Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

chore: knip fix (#34481)

Stephen Zhou36e840cd87e8
diff --git a/.vite-hooks/pre-commit b/.vite-hooks/pre-commit
index 54e09f80d6d..a4b5531ab18 100755
--- a/.vite-hooks/pre-commit
+++ b/.vite-hooks/pre-commit
@@ -89,6 +89,12 @@ if $web_modified; then
echo "No staged TypeScript changes detected, skipping type-check:tsgo"
fi
+ echo "Running knip"
+ if ! pnpm run knip; then
+ echo "Knip check failed. Please run 'pnpm run knip' to fix the errors."
+ exit 1
+ fi
+
echo "Running unit tests check"
modified_files=$(git diff --cached --name-only -- utils | grep -v '\.spec\.ts$' || true)
diff --git a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout-main.tsx b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout-main.tsx
index 0c87fd1a4df..d3f15bdf460 100644
--- a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout-main.tsx
+++ b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout-main.tsx
@@ -35,7 +35,7 @@ const TagManagementModal = dynamic(() => import('@/app/components/base/tag-manag
ssr: false,
})
-export type IAppDetailLayoutProps = {
+type IAppDetailLayoutProps = {
children: React.ReactNode
appId: string
}
diff --git a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/card-view.tsx b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/card-view.tsx
index 26373bd42ae..fb2edf0102d 100644
--- a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/card-view.tsx
+++ b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/card-view.tsx
@@ -25,7 +25,7 @@ import { useAppWorkflow } from '@/service/use-workflow'
import { AppModeEnum } from '@/types/app'
import { asyncRunSafe } from '@/utils'
-export type ICardViewProps = {
+type ICardViewProps = {
appId: string
isInPanel?: boolean
className?: string
diff --git a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/chart-view.tsx b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/chart-view.tsx
index b6e902f456e..0d33de29720 100644
--- a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/chart-view.tsx
+++ b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/chart-view.tsx
@@ -27,7 +27,7 @@ const TIME_PERIOD_MAPPING: { value: number, name: TimePeriodName }[] = [
const queryDateFormat = 'YYYY-MM-DD HH:mm'
-export type IChartViewProps = {
+type IChartViewProps = {
appId: string
headerRight: React.ReactNode
}
diff --git a/web/app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/documents/style.module.css b/web/app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/documents/style.module.css
deleted file mode 100644
index 67a9fe3bf5d..00000000000
--- a/web/app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/documents/style.module.css
+++ /dev/null
@@ -1,9 +0,0 @@
-.logTable td {
- padding: 7px 8px;
- box-sizing: border-box;
- max-width: 200px;
-}
-
-.pagination li {
- list-style: none;
-}
diff --git a/web/app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/layout-main.tsx b/web/app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/layout-main.tsx
index 730b76ee19f..092e47278f4 100644
--- a/web/app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/layout-main.tsx
+++ b/web/app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/layout-main.tsx
@@ -26,7 +26,7 @@ import { usePathname } from '@/next/navigation'
import { useDatasetDetail, useDatasetRelatedApps } from '@/service/knowledge/use-dataset'
import { cn } from '@/utils/classnames'
-export type IAppDetailLayoutProps = {
+type IAppDetailLayoutProps = {
children: React.ReactNode
datasetId: string
}
diff --git a/web/app/account/(commonLayout)/avatar.tsx b/web/app/account/(commonLayout)/avatar.tsx
index 5461ce739ca..36a510cf638 100644
--- a/web/app/account/(commonLayout)/avatar.tsx
+++ b/web/app/account/(commonLayout)/avatar.tsx
@@ -13,10 +13,6 @@ import { useProviderContext } from '@/context/provider-context'
import { useRouter } from '@/next/navigation'
import { useLogout, useUserProfile } from '@/service/use-common'
-export type IAppSelector = {
- isMobile: boolean
-}
-
export default function AppSelector() {
const router = useRouter()
const { t } = useTranslation()
diff --git a/web/app/components/app-sidebar/app-info/index.tsx b/web/app/components/app-sidebar/app-info/index.tsx
index 2530add2dca..a0628ec7861 100644
--- a/web/app/components/app-sidebar/app-info/index.tsx
+++ b/web/app/components/app-sidebar/app-info/index.tsx
@@ -5,7 +5,7 @@ import AppInfoModals from './app-info-modals'
import AppInfoTrigger from './app-info-trigger'
import { useAppInfoActions } from './use-app-info-actions'
-export type IAppInfoProps = {
+type IAppInfoProps = {
expand: boolean
onlyShowDetail?: boolean
openState?: boolean
diff --git a/web/app/components/app-sidebar/basic.tsx b/web/app/components/app-sidebar/basic.tsx
index 24746aa687e..29a08f8a01b 100644
--- a/web/app/components/app-sidebar/basic.tsx
+++ b/web/app/components/app-sidebar/basic.tsx
@@ -7,7 +7,7 @@ import {
import Tooltip from '@/app/components/base/tooltip'
import AppIcon from '../base/app-icon'
-export type IAppBasicProps = {
+type IAppBasicProps = {
iconType?: 'app' | 'api' | 'dataset' | 'webapp' | 'notion'
icon?: string
icon_background?: string | null
diff --git a/web/app/components/app-sidebar/index.tsx b/web/app/components/app-sidebar/index.tsx
index bbf71c6cf95..f86cd617e39 100644
--- a/web/app/components/app-sidebar/index.tsx
+++ b/web/app/components/app-sidebar/index.tsx
@@ -17,7 +17,7 @@ import DatasetSidebarDropdown from './dataset-sidebar-dropdown'
import NavLink from './nav-link'
import ToggleButton from './toggle-button'
-export type IAppDetailNavProps = {
+type IAppDetailNavProps = {
iconType?: 'app' | 'dataset'
navigation: Array<{
name: string
diff --git a/web/app/components/app/annotation/type.ts b/web/app/components/app/annotation/type.ts
index e2f2264f072..076ef8f9bdf 100644
--- a/web/app/components/app/annotation/type.ts
+++ b/web/app/components/app/annotation/type.ts
@@ -39,7 +39,5 @@ export enum AnnotationEnableStatus {
}
export enum JobStatus {
- waiting = 'waiting',
- processing = 'processing',
completed = 'completed',
}
diff --git a/web/app/components/app/app-publisher/suggested-action.tsx b/web/app/components/app/app-publisher/suggested-action.tsx
index 71ddceec01c..56879d8fead 100644
--- a/web/app/components/app/app-publisher/suggested-action.tsx
+++ b/web/app/components/app/app-publisher/suggested-action.tsx
@@ -2,7 +2,7 @@ import type { HTMLProps, PropsWithChildren } from 'react'
import { RiArrowRightUpLine } from '@remixicon/react'
import { cn } from '@/utils/classnames'
-export type SuggestedActionProps = PropsWithChildren<HTMLProps<HTMLAnchorElement> & {
+type SuggestedActionProps = PropsWithChildren<HTMLProps<HTMLAnchorElement> & {
icon?: React.ReactNode
link?: string
disabled?: boolean
diff --git a/web/app/components/app/configuration/base/feature-panel/index.tsx b/web/app/components/app/configuration/base/feature-panel/index.tsx
index 7f337c1572a..77ee7bc8dd4 100644
--- a/web/app/components/app/configuration/base/feature-panel/index.tsx
+++ b/web/app/components/app/configuration/base/feature-panel/index.tsx
@@ -3,7 +3,7 @@ import type { FC, ReactNode } from 'react'
import * as React from 'react'
import { cn } from '@/utils/classnames'
-export type IFeaturePanelProps = {
+type IFeaturePanelProps = {
className?: string
headerIcon?: ReactNode
title: ReactNode
diff --git a/web/app/components/app/configuration/base/group-name/index.tsx b/web/app/components/app/configuration/base/group-name/index.tsx
index b21b0c5825d..210ba4ca877 100644
--- a/web/app/components/app/configuration/base/group-name/index.tsx
+++ b/web/app/components/app/configuration/base/group-name/index.tsx
@@ -2,7 +2,7 @@
import type { FC } from 'react'
import * as React from 'react'
-export type IGroupNameProps = {
+type IGroupNameProps = {
name: string
}
diff --git a/web/app/components/app/configuration/base/operation-btn/index.tsx b/web/app/components/app/configuration/base/operation-btn/index.tsx
index d33b6320713..e3bdfd01ba4 100644
--- a/web/app/components/app/configuration/base/operation-btn/index.tsx
+++ b/web/app/components/app/configuration/base/operation-btn/index.tsx
@@ -9,7 +9,7 @@ import * as React from 'react'
import { useTranslation } from 'react-i18next'
import { cn } from '@/utils/classnames'
-export type IOperationBtnProps = {
+type IOperationBtnProps = {
className?: string
type: 'add' | 'edit'
actionName?: string
diff --git a/web/app/components/app/configuration/base/var-highlight/index.tsx b/web/app/components/app/configuration/base/var-highlight/index.tsx
index 697007d0b04..fda58f0b65a 100644
--- a/web/app/components/app/configuration/base/var-highlight/index.tsx
+++ b/web/app/components/app/configuration/base/var-highlight/index.tsx
@@ -4,7 +4,7 @@ import * as React from 'react'
import s from './style.module.css'
-export type IVarHighlightProps = {
+type IVarHighlightProps = {
name: string
className?: string
}
diff --git a/web/app/components/app/configuration/base/warning-mask/cannot-query-dataset.tsx b/web/app/components/app/configuration/base/warning-mask/cannot-query-dataset.tsx
index 791230566bc..d5fbd9e78f6 100644
--- a/web/app/components/app/configuration/base/warning-mask/cannot-query-dataset.tsx
+++ b/web/app/components/app/configuration/base/warning-mask/cannot-query-dataset.tsx
@@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next'
import Button from '@/app/components/base/button'
import WarningMask from '.'
-export type IFormattingChangedProps = {
+type IFormattingChangedProps = {
onConfirm: () => void
}
diff --git a/web/app/components/app/configuration/base/warning-mask/formatting-changed.tsx b/web/app/components/app/configuration/base/warning-mask/formatting-changed.tsx
index 1fe7b9c1822..56ccae5ade1 100644
--- a/web/app/components/app/configuration/base/warning-mask/formatting-changed.tsx
+++ b/web/app/components/app/configuration/base/warning-mask/formatting-changed.tsx
@@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next'
import Button from '@/app/components/base/button'
import WarningMask from '.'
-export type IFormattingChangedProps = {
+type IFormattingChangedProps = {
onConfirm: () => void
onCancel: () => void
}
diff --git a/web/app/components/app/configuration/base/warning-mask/has-not-set-api.tsx b/web/app/components/app/configuration/base/warning-mask/has-not-set-api.tsx
index 06c81a9f956..25587c5e581 100644
--- a/web/app/components/app/configuration/base/warning-mask/has-not-set-api.tsx
+++ b/web/app/components/app/configuration/base/warning-mask/has-not-set-api.tsx
@@ -3,7 +3,7 @@ import type { FC } from 'react'
import * as React from 'react'
import { useTranslation } from 'react-i18next'
-export type IHasNotSetAPIProps = {
+type IHasNotSetAPIProps = {
onSetting: () => void
}
diff --git a/web/app/components/app/configuration/base/warning-mask/index.tsx b/web/app/components/app/configuration/base/warning-mask/index.tsx
index 6d6aeceb97d..5275f022cb4 100644
--- a/web/app/components/app/configuration/base/warning-mask/index.tsx
+++ b/web/app/components/app/configuration/base/warning-mask/index.tsx
@@ -4,7 +4,7 @@ import * as React from 'react'
import s from './style.module.css'
-export type IWarningMaskProps = {
+type IWarningMaskProps = {
title: string
description: string
footer: React.ReactNode
diff --git a/web/app/components/app/configuration/config-prompt/confirm-add-var/index.tsx b/web/app/components/app/configuration/config-prompt/confirm-add-var/index.tsx
index c2f0cb000a7..47d9aaa4d2c 100644
--- a/web/app/components/app/configuration/config-prompt/confirm-add-var/index.tsx
+++ b/web/app/components/app/configuration/config-prompt/confirm-add-var/index.tsx
@@ -6,7 +6,7 @@ import { useTranslation } from 'react-i18next'
import Button from '@/app/components/base/button'
import VarHighlight from '../../base/var-highlight'
-export type IConfirmAddVarProps = {
+type IConfirmAddVarProps = {
varNameArr: string[]
onConfirm: () => void
onCancel: () => void
diff --git a/web/app/components/app/configuration/config-prompt/simple-prompt-input.tsx b/web/app/components/app/configuration/config-prompt/simple-prompt-input.tsx
index e5f1556cc5d..da1949af603 100644
--- a/web/app/components/app/configuration/config-prompt/simple-prompt-input.tsx
+++ b/web/app/components/app/configuration/config-prompt/simple-prompt-input.tsx
@@ -33,7 +33,7 @@ import { getNewVar, getVars } from '@/utils/var'
import ConfirmAddVar from './confirm-add-var'
import PromptEditorHeightResizeWrap from './prompt-editor-height-resize-wrap'
-export type ISimplePromptInput = {
+type ISimplePromptInput = {
mode: AppModeEnum
promptTemplate: string
promptVariables: PromptVariable[]
diff --git a/web/app/components/app/configuration/config-var/config-modal/config.ts b/web/app/components/app/configuration/config-var/config-modal/config.ts
index 6586c2fd548..e03464d4535 100644
--- a/web/app/components/app/configuration/config-var/config-modal/config.ts
+++ b/web/app/components/app/configuration/config-var/config-modal/config.ts
@@ -1,10 +1,3 @@
-export const jsonObjectWrap = {
- type: 'object',
- properties: {},
- required: [],
- additionalProperties: true,
-}
-
export const jsonConfigPlaceHolder = JSON.stringify(
{
type: 'object',
diff --git a/web/app/components/app/configuration/config-var/config-modal/index.tsx b/web/app/components/app/configuration/config-var/config-modal/index.tsx
index 31b936f3e4b..34954946761 100644
--- a/web/app/components/app/configuration/config-var/config-modal/index.tsx
+++ b/web/app/components/app/configuration/config-var/config-modal/index.tsx
@@ -52,7 +52,7 @@ const normalizeSelectDefaultValue = (inputVar: InputVar) => {
return inputVar
}
-export type IConfigModalProps = {
+type IConfigModalProps = {
isCreate?: boolean
payload?: InputVar
isShow: boolean
diff --git a/web/app/components/app/configuration/config-var/config-select/index.tsx b/web/app/components/app/configuration/config-var/config-select/index.tsx
index 847d5303753..6a5b12c417c 100644
--- a/web/app/components/app/configuration/config-var/config-select/index.tsx
+++ b/web/app/components/app/configuration/config-var/config-select/index.tsx
@@ -8,7 +8,7 @@ import { ReactSortable } from 'react-sortablejs'
import { cn } from '@/utils/classnames'
export type Options = string[]
-export type IConfigSelectProps = {
+type IConfigSelectProps = {
options: Options
onChange: (options: Options) => void
}
diff --git a/web/app/components/app/configuration/config-var/modal-foot.tsx b/web/app/components/app/configuration/config-var/modal-foot.tsx
index fbb00b72bf0..1fcaebbc0d5 100644
--- a/web/app/components/app/configuration/config-var/modal-foot.tsx
+++ b/web/app/components/app/configuration/config-var/modal-foot.tsx
@@ -4,7 +4,7 @@ import * as React from 'react'
import { useTranslation } from 'react-i18next'
import Button from '@/app/components/base/button'
-export type IModalFootProps = {
+type IModalFootProps = {
onConfirm: () => void
onCancel: () => void
}
diff --git a/web/app/components/app/configuration/config-var/select-type-item/index.tsx b/web/app/components/app/configuration/config-var/select-type-item/index.tsx
index e6ae34664ff..7385dfd4c8c 100644
--- a/web/app/components/app/configuration/config-var/select-type-item/index.tsx
+++ b/web/app/components/app/configuration/config-var/select-type-item/index.tsx
@@ -7,7 +7,7 @@ import { useTranslation } from 'react-i18next'
import InputVarTypeIcon from '@/app/components/workflow/nodes/_base/components/input-var-type-icon'
import { cn } from '@/utils/classnames'
-export type ISelectTypeItemProps = {
+type ISelectTypeItemProps = {
type: InputVarType
selected: boolean
onClick: () => void
diff --git a/web/app/components/app/configuration/config/agent/prompt-editor.tsx b/web/app/components/app/configuration/config/agent/prompt-editor.tsx
deleted file mode 100644
index e807c21518e..00000000000
--- a/web/app/components/app/configuration/config/agent/prompt-editor.tsx
+++ /dev/null
@@ -1,152 +0,0 @@
-'use client'
-import type { FC } from 'react'
-import type { ExternalDataTool } from '@/models/common'
-import copy from 'copy-to-clipboard'
-import { noop } from 'es-toolkit/function'
-import * as React from 'react'
-import { useTranslation } from 'react-i18next'
-import { useContext } from 'use-context-selector'
-import s from '@/app/components/app/configuration/config-prompt/style.module.css'
-import {
- Copy,
- CopyCheck,
-} from '@/app/components/base/icons/src/vender/line/files'
-import PromptEditor from '@/app/components/base/prompt-editor'
-import { toast } from '@/app/components/base/ui/toast'
-import ConfigContext from '@/context/debug-configuration'
-import { useModalContext } from '@/context/modal-context'
-import { cn } from '@/utils/classnames'
-
-type Props = {
- className?: string
- type: 'first-prompt' | 'next-iteration'
- value: string
- onChange: (value: string) => void
-}
-
-const Editor: FC<Props> = ({
- className,
- type,
- value,
- onChange,
-}) => {
- const { t } = useTranslation()
-
- const [isCopied, setIsCopied] = React.useState(false)
- const {
- modelConfig,
- hasSetBlockStatus,
- dataSets,
- showSelectDataSet,
- externalDataToolsConfig,
- setExternalDataToolsConfig,
- } = useContext(ConfigContext)
- const promptVariables = modelConfig.configs.prompt_variables
- const { setShowExternalDataToolModal } = useModalContext()
- const isFirstPrompt = type === 'first-prompt'
- const editorHeight = isFirstPrompt ? 'h-[336px]' : 'h-[52px]'
-
- const handleOpenExternalDataToolModal = () => {
- setShowExternalDataToolModal({
- payload: {},
- onSaveCallback: (newExternalDataTool?: ExternalDataTool) => {
- if (!newExternalDataTool)
- return
- setExternalDataToolsConfig([...externalDataToolsConfig, newExternalDataTool])
- },
- onValidateBeforeSaveCallback: (newExternalDataTool: ExternalDataTool) => {
- for (let i = 0; i < promptVariables.length; i++) {
- if (promptVariables[i].key === newExternalDataTool.variable) {
- toast.error(t('varKeyError.keyAlreadyExists', { ns: 'appDebug', key: promptVariables[i].key }))
- return false
- }
- }
-
- for (let i = 0; i < externalDataToolsConfig.length; i++) {
- if (externalDataToolsConfig[i].variable === newExternalDataTool.variable) {
- toast.error(t('varKeyError.keyAlreadyExists', { ns: 'appDebug', key: externalDataToolsConfig[i].variable }))
- return false
- }
- }
-
- return true
- },
- })
- }
- return (
- <div className={cn(className, s.gradientBorder, 'relative')}>
- <div className="rounded-xl bg-white">
- <div className={cn(s.boxHeader, 'flex h-11 items-center justify-between rounded-tl-xl rounded-tr-xl bg-white pb-1 pl-4 pr-3 pt-2 hover:shadow-xs')}>
- <div className="text-sm font-semibold uppercase text-indigo-800">{t(`agent.${isFirstPrompt ? 'firstPrompt' : 'nextIteration'}`, { ns: 'appDebug' })}</div>
- <div className={cn(s.optionWrap, 'items-center space-x-1')}>
- {!isCopied
- ? (
- <Copy
- className="h-6 w-6 cursor-pointer p-1 text-gray-500"
- onClick={() => {
- copy(value)
- setIsCopied(true)
- }}
- />
- )
- : (
- <CopyCheck className="h-6 w-6 p-1 text-gray-500" />
- )}
- </div>
- </div>
- <div className={cn(editorHeight, 'min-h-[102px] overflow-y-auto px-4 text-sm text-gray-700')}>
- <PromptEditor
- className={editorHeight}
- value={value}
- contextBlock={{
- show: true,
- selectable: !hasSetBlockStatus.context,
- datasets: dataSets.map(item => ({
- id: item.id,
- name: item.name,
- type: item.data_source_type,
- })),
- onAddContext: showSelectDataSet,
- }}
- variableBlock={{
- show: true,
- variables: modelConfig.configs.prompt_variables.filter(item => item.key && item.key.trim() && item.name && item.name.trim()).map(item => ({
- name: item.name,
- value: item.key,
- })),
- }}
- externalToolBlock={{
- show: true,
- externalTools: externalDataToolsConfig.map(item => ({
- name: item.label!,
- variableName: item.variable!,
- icon: item.icon,
- icon_background: item.icon_background,
- })),
- onAddExternalTool: handleOpenExternalDataToolModal,
- }}
- historyBlock={{
- show: false,
- selectable: false,
- history: {
- user: '',
- assistant: '',
- },
- onEditRole: noop,
- }}
- queryBlock={{
- show: false,
- selectable: false,
- }}
- onChange={onChange}
- onBlur={noop}
- />
- </div>
- <div className="flex pb-2 pl-4">
- <div className="h-[18px] rounded-md bg-gray-100 px-1 text-xs leading-[18px] text-gray-500">{value.length}</div>
- </div>
- </div>
- </div>
- )
-}
-export default React.memo(Editor)
diff --git a/web/app/components/app/configuration/config/automatic/automatic-btn.tsx b/web/app/components/app/configuration/config/automatic/automatic-btn.tsx
index 49d9bc4cc16..7999ba87af7 100644
--- a/web/app/components/app/configuration/config/automatic/automatic-btn.tsx
+++ b/web/app/components/app/configuration/config/automatic/automatic-btn.tsx
@@ -7,7 +7,7 @@ import * as React from 'react'
import { useTranslation } from 'react-i18next'
import Button from '@/app/components/base/button'
-export type IAutomaticBtnProps = {
+type IAutomaticBtnProps = {
onClick: () => void
}
const AutomaticBtn: FC<IAutomaticBtnProps> = ({
diff --git a/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx b/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx
index a2ca99a9d05..d2522e875e3 100644
--- a/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx
+++ b/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx
@@ -43,7 +43,7 @@ import useGenData from './use-gen-data'
const i18nPrefix = 'generate'
-export type IGetAutomaticResProps = {
+type IGetAutomaticResProps = {
mode: AppModeEnum
isShow: boolean
onClose: () => void
diff --git a/web/app/components/app/configuration/config/code-generator/get-code-generator-res.tsx b/web/app/components/app/configuration/config/code-generator/get-code-generator-res.tsx
index 4c7971dc1d9..2d6b3efb3d4 100644
--- a/web/app/components/app/configuration/config/code-generator/get-code-generator-res.tsx
+++ b/web/app/components/app/configuration/config/code-generator/get-code-generator-res.tsx
@@ -31,7 +31,7 @@ import { GeneratorType } from '../automatic/types'
import useGenData from '../automatic/use-gen-data'
const i18nPrefix = 'generate'
-export type IGetCodeGeneratorResProps = {
+type IGetCodeGeneratorResProps = {
flowId: string
nodeId: string
currentCode?: string
diff --git a/web/app/components/app/configuration/ctrl-btn-group/index.tsx b/web/app/components/app/configuration/ctrl-btn-group/index.tsx
index ff8576cc432..53a07a9b1d3 100644
--- a/web/app/components/app/configuration/ctrl-btn-group/index.tsx
+++ b/web/app/components/app/configuration/ctrl-btn-group/index.tsx
@@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next'
import Button from '@/app/components/base/button'
import s from './style.module.css'
-export type IContrlBtnGroupProps = {
+type IContrlBtnGroupProps = {
onSave: () => void
onReset: () => void
}
diff --git a/web/app/components/app/configuration/dataset-config/select-dataset/index.tsx b/web/app/components/app/configuration/dataset-config/select-dataset/index.tsx
index dd69774b2b0..5fc594dc6bf 100644
--- a/web/app/components/app/configuration/dataset-config/select-dataset/index.tsx
+++ b/web/app/components/app/configuration/dataset-config/select-dataset/index.tsx
@@ -17,7 +17,7 @@ import Link from '@/next/link'
import { useInfiniteDatasets } from '@/service/knowledge/use-dataset'
import { cn } from '@/utils/classnames'
-export type ISelectDataSetProps = {
+type ISelectDataSetProps = {
isShow: boolean
onClose: () => void
selectedIds: string[]
diff --git a/web/app/components/app/configuration/debug/debug-with-multiple-model/context.ts b/web/app/components/app/configuration/debug/debug-with-multiple-model/context.ts
index e3ad06f1b92..9e760672348 100644
--- a/web/app/components/app/configuration/debug/debug-with-multiple-model/context.ts
+++ b/web/app/components/app/configuration/debug/debug-with-multiple-model/context.ts
@@ -18,5 +18,3 @@ export const DebugWithMultipleModelContext = createContext<DebugWithMultipleMode
})
export const useDebugWithMultipleModelContext = () => useContext(DebugWithMultipleModelContext)
-
-export default DebugWithMultipleModelContext
diff --git a/web/app/components/app/configuration/style.module.css b/web/app/components/app/configuration/style.module.css
deleted file mode 100644
index 01f2c93167a..00000000000
--- a/web/app/components/app/configuration/style.module.css
+++ /dev/null
@@ -1,14 +0,0 @@
-.advancedPromptMode {
- position: relative;
-}
-
-.advancedPromptMode::before {
- content: '';
- position: absolute;
- bottom: 0;
- left: -1px;
- width: 100%;
- height: 3px;
- background-color: rgba(68, 76, 231, 0.18);
- transform: skewX(-30deg);
-}
diff --git a/web/app/components/app/configuration/tools/index.tsx b/web/app/components/app/configuration/tools/index.tsx
deleted file mode 100644
index 2b4511a0c64..00000000000
--- a/web/app/components/app/configuration/tools/index.tsx
+++ /dev/null
@@ -1,204 +0,0 @@
-import type { ExternalDataTool } from '@/models/common'
-import {
- RiAddLine,
- RiArrowDownSLine,
- RiDeleteBinLine,
-} from '@remixicon/react'
-import copy from 'copy-to-clipboard'
-import { useState } from 'react'
-import { useTranslation } from 'react-i18next'
-import { useContext } from 'use-context-selector'
-import AppIcon from '@/app/components/base/app-icon'
-import {
- Settings01,
-} from '@/app/components/base/icons/src/vender/line/general'
-import { Tool03 } from '@/app/components/base/icons/src/vender/solid/general'
-import Switch from '@/app/components/base/switch'
-import { toast } from '@/app/components/base/ui/toast'
-import {
- Tooltip,
- TooltipContent,
- TooltipTrigger,
-} from '@/app/components/base/ui/tooltip'
-import ConfigContext from '@/context/debug-configuration'
-import { useModalContext } from '@/context/modal-context'
-
-const Tools = () => {
- const { t } = useTranslation()
- const { setShowExternalDataToolModal } = useModalContext()
- const {
- externalDataToolsConfig,
- setExternalDataToolsConfig,
- modelConfig,
- } = useContext(ConfigContext)
- const [expanded, setExpanded] = useState(true)
- const [copied, setCopied] = useState(false)
-
- const handleSaveExternalDataToolModal = (externalDataTool: ExternalDataTool, index: number) => {
- if (index > -1) {
- setExternalDataToolsConfig([
- ...externalDataToolsConfig.slice(0, index),
- externalDataTool,
- ...externalDataToolsConfig.slice(index + 1),
- ])
- }
- else {
- setExternalDataToolsConfig([...externalDataToolsConfig, externalDataTool])
- }
- }
- const handleValidateBeforeSaveExternalDataToolModal = (newExternalDataTool: ExternalDataTool, index: number) => {
- const promptVariables = modelConfig?.configs?.prompt_variables || []
- for (let i = 0; i < promptVariables.length; i++) {
- if (promptVariables[i].key === newExternalDataTool.variable) {
- toast.error(t('varKeyError.keyAlreadyExists', { ns: 'appDebug', key: promptVariables[i].key }))
- return false
- }
- }
-
- let existedExternalDataTools = []
- if (index > -1) {
- existedExternalDataTools = [
- ...externalDataToolsConfig.slice(0, index),
- ...externalDataToolsConfig.slice(index + 1),
- ]
- }
- else {
- existedExternalDataTools = [...externalDataToolsConfig]
- }
-
- for (let i = 0; i < existedExternalDataTools.length; i++) {
- if (existedExternalDataTools[i].variable === newExternalDataTool.variable) {
- toast.error(t('varKeyError.keyAlreadyExists', { ns: 'appDebug', key: existedExternalDataTools[i].variable }))
- return false
- }
- }
-
- return true
- }
- const handleOpenExternalDataToolModal = (payload: ExternalDataTool, index: number) => {
- setShowExternalDataToolModal({
- payload,
- onSaveCallback: (externalDataTool?: ExternalDataTool) => {
- if (!externalDataTool)
- return
- handleSaveExternalDataToolModal(externalDataTool, index)
- },
- onValidateBeforeSaveCallback: (newExternalDataTool: ExternalDataTool) => handleValidateBeforeSaveExternalDataToolModal(newExternalDataTool, index),
- })
- }
-
- return (
- <div className="mt-3 rounded-xl bg-gray-50 px-3">
- <div className="flex h-12 items-center">
- <div className="flex grow items-center">
- <div
- className={`
- group mr-1 flex h-6 w-6 items-center justify-center rounded-md
- ${externalDataToolsConfig.length && 'hover:bg-white hover:shadow-xs'}
- `}
- onClick={() => setExpanded(v => !v)}
- >
- {
- externalDataToolsConfig.length
- ? <Tool03 className="h-4 w-4 text-[#444CE7] group-hover:hidden" />
- : <Tool03 className="h-4 w-4 text-[#444CE7]" />
- }
- {
- !!externalDataToolsConfig.length && (
- <RiArrowDownSLine className={`hidden h-4 w-4 cursor-pointer text-primary-600 group-hover:block ${expanded ? 'rotate-180' : 'rotate-0'}`} />
- )
- }
- </div>
- <div className="mr-1 text-sm font-semibold text-gray-800">
- {t('feature.tools.title', { ns: 'appDebug' })}
- </div>
- <Tooltip>
- <TooltipTrigger render={<span className="i-ri-question-line ml-1 h-4 w-4 shrink-0 text-text-quaternary" />} />
- <TooltipContent>
- <div className="max-w-[160px]">
- {t('feature.tools.tips', { ns: 'appDebug' })}
- </div>
- </TooltipContent>
- </Tooltip>
- </div>
- {
- !expanded && !!externalDataToolsConfig.length && (
- <>
- <div className="mr-3 text-xs text-gray-500">{t('feature.tools.toolsInUse', { ns: 'appDebug', count: externalDataToolsConfig.length })}</div>
- <div className="mr-1 h-3.5 w-px bg-gray-200" />
- </>
- )
- }
- <div
- className="flex h-7 cursor-pointer items-center px-3 text-xs font-medium text-gray-700"
- onClick={() => handleOpenExternalDataToolModal({}, -1)}
- >
- <RiAddLine className="mr-[5px] h-3.5 w-3.5" />
- {t('operation.add', { ns: 'common' })}
- </div>
- </div>
- {
- expanded && !!externalDataToolsConfig.length && (
- <div className="pb-3">
- {
- externalDataToolsConfig.map((item, index: number) => (
- <div
- key={`${index}-${item.type}-${item.label}-${item.variable}`}
- className="group mb-1 flex items-center rounded-lg border-[0.5px] border-gray-200 bg-white px-2.5 py-2 shadow-xs last-of-type:mb-0"
- >
- <div className="flex grow items-center">
- <AppIcon
- size="large"
- className="mr-2 h-6! w-6! rounded-md border-[0.5px] border-black/5"
- icon={item.icon}
- background={item.icon_background}
- />
- <div className="mr-2 text-[13px] font-medium text-gray-800">{item.label}</div>
- <Tooltip>
- <TooltipTrigger
- render={(
- <div
- className="text-xs text-gray-500"
- onClick={() => {
- copy(item.variable || '')
- setCopied(true)
- }}
- >
- {item.variable}
- </div>
- )}
- />
- <TooltipContent>
- {copied ? t('copied', { ns: 'appApi' }) : `${item.variable}, ${t('copy', { ns: 'appApi' })}`}
- </TooltipContent>
- </Tooltip>
- </div>
- <div
- className="mr-1 hidden h-6 w-6 cursor-pointer items-center justify-center rounded-md hover:bg-black/5 group-hover:flex"
- onClick={() => handleOpenExternalDataToolModal(item, index)}
- >
- <Settings01 className="h-4 w-4 text-gray-500" />
- </div>
- <div
- className="group/action hidden h-6 w-6 cursor-pointer items-center justify-center rounded-md hover:bg-[#FEE4E2] group-hover:flex"
- onClick={() => setExternalDataToolsConfig([...externalDataToolsConfig.slice(0, index), ...externalDataToolsConfig.slice(index + 1)])}
- >
- <RiDeleteBinLine className="h-4 w-4 text-gray-500 group-hover/action:text-[#D92D20]" />
- </div>
- <div className="ml-2 mr-3 hidden h-3.5 w-px bg-gray-200 group-hover:block" />
- <Switch
- size="lg"
- value={item.enabled ?? false}
- onChange={(enabled: boolean) => handleSaveExternalDataToolModal({ ...item, enabled }, index)}
- />
- </div>
- ))
- }
- </div>
- )
- }
- </div>
- )
-}
-
-export default Tools
diff --git a/web/app/components/app/create-app-dialog/app-card/index.tsx b/web/app/components/app/create-app-dialog/app-card/index.tsx
index 8afb5cbf4b2..f0633288fd0 100644
--- a/web/app/components/app/create-app-dialog/app-card/index.tsx
+++ b/web/app/components/app/create-app-dialog/app-card/index.tsx
@@ -12,7 +12,7 @@ import { useGlobalPublicStore } from '@/context/global-public-context'
import { cn } from '@/utils/classnames'
import { AppTypeIcon, AppTypeLabel } from '../../type-selector'
-export type AppCardProps = {
+type AppCardProps = {
app: App
canCreate: boolean
onCreate: () => void
diff --git a/web/app/components/app/create-from-dsl-modal/uploader.tsx b/web/app/components/app/create-from-dsl-modal/uploader.tsx
index e376d04a9fa..7480da4b5f7 100644
--- a/web/app/components/app/create-from-dsl-modal/uploader.tsx
+++ b/web/app/components/app/create-from-dsl-modal/uploader.tsx
@@ -13,7 +13,7 @@ import { toast } from '@/app/components/base/ui/toast'
import { cn } from '@/utils/classnames'
import { formatFileSize } from '@/utils/format'
-export type Props = {
+type Props = {
file: File | undefined
updateFile: (file?: File) => void
className?: string
diff --git a/web/app/components/app/log/index.tsx b/web/app/components/app/log/index.tsx
index 59f454f754a..c30cf6cf510 100644
--- a/web/app/components/app/log/index.tsx
+++ b/web/app/components/app/log/index.tsx
@@ -17,7 +17,7 @@ import EmptyElement from './empty-element'
import Filter, { TIME_PERIOD_MAPPING } from './filter'
import List from './list'
-export type ILogsProps = {
+type ILogsProps = {
appDetail: App
}
diff --git a/web/app/components/app/overview/apikey-info-panel/apikey-info-panel.test-utils.tsx b/web/app/components/app/overview/apikey-info-panel/apikey-info-panel.test-utils.tsx
index 54763907df8..4bab54b7110 100644
--- a/web/app/components/app/overview/apikey-info-panel/apikey-info-panel.test-utils.tsx
+++ b/web/app/components/app/overview/apikey-info-panel/apikey-info-panel.test-utils.tsx
@@ -72,17 +72,17 @@ const defaultModalContext: ModalContextState = {
setShowTriggerEventsLimitModal: noop,
}
-export type MockOverrides = {
+type MockOverrides = {
providerContext?: Partial<typeof defaultProviderContext>
modalContext?: Partial<typeof defaultModalContext>
}
-export type APIKeyInfoPanelRenderOptions = {
+type APIKeyInfoPanelRenderOptions = {
mockOverrides?: MockOverrides
} & Omit<RenderOptions, 'wrapper'>
// Setup function to configure mocks
-export function setupMocks(overrides: MockOverrides = {}) {
+function setupMocks(overrides: MockOverrides = {}) {
mockUseProviderContext.mockReturnValue({
...defaultProviderContext,
...overrides.providerContext,
@@ -95,7 +95,7 @@ export function setupMocks(overrides: MockOverrides = {}) {
}
// Custom render function
-export function renderAPIKeyInfoPanel(options: APIKeyInfoPanelRenderOptions = {}) {
+function renderAPIKeyInfoPanel(options: APIKeyInfoPanelRenderOptions = {}) {
const { mockOverrides, ...renderOptions } = options
setupMocks(mockOverrides)
@@ -210,4 +210,4 @@ export function clearAllMocks() {
}
// Export mock functions for external access
-export { defaultModalContext, mockUseModalContext, mockUseProviderContext }
+export { defaultModalContext, mockUseModalContext }
diff --git a/web/app/components/app/overview/app-chart.tsx b/web/app/components/app/overview/app-chart.tsx
index 028753d41ca..7ea94024ff5 100644
--- a/web/app/components/app/overview/app-chart.tsx
+++ b/web/app/components/app/overview/app-chart.tsx
@@ -102,12 +102,12 @@ export type PeriodParamsWithTimeRange = {
query?: TimeRange
}
-export type IBizChartProps = {
+type IBizChartProps = {
period: PeriodParams
id: string
}
-export type IChartProps = {
+type IChartProps = {
className?: string
basicInfo: { title: string, explanation: string, timePeriod: string }
valueKey?: string
@@ -508,5 +508,3 @@ export const AvgUserInteractions: FC<IBizChartProps> = ({ id, period }) => {
/>
)
}
-
-export default Chart
diff --git a/web/app/components/app/overview/settings/index.tsx b/web/app/components/app/overview/settings/index.tsx
index db880839c98..cd50e7f8eeb 100644
--- a/web/app/components/app/overview/settings/index.tsx
+++ b/web/app/components/app/overview/settings/index.tsx
@@ -29,7 +29,7 @@ import Link from '@/next/link'
import { AppModeEnum } from '@/types/app'
import { cn } from '@/utils/classnames'
-export type ISettingsModalProps = {
+type ISettingsModalProps = {
isChat: boolean
appInfo: AppDetailResponse & Partial<AppSSO>
isShow: boolean
diff --git a/web/app/components/app/overview/trigger-card.tsx b/web/app/components/app/overview/trigger-card.tsx
index 11f08cf994a..53301a353a5 100644
--- a/web/app/components/app/overview/trigger-card.tsx
+++ b/web/app/components/app/overview/trigger-card.tsx
@@ -22,7 +22,7 @@ import {
import { useAllTriggerPlugins } from '@/service/use-triggers'
import { canFindTool } from '@/utils'
-export type ITriggerCardProps = {
+type ITriggerCardProps = {
appInfo: AppDetailResponse & Partial<AppSSO>
onToggleResult?: (err: Error | null, message?: I18nKeysByPrefix<'common', 'actionMsg.'>) => void
}
diff --git a/web/app/components/app/text-generate/item/index.tsx b/web/app/components/app/text-generate/item/index.tsx
index 62f1e5752ef..88599a5ef1b 100644
--- a/web/app/components/app/text-generate/item/index.tsx
+++ b/web/app/components/app/text-generate/item/index.tsx
@@ -38,7 +38,7 @@ import ResultTab from './result-tab'
const MAX_DEPTH = 3
-export type IGenerationItemProps = {
+type IGenerationItemProps = {
isWorkflow?: boolean
workflowProcessData?: WorkflowProcess
className?: string
@@ -67,12 +67,6 @@ export type IGenerationItemProps = {
inSidePanel?: boolean
}
-export const copyIcon = (
- <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
- <path d="M9.3335 2.33341C9.87598 2.33341 10.1472 2.33341 10.3698 2.39304C10.9737 2.55486 11.4454 3.02657 11.6072 3.63048C11.6668 3.85302 11.6668 4.12426 11.6668 4.66675V10.0334C11.6668 11.0135 11.6668 11.5036 11.4761 11.8779C11.3083 12.2072 11.0406 12.4749 10.7113 12.6427C10.337 12.8334 9.84692 12.8334 8.86683 12.8334H5.1335C4.1534 12.8334 3.66336 12.8334 3.28901 12.6427C2.95973 12.4749 2.69201 12.2072 2.52423 11.8779C2.3335 11.5036 2.3335 11.0135 2.3335 10.0334V4.66675C2.3335 4.12426 2.3335 3.85302 2.39313 3.63048C2.55494 3.02657 3.02665 2.55486 3.63056 2.39304C3.8531 2.33341 4.12435 2.33341 4.66683 2.33341M5.60016 3.50008H8.40016C8.72686 3.50008 8.89021 3.50008 9.01499 3.4365C9.12475 3.38058 9.21399 3.29134 9.26992 3.18158C9.3335 3.05679 9.3335 2.89345 9.3335 2.56675V2.10008C9.3335 1.77338 9.3335 1.61004 9.26992 1.48525C9.21399 1.37549 9.12475 1.28625 9.01499 1.23033C8.89021 1.16675 8.72686 1.16675 8.40016 1.16675H5.60016C5.27347 1.16675 5.11012 1.16675 4.98534 1.23033C4.87557 1.28625 4.78634 1.37549 4.73041 1.48525C4.66683 1.61004 4.66683 1.77338 4.66683 2.10008V2.56675C4.66683 2.89345 4.66683 3.05679 4.73041 3.18158C4.78634 3.29134 4.87557 3.38058 4.98534 3.4365C5.11012 3.50008 5.27347 3.50008 5.60016 3.50008Z" stroke="#344054" strokeWidth="1.25" strokeLinecap="round" strokeLinejoin="round" />
- </svg>
-)
-
const GenerationItem: FC<IGenerationItemProps> = ({
isWorkflow,
workflowProcessData,
diff --git a/web/app/components/app/text-generate/saved-items/no-data/index.tsx b/web/app/components/app/text-generate/saved-items/no-data/index.tsx
index e73a1db1df4..c6596c8ec35 100644
--- a/web/app/components/app/text-generate/saved-items/no-data/index.tsx
+++ b/web/app/components/app/text-generate/saved-items/no-data/index.tsx
@@ -8,7 +8,7 @@ import * as React from 'react'
import { useTranslation } from 'react-i18next'
import Button from '@/app/components/base/button'
-export type INoDataProps = {
+type INoDataProps = {
onStartCreateContent: () => void
}
diff --git a/web/app/components/app/type-selector/index.tsx b/web/app/components/app/type-selector/index.tsx
index 2b0923a6a01..cb4db155d42 100644
--- a/web/app/components/app/type-selector/index.tsx
+++ b/web/app/components/app/type-selector/index.tsx
@@ -11,7 +11,7 @@ import {
import { AppModeEnum } from '@/types/app'
import { cn } from '@/utils/classnames'
-export type AppSelectorProps = {
+type AppSelectorProps = {
value: Array<AppModeEnum>
onChange: (value: AppSelectorProps['value']) => void
}
diff --git a/web/app/components/apps/app-card.tsx b/web/app/components/apps/app-card.tsx
index 079e8fa8bc0..7227e412e73 100644
--- a/web/app/components/apps/app-card.tsx
+++ b/web/app/components/apps/app-card.tsx
@@ -62,7 +62,7 @@ const AccessControl = dynamic(() => import('@/app/components/app/app-access-cont
ssr: false,
})
-export type AppCardProps = {
+type AppCardProps = {
app: App
onRefresh?: () => void
}
diff --git a/web/app/components/apps/new-app-card.tsx b/web/app/components/apps/new-app-card.tsx
index 7741190b8ce..31a374f6f7a 100644
--- a/web/app/components/apps/new-app-card.tsx
+++ b/web/app/components/apps/new-app-card.tsx
@@ -25,7 +25,7 @@ const CreateFromDSLModal = dynamic(() => import('@/app/components/app/create-fro
ssr: false,
})
-export type CreateAppCardProps = {
+type CreateAppCardProps = {
className?: string
isLoading?: boolean
onSuccess?: () => void
diff --git a/web/app/components/base/agent-log-modal/detail.tsx b/web/app/components/base/agent-log-modal/detail.tsx
index 6550b305f87..45f34c97111 100644
--- a/web/app/components/base/agent-log-modal/detail.tsx
+++ b/web/app/components/base/agent-log-modal/detail.tsx
@@ -15,7 +15,7 @@ import { cn } from '@/utils/classnames'
import ResultPanel from './result'
import TracingPanel from './tracing'
-export type AgentLogDetailProps = {
+type AgentLogDetailProps = {
activeTab?: 'DETAIL' | 'TRACING'
conversationID: string
log: IChatItem
diff --git a/web/app/components/base/amplitude/index.ts b/web/app/components/base/amplitude/index.ts
index 44cbf728e22..21152d12202 100644
--- a/web/app/components/base/amplitude/index.ts
+++ b/web/app/components/base/amplitude/index.ts
@@ -1,2 +1,2 @@
export { default } from './lazy-amplitude-provider'
-export { resetUser, setUserId, setUserProperties, trackEvent } from './utils'
+export { setUserId, setUserProperties, trackEvent } from './utils'
diff --git a/web/app/components/base/answer-icon/index.tsx b/web/app/components/base/answer-icon/index.tsx
index 56e932ad712..1ae1b4f0766 100644
--- a/web/app/components/base/answer-icon/index.tsx
+++ b/web/app/components/base/answer-icon/index.tsx
@@ -8,7 +8,7 @@ import { cn } from '@/utils/classnames'
init({ data })
-export type AnswerIconProps = {
+type AnswerIconProps = {
iconType?: AppIconType | null
icon?: string | null
background?: string | null
diff --git a/web/app/components/base/app-icon/index.tsx b/web/app/components/base/app-icon/index.tsx
index b3fe5f3c4f0..d4eaeb69d96 100644
--- a/web/app/components/base/app-icon/index.tsx
+++ b/web/app/components/base/app-icon/index.tsx
@@ -12,7 +12,7 @@ import { cn } from '@/utils/classnames'
init({ data })
-export type AppIconProps = {
+type AppIconProps = {
size?: 'xs' | 'tiny' | 'small' | 'medium' | 'large' | 'xl' | 'xxl'
rounded?: boolean
iconType?: AppIconType | null
diff --git a/web/app/components/base/auto-height-textarea/style.module.scss b/web/app/components/base/auto-height-textarea/style.module.scss
deleted file mode 100644
index e69de29bb2d..00000000000
diff --git a/web/app/components/base/avatar/index.tsx b/web/app/components/base/avatar/index.tsx
index f53e1f8985c..885022ddedc 100644
--- a/web/app/components/base/avatar/index.tsx
+++ b/web/app/components/base/avatar/index.tsx
@@ -24,11 +24,11 @@ export type AvatarProps = {
onLoadingStatusChange?: (status: ImageLoadingStatus) => void
}
-export type AvatarRootProps = React.ComponentPropsWithRef<typeof BaseAvatar.Root> & {
+type AvatarRootProps = React.ComponentPropsWithRef<typeof BaseAvatar.Root> & {
size?: AvatarSize
}
-export function AvatarRoot({
+function AvatarRoot({
size = 'md',
className,
...props
@@ -45,9 +45,9 @@ export function AvatarRoot({
)
}
-export type AvatarImageProps = React.ComponentPropsWithRef<typeof BaseAvatar.Image>
+type AvatarImageProps = React.ComponentPropsWithRef<typeof BaseAvatar.Image>
-export function AvatarImage({
+function AvatarImage({
className,
...props
}: AvatarImageProps) {
@@ -59,11 +59,11 @@ export function AvatarImage({
)
}
-export type AvatarFallbackProps = React.ComponentPropsWithRef<typeof BaseAvatar.Fallback> & {
+type AvatarFallbackProps = React.ComponentPropsWithRef<typeof BaseAvatar.Fallback> & {
size?: AvatarSize
}
-export function AvatarFallback({
+function AvatarFallback({
size = 'md',
className,
...props
diff --git a/web/app/components/base/block-input/index.tsx b/web/app/components/base/block-input/index.tsx
index 2a917306cdf..cf832d9f94b 100644
--- a/web/app/components/base/block-input/index.tsx
+++ b/web/app/components/base/block-input/index.tsx
@@ -29,7 +29,7 @@ export const getInputKeys = (value: string) => {
return res
}
-export type IBlockInputProps = {
+type IBlockInputProps = {
value: string
className?: string // wrapper class
highLightClassName?: string // class for the highlighted text default is text-blue-500
diff --git a/web/app/components/base/chat/chat-with-history/index.tsx b/web/app/components/base/chat/chat-with-history/index.tsx
index a6457759652..562502a573a 100644
--- a/web/app/components/base/chat/chat-with-history/index.tsx
+++ b/web/app/components/base/chat/chat-with-history/index.tsx
@@ -97,7 +97,7 @@ const ChatWithHistory: FC<ChatWithHistoryProps> = ({
)
}
-export type ChatWithHistoryWrapProps = {
+type ChatWithHistoryWrapProps = {
installedAppInfo?: InstalledApp
className?: string
}
diff --git a/web/app/components/base/chat/chat-with-history/sidebar/rename-modal.tsx b/web/app/components/base/chat/chat-with-history/sidebar/rename-modal.tsx
index 66a5ad6a36e..e66ca351f2a 100644
--- a/web/app/components/base/chat/chat-with-history/sidebar/rename-modal.tsx
+++ b/web/app/components/base/chat/chat-with-history/sidebar/rename-modal.tsx
@@ -7,7 +7,7 @@ import Button from '@/app/components/base/button'
import Input from '@/app/components/base/input'
import Modal from '@/app/components/base/modal'
-export type IRenameModalProps = {
+type IRenameModalProps = {
isShow: boolean
saveLoading: boolean
name: string
diff --git a/web/app/components/base/chat/chat/context.ts b/web/app/components/base/chat/chat/context.ts
index ff0bd263366..c4fbf9dd3e5 100644
--- a/web/app/components/base/chat/chat/context.ts
+++ b/web/app/components/base/chat/chat/context.ts
@@ -26,5 +26,3 @@ export const ChatContext = createContext<ChatContextValue>({
})
export const useChatContext = () => useContext(ChatContext)
-
-export default ChatContext
diff --git a/web/app/components/base/chat/chat/loading-anim/index.tsx b/web/app/components/base/chat/chat/loading-anim/index.tsx
index 74cc3444de2..6ba37288e7a 100644
--- a/web/app/components/base/chat/chat/loading-anim/index.tsx
+++ b/web/app/components/base/chat/chat/loading-anim/index.tsx
@@ -4,7 +4,7 @@ import * as React from 'react'
import { cn } from '@/utils/classnames'
import s from './style.module.css'
-export type ILoadingAnimProps = {
+type ILoadingAnimProps = {
type: 'text' | 'avatar'
}
diff --git a/web/app/components/base/chat/chat/type.ts b/web/app/components/base/chat/chat/type.ts
index 7bd4de5b058..6ddb4f958ee 100644
--- a/web/app/components/base/chat/chat/type.ts
+++ b/web/app/components/base/chat/chat/type.ts
@@ -29,8 +29,6 @@ export type SubmitAnnotationFunc = (
content: string,
) => Promise<any>
-export type DisplayScene = 'web' | 'console'
-
export type ToolInfoInThought = {
name: string
label: string
@@ -151,15 +149,6 @@ export type MessageReplace = {
conversation_id: string
}
-export type AnnotationReply = {
- id: string
- task_id: string
- answer: string
- conversation_id: string
- annotation_id: string
- annotation_author_name: string
-}
-
export type InputForm = {
type: InputVarType
label: string
diff --git a/web/app/components/base/chat/embedded-chatbot/header/index.tsx b/web/app/components/base/chat/embedded-chatbot/header/index.tsx
index 9cca48b42ac..7b1fb46fa0f 100644
--- a/web/app/components/base/chat/embedded-chatbot/header/index.tsx
+++ b/web/app/components/base/chat/embedded-chatbot/header/index.tsx
@@ -16,7 +16,7 @@ import {
} from '../context'
import { CssTransform } from '../theme/utils'
-export type IHeaderProps = {
+type IHeaderProps = {
isMobile?: boolean
allowResetChat?: boolean
customerIcon?: React.ReactNode
diff --git a/web/app/components/base/chat/types.ts b/web/app/components/base/chat/types.ts
index 1502a32e928..341dd3c6890 100644
--- a/web/app/components/base/chat/types.ts
+++ b/web/app/components/base/chat/types.ts
@@ -3,41 +3,15 @@ import type { FileEntity } from '@/app/components/base/file-uploader/types'
import type { WorkflowRunningStatus } from '@/app/components/workflow/types'
import type {
ModelConfig,
- VisionSettings,
} from '@/types/app'
import type { HumanInputFilledFormData, HumanInputFormData, NodeTracing } from '@/types/workflow'
export type {
Inputs,
- PromptVariable,
-} from '@/models/debug'
-export type { VisionFile } from '@/types/app'
-export { TransferMethod } from '@/types/app'
-
-export type UserInputForm = {
- default: string
- label: string
- required: boolean
- variable: string
-}
-
-export type UserInputFormTextInput = {
- 'text-input': UserInputForm & {
- max_length: number
- }
-}
-export type UserInputFormSelect = {
- select: UserInputForm & {
- options: string[]
- }
-}
-
-export type UserInputFormParagraph = {
- paragraph: UserInputForm
-}
+} from '@/models/debug'
-export type VisionConfig = VisionSettings
+export { TransferMethod } from '@/types/app'
export type EnableType = {
enabled: boolean
diff --git a/web/app/components/base/checkbox-list/index.tsx b/web/app/components/base/checkbox-list/index.tsx
index 6eda2aebd0f..5fb5ca60282 100644
--- a/web/app/components/base/checkbox-list/index.tsx
+++ b/web/app/components/base/checkbox-list/index.tsx
@@ -9,13 +9,13 @@ import SearchMenu from '@/assets/search-menu.svg'
import { cn } from '@/utils/classnames'
import Button from '../button'
-export type CheckboxListOption = {
+type CheckboxListOption = {
label: string
value: string
disabled?: boolean
}
-export type CheckboxListProps = {
+type CheckboxListProps = {
title?: string
label?: string
description?: string
diff --git a/web/app/components/base/date-and-time-picker/calendar/days-of-week.tsx b/web/app/components/base/date-and-time-picker/calendar/days-of-week.tsx
index ac14d49ead4..46670b27b33 100644
--- a/web/app/components/base/date-and-time-picker/calendar/days-of-week.tsx
+++ b/web/app/components/base/date-and-time-picker/calendar/days-of-week.tsx
@@ -17,5 +17,3 @@ export const DaysOfWeek = () => {
</div>
)
}
-
-export default React.memo(DaysOfWeek)
diff --git a/web/app/components/base/date-and-time-picker/utils/dayjs.ts b/web/app/components/base/date-and-time-picker/utils/dayjs.ts
index f1c77ecc579..3e20e51cf3d 100644
--- a/web/app/components/base/date-and-time-picker/utils/dayjs.ts
+++ b/web/app/components/base/date-and-time-picker/utils/dayjs.ts
@@ -126,7 +126,7 @@ export const convertTimezoneToOffsetStr = (timezone?: string) => {
export const isDayjsObject = (value: unknown): value is Dayjs => dayjs.isDayjs(value)
-export type ToDayjsOptions = {
+type ToDayjsOptions = {
timezone?: string
format?: string
formats?: string[]
diff --git a/web/app/components/base/divider/index.tsx b/web/app/components/base/divider/index.tsx
index d3693e9ffd9..b096844079d 100644
--- a/web/app/components/base/divider/index.tsx
+++ b/web/app/components/base/divider/index.tsx
@@ -21,7 +21,7 @@ const dividerVariants = cva('', {
},
})
-export type DividerProps = {
+type DividerProps = {
className?: string
style?: CSSProperties
} & VariantProps<typeof dividerVariants>
diff --git a/web/app/components/base/file-uploader/index.ts b/web/app/components/base/file-uploader/index.ts
index 1ab4fdae3b2..5f27f61d90a 100644
--- a/web/app/components/base/file-uploader/index.ts
+++ b/web/app/components/base/file-uploader/index.ts
@@ -1,7 +1,7 @@
export { default as FileTypeIcon } from './file-type-icon'
export { default as FileUploaderInAttachmentWrapper } from './file-uploader-in-attachment'
-export { default as FileItemInAttachment } from './file-uploader-in-attachment/file-item'
+
export { default as FileUploaderInChatInput } from './file-uploader-in-chat-input'
-export { default as FileItem } from './file-uploader-in-chat-input/file-item'
+
export { FileListInChatInput } from './file-uploader-in-chat-input/file-list'
export { FileList } from './file-uploader-in-chat-input/file-list'
diff --git a/web/app/components/base/form/form-scenarios/demo/types.ts b/web/app/components/base/form/form-scenarios/demo/types.ts
index 91ab1c77473..a8aa18b27d4 100644
--- a/web/app/components/base/form/form-scenarios/demo/types.ts
+++ b/web/app/components/base/form/form-scenarios/demo/types.ts
@@ -30,5 +30,3 @@ export const UserSchema = z.object({
preferredContactMethod: ContactMethod,
}),
})
-
-export type User = z.infer<typeof UserSchema>
diff --git a/web/app/components/base/form/index.tsx b/web/app/components/base/form/index.tsx
index 6c60826c325..663b7f1fe84 100644
--- a/web/app/components/base/form/index.tsx
+++ b/web/app/components/base/form/index.tsx
@@ -14,9 +14,11 @@ import UploadMethodField from './components/field/upload-method'
import VariableOrConstantInputField from './components/field/variable-selector'
import Actions from './components/form/actions'
-export const { fieldContext, useFieldContext, formContext, useFormContext }
+const { fieldContext, useFieldContext, formContext, useFormContext }
= createFormHookContexts()
+export { formContext, useFieldContext, useFormContext }
+
export const { useAppForm, withForm } = createFormHook({
fieldComponents: {
TextField,
diff --git a/web/app/components/base/form/types.ts b/web/app/components/base/form/types.ts
index a2b434f3cfa..4b83b9e4c97 100644
--- a/web/app/components/base/form/types.ts
+++ b/web/app/components/base/form/types.ts
@@ -82,8 +82,6 @@ export type FormSchema = {
}
}
-export type FormValues = Record<string, any>
-
export type GetValuesOptions = {
needTransformWhenSecretFieldIsPristine?: boolean
needCheckValidatedValues?: boolean
diff --git a/web/app/components/base/ga/index.tsx b/web/app/components/base/ga/index.tsx
index 3e19afd9744..79783c75cc7 100644
--- a/web/app/components/base/ga/index.tsx
+++ b/web/app/components/base/ga/index.tsx
@@ -9,16 +9,16 @@ export enum GaType {
webapp = 'webapp',
}
-export const GA_MEASUREMENT_ID_ADMIN = 'G-DM9497FN4V'
-export const GA_MEASUREMENT_ID_WEBAPP = 'G-2MFWXK7WYT'
-export const COOKIEYES_SCRIPT_SRC = 'https://cdn-cookieyes.com/client_data/2a645945fcae53f8e025a2b1/script.js'
+const GA_MEASUREMENT_ID_ADMIN = 'G-DM9497FN4V'
+const GA_MEASUREMENT_ID_WEBAPP = 'G-2MFWXK7WYT'
+const COOKIEYES_SCRIPT_SRC = 'https://cdn-cookieyes.com/client_data/2a645945fcae53f8e025a2b1/script.js'
const gaIdMaps = {
[GaType.admin]: GA_MEASUREMENT_ID_ADMIN,
[GaType.webapp]: GA_MEASUREMENT_ID_WEBAPP,
}
-export type IGAProps = {
+type IGAProps = {
gaType: GaType
}
diff --git a/web/app/components/base/icons/IconBase.tsx b/web/app/components/base/icons/IconBase.tsx
index 13ab7c816bc..2de0f3239ed 100644
--- a/web/app/components/base/icons/IconBase.tsx
+++ b/web/app/components/base/icons/IconBase.tsx
@@ -6,7 +6,7 @@ export type IconData = {
icon: AbstractNode
}
-export type IconBaseProps = {
+type IconBaseProps = {
data: IconData
className?: string
onClick?: React.MouseEventHandler<SVGElement>
diff --git a/web/app/components/base/icons/src/image/llm/index.ts b/web/app/components/base/icons/src/image/llm/index.ts
deleted file mode 100644
index 1b7f8c48ebb..00000000000
--- a/web/app/components/base/icons/src/image/llm/index.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-export { default as BaichuanTextCn } from './BaichuanTextCn'
-export { default as Minimax } from './Minimax'
-export { default as MinimaxText } from './MinimaxText'
-export { default as Tongyi } from './Tongyi'
-export { default as TongyiText } from './TongyiText'
-export { default as TongyiTextCn } from './TongyiTextCn'
-export { default as Wxyy } from './Wxyy'
-export { default as WxyyText } from './WxyyText'
-export { default as WxyyTextCn } from './WxyyTextCn'
diff --git a/web/app/components/base/icons/src/public/billing/index.ts b/web/app/components/base/icons/src/public/billing/index.ts
index bd8fdc10dd3..c80933b0db6 100644
--- a/web/app/components/base/icons/src/public/billing/index.ts
+++ b/web/app/components/base/icons/src/public/billing/index.ts
@@ -1,12 +1,5 @@
-export { default as ArCube1 } from './ArCube1'
-export { default as Asterisk } from './Asterisk'
export { default as AwsMarketplaceDark } from './AwsMarketplaceDark'
export { default as AwsMarketplaceLight } from './AwsMarketplaceLight'
export { default as Azure } from './Azure'
-export { default as Buildings } from './Buildings'
-export { default as Diamond } from './Diamond'
+
export { default as GoogleCloud } from './GoogleCloud'
-export { default as Group2 } from './Group2'
-export { default as Keyframe } from './Keyframe'
-export { default as Sparkles } from './Sparkles'
-export { default as SparklesSoft } from './SparklesSoft'
diff --git a/web/app/components/base/icons/src/public/common/index.ts b/web/app/components/base/icons/src/public/common/index.ts
index c19ab569fa4..894570bc8f9 100644
--- a/web/app/components/base/icons/src/public/common/index.ts
+++ b/web/app/components/base/icons/src/public/common/index.ts
@@ -1,16 +1,9 @@
-export { default as D } from './D'
-export { default as DiagonalDividingLine } from './DiagonalDividingLine'
-export { default as Dify } from './Dify'
-export { default as Gdpr } from './Gdpr'
export { default as Github } from './Github'
export { default as Highlight } from './Highlight'
-export { default as Iso } from './Iso'
+
export { default as Line3 } from './Line3'
-export { default as Lock } from './Lock'
-export { default as MessageChatSquare } from './MessageChatSquare'
-export { default as MultiPathRetrieval } from './MultiPathRetrieval'
+
export { default as Notion } from './Notion'
-export { default as NTo1Retrieval } from './NTo1Retrieval'
-export { default as Soc2 } from './Soc2'
+
export { default as SparklesSoft } from './SparklesSoft'
export { default as SparklesSoftAccent } from './SparklesSoftAccent'
diff --git a/web/app/components/base/icons/src/public/knowledge/dataset-card/index.ts b/web/app/components/base/icons/src/public/knowledge/dataset-card/index.ts
index 9f45717e731..50d6bac1ed8 100644
--- a/web/app/components/base/icons/src/public/knowledge/dataset-card/index.ts
+++ b/web/app/components/base/icons/src/public/knowledge/dataset-card/index.ts
@@ -1,5 +1,5 @@
export { default as ExternalKnowledgeBase } from './ExternalKnowledgeBase'
export { default as General } from './General'
-export { default as Graph } from './Graph'
+
export { default as ParentChild } from './ParentChild'
export { default as Qa } from './Qa'
diff --git a/web/app/components/base/icons/src/public/knowledge/index.ts b/web/app/components/base/icons/src/public/knowledge/index.ts
index 4acde1663ba..c0d35e9ef3b 100644
--- a/web/app/components/base/icons/src/public/knowledge/index.ts
+++ b/web/app/components/base/icons/src/public/knowledge/index.ts
@@ -1,8 +1,6 @@
-export { default as File } from './File'
export { default as OptionCardEffectBlue } from './OptionCardEffectBlue'
export { default as OptionCardEffectBlueLight } from './OptionCardEffectBlueLight'
export { default as OptionCardEffectOrange } from './OptionCardEffectOrange'
export { default as OptionCardEffectPurple } from './OptionCardEffectPurple'
export { default as OptionCardEffectTeal } from './OptionCardEffectTeal'
export { default as SelectionMod } from './SelectionMod'
-export { default as Watercrawl } from './Watercrawl'
diff --git a/web/app/components/base/icons/src/public/llm/index.ts b/web/app/components/base/icons/src/public/llm/index.ts
index 0c5cef4a363..6b77aefe519 100644
--- a/web/app/components/base/icons/src/public/llm/index.ts
+++ b/web/app/components/base/icons/src/public/llm/index.ts
@@ -1,50 +1,14 @@
-export { default as Anthropic } from './Anthropic'
export { default as AnthropicDark } from './AnthropicDark'
export { default as AnthropicLight } from './AnthropicLight'
export { default as AnthropicShortLight } from './AnthropicShortLight'
-export { default as AnthropicText } from './AnthropicText'
-export { default as Azureai } from './Azureai'
-export { default as AzureaiText } from './AzureaiText'
-export { default as AzureOpenaiService } from './AzureOpenaiService'
-export { default as AzureOpenaiServiceText } from './AzureOpenaiServiceText'
-export { default as Baichuan } from './Baichuan'
-export { default as BaichuanText } from './BaichuanText'
-export { default as Chatglm } from './Chatglm'
-export { default as ChatglmText } from './ChatglmText'
-export { default as Cohere } from './Cohere'
-export { default as CohereText } from './CohereText'
+
export { default as Deepseek } from './Deepseek'
export { default as Gemini } from './Gemini'
-export { default as Gpt3 } from './Gpt3'
-export { default as Gpt4 } from './Gpt4'
+
export { default as Grok } from './Grok'
-export { default as Huggingface } from './Huggingface'
-export { default as HuggingfaceText } from './HuggingfaceText'
-export { default as HuggingfaceTextHub } from './HuggingfaceTextHub'
-export { default as IflytekSpark } from './IflytekSpark'
-export { default as IflytekSparkText } from './IflytekSparkText'
-export { default as IflytekSparkTextCn } from './IflytekSparkTextCn'
-export { default as Jina } from './Jina'
-export { default as JinaText } from './JinaText'
-export { default as Localai } from './Localai'
-export { default as LocalaiText } from './LocalaiText'
-export { default as Microsoft } from './Microsoft'
-export { default as OpenaiBlack } from './OpenaiBlack'
-export { default as OpenaiBlue } from './OpenaiBlue'
-export { default as OpenaiGreen } from './OpenaiGreen'
+
export { default as OpenaiSmall } from './OpenaiSmall'
-export { default as OpenaiTeal } from './OpenaiTeal'
-export { default as OpenaiText } from './OpenaiText'
-export { default as OpenaiTransparent } from './OpenaiTransparent'
-export { default as OpenaiViolet } from './OpenaiViolet'
+
export { default as OpenaiYellow } from './OpenaiYellow'
-export { default as Openllm } from './Openllm'
-export { default as OpenllmText } from './OpenllmText'
-export { default as Replicate } from './Replicate'
-export { default as ReplicateText } from './ReplicateText'
+
export { default as Tongyi } from './Tongyi'
-export { default as XorbitsInference } from './XorbitsInference'
-export { default as XorbitsInferenceText } from './XorbitsInferenceText'
-export { default as Zhipuai } from './Zhipuai'
-export { default as ZhipuaiText } from './ZhipuaiText'
-export { default as ZhipuaiTextCn } from './ZhipuaiTextCn'
diff --git a/web/app/components/base/icons/src/public/model/index.ts b/web/app/components/base/icons/src/public/model/index.ts
deleted file mode 100644
index 719a6f0309a..00000000000
--- a/web/app/components/base/icons/src/public/model/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { default as Checked } from './Checked'
diff --git a/web/app/components/base/icons/src/public/other/index.ts b/web/app/components/base/icons/src/public/other/index.ts
index 10987368fb5..a8f91dd98b7 100644
--- a/web/app/components/base/icons/src/public/other/index.ts
+++ b/web/app/components/base/icons/src/public/other/index.ts
@@ -1,5 +1,5 @@
export { default as DefaultToolIcon } from './DefaultToolIcon'
-export { default as Icon3Dots } from './Icon3Dots'
+
export { default as Message3Fill } from './Message3Fill'
export { default as RowStruct } from './RowStruct'
export { default as Slack } from './Slack'
diff --git a/web/app/components/base/icons/src/public/plugins/index.ts b/web/app/components/base/icons/src/public/plugins/index.ts
deleted file mode 100644
index 87dc37167c6..00000000000
--- a/web/app/components/base/icons/src/public/plugins/index.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-export { default as Google } from './Google'
-export { default as PartnerDark } from './PartnerDark'
-export { default as PartnerLight } from './PartnerLight'
-export { default as VerifiedDark } from './VerifiedDark'
-export { default as VerifiedLight } from './VerifiedLight'
-export { default as WebReader } from './WebReader'
-export { default as Wikipedia } from './Wikipedia'
diff --git a/web/app/components/base/icons/src/public/thought/index.ts b/web/app/components/base/icons/src/public/thought/index.ts
index 8a45489dbf7..10f5e3f5c36 100644
--- a/web/app/components/base/icons/src/public/thought/index.ts
+++ b/web/app/components/base/icons/src/public/thought/index.ts
@@ -1,5 +1 @@
-export { default as DataSet } from './DataSet'
export { default as Loading } from './Loading'
-export { default as Search } from './Search'
-export { default as ThoughtList } from './ThoughtList'
-export { default as WebReader } from './WebReader'
diff --git a/web/app/components/base/icons/src/vender/knowledge/index.ts b/web/app/components/base/icons/src/vender/knowledge/index.ts
index 44055c49754..99a4f26ed50 100644
--- a/web/app/components/base/icons/src/vender/knowledge/index.ts
+++ b/web/app/components/base/icons/src/vender/knowledge/index.ts
@@ -3,7 +3,7 @@ export { default as ApiAggregate } from './ApiAggregate'
export { default as ArrowShape } from './ArrowShape'
export { default as Chunk } from './Chunk'
export { default as Collapse } from './Collapse'
-export { default as Divider } from './Divider'
+
export { default as Economic } from './Economic'
export { default as FullTextSearch } from './FullTextSearch'
export { default as GeneralChunk } from './GeneralChunk'
diff --git a/web/app/components/base/icons/src/vender/line/alertsAndFeedback/index.ts b/web/app/components/base/icons/src/vender/line/alertsAndFeedback/index.ts
index 4e721d70eb9..27f8709bed7 100644
--- a/web/app/components/base/icons/src/vender/line/alertsAndFeedback/index.ts
+++ b/web/app/components/base/icons/src/vender/line/alertsAndFeedback/index.ts
@@ -1,4 +1,2 @@
-export { default as AlertTriangle } from './AlertTriangle'
-export { default as ThumbsDown } from './ThumbsDown'
export { default as ThumbsUp } from './ThumbsUp'
export { default as Warning } from './Warning'
diff --git a/web/app/components/base/icons/src/vender/line/arrows/index.ts b/web/app/components/base/icons/src/vender/line/arrows/index.ts
index 174c69bd951..b27efc2e9c7 100644
--- a/web/app/components/base/icons/src/vender/line/arrows/index.ts
+++ b/web/app/components/base/icons/src/vender/line/arrows/index.ts
@@ -3,7 +3,5 @@ export { default as ArrowUpRight } from './ArrowUpRight'
export { default as ChevronDownDouble } from './ChevronDownDouble'
export { default as ChevronRight } from './ChevronRight'
export { default as ChevronSelectorVertical } from './ChevronSelectorVertical'
-export { default as IconR } from './IconR'
+
export { default as RefreshCcw01 } from './RefreshCcw01'
-export { default as RefreshCw05 } from './RefreshCw05'
-export { default as ReverseLeft } from './ReverseLeft'
diff --git a/web/app/components/base/icons/src/vender/line/communication/index.ts b/web/app/components/base/icons/src/vender/line/communication/index.ts
index a6844c2b696..45a762a1dde 100644
--- a/web/app/components/base/icons/src/vender/line/communication/index.ts
+++ b/web/app/components/base/icons/src/vender/line/communication/index.ts
@@ -1,6 +1,4 @@
-export { default as AiText } from './AiText'
-export { default as ChatBot } from './ChatBot'
export { default as ChatBotSlim } from './ChatBotSlim'
-export { default as CuteRobot } from './CuteRobot'
+
export { default as MessageCheckRemove } from './MessageCheckRemove'
export { default as MessageFastPlus } from './MessageFastPlus'
diff --git a/web/app/components/base/icons/src/vender/line/development/index.ts b/web/app/components/base/icons/src/vender/line/development/index.ts
index 93bb1956bb9..7c3c48aa5e9 100644
--- a/web/app/components/base/icons/src/vender/line/development/index.ts
+++ b/web/app/components/base/icons/src/vender/line/development/index.ts
@@ -1,14 +1,2 @@
-export { default as ArtificialBrain } from './ArtificialBrain'
-export { default as BarChartSquare02 } from './BarChartSquare02'
export { default as BracketsX } from './BracketsX'
export { default as CodeBrowser } from './CodeBrowser'
-export { default as Container } from './Container'
-export { default as Database01 } from './Database01'
-export { default as Database03 } from './Database03'
-export { default as FileHeart02 } from './FileHeart02'
-export { default as GitBranch01 } from './GitBranch01'
-export { default as PromptEngineering } from './PromptEngineering'
-export { default as PuzzlePiece01 } from './PuzzlePiece01'
-export { default as TerminalSquare } from './TerminalSquare'
-export { default as Variable } from './Variable'
-export { default as Webhooks } from './Webhooks'
diff --git a/web/app/components/base/icons/src/vender/line/editor/index.ts b/web/app/components/base/icons/src/vender/line/editor/index.ts
index b31c42e390a..c968aa814cc 100644
--- a/web/app/components/base/icons/src/vender/line/editor/index.ts
+++ b/web/app/components/base/icons/src/vender/line/editor/index.ts
@@ -1,8 +1 @@
-export { default as AlignLeft } from './AlignLeft'
-export { default as BezierCurve03 } from './BezierCurve03'
-export { default as Collapse } from './Collapse'
-export { default as Colors } from './Colors'
export { default as ImageIndentLeft } from './ImageIndentLeft'
-export { default as LeftIndent02 } from './LeftIndent02'
-export { default as LetterSpacing01 } from './LetterSpacing01'
-export { default as TypeSquare } from './TypeSquare'
diff --git a/web/app/components/base/icons/src/vender/line/files/index.ts b/web/app/components/base/icons/src/vender/line/files/index.ts
index 8455f7b56a7..afdc65cb24b 100644
--- a/web/app/components/base/icons/src/vender/line/files/index.ts
+++ b/web/app/components/base/icons/src/vender/line/files/index.ts
@@ -1,11 +1,10 @@
export { default as Copy } from './Copy'
export { default as CopyCheck } from './CopyCheck'
-export { default as File02 } from './File02'
+
export { default as FileArrow01 } from './FileArrow01'
-export { default as FileCheck02 } from './FileCheck02'
+
export { default as FileDownload02 } from './FileDownload02'
export { default as FilePlus01 } from './FilePlus01'
export { default as FilePlus02 } from './FilePlus02'
-export { default as FileText } from './FileText'
-export { default as FileUpload } from './FileUpload'
+
export { default as Folder } from './Folder'
diff --git a/web/app/components/base/icons/src/vender/line/financeAndECommerce/index.ts b/web/app/components/base/icons/src/vender/line/financeAndECommerce/index.ts
index 8a98a4612c3..736eeca4538 100644
--- a/web/app/components/base/icons/src/vender/line/financeAndECommerce/index.ts
+++ b/web/app/components/base/icons/src/vender/line/financeAndECommerce/index.ts
@@ -1,7 +1,6 @@
export { default as Balance } from './Balance'
-export { default as CoinsStacked01 } from './CoinsStacked01'
+
export { default as CreditsCoin } from './CreditsCoin'
-export { default as GoldCoin } from './GoldCoin'
-export { default as ReceiptList } from './ReceiptList'
+
export { default as Tag01 } from './Tag01'
export { default as Tag03 } from './Tag03'
diff --git a/web/app/components/base/icons/src/vender/line/general/index.ts b/web/app/components/base/icons/src/vender/line/general/index.ts
index 24093672648..33f67f01a5d 100644
--- a/web/app/components/base/icons/src/vender/line/general/index.ts
+++ b/web/app/components/base/icons/src/vender/line/general/index.ts
@@ -1,30 +1,19 @@
-export { default as AtSign } from './AtSign'
-export { default as Bookmark } from './Bookmark'
export { default as Check } from './Check'
-export { default as CheckDone01 } from './CheckDone01'
-export { default as ChecklistSquare } from './ChecklistSquare'
+
export { default as CodeAssistant } from './CodeAssistant'
-export { default as DotsGrid } from './DotsGrid'
-export { default as Edit02 } from './Edit02'
-export { default as Edit04 } from './Edit04'
-export { default as Edit05 } from './Edit05'
-export { default as Hash02 } from './Hash02'
-export { default as InfoCircle } from './InfoCircle'
+
export { default as Link03 } from './Link03'
export { default as LinkExternal02 } from './LinkExternal02'
-export { default as LogIn04 } from './LogIn04'
+
export { default as LogOut01 } from './LogOut01'
-export { default as LogOut04 } from './LogOut04'
+
export { default as MagicEdit } from './MagicEdit'
-export { default as Menu01 } from './Menu01'
-export { default as Pin01 } from './Pin01'
+
export { default as Pin02 } from './Pin02'
export { default as Plus02 } from './Plus02'
-export { default as Refresh } from './Refresh'
+
export { default as SearchMenu } from './SearchMenu'
export { default as Settings01 } from './Settings01'
export { default as Settings04 } from './Settings04'
-export { default as Target04 } from './Target04'
-export { default as Upload03 } from './Upload03'
-export { default as UploadCloud01 } from './UploadCloud01'
+
export { default as X } from './X'
diff --git a/web/app/components/base/icons/src/vender/line/layout/index.ts b/web/app/components/base/icons/src/vender/line/layout/index.ts
index 7c12b1f58f4..a6aa205faa5 100644
--- a/web/app/components/base/icons/src/vender/line/layout/index.ts
+++ b/web/app/components/base/icons/src/vender/line/layout/index.ts
@@ -1,4 +1 @@
-export { default as AlignLeft01 } from './AlignLeft01'
-export { default as AlignRight01 } from './AlignRight01'
-export { default as Grid01 } from './Grid01'
export { default as LayoutGrid02 } from './LayoutGrid02'
diff --git a/web/app/components/base/icons/src/vender/line/mediaAndDevices/index.ts b/web/app/components/base/icons/src/vender/line/mediaAndDevices/index.ts
index 163c433ac85..35052d6564c 100644
--- a/web/app/components/base/icons/src/vender/line/mediaAndDevices/index.ts
+++ b/web/app/components/base/icons/src/vender/line/mediaAndDevices/index.ts
@@ -1,6 +1,2 @@
-export { default as Microphone01 } from './Microphone01'
-export { default as PlayCircle } from './PlayCircle'
-export { default as SlidersH } from './SlidersH'
-export { default as Speaker } from './Speaker'
export { default as Stop } from './Stop'
export { default as StopCircle } from './StopCircle'
diff --git a/web/app/components/base/icons/src/vender/line/others/index.ts b/web/app/components/base/icons/src/vender/line/others/index.ts
index 99db66b397b..0425327c6c0 100644
--- a/web/app/components/base/icons/src/vender/line/others/index.ts
+++ b/web/app/components/base/icons/src/vender/line/others/index.ts
@@ -1,10 +1,8 @@
export { default as BubbleX } from './BubbleX'
-export { default as Colors } from './Colors'
+
export { default as DragHandle } from './DragHandle'
export { default as Env } from './Env'
export { default as GlobalVariable } from './GlobalVariable'
export { default as Icon3Dots } from './Icon3Dots'
export { default as LongArrowLeft } from './LongArrowLeft'
export { default as LongArrowRight } from './LongArrowRight'
-export { default as SearchMenu } from './SearchMenu'
-export { default as Tools } from './Tools'
diff --git a/web/app/components/base/icons/src/vender/line/shapes/index.ts b/web/app/components/base/icons/src/vender/line/shapes/index.ts
deleted file mode 100644
index daf43bcaf7d..00000000000
--- a/web/app/components/base/icons/src/vender/line/shapes/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { default as CubeOutline } from './CubeOutline'
diff --git a/web/app/components/base/icons/src/vender/line/time/index.ts b/web/app/components/base/icons/src/vender/line/time/index.ts
index 7fd91f2b2e8..2187814bbff 100644
--- a/web/app/components/base/icons/src/vender/line/time/index.ts
+++ b/web/app/components/base/icons/src/vender/line/time/index.ts
@@ -1,4 +1,2 @@
export { default as ClockFastForward } from './ClockFastForward'
export { default as ClockPlay } from './ClockPlay'
-export { default as ClockPlaySlim } from './ClockPlaySlim'
-export { default as ClockRefresh } from './ClockRefresh'
diff --git a/web/app/components/base/icons/src/vender/line/users/index.ts b/web/app/components/base/icons/src/vender/line/users/index.ts
deleted file mode 100644
index 9f8a35152fd..00000000000
--- a/web/app/components/base/icons/src/vender/line/users/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export { default as User01 } from './User01'
-export { default as Users01 } from './Users01'
diff --git a/web/app/components/base/icons/src/vender/line/weather/index.ts b/web/app/components/base/icons/src/vender/line/weather/index.ts
deleted file mode 100644
index 1a68bce7659..00000000000
--- a/web/app/components/base/icons/src/vender/line/weather/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { default as Stars02 } from './Stars02'
diff --git a/web/app/components/base/icons/src/vender/other/index.ts b/web/app/components/base/icons/src/vender/other/index.ts
index 0ca5f22bcf7..493bac19316 100644
--- a/web/app/components/base/icons/src/vender/other/index.ts
+++ b/web/app/components/base/icons/src/vender/other/index.ts
@@ -1,4 +1,3 @@
-export { default as AnthropicText } from './AnthropicText'
export { default as Generator } from './Generator'
export { default as Group } from './Group'
export { default as HourglassShape } from './HourglassShape'
diff --git a/web/app/components/base/icons/src/vender/solid/FinanceAndECommerce/index.ts b/web/app/components/base/icons/src/vender/solid/FinanceAndECommerce/index.ts
index 777fe96845b..7770962bfad 100644
--- a/web/app/components/base/icons/src/vender/solid/FinanceAndECommerce/index.ts
+++ b/web/app/components/base/icons/src/vender/solid/FinanceAndECommerce/index.ts
@@ -1,2 +1 @@
-export { default as GoldCoin } from './GoldCoin'
export { default as Scales02 } from './Scales02'
diff --git a/web/app/components/base/icons/src/vender/solid/arrows/index.ts b/web/app/components/base/icons/src/vender/solid/arrows/index.ts
index 58ce9aa8acb..d89a969bd44 100644
--- a/web/app/components/base/icons/src/vender/solid/arrows/index.ts
+++ b/web/app/components/base/icons/src/vender/solid/arrows/index.ts
@@ -1,5 +1,3 @@
export { default as ArrowDownDoubleLine } from './ArrowDownDoubleLine'
export { default as ArrowDownRoundFill } from './ArrowDownRoundFill'
export { default as ArrowUpDoubleLine } from './ArrowUpDoubleLine'
-export { default as ChevronDown } from './ChevronDown'
-export { default as HighPriority } from './HighPriority'
diff --git a/web/app/components/base/icons/src/vender/solid/communication/index.ts b/web/app/components/base/icons/src/vender/solid/communication/index.ts
index 7d2a3a5a95c..2da1ac57e81 100644
--- a/web/app/components/base/icons/src/vender/solid/communication/index.ts
+++ b/web/app/components/base/icons/src/vender/solid/communication/index.ts
@@ -1,12 +1,8 @@
-export { default as AiText } from './AiText'
export { default as BubbleTextMod } from './BubbleTextMod'
export { default as ChatBot } from './ChatBot'
export { default as CuteRobot } from './CuteRobot'
-export { default as EditList } from './EditList'
+
export { default as ListSparkle } from './ListSparkle'
export { default as Logic } from './Logic'
-export { default as MessageDotsCircle } from './MessageDotsCircle'
+
export { default as MessageFast } from './MessageFast'
-export { default as MessageHeartCircle } from './MessageHeartCircle'
-export { default as MessageSmileSquare } from './MessageSmileSquare'
-export { default as Send03 } from './Send03'
diff --git a/web/app/components/base/icons/src/vender/solid/development/index.ts b/web/app/components/base/icons/src/vender/solid/development/index.ts
index f67d854beb9..25eb3d2736c 100644
--- a/web/app/components/base/icons/src/vender/solid/development/index.ts
+++ b/web/app/components/base/icons/src/vender/solid/development/index.ts
@@ -1,13 +1,5 @@
export { default as ApiConnection } from './ApiConnection'
export { default as ApiConnectionMod } from './ApiConnectionMod'
-export { default as BarChartSquare02 } from './BarChartSquare02'
-export { default as Container } from './Container'
-export { default as Database02 } from './Database02'
-export { default as Database03 } from './Database03'
-export { default as FileHeart02 } from './FileHeart02'
-export { default as PatternRecognition } from './PatternRecognition'
-export { default as PromptEngineering } from './PromptEngineering'
-export { default as PuzzlePiece01 } from './PuzzlePiece01'
-export { default as Semantic } from './Semantic'
+
export { default as TerminalSquare } from './TerminalSquare'
export { default as Variable02 } from './Variable02'
diff --git a/web/app/components/base/icons/src/vender/solid/editor/index.ts b/web/app/components/base/icons/src/vender/solid/editor/index.ts
index 6b1a0a1afac..8b6debe736a 100644
--- a/web/app/components/base/icons/src/vender/solid/editor/index.ts
+++ b/web/app/components/base/icons/src/vender/solid/editor/index.ts
@@ -1,5 +1 @@
export { default as Brush01 } from './Brush01'
-export { default as Citations } from './Citations'
-export { default as Colors } from './Colors'
-export { default as Paragraph } from './Paragraph'
-export { default as TypeSquare } from './TypeSquare'
diff --git a/web/app/components/base/icons/src/vender/solid/education/index.ts b/web/app/components/base/icons/src/vender/solid/education/index.ts
index 2c8a3b6046c..e67b6313358 100644
--- a/web/app/components/base/icons/src/vender/solid/education/index.ts
+++ b/web/app/components/base/icons/src/vender/solid/education/index.ts
@@ -1,4 +1,4 @@
export { default as Beaker02 } from './Beaker02'
export { default as BubbleText } from './BubbleText'
-export { default as Heart02 } from './Heart02'
+
export { default as Unblur } from './Unblur'
diff --git a/web/app/components/base/icons/src/vender/solid/files/index.ts b/web/app/components/base/icons/src/vender/solid/files/index.ts
index fa93cd68dce..7677ba67616 100644
--- a/web/app/components/base/icons/src/vender/solid/files/index.ts
+++ b/web/app/components/base/icons/src/vender/solid/files/index.ts
@@ -1,4 +1,4 @@
export { default as File05 } from './File05'
-export { default as FileSearch02 } from './FileSearch02'
+
export { default as FileZip } from './FileZip'
export { default as Folder } from './Folder'
diff --git a/web/app/components/base/icons/src/vender/solid/general/index.ts b/web/app/components/base/icons/src/vender/solid/general/index.ts
index 4c4dd9a437a..273fb7e8762 100644
--- a/web/app/components/base/icons/src/vender/solid/general/index.ts
+++ b/web/app/components/base/icons/src/vender/solid/general/index.ts
@@ -1,18 +1,14 @@
-export { default as AnswerTriangle } from './AnswerTriangle'
export { default as ArrowDownRoundFill } from './ArrowDownRoundFill'
export { default as CheckCircle } from './CheckCircle'
-export { default as CheckDone01 } from './CheckDone01'
+
export { default as Download02 } from './Download02'
export { default as Edit03 } from './Edit03'
-export { default as Edit04 } from './Edit04'
+
export { default as Eye } from './Eye'
export { default as Github } from './Github'
export { default as MessageClockCircle } from './MessageClockCircle'
-export { default as PlusCircle } from './PlusCircle'
-export { default as QuestionTriangle } from './QuestionTriangle'
-export { default as SearchMd } from './SearchMd'
+
export { default as Target04 } from './Target04'
export { default as Tool03 } from './Tool03'
export { default as XCircle } from './XCircle'
export { default as ZapFast } from './ZapFast'
-export { default as ZapNarrow } from './ZapNarrow'
diff --git a/web/app/components/base/icons/src/vender/solid/layout/index.ts b/web/app/components/base/icons/src/vender/solid/layout/index.ts
deleted file mode 100644
index 73a2513d51f..00000000000
--- a/web/app/components/base/icons/src/vender/solid/layout/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { default as Grid01 } from './Grid01'
diff --git a/web/app/components/base/icons/src/vender/solid/mediaAndDevices/index.ts b/web/app/components/base/icons/src/vender/solid/mediaAndDevices/index.ts
index 7c313fecfb4..7d1bf786e93 100644
--- a/web/app/components/base/icons/src/vender/solid/mediaAndDevices/index.ts
+++ b/web/app/components/base/icons/src/vender/solid/mediaAndDevices/index.ts
@@ -1,12 +1,3 @@
-export { default as AudioSupportIcon } from './AudioSupportIcon'
-export { default as DocumentSupportIcon } from './DocumentSupportIcon'
export { default as MagicBox } from './MagicBox'
-export { default as MagicEyes } from './MagicEyes'
-export { default as MagicWand } from './MagicWand'
-export { default as Microphone01 } from './Microphone01'
-export { default as Play } from './Play'
-export { default as Robot } from './Robot'
-export { default as Sliders02 } from './Sliders02'
-export { default as Speaker } from './Speaker'
+
export { default as StopCircle } from './StopCircle'
-export { default as VideoSupportIcon } from './VideoSupportIcon'
diff --git a/web/app/components/base/icons/src/vender/solid/shapes/index.ts b/web/app/components/base/icons/src/vender/solid/shapes/index.ts
index 2768e3949a3..f25784ab023 100644
--- a/web/app/components/base/icons/src/vender/solid/shapes/index.ts
+++ b/web/app/components/base/icons/src/vender/solid/shapes/index.ts
@@ -1,3 +1 @@
export { default as Corner } from './Corner'
-export { default as Star04 } from './Star04'
-export { default as Star06 } from './Star06'
diff --git a/web/app/components/base/icons/src/vender/solid/users/index.ts b/web/app/components/base/icons/src/vender/solid/users/index.ts
index 4c969bffd78..1691fc84015 100644
--- a/web/app/components/base/icons/src/vender/solid/users/index.ts
+++ b/web/app/components/base/icons/src/vender/solid/users/index.ts
@@ -1,4 +1 @@
-export { default as User01 } from './User01'
export { default as UserEdit02 } from './UserEdit02'
-export { default as Users01 } from './Users01'
-export { default as UsersPlus } from './UsersPlus'
diff --git a/web/app/components/base/icons/src/vender/workflow/index.ts b/web/app/components/base/icons/src/vender/workflow/index.ts
index c21e865a091..c2511d3816d 100644
--- a/web/app/components/base/icons/src/vender/workflow/index.ts
+++ b/web/app/components/base/icons/src/vender/workflow/index.ts
@@ -13,7 +13,7 @@ export { default as Http } from './Http'
export { default as HumanInLoop } from './HumanInLoop'
export { default as IfElse } from './IfElse'
export { default as Iteration } from './Iteration'
-export { default as IterationStart } from './IterationStart'
+
export { default as Jinja } from './Jinja'
export { default as KnowledgeBase } from './KnowledgeBase'
export { default as KnowledgeRetrieval } from './KnowledgeRetrieval'
diff --git a/web/app/components/base/icons/utils.ts b/web/app/components/base/icons/utils.ts
index 9a15a0816de..51a1d705689 100644
--- a/web/app/components/base/icons/utils.ts
+++ b/web/app/components/base/icons/utils.ts
@@ -8,7 +8,7 @@ export type AbstractNode = {
children?: AbstractNode[]
}
-export type Attrs = {
+type Attrs = {
[key: string]: string | undefined
}
diff --git a/web/app/components/base/inline-delete-confirm/index.tsx b/web/app/components/base/inline-delete-confirm/index.tsx
index 529dec479d4..a0e3b8eb966 100644
--- a/web/app/components/base/inline-delete-confirm/index.tsx
+++ b/web/app/components/base/inline-delete-confirm/index.tsx
@@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next'
import Button from '@/app/components/base/button'
import { cn } from '@/utils/classnames'
-export type InlineDeleteConfirmProps = {
+type InlineDeleteConfirmProps = {
title?: string
confirmText?: string
cancelText?: string
diff --git a/web/app/components/base/input-with-copy/index.tsx b/web/app/components/base/input-with-copy/index.tsx
index 7c2177d5d26..e85a7bd6f4e 100644
--- a/web/app/components/base/input-with-copy/index.tsx
+++ b/web/app/components/base/input-with-copy/index.tsx
@@ -7,7 +7,7 @@ import { cn } from '@/utils/classnames'
import ActionButton from '../action-button'
import Tooltip from '../tooltip'
-export type InputWithCopyProps = {
+type InputWithCopyProps = {
showCopyButton?: boolean
copyValue?: string // Value to copy, defaults to input value
onCopy?: (value: string) => void // Callback when copy is triggered
diff --git a/web/app/components/base/markdown-blocks/index.ts b/web/app/components/base/markdown-blocks/index.ts
index 73c9fdf13f5..10e98c9ad97 100644
--- a/web/app/components/base/markdown-blocks/index.ts
+++ b/web/app/components/base/markdown-blocks/index.ts
@@ -6,7 +6,7 @@
export { default as AudioBlock } from './audio-block'
// Assuming these are also standalone components in this directory intended for Markdown rendering
export { default as MarkdownButton } from './button'
-export { default as CodeBlock } from './code-block'
+
export { default as MarkdownForm } from './form'
export { default as Img } from './img'
export { default as Link } from './link'
diff --git a/web/app/components/base/markdown-with-directive/components/markdown-with-directive-schema.ts b/web/app/components/base/markdown-with-directive/components/markdown-with-directive-schema.ts
index 5e31a7afa9a..4e721b214eb 100644
--- a/web/app/components/base/markdown-with-directive/components/markdown-with-directive-schema.ts
+++ b/web/app/components/base/markdown-with-directive/components/markdown-with-directive-schema.ts
@@ -15,12 +15,12 @@ export const withIconCardItemPropsSchema = z.object({
),
}).strict()
-export const directivePropsSchemas = {
+const directivePropsSchemas = {
withiconcardlist: withIconCardListPropsSchema,
withiconcarditem: withIconCardItemPropsSchema,
} as const
-export type DirectiveName = keyof typeof directivePropsSchemas
+type DirectiveName = keyof typeof directivePropsSchemas
function isDirectiveName(name: string): name is DirectiveName {
return Object.hasOwn(directivePropsSchemas, name)
diff --git a/web/app/components/base/node-status/index.tsx b/web/app/components/base/node-status/index.tsx
index 3c39fa1fb31..1616f350b0c 100644
--- a/web/app/components/base/node-status/index.tsx
+++ b/web/app/components/base/node-status/index.tsx
@@ -32,7 +32,7 @@ const StatusIconMap: Record<NodeStatusEnum, { IconComponent: React.ElementType,
[NodeStatusEnum.error]: { IconComponent: RiErrorWarningFill, message: 'Error' },
}
-export type NodeStatusProps = {
+type NodeStatusProps = {
message?: string
styleCss?: CSSProperties
iconClassName?: string
diff --git a/web/app/components/base/pagination/pagination.tsx b/web/app/components/base/pagination/pagination.tsx
index b258090d80d..9ce128e497d 100644
--- a/web/app/components/base/pagination/pagination.tsx
+++ b/web/app/components/base/pagination/pagination.tsx
@@ -26,7 +26,7 @@ const defaultState: IPagination = {
const PaginationContext: React.Context<IPagination> = React.createContext<IPagination>(defaultState)
-export const PrevButton = ({
+const PrevButton = ({
className,
children,
dataTestId,
@@ -61,7 +61,7 @@ export const PrevButton = ({
)
}
-export const NextButton = ({
+const NextButton = ({
className,
children,
dataTestId,
@@ -117,7 +117,7 @@ const TruncableElement = ({ prev }: ITruncableElementProps) => {
: null
}
-export const PageButton = ({
+const PageButton = ({
as = <a />,
className,
dataTestIdActive,
diff --git a/web/app/components/base/portal-to-follow-elem/index.tsx b/web/app/components/base/portal-to-follow-elem/index.tsx
index 7d4f6baa9bd..932eceee2b0 100644
--- a/web/app/components/base/portal-to-follow-elem/index.tsx
+++ b/web/app/components/base/portal-to-follow-elem/index.tsx
@@ -46,7 +46,7 @@ export type PortalToFollowElemOptions = {
}
/** @deprecated Use semantic overlay primitives instead. See #32767. */
-export function usePortalToFollowElem({
+function usePortalToFollowElem({
placement = 'bottom',
open: controlledOpen,
offset: offsetValue = 0,
@@ -114,7 +114,7 @@ type ContextType = ReturnType<typeof usePortalToFollowElem> | null
const PortalToFollowElemContext = React.createContext<ContextType>(null)
-export function usePortalToFollowElemContext() {
+function usePortalToFollowElemContext() {
const context = React.useContext(PortalToFollowElemContext)
if (context == null)
diff --git a/web/app/components/base/premium-badge/index.tsx b/web/app/components/base/premium-badge/index.tsx
index 297e05fe428..1ffff2f7a9b 100644
--- a/web/app/components/base/premium-badge/index.tsx
+++ b/web/app/components/base/premium-badge/index.tsx
@@ -66,4 +66,3 @@ const PremiumBadge: React.FC<PremiumBadgeProps> = ({
PremiumBadge.displayName = 'PremiumBadge'
export default PremiumBadge
-export { PremiumBadge, PremiumBadgeVariants }
diff --git a/web/app/components/base/prompt-editor/hooks.ts b/web/app/components/base/prompt-editor/hooks.ts
index 6984d30ee8a..49fc6a8eb0f 100644
--- a/web/app/components/base/prompt-editor/hooks.ts
+++ b/web/app/components/base/prompt-editor/hooks.ts
@@ -35,7 +35,7 @@ import { DELETE_QUERY_BLOCK_COMMAND } from './plugins/query-block'
import { $isQueryBlockNode } from './plugins/query-block/node'
import { registerLexicalTextEntity } from './utils'
-export type UseSelectOrDeleteHandler = (nodeKey: string, command?: LexicalCommand<undefined>) => [RefObject<HTMLDivElement | null>, boolean]
+type UseSelectOrDeleteHandler = (nodeKey: string, command?: LexicalCommand<undefined>) => [RefObject<HTMLDivElement | null>, boolean]
export const useSelectOrDelete: UseSelectOrDeleteHandler = (nodeKey: string, command?: LexicalCommand<undefined>) => {
const ref = useRef<HTMLDivElement>(null)
const [editor] = useLexicalComposerContext()
@@ -110,7 +110,7 @@ export const useSelectOrDelete: UseSelectOrDeleteHandler = (nodeKey: string, com
return [ref, isSelected]
}
-export type UseTriggerHandler = () => [RefObject<HTMLDivElement | null>, boolean, Dispatch<SetStateAction<boolean>>]
+type UseTriggerHandler = () => [RefObject<HTMLDivElement | null>, boolean, Dispatch<SetStateAction<boolean>>]
export const useTrigger: UseTriggerHandler = () => {
const triggerRef = useRef<HTMLDivElement>(null)
const [open, setOpen] = useState(false)
@@ -145,16 +145,16 @@ export function useLexicalTextEntity<T extends TextNode>(
}, [createNode, editor, getMatch, targetNode])
}
-export type MenuTextMatch = {
+type MenuTextMatch = {
leadOffset: number
matchingString: string
replaceableString: string
}
-export type TriggerFn = (
+type TriggerFn = (
text: string,
editor: LexicalEditor,
) => MenuTextMatch | null
-export const PUNCTUATION = '\\.,\\+\\*\\?\\$\\@\\|#{}\\(\\)\\^\\-\\[\\]\\\\/!%\'"~=<>_:;'
+const PUNCTUATION = '\\.,\\+\\*\\?\\$\\@\\|#{}\\(\\)\\^\\-\\[\\]\\\\/!%\'"~=<>_:;'
export function useBasicTypeaheadTriggerMatch(
trigger: string,
{ minLength = 1, maxLength = 75 }: { minLength?: number, maxLength?: number },
diff --git a/web/app/components/base/prompt-editor/plugins/context-block/node.tsx b/web/app/components/base/prompt-editor/plugins/context-block/node.tsx
index 231a72ca140..958415d843d 100644
--- a/web/app/components/base/prompt-editor/plugins/context-block/node.tsx
+++ b/web/app/components/base/prompt-editor/plugins/context-block/node.tsx
@@ -3,7 +3,7 @@ import type { Dataset } from './index'
import { DecoratorNode } from 'lexical'
import ContextBlockComponent from './component'
-export type SerializedNode = SerializedLexicalNode & { datasets: Dataset[], onAddContext: () => void, canNotAddContext: boolean }
+type SerializedNode = SerializedLexicalNode & { datasets: Dataset[], onAddContext: () => void, canNotAddContext: boolean }
export class ContextBlockNode extends DecoratorNode<React.JSX.Element> {
__datasets: Dataset[]
diff --git a/web/app/components/base/prompt-editor/plugins/current-block/node.tsx b/web/app/components/base/prompt-editor/plugins/current-block/node.tsx
index 554bf1a2e9b..916e3b5169f 100644
--- a/web/app/components/base/prompt-editor/plugins/current-block/node.tsx
+++ b/web/app/components/base/prompt-editor/plugins/current-block/node.tsx
@@ -3,7 +3,7 @@ import type { GeneratorType } from '@/app/components/app/configuration/config/au
import { DecoratorNode } from 'lexical'
import CurrentBlockComponent from './component'
-export type SerializedNode = SerializedLexicalNode & { generatorType: GeneratorType }
+type SerializedNode = SerializedLexicalNode & { generatorType: GeneratorType }
export class CurrentBlockNode extends DecoratorNode<React.JSX.Element> {
__generatorType: GeneratorType
diff --git a/web/app/components/base/prompt-editor/plugins/error-message-block/node.tsx b/web/app/components/base/prompt-editor/plugins/error-message-block/node.tsx
index b8042e5e543..d253cf7ff38 100644
--- a/web/app/components/base/prompt-editor/plugins/error-message-block/node.tsx
+++ b/web/app/components/base/prompt-editor/plugins/error-message-block/node.tsx
@@ -2,7 +2,7 @@ import type { LexicalNode, NodeKey, SerializedLexicalNode } from 'lexical'
import { DecoratorNode } from 'lexical'
import ErrorMessageBlockComponent from './component'
-export type SerializedNode = SerializedLexicalNode
+type SerializedNode = SerializedLexicalNode
export class ErrorMessageBlockNode extends DecoratorNode<React.JSX.Element> {
static getType(): string {
diff --git a/web/app/components/base/prompt-editor/plugins/history-block/index.tsx b/web/app/components/base/prompt-editor/plugins/history-block/index.tsx
index a1d788c8cd5..f6fd01f0d9c 100644
--- a/web/app/components/base/prompt-editor/plugins/history-block/index.tsx
+++ b/web/app/components/base/prompt-editor/plugins/history-block/index.tsx
@@ -24,13 +24,6 @@ export type RoleName = {
assistant: string
}
-export type HistoryBlockProps = {
- roleName: RoleName
- onEditRole: () => void
- onInsert?: () => void
- onDelete?: () => void
-}
-
const HistoryBlock = memo(({
history = { user: '', assistant: '' },
onEditRole = noop,
diff --git a/web/app/components/base/prompt-editor/plugins/hitl-input-block/index.tsx b/web/app/components/base/prompt-editor/plugins/hitl-input-block/index.tsx
index 49b0e3d150f..2c10fdbd5a8 100644
--- a/web/app/components/base/prompt-editor/plugins/hitl-input-block/index.tsx
+++ b/web/app/components/base/prompt-editor/plugins/hitl-input-block/index.tsx
@@ -22,11 +22,6 @@ import {
export const INSERT_HITL_INPUT_BLOCK_COMMAND = createCommand('INSERT_HITL_INPUT_BLOCK_COMMAND')
export const DELETE_HITL_INPUT_BLOCK_COMMAND = createCommand('DELETE_HITL_INPUT_BLOCK_COMMAND')
export const UPDATE_WORKFLOW_NODES_MAP = createCommand('UPDATE_WORKFLOW_NODES_MAP')
-
-export type HITLInputProps = {
- onInsert?: () => void
- onDelete?: () => void
-}
const HITLInputBlock = memo(({
onInsert,
onDelete,
diff --git a/web/app/components/base/prompt-editor/plugins/hitl-input-block/node.tsx b/web/app/components/base/prompt-editor/plugins/hitl-input-block/node.tsx
index bf3c44acf3e..9f2d25b4465 100644
--- a/web/app/components/base/prompt-editor/plugins/hitl-input-block/node.tsx
+++ b/web/app/components/base/prompt-editor/plugins/hitl-input-block/node.tsx
@@ -21,7 +21,7 @@ export type HITLNodeProps = {
readonly?: boolean
}
-export type SerializedNode = SerializedLexicalNode & HITLNodeProps
+type SerializedNode = SerializedLexicalNode & HITLNodeProps
export class HITLInputNode extends DecoratorNode<React.JSX.Element> {
__variableName: string
diff --git a/web/app/components/base/prompt-editor/plugins/last-run-block/node.tsx b/web/app/components/base/prompt-editor/plugins/last-run-block/node.tsx
index 5f61c3138bd..0606adbe2e4 100644
--- a/web/app/components/base/prompt-editor/plugins/last-run-block/node.tsx
+++ b/web/app/components/base/prompt-editor/plugins/last-run-block/node.tsx
@@ -2,7 +2,7 @@ import type { LexicalNode, NodeKey, SerializedLexicalNode } from 'lexical'
import { DecoratorNode } from 'lexical'
import LastRunBlockComponent from './component'
-export type SerializedNode = SerializedLexicalNode
+type SerializedNode = SerializedLexicalNode
export class LastRunBlockNode extends DecoratorNode<React.JSX.Element> {
static getType(): string {
diff --git a/web/app/components/base/prompt-editor/plugins/query-block/index.tsx b/web/app/components/base/prompt-editor/plugins/query-block/index.tsx
index d5953d16c40..adabf0bc6e1 100644
--- a/web/app/components/base/prompt-editor/plugins/query-block/index.tsx
+++ b/web/app/components/base/prompt-editor/plugins/query-block/index.tsx
@@ -17,11 +17,6 @@ import {
export const INSERT_QUERY_BLOCK_COMMAND = createCommand('INSERT_QUERY_BLOCK_COMMAND')
export const DELETE_QUERY_BLOCK_COMMAND = createCommand('DELETE_QUERY_BLOCK_COMMAND')
-
-export type QueryBlockProps = {
- onInsert?: () => void
- onDelete?: () => void
-}
const QueryBlock = memo(({
onInsert,
onDelete,
diff --git a/web/app/components/base/prompt-editor/plugins/query-block/node.tsx b/web/app/components/base/prompt-editor/plugins/query-block/node.tsx
index fc560451dda..519d6bab927 100644
--- a/web/app/components/base/prompt-editor/plugins/query-block/node.tsx
+++ b/web/app/components/base/prompt-editor/plugins/query-block/node.tsx
@@ -2,7 +2,7 @@ import type { LexicalNode, SerializedLexicalNode } from 'lexical'
import { DecoratorNode } from 'lexical'
import QueryBlockComponent from './component'
-export type SerializedNode = SerializedLexicalNode
+type SerializedNode = SerializedLexicalNode
export class QueryBlockNode extends DecoratorNode<React.JSX.Element> {
static getType(): string {
diff --git a/web/app/components/base/prompt-editor/plugins/request-url-block/node.tsx b/web/app/components/base/prompt-editor/plugins/request-url-block/node.tsx
index b1e74aa3a6d..b24e653bbcf 100644
--- a/web/app/components/base/prompt-editor/plugins/request-url-block/node.tsx
+++ b/web/app/components/base/prompt-editor/plugins/request-url-block/node.tsx
@@ -2,7 +2,7 @@ import type { LexicalNode, SerializedLexicalNode } from 'lexical'
import { DecoratorNode } from 'lexical'
import RequestURLBlockComponent from './component'
-export type SerializedNode = SerializedLexicalNode
+type SerializedNode = SerializedLexicalNode
export class RequestURLBlockNode extends DecoratorNode<React.JSX.Element> {
static getType(): string {
diff --git a/web/app/components/base/prompt-editor/plugins/workflow-variable-block/index.tsx b/web/app/components/base/prompt-editor/plugins/workflow-variable-block/index.tsx
index c8cac64d19d..dfbd238dbf6 100644
--- a/web/app/components/base/prompt-editor/plugins/workflow-variable-block/index.tsx
+++ b/web/app/components/base/prompt-editor/plugins/workflow-variable-block/index.tsx
@@ -1,5 +1,4 @@
-import type { GetVarType, WorkflowVariableBlockType } from '../../types'
-import type { Node } from '@/app/components/workflow/types'
+import type { WorkflowVariableBlockType } from '../../types'
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'
import { mergeRegister } from '@lexical/utils'
import {
@@ -19,13 +18,6 @@ import {
export const INSERT_WORKFLOW_VARIABLE_BLOCK_COMMAND = createCommand('INSERT_WORKFLOW_VARIABLE_BLOCK_COMMAND')
export const DELETE_WORKFLOW_VARIABLE_BLOCK_COMMAND = createCommand('DELETE_WORKFLOW_VARIABLE_BLOCK_COMMAND')
export const UPDATE_WORKFLOW_NODES_MAP = createCommand('UPDATE_WORKFLOW_NODES_MAP')
-
-export type WorkflowVariableBlockProps = {
- getWorkflowNode: (nodeId: string) => Node
- onInsert?: () => void
- onDelete?: () => void
- getVarType: GetVarType
-}
const WorkflowVariableBlock = memo(({
workflowNodesMap,
onInsert,
diff --git a/web/app/components/base/prompt-editor/plugins/workflow-variable-block/node.tsx b/web/app/components/base/prompt-editor/plugins/workflow-variable-block/node.tsx
index a241e752334..743937d8a67 100644
--- a/web/app/components/base/prompt-editor/plugins/workflow-variable-block/node.tsx
+++ b/web/app/components/base/prompt-editor/plugins/workflow-variable-block/node.tsx
@@ -6,7 +6,7 @@ import WorkflowVariableBlockComponent from './component'
export type WorkflowNodesMap = WorkflowVariableBlockType['workflowNodesMap']
-export type SerializedNode = SerializedLexicalNode & {
+type SerializedNode = SerializedLexicalNode & {
variables: string[]
workflowNodesMap: WorkflowNodesMap
getVarType?: GetVarType
diff --git a/web/app/components/base/radio/component/group/index.tsx b/web/app/components/base/radio/component/group/index.tsx
index 53ccd5e8333..aff9e5e3c6d 100644
--- a/web/app/components/base/radio/component/group/index.tsx
+++ b/web/app/components/base/radio/component/group/index.tsx
@@ -3,7 +3,7 @@ import { cn } from '@/utils/classnames'
import RadioGroupContext from '../../context'
import s from '../../style.module.css'
-export type TRadioGroupProps = {
+type TRadioGroupProps = {
children?: ReactNode | ReactNode[]
value?: string | number | boolean
className?: string
diff --git a/web/app/components/base/select/index.tsx b/web/app/components/base/select/index.tsx
index 2cfdcf74bc0..70ed726c38f 100644
--- a/web/app/components/base/select/index.tsx
+++ b/web/app/components/base/select/index.tsx
@@ -37,7 +37,7 @@ export type Item = {
extra?: React.ReactNode
} & Record<string, any>
-export type ISelectProps = {
+type ISelectProps = {
className?: string
wrapperClassName?: string
renderTrigger?: (value: Item | null, isOpen: boolean) => React.JSX.Element | null
diff --git a/web/app/components/base/sort/index.tsx b/web/app/components/base/sort/index.tsx
index 69562e2f3ea..901d353ec2d 100644
--- a/web/app/components/base/sort/index.tsx
+++ b/web/app/components/base/sort/index.tsx
@@ -9,7 +9,7 @@ import {
} from '@/app/components/base/portal-to-follow-elem'
import { cn } from '@/utils/classnames'
-export type Item = {
+type Item = {
value: number | string
name: string
} & Record<string, any>
diff --git a/web/app/components/base/tag/index.tsx b/web/app/components/base/tag/index.tsx
index 21e2a9c9821..dee85c998cc 100644
--- a/web/app/components/base/tag/index.tsx
+++ b/web/app/components/base/tag/index.tsx
@@ -1,7 +1,7 @@
import * as React from 'react'
import { cn } from '@/utils/classnames'
-export type ITagProps = {
+type ITagProps = {
children: string | React.ReactNode
color?: keyof typeof COLOR_MAP
className?: string
diff --git a/web/app/components/base/text-generation/types.ts b/web/app/components/base/text-generation/types.ts
index d7c03ab3eb5..62a401c3cb8 100644
--- a/web/app/components/base/text-generation/types.ts
+++ b/web/app/components/base/text-generation/types.ts
@@ -2,41 +2,11 @@ import type { ExternalDataTool } from '@/models/common'
import type {
ModelConfig,
VisionFile,
- VisionSettings,
} from '@/types/app'
export type { VisionFile } from '@/types/app'
export { TransferMethod } from '@/types/app'
-export type UserInputForm = {
- default: string
- label: string
- required: boolean
- variable: string
-}
-
-export type UserInputFormTextInput = {
- 'text-input': UserInputForm & {
- max_length: number
- }
-}
-
-export type UserInputFormSelect = {
- select: UserInputForm & {
- options: string[]
- }
-}
-
-export type UserInputFormParagraph = {
- paragraph: UserInputForm
-}
-
-export type VisionConfig = VisionSettings
-
-export type EnableType = {
- enabled: boolean
-}
-
export type TextGenerationConfig = Omit<ModelConfig, 'model'> & {
external_data_tools: ExternalDataTool[]
}
diff --git a/web/app/components/base/textarea/index.tsx b/web/app/components/base/textarea/index.tsx
index 73c6865903d..d991acb28b5 100644
--- a/web/app/components/base/textarea/index.tsx
+++ b/web/app/components/base/textarea/index.tsx
@@ -58,4 +58,4 @@ const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
Textarea.displayName = 'Textarea'
export default Textarea
-export { Textarea, textareaVariants }
+export { textareaVariants }
diff --git a/web/app/components/base/theme-switcher.tsx b/web/app/components/base/theme-switcher.tsx
index 91fb5ff2c9a..a6b69722104 100644
--- a/web/app/components/base/theme-switcher.tsx
+++ b/web/app/components/base/theme-switcher.tsx
@@ -2,7 +2,7 @@
import { useTheme } from 'next-themes'
import { cn } from '@/utils/classnames'
-export type Theme = 'light' | 'dark' | 'system'
+type Theme = 'light' | 'dark' | 'system'
export default function ThemeSwitcher() {
const { theme, setTheme } = useTheme()
diff --git a/web/app/components/base/timezone-label/index.tsx b/web/app/components/base/timezone-label/index.tsx
index bb4355f338d..385e4c782a7 100644
--- a/web/app/components/base/timezone-label/index.tsx
+++ b/web/app/components/base/timezone-label/index.tsx
@@ -3,7 +3,7 @@ import { useMemo } from 'react'
import { convertTimezoneToOffsetStr } from '@/app/components/base/date-and-time-picker/utils/dayjs'
import { cn } from '@/utils/classnames'
-export type TimezoneLabelProps = {
+type TimezoneLabelProps = {
/** IANA timezone identifier (e.g., 'Asia/Shanghai', 'America/New_York') */
timezone: string
/** Additional CSS classes to apply */
diff --git a/web/app/components/base/tooltip/content.tsx b/web/app/components/base/tooltip/content.tsx
index a5a31a2a5c6..191ee933f14 100644
--- a/web/app/components/base/tooltip/content.tsx
+++ b/web/app/components/base/tooltip/content.tsx
@@ -1,6 +1,6 @@
import type { FC, PropsWithChildren, ReactNode } from 'react'
-export type ToolTipContentProps = {
+type ToolTipContentProps = {
title?: ReactNode
action?: ReactNode
} & PropsWithChildren
diff --git a/web/app/components/base/tooltip/index.tsx b/web/app/components/base/tooltip/index.tsx
index 1588c998122..da373dea830 100644
--- a/web/app/components/base/tooltip/index.tsx
+++ b/web/app/components/base/tooltip/index.tsx
@@ -14,7 +14,7 @@ import { PortalToFollowElem, PortalToFollowElemContent, PortalToFollowElemTrigge
import { cn } from '@/utils/classnames'
import { tooltipManager } from './TooltipManager'
-export type TooltipProps = {
+type TooltipProps = {
position?: Placement
triggerMethod?: 'hover' | 'click'
triggerClassName?: string
diff --git a/web/app/components/base/ui/context-menu/index.tsx b/web/app/components/base/ui/context-menu/index.tsx
index 5a0f580ca4c..4e164b08b9b 100644
--- a/web/app/components/base/ui/context-menu/index.tsx
+++ b/web/app/components/base/ui/context-menu/index.tsx
@@ -17,8 +17,6 @@ import { cn } from '@/utils/classnames'
export const ContextMenu = BaseContextMenu.Root
export const ContextMenuTrigger = BaseContextMenu.Trigger
-export const ContextMenuPortal = BaseContextMenu.Portal
-export const ContextMenuBackdrop = BaseContextMenu.Backdrop
export const ContextMenuSub = BaseContextMenu.SubmenuRoot
export const ContextMenuGroup = BaseContextMenu.Group
export const ContextMenuRadioGroup = BaseContextMenu.RadioGroup
@@ -175,26 +173,6 @@ export function ContextMenuCheckboxItem({
)
}
-type ContextMenuIndicatorProps = Omit<React.ComponentPropsWithoutRef<'span'>, 'children'> & {
- children?: React.ReactNode
-}
-
-export function ContextMenuItemIndicator({
- className,
- children,
- ...props
-}: ContextMenuIndicatorProps) {
- return (
- <span
- aria-hidden
- className={cn(menuIndicatorClassName, className)}
- {...props}
- >
- {children ?? <span aria-hidden className="i-ri-check-line h-4 w-4" />}
- </span>
- )
-}
-
export function ContextMenuCheckboxItemIndicator({
className,
...props
@@ -239,7 +217,7 @@ export function ContextMenuSubTrigger({
{...props}
>
{children}
- <span aria-hidden className="i-ri-arrow-right-s-line ml-auto size-4 shrink-0 text-text-tertiary" />
+ <span aria-hidden className="ml-auto i-ri-arrow-right-s-line size-4 shrink-0 text-text-tertiary" />
</BaseContextMenu.SubmenuTrigger>
)
}
diff --git a/web/app/components/base/ui/dropdown-menu/index.tsx b/web/app/components/base/ui/dropdown-menu/index.tsx
index 13c2dab626d..5db5833fd7d 100644
--- a/web/app/components/base/ui/dropdown-menu/index.tsx
+++ b/web/app/components/base/ui/dropdown-menu/index.tsx
@@ -15,7 +15,6 @@ import { parsePlacement } from '@/app/components/base/ui/placement'
import { cn } from '@/utils/classnames'
export const DropdownMenu = Menu.Root
-export const DropdownMenuPortal = Menu.Portal
export const DropdownMenuTrigger = Menu.Trigger
export const DropdownMenuSub = Menu.SubmenuRoot
export const DropdownMenuGroup = Menu.Group
diff --git a/web/app/components/base/ui/number-field/index.tsx b/web/app/components/base/ui/number-field/index.tsx
index ac2ae0c7c63..924250ca223 100644
--- a/web/app/components/base/ui/number-field/index.tsx
+++ b/web/app/components/base/ui/number-field/index.tsx
@@ -113,7 +113,7 @@ export function NumberFieldUnit({
)
}
-export const numberFieldControlsVariants = cva(
+const numberFieldControlsVariants = cva(
'flex shrink-0 flex-col items-stretch border-l border-divider-subtle bg-transparent text-text-tertiary',
)
@@ -131,7 +131,7 @@ export function NumberFieldControls({
)
}
-export const numberFieldControlButtonVariants = cva(
+const numberFieldControlButtonVariants = cva(
[
'flex touch-manipulation select-none items-center justify-center px-1.5 text-text-tertiary outline-hidden transition-colors',
'hover:bg-components-input-bg-hover focus-visible:bg-components-input-bg-hover',
diff --git a/web/app/components/base/ui/scroll-area/index.tsx b/web/app/components/base/ui/scroll-area/index.tsx
index 195f9b4e81b..053d9e684a7 100644
--- a/web/app/components/base/ui/scroll-area/index.tsx
+++ b/web/app/components/base/ui/scroll-area/index.tsx
@@ -6,18 +6,17 @@ import { cn } from '@/utils/classnames'
import styles from './index.module.css'
export const ScrollAreaRoot = BaseScrollArea.Root
-export type ScrollAreaRootProps = React.ComponentPropsWithRef<typeof BaseScrollArea.Root>
+type ScrollAreaRootProps = React.ComponentPropsWithRef<typeof BaseScrollArea.Root>
export const ScrollAreaContent = BaseScrollArea.Content
-export type ScrollAreaContentProps = React.ComponentPropsWithRef<typeof BaseScrollArea.Content>
-export type ScrollAreaSlotClassNames = {
+type ScrollAreaSlotClassNames = {
viewport?: string
content?: string
scrollbar?: string
}
-export type ScrollAreaProps = Omit<ScrollAreaRootProps, 'children'> & {
+type ScrollAreaProps = Omit<ScrollAreaRootProps, 'children'> & {
children: React.ReactNode
orientation?: 'vertical' | 'horizontal'
slotClassNames?: ScrollAreaSlotClassNames
@@ -25,7 +24,7 @@ export type ScrollAreaProps = Omit<ScrollAreaRootProps, 'children'> & {
labelledBy?: string
}
-export const scrollAreaScrollbarClassName = cn(
+const scrollAreaScrollbarClassName = cn(
styles.scrollbar,
'flex touch-none select-none overflow-clip p-1 opacity-100 transition-opacity motion-reduce:transition-none',
'pointer-events-none data-hovering:pointer-events-auto',
@@ -34,20 +33,20 @@ export const scrollAreaScrollbarClassName = cn(
'data-[orientation=horizontal]:absolute data-[orientation=horizontal]:inset-x-0 data-[orientation=horizontal]:h-3 data-[orientation=horizontal]:items-center',
)
-export const scrollAreaThumbClassName = cn(
+const scrollAreaThumbClassName = cn(
'shrink-0 radius-xs bg-state-base-handle transition-[background-color] motion-reduce:transition-none',
'data-[orientation=vertical]:w-1',
'data-[orientation=horizontal]:h-1',
)
-export const scrollAreaViewportClassName = cn(
+const scrollAreaViewportClassName = cn(
'size-full min-h-0 min-w-0 outline-hidden',
'focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-components-input-border-hover',
)
-export const scrollAreaCornerClassName = 'bg-transparent'
+const scrollAreaCornerClassName = 'bg-transparent'
-export type ScrollAreaViewportProps = React.ComponentPropsWithRef<typeof BaseScrollArea.Viewport>
+type ScrollAreaViewportProps = React.ComponentPropsWithRef<typeof BaseScrollArea.Viewport>
export function ScrollAreaViewport({
className,
@@ -61,7 +60,7 @@ export function ScrollAreaViewport({
)
}
-export type ScrollAreaScrollbarProps = React.ComponentPropsWithRef<typeof BaseScrollArea.Scrollbar>
+type ScrollAreaScrollbarProps = React.ComponentPropsWithRef<typeof BaseScrollArea.Scrollbar>
export function ScrollAreaScrollbar({
className,
@@ -75,7 +74,7 @@ export function ScrollAreaScrollbar({
)
}
-export type ScrollAreaThumbProps = React.ComponentPropsWithRef<typeof BaseScrollArea.Thumb>
+type ScrollAreaThumbProps = React.ComponentPropsWithRef<typeof BaseScrollArea.Thumb>
export function ScrollAreaThumb({
className,
@@ -89,7 +88,7 @@ export function ScrollAreaThumb({
)
}
-export type ScrollAreaCornerProps = React.ComponentPropsWithRef<typeof BaseScrollArea.Corner>
+type ScrollAreaCornerProps = React.ComponentPropsWithRef<typeof BaseScrollArea.Corner>
export function ScrollAreaCorner({
className,
diff --git a/web/app/components/base/ui/select/index.tsx b/web/app/components/base/ui/select/index.tsx
index 83dfe817dc9..b9441b2d6b7 100644
--- a/web/app/components/base/ui/select/index.tsx
+++ b/web/app/components/base/ui/select/index.tsx
@@ -10,11 +10,8 @@ import { cn } from '@/utils/classnames'
export const Select = BaseSelect.Root
export const SelectValue = BaseSelect.Value
-export const SelectGroup = BaseSelect.Group
-export const SelectGroupLabel = BaseSelect.GroupLabel
-export const SelectSeparator = BaseSelect.Separator
-export const selectTriggerVariants = cva(
+const selectTriggerVariants = cva(
'',
{
variants: {
diff --git a/web/app/components/base/ui/slider/index.tsx b/web/app/components/base/ui/slider/index.tsx
index d44f5532545..b0a8c2f3767 100644
--- a/web/app/components/base/ui/slider/index.tsx
+++ b/web/app/components/base/ui/slider/index.tsx
@@ -24,7 +24,7 @@ type UncontrolledSliderProps = SliderBaseProps & {
defaultValue?: number
}
-export type SliderProps = ControlledSliderProps | UncontrolledSliderProps
+type SliderProps = ControlledSliderProps | UncontrolledSliderProps
const sliderRootClassName = 'group/slider relative inline-flex w-full data-disabled:opacity-30'
const sliderControlClassName = cn(
diff --git a/web/app/components/base/ui/toast/index.tsx b/web/app/components/base/ui/toast/index.tsx
index 0307e14dbca..abb71d371e4 100644
--- a/web/app/components/base/ui/toast/index.tsx
+++ b/web/app/components/base/ui/toast/index.tsx
@@ -35,28 +35,28 @@ const TOAST_TONE_STYLES = {
},
} satisfies Record<string, ToastToneStyle>
-export type ToastType = keyof typeof TOAST_TONE_STYLES
+type ToastType = keyof typeof TOAST_TONE_STYLES
-export type ToastAddOptions = Omit<ToastManagerAddOptions<ToastData>, 'data' | 'positionerProps' | 'type'> & {
+type ToastAddOptions = Omit<ToastManagerAddOptions<ToastData>, 'data' | 'positionerProps' | 'type'> & {
type?: ToastType
}
-export type ToastUpdateOptions = Omit<ToastManagerUpdateOptions<ToastData>, 'data' | 'positionerProps' | 'type'> & {
+type ToastUpdateOptions = Omit<ToastManagerUpdateOptions<ToastData>, 'data' | 'positionerProps' | 'type'> & {
type?: ToastType
}
-export type ToastOptions = Omit<ToastAddOptions, 'title'>
-export type TypedToastOptions = Omit<ToastOptions, 'type'>
+type ToastOptions = Omit<ToastAddOptions, 'title'>
+type TypedToastOptions = Omit<ToastOptions, 'type'>
type ToastPromiseResultOption<Value> = string | ToastUpdateOptions | ((value: Value) => string | ToastUpdateOptions)
-export type ToastPromiseOptions<Value> = {
+type ToastPromiseOptions<Value> = {
loading: string | ToastUpdateOptions
success: ToastPromiseResultOption<Value>
error: ToastPromiseResultOption<unknown>
}
-export type ToastHostProps = {
+type ToastHostProps = {
timeout?: number
limit?: number
}
@@ -65,7 +65,7 @@ type ToastDismiss = (toastId?: string) => void
type ToastCall = (title: ReactNode, options?: ToastOptions) => string
type TypedToastCall = (title: ReactNode, options?: TypedToastOptions) => string
-export type ToastApi = {
+type ToastApi = {
(title: ReactNode, options?: ToastOptions): string
success: TypedToastCall
error: TypedToastCall
diff --git a/web/app/components/base/ui/tooltip/index.tsx b/web/app/components/base/ui/tooltip/index.tsx
index b100c594c63..693a61ca1fd 100644
--- a/web/app/components/base/ui/tooltip/index.tsx
+++ b/web/app/components/base/ui/tooltip/index.tsx
@@ -8,7 +8,7 @@ import { cn } from '@/utils/classnames'
type TooltipContentVariant = 'default' | 'plain'
-export type TooltipContentProps = {
+type TooltipContentProps = {
children: React.ReactNode
placement?: Placement
sideOffset?: number
diff --git a/web/app/components/base/zendesk/utils.ts b/web/app/components/base/zendesk/utils.ts
index 961f4b96f65..35f3da74113 100644
--- a/web/app/components/base/zendesk/utils.ts
+++ b/web/app/components/base/zendesk/utils.ts
@@ -1,6 +1,6 @@
import { IS_CE_EDITION } from '@/config'
-export type ConversationField = {
+type ConversationField = {
id: string
value: any
}
diff --git a/web/app/components/billing/type.ts b/web/app/components/billing/type.ts
index e3eb8b67996..15eda0bbf67 100644
--- a/web/app/components/billing/type.ts
+++ b/web/app/components/billing/type.ts
@@ -37,22 +37,6 @@ export enum SelfHostedPlan {
enterprise = 'enterprise',
}
-export type SelfHostedPlanInfo = {
- level: number
- price: number
- modelProviders: string
- teamWorkspace: number
- teamMembers: number
- buildApps: number
- documents: number
- vectorSpace: string
- documentsRequestQuota: number
- documentProcessingPriority: Priority
- logHistory: number
- messageRequest: number
- annotatedResponse: number
-}
-
export type UsagePlanInfo = Pick<PlanInfo, 'buildApps' | 'teamMembers' | 'annotatedResponse' | 'documentsUploadQuota' | 'apiRateLimit' | 'triggerEvents'> & { vectorSpace: number }
export type UsageResetInfo = {
@@ -121,11 +105,6 @@ export type CurrentPlanInfoBackend = {
human_input_email_delivery_enabled: boolean
}
-export type SubscriptionItem = {
- plan: Plan
- url: string
-}
-
export type SubscriptionUrlsBackend = {
url: string
}
diff --git a/web/app/components/billing/upgrade-btn/style.module.css b/web/app/components/billing/upgrade-btn/style.module.css
deleted file mode 100644
index ab8c30ebd52..00000000000
--- a/web/app/components/billing/upgrade-btn/style.module.css
+++ /dev/null
@@ -1,9 +0,0 @@
-.upgradeBtn {
- background: linear-gradient(99deg, rgba(255, 255, 255, 0.12) 7.16%, rgba(255, 255, 255, 0.00) 85.47%), linear-gradient(280deg, #00B2FF 12.96%, #132BFF 90.95%);
- box-shadow: 0px 2px 4px -2px rgba(16, 24, 40, 0.06), 0px 4px 8px -2px rgba(0, 162, 253, 0.12);
-
-}
-.upgradeBtn:hover {
- background: linear-gradient(99deg, rgba(255, 255, 255, 0.12) 7.16%, rgba(255, 255, 255, 0.00) 85.47%), linear-gradient(280deg, #02C2FF 12.96%, #001AFF 90.95%);
- box-shadow: 0px 4px 6px -2px rgba(16, 18, 40, 0.08), 0px 12px 16px -4px rgba(0, 209, 255, 0.08);
-}
diff --git a/web/app/components/custom/custom-web-app-brand/style.module.css b/web/app/components/custom/custom-web-app-brand/style.module.css
deleted file mode 100644
index bdc7d7cfbfe..00000000000
--- a/web/app/components/custom/custom-web-app-brand/style.module.css
+++ /dev/null
@@ -1,3 +0,0 @@
-.mask {
- background: linear-gradient(273deg, rgba(255, 255, 255, 0.00) 51.75%, rgba(255, 255, 255, 0.80) 115.32%);
-}
diff --git a/web/app/components/datasets/chunk.tsx b/web/app/components/datasets/chunk.tsx
index 74184c8d07b..e0d820a4f3a 100644
--- a/web/app/components/datasets/chunk.tsx
+++ b/web/app/components/datasets/chunk.tsx
@@ -2,7 +2,7 @@ import type { FC, PropsWithChildren } from 'react'
import type { QA } from '@/models/datasets'
import { SelectionMod } from '../base/icons/src/public/knowledge'
-export type ChunkLabelProps = {
+type ChunkLabelProps = {
label: string
characterCount: number
}
@@ -27,7 +27,7 @@ export const ChunkLabel: FC<ChunkLabelProps> = (props) => {
)
}
-export type ChunkContainerProps = ChunkLabelProps & PropsWithChildren
+type ChunkContainerProps = ChunkLabelProps & PropsWithChildren
export const ChunkContainer: FC<ChunkContainerProps> = (props) => {
const { label, characterCount, children } = props
@@ -41,7 +41,7 @@ export const ChunkContainer: FC<ChunkContainerProps> = (props) => {
)
}
-export type QAPreviewProps = {
+type QAPreviewProps = {
qa: QA
}
diff --git a/web/app/components/datasets/common/image-uploader/image-uploader-in-chunk/index.tsx b/web/app/components/datasets/common/image-uploader/image-uploader-in-chunk/index.tsx
index 17ff348c648..ba2ede9f081 100644
--- a/web/app/components/datasets/common/image-uploader/image-uploader-in-chunk/index.tsx
+++ b/web/app/components/datasets/common/image-uploader/image-uploader-in-chunk/index.tsx
@@ -72,7 +72,7 @@ const ImageUploaderInChunk = ({
)
}
-export type ImageUploaderInChunkWrapperProps = {
+type ImageUploaderInChunkWrapperProps = {
value?: FileEntity[]
onChange: (files: FileEntity[]) => void
} & ImageUploaderInChunkProps
diff --git a/web/app/components/datasets/common/image-uploader/image-uploader-in-retrieval-testing/index.tsx b/web/app/components/datasets/common/image-uploader/image-uploader-in-retrieval-testing/index.tsx
index 5f395f3e54c..0c4da5a7e48 100644
--- a/web/app/components/datasets/common/image-uploader/image-uploader-in-retrieval-testing/index.tsx
+++ b/web/app/components/datasets/common/image-uploader/image-uploader-in-retrieval-testing/index.tsx
@@ -110,7 +110,7 @@ const ImageUploaderInRetrievalTesting = ({
)
}
-export type ImageUploaderInRetrievalTestingWrapperProps = {
+type ImageUploaderInRetrievalTestingWrapperProps = {
value?: FileEntity[]
onChange: (files: FileEntity[]) => void
} & ImageUploaderInRetrievalTestingProps
diff --git a/web/app/components/datasets/common/image-uploader/store.tsx b/web/app/components/datasets/common/image-uploader/store.tsx
index 93470190a41..45c338d8bcd 100644
--- a/web/app/components/datasets/common/image-uploader/store.tsx
+++ b/web/app/components/datasets/common/image-uploader/store.tsx
@@ -30,7 +30,7 @@ export const createFileStore = (
}
type FileStore = ReturnType<typeof createFileStore>
-export const FileContext = createContext<FileStore | null>(null)
+const FileContext = createContext<FileStore | null>(null)
export function useFileStoreWithSelector<T>(selector: (state: Shape) => T): T {
const store = useContext(FileContext)
diff --git a/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/hooks/use-dsl-import.ts b/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/hooks/use-dsl-import.ts
index 19023ccfe3a..992d0526bee 100644
--- a/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/hooks/use-dsl-import.ts
+++ b/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/hooks/use-dsl-import.ts
@@ -12,13 +12,13 @@ export enum CreateFromDSLModalTab {
FROM_FILE = 'from-file',
FROM_URL = 'from-url',
}
-export type UseDSLImportOptions = {
+type UseDSLImportOptions = {
activeTab?: CreateFromDSLModalTab
dslUrl?: string
onSuccess?: () => void
onClose?: () => void
}
-export type DSLVersions = {
+type DSLVersions = {
importedVersion: string
systemVersion: string
}
diff --git a/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/uploader.tsx b/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/uploader.tsx
index 74a51d488a4..7089c8293a5 100644
--- a/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/uploader.tsx
+++ b/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/uploader.tsx
@@ -9,7 +9,7 @@ import { toast } from '@/app/components/base/ui/toast'
import { cn } from '@/utils/classnames'
import { formatFileSize } from '@/utils/format'
-export type Props = {
+type Props = {
file: File | undefined
updateFile: (file?: File) => void
className?: string
diff --git a/web/app/components/datasets/create/embedding-process/index.module.css b/web/app/components/datasets/create/embedding-process/index.module.css
deleted file mode 100644
index 74251cacd20..00000000000
--- a/web/app/components/datasets/create/embedding-process/index.module.css
+++ /dev/null
@@ -1,91 +0,0 @@
-@reference "../../../../styles/globals.css";
-
-.progressContainer {
- @apply relative pb-4 w-full;
- border-bottom: 0.5px solid #EAECF0;
-}
-.sourceItem {
- position: relative;
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 4px;
- padding: 0 4px;
- height: 24px;
- background: #EFF4FF;
- border-radius: 6px;
- overflow: hidden;
-}
-
-.sourceItem .info .name {
- font-weight: 500;
- font-size: 12px;
- line-height: 18px;
- color: #101828;
-}
-.sourceItem.success .info .name {
- color: #05603A;
-}
-.sourceItem .percent {
- font-weight: 500;
- font-size: 12px;
- line-height: 18px;
- color: #344054;
- z-index: 1;
-}
-.sourceItem .error {
- color: #D92D20;
-}
-.sourceItem .success {
- color: #05603A;
-}
-
-.commonIcon {
- @apply w-3 h-3 mr-1 inline-block align-middle;
-}
-.highIcon {
- mask-image: url(../assets/star.svg);
- @apply bg-orange-500;
-}
-.economyIcon {
- background-color: #444ce7;
- mask-image: url(../assets/normal.svg);
-}
-.tokens {
- @apply text-xs font-medium px-1;
-}
-.price {
- color: #f79009;
- @apply text-xs font-medium;
-}
-
-.unknownFileIcon {
- background-image: url(../assets/unknown.svg);
-}
-.csv {
- background-image: url(../assets/csv.svg);
-}
-.docx {
- background-image: url(../assets/docx.svg);
-}
-.xlsx,
-.xls {
- background-image: url(../assets/xlsx.svg);
-}
-.pdf {
- background-image: url(../assets/pdf.svg);
-}
-.html,
-.htm {
- background-image: url(../assets/html.svg);
-}
-.md,
-.markdown {
- background-image: url(../assets/md.svg);
-}
-.txt {
- background-image: url(../assets/txt.svg);
-}
-.json {
- background-image: url(../assets/json.svg);
-}
diff --git a/web/app/components/datasets/create/file-uploader/hooks/use-file-upload.ts b/web/app/components/datasets/create/file-uploader/hooks/use-file-upload.ts
index a202d85b61f..05827d0a9ec 100644
--- a/web/app/components/datasets/create/file-uploader/hooks/use-file-upload.ts
+++ b/web/app/components/datasets/create/file-uploader/hooks/use-file-upload.ts
@@ -19,7 +19,7 @@ export type FileUploadConfig = {
file_upload_limit: number
}
-export type UseFileUploadOptions = {
+type UseFileUploadOptions = {
fileList: FileItem[]
prepareFileList: (files: FileItem[]) => void
onFileUpdate: (fileItem: FileItem, progress: number, list: FileItem[]) => void
@@ -33,7 +33,7 @@ export type UseFileUploadOptions = {
allowedExtensions?: string[]
}
-export type UseFileUploadReturn = {
+type UseFileUploadReturn = {
// Refs
dropRef: RefObject<HTMLDivElement | null>
dragRef: RefObject<HTMLDivElement | null>
diff --git a/web/app/components/datasets/create/file-uploader/index.module.css b/web/app/components/datasets/create/file-uploader/index.module.css
deleted file mode 100644
index a75274594d2..00000000000
--- a/web/app/components/datasets/create/file-uploader/index.module.css
+++ /dev/null
@@ -1,133 +0,0 @@
-@reference "../../../../styles/globals.css";
-
-.file {
- @apply box-border relative flex items-center justify-between;
- padding: 8px 12px 8px 8px;
- max-width: 640px;
- height: 40px;
- background: #ffffff;
- border: 0.5px solid #EAECF0;
- box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05);
- border-radius: 8px;
- overflow: hidden;
- cursor: pointer;
-}
-
-.progressbar {
- position: absolute;
- top: 0;
- left: 0;
- height: 100%;
- background-color: #F2F4F7;
-}
-
-.file.uploading,
-.file.uploading:hover {
- background: #FCFCFD;
- border: 0.5px solid #EAECF0;
-}
-
-.file.active {
- background: #F5F8FF;
- border: 1px solid #D1E0FF;
- box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05);
-}
-
-.file:hover {
- background: #F5F8FF;
- border: 1px solid #D1E0FF;
- box-shadow: 0px 4px 8px -2px rgba(16, 24, 40, 0.1), 0px 2px 4px -2px rgba(16, 24, 40, 0.06);
-}
-
-.fileIcon {
- @apply shrink-0 w-6 h-6 mr-2 bg-center bg-no-repeat;
- background-image: url(../assets/unknown.svg);
- background-size: 24px;
-}
-
-.fileIcon.csv {
- background-image: url(../assets/csv.svg);
-}
-
-.fileIcon.doc {
- background-image: url(../assets/doc.svg);
-}
-
-.fileIcon.docx {
- background-image: url(../assets/docx.svg);
-}
-
-.fileIcon.xlsx,
-.fileIcon.xls {
- background-image: url(../assets/xlsx.svg);
-}
-
-.fileIcon.pdf {
- background-image: url(../assets/pdf.svg);
-}
-
-.fileIcon.html,
-.fileIcon.htm {
- background-image: url(../assets/html.svg);
-}
-
-.fileIcon.md,
-.fileIcon.markdown {
- background-image: url(../assets/md.svg);
-}
-
-.fileIcon.txt {
- background-image: url(../assets/txt.svg);
-}
-
-.fileIcon.json {
- background-image: url(../assets/json.svg);
-}
-
-.fileInfo {
- @apply grow flex items-center;
- z-index: 1;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-
-.filename {
- font-weight: 500;
- font-size: 13px;
- line-height: 18px;
- color: #1D2939;
-}
-
-.size {
- @apply ml-3;
- font-weight: 400;
- font-size: 12px;
- line-height: 18px;
- color: #667085;
-}
-
-.actionWrapper {
- @apply flex items-center shrink-0;
- z-index: 1;
-}
-
-.actionWrapper .percent {
- font-weight: 400;
- font-size: 13px;
- line-height: 18px;
- color: #344054;
-}
-
-.actionWrapper .remove {
- display: none;
- width: 24px;
- height: 24px;
- background: center no-repeat url(../assets/trash.svg);
- background-size: 16px;
- cursor: pointer;
-}
-
-.file:hover .actionWrapper .remove {
- display: block;
-}
diff --git a/web/app/components/datasets/create/index.module.css b/web/app/components/datasets/create/index.module.css
deleted file mode 100644
index e69de29bb2d..00000000000
diff --git a/web/app/components/datasets/create/step-one/hooks/index.ts b/web/app/components/datasets/create/step-one/hooks/index.ts
index bae5ce4fce3..bccd40e5426 100644
--- a/web/app/components/datasets/create/step-one/hooks/index.ts
+++ b/web/app/components/datasets/create/step-one/hooks/index.ts
@@ -1,2 +1 @@
export { default as usePreviewState } from './use-preview-state'
-export type { PreviewActions, PreviewState, UsePreviewStateReturn } from './use-preview-state'
diff --git a/web/app/components/datasets/create/step-one/hooks/use-preview-state.ts b/web/app/components/datasets/create/step-one/hooks/use-preview-state.ts
index 3984947ab1d..79249fd84dc 100644
--- a/web/app/components/datasets/create/step-one/hooks/use-preview-state.ts
+++ b/web/app/components/datasets/create/step-one/hooks/use-preview-state.ts
@@ -4,13 +4,13 @@ import type { NotionPage } from '@/models/common'
import type { CrawlResultItem } from '@/models/datasets'
import { useCallback, useState } from 'react'
-export type PreviewState = {
+type PreviewState = {
currentFile: File | undefined
currentNotionPage: NotionPage | undefined
currentWebsite: CrawlResultItem | undefined
}
-export type PreviewActions = {
+type PreviewActions = {
showFilePreview: (file: File) => void
hideFilePreview: () => void
showNotionPagePreview: (page: NotionPage) => void
@@ -19,7 +19,7 @@ export type PreviewActions = {
hideWebsitePreview: () => void
}
-export type UsePreviewStateReturn = PreviewState & PreviewActions
+type UsePreviewStateReturn = PreviewState & PreviewActions
/**
* Custom hook for managing preview state across different data source types.
diff --git a/web/app/components/datasets/create/step-three/index.module.css b/web/app/components/datasets/create/step-three/index.module.css
deleted file mode 100644
index 221c77bb05c..00000000000
--- a/web/app/components/datasets/create/step-three/index.module.css
+++ /dev/null
@@ -1,77 +0,0 @@
-@reference "../../../../styles/globals.css";
-
-.creationInfo {
- padding-top: 42px;
-}
-.creationInfo .title {
- @apply mb-2;
- font-weight: 500;
- font-size: 20px;
- line-height: 30px;
- color: #101828;
-}
-.creationInfo .content {
- margin-bottom: 44px;
- font-weight: 400;
- font-size: 14px;
- line-height: 20px;
- color: #667085;
-}
-.creationInfo .label {
- @apply mb-2;
- font-weight: 500;
- font-size: 14px;
- line-height: 20px;
- color: #101828;
-}
-.datasetName {
- padding: 8px 12px;
- background: #F9FAFB;
- border-radius: 8px;
- font-weight: 400;
- font-size: 14px;
- line-height: 20px;
- color: #101828;
- word-break: break-all;
-}
-
-.dividerLine {
- margin: 24px 0;
- height: 1px;
- background-color: #eaecf0;
-}
-
-.sideTip {
- @apply flex flex-col items-center shrink-0 ;
- padding-top: 108px;
- width: 524px;
- border-left: 0.5px solid #F2F4F7;
-}
-.tipCard {
- @apply flex flex-col items-start p-6;
- width: 320px;
- background-color: #F9FAFB;
- box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05);
- border-radius: 12px;
-}
-.tipCard .icon {
- width: 32px;
- height: 32px;
- border: 1px solid #EAECF0;
- border-radius: 6px;
- background: center no-repeat url(../assets/book-open-01.svg);
- background-size: 16px;
-}
-.tipCard .title {
- margin: 12px 0;
- font-weight: 500;
- font-size: 16px;
- line-height: 24px;
- color: #344054;
-}
-.tipCard .content {
- font-weight: 400;
- font-size: 14px;
- line-height: 20px;
- color: #344054;
-}
diff --git a/web/app/components/datasets/create/step-two/hooks/index.ts b/web/app/components/datasets/create/step-two/hooks/index.ts
index f16daaaea58..b216ead2e6b 100644
--- a/web/app/components/datasets/create/step-two/hooks/index.ts
+++ b/web/app/components/datasets/create/step-two/hooks/index.ts
@@ -1,14 +1,10 @@
export { useDocumentCreation } from './use-document-creation'
-export type { DocumentCreation, ValidationParams } from './use-document-creation'
export { IndexingType, useIndexingConfig } from './use-indexing-config'
-export type { IndexingConfig } from './use-indexing-config'
export { useIndexingEstimate } from './use-indexing-estimate'
-export type { IndexingEstimate } from './use-indexing-estimate'
export { usePreviewState } from './use-preview-state'
-export type { PreviewState } from './use-preview-state'
export { DEFAULT_MAXIMUM_CHUNK_LENGTH, DEFAULT_OVERLAP, DEFAULT_SEGMENT_IDENTIFIER, defaultParentChildConfig, MAXIMUM_CHUNK_TOKEN_LENGTH, useSegmentationState } from './use-segmentation-state'
-export type { ParentChildConfig, SegmentationState } from './use-segmentation-state'
+export type { ParentChildConfig } from './use-segmentation-state'
diff --git a/web/app/components/datasets/create/step-two/hooks/use-document-creation.ts b/web/app/components/datasets/create/step-two/hooks/use-document-creation.ts
index eb1994276c1..1c80a188e5b 100644
--- a/web/app/components/datasets/create/step-two/hooks/use-document-creation.ts
+++ b/web/app/components/datasets/create/step-two/hooks/use-document-creation.ts
@@ -14,7 +14,7 @@ import { useInvalidDatasetList } from '@/service/knowledge/use-dataset'
import { IndexingType } from './use-indexing-config'
import { MAXIMUM_CHUNK_TOKEN_LENGTH } from './use-segmentation-state'
-export type UseDocumentCreationOptions = {
+type UseDocumentCreationOptions = {
datasetId?: string
isSetting?: boolean
documentDetail?: FullDocumentDetail
@@ -34,7 +34,7 @@ export type UseDocumentCreationOptions = {
onSave?: () => void
mutateDatasetRes?: () => void
}
-export type ValidationParams = {
+type ValidationParams = {
segmentationType: string
maxChunkLength: number
limitMaxChunkLength: number
@@ -197,4 +197,3 @@ export const useDocumentCreation = (options: UseDocumentCreationOptions) => {
validatePreviewParams,
}
}
-export type DocumentCreation = ReturnType<typeof useDocumentCreation>
diff --git a/web/app/components/datasets/create/step-two/hooks/use-indexing-config.ts b/web/app/components/datasets/create/step-two/hooks/use-indexing-config.ts
index 97fc9c260fd..a8dd5f22178 100644
--- a/web/app/components/datasets/create/step-two/hooks/use-indexing-config.ts
+++ b/web/app/components/datasets/create/step-two/hooks/use-indexing-config.ts
@@ -23,7 +23,7 @@ const DEFAULT_RETRIEVAL_CONFIG: RetrievalConfig = {
score_threshold: 0.5,
}
-export type UseIndexingConfigOptions = {
+type UseIndexingConfigOptions = {
initialIndexType?: IndexingType
initialEmbeddingModel?: DefaultModel
initialRetrievalConfig?: RetrievalConfig
@@ -139,5 +139,3 @@ export const useIndexingConfig = (options: UseIndexingConfigOptions) => {
showMultiModalTip,
}
}
-
-export type IndexingConfig = ReturnType<typeof useIndexingConfig>
diff --git a/web/app/components/datasets/create/step-two/hooks/use-indexing-estimate.ts b/web/app/components/datasets/create/step-two/hooks/use-indexing-estimate.ts
index cc5a2bcf332..ea14ef2c993 100644
--- a/web/app/components/datasets/create/step-two/hooks/use-indexing-estimate.ts
+++ b/web/app/components/datasets/create/step-two/hooks/use-indexing-estimate.ts
@@ -10,7 +10,7 @@ import {
useFetchFileIndexingEstimateForWeb,
} from '@/service/knowledge/use-create-dataset'
-export type UseIndexingEstimateOptions = {
+type UseIndexingEstimateOptions = {
dataSourceType: DataSourceType
datasetId?: string
// Document settings
@@ -119,5 +119,3 @@ export const useIndexingEstimate = (options: UseIndexingEstimateOptions) => {
reset: currentMutation.reset,
}
}
-
-export type IndexingEstimate = ReturnType<typeof useIndexingEstimate>
diff --git a/web/app/components/datasets/create/step-two/hooks/use-preview-state.ts b/web/app/components/datasets/create/step-two/hooks/use-preview-state.ts
index 94171c59470..8ac1b7904d1 100644
--- a/web/app/components/datasets/create/step-two/hooks/use-preview-state.ts
+++ b/web/app/components/datasets/create/step-two/hooks/use-preview-state.ts
@@ -3,7 +3,7 @@ import type { CrawlResultItem, CustomFile, DocumentItem, FullDocumentDetail } fr
import { useCallback, useState } from 'react'
import { DataSourceType } from '@/models/datasets'
-export type UsePreviewStateOptions = {
+type UsePreviewStateOptions = {
dataSourceType: DataSourceType
files: CustomFile[]
notionPages: NotionPage[]
@@ -123,5 +123,3 @@ export const usePreviewState = (options: UsePreviewStateOptions) => {
handlePreviewChange,
}
}
-
-export type PreviewState = ReturnType<typeof usePreviewState>
diff --git a/web/app/components/datasets/create/step-two/hooks/use-segmentation-state.ts b/web/app/components/datasets/create/step-two/hooks/use-segmentation-state.ts
index abef8a98cb5..cdd2f61c0c3 100644
--- a/web/app/components/datasets/create/step-two/hooks/use-segmentation-state.ts
+++ b/web/app/components/datasets/create/step-two/hooks/use-segmentation-state.ts
@@ -35,7 +35,7 @@ export const defaultParentChildConfig: ParentChildConfig = {
},
}
-export type UseSegmentationStateOptions = {
+type UseSegmentationStateOptions = {
initialSegmentationType?: ProcessMode
initialSummaryIndexSetting?: SummaryIndexSettingType
}
@@ -230,5 +230,3 @@ export const useSegmentationState = (options: UseSegmentationStateOptions = {})
getProcessRule,
}
}
-
-export type SegmentationState = ReturnType<typeof useSegmentationState>
diff --git a/web/app/components/datasets/documents/components/document-list/components/index.ts b/web/app/components/datasets/documents/components/document-list/components/index.ts
index 377f64a27f4..9a279e410f5 100644
--- a/web/app/components/datasets/documents/components/document-list/components/index.ts
+++ b/web/app/components/datasets/documents/components/document-list/components/index.ts
@@ -1,4 +1,2 @@
-export { default as DocumentSourceIcon } from './document-source-icon'
export { default as DocumentTableRow } from './document-table-row'
export { default as SortHeader } from './sort-header'
-export { renderTdValue } from './utils'
diff --git a/web/app/components/datasets/documents/components/document-list/index.tsx b/web/app/components/datasets/documents/components/document-list/index.tsx
deleted file mode 100644
index 46fd7a02d53..00000000000
--- a/web/app/components/datasets/documents/components/document-list/index.tsx
+++ /dev/null
@@ -1,3 +0,0 @@
-// Re-export from parent for backwards compatibility
-export { default } from '../list'
-export { renderTdValue } from './components'
diff --git a/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/constants.ts b/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/constants.ts
index cda2dae868b..5714f4d8990 100644
--- a/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/constants.ts
+++ b/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/constants.ts
@@ -1,3 +1,2 @@
export const PROGRESS_NOT_STARTED = -1
export const PROGRESS_ERROR = -2
-export const PROGRESS_COMPLETE = 100
diff --git a/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/hooks/use-local-file-upload.ts b/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/hooks/use-local-file-upload.ts
index 1f7c9ecfede..667010f661d 100644
--- a/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/hooks/use-local-file-upload.ts
+++ b/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/hooks/use-local-file-upload.ts
@@ -4,7 +4,7 @@ import { useCallback, useRef } from 'react'
import { useFileUpload } from '@/app/components/datasets/create/file-uploader/hooks/use-file-upload'
import { useDataSourceStore, useDataSourceStoreWithSelector } from '../../store'
-export type UseLocalFileUploadOptions = {
+type UseLocalFileUploadOptions = {
allowedExtensions: string[]
supportBatchUpload?: boolean
}
diff --git a/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/index.tsx b/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/index.tsx
index cb3632ba9d1..93a48f6be7d 100644
--- a/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/index.tsx
+++ b/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/index.tsx
@@ -3,7 +3,7 @@ import FileListItem from './components/file-list-item'
import UploadDropzone from './components/upload-dropzone'
import { useLocalFileUpload } from './hooks/use-local-file-upload'
-export type LocalFileProps = {
+type LocalFileProps = {
allowedExtensions: string[]
supportBatchUpload?: boolean
}
diff --git a/web/app/components/datasets/documents/create-from-pipeline/data-source/website-crawl/index.tsx b/web/app/components/datasets/documents/create-from-pipeline/data-source/website-crawl/index.tsx
index b0f25d94b7f..fc56e05b434 100644
--- a/web/app/components/datasets/documents/create-from-pipeline/data-source/website-crawl/index.tsx
+++ b/web/app/components/datasets/documents/create-from-pipeline/data-source/website-crawl/index.tsx
@@ -31,7 +31,7 @@ import Options from './base/options'
const I18N_PREFIX = 'stepOne.website'
-export type WebsiteCrawlProps = {
+type WebsiteCrawlProps = {
nodeId: string
nodeData: DataSourceNodeType
onCredentialChange: (credentialId: string) => void
diff --git a/web/app/components/datasets/documents/detail/batch-modal/csv-uploader.tsx b/web/app/components/datasets/documents/detail/batch-modal/csv-uploader.tsx
index 2e85dad26a8..7382d1abd1b 100644
--- a/web/app/components/datasets/documents/detail/batch-modal/csv-uploader.tsx
+++ b/web/app/components/datasets/documents/detail/batch-modal/csv-uploader.tsx
@@ -16,7 +16,7 @@ import { useFileUploadConfig } from '@/service/use-common'
import { Theme } from '@/types/app'
import { cn } from '@/utils/classnames'
-export type Props = {
+type Props = {
file: FileItem | undefined
updateFile: (file?: FileItem) => void
}
diff --git a/web/app/components/datasets/documents/detail/batch-modal/index.tsx b/web/app/components/datasets/documents/detail/batch-modal/index.tsx
index 1fc006831e4..ff43f5f67dc 100644
--- a/web/app/components/datasets/documents/detail/batch-modal/index.tsx
+++ b/web/app/components/datasets/documents/detail/batch-modal/index.tsx
@@ -11,7 +11,7 @@ import Modal from '@/app/components/base/modal'
import CSVDownloader from './csv-downloader'
import CSVUploader from './csv-uploader'
-export type IBatchModalProps = {
+type IBatchModalProps = {
isShow: boolean
docForm: ChunkingMode
onCancel: () => void
diff --git a/web/app/components/datasets/documents/detail/completed/hooks/index.ts b/web/app/components/datasets/documents/detail/completed/hooks/index.ts
index 858b4485630..1a6ed8bd0e0 100644
--- a/web/app/components/datasets/documents/detail/completed/hooks/index.ts
+++ b/web/app/components/datasets/documents/detail/completed/hooks/index.ts
@@ -1,14 +1,9 @@
export { useChildSegmentData } from './use-child-segment-data'
-export type { UseChildSegmentDataReturn } from './use-child-segment-data'
export { useModalState } from './use-modal-state'
-export type { CurrChildChunkType, CurrSegmentType, UseModalStateReturn } from './use-modal-state'
export { useSearchFilter } from './use-search-filter'
-export type { UseSearchFilterReturn } from './use-search-filter'
export { useSegmentListData } from './use-segment-list-data'
-export type { UseSegmentListDataReturn } from './use-segment-list-data'
export { useSegmentSelection } from './use-segment-selection'
-export type { UseSegmentSelectionReturn } from './use-segment-selection'
diff --git a/web/app/components/datasets/documents/detail/completed/hooks/use-child-segment-data.ts b/web/app/components/datasets/documents/detail/completed/hooks/use-child-segment-data.ts
index 50a22fc71f6..fab8b160194 100644
--- a/web/app/components/datasets/documents/detail/completed/hooks/use-child-segment-data.ts
+++ b/web/app/components/datasets/documents/detail/completed/hooks/use-child-segment-data.ts
@@ -8,7 +8,7 @@ import { useChildSegmentList, useChildSegmentListKey, useDeleteChildSegment, use
import { useInvalid } from '@/service/use-base'
import { useDocumentContext } from '../../context'
-export type UseChildSegmentDataOptions = {
+type UseChildSegmentDataOptions = {
searchValue: string
currentPage: number
limit: number
@@ -19,7 +19,7 @@ export type UseChildSegmentDataOptions = {
refreshChunkListDataWithDetailChanged: () => void
updateSegmentInCache: (segmentId: string, updater: (seg: SegmentDetailModel) => SegmentDetailModel) => void
}
-export type UseChildSegmentDataReturn = {
+type UseChildSegmentDataReturn = {
childSegments: ChildChunkDetail[]
isLoadingChildSegmentList: boolean
childChunkListData: ReturnType<typeof useChildSegmentList>['data']
diff --git a/web/app/components/datasets/documents/detail/completed/hooks/use-modal-state.ts b/web/app/components/datasets/documents/detail/completed/hooks/use-modal-state.ts
index ecb45ac1ee3..fa314bec258 100644
--- a/web/app/components/datasets/documents/detail/completed/hooks/use-modal-state.ts
+++ b/web/app/components/datasets/documents/detail/completed/hooks/use-modal-state.ts
@@ -1,18 +1,18 @@
import type { ChildChunkDetail, SegmentDetailModel } from '@/models/datasets'
import { useCallback, useState } from 'react'
-export type CurrSegmentType = {
+type CurrSegmentType = {
segInfo?: SegmentDetailModel
showModal: boolean
isEditMode?: boolean
}
-export type CurrChildChunkType = {
+type CurrChildChunkType = {
childChunkInfo?: ChildChunkDetail
showModal: boolean
}
-export type UseModalStateReturn = {
+type UseModalStateReturn = {
// Segment detail modal
currSegment: CurrSegmentType
onClickCard: (detail: SegmentDetailModel, isEditMode?: boolean) => void
diff --git a/web/app/components/datasets/documents/detail/completed/hooks/use-search-filter.ts b/web/app/components/datasets/documents/detail/completed/hooks/use-search-filter.ts
index e7fafa692d8..310e326fc1e 100644
--- a/web/app/components/datasets/documents/detail/completed/hooks/use-search-filter.ts
+++ b/web/app/components/datasets/documents/detail/completed/hooks/use-search-filter.ts
@@ -3,13 +3,7 @@ import { useDebounceFn } from 'ahooks'
import { useCallback, useMemo, useRef, useState } from 'react'
import { useTranslation } from 'react-i18next'
-export type SearchFilterState = {
- inputValue: string
- searchValue: string
- selectedStatus: boolean | 'all'
-}
-
-export type UseSearchFilterReturn = {
+type UseSearchFilterReturn = {
inputValue: string
searchValue: string
selectedStatus: boolean | 'all'
diff --git a/web/app/components/datasets/documents/detail/completed/hooks/use-segment-list-data.ts b/web/app/components/datasets/documents/detail/completed/hooks/use-segment-list-data.ts
index fb5db4497e6..3a3c486070e 100644
--- a/web/app/components/datasets/documents/detail/completed/hooks/use-segment-list-data.ts
+++ b/web/app/components/datasets/documents/detail/completed/hooks/use-segment-list-data.ts
@@ -14,7 +14,7 @@ import { useDocumentContext } from '../../context'
import { ProcessStatus } from '../../segment-add'
const DEFAULT_LIMIT = 10
-export type UseSegmentListDataOptions = {
+type UseSegmentListDataOptions = {
searchValue: string
selectedStatus: boolean | 'all'
selectedSegmentIds: string[]
@@ -24,7 +24,7 @@ export type UseSegmentListDataOptions = {
onCloseSegmentDetail: () => void
clearSelection: () => void
}
-export type UseSegmentListDataReturn = {
+type UseSegmentListDataReturn = {
segments: SegmentDetailModel[]
isLoadingSegmentList: boolean
segmentListData: ReturnType<typeof useSegmentList>['data']
diff --git a/web/app/components/datasets/documents/detail/completed/hooks/use-segment-selection.ts b/web/app/components/datasets/documents/detail/completed/hooks/use-segment-selection.ts
index b1adeedaf4c..e0fb0b036f0 100644
--- a/web/app/components/datasets/documents/detail/completed/hooks/use-segment-selection.ts
+++ b/web/app/components/datasets/documents/detail/completed/hooks/use-segment-selection.ts
@@ -1,7 +1,7 @@
import type { SegmentDetailModel } from '@/models/datasets'
import { useCallback, useMemo, useState } from 'react'
-export type UseSegmentSelectionReturn = {
+type UseSegmentSelectionReturn = {
selectedSegmentIds: string[]
isAllSelected: boolean
isSomeSelected: boolean
diff --git a/web/app/components/datasets/documents/detail/embedding/hooks/index.ts b/web/app/components/datasets/documents/detail/embedding/hooks/index.ts
index 603c16dda53..2d0c4fa25eb 100644
--- a/web/app/components/datasets/documents/detail/embedding/hooks/index.ts
+++ b/web/app/components/datasets/documents/detail/embedding/hooks/index.ts
@@ -1,10 +1,7 @@
export {
- calculatePercent,
- isEmbeddingStatus,
- isTerminalStatus,
+
useEmbeddingStatus,
- useInvalidateEmbeddingStatus,
+
usePauseIndexing,
useResumeIndexing,
} from './use-embedding-status'
-export type { EmbeddingStatusType } from './use-embedding-status'
diff --git a/web/app/components/datasets/documents/detail/embedding/hooks/use-embedding-status.ts b/web/app/components/datasets/documents/detail/embedding/hooks/use-embedding-status.ts
index e55cd8f9aa6..5f9314e695e 100644
--- a/web/app/components/datasets/documents/detail/embedding/hooks/use-embedding-status.ts
+++ b/web/app/components/datasets/documents/detail/embedding/hooks/use-embedding-status.ts
@@ -10,8 +10,6 @@ import {
const NAME_SPACE = 'embedding'
-export type EmbeddingStatusType = 'indexing' | 'splitting' | 'parsing' | 'cleaning' | 'completed' | 'paused' | 'error' | 'waiting' | ''
-
const EMBEDDING_STATUSES = ['indexing', 'splitting', 'parsing', 'cleaning'] as const
const TERMINAL_STATUSES = ['completed', 'error', 'paused'] as const
diff --git a/web/app/components/datasets/documents/detail/embedding/style.module.css b/web/app/components/datasets/documents/detail/embedding/style.module.css
deleted file mode 100644
index a60a583ebef..00000000000
--- a/web/app/components/datasets/documents/detail/embedding/style.module.css
+++ /dev/null
@@ -1,61 +0,0 @@
-@reference "../../../../../styles/globals.css";
-
-.progressBar {
- @apply absolute top-0 h-4;
-}
-.barPaused {
- background: linear-gradient(
- 270deg,
- rgba(208, 213, 221, 0.8) -2.21%,
- rgba(208, 213, 221, 0.5) 100%
- );
-}
-.barProcessing {
- background: linear-gradient(
- 90deg,
- rgba(41, 112, 255, 0.9) 0%,
- rgba(21, 94, 239, 0.9) 100%
- );
-}
-.opBtn {
- @apply !h-6 !w-fit !px-2 !py-1 !text-xs !text-gray-700 rounded-md;
-}
-.opIcon {
- @apply mr-1 stroke-current text-gray-700 w-3 h-3;
-}
-.progressContainer {
- @apply relative flex mb-2 h-4 rounded-md w-full;
-}
-.progressBgItem {
- @apply flex-1 border-r border-r-white first:rounded-l-md;
-}
-.progressBgItem:nth-last-child(2) {
- @apply rounded-r-md;
-}
-.progressData {
- @apply w-full flex items-center text-xs text-gray-700;
-}
-.previewTip {
- @apply pb-1 pt-12 text-gray-900 text-sm font-medium;
-}
-.embeddingStatus {
- @apply flex items-center justify-between text-gray-900 font-medium text-base mb-3;
-}
-.commonIcon {
- @apply w-3 h-3 mr-1 inline-block align-middle;
-}
-.highIcon {
- mask-image: url(../../assets/star.svg);
- @apply bg-orange-500;
-}
-.economyIcon {
- background-color: #444ce7;
- mask-image: url(../../assets/normal.svg);
-}
-.tokens {
- @apply text-xs font-medium px-1;
-}
-.price {
- color: #f79009;
- @apply text-xs font-medium;
-}
diff --git a/web/app/components/datasets/documents/detail/segment-add/index.tsx b/web/app/components/datasets/documents/detail/segment-add/index.tsx
index 0abfda328b7..dbd9f0b5e5d 100644
--- a/web/app/components/datasets/documents/detail/segment-add/index.tsx
+++ b/web/app/components/datasets/documents/detail/segment-add/index.tsx
@@ -17,7 +17,7 @@ import { Plan } from '@/app/components/billing/type'
import { useProviderContext } from '@/context/provider-context'
import { cn } from '@/utils/classnames'
-export type ISegmentAddProps = {
+type ISegmentAddProps = {
importStatus: ProcessStatus | string | undefined
clearProcessStatus: () => void
showNewSegmentModal: () => void
diff --git a/web/app/components/datasets/formatted-text/flavours/shared.tsx b/web/app/components/datasets/formatted-text/flavours/shared.tsx
index 77637f4bb24..4f68177ea39 100644
--- a/web/app/components/datasets/formatted-text/flavours/shared.tsx
+++ b/web/app/components/datasets/formatted-text/flavours/shared.tsx
@@ -3,7 +3,7 @@ import { cn } from '@/utils/classnames'
const baseStyle = 'py-[3px]'
-export type SliceContainerProps = ComponentProps<'span'>
+type SliceContainerProps = ComponentProps<'span'>
export const SliceContainer: FC<SliceContainerProps> = (
{
@@ -22,7 +22,7 @@ export const SliceContainer: FC<SliceContainerProps> = (
}
SliceContainer.displayName = 'SliceContainer'
-export type SliceLabelProps = ComponentProps<'span'> & { labelInnerClassName?: string }
+type SliceLabelProps = ComponentProps<'span'> & { labelInnerClassName?: string }
export const SliceLabel: FC<SliceLabelProps> = (
{
@@ -45,7 +45,7 @@ export const SliceLabel: FC<SliceLabelProps> = (
}
SliceLabel.displayName = 'SliceLabel'
-export type SliceContentProps = ComponentProps<'span'>
+type SliceContentProps = ComponentProps<'span'>
export const SliceContent: FC<SliceContentProps> = (
{
@@ -66,7 +66,7 @@ export const SliceContent: FC<SliceContentProps> = (
}
SliceContent.displayName = 'SliceContent'
-export type SliceDividerProps = ComponentProps<'span'>
+type SliceDividerProps = ComponentProps<'span'>
export const SliceDivider: FC<SliceDividerProps> = (
{
diff --git a/web/app/components/datasets/formatted-text/formatted.tsx b/web/app/components/datasets/formatted-text/formatted.tsx
index 0c1aad6d21d..21036ac6f31 100644
--- a/web/app/components/datasets/formatted-text/formatted.tsx
+++ b/web/app/components/datasets/formatted-text/formatted.tsx
@@ -1,7 +1,7 @@
import type { ComponentProps, FC } from 'react'
import { cn } from '@/utils/classnames'
-export type FormattedTextProps = ComponentProps<'p'>
+type FormattedTextProps = ComponentProps<'p'>
export const FormattedText: FC<FormattedTextProps> = (props) => {
const { className, ...rest } = props
diff --git a/web/app/components/datasets/hit-testing/components/mask.tsx b/web/app/components/datasets/hit-testing/components/mask.tsx
index 4568bce5a95..4510e38430c 100644
--- a/web/app/components/datasets/hit-testing/components/mask.tsx
+++ b/web/app/components/datasets/hit-testing/components/mask.tsx
@@ -5,7 +5,7 @@ type MaskProps = {
className?: string
}
-export const Mask = ({
+const Mask = ({
className,
}: MaskProps) => {
return (
diff --git a/web/app/components/datasets/preview/container.tsx b/web/app/components/datasets/preview/container.tsx
index 9bba6054a97..ed63bbc8c58 100644
--- a/web/app/components/datasets/preview/container.tsx
+++ b/web/app/components/datasets/preview/container.tsx
@@ -1,7 +1,7 @@
import type { ComponentProps, FC, ReactNode } from 'react'
import { cn } from '@/utils/classnames'
-export type PreviewContainerProps = ComponentProps<'div'> & {
+type PreviewContainerProps = ComponentProps<'div'> & {
header: ReactNode
mainClassName?: string
ref?: React.Ref<HTMLDivElement>
diff --git a/web/app/components/datasets/preview/header.tsx b/web/app/components/datasets/preview/header.tsx
index 0124d03e881..2da4e497a4d 100644
--- a/web/app/components/datasets/preview/header.tsx
+++ b/web/app/components/datasets/preview/header.tsx
@@ -1,7 +1,7 @@
import type { ComponentProps, FC } from 'react'
import { cn } from '@/utils/classnames'
-export type PreviewHeaderProps = Omit<ComponentProps<'div'>, 'title'> & {
+type PreviewHeaderProps = Omit<ComponentProps<'div'>, 'title'> & {
title: string
}
diff --git a/web/app/components/datasets/settings/permission-selector/index.tsx b/web/app/components/datasets/settings/permission-selector/index.tsx
index 5afb56f0a99..a83beffbb40 100644
--- a/web/app/components/datasets/settings/permission-selector/index.tsx
+++ b/web/app/components/datasets/settings/permission-selector/index.tsx
@@ -17,7 +17,7 @@ import { cn } from '@/utils/classnames'
import MemberItem from './member-item'
import Item from './permission-item'
-export type RoleSelectorProps = {
+type RoleSelectorProps = {
disabled?: boolean
permission?: DatasetPermission
value: string[]
diff --git a/web/app/components/devtools/react-grab/loader.tsx b/web/app/components/devtools/react-grab/loader.tsx
deleted file mode 100644
index 4ee9ad1236f..00000000000
--- a/web/app/components/devtools/react-grab/loader.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import { IS_DEV } from '@/config'
-import Script from '@/next/script'
-
-export function ReactGrabLoader() {
- if (!IS_DEV)
- return null
-
- return (
- <>
- <Script
- src="//unpkg.com/react-grab/dist/index.global.js"
- crossOrigin="anonymous"
- strategy="beforeInteractive"
- />
- </>
- )
-}
diff --git a/web/app/components/explore/category.tsx b/web/app/components/explore/category.tsx
index 47c2a4e3a79..bcc1451253e 100644
--- a/web/app/components/explore/category.tsx
+++ b/web/app/components/explore/category.tsx
@@ -7,7 +7,7 @@ import { ThumbsUp } from '@/app/components/base/icons/src/vender/line/alertsAndF
import exploreI18n from '@/i18n/en-US/explore.json'
import { cn } from '@/utils/classnames'
-export type ICategoryProps = {
+type ICategoryProps = {
className?: string
list: AppCategory[]
value: string
diff --git a/web/app/components/explore/item-operation/index.tsx b/web/app/components/explore/item-operation/index.tsx
index ecf7661559e..a0f59c269d5 100644
--- a/web/app/components/explore/item-operation/index.tsx
+++ b/web/app/components/explore/item-operation/index.tsx
@@ -14,7 +14,7 @@ import { cn } from '@/utils/classnames'
import { Pin02 } from '../../base/icons/src/vender/line/general'
import s from './style.module.css'
-export type IItemOperationProps = {
+type IItemOperationProps = {
className?: string
isItemHovering?: boolean
isPinned: boolean
diff --git a/web/app/components/explore/sidebar/app-nav-item/index.tsx b/web/app/components/explore/sidebar/app-nav-item/index.tsx
index 3f3d7a727e7..338f47c88f0 100644
--- a/web/app/components/explore/sidebar/app-nav-item/index.tsx
+++ b/web/app/components/explore/sidebar/app-nav-item/index.tsx
@@ -9,7 +9,7 @@ import ItemOperation from '@/app/components/explore/item-operation'
import { useRouter } from '@/next/navigation'
import { cn } from '@/utils/classnames'
-export type IAppNavItemProps = {
+type IAppNavItemProps = {
isMobile: boolean
name: string
id: string
diff --git a/web/app/components/goto-anything/actions/commands/command-bus.ts b/web/app/components/goto-anything/actions/commands/command-bus.ts
index 001a5c9e3a6..9252a6638f4 100644
--- a/web/app/components/goto-anything/actions/commands/command-bus.ts
+++ b/web/app/components/goto-anything/actions/commands/command-bus.ts
@@ -1,4 +1,4 @@
-export type CommandHandler = (args?: Record<string, any>) => void | Promise<void>
+type CommandHandler = (args?: Record<string, any>) => void | Promise<void>
const handlers = new Map<string, CommandHandler>()
diff --git a/web/app/components/goto-anything/actions/commands/index.ts b/web/app/components/goto-anything/actions/commands/index.ts
index 72388f6565c..5c18e87acc5 100644
--- a/web/app/components/goto-anything/actions/commands/index.ts
+++ b/web/app/components/goto-anything/actions/commands/index.ts
@@ -1,15 +1,7 @@
// Command bus (for extending with custom commands)
-export {
- type CommandHandler,
- executeCommand,
- registerCommands,
- unregisterCommands,
-} from './command-bus'
+
// Command registry system (for extending with custom commands)
-export { slashCommandRegistry, SlashCommandRegistry } from './registry'
// Command system exports
export { slashAction } from './slash'
-export { registerSlashCommands, SlashCommandProvider, unregisterSlashCommands } from './slash'
-
-export type { SlashCommandHandler } from './types'
+export { SlashCommandProvider } from './slash'
diff --git a/web/app/components/goto-anything/actions/commands/slash.tsx b/web/app/components/goto-anything/actions/commands/slash.tsx
index 25d1aa59c51..a5db24be412 100644
--- a/web/app/components/goto-anything/actions/commands/slash.tsx
+++ b/web/app/components/goto-anything/actions/commands/slash.tsx
@@ -39,7 +39,7 @@ export const slashAction: ActionItem = {
}
// Register/unregister default handlers for slash commands with external dependencies.
-export const registerSlashCommands = (deps: Record<string, any>) => {
+const registerSlashCommands = (deps: Record<string, any>) => {
// Register command handlers to the registry system with their respective dependencies
slashCommandRegistry.register(themeCommand, { setTheme: deps.setTheme })
slashCommandRegistry.register(languageCommand, { setLocale: deps.setLocale })
@@ -50,7 +50,7 @@ export const registerSlashCommands = (deps: Record<string, any>) => {
slashCommandRegistry.register(zenCommand, {})
}
-export const unregisterSlashCommands = () => {
+const unregisterSlashCommands = () => {
// Remove command handlers from registry system (automatically calls each command's unregister method)
slashCommandRegistry.unregister('theme')
slashCommandRegistry.unregister('language')
diff --git a/web/app/components/goto-anything/actions/index.ts b/web/app/components/goto-anything/actions/index.ts
index a038ef1a6c5..88b29e55970 100644
--- a/web/app/components/goto-anything/actions/index.ts
+++ b/web/app/components/goto-anything/actions/index.ts
@@ -296,4 +296,3 @@ export const matchAction = (query: string, actions: Record<string, ActionItem>)
export * from './commands'
export * from './types'
-export { appAction, knowledgeAction, pluginAction, workflowNodesAction }
diff --git a/web/app/components/goto-anything/components/empty-state.tsx b/web/app/components/goto-anything/components/empty-state.tsx
index a07bc1d45a5..1f18fec6d56 100644
--- a/web/app/components/goto-anything/components/empty-state.tsx
+++ b/web/app/components/goto-anything/components/empty-state.tsx
@@ -4,9 +4,9 @@ import type { FC } from 'react'
import type { ActionItem } from '../actions/types'
import { useTranslation } from 'react-i18next'
-export type EmptyStateVariant = 'no-results' | 'error' | 'default' | 'loading'
+type EmptyStateVariant = 'no-results' | 'error' | 'default' | 'loading'
-export type EmptyStateProps = {
+type EmptyStateProps = {
variant: EmptyStateVariant
searchMode?: string
error?: Error | null
diff --git a/web/app/components/goto-anything/components/footer.tsx b/web/app/components/goto-anything/components/footer.tsx
index f74cb49747e..b835d7d0706 100644
--- a/web/app/components/goto-anything/components/footer.tsx
+++ b/web/app/components/goto-anything/components/footer.tsx
@@ -3,7 +3,7 @@
import type { FC } from 'react'
import { useTranslation } from 'react-i18next'
-export type FooterProps = {
+type FooterProps = {
resultCount: number
searchMode: string
isError: boolean
diff --git a/web/app/components/goto-anything/components/index.ts b/web/app/components/goto-anything/components/index.ts
index e26a69f25b1..d430a156967 100644
--- a/web/app/components/goto-anything/components/index.ts
+++ b/web/app/components/goto-anything/components/index.ts
@@ -1,14 +1,7 @@
export { default as EmptyState } from './empty-state'
-export type { EmptyStateProps, EmptyStateVariant } from './empty-state'
export { default as Footer } from './footer'
-export type { FooterProps } from './footer'
-
-export { default as ResultItem } from './result-item'
-export type { ResultItemProps } from './result-item'
export { default as ResultList } from './result-list'
-export type { ResultListProps } from './result-list'
export { default as SearchInput } from './search-input'
-export type { SearchInputProps } from './search-input'
diff --git a/web/app/components/goto-anything/components/result-item.tsx b/web/app/components/goto-anything/components/result-item.tsx
index ea15d265fdf..d6ec49ac227 100644
--- a/web/app/components/goto-anything/components/result-item.tsx
+++ b/web/app/components/goto-anything/components/result-item.tsx
@@ -4,7 +4,7 @@ import type { FC } from 'react'
import type { SearchResult } from '../actions/types'
import { Command } from 'cmdk'
-export type ResultItemProps = {
+type ResultItemProps = {
result: SearchResult
onSelect: () => void
}
diff --git a/web/app/components/goto-anything/components/result-list.tsx b/web/app/components/goto-anything/components/result-list.tsx
index 6f1c5005b7c..3a380dea5f5 100644
--- a/web/app/components/goto-anything/components/result-list.tsx
+++ b/web/app/components/goto-anything/components/result-list.tsx
@@ -6,7 +6,7 @@ import { Command } from 'cmdk'
import { useTranslation } from 'react-i18next'
import ResultItem from './result-item'
-export type ResultListProps = {
+type ResultListProps = {
groupedResults: Record<string, SearchResult[]>
onSelect: (result: SearchResult) => void
}
diff --git a/web/app/components/goto-anything/components/search-input.tsx b/web/app/components/goto-anything/components/search-input.tsx
index d01cdfda95c..4cca85fea95 100644
--- a/web/app/components/goto-anything/components/search-input.tsx
+++ b/web/app/components/goto-anything/components/search-input.tsx
@@ -6,7 +6,7 @@ import { useTranslation } from 'react-i18next'
import Input from '@/app/components/base/input'
import ShortcutsName from '@/app/components/workflow/shortcuts-name'
-export type SearchInputProps = {
+type SearchInputProps = {
inputRef: RefObject<HTMLInputElement | null>
value: string
onChange: (value: string) => void
diff --git a/web/app/components/goto-anything/hooks/index.ts b/web/app/components/goto-anything/hooks/index.ts
index 2c5681dce5c..c918a0c2bb7 100644
--- a/web/app/components/goto-anything/hooks/index.ts
+++ b/web/app/components/goto-anything/hooks/index.ts
@@ -1,11 +1,7 @@
export { useGotoAnythingModal } from './use-goto-anything-modal'
-export type { UseGotoAnythingModalReturn } from './use-goto-anything-modal'
export { useGotoAnythingNavigation } from './use-goto-anything-navigation'
-export type { UseGotoAnythingNavigationOptions, UseGotoAnythingNavigationReturn } from './use-goto-anything-navigation'
export { useGotoAnythingResults } from './use-goto-anything-results'
-export type { UseGotoAnythingResultsOptions, UseGotoAnythingResultsReturn } from './use-goto-anything-results'
export { useGotoAnythingSearch } from './use-goto-anything-search'
-export type { UseGotoAnythingSearchReturn } from './use-goto-anything-search'
diff --git a/web/app/components/goto-anything/hooks/use-goto-anything-modal.ts b/web/app/components/goto-anything/hooks/use-goto-anything-modal.ts
index 8b0d6531849..3e616cdd95a 100644
--- a/web/app/components/goto-anything/hooks/use-goto-anything-modal.ts
+++ b/web/app/components/goto-anything/hooks/use-goto-anything-modal.ts
@@ -5,7 +5,7 @@ import { useKeyPress } from 'ahooks'
import { useCallback, useEffect, useRef, useState } from 'react'
import { getKeyboardKeyCodeBySystem, isEventTargetInputArea } from '@/app/components/workflow/utils/common'
-export type UseGotoAnythingModalReturn = {
+type UseGotoAnythingModalReturn = {
show: boolean
setShow: (show: boolean | ((prev: boolean) => boolean)) => void
inputRef: RefObject<HTMLInputElement | null>
diff --git a/web/app/components/goto-anything/hooks/use-goto-anything-navigation.ts b/web/app/components/goto-anything/hooks/use-goto-anything-navigation.ts
index 9c9871fa1d9..1c75adbf729 100644
--- a/web/app/components/goto-anything/hooks/use-goto-anything-navigation.ts
+++ b/web/app/components/goto-anything/hooks/use-goto-anything-navigation.ts
@@ -8,14 +8,14 @@ import { selectWorkflowNode } from '@/app/components/workflow/utils/node-navigat
import { useRouter } from '@/next/navigation'
import { slashCommandRegistry } from '../actions/commands/registry'
-export type UseGotoAnythingNavigationReturn = {
+type UseGotoAnythingNavigationReturn = {
handleCommandSelect: (commandKey: string) => void
handleNavigate: (result: SearchResult) => void
activePlugin: Plugin | undefined
setActivePlugin: (plugin: Plugin | undefined) => void
}
-export type UseGotoAnythingNavigationOptions = {
+type UseGotoAnythingNavigationOptions = {
Actions: Record<string, ActionItem>
setSearchQuery: (query: string) => void
clearSelection: () => void
diff --git a/web/app/components/goto-anything/hooks/use-goto-anything-results.ts b/web/app/components/goto-anything/hooks/use-goto-anything-results.ts
index dabbd8039cf..8fac699fdc0 100644
--- a/web/app/components/goto-anything/hooks/use-goto-anything-results.ts
+++ b/web/app/components/goto-anything/hooks/use-goto-anything-results.ts
@@ -6,7 +6,7 @@ import { useEffect, useMemo } from 'react'
import { useGetLanguage } from '@/context/i18n'
import { matchAction, searchAnything } from '../actions'
-export type UseGotoAnythingResultsReturn = {
+type UseGotoAnythingResultsReturn = {
searchResults: SearchResult[]
dedupedResults: SearchResult[]
groupedResults: Record<string, SearchResult[]>
@@ -15,7 +15,7 @@ export type UseGotoAnythingResultsReturn = {
error: Error | null
}
-export type UseGotoAnythingResultsOptions = {
+type UseGotoAnythingResultsOptions = {
searchQueryDebouncedValue: string
searchMode: string
isCommandsMode: boolean
@@ -48,7 +48,7 @@ export const useGotoAnythingResults = (
const { data: searchResults = [], isLoading, isError, error } = useQuery(
{
- // eslint-disable-next-line @tanstack/query/exhaustive-deps -- Actions intentionally excluded: contains non-serializable functions; actionKeys provides stable representation
+
queryKey: [
'goto-anything',
'search-result',
diff --git a/web/app/components/goto-anything/hooks/use-goto-anything-search.ts b/web/app/components/goto-anything/hooks/use-goto-anything-search.ts
index dd88fc315b2..486da787eba 100644
--- a/web/app/components/goto-anything/hooks/use-goto-anything-search.ts
+++ b/web/app/components/goto-anything/hooks/use-goto-anything-search.ts
@@ -6,7 +6,7 @@ import { useCallback, useMemo, useState } from 'react'
import { createActions, matchAction } from '../actions'
import { useGotoAnythingContext } from '../context'
-export type UseGotoAnythingSearchReturn = {
+type UseGotoAnythingSearchReturn = {
searchQuery: string
setSearchQuery: (query: string) => void
searchQueryDebouncedValue: string
diff --git a/web/app/components/header/account-dropdown/menu-item-content.tsx b/web/app/components/header/account-dropdown/menu-item-content.tsx
index 47f00420476..3a5e0211ed0 100644
--- a/web/app/components/header/account-dropdown/menu-item-content.tsx
+++ b/web/app/components/header/account-dropdown/menu-item-content.tsx
@@ -4,7 +4,7 @@ import { cn } from '@/utils/classnames'
const menuLabelClassName = 'min-w-0 grow truncate px-1 text-text-secondary system-md-regular'
const menuLeadingIconClassName = 'size-4 shrink-0 text-text-tertiary'
-export const menuTrailingIconClassName = 'size-[14px] shrink-0 text-text-tertiary'
+const menuTrailingIconClassName = 'size-[14px] shrink-0 text-text-tertiary'
type MenuItemContentProps = {
iconClassName: string
diff --git a/web/app/components/header/account-dropdown/workplace-selector/index.module.css b/web/app/components/header/account-dropdown/workplace-selector/index.module.css
deleted file mode 100644
index c3184f7e18c..00000000000
--- a/web/app/components/header/account-dropdown/workplace-selector/index.module.css
+++ /dev/null
@@ -1,5 +0,0 @@
-.popup {
- left: 4px;
- transform: translateX(-100%);
- box-shadow: 0px 12px 16px -4px rgba(16, 24, 40, 0.08), 0px 4px 6px -2px rgba(16, 24, 40, 0.03);
-}
diff --git a/web/app/components/header/account-setting/key-validator/declarations.ts b/web/app/components/header/account-setting/key-validator/declarations.ts
index 7e14fa1f5e4..374256ff415 100644
--- a/web/app/components/header/account-setting/key-validator/declarations.ts
+++ b/web/app/components/header/account-setting/key-validator/declarations.ts
@@ -33,11 +33,3 @@ export type KeyFrom = {
text: string
link: string
}
-
-export type KeyValidatorProps = {
- type: string
- title: React.ReactNode
- status: Status
- forms: Form[]
- keyFrom: KeyFrom
-}
diff --git a/web/app/components/header/account-setting/key-validator/index.tsx b/web/app/components/header/account-setting/key-validator/index.tsx
index f97802feb01..0e65eb9a359 100644
--- a/web/app/components/header/account-setting/key-validator/index.tsx
+++ b/web/app/components/header/account-setting/key-validator/index.tsx
@@ -6,7 +6,7 @@ import { useValidate } from './hooks'
import KeyInput from './KeyInput'
import Operate from './Operate'
-export type KeyValidatorProps = {
+type KeyValidatorProps = {
type: string
title: React.ReactNode
status: Status
diff --git a/web/app/components/header/account-setting/language-page/index.module.css b/web/app/components/header/account-setting/language-page/index.module.css
deleted file mode 100644
index 7c2a8836395..00000000000
--- a/web/app/components/header/account-setting/language-page/index.module.css
+++ /dev/null
@@ -1,24 +0,0 @@
-.google-icon {
- background: url(../../assets/google.svg) center center no-repeat;
- background-size: 16px 16px;
-}
-
-.github-icon {
- background: url(../../assets/github.svg) center center no-repeat;
- background-size: 16px 16px;
-}
-
-.twitter-icon {
- background: url(../../assets/twitter.svg) center center no-repeat;
- background-size: 16px 16px;
-}
-
-.bitbucket-icon {
- background: url(../../assets/bitbucket.svg) center center no-repeat;
- background-size: 16px 16px;
-}
-
-.salesforce-icon {
- background: url(../../assets/salesforce.svg) center center no-repeat;
- background-size: 24px auto;
-}
diff --git a/web/app/components/header/account-setting/members-page/invite-modal/role-selector.tsx b/web/app/components/header/account-setting/members-page/invite-modal/role-selector.tsx
index 6383b203d97..5d9b80bd1ef 100644
--- a/web/app/components/header/account-setting/members-page/invite-modal/role-selector.tsx
+++ b/web/app/components/header/account-setting/members-page/invite-modal/role-selector.tsx
@@ -17,7 +17,7 @@ const roleI18nKeyMap = {
export type RoleKey = keyof typeof roleI18nKeyMap
-export type RoleSelectorProps = {
+type RoleSelectorProps = {
value: RoleKey
onChange: (role: RoleKey) => void
}
diff --git a/web/app/components/header/account-setting/members-page/invited-modal/index.tsx b/web/app/components/header/account-setting/members-page/invited-modal/index.tsx
index dbabb384a21..5a62346d408 100644
--- a/web/app/components/header/account-setting/members-page/invited-modal/index.tsx
+++ b/web/app/components/header/account-setting/members-page/invited-modal/index.tsx
@@ -8,7 +8,7 @@ import { IS_CE_EDITION } from '@/config'
import InvitationLink from './invitation-link'
export type SuccessInvitationResult = Extract<InvitationResult, { status: 'success' }>
-export type FailedInvitationResult = Extract<InvitationResult, { status: 'failed' }>
+type FailedInvitationResult = Extract<InvitationResult, { status: 'failed' }>
type IInvitedModalProps = {
invitationResults: InvitationResult[]
diff --git a/web/app/components/header/account-setting/model-provider-page/declarations.ts b/web/app/components/header/account-setting/model-provider-page/declarations.ts
index 6c961637cd8..cc700fe5c6a 100644
--- a/web/app/components/header/account-setting/model-provider-page/declarations.ts
+++ b/web/app/components/header/account-setting/model-provider-page/declarations.ts
@@ -72,9 +72,6 @@ export enum ModelFeatureEnum {
}
export enum ModelFeatureTextEnum {
- toolCall = 'Tool Call',
- multiToolCall = 'Multi Tool Call',
- agentThought = 'Agent Thought',
vision = 'Vision',
video = 'Video',
document = 'Document',
@@ -90,21 +87,6 @@ export enum ModelStatusEnum {
credentialRemoved = 'credential-removed',
}
-export const MODEL_STATUS_TEXT: { [k: string]: TypeWithI18N } = {
- 'no-configure': {
- en_US: 'No Configure',
- zh_Hans: '未配置凭据',
- },
- 'quota-exceeded': {
- en_US: 'Quota Exceeded',
- zh_Hans: '额度不足',
- },
- 'no-permission': {
- en_US: 'No Permission',
- zh_Hans: '无使用权限',
- },
-}
-
export enum CustomConfigurationStatusEnum {
active = 'active',
noConfigure = 'no-configure',
@@ -171,8 +153,6 @@ export enum CurrentSystemQuotaTypeEnum {
export enum QuotaUnitEnum {
times = 'times',
- tokens = 'tokens',
- credits = 'credits',
}
export type QuotaConfiguration = {
@@ -203,11 +183,6 @@ export type CustomModelCredential = CustomModel & {
current_credential_name?: string
}
-export type CredentialWithModel = Credential & {
- model: string
- model_type: ModelTypeEnum
-}
-
export type ModelProvider = {
provider: string
label: TypeWithI18N
diff --git a/web/app/components/header/account-setting/model-provider-page/derive-model-status.ts b/web/app/components/header/account-setting/model-provider-page/derive-model-status.ts
index f9eb93536e1..ce73d115480 100644
--- a/web/app/components/header/account-setting/model-provider-page/derive-model-status.ts
+++ b/web/app/components/header/account-setting/model-provider-page/derive-model-status.ts
@@ -2,7 +2,7 @@ import type { Model, ModelItem, ModelProvider } from './declarations'
import type { CredentialPanelState } from './provider-added-card/use-credential-panel-state'
import { ModelStatusEnum } from './declarations'
-export type DerivedModelStatus
+type DerivedModelStatus
= | 'empty'
| 'active'
| 'configure-required'
diff --git a/web/app/components/header/account-setting/model-provider-page/model-auth/index.tsx b/web/app/components/header/account-setting/model-provider-page/model-auth/index.tsx
index a33cfcc36b7..1967f591bb6 100644
--- a/web/app/components/header/account-setting/model-provider-page/model-auth/index.tsx
+++ b/web/app/components/header/account-setting/model-provider-page/model-auth/index.tsx
@@ -2,7 +2,7 @@ export { default as AddCredentialInLoadBalancing } from './add-credential-in-loa
export { default as AddCustomModel } from './add-custom-model'
export { default as Authorized } from './authorized'
export { default as ConfigModel } from './config-model'
-export { default as ConfigProvider } from './config-provider'
+
export { default as CredentialSelector } from './credential-selector'
export { default as ManageCustomModelCredentials } from './manage-custom-model-credentials'
export { default as SwitchCredentialInLoadBalancing } from './switch-credential-in-load-balancing'
diff --git a/web/app/components/header/account-setting/model-provider-page/model-parameter-modal/agent-model-trigger.tsx b/web/app/components/header/account-setting/model-provider-page/model-parameter-modal/agent-model-trigger.tsx
index b8d8cd1a870..16d94958f85 100644
--- a/web/app/components/header/account-setting/model-provider-page/model-parameter-modal/agent-model-trigger.tsx
+++ b/web/app/components/header/account-setting/model-provider-page/model-parameter-modal/agent-model-trigger.tsx
@@ -25,7 +25,7 @@ import ConfigurationButton from './configuration-button'
import ModelDisplay from './model-display'
import StatusIndicators from './status-indicators'
-export type AgentModelTriggerProps = {
+type AgentModelTriggerProps = {
open?: boolean
disabled?: boolean
currentProvider?: ModelProvider
diff --git a/web/app/components/header/account-setting/model-provider-page/model-parameter-modal/derive-trigger-status.ts b/web/app/components/header/account-setting/model-provider-page/model-parameter-modal/derive-trigger-status.ts
index 8492107eabb..08614604dd5 100644
--- a/web/app/components/header/account-setting/model-provider-page/model-parameter-modal/derive-trigger-status.ts
+++ b/web/app/components/header/account-setting/model-provider-page/model-parameter-modal/derive-trigger-status.ts
@@ -1,12 +1,9 @@
-import type { DerivedModelStatus } from '../derive-model-status'
import {
DERIVED_MODEL_STATUS_BADGE_I18N,
DERIVED_MODEL_STATUS_TOOLTIP_I18N,
deriveModelStatus,
} from '../derive-model-status'
-export type TriggerStatus = DerivedModelStatus
-
export const deriveTriggerStatus = deriveModelStatus
export const TRIGGER_STATUS_BADGE_I18N = DERIVED_MODEL_STATUS_BADGE_I18N
export const TRIGGER_STATUS_TOOLTIP_I18N = DERIVED_MODEL_STATUS_TOOLTIP_I18N
diff --git a/web/app/components/header/account-setting/model-provider-page/provider-added-card/cooldown-timer.tsx b/web/app/components/header/account-setting/model-provider-page/provider-added-card/cooldown-timer.tsx
index 9ff705e4b80..47e3ccffaad 100644
--- a/web/app/components/header/account-setting/model-provider-page/provider-added-card/cooldown-timer.tsx
+++ b/web/app/components/header/account-setting/model-provider-page/provider-added-card/cooldown-timer.tsx
@@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next'
import SimplePieChart from '@/app/components/base/simple-pie-chart'
import Tooltip from '@/app/components/base/tooltip'
-export type CooldownTimerProps = {
+type CooldownTimerProps = {
secondsRemaining?: number
onFinish?: () => void
}
diff --git a/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-list-item.tsx b/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-list-item.tsx
index 595525d0142..469557b92dd 100644
--- a/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-list-item.tsx
+++ b/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-list-item.tsx
@@ -19,7 +19,7 @@ import { ConfigModel } from '../model-auth'
import ModelIcon from '../model-icon'
import ModelName from '../model-name'
-export type ModelListItemProps = {
+type ModelListItemProps = {
model: ModelItem
provider: ModelProvider
isConfigurable: boolean
diff --git a/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-load-balancing-configs.tsx b/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-load-balancing-configs.tsx
index c0da1ee2fbc..997ba402cdd 100644
--- a/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-load-balancing-configs.tsx
+++ b/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-load-balancing-configs.tsx
@@ -24,7 +24,7 @@ import Indicator from '../../../indicator'
import { ConfigurationMethodEnum } from '../declarations'
import CooldownTimer from './cooldown-timer'
-export type ModelLoadBalancingConfigsProps = {
+type ModelLoadBalancingConfigsProps = {
draftConfig?: ModelLoadBalancingConfig
setDraftConfig: Dispatch<SetStateAction<ModelLoadBalancingConfig | undefined>>
provider: ModelProvider
diff --git a/web/app/components/header/account-setting/model-provider-page/status-mapping.ts b/web/app/components/header/account-setting/model-provider-page/status-mapping.ts
deleted file mode 100644
index 2de2876e202..00000000000
--- a/web/app/components/header/account-setting/model-provider-page/status-mapping.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import { ModelStatusEnum } from './declarations'
-
-export const MODEL_STATUS_I18N_KEY: Partial<Record<ModelStatusEnum, string>> = {
- [ModelStatusEnum.quotaExceeded]: 'modelProvider.selector.creditsExhausted',
- [ModelStatusEnum.noConfigure]: 'modelProvider.selector.configureRequired',
- [ModelStatusEnum.noPermission]: 'modelProvider.selector.incompatible',
- [ModelStatusEnum.disabled]: 'modelProvider.selector.disabled',
- [ModelStatusEnum.credentialRemoved]: 'modelProvider.selector.apiKeyUnavailable',
-}
diff --git a/web/app/components/header/nav/index.module.css b/web/app/components/header/nav/index.module.css
deleted file mode 100644
index e69de29bb2d..00000000000
diff --git a/web/app/components/plugins/card/index.tsx b/web/app/components/plugins/card/index.tsx
index d1af00182f1..2d48985f927 100644
--- a/web/app/components/plugins/card/index.tsx
+++ b/web/app/components/plugins/card/index.tsx
@@ -22,7 +22,7 @@ import OrgInfo from './base/org-info'
import Placeholder from './base/placeholder'
import Title from './base/title'
-export type Props = {
+type Props = {
className?: string
payload: Plugin
titleLeft?: React.ReactNode
diff --git a/web/app/components/plugins/marketplace/types.ts b/web/app/components/plugins/marketplace/types.ts
index e4e2dbd9357..b17ab5d9753 100644
--- a/web/app/components/plugins/marketplace/types.ts
+++ b/web/app/components/plugins/marketplace/types.ts
@@ -1,5 +1,3 @@
-import type { Plugin } from '../types'
-
export type SearchParamsFromCollection = {
query?: string
sort_by?: string
@@ -17,16 +15,6 @@ export type MarketplaceCollection = {
search_params?: SearchParamsFromCollection
}
-export type MarketplaceCollectionsResponse = {
- collections: MarketplaceCollection[]
- total: number
-}
-
-export type MarketplaceCollectionPluginsResponse = {
- plugins: Plugin[]
- total: number
-}
-
export type PluginsSearchParams = {
query: string
page?: number
@@ -50,10 +38,3 @@ export type CollectionsAndPluginsSearchParams = {
exclude?: string[]
type?: 'plugin' | 'bundle'
}
-
-export type SearchParams = {
- language?: string
- q?: string
- tags?: string
- category?: string
-}
diff --git a/web/app/components/plugins/plugin-detail-panel/detail-header/hooks/index.ts b/web/app/components/plugins/plugin-detail-panel/detail-header/hooks/index.ts
index 47b4d9b9a5f..4d4c4f182b0 100644
--- a/web/app/components/plugins/plugin-detail-panel/detail-header/hooks/index.ts
+++ b/web/app/components/plugins/plugin-detail-panel/detail-header/hooks/index.ts
@@ -1,3 +1,3 @@
export { useDetailHeaderState } from './use-detail-header-state'
-export type { ModalStates, UseDetailHeaderStateReturn, VersionPickerState, VersionTarget } from './use-detail-header-state'
+export type { ModalStates, VersionTarget } from './use-detail-header-state'
export { usePluginOperations } from './use-plugin-operations'
diff --git a/web/app/components/plugins/plugin-detail-panel/detail-header/hooks/use-detail-header-state.ts b/web/app/components/plugins/plugin-detail-panel/detail-header/hooks/use-detail-header-state.ts
index 763ed9c992f..3af7fc41730 100644
--- a/web/app/components/plugins/plugin-detail-panel/detail-header/hooks/use-detail-header-state.ts
+++ b/web/app/components/plugins/plugin-detail-panel/detail-header/hooks/use-detail-header-state.ts
@@ -29,7 +29,7 @@ export type ModalStates = {
hideDeleting: () => void
}
-export type VersionPickerState = {
+type VersionPickerState = {
isShow: boolean
setIsShow: (show: boolean) => void
targetVersion: VersionTarget
@@ -38,7 +38,7 @@ export type VersionPickerState = {
setIsDowngrade: (downgrade: boolean) => void
}
-export type UseDetailHeaderStateReturn = {
+type UseDetailHeaderStateReturn = {
modalStates: ModalStates
versionPicker: VersionPickerState
hasNewVersion: boolean
diff --git a/web/app/components/plugins/plugin-detail-panel/model-selector/index.tsx b/web/app/components/plugins/plugin-detail-panel/model-selector/index.tsx
index dc8f448753d..33e9912f87c 100644
--- a/web/app/components/plugins/plugin-detail-panel/model-selector/index.tsx
+++ b/web/app/components/plugins/plugin-detail-panel/model-selector/index.tsx
@@ -29,7 +29,7 @@ import { fetchAndMergeValidCompletionParams } from '@/utils/completion-params'
import LLMParamsPanel from './llm-params-panel'
import TTSParamsPanel from './tts-params-panel'
-export type ModelParameterModalProps = {
+type ModelParameterModalProps = {
popupClassName?: string
isAdvancedMode: boolean
value: any
diff --git a/web/app/components/plugins/plugin-detail-panel/subscription-list/create/components/modal-steps.tsx b/web/app/components/plugins/plugin-detail-panel/subscription-list/create/components/modal-steps.tsx
index 7b037efbc87..e21e49040e4 100644
--- a/web/app/components/plugins/plugin-detail-panel/subscription-list/create/components/modal-steps.tsx
+++ b/web/app/components/plugins/plugin-detail-panel/subscription-list/create/components/modal-steps.tsx
@@ -19,7 +19,7 @@ type StatusStepProps = {
text: string
}
-export const StatusStep = ({ isActive, text }: StatusStepProps) => {
+const StatusStep = ({ isActive, text }: StatusStepProps) => {
return (
<div className={`system-2xs-semibold-uppercase flex items-center gap-1 ${isActive
? 'text-state-accent-solid'
@@ -81,7 +81,7 @@ type SubscriptionFormProps = {
endpoint?: string
}
-export const SubscriptionForm = ({
+const SubscriptionForm = ({
subscriptionFormRef,
endpoint,
}: SubscriptionFormProps) => {
@@ -143,7 +143,7 @@ type AutoParametersFormProps = {
credentialId: string
}
-export const AutoParametersForm = ({
+const AutoParametersForm = ({
schemas,
formRef,
pluginId,
@@ -192,7 +192,7 @@ type ManualPropertiesSectionProps = {
pluginName: string
}
-export const ManualPropertiesSection = ({
+const ManualPropertiesSection = ({
schemas,
formRef,
onChange,
diff --git a/web/app/components/plugins/plugin-detail-panel/subscription-list/create/hooks/use-common-modal-state.ts b/web/app/components/plugins/plugin-detail-panel/subscription-list/create/hooks/use-common-modal-state.ts
index 99c42f6fc59..339f782b45d 100644
--- a/web/app/components/plugins/plugin-detail-panel/subscription-list/create/hooks/use-common-modal-state.ts
+++ b/web/app/components/plugins/plugin-detail-panel/subscription-list/create/hooks/use-common-modal-state.ts
@@ -31,7 +31,7 @@ export enum ApiKeyStep {
Configuration = 'configuration',
}
-export const CREDENTIAL_TYPE_MAP: Record<SupportedCreationMethods, TriggerCredentialTypeEnum> = {
+const CREDENTIAL_TYPE_MAP: Record<SupportedCreationMethods, TriggerCredentialTypeEnum> = {
[SupportedCreationMethods.APIKEY]: TriggerCredentialTypeEnum.ApiKey,
[SupportedCreationMethods.OAUTH]: TriggerCredentialTypeEnum.Oauth2,
[SupportedCreationMethods.MANUAL]: TriggerCredentialTypeEnum.Unauthorized,
diff --git a/web/app/components/plugins/plugin-detail-panel/subscription-list/index.tsx b/web/app/components/plugins/plugin-detail-panel/subscription-list/index.tsx
index 96ce983f384..c152b8ffbf5 100644
--- a/web/app/components/plugins/plugin-detail-panel/subscription-list/index.tsx
+++ b/web/app/components/plugins/plugin-detail-panel/subscription-list/index.tsx
@@ -14,7 +14,6 @@ type SubscriptionListProps = {
pluginDetail?: PluginDetail
}
-export { SubscriptionSelectorEntry } from './selector-entry'
export type { SimpleSubscription } from './types'
export const SubscriptionList = withErrorBoundary(({
diff --git a/web/app/components/plugins/plugin-detail-panel/tool-selector/components/index.ts b/web/app/components/plugins/plugin-detail-panel/tool-selector/components/index.ts
index a3cb4fe6d5c..f6a1401d5c9 100644
--- a/web/app/components/plugins/plugin-detail-panel/tool-selector/components/index.ts
+++ b/web/app/components/plugins/plugin-detail-panel/tool-selector/components/index.ts
@@ -1,4 +1,3 @@
-export { default as ReasoningConfigForm } from './reasoning-config-form'
export { default as SchemaModal } from './schema-modal'
export { default as ToolAuthorizationSection } from './tool-authorization-section'
export { default as ToolBaseForm } from './tool-base-form'
diff --git a/web/app/components/plugins/plugin-detail-panel/tool-selector/hooks/index.ts b/web/app/components/plugins/plugin-detail-panel/tool-selector/hooks/index.ts
index 06218b97990..fa874d01007 100644
--- a/web/app/components/plugins/plugin-detail-panel/tool-selector/hooks/index.ts
+++ b/web/app/components/plugins/plugin-detail-panel/tool-selector/hooks/index.ts
@@ -1,3 +1,2 @@
export { usePluginInstalledCheck } from './use-plugin-installed-check'
export { useToolSelectorState } from './use-tool-selector-state'
-export type { TabType, ToolSelectorState, UseToolSelectorStateProps } from './use-tool-selector-state'
diff --git a/web/app/components/plugins/plugin-detail-panel/tool-selector/hooks/use-tool-selector-state.ts b/web/app/components/plugins/plugin-detail-panel/tool-selector/hooks/use-tool-selector-state.ts
index e5edea56793..45645df16e4 100644
--- a/web/app/components/plugins/plugin-detail-panel/tool-selector/hooks/use-tool-selector-state.ts
+++ b/web/app/components/plugins/plugin-detail-panel/tool-selector/hooks/use-tool-selector-state.ts
@@ -18,7 +18,7 @@ import { usePluginInstalledCheck } from './use-plugin-installed-check'
export type TabType = 'settings' | 'params'
-export type UseToolSelectorStateProps = {
+type UseToolSelectorStateProps = {
value?: ToolValue
onSelect: (tool: ToolValue) => void
onSelectMultiple?: (tool: ToolValue[]) => void
@@ -247,5 +247,3 @@ export const useToolSelectorState = ({
getSettingsValue,
}
}
-
-export type ToolSelectorState = ReturnType<typeof useToolSelectorState>
diff --git a/web/app/components/plugins/plugin-page/context.ts b/web/app/components/plugins/plugin-page/context.ts
index 04ab1eef199..fe3706f4f72 100644
--- a/web/app/components/plugins/plugin-page/context.ts
+++ b/web/app/components/plugins/plugin-page/context.ts
@@ -13,7 +13,7 @@ import { PLUGIN_PAGE_TABS_MAP } from '../hooks'
export type PluginPageTab = typeof PLUGIN_PAGE_TABS_MAP[keyof typeof PLUGIN_PAGE_TABS_MAP]
| (typeof PLUGIN_TYPE_SEARCH_MAP)[keyof typeof PLUGIN_TYPE_SEARCH_MAP]
-export type PluginPageContextValue = {
+type PluginPageContextValue = {
containerRef: RefObject<HTMLDivElement | null>
currentPluginID: string | undefined
setCurrentPluginID: (pluginID?: string) => void
diff --git a/web/app/components/plugins/plugin-page/plugin-tasks/components/plugin-item.tsx b/web/app/components/plugins/plugin-page/plugin-tasks/components/plugin-item.tsx
index 2b88336522f..ca9963e426c 100644
--- a/web/app/components/plugins/plugin-page/plugin-tasks/components/plugin-item.tsx
+++ b/web/app/components/plugins/plugin-page/plugin-tasks/components/plugin-item.tsx
@@ -3,7 +3,7 @@ import type { PluginStatus } from '@/app/components/plugins/types'
import type { Locale } from '@/i18n-config'
import CardIcon from '@/app/components/plugins/card/base/card-icon'
-export type PluginItemProps = {
+type PluginItemProps = {
plugin: PluginStatus
getIconUrl: (icon: string) => string
language: Locale
diff --git a/web/app/components/plugins/plugin-page/plugin-tasks/components/plugin-section.tsx b/web/app/components/plugins/plugin-page/plugin-tasks/components/plugin-section.tsx
index 5a6dfe00942..838d2c31191 100644
--- a/web/app/components/plugins/plugin-page/plugin-tasks/components/plugin-section.tsx
+++ b/web/app/components/plugins/plugin-page/plugin-tasks/components/plugin-section.tsx
@@ -3,7 +3,7 @@ import type { PluginStatus } from '@/app/components/plugins/types'
import type { Locale } from '@/i18n-config'
import PluginItem from './plugin-item'
-export type PluginSectionProps = {
+type PluginSectionProps = {
title: string
count: number
plugins: PluginStatus[]
diff --git a/web/app/components/plugins/plugin-page/plugin-tasks/components/task-status-indicator.tsx b/web/app/components/plugins/plugin-page/plugin-tasks/components/task-status-indicator.tsx
index 084c8f90f97..5d5ef914789 100644
--- a/web/app/components/plugins/plugin-page/plugin-tasks/components/task-status-indicator.tsx
+++ b/web/app/components/plugins/plugin-page/plugin-tasks/components/task-status-indicator.tsx
@@ -9,7 +9,7 @@ import Tooltip from '@/app/components/base/tooltip'
import DownloadingIcon from '@/app/components/header/plugins-nav/downloading-icon'
import { cn } from '@/utils/classnames'
-export type TaskStatusIndicatorProps = {
+type TaskStatusIndicatorProps = {
tip: string
isInstalling: boolean
isInstallingWithSuccess: boolean
diff --git a/web/app/components/plugins/reference-setting-modal/style.module.css b/web/app/components/plugins/reference-setting-modal/style.module.css
deleted file mode 100644
index 15bedd84ca4..00000000000
--- a/web/app/components/plugins/reference-setting-modal/style.module.css
+++ /dev/null
@@ -1,7 +0,0 @@
-.textGradient {
- background: linear-gradient(92deg, #2250F2 -29.55%, #0EBCF3 75.22%);
- -webkit-background-clip: text;
- -webkit-text-fill-color: transparent;
- background-clip: text;
- text-fill-color: transparent;
-}
diff --git a/web/app/components/plugins/types.ts b/web/app/components/plugins/types.ts
index c5aa710be74..bcffad06e04 100644
--- a/web/app/components/plugins/types.ts
+++ b/web/app/components/plugins/types.ts
@@ -143,23 +143,6 @@ export type ParametersSchema = {
description: Record<Locale, string>
}
-export type PropertiesSchema = {
- type: FormTypeEnum
- name: string
- scope: any
- required: boolean
- default: any
- options: Array<{
- value: string
- label: Record<Locale, string>
- icon?: string
- }>
- label: Record<Locale, string>
- help: Record<Locale, string>
- url: any
- placeholder: any
-}
-
export type TriggerEventParameter = {
name: string
label: TypeWithI18N
@@ -353,10 +336,6 @@ export type GitHubUrlInfo = {
}
// endpoint
-export type EndpointOperationResponse = {
- result: 'success' | 'error'
-}
-
export type EndpointsResponse = {
endpoints: EndpointListItem[]
has_more: boolean
@@ -364,12 +343,6 @@ export type EndpointsResponse = {
total: number
page: number
}
-export type UpdateEndpointRequest = {
- endpoint_id: string
- settings: Record<string, any>
- name: string
-}
-
export enum InstallStep {
uploading = 'uploading',
uploadFailed = 'uploadFailed',
@@ -454,20 +427,12 @@ export type TaskStatusResponse = {
task: PluginTask
}
-export type PluginTasksResponse = {
- tasks: PluginTask[]
-}
-
export type MetaData = {
repo: string
version: string
package: string
}
-export type InstalledPluginListResponse = {
- plugins: PluginDetail[]
-}
-
export type InstalledPluginListWithTotalResponse = {
plugins: PluginDetail[]
total: number
diff --git a/web/app/components/rag-pipeline/store/index.ts b/web/app/components/rag-pipeline/store/index.ts
index 4840e1ddd16..732076d5460 100644
--- a/web/app/components/rag-pipeline/store/index.ts
+++ b/web/app/components/rag-pipeline/store/index.ts
@@ -28,7 +28,6 @@ export type RagPipelineSliceShape = {
setIsPreparingDataSource: (isPreparingDataSource: boolean) => void
}
-export type CreateRagPipelineSliceSlice = StateCreator<RagPipelineSliceShape>
export const createRagPipelineSliceSlice: StateCreator<RagPipelineSliceShape> = set => ({
pipelineId: '',
knowledgeName: '',
diff --git a/web/app/components/share/text-generation/index.tsx b/web/app/components/share/text-generation/index.tsx
index 16444748a12..a6b54137f13 100644
--- a/web/app/components/share/text-generation/index.tsx
+++ b/web/app/components/share/text-generation/index.tsx
@@ -16,7 +16,7 @@ import { useTextGenerationBatch } from './hooks/use-text-generation-batch'
import TextGenerationResultPanel from './text-generation-result-panel'
import TextGenerationSidebar from './text-generation-sidebar'
-export type IMainProps = {
+type IMainProps = {
isInstalledApp?: boolean
installedAppInfo?: InstalledApp
isWorkflow?: boolean
diff --git a/web/app/components/share/text-generation/no-data/index.tsx b/web/app/components/share/text-generation/no-data/index.tsx
index 31a3a19b476..5885f607543 100644
--- a/web/app/components/share/text-generation/no-data/index.tsx
+++ b/web/app/components/share/text-generation/no-data/index.tsx
@@ -5,7 +5,7 @@ import {
import * as React from 'react'
import { useTranslation } from 'react-i18next'
-export type INoDataProps = {}
+type INoDataProps = {}
const NoData: FC<INoDataProps> = () => {
const { t } = useTranslation()
return (
diff --git a/web/app/components/share/text-generation/result/index.tsx b/web/app/components/share/text-generation/result/index.tsx
index b4a6119a534..09c87c61bbb 100644
--- a/web/app/components/share/text-generation/result/index.tsx
+++ b/web/app/components/share/text-generation/result/index.tsx
@@ -15,7 +15,7 @@ import NoData from '@/app/components/share/text-generation/no-data'
import { useResultRunState } from './hooks/use-result-run-state'
import { useResultSender } from './hooks/use-result-sender'
-export type IResultProps = {
+type IResultProps = {
isWorkflow: boolean
isCallBatchAPI: boolean
isPC: boolean
diff --git a/web/app/components/share/text-generation/run-batch/csv-download/index.tsx b/web/app/components/share/text-generation/run-batch/csv-download/index.tsx
index cd36627e2cb..a179029cb76 100644
--- a/web/app/components/share/text-generation/run-batch/csv-download/index.tsx
+++ b/web/app/components/share/text-generation/run-batch/csv-download/index.tsx
@@ -7,7 +7,7 @@ import {
} from 'react-papaparse'
import { Download02 as DownloadIcon } from '@/app/components/base/icons/src/vender/solid/general'
-export type ICSVDownloadProps = {
+type ICSVDownloadProps = {
vars: { name: string }[]
}
diff --git a/web/app/components/share/text-generation/run-batch/csv-reader/index.tsx b/web/app/components/share/text-generation/run-batch/csv-reader/index.tsx
index 48b9ab0ea47..299e35bdaa8 100644
--- a/web/app/components/share/text-generation/run-batch/csv-reader/index.tsx
+++ b/web/app/components/share/text-generation/run-batch/csv-reader/index.tsx
@@ -9,7 +9,7 @@ import {
import { Csv as CSVIcon } from '@/app/components/base/icons/src/public/files'
import { cn } from '@/utils/classnames'
-export type Props = {
+type Props = {
onParsed: (data: string[][]) => void
}
diff --git a/web/app/components/share/text-generation/run-batch/index.tsx b/web/app/components/share/text-generation/run-batch/index.tsx
index eabfb4e6dbd..bdb8b78ecff 100644
--- a/web/app/components/share/text-generation/run-batch/index.tsx
+++ b/web/app/components/share/text-generation/run-batch/index.tsx
@@ -12,7 +12,7 @@ import { cn } from '@/utils/classnames'
import CSVDownload from './csv-download'
import CSVReader from './csv-reader'
-export type IRunBatchProps = {
+type IRunBatchProps = {
vars: { name: string }[]
onSend: (data: string[][]) => void
isAllFinished: boolean
diff --git a/web/app/components/share/text-generation/run-batch/res-download/index.tsx b/web/app/components/share/text-generation/run-batch/res-download/index.tsx
index 5d810aca20d..012693003be 100644
--- a/web/app/components/share/text-generation/run-batch/res-download/index.tsx
+++ b/web/app/components/share/text-generation/run-batch/res-download/index.tsx
@@ -10,7 +10,7 @@ import ActionButton from '@/app/components/base/action-button'
import Button from '@/app/components/base/button'
import { cn } from '@/utils/classnames'
-export type IResDownloadProps = {
+type IResDownloadProps = {
isMobile: boolean
values: Record<string, string>[]
}
diff --git a/web/app/components/share/text-generation/run-once/index.tsx b/web/app/components/share/text-generation/run-once/index.tsx
index e4385a894fb..484291088c4 100644
--- a/web/app/components/share/text-generation/run-once/index.tsx
+++ b/web/app/components/share/text-generation/run-once/index.tsx
@@ -24,7 +24,7 @@ import { CodeLanguage } from '@/app/components/workflow/nodes/code/types'
import useBreakpoints, { MediaType } from '@/hooks/use-breakpoints'
import { cn } from '@/utils/classnames'
-export type IRunOnceProps = {
+type IRunOnceProps = {
siteInfo: SiteInfo
promptConfig: PromptConfig
inputs: Record<string, InputValueTypes>
diff --git a/web/app/components/tools/mcp/hooks/use-mcp-modal-form.ts b/web/app/components/tools/mcp/hooks/use-mcp-modal-form.ts
index 13d26a47387..6d88d52c4c9 100644
--- a/web/app/components/tools/mcp/hooks/use-mcp-modal-form.ts
+++ b/web/app/components/tools/mcp/hooks/use-mcp-modal-form.ts
@@ -40,7 +40,7 @@ export const isValidUrl = (string: string) => {
export const isValidServerID = (str: string) => {
return /^[a-z0-9_-]{1,24}$/.test(str)
}
-export type MCPModalFormState = {
+type MCPModalFormState = {
url: string
name: string
appIcon: AppIconSelection
@@ -55,7 +55,7 @@ export type MCPModalFormState = {
clientID: string
credentials: string
}
-export type MCPModalFormActions = {
+type MCPModalFormActions = {
setUrl: (url: string) => void
setName: (name: string) => void
setAppIcon: (icon: AppIconSelection) => void
diff --git a/web/app/components/tools/mcp/mcp-server-modal.tsx b/web/app/components/tools/mcp/mcp-server-modal.tsx
index 85025809fb1..7d85df7b55e 100644
--- a/web/app/components/tools/mcp/mcp-server-modal.tsx
+++ b/web/app/components/tools/mcp/mcp-server-modal.tsx
@@ -17,7 +17,7 @@ import {
} from '@/service/use-tools'
import { cn } from '@/utils/classnames'
-export type ModalProps = {
+type ModalProps = {
appID: string
latestParams?: any[]
data?: MCPServerDetail
diff --git a/web/app/components/tools/mcp/mcp-service-card.tsx b/web/app/components/tools/mcp/mcp-service-card.tsx
index f6d509c41c3..5845ba0e347 100644
--- a/web/app/components/tools/mcp/mcp-service-card.tsx
+++ b/web/app/components/tools/mcp/mcp-service-card.tsx
@@ -149,7 +149,7 @@ function getTooltipContent({
}
// Main component
-export type IAppCardProps = {
+type IAppCardProps = {
appInfo: AppDetailResponse & Partial<AppSSO>
triggerModeDisabled?: boolean
triggerModeMessage?: ReactNode
diff --git a/web/app/components/tools/mcp/modal.tsx b/web/app/components/tools/mcp/modal.tsx
index 2ca4ced8685..2de71ba924f 100644
--- a/web/app/components/tools/mcp/modal.tsx
+++ b/web/app/components/tools/mcp/modal.tsx
@@ -23,7 +23,7 @@ import AuthenticationSection from './sections/authentication-section'
import ConfigurationsSection from './sections/configurations-section'
import HeadersSection from './sections/headers-section'
-export type MCPModalConfirmPayload = {
+type MCPModalConfirmPayload = {
name: string
server_url: string
icon_type: AppIconType
@@ -43,7 +43,7 @@ export type MCPModalConfirmPayload = {
}
}
-export type DuplicateAppModalProps = {
+type DuplicateAppModalProps = {
data?: ToolWithProvider
show: boolean
onConfirm: (info: MCPModalConfirmPayload) => void
diff --git a/web/app/components/tools/types.ts b/web/app/components/tools/types.ts
index 59c36967b5d..c7fb9eec2ae 100644
--- a/web/app/components/tools/types.ts
+++ b/web/app/components/tools/types.ts
@@ -6,11 +6,6 @@ type LocalizedText<T = string> = {
[key: string]: T
}
-export enum LOC {
- tools = 'tools',
- app = 'app',
-}
-
export enum AuthType {
none = 'none',
apiKey = 'api_key', // backward compatibility
diff --git a/web/app/components/workflow-app/hooks/use-workflow-run-utils.ts b/web/app/components/workflow-app/hooks/use-workflow-run-utils.ts
index c2e339d8d94..62b09cfe740 100644
--- a/web/app/components/workflow-app/hooks/use-workflow-run-utils.ts
+++ b/web/app/components/workflow-app/hooks/use-workflow-run-utils.ts
@@ -19,7 +19,7 @@ export type HandleRunOptions = {
allNodeIds?: string[]
}
-export type DebuggableTriggerType = Exclude<TriggerType, TriggerType.UserInput>
+type DebuggableTriggerType = Exclude<TriggerType, TriggerType.UserInput>
type AppDetailLike = {
id?: string
@@ -53,14 +53,14 @@ type TriggerDebugRunnerOptions = {
setWorkflowRunningData: ListeningStateActions['setWorkflowRunningData']
}
-export const controllerKeyMap: Record<DebuggableTriggerType, string> = {
+const controllerKeyMap: Record<DebuggableTriggerType, string> = {
[TriggerType.Webhook]: '__webhookDebugAbortController',
[TriggerType.Plugin]: '__pluginDebugAbortController',
[TriggerType.All]: '__allTriggersDebugAbortController',
[TriggerType.Schedule]: '__scheduleDebugAbortController',
}
-export const debugLabelMap: Record<DebuggableTriggerType, string> = {
+const debugLabelMap: Record<DebuggableTriggerType, string> = {
[TriggerType.Webhook]: 'Webhook',
[TriggerType.Plugin]: 'Plugin',
[TriggerType.All]: 'All',
@@ -306,7 +306,7 @@ export const normalizePublishedWorkflowNodes = (publishedWorkflow: VersionHistor
}))
}
-export const waitWithAbort = (signal: AbortSignal, delay: number) => new Promise<void>((resolve) => {
+const waitWithAbort = (signal: AbortSignal, delay: number) => new Promise<void>((resolve) => {
const timer = window.setTimeout(resolve, delay)
signal.addEventListener('abort', () => {
clearTimeout(timer)
diff --git a/web/app/components/workflow-app/store/workflow/workflow-slice.ts b/web/app/components/workflow-app/store/workflow/workflow-slice.ts
index 72230629f09..bc283208437 100644
--- a/web/app/components/workflow-app/store/workflow/workflow-slice.ts
+++ b/web/app/components/workflow-app/store/workflow/workflow-slice.ts
@@ -17,7 +17,6 @@ export type WorkflowSliceShape = {
setHasShownOnboarding: (hasShownOnboarding: boolean) => void
}
-export type CreateWorkflowSlice = StateCreator<WorkflowSliceShape>
export const createWorkflowSlice: StateCreator<WorkflowSliceShape> = set => ({
appId: '',
appName: '',
diff --git a/web/app/components/workflow/__tests__/fixtures.ts b/web/app/components/workflow/__tests__/fixtures.ts
index a340e38abb7..b7884f28359 100644
--- a/web/app/components/workflow/__tests__/fixtures.ts
+++ b/web/app/components/workflow/__tests__/fixtures.ts
@@ -1,4 +1,4 @@
-import type { CommonEdgeType, CommonNodeType, Edge, Node, ToolWithProvider, WorkflowRunningData } from '../types'
+import type { CommonEdgeType, CommonNodeType, Edge, Node, WorkflowRunningData } from '../types'
import type { NodeTracing } from '@/types/workflow'
import { Position } from 'reactflow'
import { CUSTOM_NODE } from '../constants'
@@ -88,34 +88,6 @@ export function createEdge(overrides: Omit<Partial<Edge>, 'data'> & { data?: Par
} as Edge
}
-export function createLinearGraph(nodeCount: number): { nodes: Node[], edges: Edge[] } {
- const nodes: Node[] = []
- const edges: Edge[] = []
-
- for (let i = 0; i < nodeCount; i++) {
- const type = i === 0 ? BlockEnum.Start : BlockEnum.Code
- nodes.push(createNode({
- id: `n${i}`,
- position: { x: i * 300, y: 0 },
- data: { type, title: `Node ${i}`, desc: '' },
- }))
- if (i > 0) {
- edges.push(createEdge({
- id: `e-n${i - 1}-n${i}`,
- source: `n${i - 1}`,
- target: `n${i}`,
- sourceHandle: 'source',
- targetHandle: 'target',
- data: {
- sourceType: i === 1 ? BlockEnum.Start : BlockEnum.Code,
- targetType: BlockEnum.Code,
- },
- }))
- }
- }
- return { nodes, edges }
-}
-
// ---------------------------------------------------------------------------
// Workflow-level factories
// ---------------------------------------------------------------------------
@@ -162,28 +134,3 @@ export function createNodeTracing(
...overrides,
}
}
-
-export function createToolWithProvider(
- overrides?: Partial<ToolWithProvider>,
-): ToolWithProvider {
- return {
- id: 'tool-provider-1',
- name: 'test-tool',
- author: 'test',
- description: { en_US: 'Test tool', zh_Hans: '测试工具' },
- icon: '/icon.svg',
- icon_dark: '/icon-dark.svg',
- label: { en_US: 'Test Tool', zh_Hans: '测试工具' },
- type: 'builtin',
- team_credentials: {},
- is_team_authorization: false,
- allow_delete: true,
- labels: [],
- tools: [],
- meta: { version: '0.0.1' },
- plugin_id: 'plugin-1',
- ...overrides,
- }
-}
-
-export { BlockEnum, NodeRunningStatus }
diff --git a/web/app/components/workflow/__tests__/workflow-test-env.tsx b/web/app/components/workflow/__tests__/workflow-test-env.tsx
index 1ee601317b0..bbc5fe98dda 100644
--- a/web/app/components/workflow/__tests__/workflow-test-env.tsx
+++ b/web/app/components/workflow/__tests__/workflow-test-env.tsx
@@ -114,7 +114,7 @@ export function createTestWorkflowStore(initialState?: Partial<Shape>): Workflow
return store
}
-export function createTestHooksStore(props?: Partial<HooksStoreShape>): HooksStore {
+function createTestHooksStore(props?: Partial<HooksStoreShape>): HooksStore {
const store = createHooksStore(props ?? {})
if (props)
store.setState(props)
diff --git a/web/app/components/workflow/block-selector/hooks.ts b/web/app/components/workflow/block-selector/hooks.ts
index ad21df1cb81..c47f2fa75a4 100644
--- a/web/app/components/workflow/block-selector/hooks.ts
+++ b/web/app/components/workflow/block-selector/hooks.ts
@@ -5,7 +5,7 @@ import {
useState,
} from 'react'
import { useTranslation } from 'react-i18next'
-import { BLOCKS, START_BLOCKS } from './constants'
+import { BLOCKS } from './constants'
import {
TabsEnum,
ToolTypeEnum,
@@ -22,17 +22,6 @@ export const useBlocks = () => {
})
}
-export const useStartBlocks = () => {
- const { t } = useTranslation()
-
- return START_BLOCKS.map((block) => {
- return {
- ...block,
- title: t(`blocks.${block.type}`, { ns: 'workflow' }),
- }
- })
-}
-
export const useTabs = ({
noBlocks,
noSources,
diff --git a/web/app/components/workflow/block-selector/tabs.tsx b/web/app/components/workflow/block-selector/tabs.tsx
index 4f7df70c197..7038460c845 100644
--- a/web/app/components/workflow/block-selector/tabs.tsx
+++ b/web/app/components/workflow/block-selector/tabs.tsx
@@ -20,7 +20,7 @@ import Blocks from './blocks'
import DataSources from './data-sources'
import { TabsEnum } from './types'
-export type TabsProps = {
+type TabsProps = {
activeTab: TabsEnum
onActiveTabChange: (activeTab: TabsEnum) => void
searchText: string
diff --git a/web/app/components/workflow/block-selector/types.ts b/web/app/components/workflow/block-selector/types.ts
index 39e7b033bd6..dc6551c45cb 100644
--- a/web/app/components/workflow/block-selector/types.ts
+++ b/web/app/components/workflow/block-selector/types.ts
@@ -124,35 +124,6 @@ export type DataSourceItem = {
is_authorized: boolean
}
-// Backend API types - exact match with Python definitions
-export type TriggerParameter = {
- multiple: boolean
- name: string
- label: TypeWithI18N
- description?: TypeWithI18N
- type: 'string' | 'number' | 'boolean' | 'select' | 'file' | 'files'
- | 'model-selector' | 'app-selector' | 'object' | 'array' | 'dynamic-select'
- auto_generate?: {
- type: string
- value?: unknown
- } | null
- template?: {
- type: string
- value?: unknown
- } | null
- scope?: string | null
- required?: boolean
- default?: unknown
- min?: number | null
- max?: number | null
- precision?: number | null
- options?: Array<{
- value: string
- label: TypeWithI18N
- icon?: string | null
- }> | null
-}
-
export type TriggerCredentialField = {
type: 'secret-input' | 'text-input' | 'select' | 'boolean'
| 'app-selector' | 'model-selector' | 'tools-selector'
@@ -170,31 +141,6 @@ export type TriggerCredentialField = {
placeholder?: TypeWithI18N
}
-export type TriggerSubscriptionSchema = {
- parameters_schema: TriggerParameter[]
- properties_schema: TriggerCredentialField[]
-}
-
-export type TriggerIdentity = {
- author: string
- name: string
- label: TypeWithI18N
- provider: string
-}
-
-export type TriggerDescription = {
- human: TypeWithI18N
- llm: TypeWithI18N
-}
-
-export type TriggerApiEntity = {
- name: string
- identity: TriggerIdentity
- description: TypeWithI18N
- parameters: TriggerParameter[]
- output_schema?: Record<string, unknown>
-}
-
export type TriggerProviderApiEntity = {
author: string
name: string
@@ -272,11 +218,6 @@ export type TriggerOAuthClientParams = {
scope?: string
}
-export type TriggerOAuthResponse = {
- authorization_url: string
- subscription_builder: TriggerSubscriptionBuilder
-}
-
export type TriggerLogEntity = {
id: string
endpoint: string
diff --git a/web/app/components/workflow/context.tsx b/web/app/components/workflow/context.tsx
index ca3185b714e..4680b49d1a2 100644
--- a/web/app/components/workflow/context.tsx
+++ b/web/app/components/workflow/context.tsx
@@ -11,7 +11,7 @@ import {
type WorkflowStore = ReturnType<typeof createWorkflowStore>
export const WorkflowContext = createContext<WorkflowStore | null>(null)
-export type WorkflowProviderProps = {
+type WorkflowProviderProps = {
children: React.ReactNode
injectWorkflowStoreSliceFn?: StateCreator<SliceFromInjection>
}
diff --git a/web/app/components/workflow/header/undo-redo.tsx b/web/app/components/workflow/header/undo-redo.tsx
index c6b91972c91..9cab2540164 100644
--- a/web/app/components/workflow/header/undo-redo.tsx
+++ b/web/app/components/workflow/header/undo-redo.tsx
@@ -8,7 +8,7 @@ import Divider from '../../base/divider'
import TipPopup from '../operator/tip-popup'
import { useWorkflowHistoryStore } from '../workflow-history-store'
-export type UndoRedoProps = { handleUndo: () => void, handleRedo: () => void }
+type UndoRedoProps = { handleUndo: () => void, handleRedo: () => void }
const UndoRedo: FC<UndoRedoProps> = ({ handleUndo, handleRedo }) => {
const { t } = useTranslation()
const { store } = useWorkflowHistoryStore()
diff --git a/web/app/components/workflow/hooks-store/store.ts b/web/app/components/workflow/hooks-store/store.ts
index 7530de6d2ee..a9d5003fb3d 100644
--- a/web/app/components/workflow/hooks-store/store.ts
+++ b/web/app/components/workflow/hooks-store/store.ts
@@ -163,7 +163,3 @@ export function useHooksStore<T>(selector: (state: Shape) => T): T {
return useZustandStore(store, selector)
}
-
-export const useHooksStoreApi = () => {
- return useContext(HooksStoreContext)!
-}
diff --git a/web/app/components/workflow/hooks/index.ts b/web/app/components/workflow/hooks/index.ts
index 4b879738e7f..2d4369568fc 100644
--- a/web/app/components/workflow/hooks/index.ts
+++ b/web/app/components/workflow/hooks/index.ts
@@ -6,7 +6,6 @@ export * from './use-edges-interactions'
export * from './use-inspect-vars-crud'
export * from './use-node-data-update'
export * from './use-nodes-interactions'
-export * from './use-nodes-layout'
export * from './use-nodes-meta-data'
export * from './use-nodes-sync-draft'
export * from './use-panel-interactions'
diff --git a/web/app/components/workflow/hooks/use-node-plugin-installation.ts b/web/app/components/workflow/hooks/use-node-plugin-installation.ts
index 7c88685c985..55f8982efe3 100644
--- a/web/app/components/workflow/hooks/use-node-plugin-installation.ts
+++ b/web/app/components/workflow/hooks/use-node-plugin-installation.ts
@@ -24,7 +24,7 @@ import {
matchTriggerProvider,
} from '../utils/plugin-install-check'
-export type InstallationState = {
+type InstallationState = {
isChecking: boolean
isMissing: boolean
uniqueIdentifier?: string
diff --git a/web/app/components/workflow/hooks/use-nodes-layout.ts b/web/app/components/workflow/hooks/use-nodes-layout.ts
deleted file mode 100644
index 07387037919..00000000000
--- a/web/app/components/workflow/hooks/use-nodes-layout.ts
+++ /dev/null
@@ -1,96 +0,0 @@
-import type {
- Edge,
- Node,
-} from '../types'
-import ELK from 'elkjs/lib/elk.bundled.js'
-import { cloneDeep } from 'es-toolkit/object'
-import { useCallback } from 'react'
-import {
- useReactFlow,
- useStoreApi,
-} from 'reactflow'
-import { AUTO_LAYOUT_OFFSET } from '../constants'
-import { useWorkflowStore } from '../store'
-import { useNodesSyncDraft } from './use-nodes-sync-draft'
-
-const layoutOptions = {
- 'elk.algorithm': 'layered',
- 'elk.direction': 'RIGHT',
- 'elk.layered.spacing.nodeNodeBetweenLayers': '60',
- 'elk.spacing.nodeNode': '40',
- 'elk.layered.nodePlacement.strategy': 'SIMPLE',
-}
-
-const elk = new ELK()
-
-export const getLayoutedNodes = async (nodes: Node[], edges: Edge[]) => {
- const graph = {
- id: 'root',
- layoutOptions,
- children: nodes.map((n) => {
- return {
- ...n,
- width: n.width ?? 150,
- height: n.height ?? 50,
- targetPosition: 'left',
- sourcePosition: 'right',
- }
- }),
- edges: cloneDeep(edges),
- }
-
- const layoutedGraph = await elk.layout(graph as any)
- const layoutedNodes = nodes.map((node) => {
- const layoutedNode = layoutedGraph.children?.find(
- lgNode => lgNode.id === node.id,
- )
-
- return {
- ...node,
- position: {
- x: (layoutedNode?.x ?? 0) + AUTO_LAYOUT_OFFSET.x,
- y: (layoutedNode?.y ?? 0) + AUTO_LAYOUT_OFFSET.y,
- },
- }
- })
-
- return {
- layoutedNodes,
- }
-}
-
-export const useNodesLayout = () => {
- const store = useStoreApi()
- const reactflow = useReactFlow()
- const workflowStore = useWorkflowStore()
- const { handleSyncWorkflowDraft } = useNodesSyncDraft()
-
- const handleNodesLayout = useCallback(async () => {
- workflowStore.setState({ nodeAnimation: true })
- const {
- getNodes,
- edges,
- setNodes,
- } = store.getState()
- const { setViewport } = reactflow
- const nodes = getNodes()
- const {
- layoutedNodes,
- } = await getLayoutedNodes(nodes, edges)
-
- setNodes(layoutedNodes)
- const zoom = 0.7
- setViewport({
- x: 0,
- y: 0,
- zoom,
- })
- setTimeout(() => {
- handleSyncWorkflowDraft()
- })
- }, [store, reactflow, handleSyncWorkflowDraft, workflowStore])
-
- return {
- handleNodesLayout,
- }
-}
diff --git a/web/app/components/workflow/nodes/_base/components/add-variable-popup.tsx b/web/app/components/workflow/nodes/_base/components/add-variable-popup.tsx
index 1e3d233e1d0..049c211a098 100644
--- a/web/app/components/workflow/nodes/_base/components/add-variable-popup.tsx
+++ b/web/app/components/workflow/nodes/_base/components/add-variable-popup.tsx
@@ -7,11 +7,11 @@ import { memo } from 'react'
import { useTranslation } from 'react-i18next'
import VarReferenceVars from '@/app/components/workflow/nodes/_base/components/variable/var-reference-vars'
-export type AddVariablePopupProps = {
+type AddVariablePopupProps = {
availableVars: NodeOutPutVar[]
onSelect: (value: ValueSelector, item: Var) => void
}
-export const AddVariablePopup = ({
+const AddVariablePopup = ({
availableVars,
onSelect,
}: AddVariablePopupProps) => {
diff --git a/web/app/components/workflow/nodes/_base/components/agent-strategy-selector.tsx b/web/app/components/workflow/nodes/_base/components/agent-strategy-selector.tsx
index f872fefe193..b91bf52b4f1 100644
--- a/web/app/components/workflow/nodes/_base/components/agent-strategy-selector.tsx
+++ b/web/app/components/workflow/nodes/_base/components/agent-strategy-selector.tsx
@@ -89,7 +89,7 @@ function formatStrategy(input: StrategyPluginDetail[], getIcon: (i: string) => s
})
}
-export type AgentStrategySelectorProps = {
+type AgentStrategySelectorProps = {
value?: Strategy
onChange: (value?: Strategy) => void
}
diff --git a/web/app/components/workflow/nodes/_base/components/agent-strategy.tsx b/web/app/components/workflow/nodes/_base/components/agent-strategy.tsx
index b70bcd01731..039385fa241 100644
--- a/web/app/components/workflow/nodes/_base/components/agent-strategy.tsx
+++ b/web/app/components/workflow/nodes/_base/components/agent-strategy.tsx
@@ -41,7 +41,7 @@ export type Strategy = {
meta?: PluginMeta
}
-export type AgentStrategyProps = {
+type AgentStrategyProps = {
strategy?: Strategy
onStrategyChange: (strategy?: Strategy) => void
formSchema: CredentialFormSchema[]
diff --git a/web/app/components/workflow/nodes/_base/components/before-run-form/panel-wrap.tsx b/web/app/components/workflow/nodes/_base/components/before-run-form/panel-wrap.tsx
index d130c1315a5..c5ec7d72b82 100644
--- a/web/app/components/workflow/nodes/_base/components/before-run-form/panel-wrap.tsx
+++ b/web/app/components/workflow/nodes/_base/components/before-run-form/panel-wrap.tsx
@@ -8,7 +8,7 @@ import { useTranslation } from 'react-i18next'
const i18nPrefix = 'singleRun'
-export type Props = {
+type Props = {
nodeName: string
onHide: () => void
children: React.ReactNode
diff --git a/web/app/components/workflow/nodes/_base/components/form-input-item.helpers.ts b/web/app/components/workflow/nodes/_base/components/form-input-item.helpers.ts
index c865ac09897..5c75e0f22a7 100644
--- a/web/app/components/workflow/nodes/_base/components/form-input-item.helpers.ts
+++ b/web/app/components/workflow/nodes/_base/components/form-input-item.helpers.ts
@@ -41,7 +41,7 @@ export type SelectItem = {
value: string
}
-export type FormInputState = {
+type FormInputState = {
defaultValue: unknown
isAppSelector: boolean
isArray: boolean
diff --git a/web/app/components/workflow/nodes/_base/components/group.tsx b/web/app/components/workflow/nodes/_base/components/group.tsx
index 366f86df054..3e14b96363b 100644
--- a/web/app/components/workflow/nodes/_base/components/group.tsx
+++ b/web/app/components/workflow/nodes/_base/components/group.tsx
@@ -1,7 +1,7 @@
import type { ComponentProps, FC, PropsWithChildren, ReactNode } from 'react'
import { cn } from '@/utils/classnames'
-export type GroupLabelProps = ComponentProps<'div'>
+type GroupLabelProps = ComponentProps<'div'>
export const GroupLabel: FC<GroupLabelProps> = (props) => {
const { children, className, ...rest } = props
@@ -12,7 +12,7 @@ export const GroupLabel: FC<GroupLabelProps> = (props) => {
)
}
-export type GroupProps = PropsWithChildren<{
+type GroupProps = PropsWithChildren<{
label: ReactNode
}>
diff --git a/web/app/components/workflow/nodes/_base/components/mcp-tool-availability.tsx b/web/app/components/workflow/nodes/_base/components/mcp-tool-availability.tsx
index d32899a9459..37944f71913 100644
--- a/web/app/components/workflow/nodes/_base/components/mcp-tool-availability.tsx
+++ b/web/app/components/workflow/nodes/_base/components/mcp-tool-availability.tsx
@@ -8,7 +8,7 @@ type MCPToolAvailabilityContextValue = {
const MCPToolAvailabilityContext = createContext<MCPToolAvailabilityContextValue | undefined>(undefined)
-export type MCPToolAvailability = {
+type MCPToolAvailability = {
allowed: boolean
versionSupported?: boolean
}
diff --git a/web/app/components/workflow/nodes/_base/components/retry/hooks.ts b/web/app/components/workflow/nodes/_base/components/retry/hooks.ts
index 9f3e68c9e91..c3ebfbb5604 100644
--- a/web/app/components/workflow/nodes/_base/components/retry/hooks.ts
+++ b/web/app/components/workflow/nodes/_base/components/retry/hooks.ts
@@ -1,8 +1,6 @@
import type { WorkflowRetryConfig } from './types'
-import type { NodeTracing } from '@/types/workflow'
import {
useCallback,
- useState,
} from 'react'
import {
useNodeDataUpdate,
@@ -26,16 +24,3 @@ export const useRetryConfig = (
handleRetryConfigChange,
}
}
-
-export const useRetryDetailShowInSingleRun = () => {
- const [retryDetails, setRetryDetails] = useState<NodeTracing[] | undefined>()
-
- const handleRetryDetailsChange = useCallback((details: NodeTracing[] | undefined) => {
- setRetryDetails(details)
- }, [])
-
- return {
- retryDetails,
- handleRetryDetailsChange,
- }
-}
diff --git a/web/app/components/workflow/nodes/_base/components/retry/utils.ts b/web/app/components/workflow/nodes/_base/components/retry/utils.ts
deleted file mode 100644
index 336ce12bb91..00000000000
--- a/web/app/components/workflow/nodes/_base/components/retry/utils.ts
+++ /dev/null
@@ -1 +0,0 @@
-export {}
diff --git a/web/app/components/workflow/nodes/_base/components/setting-item.tsx b/web/app/components/workflow/nodes/_base/components/setting-item.tsx
index c629dba46be..92be07e2d38 100644
--- a/web/app/components/workflow/nodes/_base/components/setting-item.tsx
+++ b/web/app/components/workflow/nodes/_base/components/setting-item.tsx
@@ -4,7 +4,7 @@ import Tooltip from '@/app/components/base/tooltip'
import Indicator from '@/app/components/header/indicator'
import { cn } from '@/utils/classnames'
-export type SettingItemProps = PropsWithChildren<{
+type SettingItemProps = PropsWithChildren<{
label: string
status?: 'error' | 'warning'
tooltip?: ReactNode
diff --git a/web/app/components/workflow/nodes/_base/components/switch-plugin-version.tsx b/web/app/components/workflow/nodes/_base/components/switch-plugin-version.tsx
index b3e398f86de..d73baf32716 100644
--- a/web/app/components/workflow/nodes/_base/components/switch-plugin-version.tsx
+++ b/web/app/components/workflow/nodes/_base/components/switch-plugin-version.tsx
@@ -17,7 +17,7 @@ import { useCheckInstalled, useUpdatePackageFromMarketPlace } from '@/service/us
import { cn } from '@/utils/classnames'
import { getMarketplaceUrl } from '@/utils/var'
-export type SwitchPluginVersionProps = {
+type SwitchPluginVersionProps = {
uniqueIdentifier: string
tooltip?: ReactNode
onChange?: (version: string) => void
diff --git a/web/app/components/workflow/nodes/_base/components/variable/utils.ts b/web/app/components/workflow/nodes/_base/components/variable/utils.ts
index 867221ea317..d476a215689 100644
--- a/web/app/components/workflow/nodes/_base/components/variable/utils.ts
+++ b/web/app/components/workflow/nodes/_base/components/variable/utils.ts
@@ -101,7 +101,7 @@ export const isSpecialVar = (prefix: string): boolean => {
return ['sys', 'env', 'conversation', 'rag'].includes(prefix)
}
-export const hasValidChildren = (children: any): boolean => {
+const hasValidChildren = (children: any): boolean => {
return (
children
&& ((Array.isArray(children) && children.length > 0)
diff --git a/web/app/components/workflow/nodes/_base/hooks/use-resize-panel.ts b/web/app/components/workflow/nodes/_base/hooks/use-resize-panel.ts
index cbda7daa09e..3baf6d05a04 100644
--- a/web/app/components/workflow/nodes/_base/hooks/use-resize-panel.ts
+++ b/web/app/components/workflow/nodes/_base/hooks/use-resize-panel.ts
@@ -5,7 +5,7 @@ import {
useState,
} from 'react'
-export type UseResizePanelParams = {
+type UseResizePanelParams = {
direction?: 'horizontal' | 'vertical' | 'both'
triggerDirection?: 'top' | 'right' | 'bottom' | 'left' | 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'
minWidth?: number
diff --git a/web/app/components/workflow/nodes/_base/types.ts b/web/app/components/workflow/nodes/_base/types.ts
index 18ad9c4e719..77d5d911869 100644
--- a/web/app/components/workflow/nodes/_base/types.ts
+++ b/web/app/components/workflow/nodes/_base/types.ts
@@ -12,16 +12,3 @@ export type ResourceVarInputs = Record<string, {
type: VarKindType
value?: string | ValueSelector | any
}>
-
-// Base resource interface
-export type BaseResource = {
- name: string
- [key: string]: any
-}
-
-// Base resource provider interface
-export type BaseResourceProvider = {
- plugin_id?: string
- name: string
- [key: string]: any
-}
diff --git a/web/app/components/workflow/nodes/agent/components/model-bar.tsx b/web/app/components/workflow/nodes/agent/components/model-bar.tsx
index cff0b71a08d..88e6915088d 100644
--- a/web/app/components/workflow/nodes/agent/components/model-bar.tsx
+++ b/web/app/components/workflow/nodes/agent/components/model-bar.tsx
@@ -7,7 +7,7 @@ import { useModelList } from '@/app/components/header/account-setting/model-prov
import ModelSelector from '@/app/components/header/account-setting/model-provider-page/model-selector'
import Indicator from '@/app/components/header/indicator'
-export type ModelBarProps = {
+type ModelBarProps = {
provider: string
model: string
} | {}
diff --git a/web/app/components/workflow/nodes/agent/panel.tsx b/web/app/components/workflow/nodes/agent/panel.tsx
index 14232bc639d..03e3aafa49c 100644
--- a/web/app/components/workflow/nodes/agent/panel.tsx
+++ b/web/app/components/workflow/nodes/agent/panel.tsx
@@ -19,7 +19,7 @@ import useConfig from './use-config'
const i18nPrefix = 'nodes.agent'
-export function strategyParamToCredientialForm(param: StrategyParamItem): CredentialFormSchema {
+function strategyParamToCredientialForm(param: StrategyParamItem): CredentialFormSchema {
return {
...param as any,
variable: param.name,
diff --git a/web/app/components/workflow/nodes/agent/use-config.ts b/web/app/components/workflow/nodes/agent/use-config.ts
index ce8765d833a..0231f673c9e 100644
--- a/web/app/components/workflow/nodes/agent/use-config.ts
+++ b/web/app/components/workflow/nodes/agent/use-config.ts
@@ -17,7 +17,7 @@ import useNodeCrud from '../_base/hooks/use-node-crud'
import useVarList from '../_base/hooks/use-var-list'
import { VarType } from '../tool/types'
-export type StrategyStatus = {
+type StrategyStatus = {
plugin: {
source: 'external' | 'marketplace'
installed: boolean
diff --git a/web/app/components/workflow/nodes/answer/utils.ts b/web/app/components/workflow/nodes/answer/utils.ts
deleted file mode 100644
index a77faa5c790..00000000000
--- a/web/app/components/workflow/nodes/answer/utils.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-import type { AnswerNodeType } from './types'
-
-export const checkNodeValid = (_payload: AnswerNodeType) => {
- return true
-}
diff --git a/web/app/components/workflow/nodes/assigner/components/var-list/use-var-list.ts b/web/app/components/workflow/nodes/assigner/components/var-list/use-var-list.ts
deleted file mode 100644
index 51f938d9b47..00000000000
--- a/web/app/components/workflow/nodes/assigner/components/var-list/use-var-list.ts
+++ /dev/null
@@ -1,39 +0,0 @@
-import type { AssignerNodeOperation, AssignerNodeType } from '../../types'
-import { produce } from 'immer'
-import { useCallback } from 'react'
-import { AssignerNodeInputType, WriteMode } from '../../types'
-
-type Params = {
- id: string
- inputs: AssignerNodeType
- setInputs: (newInputs: AssignerNodeType) => void
-}
-function useVarList({
- inputs,
- setInputs,
-}: Params) {
- const handleVarListChange = useCallback((newList: AssignerNodeOperation[]) => {
- const newInputs = produce(inputs, (draft) => {
- draft.items = newList
- })
- setInputs(newInputs)
- }, [inputs, setInputs])
-
- const handleAddVariable = useCallback(() => {
- const newInputs = produce(inputs, (draft) => {
- draft.items.push({
- variable_selector: [],
- input_type: AssignerNodeInputType.constant,
- operation: WriteMode.overwrite,
- value: '',
- })
- })
- setInputs(newInputs)
- }, [inputs, setInputs])
- return {
- handleVarListChange,
- handleAddVariable,
- }
-}
-
-export default useVarList
diff --git a/web/app/components/workflow/nodes/assigner/utils.ts b/web/app/components/workflow/nodes/assigner/utils.ts
index 8e27626834e..0702a15409f 100644
--- a/web/app/components/workflow/nodes/assigner/utils.ts
+++ b/web/app/components/workflow/nodes/assigner/utils.ts
@@ -2,16 +2,6 @@ import type { AssignerNodeType } from './types'
import type { I18nKeysByPrefix } from '@/types/i18n'
import { AssignerNodeInputType, WriteMode } from './types'
-export const checkNodeValid = (_payload: AssignerNodeType) => {
- return true
-}
-
-export const formatOperationName = (type: string) => {
- if (type === 'over-write')
- return 'Overwrite'
- return type.charAt(0).toUpperCase() + type.slice(1)
-}
-
export type OperationName = I18nKeysByPrefix<'workflow', 'nodes.assigner.operations.'>
export type Item
diff --git a/web/app/components/workflow/nodes/code/utils.ts b/web/app/components/workflow/nodes/code/utils.ts
deleted file mode 100644
index da9c1153c64..00000000000
--- a/web/app/components/workflow/nodes/code/utils.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export const checkNodeValid = () => {
- return true
-}
diff --git a/web/app/components/workflow/nodes/constants.ts b/web/app/components/workflow/nodes/constants.ts
index 36e48d7c620..f712034f620 100644
--- a/web/app/components/workflow/nodes/constants.ts
+++ b/web/app/components/workflow/nodes/constants.ts
@@ -1,8 +1,6 @@
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.'>
diff --git a/web/app/components/workflow/nodes/data-source/types.ts b/web/app/components/workflow/nodes/data-source/types.ts
index 19b4bada3f8..a33df0b4a1f 100644
--- a/web/app/components/workflow/nodes/data-source/types.ts
+++ b/web/app/components/workflow/nodes/data-source/types.ts
@@ -8,9 +8,6 @@ export { VarKindType as VarType } from '../_base/types'
export enum DataSourceClassification {
localFile = 'local_file',
- websiteCrawl = 'website_crawl',
- onlineDocument = 'online_document',
- onlineDrive = 'online_drive',
}
export type ToolVarInputs = ResourceVarInputs
diff --git a/web/app/components/workflow/nodes/end/utils.ts b/web/app/components/workflow/nodes/end/utils.ts
deleted file mode 100644
index 6ca87aa2358..00000000000
--- a/web/app/components/workflow/nodes/end/utils.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-import type { EndNodeType } from './types'
-
-export const checkNodeValid = (_payload: EndNodeType) => {
- return true
-}
diff --git a/web/app/components/workflow/nodes/if-else/utils.ts b/web/app/components/workflow/nodes/if-else/utils.ts
index 72b0f9d42e8..e68a355b3c0 100644
--- a/web/app/components/workflow/nodes/if-else/utils.ts
+++ b/web/app/components/workflow/nodes/if-else/utils.ts
@@ -1,5 +1,4 @@
import type { Branch } from '@/app/components/workflow/types'
-import type { I18nKeysByPrefix } from '@/types/i18n'
import { VarType } from '@/app/components/workflow/types'
import { ComparisonOperator } from './types'
@@ -17,8 +16,7 @@ const notTranslateKey = [
] as const
type NotTranslateOperator = typeof notTranslateKey[number]
-export type TranslatableComparisonOperator = Exclude<ComparisonOperator, NotTranslateOperator>
-export type IfElseOptionName = I18nKeysByPrefix<'workflow', 'nodes.ifElse.optionName.'>
+type TranslatableComparisonOperator = Exclude<ComparisonOperator, NotTranslateOperator>
export function isComparisonOperatorNeedTranslate(operator: ComparisonOperator): operator is TranslatableComparisonOperator
export function isComparisonOperatorNeedTranslate(operator?: ComparisonOperator): operator is TranslatableComparisonOperator
diff --git a/web/app/components/workflow/nodes/index.tsx b/web/app/components/workflow/nodes/index.tsx
index 809c4af2846..1a5c729fe57 100644
--- a/web/app/components/workflow/nodes/index.tsx
+++ b/web/app/components/workflow/nodes/index.tsx
@@ -29,7 +29,7 @@ const CustomNode = (props: NodeProps) => {
}
CustomNode.displayName = 'CustomNode'
-export type PanelProps = {
+type PanelProps = {
type: Node['type']
id: Node['id']
data: Node['data']
diff --git a/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/condition-list/utils.ts b/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/condition-list/utils.ts
index ff46c8ade17..d34303014ba 100644
--- a/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/condition-list/utils.ts
+++ b/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/condition-list/utils.ts
@@ -3,10 +3,6 @@ import {
MetadataFilteringVariableType,
} from '@/app/components/workflow/nodes/knowledge-retrieval/types'
-export const isEmptyRelatedOperator = (operator: ComparisonOperator) => {
- return [ComparisonOperator.empty, ComparisonOperator.notEmpty, ComparisonOperator.isNull, ComparisonOperator.isNotNull, ComparisonOperator.exists, ComparisonOperator.notExists].includes(operator)
-}
-
const notTranslateKey = [
ComparisonOperator.equal,
ComparisonOperator.notEqual,
@@ -17,7 +13,7 @@ const notTranslateKey = [
] as const
type NotTranslateOperator = typeof notTranslateKey[number]
-export type TranslatableComparisonOperator = Exclude<ComparisonOperator, NotTranslateOperator>
+type TranslatableComparisonOperator = Exclude<ComparisonOperator, NotTranslateOperator>
export function isComparisonOperatorNeedTranslate(operator: ComparisonOperator): operator is TranslatableComparisonOperator
export function isComparisonOperatorNeedTranslate(operator?: ComparisonOperator): operator is TranslatableComparisonOperator
diff --git a/web/app/components/workflow/nodes/knowledge-retrieval/utils.ts b/web/app/components/workflow/nodes/knowledge-retrieval/utils.ts
index 2ce57bc270f..65a2b6f0104 100644
--- a/web/app/components/workflow/nodes/knowledge-retrieval/utils.ts
+++ b/web/app/components/workflow/nodes/knowledge-retrieval/utils.ts
@@ -13,10 +13,6 @@ import {
} from '@/models/datasets'
import { RETRIEVE_METHOD } from '@/types/app'
-export const checkNodeValid = () => {
- return true
-}
-
export const getSelectedDatasetsMode = (datasets: DataSet[] = []) => {
if (datasets === null)
datasets = []
diff --git a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-generator/prompt-editor.tsx b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-generator/prompt-editor.tsx
index f84f6ef6346..8c7eb854dd4 100644
--- a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-generator/prompt-editor.tsx
+++ b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-generator/prompt-editor.tsx
@@ -10,7 +10,7 @@ import Textarea from '@/app/components/base/textarea'
import Tooltip from '@/app/components/base/tooltip'
import ModelParameterModal from '@/app/components/header/account-setting/model-provider-page/model-parameter-modal'
-export type ModelInfo = {
+type ModelInfo = {
modelId: string
provider: string
mode?: string
diff --git a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/context.tsx b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/context.tsx
index 82a3c27a981..db2c8032bb3 100644
--- a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/context.tsx
+++ b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/context.tsx
@@ -30,7 +30,7 @@ export const VisualEditorContextProvider = ({ children }: VisualEditorProviderPr
)
}
-export const MittContext = createContext<ReturnType<typeof useMitt>>({
+const MittContext = createContext<ReturnType<typeof useMitt>>({
emit: noop,
useSubscribe: noop,
})
diff --git a/web/app/components/workflow/nodes/llm/utils.ts b/web/app/components/workflow/nodes/llm/utils.ts
index 662a1cae267..dbfd3158744 100644
--- a/web/app/components/workflow/nodes/llm/utils.ts
+++ b/web/app/components/workflow/nodes/llm/utils.ts
@@ -1,14 +1,10 @@
import type { ValidationError } from 'jsonschema'
-import type { ArrayItems, Field, LLMNodeType } from './types'
+import type { ArrayItems, Field } from './types'
import * as z from 'zod'
import { draft07Validator, forbidBooleanProperties } from '@/utils/validators'
import { extractPluginId } from '../../utils/plugin'
import { ArrayType, Type } from './types'
-export const checkNodeValid = (_payload: LLMNodeType) => {
- return true
-}
-
export enum LLMModelIssueCode {
providerRequired = 'provider-required',
providerPluginUnavailable = 'provider-plugin-unavailable',
@@ -59,7 +55,7 @@ export const getHasChildren = (schema: Field) => {
return schema.items && schema.items.type === Type.object && schema.items.properties && Object.keys(schema.items.properties).length > 0
}
-export const getTypeOf = (target: any) => {
+const getTypeOf = (target: any) => {
if (target === null)
return 'null'
if (typeof target !== 'object') {
@@ -73,7 +69,7 @@ export const getTypeOf = (target: any) => {
}
}
-export const inferType = (value: any): Type => {
+const inferType = (value: any): Type => {
const type = getTypeOf(value)
if (type === 'array')
return Type.array
@@ -172,27 +168,6 @@ export const getValidationErrorMessage = (errors: Array<ValidationError | string
return message
}
-// Previous Not support boolean type, so transform boolean to string when paste it into schema editor
-export const convertBooleanToString = (schema: any) => {
- if (schema.type === Type.boolean)
- schema.type = Type.string
- if (schema.type === Type.array && schema.items && schema.items.type === Type.boolean)
- schema.items.type = Type.string
- if (schema.type === Type.object) {
- schema.properties = Object.entries(schema.properties).reduce((acc, [key, value]) => {
- acc[key] = convertBooleanToString(value)
- return acc
- }, {} as any)
- }
- if (schema.type === Type.array && schema.items && schema.items.type === Type.object) {
- schema.items.properties = Object.entries(schema.items.properties).reduce((acc, [key, value]) => {
- acc[key] = convertBooleanToString(value)
- return acc
- }, {} as any)
- }
- return schema
-}
-
const schemaRootObject = z.object({
type: z.literal('object'),
properties: z.record(z.string(), z.any()),
diff --git a/web/app/components/workflow/nodes/loop/types.ts b/web/app/components/workflow/nodes/loop/types.ts
index fe23b1f8ce8..3e91506c475 100644
--- a/web/app/components/workflow/nodes/loop/types.ts
+++ b/web/app/components/workflow/nodes/loop/types.ts
@@ -57,7 +57,6 @@ export type CaseItem = {
export type HandleAddCondition = (valueSelector: ValueSelector, varItem: Var) => void
export type HandleRemoveCondition = (conditionId: string) => void
export type HandleUpdateCondition = (conditionId: string, newCondition: Condition) => void
-export type HandleUpdateConditionLogicalOperator = (value: LogicalOperator) => void
export type HandleToggleConditionLogicalOperator = () => void
diff --git a/web/app/components/workflow/nodes/loop/utils.ts b/web/app/components/workflow/nodes/loop/utils.ts
index 8ec9cd241f5..108b240b185 100644
--- a/web/app/components/workflow/nodes/loop/utils.ts
+++ b/web/app/components/workflow/nodes/loop/utils.ts
@@ -1,4 +1,3 @@
-import type { Branch } from '@/app/components/workflow/types'
import { VarType } from '@/app/components/workflow/types'
import { ComparisonOperator } from './types'
@@ -16,7 +15,7 @@ const notTranslateKey = [
] as const
type NotTranslateOperator = typeof notTranslateKey[number]
-export type TranslatableComparisonOperator = Exclude<ComparisonOperator, NotTranslateOperator>
+type TranslatableComparisonOperator = Exclude<ComparisonOperator, NotTranslateOperator>
export function isComparisonOperatorNeedTranslate(operator: ComparisonOperator): operator is TranslatableComparisonOperator
export function isComparisonOperatorNeedTranslate(operator?: ComparisonOperator): operator is TranslatableComparisonOperator
@@ -170,25 +169,3 @@ export const comparisonOperatorNotRequireValue = (operator?: ComparisonOperator)
return [ComparisonOperator.empty, ComparisonOperator.notEmpty, ComparisonOperator.isNull, ComparisonOperator.isNotNull, ComparisonOperator.exists, ComparisonOperator.notExists].includes(operator)
}
-
-export const branchNameCorrect = (branches: Branch[]) => {
- const branchLength = branches.length
- if (branchLength < 2)
- throw new Error('if-else node branch number must than 2')
-
- if (branchLength === 2) {
- return branches.map((branch) => {
- return {
- ...branch,
- name: branch.id === 'false' ? 'ELSE' : 'IF',
- }
- })
- }
-
- return branches.map((branch, index) => {
- return {
- ...branch,
- name: branch.id === 'false' ? 'ELSE' : `CASE ${index + 1}`,
- }
- })
-}
diff --git a/web/app/components/workflow/nodes/question-classifier/utils.ts b/web/app/components/workflow/nodes/question-classifier/utils.ts
deleted file mode 100644
index da9c1153c64..00000000000
--- a/web/app/components/workflow/nodes/question-classifier/utils.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export const checkNodeValid = () => {
- return true
-}
diff --git a/web/app/components/workflow/nodes/start/utils.ts b/web/app/components/workflow/nodes/start/utils.ts
deleted file mode 100644
index 16743d6178f..00000000000
--- a/web/app/components/workflow/nodes/start/utils.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-import type { StartNodeType } from './types'
-
-export const checkNodeValid = (_payload: StartNodeType) => {
- return true
-}
diff --git a/web/app/components/workflow/nodes/template-transform/utils.ts b/web/app/components/workflow/nodes/template-transform/utils.ts
deleted file mode 100644
index 874ee2c1a15..00000000000
--- a/web/app/components/workflow/nodes/template-transform/utils.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-import type { TemplateTransformNodeType } from './types'
-
-export const checkNodeValid = (_payload: TemplateTransformNodeType) => {
- return true
-}
diff --git a/web/app/components/workflow/nodes/tool/utils.ts b/web/app/components/workflow/nodes/tool/utils.ts
deleted file mode 100644
index c55d2f38074..00000000000
--- a/web/app/components/workflow/nodes/tool/utils.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-import type { ToolNodeType } from './types'
-
-export const checkNodeValid = (_payload: ToolNodeType) => {
- return true
-}
diff --git a/web/app/components/workflow/nodes/trigger-plugin/hooks/use-trigger-auth-flow.ts b/web/app/components/workflow/nodes/trigger-plugin/hooks/use-trigger-auth-flow.ts
deleted file mode 100644
index f551f2f420c..00000000000
--- a/web/app/components/workflow/nodes/trigger-plugin/hooks/use-trigger-auth-flow.ts
+++ /dev/null
@@ -1,174 +0,0 @@
-import type { TriggerWithProvider } from '@/app/components/workflow/block-selector/types'
-import { useCallback, useState } from 'react'
-import {
- useBuildTriggerSubscription,
- useCreateTriggerSubscriptionBuilder,
- useUpdateTriggerSubscriptionBuilder,
- useVerifyAndUpdateTriggerSubscriptionBuilder,
-} from '@/service/use-triggers'
-
-// Helper function to serialize complex values to strings for backend encryption
-const serializeFormValues = (values: Record<string, unknown>): Record<string, string> => {
- const result: Record<string, string> = {}
-
- for (const [key, value] of Object.entries(values)) {
- if (value === null || value === undefined)
- result[key] = ''
- else if (typeof value === 'object')
- result[key] = JSON.stringify(value)
- else
- result[key] = String(value)
- }
-
- return result
-}
-
-const getErrorMessage = (error: unknown, fallback: string) => {
- if (error instanceof Error && error.message)
- return error.message
- if (typeof error === 'object' && error && 'message' in error) {
- const message = (error as { message?: string }).message
- if (typeof message === 'string' && message)
- return message
- }
- return fallback
-}
-
-export type AuthFlowStep = 'auth' | 'params' | 'complete'
-
-export type AuthFlowState = {
- step: AuthFlowStep
- builderId: string
- isLoading: boolean
- error: string | null
-}
-
-export type AuthFlowActions = {
- startAuth: () => Promise<void>
- verifyAuth: (credentials: Record<string, unknown>) => Promise<void>
- completeConfig: (parameters: Record<string, unknown>, properties?: Record<string, unknown>, name?: string) => Promise<void>
- reset: () => void
-}
-
-export const useTriggerAuthFlow = (provider: TriggerWithProvider): AuthFlowState & AuthFlowActions => {
- const [step, setStep] = useState<AuthFlowStep>('auth')
- const [builderId, setBuilderId] = useState<string>('')
- const [isLoading, setIsLoading] = useState(false)
- const [error, setError] = useState<string | null>(null)
-
- const createBuilder = useCreateTriggerSubscriptionBuilder()
- const updateBuilder = useUpdateTriggerSubscriptionBuilder()
- const verifyBuilder = useVerifyAndUpdateTriggerSubscriptionBuilder()
- const buildSubscription = useBuildTriggerSubscription()
-
- const startAuth = useCallback(async () => {
- if (builderId)
- return // Prevent multiple calls if already started
-
- setIsLoading(true)
- setError(null)
-
- try {
- const response = await createBuilder.mutateAsync({
- provider: provider.name,
- })
- setBuilderId(response.subscription_builder.id)
- setStep('auth')
- }
- catch (err: unknown) {
- setError(getErrorMessage(err, 'Failed to start authentication flow'))
- throw err
- }
- finally {
- setIsLoading(false)
- }
- }, [provider.name, createBuilder, builderId])
-
- const verifyAuth = useCallback(async (credentials: Record<string, unknown>) => {
- if (!builderId) {
- setError('No builder ID available')
- return
- }
-
- setIsLoading(true)
- setError(null)
-
- try {
- await updateBuilder.mutateAsync({
- provider: provider.name,
- subscriptionBuilderId: builderId,
- credentials: serializeFormValues(credentials),
- })
-
- await verifyBuilder.mutateAsync({
- provider: provider.name,
- subscriptionBuilderId: builderId,
- })
-
- setStep('params')
- }
- catch (err: unknown) {
- setError(getErrorMessage(err, 'Authentication verification failed'))
- throw err
- }
- finally {
- setIsLoading(false)
- }
- }, [provider.name, builderId, updateBuilder, verifyBuilder])
-
- const completeConfig = useCallback(async (
- parameters: Record<string, unknown>,
- properties: Record<string, unknown> = {},
- name?: string,
- ) => {
- if (!builderId) {
- setError('No builder ID available')
- return
- }
-
- setIsLoading(true)
- setError(null)
-
- try {
- await updateBuilder.mutateAsync({
- provider: provider.name,
- subscriptionBuilderId: builderId,
- parameters: serializeFormValues(parameters),
- properties: serializeFormValues(properties),
- name,
- })
-
- await buildSubscription.mutateAsync({
- provider: provider.name,
- subscriptionBuilderId: builderId,
- })
-
- setStep('complete')
- }
- catch (err: unknown) {
- setError(getErrorMessage(err, 'Configuration failed'))
- throw err
- }
- finally {
- setIsLoading(false)
- }
- }, [provider.name, builderId, updateBuilder, buildSubscription])
-
- const reset = useCallback(() => {
- setStep('auth')
- setBuilderId('')
- setIsLoading(false)
- setError(null)
- }, [])
-
- return {
- step,
- builderId,
- isLoading,
- error,
- startAuth,
- verifyAuth,
- completeConfig,
- reset,
- }
-}
diff --git a/web/app/components/workflow/nodes/trigger-plugin/types.ts b/web/app/components/workflow/nodes/trigger-plugin/types.ts
index 8dd6aa96575..2ec1521749c 100644
--- a/web/app/components/workflow/nodes/trigger-plugin/types.ts
+++ b/web/app/components/workflow/nodes/trigger-plugin/types.ts
@@ -20,5 +20,5 @@ export type PluginTriggerNodeType = CommonNodeType & {
}
// Use base types directly
-export { VarKindType as PluginTriggerVarType } from '../_base/types'
+
export type PluginTriggerVarInputs = ResourceVarInputs
diff --git a/web/app/components/workflow/nodes/trigger-schedule/utils/execution-time-calculator.ts b/web/app/components/workflow/nodes/trigger-schedule/utils/execution-time-calculator.ts
index 6bd6bc41dc3..c7aaa13f496 100644
--- a/web/app/components/workflow/nodes/trigger-schedule/utils/execution-time-calculator.ts
+++ b/web/app/components/workflow/nodes/trigger-schedule/utils/execution-time-calculator.ts
@@ -58,12 +58,6 @@ const formatUserTimezoneDate = (date: Date, timezone: string, includeWeekday: bo
return `${dateStr}, ${timeStr}`
}
-// Helper function to get default datetime - consistent with base DatePicker
-export const getDefaultDateTime = (): Date => {
- const defaultDate = new Date(2024, 0, 2, 11, 30, 0, 0)
- return defaultDate
-}
-
export const getNextExecutionTimes = (data: ScheduleTriggerNodeType, count: number = 5): Date[] => {
const timezone = resolveTimezone(data.timezone)
@@ -266,7 +260,7 @@ export const getNextExecutionTimes = (data: ScheduleTriggerNodeType, count: numb
return times
}
-export const formatExecutionTime = (date: Date, timezone: string | undefined, includeWeekday: boolean = true, includeTimezone: boolean = true): string => {
+const formatExecutionTime = (date: Date, timezone: string | undefined, includeWeekday: boolean = true, includeTimezone: boolean = true): string => {
const resolvedTimezone = resolveTimezone(timezone)
return formatUserTimezoneDate(date, resolvedTimezone, includeWeekday, includeTimezone)
}
diff --git a/web/app/components/workflow/nodes/trigger-webhook/types.ts b/web/app/components/workflow/nodes/trigger-webhook/types.ts
index f5938ed00b9..5d2794c8062 100644
--- a/web/app/components/workflow/nodes/trigger-webhook/types.ts
+++ b/web/app/components/workflow/nodes/trigger-webhook/types.ts
@@ -2,14 +2,6 @@ import type { CommonNodeType, Variable, VarType } from '@/app/components/workflo
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD'
-export type ArrayElementType = 'string' | 'number' | 'boolean' | 'object'
-
-export const getArrayElementType = (arrayType: `array[${ArrayElementType}]`): ArrayElementType => {
- const arrayRegex = /^array\[(.+)\]$/
- const match = arrayRegex.exec(arrayType)
- return (match?.[1] as ArrayElementType) || 'string'
-}
-
export type WebhookParameter = {
name: string
type: VarType
diff --git a/web/app/components/workflow/nodes/trigger-webhook/use-config.helpers.ts b/web/app/components/workflow/nodes/trigger-webhook/use-config.helpers.ts
index 20ea7fdbf8a..dbbdc161b20 100644
--- a/web/app/components/workflow/nodes/trigger-webhook/use-config.helpers.ts
+++ b/web/app/components/workflow/nodes/trigger-webhook/use-config.helpers.ts
@@ -5,7 +5,7 @@ import { VarType } from '@/app/components/workflow/types'
import { checkKeys, hasDuplicateStr } from '@/utils/var'
import { WEBHOOK_RAW_VARIABLE_NAME } from './utils/raw-variable'
-export type VariableSyncSource = 'param' | 'header' | 'body'
+type VariableSyncSource = 'param' | 'header' | 'body'
type SanitizedEntry = {
item: WebhookParameter | WebhookHeader
diff --git a/web/app/components/workflow/nodes/trigger-webhook/utils/parameter-type-utils.ts b/web/app/components/workflow/nodes/trigger-webhook/utils/parameter-type-utils.ts
index 10f61a5e22b..89707cb24f3 100644
--- a/web/app/components/workflow/nodes/trigger-webhook/utils/parameter-type-utils.ts
+++ b/web/app/components/workflow/nodes/trigger-webhook/utils/parameter-type-utils.ts
@@ -91,7 +91,7 @@ export const normalizeParameterType = (input: string | undefined | null): VarTyp
/**
* Gets display name for parameter types in UI components
*/
-export const getParameterTypeDisplayName = (type: VarType): string => {
+const getParameterTypeDisplayName = (type: VarType): string => {
return TYPE_DISPLAY_NAMES[type]
}
@@ -99,7 +99,7 @@ export const getParameterTypeDisplayName = (type: VarType): string => {
* Gets available parameter types based on content type
* Provides context-aware type filtering for different webhook content types
*/
-export const getAvailableParameterTypes = (contentType?: string): VarType[] => {
+const getAvailableParameterTypes = (contentType?: string): VarType[] => {
if (!contentType)
return [VarType.string, VarType.number, VarType.boolean]
diff --git a/web/app/components/workflow/nodes/trigger-webhook/utils/raw-variable.ts b/web/app/components/workflow/nodes/trigger-webhook/utils/raw-variable.ts
index d4975cc5972..506c3ee690f 100644
--- a/web/app/components/workflow/nodes/trigger-webhook/utils/raw-variable.ts
+++ b/web/app/components/workflow/nodes/trigger-webhook/utils/raw-variable.ts
@@ -2,7 +2,7 @@ import type { Variable } from '@/app/components/workflow/types'
import { VarType } from '@/app/components/workflow/types'
export const WEBHOOK_RAW_VARIABLE_NAME = '_webhook_raw'
-export const WEBHOOK_RAW_VARIABLE_LABEL = 'raw'
+const WEBHOOK_RAW_VARIABLE_LABEL = 'raw'
export const createWebhookRawVariable = (): Variable => ({
variable: WEBHOOK_RAW_VARIABLE_NAME,
diff --git a/web/app/components/workflow/nodes/variable-assigner/components/add-variable/index.tsx b/web/app/components/workflow/nodes/variable-assigner/components/add-variable/index.tsx
index 105adbe981c..b49344c5623 100644
--- a/web/app/components/workflow/nodes/variable-assigner/components/add-variable/index.tsx
+++ b/web/app/components/workflow/nodes/variable-assigner/components/add-variable/index.tsx
@@ -19,7 +19,7 @@ import AddVariablePopup from '@/app/components/workflow/nodes/_base/components/a
import { cn } from '@/utils/classnames'
import { useVariableAssigner } from '../../hooks'
-export type AddVariableProps = {
+type AddVariableProps = {
variableAssignerNodeId: string
variableAssignerNodeData: VariableAssignerNodeType
availableVars: NodeOutPutVar[]
diff --git a/web/app/components/workflow/nodes/variable-assigner/components/var-list/use-var-list.ts b/web/app/components/workflow/nodes/variable-assigner/components/var-list/use-var-list.ts
deleted file mode 100644
index 71d0fb72eab..00000000000
--- a/web/app/components/workflow/nodes/variable-assigner/components/var-list/use-var-list.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-import type { VariableAssignerNodeType } from '../../types'
-import type { ValueSelector } from '@/app/components/workflow/types'
-import { produce } from 'immer'
-import { useCallback } from 'react'
-
-type Params = {
- id: string
- inputs: VariableAssignerNodeType
- setInputs: (newInputs: VariableAssignerNodeType) => void
-}
-function useVarList({
- inputs,
- setInputs,
-}: Params) {
- const handleVarListChange = useCallback((newList: ValueSelector[]) => {
- const newInputs = produce(inputs, (draft) => {
- draft.variables = newList
- })
- setInputs(newInputs)
- }, [inputs, setInputs])
-
- const handleAddVariable = useCallback(() => {
- const newInputs = produce(inputs, (draft) => {
- draft.variables.push([])
- })
- setInputs(newInputs)
- }, [inputs, setInputs])
- return {
- handleVarListChange,
- handleAddVariable,
- }
-}
-
-export default useVarList
diff --git a/web/app/components/workflow/nodes/variable-assigner/utils.ts b/web/app/components/workflow/nodes/variable-assigner/utils.ts
index a41acf93f53..a7abe4206ad 100644
--- a/web/app/components/workflow/nodes/variable-assigner/utils.ts
+++ b/web/app/components/workflow/nodes/variable-assigner/utils.ts
@@ -1,10 +1,6 @@
import type { Var } from '../../types'
import { VarType } from '../../types'
-export const checkNodeValid = () => {
- return true
-}
-
export const filterVar = (varType: VarType) => {
return (v: Var) => {
if (varType === VarType.any)
diff --git a/web/app/components/workflow/operator/index.tsx b/web/app/components/workflow/operator/index.tsx
index dd75ce3aee3..89330b8a8cb 100644
--- a/web/app/components/workflow/operator/index.tsx
+++ b/web/app/components/workflow/operator/index.tsx
@@ -7,7 +7,7 @@ import VariableInspectPanel from '../variable-inspect'
import VariableTrigger from '../variable-inspect/trigger'
import ZoomInOut from './zoom-in-out'
-export type OperatorProps = {
+type OperatorProps = {
handleUndo: () => void
handleRedo: () => void
}
diff --git a/web/app/components/workflow/panel/chat-variable-panel/components/variable-modal.sections.tsx b/web/app/components/workflow/panel/chat-variable-panel/components/variable-modal.sections.tsx
index 93003518631..41a90ce8ced 100644
--- a/web/app/components/workflow/panel/chat-variable-panel/components/variable-modal.sections.tsx
+++ b/web/app/components/workflow/panel/chat-variable-panel/components/variable-modal.sections.tsx
@@ -16,7 +16,7 @@ type SectionTitleProps = {
children: ReactNode
}
-export const SectionTitle = ({ children }: SectionTitleProps) => (
+const SectionTitle = ({ children }: SectionTitleProps) => (
<div className="mb-1 flex h-6 items-center text-text-secondary system-sm-semibold">{children}</div>
)
diff --git a/web/app/components/workflow/panel/chat-variable-panel/components/variable-modal.tsx b/web/app/components/workflow/panel/chat-variable-panel/components/variable-modal.tsx
index a5fcdb05956..4fe1a707cb3 100644
--- a/web/app/components/workflow/panel/chat-variable-panel/components/variable-modal.tsx
+++ b/web/app/components/workflow/panel/chat-variable-panel/components/variable-modal.tsx
@@ -22,7 +22,7 @@ import {
ValueSection,
} from './variable-modal.sections'
-export type ModalPropsType = {
+type ModalPropsType = {
chatVar?: ConversationVariable
onClose: () => void
onSave: (chatVar: ConversationVariable) => void
diff --git a/web/app/components/workflow/panel/debug-and-preview/conversation-variable-modal.tsx b/web/app/components/workflow/panel/debug-and-preview/conversation-variable-modal.tsx
index 34cc3695316..028543d4815 100644
--- a/web/app/components/workflow/panel/debug-and-preview/conversation-variable-modal.tsx
+++ b/web/app/components/workflow/panel/debug-and-preview/conversation-variable-modal.tsx
@@ -24,7 +24,7 @@ import useTimestamp from '@/hooks/use-timestamp'
import { fetchCurrentValueOfConversationVariable } from '@/service/workflow'
import { cn } from '@/utils/classnames'
-export type Props = {
+type Props = {
conversationID: string
onHide: () => void
}
diff --git a/web/app/components/workflow/panel/env-panel/variable-modal.tsx b/web/app/components/workflow/panel/env-panel/variable-modal.tsx
index 6569c32b3ed..523ea5a8700 100644
--- a/web/app/components/workflow/panel/env-panel/variable-modal.tsx
+++ b/web/app/components/workflow/panel/env-panel/variable-modal.tsx
@@ -12,7 +12,7 @@ import { useWorkflowStore } from '@/app/components/workflow/store'
import { cn } from '@/utils/classnames'
import { checkKeys, replaceSpaceWithUnderscoreInVarNameInput } from '@/utils/var'
-export type ModalPropsType = {
+type ModalPropsType = {
env?: EnvironmentVariable
onClose: () => void
onSave: (env: EnvironmentVariable) => void
diff --git a/web/app/components/workflow/run/index.tsx b/web/app/components/workflow/run/index.tsx
index f648863e2d0..d39e6d43c3e 100644
--- a/web/app/components/workflow/run/index.tsx
+++ b/web/app/components/workflow/run/index.tsx
@@ -15,7 +15,7 @@ import ResultPanel from './result-panel'
import StatusPanel from './status'
import TracingPanel from './tracing-panel'
-export type RunProps = {
+type RunProps = {
hideResult?: boolean
activeTab?: 'RESULT' | 'DETAIL' | 'TRACING'
getResultCallback?: (result: WorkflowRunDetailResponse) => void
diff --git a/web/app/components/workflow/types.ts b/web/app/components/workflow/types.ts
index b66f7d77cc8..a770616d5db 100644
--- a/web/app/components/workflow/types.ts
+++ b/web/app/components/workflow/types.ts
@@ -132,7 +132,6 @@ export type CommonEdgeType = {
}
export type Node<T = {}> = ReactFlowNode<CommonNodeType<T>>
-export type SelectedNode = Pick<Node, 'id' | 'data'>
export type NodeProps<T = unknown> = { id: string, data: CommonNodeType<T> }
export type NodePanelProps<T> = {
id: string
@@ -187,11 +186,6 @@ export type GlobalVariable = {
description: string
}
-export type VariableWithValue = {
- key: string
- value: string
-}
-
export enum InputVarType {
textInput = 'text-input',
paragraph = 'paragraph',
@@ -392,11 +386,6 @@ export type OnNodeAdd = (
},
) => void
-export type CheckValidRes = {
- isValid: boolean
- errorMessage?: string
-}
-
export type RunFile = {
type: string
transfer_method: TransferMethod[]
diff --git a/web/app/components/workflow/utils/gen-node-meta-data.ts b/web/app/components/workflow/utils/gen-node-meta-data.ts
index e625e3a8af3..958a870a5f5 100644
--- a/web/app/components/workflow/utils/gen-node-meta-data.ts
+++ b/web/app/components/workflow/utils/gen-node-meta-data.ts
@@ -2,7 +2,7 @@ import type { BlockEnum } from '@/app/components/workflow/types'
import type { UseDifyNodesPath } from '@/types/doc-paths'
import { BlockClassificationEnum } from '@/app/components/workflow/block-selector/types'
-export type GenNodeMetaDataParams = {
+type GenNodeMetaDataParams = {
classification?: BlockClassificationEnum
sort: number
type: BlockEnum
diff --git a/web/app/components/workflow/utils/node-navigation.ts b/web/app/components/workflow/utils/node-navigation.ts
index 4294a113abc..3bded573c2f 100644
--- a/web/app/components/workflow/utils/node-navigation.ts
+++ b/web/app/components/workflow/utils/node-navigation.ts
@@ -6,7 +6,7 @@
/**
* Interface for node selection event detail
*/
-export type NodeSelectionDetail = {
+type NodeSelectionDetail = {
nodeId: string
focus?: boolean
}
diff --git a/web/app/components/workflow/utils/plugin-install-check.ts b/web/app/components/workflow/utils/plugin-install-check.ts
index b4d36406191..72a254856b4 100644
--- a/web/app/components/workflow/utils/plugin-install-check.ts
+++ b/web/app/components/workflow/utils/plugin-install-check.ts
@@ -7,7 +7,7 @@ import { CollectionType } from '@/app/components/tools/types'
import { canFindTool } from '@/utils'
import { BlockEnum } from '../types'
-export const PLUGIN_DEPENDENT_TYPES: BlockEnum[] = [
+const PLUGIN_DEPENDENT_TYPES: BlockEnum[] = [
BlockEnum.Tool,
BlockEnum.DataSource,
BlockEnum.TriggerPlugin,
@@ -50,7 +50,7 @@ export function matchDataSource(
)
}
-export type PluginInstallCheckContext = {
+type PluginInstallCheckContext = {
builtInTools?: ToolWithProvider[]
customTools?: ToolWithProvider[]
workflowTools?: ToolWithProvider[]
diff --git a/web/app/components/workflow/utils/trigger.ts b/web/app/components/workflow/utils/trigger.ts
index f6d197c69c7..569bf818948 100644
--- a/web/app/components/workflow/utils/trigger.ts
+++ b/web/app/components/workflow/utils/trigger.ts
@@ -1,7 +1,7 @@
import type { TriggerWithProvider } from '@/app/components/workflow/block-selector/types'
import type { PluginTriggerNodeType } from '@/app/components/workflow/nodes/trigger-plugin/types'
-export type TriggerCheckParams = {
+type TriggerCheckParams = {
triggerInputsSchema: Array<{
variable: string
label: string
diff --git a/web/app/components/workflow/variable-inspect/listening.tsx b/web/app/components/workflow/variable-inspect/listening.tsx
index dbe90d22709..b183976ea4e 100644
--- a/web/app/components/workflow/variable-inspect/listening.tsx
+++ b/web/app/components/workflow/variable-inspect/listening.tsx
@@ -70,7 +70,7 @@ const resolveMultipleListeningDescription = (
return t('debug.variableInspect.listening.tipFallback', { ns: 'workflow' })
}
-export type ListeningProps = {
+type ListeningProps = {
onStop: () => void
message?: string
}
diff --git a/web/app/components/workflow/workflow-history-store.tsx b/web/app/components/workflow/workflow-history-store.tsx
index 5d10f81b27b..efab0dd067a 100644
--- a/web/app/components/workflow/workflow-history-store.tsx
+++ b/web/app/components/workflow/workflow-history-store.tsx
@@ -10,7 +10,7 @@ import { temporal } from 'zundo'
import { create } from 'zustand'
export const WorkflowHistoryStoreContext = createContext<WorkflowHistoryStoreContextType>({ store: null, shortcutsEnabled: true, setShortcutsEnabled: noop })
-export const Provider = WorkflowHistoryStoreContext.Provider
+const Provider = WorkflowHistoryStoreContext.Provider
export function WorkflowHistoryProvider({
nodes,
@@ -120,7 +120,7 @@ type WorkflowHistoryStoreContextType = {
export type WorkflowHistoryStoreApi = StoreApi<WorkflowHistoryState> & { temporal: StoreApi<TemporalState<WorkflowHistoryState>> }
-export type WorkflowWithHistoryProviderProps = {
+type WorkflowWithHistoryProviderProps = {
nodes: Node[]
edges: Edge[]
children: ReactNode
diff --git a/web/app/education-apply/verify-state-modal.tsx b/web/app/education-apply/verify-state-modal.tsx
index afbaeeaeff9..6f1f529e76c 100644
--- a/web/app/education-apply/verify-state-modal.tsx
+++ b/web/app/education-apply/verify-state-modal.tsx
@@ -8,7 +8,7 @@ import { useTranslation } from 'react-i18next'
import Button from '@/app/components/base/button'
import { useDocLink } from '@/context/i18n'
-export type IConfirm = {
+type IConfirm = {
className?: string
isShow: boolean
title: string
diff --git a/web/context/app-context-provider.tsx b/web/context/app-context-provider.tsx
index 9b5e6dd9395..78a8f99e7f3 100644
--- a/web/context/app-context-provider.tsx
+++ b/web/context/app-context-provider.tsx
@@ -23,7 +23,7 @@ import {
} from '@/service/use-common'
import { useGlobalPublicStore } from './global-public-context'
-export type AppContextProviderProps = {
+type AppContextProviderProps = {
children: ReactNode
}
diff --git a/web/context/datasets-context.ts b/web/context/datasets-context.ts
deleted file mode 100644
index d309a8ef3fd..00000000000
--- a/web/context/datasets-context.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-'use client'
-
-import type { DataSet } from '@/models/datasets'
-import { noop } from 'es-toolkit/function'
-import { createContext, useContext } from 'use-context-selector'
-
-export type DatasetsContextValue = {
- datasets: DataSet[]
- mutateDatasets: () => void
- currentDataset?: DataSet
-}
-
-const DatasetsContext = createContext<DatasetsContextValue>({
- datasets: [],
- mutateDatasets: noop,
- currentDataset: undefined,
-})
-
-export const useDatasetsContext = () => useContext(DatasetsContext)
-
-export default DatasetsContext
diff --git a/web/context/event-emitter.ts b/web/context/event-emitter.ts
index eb7794dfe12..781bac1f610 100644
--- a/web/context/event-emitter.ts
+++ b/web/context/event-emitter.ts
@@ -20,5 +20,3 @@ export const EventEmitterContext = createContext<{ eventEmitter: EventEmitter<Ev
})
export const useEventEmitterContextContext = () => useContext(EventEmitterContext)
-
-export default EventEmitterContext
diff --git a/web/context/external-knowledge-api-context.tsx b/web/context/external-knowledge-api-context.tsx
index b137e8ca5ed..265171d2086 100644
--- a/web/context/external-knowledge-api-context.tsx
+++ b/web/context/external-knowledge-api-context.tsx
@@ -13,7 +13,7 @@ type ExternalKnowledgeApiContextType = {
const ExternalKnowledgeApiContext = createContext<ExternalKnowledgeApiContextType | undefined>(undefined)
-export type ExternalKnowledgeApiProviderProps = {
+type ExternalKnowledgeApiProviderProps = {
children: ReactNode
}
diff --git a/web/context/global-public-context.tsx b/web/context/global-public-context.tsx
index 3a570fc7efc..190033bbf7d 100644
--- a/web/context/global-public-context.tsx
+++ b/web/context/global-public-context.tsx
@@ -40,7 +40,7 @@ export function useIsSystemFeaturesPending() {
return isPending
}
-export function useSetupStatusQuery() {
+function useSetupStatusQuery() {
return useQuery({
queryKey: setupStatusQueryKey,
queryFn: fetchSetupStatusWithCache,
diff --git a/web/context/mitt-context.ts b/web/context/mitt-context.ts
index 5c4a0771c53..66616d70913 100644
--- a/web/context/mitt-context.ts
+++ b/web/context/mitt-context.ts
@@ -2,7 +2,7 @@
import type { useMitt } from '@/hooks/use-mitt'
import { noop } from 'es-toolkit/function'
-import { createContext, useContext, useContextSelector } from 'use-context-selector'
+import { createContext, useContextSelector } from 'use-context-selector'
type ContextValueType = ReturnType<typeof useMitt>
export const MittContext = createContext<ContextValueType>({
@@ -10,10 +10,6 @@ export const MittContext = createContext<ContextValueType>({
useSubscribe: noop,
})
-export const useMittContext = () => {
- return useContext(MittContext)
-}
-
export function useMittContextSelector<T>(selector: (value: ContextValueType) => T): T {
return useContextSelector(MittContext, selector)
}
diff --git a/web/context/modal-context-provider.tsx b/web/context/modal-context-provider.tsx
index 5f14729e748..5facc9a2026 100644
--- a/web/context/modal-context-provider.tsx
+++ b/web/context/modal-context-provider.tsx
@@ -405,5 +405,3 @@ export const ModalContextProvider = ({
</ModalContext.Provider>
)
}
-
-export default ModalContext
diff --git a/web/context/modal-context.ts b/web/context/modal-context.ts
index cc0ca28a42f..d019093955d 100644
--- a/web/context/modal-context.ts
+++ b/web/context/modal-context.ts
@@ -88,5 +88,3 @@ export const useModalContext = () => useContext(ModalContext)
// https://github.com/microsoft/TypeScript/issues/15713
export const useModalContextSelector = <T>(selector: (state: ModalContextState) => T): T =>
useContextSelector(ModalContext, selector)
-
-export default ModalContext
diff --git a/web/context/provider-context.ts b/web/context/provider-context.ts
index 27c43e7c91f..5d6c49c6b24 100644
--- a/web/context/provider-context.ts
+++ b/web/context/provider-context.ts
@@ -86,5 +86,3 @@ export const useProviderContext = () => useContext(ProviderContext)
// https://github.com/microsoft/TypeScript/issues/15713
export const useProviderContextSelector = <T>(selector: (state: ProviderContextState) => T): T =>
useContextSelector(ProviderContext, selector)
-
-export default ProviderContext
diff --git a/web/context/workspace-context.ts b/web/context/workspace-context.ts
index e088d12f4e1..b8edfc8236a 100644
--- a/web/context/workspace-context.ts
+++ b/web/context/workspace-context.ts
@@ -3,7 +3,7 @@
import type { IWorkspace } from '@/models/common'
import { createContext, useContext } from 'use-context-selector'
-export type WorkspacesContextValue = {
+type WorkspacesContextValue = {
workspaces: IWorkspace[]
}
@@ -12,5 +12,3 @@ export const WorkspacesContext = createContext<WorkspacesContextValue>({
})
export const useWorkspacesContext = () => useContext(WorkspacesContext)
-
-export default WorkspacesContext
diff --git a/web/contract/console/explore.ts b/web/contract/console/explore.ts
index 36749277fcc..e931b35c535 100644
--- a/web/contract/console/explore.ts
+++ b/web/contract/console/explore.ts
@@ -7,7 +7,7 @@ import type { AppModeEnum } from '@/types/app'
import { type } from '@orpc/contract'
import { base } from '../base'
-export type ExploreAppsResponse = {
+type ExploreAppsResponse = {
categories: AppCategory[]
recommended_apps: App[]
}
@@ -22,16 +22,16 @@ export type ExploreAppDetailResponse = {
can_trial?: boolean
}
-export type InstalledAppsResponse = {
+type InstalledAppsResponse = {
installed_apps: InstalledApp[]
}
-export type InstalledAppMutationResponse = {
+type InstalledAppMutationResponse = {
result: string
message: string
}
-export type AppAccessModeResponse = {
+type AppAccessModeResponse = {
accessMode: AccessMode
}
diff --git a/web/contract/console/notification.ts b/web/contract/console/notification.ts
index f82d45efa58..8a167e0f9fd 100644
--- a/web/contract/console/notification.ts
+++ b/web/contract/console/notification.ts
@@ -1,7 +1,7 @@
import { type } from '@orpc/contract'
import { base } from '../base'
-export type ConsoleNotification = {
+type ConsoleNotification = {
body: string
frequency: 'once' | 'always'
lang: string
@@ -11,7 +11,7 @@ export type ConsoleNotification = {
title_pic_url?: string
}
-export type ConsoleNotificationResponse = {
+type ConsoleNotificationResponse = {
notifications: ConsoleNotification[]
should_show: boolean
}
diff --git a/web/contract/router.ts b/web/contract/router.ts
index d325cac6601..eec3966ad1f 100644
--- a/web/contract/router.ts
+++ b/web/contract/router.ts
@@ -98,5 +98,3 @@ export const consoleRouterContract = {
oauthInitiate: triggerOAuthInitiateContract,
},
}
-
-export type ConsoleInputs = InferContractRouterInputs<typeof consoleRouterContract>
diff --git a/web/eslint-suppressions.json b/web/eslint-suppressions.json
index 95d6a4660ec..b9a77b68947 100644
--- a/web/eslint-suppressions.json
+++ b/web/eslint-suppressions.json
@@ -876,11 +876,6 @@
"count": 4
}
},
- "app/components/app/configuration/config/agent/prompt-editor.tsx": {
- "tailwindcss/enforce-consistent-class-order": {
- "count": 2
- }
- },
"app/components/app/configuration/config/assistant-type-picker/index.tsx": {
"no-restricted-imports": {
"count": 1
@@ -1227,11 +1222,6 @@
"count": 2
}
},
- "app/components/app/configuration/tools/index.tsx": {
- "tailwindcss/enforce-consistent-class-order": {
- "count": 5
- }
- },
"app/components/app/create-app-dialog/app-card/index.spec.tsx": {
"ts/no-explicit-any": {
"count": 1
@@ -1462,9 +1452,6 @@
}
},
"app/components/app/text-generate/item/index.tsx": {
- "react-refresh/only-export-components": {
- "count": 1
- },
"react/set-state-in-effect": {
"count": 3
},
@@ -2128,7 +2115,7 @@
},
"app/components/base/chat/types.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 3
+ "count": 2
}
},
"app/components/base/chat/utils.ts": {
@@ -2575,7 +2562,7 @@
},
"app/components/base/file-uploader/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 7
+ "count": 5
}
},
"app/components/base/file-uploader/pdf-highlighter-adapter.tsx": {
@@ -2741,7 +2728,7 @@
"count": 2
},
"ts/no-explicit-any": {
- "count": 16
+ "count": 15
}
},
"app/components/base/form/utils/secret-input/index.ts": {
@@ -2759,7 +2746,7 @@
"count": 1
},
"react-refresh/only-export-components": {
- "count": 4
+ "count": 1
}
},
"app/components/base/grid-mask/index.stories.tsx": {
@@ -2772,11 +2759,6 @@
"count": 1
}
},
- "app/components/base/icons/src/image/llm/index.ts": {
- "no-barrel-files/no-barrel-files": {
- "count": 9
- }
- },
"app/components/base/icons/src/public/avatar/index.ts": {
"no-barrel-files/no-barrel-files": {
"count": 2
@@ -2784,12 +2766,12 @@
},
"app/components/base/icons/src/public/billing/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 12
+ "count": 4
}
},
"app/components/base/icons/src/public/common/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 16
+ "count": 6
}
},
"app/components/base/icons/src/public/education/index.ts": {
@@ -2804,12 +2786,12 @@
},
"app/components/base/icons/src/public/knowledge/dataset-card/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 5
+ "count": 4
}
},
"app/components/base/icons/src/public/knowledge/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 8
+ "count": 6
}
},
"app/components/base/icons/src/public/knowledge/online-drive/index.ts": {
@@ -2819,27 +2801,17 @@
},
"app/components/base/icons/src/public/llm/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 50
- }
- },
- "app/components/base/icons/src/public/model/index.ts": {
- "no-barrel-files/no-barrel-files": {
- "count": 1
+ "count": 9
}
},
"app/components/base/icons/src/public/other/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 6
- }
- },
- "app/components/base/icons/src/public/plugins/index.ts": {
- "no-barrel-files/no-barrel-files": {
- "count": 7
+ "count": 5
}
},
"app/components/base/icons/src/public/thought/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 5
+ "count": 1
}
},
"app/components/base/icons/src/public/tracing/index.ts": {
@@ -2854,32 +2826,32 @@
},
"app/components/base/icons/src/vender/knowledge/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 16
+ "count": 15
}
},
"app/components/base/icons/src/vender/line/alertsAndFeedback/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 4
+ "count": 2
}
},
"app/components/base/icons/src/vender/line/arrows/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 9
+ "count": 6
}
},
"app/components/base/icons/src/vender/line/communication/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 6
+ "count": 3
}
},
"app/components/base/icons/src/vender/line/development/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 14
+ "count": 2
}
},
"app/components/base/icons/src/vender/line/editor/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 8
+ "count": 1
}
},
"app/components/base/icons/src/vender/line/education/index.ts": {
@@ -2889,17 +2861,17 @@
},
"app/components/base/icons/src/vender/line/files/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 11
+ "count": 7
}
},
"app/components/base/icons/src/vender/line/financeAndECommerce/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 7
+ "count": 4
}
},
"app/components/base/icons/src/vender/line/general/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 30
+ "count": 12
}
},
"app/components/base/icons/src/vender/line/images/index.ts": {
@@ -2909,42 +2881,27 @@
},
"app/components/base/icons/src/vender/line/layout/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 4
+ "count": 1
}
},
"app/components/base/icons/src/vender/line/mediaAndDevices/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 6
+ "count": 2
}
},
"app/components/base/icons/src/vender/line/others/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 10
- }
- },
- "app/components/base/icons/src/vender/line/shapes/index.ts": {
- "no-barrel-files/no-barrel-files": {
- "count": 1
+ "count": 7
}
},
"app/components/base/icons/src/vender/line/time/index.ts": {
- "no-barrel-files/no-barrel-files": {
- "count": 4
- }
- },
- "app/components/base/icons/src/vender/line/users/index.ts": {
"no-barrel-files/no-barrel-files": {
"count": 2
}
},
- "app/components/base/icons/src/vender/line/weather/index.ts": {
- "no-barrel-files/no-barrel-files": {
- "count": 1
- }
- },
"app/components/base/icons/src/vender/other/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 9
+ "count": 8
}
},
"app/components/base/icons/src/vender/pipeline/index.ts": {
@@ -2959,7 +2916,7 @@
},
"app/components/base/icons/src/vender/solid/FinanceAndECommerce/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 2
+ "count": 1
}
},
"app/components/base/icons/src/vender/solid/alertsAndFeedback/index.ts": {
@@ -2969,47 +2926,42 @@
},
"app/components/base/icons/src/vender/solid/arrows/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 5
+ "count": 3
}
},
"app/components/base/icons/src/vender/solid/communication/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 12
+ "count": 6
}
},
"app/components/base/icons/src/vender/solid/development/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 13
+ "count": 4
}
},
"app/components/base/icons/src/vender/solid/editor/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 5
+ "count": 1
}
},
"app/components/base/icons/src/vender/solid/education/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 4
+ "count": 3
}
},
"app/components/base/icons/src/vender/solid/files/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 4
+ "count": 3
}
},
"app/components/base/icons/src/vender/solid/general/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 18
- }
- },
- "app/components/base/icons/src/vender/solid/layout/index.ts": {
- "no-barrel-files/no-barrel-files": {
- "count": 1
+ "count": 11
}
},
"app/components/base/icons/src/vender/solid/mediaAndDevices/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 12
+ "count": 2
}
},
"app/components/base/icons/src/vender/solid/security/index.ts": {
@@ -3019,12 +2971,12 @@
},
"app/components/base/icons/src/vender/solid/shapes/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 3
+ "count": 1
}
},
"app/components/base/icons/src/vender/solid/users/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 4
+ "count": 1
}
},
"app/components/base/icons/src/vender/system/index.ts": {
@@ -3034,7 +2986,7 @@
},
"app/components/base/icons/src/vender/workflow/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 31
+ "count": 30
}
},
"app/components/base/icons/utils.ts": {
@@ -3210,7 +3162,7 @@
},
"app/components/base/markdown-blocks/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 11
+ "count": 10
}
},
"app/components/base/markdown-blocks/link.tsx": {
@@ -3457,9 +3409,6 @@
}
},
"app/components/base/portal-to-follow-elem/index.tsx": {
- "react-refresh/only-export-components": {
- "count": 2
- },
"ts/no-explicit-any": {
"count": 1
}
@@ -4044,11 +3993,6 @@
"count": 1
}
},
- "app/components/base/ui/context-menu/index.tsx": {
- "tailwindcss/enforce-consistent-class-order": {
- "count": 1
- }
- },
"app/components/base/ui/dialog/index.tsx": {
"tailwindcss/enforce-consistent-class-order": {
"count": 4
@@ -4390,7 +4334,7 @@
},
"app/components/datasets/common/image-uploader/store.tsx": {
"react-refresh/only-export-components": {
- "count": 4
+ "count": 3
}
},
"app/components/datasets/common/retrieval-method-info/index.tsx": {
@@ -4574,7 +4518,7 @@
},
"app/components/datasets/create/step-one/hooks/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 2
+ "count": 1
}
},
"app/components/datasets/create/step-one/upgrade-card.tsx": {
@@ -4631,7 +4575,7 @@
},
"app/components/datasets/create/step-two/hooks/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 10
+ "count": 6
}
},
"app/components/datasets/create/step-two/hooks/use-indexing-config.ts": {
@@ -4807,7 +4751,7 @@
},
"app/components/datasets/documents/components/document-list/components/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 4
+ "count": 2
}
},
"app/components/datasets/documents/components/document-list/components/sort-header.tsx": {
@@ -4820,11 +4764,6 @@
"count": 4
}
},
- "app/components/datasets/documents/components/document-list/index.tsx": {
- "no-barrel-files/no-barrel-files": {
- "count": 2
- }
- },
"app/components/datasets/documents/components/documents-header.tsx": {
"no-restricted-imports": {
"count": 1
@@ -5189,7 +5128,7 @@
},
"app/components/datasets/documents/detail/completed/hooks/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 10
+ "count": 5
}
},
"app/components/datasets/documents/detail/completed/hooks/use-search-filter.ts": {
@@ -5273,7 +5212,7 @@
},
"app/components/datasets/documents/detail/embedding/hooks/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 2
+ "count": 1
}
},
"app/components/datasets/documents/detail/embedding/skeleton/index.tsx": {
@@ -6012,7 +5951,7 @@
},
"app/components/goto-anything/actions/commands/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 5
+ "count": 2
}
},
"app/components/goto-anything/actions/commands/registry.ts": {
@@ -6022,7 +5961,7 @@
},
"app/components/goto-anything/actions/commands/slash.tsx": {
"react-refresh/only-export-components": {
- "count": 3
+ "count": 1
},
"ts/no-explicit-any": {
"count": 1
@@ -6035,7 +5974,7 @@
},
"app/components/goto-anything/actions/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 6
+ "count": 2
}
},
"app/components/goto-anything/actions/types.ts": {
@@ -6055,7 +5994,7 @@
},
"app/components/goto-anything/components/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 10
+ "count": 4
}
},
"app/components/goto-anything/components/result-item.tsx": {
@@ -6078,7 +6017,7 @@
},
"app/components/goto-anything/hooks/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 8
+ "count": 4
}
},
"app/components/goto-anything/hooks/use-goto-anything-results.ts": {
@@ -6112,11 +6051,6 @@
"count": 6
}
},
- "app/components/header/account-dropdown/menu-item-content.tsx": {
- "react-refresh/only-export-components": {
- "count": 1
- }
- },
"app/components/header/account-dropdown/workplace-selector/index.tsx": {
"tailwindcss/enforce-consistent-class-order": {
"count": 7
@@ -6428,7 +6362,7 @@
},
"app/components/header/account-setting/model-provider-page/model-auth/index.tsx": {
"no-barrel-files/no-barrel-files": {
- "count": 8
+ "count": 7
}
},
"app/components/header/account-setting/model-provider-page/model-auth/switch-credential-in-load-balancing.tsx": {
@@ -7294,10 +7228,7 @@
},
"app/components/plugins/plugin-detail-panel/subscription-list/index.tsx": {
"no-barrel-files/no-barrel-files": {
- "count": 3
- },
- "react-refresh/only-export-components": {
- "count": 1
+ "count": 2
}
},
"app/components/plugins/plugin-detail-panel/subscription-list/list-view.tsx": {
@@ -7347,7 +7278,7 @@
},
"app/components/plugins/plugin-detail-panel/tool-selector/components/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 8
+ "count": 7
}
},
"app/components/plugins/plugin-detail-panel/tool-selector/components/reasoning-config-form.tsx": {
@@ -7386,7 +7317,7 @@
},
"app/components/plugins/plugin-detail-panel/tool-selector/hooks/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 3
+ "count": 2
}
},
"app/components/plugins/plugin-detail-panel/tool-selector/index.tsx": {
@@ -7615,7 +7546,7 @@
"count": 7
},
"ts/no-explicit-any": {
- "count": 30
+ "count": 25
}
},
"app/components/plugins/update-plugin/downgrade-warning.tsx": {
@@ -8213,7 +8144,7 @@
},
"app/components/tools/types.ts": {
"erasable-syntax-only/enums": {
- "count": 5
+ "count": 4
},
"ts/no-explicit-any": {
"count": 4
@@ -8319,11 +8250,6 @@
"count": 2
}
},
- "app/components/workflow/__tests__/fixtures.ts": {
- "no-barrel-files/no-barrel-files": {
- "count": 2
- }
- },
"app/components/workflow/block-selector/all-start-blocks.tsx": {
"react/set-state-in-effect": {
"count": 1
@@ -8681,7 +8607,7 @@
},
"app/components/workflow/hooks/index.ts": {
"no-barrel-files/no-barrel-files": {
- "count": 26
+ "count": 25
}
},
"app/components/workflow/hooks/use-checklist.ts": {
@@ -8717,11 +8643,6 @@
"count": 8
}
},
- "app/components/workflow/hooks/use-nodes-layout.ts": {
- "ts/no-explicit-any": {
- "count": 1
- }
- },
"app/components/workflow/hooks/use-serial-async-callback.ts": {
"ts/no-explicit-any": {
"count": 1
@@ -9392,7 +9313,7 @@
"count": 1
},
"ts/no-explicit-any": {
- "count": 3
+ "count": 1
}
},
"app/components/workflow/nodes/agent/components/model-bar.tsx": {
@@ -9428,9 +9349,6 @@
}
},
"app/components/workflow/nodes/agent/panel.tsx": {
- "react-refresh/only-export-components": {
- "count": 1
- },
"ts/no-explicit-any": {
"count": 1
}
@@ -10380,7 +10298,7 @@
},
"app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/context.tsx": {
"react-refresh/only-export-components": {
- "count": 3
+ "count": 2
}
},
"app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/edit-card/actions.tsx": {
@@ -10473,7 +10391,7 @@
"count": 1
},
"ts/no-explicit-any": {
- "count": 10
+ "count": 7
}
},
"app/components/workflow/nodes/loop-start/index.tsx": {
@@ -10860,9 +10778,6 @@
}
},
"app/components/workflow/nodes/trigger-plugin/types.ts": {
- "no-barrel-files/no-barrel-files": {
- "count": 1
- },
"ts/no-explicit-any": {
"count": 4
}
@@ -11748,7 +11663,7 @@
},
"app/components/workflow/workflow-history-store.tsx": {
"react-refresh/only-export-components": {
- "count": 3
+ "count": 2
}
},
"app/components/workflow/workflow-preview/components/error-handle-on-node.tsx": {
@@ -11994,7 +11909,7 @@
},
"context/global-public-context.tsx": {
"react-refresh/only-export-components": {
- "count": 4
+ "count": 3
}
},
"context/hooks/use-trigger-events-limit-modal.ts": {
@@ -12003,9 +11918,6 @@
}
},
"context/modal-context-provider.tsx": {
- "no-barrel-files/no-barrel-files": {
- "count": 1
- },
"ts/no-explicit-any": {
"count": 3
}
@@ -12056,11 +11968,6 @@
"count": 2
}
},
- "hooks/use-moderate.ts": {
- "react/set-state-in-effect": {
- "count": 1
- }
- },
"hooks/use-oauth.ts": {
"ts/no-explicit-any": {
"count": 1
@@ -12070,9 +11977,6 @@
"no-restricted-imports": {
"count": 2
},
- "react-refresh/only-export-components": {
- "count": 3
- },
"react/set-state-in-effect": {
"count": 4
}
@@ -12149,7 +12053,7 @@
},
"models/common.ts": {
"erasable-syntax-only/enums": {
- "count": 3
+ "count": 2
},
"ts/no-explicit-any": {
"count": 3
@@ -12188,18 +12092,10 @@
}
},
"models/share.ts": {
- "ts/no-empty-object-type": {
- "count": 1
- },
"ts/no-explicit-any": {
"count": 1
}
},
- "scripts/analyze-component.js": {
- "unused-imports/no-unused-vars": {
- "count": 1
- }
- },
"scripts/component-analyzer.js": {
"regexp/no-unused-capturing-group": {
"count": 6
@@ -12217,7 +12113,7 @@
},
"service/apps.ts": {
"ts/no-explicit-any": {
- "count": 17
+ "count": 7
}
},
"service/base.ts": {
@@ -12232,7 +12128,7 @@
},
"service/datasets.ts": {
"ts/no-explicit-any": {
- "count": 8
+ "count": 6
}
},
"service/debug.ts": {
@@ -12291,9 +12187,6 @@
},
"service/use-pipeline.ts": {
"@tanstack/query/exhaustive-deps": {
- "count": 2
- },
- "ts/no-explicit-any": {
"count": 1
}
},
@@ -12315,7 +12208,7 @@
},
"service/use-tools.ts": {
"ts/no-explicit-any": {
- "count": 2
+ "count": 1
}
},
"service/use-workflow.ts": {
@@ -12331,14 +12224,9 @@
"count": 2
}
},
- "service/workflow-payload.ts": {
- "ts/no-explicit-any": {
- "count": 10
- }
- },
"types/app.ts": {
"erasable-syntax-only/enums": {
- "count": 11
+ "count": 9
},
"ts/no-explicit-any": {
"count": 1
diff --git a/web/hooks/use-mitt.ts b/web/hooks/use-mitt.ts
index e29396aefbb..af07dd7d205 100644
--- a/web/hooks/use-mitt.ts
+++ b/web/hooks/use-mitt.ts
@@ -8,9 +8,9 @@ const merge = <T extends Record<string, any>>(
return Object.assign({}, ...args)
}
-export type _Events = Record<EventType, unknown>
+type _Events = Record<EventType, unknown>
-export type UseSubscribeOption = {
+type UseSubscribeOption = {
/**
* Whether the subscription is enabled.
* @default true
@@ -18,7 +18,7 @@ export type UseSubscribeOption = {
enabled: boolean
}
-export type ExtendedOn<Events extends _Events> = {
+type ExtendedOn<Events extends _Events> = {
<Key extends keyof Events>(
type: Key,
handler: Handler<Events[Key]>,
@@ -31,7 +31,7 @@ export type ExtendedOn<Events extends _Events> = {
): void
}
-export type UseMittReturn<Events extends _Events> = {
+type UseMittReturn<Events extends _Events> = {
useSubscribe: ExtendedOn<Events>
emit: Emitter<Events>['emit']
}
diff --git a/web/hooks/use-moderate.ts b/web/hooks/use-moderate.ts
deleted file mode 100644
index e42441e58e3..00000000000
--- a/web/hooks/use-moderate.ts
+++ /dev/null
@@ -1,49 +0,0 @@
-import type { ModerationService } from '@/models/common'
-import { useEffect, useRef, useState } from 'react'
-
-function splitStringByLength(inputString: string, chunkLength: number) {
- const resultArray = []
- for (let i = 0; i < inputString.length; i += chunkLength)
- resultArray.push(inputString.substring(i, i + chunkLength))
-
- return resultArray
-}
-
-export const useModerate = (
- content: string,
- stop: boolean,
- moderationService: (text: string) => ReturnType<ModerationService>,
- separateLength = 50,
-) => {
- const moderatedContentMap = useRef<Map<number, string>>(new Map())
- const moderatingIndex = useRef<number[]>([])
- const [contentArr, setContentArr] = useState<string[]>([])
-
- const handleModerate = () => {
- const stringArr = splitStringByLength(content, separateLength)
-
- const lastIndex = stringArr.length - 1
- stringArr.forEach((item, index) => {
- if (!(index in moderatingIndex.current) && !moderatedContentMap.current.get(index)) {
- if (index === lastIndex && !stop)
- return
-
- moderatingIndex.current.push(index)
- moderationService(item).then((res) => {
- if (res.flagged) {
- moderatedContentMap.current.set(index, res.text)
- setContentArr([...stringArr.slice(0, index), res.text, ...stringArr.slice(index + 1)])
- }
- })
- }
- })
-
- setContentArr(stringArr)
- }
- useEffect(() => {
- if (content)
- handleModerate()
- }, [content, stop])
-
- return contentArr.map((item, index) => moderatedContentMap.current.get(index) || item).join('')
-}
diff --git a/web/hooks/use-pay.tsx b/web/hooks/use-pay.tsx
index 5ce50fdb0f4..3a90a798058 100644
--- a/web/hooks/use-pay.tsx
+++ b/web/hooks/use-pay.tsx
@@ -7,9 +7,9 @@ import Confirm from '@/app/components/base/confirm'
import { useRouter, useSearchParams } from '@/next/navigation'
import { useNotionBinding } from '@/service/use-common'
-export type ConfirmType = Pick<IConfirm, 'type' | 'title' | 'content'>
+type ConfirmType = Pick<IConfirm, 'type' | 'title' | 'content'>
-export const useAnthropicCheckPay = () => {
+const useAnthropicCheckPay = () => {
const { t } = useTranslation()
const [confirm, setConfirm] = useState<ConfirmType | null>(null)
const searchParams = useSearchParams()
@@ -28,7 +28,7 @@ export const useAnthropicCheckPay = () => {
return confirm
}
-export const useBillingPay = () => {
+const useBillingPay = () => {
const { t } = useTranslation()
const [confirm, setConfirm] = useState<ConfirmType | null>(null)
const searchParams = useSearchParams()
@@ -47,7 +47,7 @@ export const useBillingPay = () => {
return confirm
}
-export const useCheckNotion = () => {
+const useCheckNotion = () => {
const router = useRouter()
const [confirm, setConfirm] = useState<ConfirmType | null>(null)
const [canBinding, setCanBinding] = useState(false)
diff --git a/web/i18n-config/language.ts b/web/i18n-config/language.ts
index cdfd2854420..397c361cdae 100644
--- a/web/i18n-config/language.ts
+++ b/web/i18n-config/language.ts
@@ -1,12 +1,6 @@
import type { DocLanguage } from '@/types/doc-paths'
import data from './languages'
-export type Item = {
- value: number | string
- name: string
- example: string
-}
-
export type I18nText = Record<typeof LanguagesSupported[number], string>
export const languages = data.languages
diff --git a/web/knip.config.ts b/web/knip.config.ts
index c1f4a49615a..2700e007178 100644
--- a/web/knip.config.ts
+++ b/web/knip.config.ts
@@ -7,7 +7,6 @@ const config: KnipConfig = {
entry: [
'scripts/**/*.{js,ts,mjs}',
'bin/**/*.{js,ts,mjs}',
- 'taze.config.js',
'tsslint.config.ts',
],
ignore: [
@@ -22,19 +21,23 @@ const config: KnipConfig = {
'@storybook/addon-onboarding',
],
+ /// keep-sorted
rules: {
- files: 'warn',
+ binaries: 'error',
+ catalog: 'error',
dependencies: 'error',
devDependencies: 'error',
+ duplicates: 'error',
+ enumMembers: 'error',
+ exports: 'error',
+ files: 'error',
+ namespaceMembers: 'error',
+ nsExports: 'error',
+ nsTypes: 'error',
optionalPeerDependencies: 'error',
- unlisted: 'warn',
- unresolved: 'warn',
- exports: 'warn',
- nsExports: 'warn',
- types: 'warn',
- nsTypes: 'warn',
- enumMembers: 'warn',
- duplicates: 'warn',
+ types: 'error',
+ unlisted: 'error',
+ unresolved: 'error',
},
}
diff --git a/web/models/app.ts b/web/models/app.ts
index 056f5cb1739..1a045650357 100644
--- a/web/models/app.ts
+++ b/web/models/app.ts
@@ -12,7 +12,7 @@ import type {
WeaveConfig,
} from '@/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/type'
import type { Dependency } from '@/app/components/plugins/types'
-import type { App, AppModeEnum, AppTemplate, SiteConfig } from '@/types/app'
+import type { App, AppModeEnum, SiteConfig } from '@/types/app'
export enum DSLImportMode {
YAML_CONTENT = 'yaml-content',
@@ -47,12 +47,6 @@ export type DSLImportResponse = {
leaked_dependencies: Dependency[]
}
-export type AppTemplatesResponse = {
- data: AppTemplate[]
-}
-
-export type CreateAppResponse = App
-
export type UpdateAppSiteCodeResponse = { app_id: string } & SiteConfig
export type AppDailyMessagesResponse = {
@@ -105,10 +99,6 @@ export type ValidateOpenAIKeyResponse = {
export type UpdateOpenAIKeyResponse = ValidateOpenAIKeyResponse
-export type GenerationIntroductionResponse = {
- introduction: string
-}
-
export type AppVoicesListResponse = [{
name: string
value: string
diff --git a/web/models/common.ts b/web/models/common.ts
index 9c8866b25b8..0e44b10e62a 100644
--- a/web/models/common.ts
+++ b/web/models/common.ts
@@ -5,18 +5,6 @@ export type CommonResponse = {
result: 'success' | 'fail'
}
-export type FileDownloadResponse = {
- id: string
- name: string
- size: number
- extension: string
- url: string
- download_url: string
- mime_type: string
- created_by: string
- created_at: number
-}
-
export type OauthResponse = {
redirect_url: string
}
@@ -62,20 +50,6 @@ export type LangGeniusVersionResponse = {
current_env: string
}
-export type TenantInfoResponse = {
- name: string
- created_at: string
- providers: Array<{
- provider: string
- provider_name: string
- token_is_set: boolean
- is_valid: boolean
- token_is_valid: boolean
- }>
- in_trail: boolean
- trial_end_reason: null | 'trial_exceeded' | 'using_custom'
-}
-
export type Member = Pick<UserProfileResponse, 'id' | 'name' | 'email' | 'last_login_at' | 'last_active_at' | 'created_at' | 'avatar_url'> & {
avatar: string
status: 'pending' | 'active' | 'banned' | 'closed'
@@ -100,11 +74,6 @@ export type ProviderAzureToken = {
export type ProviderAnthropicToken = {
anthropic_api_key?: string
}
-export type ProviderTokenType = {
- [ProviderName.OPENAI]: string
- [ProviderName.AZURE_OPENAI]: ProviderAzureToken
- [ProviderName.ANTHROPIC]: ProviderAnthropicToken
-}
export type Provider = {
[Name in ProviderName]: {
provider_name: Name
@@ -117,12 +86,6 @@ export type Provider = {
}
}[ProviderName]
-export type ProviderHosted = Provider & {
- quota_type: string
- quota_limit: number
- quota_used: number
-}
-
export type AccountIntegrate = {
provider: 'google' | 'github'
created_at: number
@@ -179,8 +142,6 @@ export type DataSourceNotionWorkspace = {
pages: DataSourceNotionPage[]
}
-export type DataSourceNotionWorkspaceMap = Record<string, DataSourceNotionWorkspace>
-
export type DataSourceNotion = {
id: string
provider: string
@@ -188,38 +149,12 @@ export type DataSourceNotion = {
source_info: DataSourceNotionWorkspace
}
-export enum DataSourceCategory {
- website = 'website',
-}
export enum DataSourceProvider {
fireCrawl = 'firecrawl',
jinaReader = 'jinareader',
waterCrawl = 'watercrawl',
}
-export type FirecrawlConfig = {
- api_key: string
- base_url: string
-}
-
-export type WatercrawlConfig = {
- api_key: string
- base_url: string
-}
-
-export type DataSourceItem = {
- id: string
- category: DataSourceCategory
- provider: DataSourceProvider
- disabled: boolean
- created_at: number
- updated_at: number
-}
-
-export type DataSources = {
- sources: DataSourceItem[]
-}
-
export type PluginProvider = {
tool_name: string
is_enabled: boolean
@@ -300,14 +235,6 @@ export type ModerateResponse = {
text: string
}
-export type ModerationService = (
- url: string,
- body: {
- app_id: string
- text: string
- },
-) => Promise<ModerateResponse>
-
export type StructuredOutputRulesRequestBody = {
instruction: string
model_config: Model
diff --git a/web/models/datasets.ts b/web/models/datasets.ts
index e4793357f4c..08595069b33 100644
--- a/web/models/datasets.ts
+++ b/web/models/datasets.ts
@@ -7,7 +7,6 @@ import type { MetadataFilteringVariableType } from '@/app/components/workflow/no
import type { AppIconType, AppModeEnum, RetrievalConfig, TransferMethod } from '@/types/app'
import type { I18nKeysByPrefix } from '@/types/i18n'
import { ExternalKnowledgeBase, General, ParentChild, Qa } from '@/app/components/base/icons/src/public/knowledge/dataset-card'
-import { GeneralChunk, ParentChildChunk, QuestionAndAnswer } from '@/app/components/base/icons/src/vender/knowledge'
export enum DataSourceType {
FILE = 'upload_file',
@@ -474,10 +473,6 @@ export type NotionInfo = {
pages: DataSourceNotionPage[]
credential_id: string
}
-export type NotionPage = {
- page_id: string
- type: string
-}
export type ProcessRule = {
mode: ProcessMode
@@ -550,15 +545,6 @@ export type DocumentDetailResponse = FullDocumentDetail
export const SEGMENT_STATUS_LIST = ['waiting', 'completed', 'error', 'indexing']
export type SegmentStatus = typeof SEGMENT_STATUS_LIST[number]
-export type SegmentsQuery = {
- page?: string
- limit: number
- // status?: SegmentStatus
- hit_count_gte?: number
- keyword?: string
- enabled?: boolean | 'all'
-}
-
export type Attachment = {
id: string
name: string
@@ -785,11 +771,6 @@ export type ChildSegmentsResponse = {
limit: number
}
-export type UpdateDocumentParams = {
- datasetId: string
- documentId: string
-}
-
// Used in api url
export enum DocumentActionType {
enable = 'enable',
@@ -819,12 +800,6 @@ export const DOC_FORM_ICON_WITH_BG: Record<ChunkingMode | 'external', React.Comp
external: ExternalKnowledgeBase,
}
-export const DOC_FORM_ICON: Record<ChunkingMode.text | ChunkingMode.qa | ChunkingMode.parentChild, React.ComponentType<{ className: string }>> = {
- [ChunkingMode.text]: GeneralChunk,
- [ChunkingMode.qa]: QuestionAndAnswer,
- [ChunkingMode.parentChild]: ParentChildChunk,
-}
-
type ChunkingModeText = I18nKeysByPrefix<'dataset', 'chunkingMode.'>
export const DOC_FORM_TEXT: Record<ChunkingMode, ChunkingModeText> = {
@@ -857,12 +832,6 @@ export type IndexingStatusBatchRequest = {
batchId: string
}
-export type HitTestingRecordsRequest = {
- datasetId: string
- page: number
- limit: number
-}
-
export type HitTestingRequest = {
query: string
attachment_ids: string[]
diff --git a/web/models/debug.ts b/web/models/debug.ts
index fb75ae7946e..9aab3334cbc 100644
--- a/web/models/debug.ts
+++ b/web/models/debug.ts
@@ -65,17 +65,6 @@ export type PromptVariable = {
json_schema?: string | Record<string, any>
}
-export type CompletionParams = {
- max_tokens: number
- temperature: number
- top_p: number
- presence_penalty: number
- frequency_penalty: number
- stop?: string[]
-}
-
-export type ModelId = 'gpt-3.5-turbo' | 'text-davinci-003'
-
export type PromptConfig = {
prompt_template: string
prompt_variables: PromptVariable[]
@@ -159,11 +148,6 @@ export type ModelConfig = {
dataSets: any[]
agentConfig: AgentConfig
}
-export type DatasetConfigItem = {
- enable: boolean
- value: number
-}
-
export type DatasetConfigs = {
retrieval_model: RETRIEVE_TYPE
reranking_model: {
@@ -197,74 +181,6 @@ export type DatasetConfigs = {
metadata_model_config?: NodeModelConfig
}
-export type DebugRequestBody = {
- inputs: Inputs
- query: string
- completion_params: CompletionParams
- model_config: ModelConfig
-}
-
-export type DebugResponse = {
- id: string
- answer: string
- created_at: string
-}
-
-export type DebugResponseStream = {
- id: string
- data: string
- created_at: string
-}
-
-export type FeedBackRequestBody = {
- message_id: string
- rating: 'like' | 'dislike'
- content?: string
- from_source: 'api' | 'log'
-}
-
-export type FeedBackResponse = {
- message_id: string
- rating: 'like' | 'dislike'
-}
-
-// Log session list
-export type LogSessionListQuery = {
- keyword?: string
- start?: string // format datetime(YYYY-mm-dd HH:ii)
- end?: string // format datetime(YYYY-mm-dd HH:ii)
- page: number
- limit: number // default 20. 1-100
-}
-
-export type LogSessionListResponse = {
- data: {
- id: string
- conversation_id: string
- query: string // user's query question
- message: string // prompt send to LLM
- answer: string
- created_at: string
- }[]
- total: number
- page: number
-}
-
-// log session detail and debug
-export type LogSessionDetailResponse = {
- id: string
- conversation_id: string
- model_provider: string
- query: string
- inputs: Record<string, string | number | object>[]
- message: string
- message_tokens: number // number of tokens in message
- answer: string
- answer_tokens: number // number of tokens in answer
- provider_response_latency: number // used time in ms
- from_source: 'api' | 'log'
-}
-
export type SavedMessage = {
id: string
answer: string
diff --git a/web/models/log.ts b/web/models/log.ts
index ab1282b8af3..f9cb13ab8e2 100644
--- a/web/models/log.ts
+++ b/web/models/log.ts
@@ -6,10 +6,6 @@ import type {
} from '@/app/components/workflow/types'
import type { VisionFile } from '@/types/app'
-export const CompletionParams = ['temperature', 'top_p', 'presence_penalty', 'max_token', 'stop', 'frequency_penalty'] as const
-
-export type CompletionParamType = typeof CompletionParams[number]
-
export type CompletionParamsType = {
max_tokens: number
temperature: number
@@ -279,13 +275,6 @@ export type WorkflowLogsResponse = {
total: number
page: number
}
-export type WorkflowLogsRequest = {
- keyword: string
- status: string
- page: number
- limit: number // The default value is 20 and the range is 1-100
-}
-
export type WorkflowRunDetailResponse = {
id: string
version: string
diff --git a/web/models/pipeline.ts b/web/models/pipeline.ts
index 143bc611807..e75ee7569a1 100644
--- a/web/models/pipeline.ts
+++ b/web/models/pipeline.ts
@@ -1,7 +1,6 @@
import type { Viewport } from 'reactflow'
import type { DSLImportMode, DSLImportStatus } from './app'
-import type { ChunkingMode, DatasetPermission, DocumentIndexingStatus, FileIndexingEstimateResponse, IconInfo } from './datasets'
-import type { AppIconSelection } from '@/app/components/base/app-icon-picker'
+import type { ChunkingMode, DocumentIndexingStatus, FileIndexingEstimateResponse, IconInfo } from './datasets'
import type { Dependency } from '@/app/components/plugins/types'
import type { Edge, EnvironmentVariable, Node, SupportUploadFileTypes } from '@/app/components/workflow/types'
import type { TransferMethod } from '@/types/app'
@@ -53,14 +52,6 @@ export type PipelineTemplateByIdResponse = {
created_by: string
}
-export type CreateFormData = {
- name: string
- appIcon: AppIconSelection
- description: string
- permission: DatasetPermission
- selectedMemberIDs: string[]
-}
-
export type UpdateTemplateInfoRequest = {
template_id: string
name: string
diff --git a/web/models/share.ts b/web/models/share.ts
index 6bf96db3a1f..50e0b9c9c40 100644
--- a/web/models/share.ts
+++ b/web/models/share.ts
@@ -1,8 +1,6 @@
import type { Locale } from '@/i18n-config'
import type { AppIconType } from '@/types/app'
-export type ResponseHolder = {}
-
export type ConversationItem = {
id: string
name: string
diff --git a/web/plugins/dev-proxy/server.ts b/web/plugins/dev-proxy/server.ts
index 3708dd746fd..a3752784fac 100644
--- a/web/plugins/dev-proxy/server.ts
+++ b/web/plugins/dev-proxy/server.ts
@@ -8,7 +8,7 @@ type DevProxyEnv = Partial<Record<
string
>>
-export type DevProxyTargets = {
+type DevProxyTargets = {
consoleApiTarget: string
publicApiTarget: string
}
@@ -55,7 +55,7 @@ export const isAllowedDevOrigin = (origin?: string | null) => {
}
}
-export const applyCorsHeaders = (headers: Headers, origin?: string | null) => {
+const applyCorsHeaders = (headers: Headers, origin?: string | null) => {
if (!isAllowedDevOrigin(origin))
return
diff --git a/web/plugins/eslint/namespaces.js b/web/plugins/eslint/namespaces.js
index 77cae657567..68d41d5a4f9 100644
--- a/web/plugins/eslint/namespaces.js
+++ b/web/plugins/eslint/namespaces.js
@@ -2,7 +2,7 @@
// Keep in sync with the namespaces object
// @keep-sorted
-export const NAMESPACES = [
+const NAMESPACES = [
'app',
'appAnnotation',
'appApi',
@@ -37,7 +37,7 @@ export const NAMESPACES = [
// Sort by length descending to match longer prefixes first
// e.g., 'datasetDocuments' before 'dataset'
-export const NAMESPACES_BY_LENGTH = [...NAMESPACES].sort((a, b) => b.length - a.length)
+const NAMESPACES_BY_LENGTH = [...NAMESPACES].sort((a, b) => b.length - a.length)
/**
* Extract namespace from a translation key
diff --git a/web/plugins/vite/inject-target.ts b/web/plugins/vite/inject-target.ts
index 845f949174c..685da6616ac 100644
--- a/web/plugins/vite/inject-target.ts
+++ b/web/plugins/vite/inject-target.ts
@@ -1,6 +1,6 @@
import path from 'node:path'
-export const rootClientInjectTargetRelativePath = 'instrumentation-client.ts'
+const rootClientInjectTargetRelativePath = 'instrumentation-client.ts'
export const getRootClientInjectTarget = (projectRoot: string): string => {
return path.resolve(projectRoot, rootClientInjectTargetRelativePath)
diff --git a/web/plugins/vite/react-grab-open-file.ts b/web/plugins/vite/react-grab-open-file.ts
deleted file mode 100644
index 42e0ace3afd..00000000000
--- a/web/plugins/vite/react-grab-open-file.ts
+++ /dev/null
@@ -1,92 +0,0 @@
-import type { Plugin } from 'vite'
-import { injectClientSnippet, normalizeViteModuleId } from './utils'
-
-type ReactGrabOpenFilePluginOptions = {
- injectTarget: string
- projectRoot: string
-}
-
-export const reactGrabOpenFilePlugin = ({
- injectTarget,
- projectRoot,
-}: ReactGrabOpenFilePluginOptions): Plugin => {
- const reactGrabOpenFileClientMarker = 'react-grab-open-file-client'
- const reactGrabOpenFileClientSnippet = `/* ${reactGrabOpenFileClientMarker} */
-if (typeof window !== 'undefined') {
- const projectRoot = ${JSON.stringify(projectRoot)};
- const pluginName = 'dify-vite-open-file';
- const rootRelativeSourcePathPattern = /^\\/(?!@|node_modules)(?:.+)\\.(?:[cm]?[jt]sx?|mdx?)$/;
-
- const normalizeProjectRoot = (input) => {
- return input.endsWith('/') ? input.slice(0, -1) : input;
- };
-
- const resolveFilePath = (filePath) => {
- if (filePath.startsWith('/@fs/')) {
- return filePath.slice('/@fs'.length);
- }
-
- if (!rootRelativeSourcePathPattern.test(filePath)) {
- return filePath;
- }
-
- const normalizedProjectRoot = normalizeProjectRoot(projectRoot);
- if (filePath.startsWith(normalizedProjectRoot)) {
- return filePath;
- }
-
- return \`\${normalizedProjectRoot}\${filePath}\`;
- };
-
- const registerPlugin = () => {
- if (window.__DIFY_REACT_GRAB_OPEN_FILE_PLUGIN_REGISTERED__) {
- return;
- }
-
- const reactGrab = window.__REACT_GRAB__;
- if (!reactGrab) {
- return;
- }
-
- reactGrab.registerPlugin({
- name: pluginName,
- hooks: {
- onOpenFile(filePath, lineNumber) {
- const params = new URLSearchParams({
- file: resolveFilePath(filePath),
- column: '1',
- });
-
- if (lineNumber) {
- params.set('line', String(lineNumber));
- }
-
- void fetch(\`/__open-in-editor?\${params.toString()}\`);
- return true;
- },
- },
- });
-
- window.__DIFY_REACT_GRAB_OPEN_FILE_PLUGIN_REGISTERED__ = true;
- };
-
- registerPlugin();
- window.addEventListener('react-grab:init', registerPlugin);
-}
-`
-
- return {
- name: 'react-grab-open-file',
- apply: 'serve',
- transform(code, id) {
- const cleanId = normalizeViteModuleId(id)
- if (cleanId !== injectTarget)
- return null
-
- const nextCode = injectClientSnippet(code, reactGrabOpenFileClientMarker, reactGrabOpenFileClientSnippet)
- if (nextCode === code)
- return null
- return { code: nextCode, map: null }
- },
- }
-}
diff --git a/web/scripts/analyze-component.js b/web/scripts/analyze-component.js
index 2fdff2f3d0f..04bf0d8f71b 100755
--- a/web/scripts/analyze-component.js
+++ b/web/scripts/analyze-component.js
@@ -304,7 +304,7 @@ Create the test file at: ${testPath}
}
class TestReviewPromptBuilder {
- build({ analysis, testPath, testCode, originalPromptSection }) {
+ build({ analysis, testPath, originalPromptSection }) {
const formattedOriginalPrompt = originalPromptSection
? originalPromptSection
.split('\n')
diff --git a/web/service/apps.ts b/web/service/apps.ts
index db79141ec61..5698d11e9de 100644
--- a/web/service/apps.ts
+++ b/web/service/apps.ts
@@ -1,5 +1,5 @@
import type { TracingProvider } from '@/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/type'
-import type { ApiKeysListResponse, AppDailyConversationsResponse, AppDailyEndUsersResponse, AppDailyMessagesResponse, AppDetailResponse, AppListResponse, AppStatisticsResponse, AppTemplatesResponse, AppTokenCostsResponse, AppVoicesListResponse, CreateApiKeyResponse, DSLImportMode, DSLImportResponse, GenerationIntroductionResponse, TracingConfig, TracingStatus, UpdateAppModelConfigResponse, UpdateAppSiteCodeResponse, UpdateOpenAIKeyResponse, ValidateOpenAIKeyResponse, WebhookTriggerResponse, WorkflowDailyConversationsResponse } from '@/models/app'
+import type { AppDetailResponse, AppListResponse, CreateApiKeyResponse, DSLImportMode, DSLImportResponse, TracingConfig, TracingStatus, UpdateAppModelConfigResponse, UpdateAppSiteCodeResponse, WebhookTriggerResponse } from '@/models/app'
import type { CommonResponse } from '@/models/common'
import type { AppIconType, AppModeEnum, ModelConfig } from '@/types/app'
import { del, get, patch, post, put } from './base'
@@ -16,10 +16,6 @@ export const fetchAppDetailDirect = async ({ url, id }: { url: string, id: strin
return get<AppDetailResponse>(`${url}/${id}`)
}
-export const fetchAppTemplates = ({ url }: { url: string }): Promise<AppTemplatesResponse> => {
- return get<AppTemplatesResponse>(url)
-}
-
export const createApp = ({
name,
icon_type,
@@ -112,15 +108,6 @@ export const updateAppSiteStatus = ({ url, body }: { url: string, body: Record<s
return post<AppDetailResponse>(url, { body })
}
-export const updateAppApiStatus = ({ url, body }: { url: string, body: Record<string, any> }): Promise<AppDetailResponse> => {
- return post<AppDetailResponse>(url, { body })
-}
-
-// path: /apps/{appId}/rate-limit
-export const updateAppRateLimit = ({ url, body }: { url: string, body: Record<string, any> }): Promise<AppDetailResponse> => {
- return post<AppDetailResponse>(url, { body })
-}
-
export const updateAppSiteAccessToken = ({ url }: { url: string }): Promise<UpdateAppSiteCodeResponse> => {
return post<UpdateAppSiteCodeResponse>(url)
}
@@ -129,43 +116,10 @@ export const updateAppSiteConfig = ({ url, body }: { url: string, body: Record<s
return post<AppDetailResponse>(url, { body })
}
-export const getAppDailyMessages = ({ url, params }: { url: string, params: Record<string, any> }): Promise<AppDailyMessagesResponse> => {
- return get<AppDailyMessagesResponse>(url, { params })
-}
-
-export const getAppDailyConversations = ({ url, params }: { url: string, params: Record<string, any> }): Promise<AppDailyConversationsResponse> => {
- return get<AppDailyConversationsResponse>(url, { params })
-}
-
-export const getWorkflowDailyConversations = ({ url, params }: { url: string, params: Record<string, any> }): Promise<WorkflowDailyConversationsResponse> => {
- return get<WorkflowDailyConversationsResponse>(url, { params })
-}
-
-export const getAppStatistics = ({ url, params }: { url: string, params: Record<string, any> }): Promise<AppStatisticsResponse> => {
- return get<AppStatisticsResponse>(url, { params })
-}
-
-export const getAppDailyEndUsers = ({ url, params }: { url: string, params: Record<string, any> }): Promise<AppDailyEndUsersResponse> => {
- return get<AppDailyEndUsersResponse>(url, { params })
-}
-
-export const getAppTokenCosts = ({ url, params }: { url: string, params: Record<string, any> }): Promise<AppTokenCostsResponse> => {
- return get<AppTokenCostsResponse>(url, { params })
-}
-
export const updateAppModelConfig = ({ url, body }: { url: string, body: Record<string, any> }): Promise<UpdateAppModelConfigResponse> => {
return post<UpdateAppModelConfigResponse>(url, { body })
}
-// For temp testing
-export const fetchAppListNoMock = ({ url, params }: { url: string, params: Record<string, any> }): Promise<AppListResponse> => {
- return get<AppListResponse>(url, params)
-}
-
-export const fetchApiKeysList = ({ url, params }: { url: string, params: Record<string, any> }): Promise<ApiKeysListResponse> => {
- return get<ApiKeysListResponse>(url, params)
-}
-
export const delApikey = ({ url, params }: { url: string, params: Record<string, any> }): Promise<CommonResponse> => {
return del<CommonResponse>(url, params)
}
@@ -174,23 +128,6 @@ export const createApikey = ({ url, body }: { url: string, body: Record<string,
return post<CreateApiKeyResponse>(url, body)
}
-export const validateOpenAIKey = ({ url, body }: { url: string, body: { token: string } }): Promise<ValidateOpenAIKeyResponse> => {
- return post<ValidateOpenAIKeyResponse>(url, { body })
-}
-
-export const updateOpenAIKey = ({ url, body }: { url: string, body: { token: string } }): Promise<UpdateOpenAIKeyResponse> => {
- return post<UpdateOpenAIKeyResponse>(url, { body })
-}
-
-export const generationIntroduction = ({ url, body }: { url: string, body: { prompt_template: string } }): Promise<GenerationIntroductionResponse> => {
- return post<GenerationIntroductionResponse>(url, { body })
-}
-
-export const fetchAppVoices = ({ appId, language }: { appId: string, language?: string }): Promise<AppVoicesListResponse> => {
- language = language || 'en-US'
- return get<AppVoicesListResponse>(`apps/${appId}/text-to-audio/voices?language=${language}`)
-}
-
// Tracing
export const fetchTracingStatus = ({ appId }: { appId: string }): Promise<TracingStatus> => {
return get<TracingStatus>(`/apps/${appId}/trace`)
diff --git a/web/service/base.ts b/web/service/base.ts
index e44a607fb8b..ad4f8cef44a 100644
--- a/web/service/base.ts
+++ b/web/service/base.ts
@@ -1,5 +1,5 @@
import type { FetchOptionType, ResponseError } from './fetch'
-import type { AnnotationReply, MessageEnd, MessageReplace, ThoughtItem } from '@/app/components/base/chat/chat/type'
+import type { MessageEnd, MessageReplace, ThoughtItem } from '@/app/components/base/chat/chat/type'
import type { VisionFile } from '@/types/app'
import type {
DataSourceNodeCompletedResponse,
@@ -51,7 +51,6 @@ export type IOnThought = (though: ThoughtItem) => void
export type IOnFile = (file: VisionFile) => void
export type IOnMessageEnd = (messageEnd: MessageEnd) => void
export type IOnMessageReplace = (messageReplace: MessageReplace) => void
-export type IOnAnnotationReply = (messageReplace: AnnotationReply) => void
export type IOnCompleted = (hasError?: boolean, errorMessage?: string) => void
export type IOnError = (msg: string, code?: string) => void
@@ -173,14 +172,6 @@ function formatURL(url: string, isPublicAPI: boolean) {
return `${urlPrefix}${urlWithoutProtocol}`
}
-export function format(text: string) {
- let res = text.trim()
- if (res.startsWith('\n'))
- res = res.replace('\n', '')
-
- return res.replaceAll('\n', '<br/>').replaceAll('```', '')
-}
-
export const handleStream = (
response: Response,
onData: IOnData,
@@ -856,10 +847,6 @@ export const put = <T>(url: string, options = {}, otherOptions?: IOtherOptions)
return request<T>(url, Object.assign({}, options, { method: 'PUT' }), otherOptions)
}
-export const putPublic = <T>(url: string, options = {}, otherOptions?: IOtherOptions) => {
- return put<T>(url, options, { ...otherOptions, isPublicAPI: true })
-}
-
export const del = <T>(url: string, options = {}, otherOptions?: IOtherOptions) => {
return request<T>(url, Object.assign({}, options, { method: 'DELETE' }), otherOptions)
}
diff --git a/web/service/datasets.ts b/web/service/datasets.ts
index 4465886c204..3d84a894011 100644
--- a/web/service/datasets.ts
+++ b/web/service/datasets.ts
@@ -1,34 +1,25 @@
import type { CreateExternalAPIReq } from '@/app/components/datasets/external-api/declarations'
import type { CreateKnowledgeBaseReq } from '@/app/components/datasets/external-knowledge-base/create/declarations'
import type {
- ApiKeysListResponse,
CreateApiKeyResponse,
} from '@/models/app'
-import type { CommonResponse, DataSourceNotionWorkspace } from '@/models/common'
+import type { CommonResponse } from '@/models/common'
import type {
CreateDocumentReq,
createDocumentResponse,
DataSet,
DataSetListResponse,
- ErrorDocsResponse,
ExternalAPIDeleteResponse,
ExternalAPIItem,
- ExternalAPIListResponse,
ExternalAPIUsage,
- ExternalKnowledgeBaseHitTestingResponse,
ExternalKnowledgeItem,
FetchDatasetsParams,
FileIndexingEstimateResponse,
- HitTestingRecordsResponse,
- HitTestingResponse,
IndexingEstimateParams,
- IndexingEstimateResponse,
IndexingStatusBatchResponse,
IndexingStatusResponse,
ProcessRuleResponse,
- RelatedAppResponse,
} from '@/models/datasets'
-import type { RetrievalConfig } from '@/types/app'
import qs from 'qs'
import { DataSourceProvider } from '@/models/common'
import { del, get, patch, post, put } from './base'
@@ -58,10 +49,6 @@ export type SortType = 'created_at' | 'hit_count' | '-created_at' | '-hit_count'
export type MetadataType = 'all' | 'only' | 'without'
-export const fetchDatasetDetail = (datasetId: string): Promise<DataSet> => {
- return get<DataSet>(`/datasets/${datasetId}`)
-}
-
export const updateDatasetSetting = ({
datasetId,
body,
@@ -72,10 +59,6 @@ export const updateDatasetSetting = ({
return patch<DataSet>(`/datasets/${datasetId}`, { body })
}
-export const fetchDatasetRelatedApps = (datasetId: string): Promise<RelatedAppResponse> => {
- return get<RelatedAppResponse>(`/datasets/${datasetId}/related-apps`)
-}
-
export const fetchDatasets = ({ url, params }: FetchDatasetsParams): Promise<DataSetListResponse> => {
const urlParams = qs.stringify(params, { indices: false })
return get<DataSetListResponse>(`${url}?${urlParams}`)
@@ -95,10 +78,6 @@ export const deleteDataset = (datasetID: string): Promise<DataSet> => {
return del<DataSet>(`/datasets/${datasetID}`)
}
-export const fetchExternalAPIList = ({ url }: { url: string }): Promise<ExternalAPIListResponse> => {
- return get<ExternalAPIListResponse>(url)
-}
-
export const fetchExternalAPI = ({ apiTemplateId }: { apiTemplateId: string }): Promise<ExternalAPIItem> => {
return get<ExternalAPIItem>(`/datasets/external-knowledge-api/${apiTemplateId}`)
}
@@ -126,9 +105,6 @@ export const createExternalKnowledgeBase = ({ body }: { body: CreateKnowledgeBas
export const fetchDefaultProcessRule = ({ url }: { url: string }): Promise<ProcessRuleResponse> => {
return get<ProcessRuleResponse>(url)
}
-export const fetchProcessRule = ({ params: { documentId } }: { params: { documentId: string } }): Promise<ProcessRuleResponse> => {
- return get<ProcessRuleResponse>('/datasets/process-rule', { params: { document_id: documentId } })
-}
export const createFirstDocument = ({ body }: { body: CreateDocumentReq }): Promise<createDocumentResponse> => {
return post<createDocumentResponse>('/datasets/init', { body })
@@ -138,13 +114,6 @@ export const createDocument = ({ datasetId, body }: { datasetId: string, body: C
return post<createDocumentResponse>(`/datasets/${datasetId}/documents`, { body })
}
-export const fetchIndexingEstimate = ({ datasetId, documentId }: CommonDocReq): Promise<IndexingEstimateResponse> => {
- return get<IndexingEstimateResponse>(`/datasets/${datasetId}/documents/${documentId}/indexing-estimate`, {})
-}
-export const fetchIndexingEstimateBatch = ({ datasetId, batchId }: BatchReq): Promise<IndexingEstimateResponse> => {
- return get<IndexingEstimateResponse>(`/datasets/${datasetId}/batch/${batchId}/indexing-estimate`, {})
-}
-
export const fetchIndexingStatus = ({ datasetId, documentId }: CommonDocReq): Promise<IndexingStatusResponse> => {
return get<IndexingStatusResponse>(`/datasets/${datasetId}/documents/${documentId}/indexing-status`, {})
}
@@ -179,27 +148,11 @@ export const downloadDocumentsZip = ({ datasetId, documentIds }: DocumentDownloa
})
}
-export const preImportNotionPages = ({ url, datasetId }: { url: string, datasetId?: string }): Promise<{ notion_info: DataSourceNotionWorkspace[] }> => {
- return get<{ notion_info: DataSourceNotionWorkspace[] }>(url, { params: { dataset_id: datasetId } })
-}
-
export const modifyDocMetadata = ({ datasetId, documentId, body }: CommonDocReq & { body: { doc_type: string, doc_metadata: Record<string, any> } }): Promise<CommonResponse> => {
return put<CommonResponse>(`/datasets/${datasetId}/documents/${documentId}/metadata`, { body })
}
// hit testing
-export const hitTesting = ({ datasetId, queryText, retrieval_model }: { datasetId: string, queryText: string, retrieval_model: RetrievalConfig }): Promise<HitTestingResponse> => {
- return post<HitTestingResponse>(`/datasets/${datasetId}/hit-testing`, { body: { query: queryText, retrieval_model } })
-}
-
-export const externalKnowledgeBaseHitTesting = ({ datasetId, query, external_retrieval_model }: { datasetId: string, query: string, external_retrieval_model: { top_k: number, score_threshold: number, score_threshold_enabled: boolean } }): Promise<ExternalKnowledgeBaseHitTestingResponse> => {
- return post<ExternalKnowledgeBaseHitTestingResponse>(`/datasets/${datasetId}/external-hit-testing`, { body: { query, external_retrieval_model } })
-}
-
-export const fetchTestingRecords = ({ datasetId, params }: { datasetId: string, params: { page: number, limit: number } }): Promise<HitTestingRecordsResponse> => {
- return get<HitTestingRecordsResponse>(`/datasets/${datasetId}/queries`, { params })
-}
-
export const fetchFileIndexingEstimate = (body: IndexingEstimateParams): Promise<FileIndexingEstimateResponse> => {
return post<FileIndexingEstimateResponse>('/datasets/indexing-estimate', { body })
}
@@ -212,10 +165,6 @@ export const fetchNotionPagePreview = ({ pageID, pageType, credentialID }: { pag
})
}
-export const fetchApiKeysList = ({ url, params }: { url: string, params: Record<string, any> }): Promise<ApiKeysListResponse> => {
- return get<ApiKeysListResponse>(url, params)
-}
-
export const delApikey = ({ url, params }: { url: string, params: Record<string, any> }): Promise<CommonResponse> => {
return del<CommonResponse>(url, params)
}
@@ -224,18 +173,6 @@ export const createApikey = ({ url, body }: { url: string, body: Record<string,
return post<CreateApiKeyResponse>(url, body)
}
-export const fetchDataSources = (): Promise<CommonResponse> => {
- return get<CommonResponse>('api-key-auth/data-source')
-}
-
-export const createDataSourceApiKeyBinding = (body: Record<string, any>): Promise<CommonResponse> => {
- return post<CommonResponse>('api-key-auth/data-source/binding', { body })
-}
-
-export const removeDataSourceApiKeyBinding = (id: string): Promise<CommonResponse> => {
- return del<CommonResponse>(`api-key-auth/data-source/${id}`)
-}
-
export const createFirecrawlTask = (body: Record<string, any>): Promise<CommonResponse> => {
return post<CommonResponse>('website/crawl', {
body: {
@@ -297,14 +234,6 @@ export type FileTypesRes = {
allowed_extensions: string[]
}
-export const fetchSupportFileTypes = ({ url }: { url: string }): Promise<FileTypesRes> => {
- return get<FileTypesRes>(url)
-}
-
-export const getErrorDocs = ({ datasetId }: { datasetId: string }): Promise<ErrorDocsResponse> => {
- return get<ErrorDocsResponse>(`/datasets/${datasetId}/error-docs`)
-}
-
export const retryErrorDocs = ({ datasetId, document_ids }: { datasetId: string, document_ids: string[] }): Promise<CommonResponse> => {
return post<CommonResponse>(`/datasets/${datasetId}/retry`, { body: { document_ids } })
}
diff --git a/web/service/debug.ts b/web/service/debug.ts
index 9f11643e7f9..257a1cf1592 100644
--- a/web/service/debug.ts
+++ b/web/service/debug.ts
@@ -1,10 +1,9 @@
import type { IOnCompleted, IOnData, IOnError, IOnMessageReplace } from './base'
-import type { ModelParameterRule } from '@/app/components/header/account-setting/model-provider-page/declarations'
import type { ChatPromptConfig, CompletionPromptConfig } from '@/models/debug'
import type { AppModeEnum, ModelModeType } from '@/types/app'
import { get, post, ssePost } from './base'
-export type BasicAppFirstRes = {
+type BasicAppFirstRes = {
prompt: string
variables: string[]
opening_statement: string
@@ -19,12 +18,6 @@ export type GenRes = {
error?: string
}
-export type CodeGenRes = {
- code: string
- language: string[]
- error?: string
-}
-
export const stopChatMessageResponding = async (appId: string, taskId: string) => {
return post(`apps/${appId}/chat-messages/${taskId}/stop`)
}
@@ -75,14 +68,6 @@ export const generateRule = (body: Record<string, any>) => {
})
}
-export const fetchModelParams = (providerName: string, modelId: string) => {
- return get(`workspaces/current/model-providers/${providerName}/models/parameter-rules`, {
- params: {
- model: modelId,
- },
- }) as Promise<{ data: ModelParameterRule[] }>
-}
-
export const fetchPromptTemplate = ({
appMode,
mode,
diff --git a/web/service/knowledge/use-dataset.ts b/web/service/knowledge/use-dataset.ts
index 87fc1f2aec4..1be3df18dd4 100644
--- a/web/service/knowledge/use-dataset.ts
+++ b/web/service/knowledge/use-dataset.ts
@@ -188,15 +188,6 @@ export const useExternalKnowledgeApiList = (options?: { enabled?: boolean }) =>
})
}
-export const useInvalidateExternalKnowledgeApiList = () => {
- const queryClient = useQueryClient()
- return () => {
- queryClient.invalidateQueries({
- queryKey: [NAME_SPACE, 'external-knowledge-api'],
- })
- }
-}
-
export const useDatasetTestingRecords = (
datasetId?: string,
params?: { page: number, limit: number },
diff --git a/web/service/knowledge/use-document.ts b/web/service/knowledge/use-document.ts
index 6e48d7b6f41..811ed1aa49f 100644
--- a/web/service/knowledge/use-document.ts
+++ b/web/service/knowledge/use-document.ts
@@ -72,7 +72,7 @@ const toBatchDocumentsIdParams = (documentIds: string[] | string) => {
return ids.map(id => `document_id=${id}`).join('&')
}
-export const useDocumentBatchAction = (action: DocumentActionType) => {
+const useDocumentBatchAction = (action: DocumentActionType) => {
return useMutation({
mutationFn: ({ datasetId, documentIds, documentId }: UpdateDocumentBatchParams) => {
return patch<CommonResponse>(`/datasets/${datasetId}/documents/status/${action}/batch?${toBatchDocumentsIdParams(documentId || documentIds!)}`)
diff --git a/web/service/knowledge/use-hit-testing.ts b/web/service/knowledge/use-hit-testing.ts
index 75c111483ed..97442e50e53 100644
--- a/web/service/knowledge/use-hit-testing.ts
+++ b/web/service/knowledge/use-hit-testing.ts
@@ -1,31 +1,14 @@
import type {
ExternalKnowledgeBaseHitTestingRequest,
ExternalKnowledgeBaseHitTestingResponse,
- HitTestingRecordsRequest,
- HitTestingRecordsResponse,
HitTestingRequest,
HitTestingResponse,
} from '@/models/datasets'
-import { useMutation, useQuery } from '@tanstack/react-query'
-import { get, post } from '../base'
-import { useInvalid } from '../use-base'
+import { useMutation } from '@tanstack/react-query'
+import { post } from '../base'
const NAME_SPACE = 'hit-testing'
-const HitTestingRecordsKey = [NAME_SPACE, 'records']
-
-export const useHitTestingRecords = (params: HitTestingRecordsRequest) => {
- const { datasetId, page, limit } = params
- return useQuery({
- queryKey: [...HitTestingRecordsKey, datasetId, page, limit],
- queryFn: () => get<HitTestingRecordsResponse>(`/datasets/${datasetId}/queries`, { params: { page, limit } }),
- })
-}
-
-export const useInvalidateHitTestingRecords = (datasetId: string) => {
- return useInvalid([...HitTestingRecordsKey, datasetId])
-}
-
export const useHitTesting = (datasetId: string) => {
return useMutation({
mutationKey: [NAME_SPACE, 'hit-testing', datasetId],
diff --git a/web/service/knowledge/use-metadata.ts b/web/service/knowledge/use-metadata.ts
index 50b2c47ae3d..5f802c2e531 100644
--- a/web/service/knowledge/use-metadata.ts
+++ b/web/service/knowledge/use-metadata.ts
@@ -16,7 +16,7 @@ export const useDatasetMetaData = (datasetId: string) => {
})
}
-export const useInvalidDatasetMetaData = (datasetId: string) => {
+const useInvalidDatasetMetaData = (datasetId: string) => {
return useInvalid([NAME_SPACE, 'dataset', datasetId])
}
@@ -32,7 +32,7 @@ export const useCreateMetaData = (datasetId: string) => {
},
})
}
-export const useInvalidAllDocumentMetaData = (datasetId: string) => {
+const useInvalidAllDocumentMetaData = (datasetId: string) => {
const queryClient = useQueryClient()
return () => {
queryClient.invalidateQueries({
diff --git a/web/service/plugins.ts b/web/service/plugins.ts
index cf05d8c20d8..9062d3b5ecf 100644
--- a/web/service/plugins.ts
+++ b/web/service/plugins.ts
@@ -1,15 +1,8 @@
-import type {
- MarketplaceCollectionPluginsResponse,
- MarketplaceCollectionsResponse,
-} from '@/app/components/plugins/marketplace/types'
import type {
Dependency,
InstallPackageResponse,
- Permissions,
- PluginDeclaration,
PluginInfoFromMarketPlace,
PluginManifestInMarket,
- PluginTasksResponse,
TaskStatusResponse,
UninstallPluginResponse,
updatePackageResponse,
@@ -54,14 +47,6 @@ export const uploadGitHub = async (repoUrl: string, selectedVersion: string, sel
})
}
-export const fetchIcon = (tenantId: string, fileName: string) => {
- return get(`workspaces/current/plugin/icon?tenant_id=${tenantId}&filename=${fileName}`)
-}
-
-export const fetchManifest = async (uniqueIdentifier: string) => {
- return get<PluginDeclaration>(`/workspaces/current/plugin/fetch-manifest?plugin_unique_identifier=${uniqueIdentifier}`)
-}
-
export const fetchManifestFromMarketPlace = async (uniqueIdentifier: string) => {
return getMarketplace<{ data: { plugin: PluginManifestInMarket, version: { version: string } } }>(`/plugins/identifier?unique_identifier=${uniqueIdentifier}`)
}
@@ -81,26 +66,10 @@ export const fetchPluginInfoFromMarketPlace = async ({
return getMarketplace<{ data: { plugin: PluginInfoFromMarketPlace, version: { version: string } } }>(`/plugins/${org}/${name}`)
}
-export const fetchMarketplaceCollections = ({ url }: { url: string }): Promise<MarketplaceCollectionsResponse> => {
- return get<MarketplaceCollectionsResponse>(url)
-}
-
-export const fetchMarketplaceCollectionPlugins = ({ url }: { url: string }): Promise<MarketplaceCollectionPluginsResponse> => {
- return get<MarketplaceCollectionPluginsResponse>(url)
-}
-
-export const fetchPluginTasks = async () => {
- return get<PluginTasksResponse>('/workspaces/current/plugin/tasks?page=1&page_size=255')
-}
-
export const checkTaskStatus = async (taskId: string) => {
return get<TaskStatusResponse>(`/workspaces/current/plugin/tasks/${taskId}`)
}
-export const updatePermission = async (permissions: Permissions) => {
- return post('/workspaces/current/plugin/permission/change', { body: permissions })
-}
-
export const uninstallPlugin = async (pluginId: string) => {
return post<UninstallPluginResponse>('/workspaces/current/plugin/uninstall', { body: { plugin_installation_id: pluginId } })
}
diff --git a/web/service/share.ts b/web/service/share.ts
index 4726ded7d16..de0adb2be26 100644
--- a/web/service/share.ts
+++ b/web/service/share.ts
@@ -246,10 +246,6 @@ export const textToAudioStream = (url: string, appSourceType: AppSourceType, hea
return (getAction('post', appSourceType))(url, { body, header }, { needAllResponseContent: true })
}
-export const textToAudio = (url: string, appSourceType: AppSourceType, body: FormData) => {
- return (getAction('post', appSourceType))(url, { body }, { bodyStringify: false, deleteContentType: true }) as Promise<{ data: string }>
-}
-
export const fetchAccessToken = async ({ userId, appCode }: { userId?: string, appCode: string }) => {
const headers = new Headers()
headers.append(WEB_APP_SHARE_CODE_HEADER_NAME, appCode)
diff --git a/web/service/tools.ts b/web/service/tools.ts
index 7ffe8ef65ad..ae9655d5205 100644
--- a/web/service/tools.ts
+++ b/web/service/tools.ts
@@ -15,10 +15,6 @@ export const fetchCollectionList = () => {
return get<Collection[]>('/workspaces/current/tool-providers')
}
-export const fetchCollectionDetail = (collectionName: string) => {
- return get<Collection>(`/workspaces/current/tool-provider/${collectionName}/info`)
-}
-
export const fetchBuiltInToolList = (collectionName: string) => {
return get<Tool[]>(`/workspaces/current/tool-provider/builtin/${collectionName}/tools`)
}
@@ -133,10 +129,6 @@ export const saveWorkflowToolProvider = (payload: WorkflowToolProviderRequest &
})
}
-export const fetchWorkflowToolDetailByAppID = (appID: string) => {
- return get<WorkflowToolProviderResponse>(`/workspaces/current/tool-provider/workflow/get?workflow_app_id=${appID}`)
-}
-
export const fetchWorkflowToolDetail = (toolID: string) => {
return get<WorkflowToolProviderResponse>(`/workspaces/current/tool-provider/workflow/get?workflow_tool_id=${toolID}`)
}
diff --git a/web/service/use-apps.ts b/web/service/use-apps.ts
index f9f63205e41..f28df7bd4b6 100644
--- a/web/service/use-apps.ts
+++ b/web/service/use-apps.ts
@@ -21,7 +21,6 @@ import {
import { consoleClient, consoleQuery } from '@/service/client'
import { AppModeEnum } from '@/types/app'
import { get, post } from './base'
-import { useInvalid } from './use-base'
const NAME_SPACE = 'apps'
@@ -105,17 +104,6 @@ export const useAppList = (params: AppListParams, options?: { enabled?: boolean
})
}
-export const useAppFullList = () => {
- return useQuery<AppListResponse>({
- queryKey: useAppFullListKey,
- queryFn: () => get<AppListResponse>('/apps', { params: { page: 1, limit: 100, name: '' } }),
- })
-}
-
-export const useInvalidateAppFullList = () => {
- return useInvalid(useAppFullListKey)
-}
-
export const useInfiniteAppList = (params: AppListParams, options?: { enabled?: boolean }) => {
const normalizedParams = normalizeAppListParams(params)
return useInfiniteQuery<AppListResponse>({
diff --git a/web/service/use-common.ts b/web/service/use-common.ts
index fbd83845ba8..238f4f6ecfc 100644
--- a/web/service/use-common.ts
+++ b/web/service/use-common.ts
@@ -10,7 +10,6 @@ import type {
ApiBasedExtension,
CodeBasedExtension,
CommonResponse,
- DataSourceNotion,
FileUploadConfigResponse,
ICurrentWorkspace,
IWorkspace,
@@ -25,7 +24,6 @@ import type { RETRIEVE_METHOD } from '@/types/app'
import { useMutation, useQuery } from '@tanstack/react-query'
import { IS_DEV } from '@/config'
import { get, post } from './base'
-import { useInvalid } from './use-base'
const NAME_SPACE = 'common'
@@ -277,14 +275,6 @@ export const useModelListByType = (type: ModelTypeEnum, enabled = true) => {
})
}
-export const useDefaultModelByType = (type: ModelTypeEnum, enabled = true) => {
- return useQuery({
- queryKey: commonQueryKeys.defaultModel(type),
- queryFn: () => get(`/workspaces/current/default-model?model_type=${type}`),
- enabled,
- })
-}
-
export const useSupportRetrievalMethods = () => {
return useQuery<{ retrieval_method: RETRIEVE_METHOD[] }>({
queryKey: commonQueryKeys.retrievalMethods,
@@ -299,25 +289,6 @@ export const useAccountIntegrates = () => {
})
}
-type DataSourceIntegratesOptions = {
- enabled?: boolean
- initialData?: { data: DataSourceNotion[] }
-}
-
-export const useDataSourceIntegrates = (options: DataSourceIntegratesOptions = {}) => {
- const { enabled = true, initialData } = options
- return useQuery<{ data: DataSourceNotion[] }>({
- queryKey: commonQueryKeys.dataSourceIntegrates,
- queryFn: () => get<{ data: DataSourceNotion[] }>('/data-source/integrates'),
- enabled,
- initialData,
- })
-}
-
-export const useInvalidDataSourceIntegrates = () => {
- return useInvalid(commonQueryKeys.dataSourceIntegrates)
-}
-
export const usePluginProviders = () => {
return useQuery<PluginProvider[] | null>({
queryKey: commonQueryKeys.pluginProviders,
@@ -332,14 +303,6 @@ export const useCodeBasedExtensions = (module: string) => {
})
}
-export const useNotionConnection = (enabled: boolean) => {
- return useQuery<{ data: string }>({
- queryKey: commonQueryKeys.notionConnection,
- queryFn: () => get<{ data: string }>('/oauth/data-source/notion'),
- enabled,
- })
-}
-
export const useApiBasedExtensions = () => {
return useQuery<ApiBasedExtension[]>({
queryKey: commonQueryKeys.apiBasedExtensions,
diff --git a/web/service/use-oauth.ts b/web/service/use-oauth.ts
index b55704e1649..68e157c15ca 100644
--- a/web/service/use-oauth.ts
+++ b/web/service/use-oauth.ts
@@ -3,13 +3,13 @@ import { post } from './base'
const NAME_SPACE = 'oauth-provider'
-export type OAuthAppInfo = {
+type OAuthAppInfo = {
app_icon: string
app_label: Record<string, string>
scope: string
}
-export type OAuthAuthorizeResponse = {
+type OAuthAuthorizeResponse = {
code: string
}
diff --git a/web/service/use-pipeline.ts b/web/service/use-pipeline.ts
index 34c7332f4c8..6efb5bb8c65 100644
--- a/web/service/use-pipeline.ts
+++ b/web/service/use-pipeline.ts
@@ -1,5 +1,4 @@
import type { MutationOptions } from '@tanstack/react-query'
-import type { ToolCredential } from '@/app/components/tools/types'
import type { DataSourceItem } from '@/app/components/workflow/block-selector/types'
import type { IconInfo } from '@/models/datasets'
import type {
@@ -31,14 +30,14 @@ import type {
UpdateTemplateInfoRequest,
UpdateTemplateInfoResponse,
} from '@/models/pipeline'
-import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQuery } from '@tanstack/react-query'
import { DatasourceType } from '@/models/pipeline'
import { del, get, patch, post } from './base'
import { useInvalid } from './use-base'
const NAME_SPACE = 'pipeline'
-export const PipelineTemplateListQueryKeyPrefix = [NAME_SPACE, 'template-list']
+const PipelineTemplateListQueryKeyPrefix = [NAME_SPACE, 'template-list']
export const usePipelineTemplateList = (params: PipelineTemplateListParams, enabled = true) => {
return useQuery<PipelineTemplateListResponse>({
queryKey: [...PipelineTemplateListQueryKeyPrefix, params],
@@ -224,46 +223,6 @@ export const useRunPublishedPipeline = (
})
}
-export const useDataSourceCredentials = (provider: string, pluginId: string, onSuccess: (value: ToolCredential[]) => void) => {
- return useQuery({
- queryKey: [NAME_SPACE, 'datasource-credentials', provider, pluginId],
- queryFn: async () => {
- const result = await get<{ result: ToolCredential[] }>(`/auth/plugin/datasource?provider=${provider}&plugin_id=${pluginId}`)
- onSuccess(result.result)
- return result.result
- },
- enabled: !!provider && !!pluginId,
- retry: 2,
- })
-}
-
-export const useUpdateDataSourceCredentials = (
-) => {
- const queryClient = useQueryClient()
- return useMutation({
- mutationKey: [NAME_SPACE, 'update-datasource-credentials'],
- mutationFn: ({
- provider,
- pluginId,
- credentials,
- name,
- }: { provider: string, pluginId: string, credentials: Record<string, any>, name: string }) => {
- return post('/auth/plugin/datasource', {
- body: {
- provider,
- plugin_id: pluginId,
- credentials,
- name,
- },
- }).then(() => {
- queryClient.invalidateQueries({
- queryKey: [NAME_SPACE, 'datasource'],
- })
- })
- },
- })
-}
-
export const useDraftPipelinePreProcessingParams = (params: PipelinePreProcessingParamsRequest, enabled = true) => {
const { pipeline_id, node_id } = params
return useQuery<PipelinePreProcessingParamsResponse>({
diff --git a/web/service/use-plugins-auth.ts b/web/service/use-plugins-auth.ts
index 3427fc7a6a3..9952f39f041 100644
--- a/web/service/use-plugins-auth.ts
+++ b/web/service/use-plugins-auth.ts
@@ -44,15 +44,6 @@ export const useSetPluginDefaultCredential = (
})
}
-export const useGetPluginCredentialList = (
- url: string,
-) => {
- return useQuery({
- queryKey: [NAME_SPACE, 'credential-list', url],
- queryFn: () => get(url),
- })
-}
-
export const useAddPluginCredential = (
url: string,
) => {
diff --git a/web/service/use-plugins.ts b/web/service/use-plugins.ts
index 17e8eb59031..a4296628f2c 100644
--- a/web/service/use-plugins.ts
+++ b/web/service/use-plugins.ts
@@ -4,7 +4,6 @@ import type {
ModelProvider,
} from '@/app/components/header/account-setting/model-provider-page/declarations'
import type {
- PluginsSearchParams,
} from '@/app/components/plugins/marketplace/types'
import type {
DebugInfo as DebugInfoTypes,
@@ -70,7 +69,7 @@ export const useInvalidateCheckInstalled = () => {
}
const useRecommendedMarketplacePluginsKey = [NAME_SPACE, 'recommendedMarketplacePlugins']
-export const useRecommendedMarketplacePlugins = ({
+const useRecommendedMarketplacePlugins = ({
collection = '__recommended-plugins-tools',
enabled = true,
limit = 15,
@@ -231,12 +230,6 @@ export const useVersionListOfPlugin = (pluginID: string) => {
queryFn: () => getMarketplace<{ data: VersionListResponse }>(`/plugins/${pluginID}/versions`, { params: { page: 1, page_size: 100 } }),
})
}
-export const useInvalidateVersionListOfPlugin = () => {
- const queryClient = useQueryClient()
- return (pluginID: string) => {
- queryClient.invalidateQueries({ queryKey: [NAME_SPACE, 'versions', pluginID] })
- }
-}
export const useInstallPackageFromLocal = () => {
return useMutation({
@@ -473,38 +466,6 @@ export const useRemoveAutoUpgrade = () => {
})
}
-export const useMutationPluginsFromMarketplace = () => {
- return useMutation({
- mutationFn: (pluginsSearchParams: PluginsSearchParams) => {
- const {
- query,
- sort_by,
- sort_order,
- category,
- tags,
- exclude,
- type,
- page = 1,
- page_size = 40,
- } = pluginsSearchParams
- const pluginOrBundle = type === 'bundle' ? 'bundles' : 'plugins'
- return postMarketplace<{ data: PluginsFromMarketplaceResponse }>(`/${pluginOrBundle}/search/advanced`, {
- body: {
- page,
- page_size,
- query,
- sort_by,
- sort_order,
- category: category !== 'all' ? category : '',
- tags,
- exclude,
- type,
- },
- })
- },
- })
-}
-
export const useFetchPluginsInMarketPlaceByIds = (unique_identifiers: string[], options?: QueryOptions<{ data: PluginsFromMarketplaceResponse }>) => {
return useQuery({
...options,
@@ -519,39 +480,6 @@ export const useFetchPluginsInMarketPlaceByIds = (unique_identifiers: string[],
})
}
-export const useFetchPluginListOrBundleList = (pluginsSearchParams: PluginsSearchParams) => {
- return useQuery({
- queryKey: [NAME_SPACE, 'fetchPluginListOrBundleList', pluginsSearchParams],
- queryFn: () => {
- const {
- query,
- sort_by,
- sort_order,
- category,
- tags,
- exclude,
- type,
- page = 1,
- page_size = 40,
- } = pluginsSearchParams
- const pluginOrBundle = type === 'bundle' ? 'bundles' : 'plugins'
- return postMarketplace<{ data: PluginsFromMarketplaceResponse }>(`/${pluginOrBundle}/search/advanced`, {
- body: {
- page,
- page_size,
- query,
- sort_by,
- sort_order,
- category: category !== 'all' ? category : '',
- tags,
- exclude,
- type,
- },
- })
- },
- })
-}
-
export const useFetchPluginsInMarketPlaceByInfo = (infos: Record<string, any>[]) => {
return useQuery({
queryKey: [NAME_SPACE, 'fetchPluginsInMarketPlaceByInfo', infos],
@@ -632,14 +560,6 @@ export const useMutationClearTaskPlugin = () => {
})
}
-export const useMutationClearAllTaskPlugin = () => {
- return useMutation({
- mutationFn: () => {
- return post<{ success: boolean }>('/workspaces/current/plugin/tasks/delete_all')
- },
- })
-}
-
export const usePluginManifestInfo = (pluginUID: string) => {
return useQuery({
enabled: !!pluginUID,
diff --git a/web/service/use-share.ts b/web/service/use-share.ts
index 68e9229c1b9..e164276699c 100644
--- a/web/service/use-share.ts
+++ b/web/service/use-share.ts
@@ -194,7 +194,7 @@ export const useGetHumanInputForm = (token: string, options: ShareQueryOptions =
})
}
-export type SubmitHumanInputFormParams = {
+type SubmitHumanInputFormParams = {
token: string
data: {
inputs: Record<string, string>
diff --git a/web/service/use-strategy.ts b/web/service/use-strategy.ts
index b66a1e8b467..ece4084a64a 100644
--- a/web/service/use-strategy.ts
+++ b/web/service/use-strategy.ts
@@ -30,7 +30,3 @@ export const useStrategyProviderDetail = (agentProvider: string, options?: Query
enabled: !!agentProvider,
})
}
-
-export const useInvalidateStrategyProviderDetail = (agentProvider: string) => {
- return useInvalid([NAME_SPACE, 'detail', agentProvider])
-}
diff --git a/web/service/use-tools.ts b/web/service/use-tools.ts
index 2feedacf691..9ce3290ae6d 100644
--- a/web/service/use-tools.ts
+++ b/web/service/use-tools.ts
@@ -173,19 +173,6 @@ export const useAuthorizeMCP = () => {
})
}
-export const useUpdateMCPAuthorizationToken = () => {
- return useMutation({
- mutationKey: [NAME_SPACE, 'refresh-mcp-server-code'],
- mutationFn: (payload: { provider_id: string, authorization_code: string }) => {
- return get<MCPServerDetail>('/workspaces/current/tool-provider/mcp/token', {
- params: {
- ...payload,
- },
- })
- },
- })
-}
-
export const useMCPTools = (providerID: string) => {
return useQuery({
enabled: !!providerID,
@@ -275,24 +262,6 @@ export const useRefreshMCPServerCode = () => {
})
}
-export const useBuiltinProviderInfo = (providerName: string) => {
- return useQuery({
- queryKey: [NAME_SPACE, 'builtin-provider-info', providerName],
- queryFn: () => get<Collection>(`/workspaces/current/tool-provider/builtin/${providerName}/info`),
- })
-}
-
-export const useInvalidateBuiltinProviderInfo = () => {
- const queryClient = useQueryClient()
- return (providerName: string) => {
- queryClient.invalidateQueries(
- {
- queryKey: [NAME_SPACE, 'builtin-provider-info', providerName],
- },
- )
- }
-}
-
export const useBuiltinTools = (providerName: string) => {
return useQuery({
enabled: !!providerName,
@@ -301,41 +270,6 @@ export const useBuiltinTools = (providerName: string) => {
})
}
-export const useUpdateProviderCredentials = ({
- onSuccess,
-}: {
- onSuccess?: () => void
-}) => {
- return useMutation({
- mutationKey: [NAME_SPACE, 'update-provider-credentials'],
- mutationFn: (payload: { providerName: string, credentials: Record<string, any> }) => {
- const { providerName, credentials } = payload
- return post(`/workspaces/current/tool-provider/builtin/${providerName}/update`, {
- body: {
- credentials,
- },
- })
- },
- onSuccess,
- })
-}
-
-export const useRemoveProviderCredentials = ({
- onSuccess,
-}: {
- onSuccess?: () => void
-}) => {
- return useMutation({
- mutationKey: [NAME_SPACE, 'remove-provider-credentials'],
- mutationFn: (providerName: string) => {
- return post(`/workspaces/current/tool-provider/builtin/${providerName}/delete`, {
- body: {},
- })
- },
- onSuccess,
- })
-}
-
const useRAGRecommendedPluginListKey = [NAME_SPACE, 'rag-recommended-plugins']
export const useRAGRecommendedPlugins = (type: 'tool' | 'datasource' | 'all' = 'all') => {
diff --git a/web/service/use-triggers.ts b/web/service/use-triggers.ts
index df5700d0e78..1b4b161d855 100644
--- a/web/service/use-triggers.ts
+++ b/web/service/use-triggers.ts
@@ -8,7 +8,7 @@ import type {
TriggerSubscriptionBuilder,
TriggerWithProvider,
} from '@/app/components/workflow/block-selector/types'
-import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQuery } from '@tanstack/react-query'
import { CollectionType } from '@/app/components/tools/types'
import { consoleClient, consoleQuery } from '@/service/client'
import { get, post } from './base'
@@ -75,17 +75,6 @@ export const useAllTriggerPlugins = (enabled = true) => {
})
}
-export const useTriggerPluginsByType = (triggerType: string, enabled = true) => {
- return useQuery<TriggerWithProvider[]>({
- queryKey: consoleQuery.triggers.list.queryKey({ input: { query: { type: triggerType } } }),
- queryFn: async () => {
- const response = await consoleClient.triggers.list({ query: { type: triggerType } })
- return response.map(convertToTriggerWithProvider)
- },
- enabled: enabled && !!triggerType,
- })
-}
-
export const useInvalidateAllTriggerPlugins = () => {
return useInvalid(consoleQuery.triggers.list.queryKey({ input: {} }))
}
@@ -108,15 +97,6 @@ export const useTriggerSubscriptions = (provider: string, enabled = true) => {
})
}
-export const useInvalidateTriggerSubscriptions = () => {
- const queryClient = useQueryClient()
- return (provider: string) => {
- queryClient.invalidateQueries({
- queryKey: consoleQuery.triggers.subscriptions.queryKey({ input: { params: { provider } } }),
- })
- }
-}
-
export const useCreateTriggerSubscriptionBuilder = () => {
return useMutation({
mutationKey: consoleQuery.triggers.subscriptionBuilderCreate.mutationKey(),
@@ -220,7 +200,7 @@ export const useDeleteTriggerSubscription = () => {
})
}
-export type UpdateTriggerSubscriptionPayload = {
+type UpdateTriggerSubscriptionPayload = {
subscriptionId: string
name?: string
properties?: Record<string, unknown>
@@ -362,12 +342,3 @@ export const useTriggerPluginDynamicOptions = (payload: {
}
// ===== Cache Invalidation Helpers =====
-
-export const useInvalidateTriggerOAuthConfig = () => {
- const queryClient = useQueryClient()
- return (provider: string) => {
- queryClient.invalidateQueries({
- queryKey: consoleQuery.triggers.oauthConfig.queryKey({ input: { params: { provider } } }),
- })
- }
-}
diff --git a/web/service/use-workflow.ts b/web/service/use-workflow.ts
index 949658d8edf..103e3b77b01 100644
--- a/web/service/use-workflow.ts
+++ b/web/service/use-workflow.ts
@@ -188,7 +188,6 @@ export const useResetToLastRunValue = (flowType: FlowType, flowId: string) => {
})
}
-export const useSysVarValuesKey = [NAME_SPACE, 'sys-variable']
export const useSysVarValues = (flowType?: FlowType, flowId?: string) => {
return useQuery({
enabled: !!flowId,
diff --git a/web/service/webapp-auth.ts b/web/service/webapp-auth.ts
index 7a9abd95992..8f144571db7 100644
--- a/web/service/webapp-auth.ts
+++ b/web/service/webapp-auth.ts
@@ -17,11 +17,11 @@ export function getWebAppPassport(shareCode: string) {
return localStorage.getItem(PASSPORT_LOCAL_STORAGE_NAME(shareCode)) || ''
}
-export function clearWebAppAccessToken() {
+function clearWebAppAccessToken() {
localStorage.removeItem(ACCESS_TOKEN_LOCAL_STORAGE_NAME)
}
-export function clearWebAppPassport(shareCode: string) {
+function clearWebAppPassport(shareCode: string) {
localStorage.removeItem(PASSPORT_LOCAL_STORAGE_NAME(shareCode))
}
diff --git a/web/service/workflow-payload.ts b/web/service/workflow-payload.ts
deleted file mode 100644
index 5e2cdebdb33..00000000000
--- a/web/service/workflow-payload.ts
+++ /dev/null
@@ -1,193 +0,0 @@
-import type { PluginTriggerNodeType } from '@/app/components/workflow/nodes/trigger-plugin/types'
-import type { Edge, Node } from '@/app/components/workflow/types'
-import type { FetchWorkflowDraftResponse } from '@/types/workflow'
-import { produce } from 'immer'
-import { BlockEnum } from '@/app/components/workflow/types'
-
-export type TriggerPluginNodePayload = {
- title: string
- desc: string
- plugin_id: string
- provider_id: string
- event_name: string
- subscription_id: string
- plugin_unique_identifier: string
- event_parameters: Record<string, unknown>
-}
-
-export type WorkflowDraftSyncParams = Pick<
- FetchWorkflowDraftResponse,
- 'graph' | 'features' | 'environment_variables' | 'conversation_variables'
->
-
-const removeTempProperties = (data: Record<string, unknown>): void => {
- Object.keys(data).forEach((key) => {
- if (key.startsWith('_'))
- delete data[key]
- })
-}
-
-type TriggerParameterSchema = Record<string, unknown>
-
-type TriggerPluginHydratePayload = (PluginTriggerNodeType & {
- paramSchemas?: TriggerParameterSchema[]
- parameters_schema?: TriggerParameterSchema[]
-})
-
-const sanitizeTriggerPluginNode = (node: Node<TriggerPluginNodePayload>): Node<TriggerPluginNodePayload> => {
- const data = node.data
-
- if (!data || data.type !== BlockEnum.TriggerPlugin)
- return node
-
- const sanitizedData: TriggerPluginNodePayload & { type: BlockEnum.TriggerPlugin } = {
- type: BlockEnum.TriggerPlugin,
- title: data.title ?? '',
- desc: data.desc ?? '',
- plugin_id: data.plugin_id ?? '',
- provider_id: data.provider_id ?? '',
- event_name: data.event_name ?? '',
- subscription_id: data.subscription_id ?? '',
- plugin_unique_identifier: data.plugin_unique_identifier ?? '',
- event_parameters: (typeof data.event_parameters === 'object' && data.event_parameters !== null)
- ? data.event_parameters as Record<string, unknown>
- : {},
- }
-
- return {
- ...node,
- data: sanitizedData,
- }
-}
-
-export const sanitizeWorkflowDraftPayload = (params: WorkflowDraftSyncParams): WorkflowDraftSyncParams => {
- const { graph } = params
-
- if (!graph?.nodes?.length)
- return params
-
- const sanitizedNodes = graph.nodes.map((node) => {
- // First sanitize known node types (TriggerPlugin)
- const n = sanitizeTriggerPluginNode(node as Node<TriggerPluginNodePayload>) as Node<any>
-
- // Normalize Start node variable json_schema: ensure dict, not string
- if ((n.data as any)?.type === BlockEnum.Start && Array.isArray((n.data as any).variables)) {
- const next = { ...n, data: { ...n.data } }
- next.data.variables = (n.data as any).variables.map((v: any) => {
- if (v && v.type === 'json_object' && typeof v.json_schema === 'string') {
- try {
- const obj = JSON.parse(v.json_schema)
- return { ...v, json_schema: obj }
- }
- catch {
- return v
- }
- }
- return v
- })
- return next
- }
-
- return n
- })
-
- return {
- ...params,
- graph: {
- ...graph,
- nodes: sanitizedNodes,
- },
- }
-}
-
-const isTriggerPluginNode = (node: Node): node is Node<TriggerPluginHydratePayload> => {
- const data = node.data as unknown
-
- if (!data || typeof data !== 'object')
- return false
-
- const payload = data as Partial<TriggerPluginHydratePayload> & { type?: BlockEnum }
-
- if (payload.type !== BlockEnum.TriggerPlugin)
- return false
-
- return 'event_parameters' in payload
-}
-
-const hydrateTriggerPluginNode = (node: Node): Node => {
- if (!isTriggerPluginNode(node))
- return node
-
- const typedNode = node as Node<TriggerPluginHydratePayload>
- const data = typedNode.data
- const eventParameters = data.event_parameters ?? {}
- const parametersSchema = data.parameters_schema ?? data.paramSchemas ?? []
- const config = data.config ?? eventParameters ?? {}
-
- const nextData: typeof data = {
- ...data,
- config,
- paramSchemas: data.paramSchemas ?? parametersSchema,
- parameters_schema: parametersSchema,
- }
-
- return {
- ...typedNode,
- data: nextData,
- }
-}
-
-export const hydrateWorkflowDraftResponse = (draft: FetchWorkflowDraftResponse): FetchWorkflowDraftResponse => {
- return produce(draft, (mutableDraft) => {
- if (!mutableDraft?.graph)
- return
-
- if (mutableDraft.graph.nodes) {
- mutableDraft.graph.nodes = mutableDraft.graph.nodes
- .filter((node: Node) => !node.data?._isTempNode)
- .map((node: Node) => {
- if (node.data)
- removeTempProperties(node.data as Record<string, unknown>)
-
- let n = hydrateTriggerPluginNode(node)
- // Normalize Start node variable json_schema to object when loading
- if ((n.data as any)?.type === BlockEnum.Start && Array.isArray((n.data as any).variables)) {
- const next = { ...n, data: { ...n.data } } as Node<any>
- next.data.variables = (n.data as any).variables.map((v: any) => {
- if (v && v.type === 'json_object' && typeof v.json_schema === 'string') {
- try {
- const obj = JSON.parse(v.json_schema)
- return { ...v, json_schema: obj }
- }
- catch {
- return v
- }
- }
- return v
- })
- n = next
- }
- return n
- })
- }
-
- if (mutableDraft.graph.edges) {
- mutableDraft.graph.edges = mutableDraft.graph.edges
- .filter((edge: Edge) => !edge.data?._isTemp)
- .map((edge: Edge) => {
- if (edge.data)
- removeTempProperties(edge.data as Record<string, unknown>)
-
- return edge
- })
- }
-
- if (mutableDraft.environment_variables) {
- mutableDraft.environment_variables = mutableDraft.environment_variables.map(env =>
- env.value_type === 'secret'
- ? { ...env, value: '[__HIDDEN__]' }
- : env,
- )
- }
- })
-}
diff --git a/web/test/i18n-mock.ts b/web/test/i18n-mock.ts
index 39f97db5430..9fd9a29cfb8 100644
--- a/web/test/i18n-mock.ts
+++ b/web/test/i18n-mock.ts
@@ -7,7 +7,7 @@ type TranslationMap = Record<string, string | string[]>
* Create a t function with optional custom translations
* Checks translations[key] first, then translations[ns.key], then returns ns.key as fallback
*/
-export function createTFunction(translations: TranslationMap, defaultNs?: string) {
+function createTFunction(translations: TranslationMap, defaultNs?: string) {
return (key: string, options?: Record<string, unknown>) => {
// Check custom translations first (without namespace)
if (translations[key] !== undefined)
@@ -40,7 +40,7 @@ export function createTFunction(translations: TranslationMap, defaultNs?: string
* 'operation.confirm': 'Confirm',
* }))
*/
-export function createUseTranslationMock(translations: TranslationMap = {}) {
+function createUseTranslationMock(translations: TranslationMap = {}) {
const tCache = new Map<string, ReturnType<typeof createTFunction>>()
const i18n = {
language: 'en',
@@ -62,7 +62,7 @@ export function createUseTranslationMock(translations: TranslationMap = {}) {
/**
* Create Trans component mock with optional custom translations
*/
-export function createTransMock(translations: TranslationMap = {}) {
+function createTransMock(translations: TranslationMap = {}) {
return {
Trans: ({ i18nKey, children }: {
i18nKey: string
diff --git a/web/types/app.ts b/web/types/app.ts
index c8c409a22c9..b782a787309 100644
--- a/web/types/app.ts
+++ b/web/types/app.ts
@@ -16,22 +16,6 @@ export enum Theme {
system = 'system',
}
-export enum ProviderType {
- openai = 'openai',
- anthropic = 'anthropic',
- azure_openai = 'azure_openai',
- replicate = 'replicate',
- huggingface_hub = 'huggingface_hub',
- minimax = 'minimax',
- tongyi = 'tongyi',
- spark = 'spark',
-}
-
-export enum AppType {
- chat = 'chat',
- completion = 'completion',
-}
-
export enum ModelModeType {
chat = 'chat',
completion = 'completion',
@@ -51,12 +35,6 @@ export enum RETRIEVE_METHOD {
keywordSearch = 'keyword_search',
}
-export type VariableInput = {
- key: string
- name: string
- value: string
-}
-
/**
* App modes
*/
@@ -388,20 +366,6 @@ export type AppSSO = {
enable_sso: boolean
}
-/**
- * App Template
- */
-export type AppTemplate = {
- /** Name */
- name: string
- /** Description */
- description: string
- /** Mode */
- mode: AppModeEnum
- /** Model */
- model_config: ModelConfig
-}
-
export enum Resolution {
low = 'low',
high = 'high',
diff --git a/web/types/doc-paths.ts b/web/types/doc-paths.ts
index 9cbad79a2e9..a0f2d12097e 100644
--- a/web/types/doc-paths.ts
+++ b/web/types/doc-paths.ts
@@ -273,7 +273,7 @@ export type DocPathWithoutLang =
| `${DocPathWithoutLangBase}#${string}`
// Full documentation path with language prefix
-export type DifyDocPath = `${DocLanguage}/${DocPathWithoutLang}`
+type DifyDocPath = `${DocLanguage}/${DocPathWithoutLang}`
// API Reference path translations (English -> other languages)
export const apiReferencePathTranslations: Record<string, { zh?: string; ja?: string }> = {
diff --git a/web/types/pipeline.tsx b/web/types/pipeline.tsx
index 9caa762ac50..f101853c6cc 100644
--- a/web/types/pipeline.tsx
+++ b/web/types/pipeline.tsx
@@ -6,12 +6,6 @@ export type DataSourceNodeProcessingResponse = {
completed: number
}
-export type DataSourceNodeError = {
- event: 'datasource_error'
- message: string
- code?: string
-}
-
export type OnlineDriveFile = {
id: string
name: string
diff --git a/web/types/workflow.ts b/web/types/workflow.ts
index 5c39246ee0d..9e7dfd7e7af 100644
--- a/web/types/workflow.ts
+++ b/web/types/workflow.ts
@@ -1,9 +1,7 @@
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 { FormInputItem, UserAction } from '@/app/components/workflow/nodes/human-input/types'
-import type { SpecialResultPanelProps } from '@/app/components/workflow/run/special-result-panel'
import type {
BlockEnum,
CommonNodeType,
@@ -402,10 +400,6 @@ export type WorkflowRunHistoryResponse = {
data: WorkflowRunHistory[]
}
-export type ChatRunHistoryResponse = {
- data: WorkflowRunHistory[]
-}
-
export type NodesDefaultConfigsResponse = {
type: string
config: any
@@ -439,10 +433,6 @@ export type UpdateWorkflowParams = {
releaseNotes: string
}
-export type PanelExposedType = {
- singleRunParams: Pick<BeforeRunFormProps, 'forms'> & Partial<SpecialResultPanelProps>
-}
-
export type PanelProps = {
getInputVars: (textList: string[]) => InputVar[]
toVarInputs: (variables: Variable[]) => InputVar[]
diff --git a/web/utils/download.ts b/web/utils/download.ts
index 8278366aea0..80b563bf938 100644
--- a/web/utils/download.ts
+++ b/web/utils/download.ts
@@ -1,4 +1,4 @@
-export type DownloadUrlOptions = {
+type DownloadUrlOptions = {
url: string
fileName?: string
rel?: string
diff --git a/web/utils/encryption.ts b/web/utils/encryption.ts
index 2c9e985f121..622132fb932 100644
--- a/web/utils/encryption.ts
+++ b/web/utils/encryption.ts
@@ -12,7 +12,7 @@
* @param plaintext - The plain text to encode
* @returns Base64 encoded text
*/
-export function encryptField(plaintext: string): string {
+function encryptField(plaintext: string): string {
try {
// Base64 encode the plaintext
// btoa works with ASCII, so we need to handle UTF-8 properly
diff --git a/web/utils/var.ts b/web/utils/var.ts
index efad8794eb5..1c024408005 100644
--- a/web/utils/var.ts
+++ b/web/utils/var.ts
@@ -51,7 +51,7 @@ export const getNewVarInWorkflow = (key: string, type = InputVarType.textInput):
}
}
-export type VarKeyErrorMessageKey = I18nKeysByPrefix<'appDebug', 'varKeyError.'>
+type VarKeyErrorMessageKey = I18nKeysByPrefix<'appDebug', 'varKeyError.'>
export const checkKey = (key: string, canBeEmpty?: boolean, _keys?: string[]): true | VarKeyErrorMessageKey => {
if (key.length === 0 && !canBeEmpty)