mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-18 10:03:55 +00:00
feat: update ESLint config with @typescript-eslint/consistent-type-imports (#4746)
* update: Add type * fix: update import statement for NextApiRequest type * fix: update imports to use type for LexicalEditor and EditorState * Refactor imports to use 'import type' for type-only imports across multiple files - Updated imports in various components and API files to use 'import type' for better clarity and to optimize TypeScript's type checking. - Ensured consistent usage of type imports in files related to chat, dataset, workflow, and user management. - Improved code readability and maintainability by distinguishing between value and type imports. * refactor: remove old ESLint configuration and add new rules - Deleted the old ESLint configuration file from the app project. - Added a new ESLint configuration file with updated rules and settings. - Changed imports to use type-only imports in various files for better clarity and performance. - Updated TypeScript configuration to remove unnecessary options. - Added an ESLint ignore file to exclude build and dependency directories from linting. * fix: update imports to use 'import type' for type-only imports in schema files
This commit is contained in:
25
.eslintignore
Normal file
25
.eslintignore
Normal file
@@ -0,0 +1,25 @@
|
||||
# 构建输出目录
|
||||
dist/
|
||||
build/
|
||||
.next/
|
||||
out/
|
||||
|
||||
# 依赖目录
|
||||
node_modules/
|
||||
|
||||
# 缓存和生成文件
|
||||
coverage/
|
||||
.coverage/
|
||||
.nyc_output/
|
||||
*.log
|
||||
|
||||
# 其他不需要检查的文件
|
||||
*.min.js
|
||||
*.config.js
|
||||
vitest.config.mts
|
||||
|
||||
# 特定目录
|
||||
bin/
|
||||
scripts/
|
||||
deploy/
|
||||
docSite/
|
17
.eslintrc.json
Normal file
17
.eslintrc.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"root": true,
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"plugins": ["@typescript-eslint"],
|
||||
"extends": ["next/core-web-vitals"],
|
||||
"rules": {
|
||||
"react-hooks/rules-of-hooks": 0,
|
||||
"@typescript-eslint/consistent-type-imports": [
|
||||
"error",
|
||||
{
|
||||
"prefer": "type-imports",
|
||||
"disallowTypeAnnotations": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"ignorePatterns": ["node_modules/", "dist/", "build/", "coverage/"]
|
||||
}
|
11
package.json
11
package.json
@@ -13,12 +13,18 @@
|
||||
"previewIcon": "node ./scripts/icon/index.js",
|
||||
"api:gen": "tsc ./scripts/openapi/index.ts && node ./scripts/openapi/index.js && npx @redocly/cli build-docs ./scripts/openapi/openapi.json -o ./projects/app/public/openapi/index.html",
|
||||
"create:i18n": "node ./scripts/i18n/index.js",
|
||||
"lint": "eslint \"**/*.{ts,tsx}\" --ignore-path .eslintignore",
|
||||
"lint:fix": "eslint \"**/*.{ts,tsx}\" --fix --ignore-path .eslintignore",
|
||||
"test": "vitest run",
|
||||
"test:workflow": "vitest run workflow"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@chakra-ui/cli": "^2.4.1",
|
||||
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
||||
"@typescript-eslint/parser": "^6.21.0",
|
||||
"@vitest/coverage-v8": "^3.0.9",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-config-next": "^14.1.0",
|
||||
"husky": "^8.0.3",
|
||||
"i18next": "23.16.8",
|
||||
"lint-staged": "^13.3.0",
|
||||
@@ -31,7 +37,10 @@
|
||||
"zhlint": "^0.7.4"
|
||||
},
|
||||
"lint-staged": {
|
||||
"./**/**/*.{ts,tsx,scss}": "npm run format-code",
|
||||
"./**/**/*.{ts,tsx,scss}": [
|
||||
"npm run format-code",
|
||||
"npm run lint:fix"
|
||||
],
|
||||
"./docSite/**/**/*.md": "npm run format-doc && npm run gen:llms"
|
||||
},
|
||||
"resolutions": {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { ErrType } from '../errorCode';
|
||||
import { type ErrType } from '../errorCode';
|
||||
import { i18nT } from '../../../../web/i18n/utils';
|
||||
/* dataset: 502000 */
|
||||
export enum AppErrEnum {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { ErrType } from '../errorCode';
|
||||
import { type ErrType } from '../errorCode';
|
||||
import { i18nT } from '../../../../web/i18n/utils';
|
||||
/* dataset: 504000 */
|
||||
export enum ChatErrEnum {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { i18nT } from '../../../../web/i18n/utils';
|
||||
import { ErrType } from '../errorCode';
|
||||
import { type ErrType } from '../errorCode';
|
||||
|
||||
/* dataset: 507000 */
|
||||
const startCode = 507000;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { i18nT } from '../../../../web/i18n/utils';
|
||||
import { ErrType } from '../errorCode';
|
||||
import { type ErrType } from '../errorCode';
|
||||
|
||||
/* dataset: 501000 */
|
||||
export enum DatasetErrEnum {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { ErrType } from '../errorCode';
|
||||
import { type ErrType } from '../errorCode';
|
||||
import { i18nT } from '../../../../web/i18n/utils';
|
||||
/* dataset: 506000 */
|
||||
export enum OpenApiErrEnum {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { ErrType } from '../errorCode';
|
||||
import { type ErrType } from '../errorCode';
|
||||
import { i18nT } from '../../../../web/i18n/utils';
|
||||
/* dataset: 505000 */
|
||||
export enum OutLinkErrEnum {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { ErrType } from '../errorCode';
|
||||
import { type ErrType } from '../errorCode';
|
||||
import { i18nT } from '../../../../web/i18n/utils';
|
||||
/* dataset: 508000 */
|
||||
export enum PluginErrEnum {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { ErrType } from '../errorCode';
|
||||
import { type ErrType } from '../errorCode';
|
||||
import { i18nT } from '../../../../web/i18n/utils';
|
||||
/* dataset: 509000 */
|
||||
export enum SystemErrEnum {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { ErrType } from '../errorCode';
|
||||
import { type ErrType } from '../errorCode';
|
||||
import { i18nT } from '../../../../web/i18n/utils';
|
||||
/* team: 503000 */
|
||||
export enum UserErrEnum {
|
||||
|
2
packages/global/common/file/api.d.ts
vendored
2
packages/global/common/file/api.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
import { OutLinkChatAuthProps } from '../../support/permission/chat.d';
|
||||
import type { OutLinkChatAuthProps } from '../../support/permission/chat.d';
|
||||
|
||||
export type preUploadImgProps = OutLinkChatAuthProps & {
|
||||
// expiredTime?: Date;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { detect } from 'jschardet';
|
||||
import { documentFileType } from './constants';
|
||||
import { ChatFileTypeEnum } from '../../core/chat/constants';
|
||||
import { UserChatItemValueItemType } from '../../core/chat/type';
|
||||
import { type UserChatItemValueItemType } from '../../core/chat/type';
|
||||
import * as fs from 'fs';
|
||||
|
||||
export const formatFileSize = (bytes: number): string => {
|
||||
|
2
packages/global/common/file/type.d.ts
vendored
2
packages/global/common/file/type.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
import { BucketNameEnum } from './constants';
|
||||
import type { BucketNameEnum } from './constants';
|
||||
|
||||
export type FileTokenQuery = {
|
||||
bucketName: `${BucketNameEnum}`;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { TrackEnum } from './constants';
|
||||
import type { TrackEnum } from './constants';
|
||||
import { OAuthEnum } from '../../../support/user/constant';
|
||||
import { AppTypeEnum } from '../../../core/app/constants';
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { ParentIdType } from './type';
|
||||
import { type ParentIdType } from './type';
|
||||
|
||||
export const parseParentIdInMongo = (parentId: ParentIdType) => {
|
||||
if (parentId === undefined) return {};
|
||||
|
@@ -1,8 +1,8 @@
|
||||
import { SystemConfigsTypeEnum } from "./constants";
|
||||
import type { SystemConfigsTypeEnum } from './constants';
|
||||
|
||||
export type SystemConfigsType = {
|
||||
_id: string;
|
||||
type: `${SystemConfigsTypeEnum}`;
|
||||
value: Record<string, any>;
|
||||
createTime: Date;
|
||||
};
|
||||
};
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import { StandSubPlanLevelMapType, SubPlanType } from '../../../support/wallet/sub/type';
|
||||
import type { SubPlanType } from '../../../support/wallet/sub/type';
|
||||
import { StandSubPlanLevelMapType } from '../../../support/wallet/sub/type';
|
||||
import type {
|
||||
ChatModelItemType,
|
||||
FunctionModelItemType,
|
||||
|
2
packages/global/core/ai/model.d.ts
vendored
2
packages/global/core/ai/model.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
import { ModelTypeEnum } from './model';
|
||||
import type { ModelTypeEnum } from './model';
|
||||
import type { ModelProviderIdType } from './provider';
|
||||
|
||||
type PriceType = {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { i18nT } from '../../../web/i18n/utils';
|
||||
import type { LLMModelItemType, STTModelType, EmbeddingModelItemType } from './model.d';
|
||||
import { getModelProvider, ModelProviderIdType } from './provider';
|
||||
import { getModelProvider, type ModelProviderIdType } from './provider';
|
||||
|
||||
export enum ModelTypeEnum {
|
||||
llm = 'llm',
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { PromptTemplateItem } from '../type.d';
|
||||
import { type PromptTemplateItem } from '../type.d';
|
||||
import { i18nT } from '../../../../web/i18n/utils';
|
||||
import { getPromptByVersion } from './utils';
|
||||
|
||||
|
4
packages/global/core/ai/type.d.ts
vendored
4
packages/global/core/ai/type.d.ts
vendored
@@ -9,8 +9,8 @@ import type {
|
||||
ChatCompletionAssistantMessageParam as SdkChatCompletionAssistantMessageParam
|
||||
} from 'openai/resources';
|
||||
import { ChatMessageTypeEnum } from './constants';
|
||||
import { WorkflowInteractiveResponseType } from '../workflow/template/system/interactive/type';
|
||||
import { Stream } from 'openai/streaming';
|
||||
import type { WorkflowInteractiveResponseType } from '../workflow/template/system/interactive/type';
|
||||
import type { Stream } from 'openai/streaming';
|
||||
export * from 'openai/resources';
|
||||
|
||||
// Extension of ChatCompletionMessageParam, Add file url type
|
||||
|
@@ -1,9 +1,9 @@
|
||||
import {
|
||||
AppTTSConfigType,
|
||||
AppFileSelectConfigType,
|
||||
AppWhisperConfigType,
|
||||
AppAutoExecuteConfigType,
|
||||
AppQGConfigType
|
||||
type AppTTSConfigType,
|
||||
type AppFileSelectConfigType,
|
||||
type AppWhisperConfigType,
|
||||
type AppAutoExecuteConfigType,
|
||||
type AppQGConfigType
|
||||
} from './type';
|
||||
|
||||
export enum AppTypeEnum {
|
||||
|
6
packages/global/core/app/controller.d.ts
vendored
6
packages/global/core/app/controller.d.ts
vendored
@@ -1,6 +1,6 @@
|
||||
import { ParentIdType } from 'common/parentFolder/type';
|
||||
import { AppSchema } from './type';
|
||||
import { AppTypeEnum } from './constants';
|
||||
import type { ParentIdType } from 'common/parentFolder/type';
|
||||
import type { AppSchema } from './type';
|
||||
import type { AppTypeEnum } from './constants';
|
||||
|
||||
export type CreateAppProps = {
|
||||
parentId?: ParentIdType;
|
||||
|
@@ -1,19 +1,19 @@
|
||||
import { getNanoid } from '../../../common/string/tools';
|
||||
import { OpenApiJsonSchema } from './type';
|
||||
import { type OpenApiJsonSchema } from './type';
|
||||
import yaml from 'js-yaml';
|
||||
import { OpenAPIV3 } from 'openapi-types';
|
||||
import { FlowNodeInputItemType, FlowNodeOutputItemType } from '../../workflow/type/io';
|
||||
import type { OpenAPIV3 } from 'openapi-types';
|
||||
import { type FlowNodeInputItemType, type FlowNodeOutputItemType } from '../../workflow/type/io';
|
||||
import { FlowNodeInputTypeEnum, FlowNodeOutputTypeEnum } from '../../workflow/node/constant';
|
||||
import { WorkflowIOValueTypeEnum } from '../../workflow/constants';
|
||||
import { PluginInputModule } from '../../workflow/template/system/pluginInput';
|
||||
import { PluginOutputModule } from '../../workflow/template/system/pluginOutput';
|
||||
import { HttpNode468 } from '../../workflow/template/system/http468';
|
||||
import { HttpParamAndHeaderItemType } from '../../workflow/api';
|
||||
import { StoreNodeItemType } from '../../workflow/type/node';
|
||||
import { type HttpParamAndHeaderItemType } from '../../workflow/api';
|
||||
import { type StoreNodeItemType } from '../../workflow/type/node';
|
||||
import { HttpImgUrl } from '../../../common/file/image/constants';
|
||||
import SwaggerParser from '@apidevtools/swagger-parser';
|
||||
import { getHandleId } from '../../workflow/utils';
|
||||
import { CreateHttpPluginChildrenPros } from '../controller';
|
||||
import { type CreateHttpPluginChildrenPros } from '../controller';
|
||||
import { AppTypeEnum } from '../constants';
|
||||
import type { StoreEdgeItemType } from '../../workflow/type/edge';
|
||||
|
||||
|
@@ -5,9 +5,9 @@ import {
|
||||
FlowNodeTypeEnum
|
||||
} from '../../workflow/node/constant';
|
||||
import { nanoid } from 'nanoid';
|
||||
import { ToolType } from '../type';
|
||||
import { type ToolType } from '../type';
|
||||
import { i18nT } from '../../../../web/i18n/utils';
|
||||
import { RuntimeNodeItemType } from '../../workflow/runtime/type';
|
||||
import { type RuntimeNodeItemType } from '../../workflow/runtime/type';
|
||||
|
||||
export const getMCPToolSetRuntimeNode = ({
|
||||
url,
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { StoreNodeItemType } from '../../workflow/type/node';
|
||||
import { FlowNodeInputItemType } from '../../workflow/type/io';
|
||||
import { type StoreNodeItemType } from '../../workflow/type/node';
|
||||
import { type FlowNodeInputItemType } from '../../workflow/type/io';
|
||||
import { FlowNodeTypeEnum } from '../../workflow/node/constant';
|
||||
|
||||
export const getPluginInputsFromStoreNodes = (nodes: StoreNodeItemType[]) => {
|
||||
|
18
packages/global/core/app/type.d.ts
vendored
18
packages/global/core/app/type.d.ts
vendored
@@ -1,20 +1,20 @@
|
||||
import type { FlowNodeTemplateType, StoreNodeItemType } from '../workflow/type/node';
|
||||
import { AppTypeEnum } from './constants';
|
||||
import type { AppTypeEnum } from './constants';
|
||||
import { PermissionTypeEnum } from '../../support/permission/constant';
|
||||
import {
|
||||
import type {
|
||||
NodeInputKeyEnum,
|
||||
VariableInputEnum,
|
||||
WorkflowIOValueTypeEnum
|
||||
} from '../workflow/constants';
|
||||
import { SelectedDatasetType } from '../workflow/api';
|
||||
import { DatasetSearchModeEnum } from '../dataset/constants';
|
||||
import type { SelectedDatasetType } from '../workflow/api';
|
||||
import type { DatasetSearchModeEnum } from '../dataset/constants';
|
||||
import { TeamTagSchema as TeamTagsSchemaType } from '@fastgpt/global/support/user/team/type.d';
|
||||
import { StoreEdgeItemType } from '../workflow/type/edge';
|
||||
import { AppPermission } from '../../support/permission/app/controller';
|
||||
import { ParentIdType } from '../../common/parentFolder/type';
|
||||
import type { StoreEdgeItemType } from '../workflow/type/edge';
|
||||
import type { AppPermission } from '../../support/permission/app/controller';
|
||||
import type { ParentIdType } from '../../common/parentFolder/type';
|
||||
import { FlowNodeInputTypeEnum } from '../../core/workflow/node/constant';
|
||||
import { WorkflowTemplateBasicType } from '@fastgpt/global/core/workflow/type';
|
||||
import { SourceMemberType } from '../../support/user/type';
|
||||
import type { WorkflowTemplateBasicType } from '@fastgpt/global/core/workflow/type';
|
||||
import type { SourceMemberType } from '../../support/user/type';
|
||||
|
||||
export type ToolType = {
|
||||
name: string;
|
||||
|
@@ -3,9 +3,9 @@ import { FlowNodeTypeEnum } from '../workflow/node/constant';
|
||||
import { NodeInputKeyEnum, FlowNodeTemplateTypeEnum } from '../workflow/constants';
|
||||
import type { FlowNodeInputItemType } from '../workflow/type/io.d';
|
||||
import { getAppChatConfig } from '../workflow/utils';
|
||||
import { StoreNodeItemType } from '../workflow/type/node';
|
||||
import { type StoreNodeItemType } from '../workflow/type/node';
|
||||
import { DatasetSearchModeEnum } from '../dataset/constants';
|
||||
import { WorkflowTemplateBasicType } from '../workflow/type';
|
||||
import { type WorkflowTemplateBasicType } from '../workflow/type';
|
||||
import { AppTypeEnum } from './constants';
|
||||
import { AppErrEnum } from '../../common/error/code/app';
|
||||
import { PluginErrEnum } from '../../common/error/code/plugin';
|
||||
|
5
packages/global/core/app/version.d.ts
vendored
5
packages/global/core/app/version.d.ts
vendored
@@ -1,7 +1,8 @@
|
||||
import { TeamMemberStatusEnum } from 'support/user/team/constant';
|
||||
import { StoreEdgeItemType } from '../workflow/type/edge';
|
||||
import { AppChatConfigType, AppSchema } from './type';
|
||||
import { SourceMemberType } from 'support/user/type';
|
||||
import type { AppSchema } from './type';
|
||||
import { AppChatConfigType } from './type';
|
||||
import type { SourceMemberType } from 'support/user/type';
|
||||
|
||||
export type AppVersionSchemaType = {
|
||||
_id: string;
|
||||
|
2
packages/global/core/chat/api.d.ts
vendored
2
packages/global/core/chat/api.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
import { OutLinkChatAuthProps } from '../../support/permission/chat';
|
||||
import type { OutLinkChatAuthProps } from '../../support/permission/chat';
|
||||
|
||||
export type UpdateChatFeedbackProps = OutLinkChatAuthProps & {
|
||||
appId: string;
|
||||
|
21
packages/global/core/chat/type.d.ts
vendored
21
packages/global/core/chat/type.d.ts
vendored
@@ -1,22 +1,23 @@
|
||||
import { ClassifyQuestionAgentItemType } from '../workflow/template/system/classifyQuestion/type';
|
||||
import { SearchDataResponseItemType } from '../dataset/type';
|
||||
import {
|
||||
import type { SearchDataResponseItemType } from '../dataset/type';
|
||||
import type {
|
||||
ChatFileTypeEnum,
|
||||
ChatItemValueTypeEnum,
|
||||
ChatRoleEnum,
|
||||
ChatSourceEnum,
|
||||
ChatStatusEnum
|
||||
} from './constants';
|
||||
import { FlowNodeTypeEnum } from '../workflow/node/constant';
|
||||
import { NodeOutputKeyEnum } from '../workflow/constants';
|
||||
import { DispatchNodeResponseKeyEnum } from '../workflow/runtime/constants';
|
||||
import { AppChatConfigType, AppSchema, VariableItemType } from '../app/type';
|
||||
import type { FlowNodeTypeEnum } from '../workflow/node/constant';
|
||||
import type { NodeOutputKeyEnum } from '../workflow/constants';
|
||||
import type { DispatchNodeResponseKeyEnum } from '../workflow/runtime/constants';
|
||||
import type { AppSchema, VariableItemType } from '../app/type';
|
||||
import { AppChatConfigType } from '../app/type';
|
||||
import type { AppSchema as AppType } from '@fastgpt/global/core/app/type.d';
|
||||
import { DatasetSearchModeEnum } from '../dataset/constants';
|
||||
import { DispatchNodeResponseType } from '../workflow/runtime/type.d';
|
||||
import { ChatBoxInputType } from '../../../../projects/app/src/components/core/chat/ChatContainer/ChatBox/type';
|
||||
import { WorkflowInteractiveResponseType } from '../workflow/template/system/interactive/type';
|
||||
import { FlowNodeInputItemType } from '../workflow/type/io';
|
||||
import type { DispatchNodeResponseType } from '../workflow/runtime/type.d';
|
||||
import type { ChatBoxInputType } from '../../../../projects/app/src/components/core/chat/ChatContainer/ChatBox/type';
|
||||
import type { WorkflowInteractiveResponseType } from '../workflow/template/system/interactive/type';
|
||||
import type { FlowNodeInputItemType } from '../workflow/type/io';
|
||||
|
||||
export type ChatSchema = {
|
||||
_id: string;
|
||||
|
@@ -1,11 +1,11 @@
|
||||
import { DispatchNodeResponseType } from '../workflow/runtime/type';
|
||||
import { type DispatchNodeResponseType } from '../workflow/runtime/type';
|
||||
import { FlowNodeTypeEnum } from '../workflow/node/constant';
|
||||
import { ChatItemValueTypeEnum, ChatRoleEnum, ChatSourceEnum } from './constants';
|
||||
import {
|
||||
AIChatItemValueItemType,
|
||||
ChatHistoryItemResType,
|
||||
ChatItemType,
|
||||
UserChatItemValueItemType
|
||||
type AIChatItemValueItemType,
|
||||
type ChatHistoryItemResType,
|
||||
type ChatItemType,
|
||||
type UserChatItemValueItemType
|
||||
} from './type.d';
|
||||
import { sliceStrStartEnd } from '../../common/string/tools';
|
||||
import { PublishChannelEnum } from '../../support/outLink/constant';
|
||||
|
6
packages/global/core/dataset/api.d.ts
vendored
6
packages/global/core/dataset/api.d.ts
vendored
@@ -1,12 +1,12 @@
|
||||
import { DatasetDataIndexItemType, DatasetSchemaType } from './type';
|
||||
import {
|
||||
import type { DatasetDataIndexItemType, DatasetSchemaType } from './type';
|
||||
import type {
|
||||
DatasetCollectionTypeEnum,
|
||||
DatasetCollectionDataProcessModeEnum,
|
||||
ChunkSettingModeEnum,
|
||||
DataChunkSplitModeEnum
|
||||
} from './constants';
|
||||
import type { LLMModelItemType } from '../ai/model.d';
|
||||
import { ParentIdType } from 'common/parentFolder/type';
|
||||
import type { ParentIdType } from 'common/parentFolder/type';
|
||||
|
||||
/* ================= dataset ===================== */
|
||||
export type DatasetUpdateBody = {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { UpdateClbPermissionProps } from '../../support/permission/collaborator';
|
||||
import type { UpdateClbPermissionProps } from '../../support/permission/collaborator';
|
||||
import { PermissionValueType } from '../../support/permission/type';
|
||||
import { RequireOnlyOne } from '../../common/type/utils';
|
||||
import type { RequireOnlyOne } from '../../common/type/utils';
|
||||
|
||||
export type UpdateDatasetCollaboratorBody = UpdateClbPermissionProps & {
|
||||
datasetId: string;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { DatasetCollectionTypeEnum } from '../constants';
|
||||
import { DatasetCollectionSchemaType } from '../type';
|
||||
import { type DatasetCollectionSchemaType } from '../type';
|
||||
|
||||
export const getCollectionSourceData = (collection?: DatasetCollectionSchemaType) => {
|
||||
return {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { SearchScoreTypeEnum } from '../constants';
|
||||
import { SearchDataResponseItemType } from '../type';
|
||||
import { type SearchDataResponseItemType } from '../type';
|
||||
|
||||
/* dataset search result concat */
|
||||
export const datasetSearchResultConcat = (
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { PushDatasetDataChunkProps } from '../api';
|
||||
import { TrainingModeEnum } from '../constants';
|
||||
import type { PushDatasetDataChunkProps } from '../api';
|
||||
import type { TrainingModeEnum } from '../constants';
|
||||
|
||||
export type PushDataToTrainingQueueProps = {
|
||||
teamId: string;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { EmbeddingModelItemType, LLMModelItemType } from '../../../core/ai/model.d';
|
||||
import { type EmbeddingModelItemType, type LLMModelItemType } from '../../../core/ai/model.d';
|
||||
import {
|
||||
ChunkSettingModeEnum,
|
||||
DataChunkSplitModeEnum,
|
||||
|
12
packages/global/core/dataset/type.d.ts
vendored
12
packages/global/core/dataset/type.d.ts
vendored
@@ -1,7 +1,7 @@
|
||||
import type { LLMModelItemType, EmbeddingModelItemType } from '../../core/ai/model.d';
|
||||
import { PermissionTypeEnum } from '../../support/permission/constant';
|
||||
import { PushDatasetDataChunkProps } from './api';
|
||||
import {
|
||||
import type {
|
||||
DataChunkSplitModeEnum,
|
||||
DatasetCollectionDataProcessModeEnum,
|
||||
DatasetCollectionTypeEnum,
|
||||
@@ -10,12 +10,12 @@ import {
|
||||
SearchScoreTypeEnum,
|
||||
TrainingModeEnum
|
||||
} from './constants';
|
||||
import { DatasetPermission } from '../../support/permission/dataset/controller';
|
||||
import type { DatasetPermission } from '../../support/permission/dataset/controller';
|
||||
import { Permission } from '../../support/permission/controller';
|
||||
import { APIFileServer, FeishuServer, YuqueServer } from './apiDataset';
|
||||
import { SourceMemberType } from 'support/user/type';
|
||||
import { DatasetDataIndexTypeEnum } from './data/constants';
|
||||
import { ChunkSettingModeEnum } from './constants';
|
||||
import type { APIFileServer, FeishuServer, YuqueServer } from './apiDataset';
|
||||
import type { SourceMemberType } from 'support/user/type';
|
||||
import type { DatasetDataIndexTypeEnum } from './data/constants';
|
||||
import type { ChunkSettingModeEnum } from './constants';
|
||||
|
||||
export type ChunkSettingsType = {
|
||||
trainingType: DatasetCollectionDataProcessModeEnum;
|
||||
|
4
packages/global/core/plugin/controller.d.ts
vendored
4
packages/global/core/plugin/controller.d.ts
vendored
@@ -1,6 +1,6 @@
|
||||
import { StoreEdgeItemType } from 'core/workflow/type/edge';
|
||||
import type { StoreEdgeItemType } from 'core/workflow/type/edge';
|
||||
import type { StoreNodeItemType } from '../workflow/type/node';
|
||||
import { PluginTypeEnum } from './constants';
|
||||
import type { PluginTypeEnum } from './constants';
|
||||
import { HttpAuthMethodType } from '../app/httpPlugin/type';
|
||||
|
||||
export type CreateOnePluginParams = {
|
||||
|
6
packages/global/core/plugin/type.d.ts
vendored
6
packages/global/core/plugin/type.d.ts
vendored
@@ -1,9 +1,9 @@
|
||||
import { StoreEdgeItemType } from 'core/workflow/type/edge';
|
||||
import type { StoreEdgeItemType } from 'core/workflow/type/edge';
|
||||
import { ModuleTemplateTypeEnum } from '../workflow/constants';
|
||||
import type { StoreNodeItemType } from '../workflow/type/node';
|
||||
import { PluginSourceEnum, PluginTypeEnum } from './constants';
|
||||
import type { PluginSourceEnum, PluginTypeEnum } from './constants';
|
||||
import { MethodType } from './controller';
|
||||
import { FlowNodeTemplateType } from '../workflow/type/node';
|
||||
import type { FlowNodeTemplateType } from '../workflow/type/node';
|
||||
|
||||
export type PluginItemSchema = {
|
||||
_id: string;
|
||||
|
2
packages/global/core/workflow/api.d.ts
vendored
2
packages/global/core/workflow/api.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
import { EmbeddingModelItemType } from '../ai/model.d';
|
||||
import type { EmbeddingModelItemType } from '../ai/model.d';
|
||||
import { NodeInputKeyEnum } from './constants';
|
||||
|
||||
export type SelectedDatasetType = {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { FlowNodeInputItemType } from '../../type/io';
|
||||
import { type FlowNodeInputItemType } from '../../type/io';
|
||||
|
||||
export const getInputComponentProps = (input: FlowNodeInputItemType) => {
|
||||
return {
|
||||
|
42
packages/global/core/workflow/runtime/type.d.ts
vendored
42
packages/global/core/workflow/runtime/type.d.ts
vendored
@@ -1,30 +1,32 @@
|
||||
import { ChatNodeUsageType } from '../../../support/wallet/bill/type';
|
||||
import {
|
||||
import type { ChatNodeUsageType } from '../../../support/wallet/bill/type';
|
||||
import type {
|
||||
ChatItemType,
|
||||
UserChatItemValueItemType,
|
||||
ToolRunResponseItemType,
|
||||
NodeOutputItemType,
|
||||
AIChatItemValueItemType
|
||||
} from '../../chat/type';
|
||||
import { FlowNodeInputItemType, FlowNodeOutputItemType } from '../type/io.d';
|
||||
import { StoreNodeItemType } from '../type/node';
|
||||
import { DispatchNodeResponseKeyEnum } from './constants';
|
||||
import { StoreEdgeItemType } from '../type/edge';
|
||||
import { NodeInputKeyEnum } from '../constants';
|
||||
import { ClassifyQuestionAgentItemType } from '../template/system/classifyQuestion/type';
|
||||
import { NextApiResponse } from 'next';
|
||||
import { NodeOutputItemType } from '../../chat/type';
|
||||
import type { FlowNodeInputItemType, FlowNodeOutputItemType } from '../type/io.d';
|
||||
import type { StoreNodeItemType } from '../type/node';
|
||||
import type { DispatchNodeResponseKeyEnum } from './constants';
|
||||
import type { StoreEdgeItemType } from '../type/edge';
|
||||
import type { NodeInputKeyEnum } from '../constants';
|
||||
import type { ClassifyQuestionAgentItemType } from '../template/system/classifyQuestion/type';
|
||||
import type { NextApiResponse } from 'next';
|
||||
import { UserModelSchema } from '../../../support/user/type';
|
||||
import { AppDetailType, AppSchema } from '../../app/type';
|
||||
import { RuntimeNodeItemType } from '../runtime/type';
|
||||
import { RuntimeEdgeItemType } from './edge';
|
||||
import { ReadFileNodeResponse } from '../template/system/readFiles/type';
|
||||
import type { AppSchema } from '../../app/type';
|
||||
import { AppDetailType } from '../../app/type';
|
||||
import type { RuntimeNodeItemType } from '../runtime/type';
|
||||
import type { RuntimeEdgeItemType } from './edge';
|
||||
import type { ReadFileNodeResponse } from '../template/system/readFiles/type';
|
||||
import { UserSelectOptionType } from '../template/system/userSelect/type';
|
||||
import { WorkflowResponseType } from '../../../../service/core/workflow/dispatch/type';
|
||||
import { AiChatQuoteRoleType } from '../template/system/aiChat/type';
|
||||
import { LafAccountType, OpenaiAccountType } from '../../../support/user/team/type';
|
||||
import { CompletionFinishReason } from '../../ai/type';
|
||||
import { WorkflowInteractiveResponseType } from '../template/system/interactive/type';
|
||||
import { SearchDataResponseItemType } from '../../dataset/type';
|
||||
import type { WorkflowResponseType } from '../../../../service/core/workflow/dispatch/type';
|
||||
import type { AiChatQuoteRoleType } from '../template/system/aiChat/type';
|
||||
import type { OpenaiAccountType } from '../../../support/user/team/type';
|
||||
import { LafAccountType } from '../../../support/user/team/type';
|
||||
import type { CompletionFinishReason } from '../../ai/type';
|
||||
import type { WorkflowInteractiveResponseType } from '../template/system/interactive/type';
|
||||
import type { SearchDataResponseItemType } from '../../dataset/type';
|
||||
export type ExternalProviderType = {
|
||||
openaiAccount?: OpenaiAccountType;
|
||||
externalWorkflowVariables?: Record<string, string>;
|
||||
|
@@ -1,19 +1,19 @@
|
||||
import { ChatCompletionRequestMessageRoleEnum } from '../../ai/constants';
|
||||
import { NodeInputKeyEnum, NodeOutputKeyEnum, WorkflowIOValueTypeEnum } from '../constants';
|
||||
import { FlowNodeTypeEnum } from '../node/constant';
|
||||
import { StoreNodeItemType } from '../type/node';
|
||||
import { StoreEdgeItemType } from '../type/edge';
|
||||
import { RuntimeEdgeItemType, RuntimeNodeItemType } from './type';
|
||||
import { type StoreNodeItemType } from '../type/node';
|
||||
import { type StoreEdgeItemType } from '../type/edge';
|
||||
import { type RuntimeEdgeItemType, type RuntimeNodeItemType } from './type';
|
||||
import { VARIABLE_NODE_ID } from '../constants';
|
||||
import { isValidReferenceValueFormat } from '../utils';
|
||||
import { FlowNodeOutputItemType, ReferenceValueType } from '../type/io';
|
||||
import { ChatItemType, NodeOutputItemType } from '../../../core/chat/type';
|
||||
import { type FlowNodeOutputItemType, type ReferenceValueType } from '../type/io';
|
||||
import { type ChatItemType, type NodeOutputItemType } from '../../../core/chat/type';
|
||||
import { ChatItemValueTypeEnum, ChatRoleEnum } from '../../../core/chat/constants';
|
||||
import { replaceVariable, valToStr } from '../../../common/string/tools';
|
||||
import json5 from 'json5';
|
||||
import {
|
||||
InteractiveNodeResponseType,
|
||||
WorkflowInteractiveResponseType
|
||||
type InteractiveNodeResponseType,
|
||||
type WorkflowInteractiveResponseType
|
||||
} from '../template/system/interactive/type';
|
||||
|
||||
export const extractDeepestInteractive = (
|
||||
|
@@ -2,7 +2,7 @@ import { NodeInputKeyEnum } from '../constants';
|
||||
import { FlowNodeInputTypeEnum } from '../node/constant';
|
||||
import { WorkflowIOValueTypeEnum } from '../constants';
|
||||
import { chatNodeSystemPromptTip, systemPromptTip } from './tip';
|
||||
import { FlowNodeInputItemType } from '../type/io';
|
||||
import { type FlowNodeInputItemType } from '../type/io';
|
||||
import { i18nT } from '../../../../web/i18n/utils';
|
||||
|
||||
export const Input_Template_History: FlowNodeInputItemType = {
|
||||
|
@@ -4,7 +4,7 @@ import {
|
||||
FlowNodeOutputTypeEnum,
|
||||
FlowNodeTypeEnum
|
||||
} from '../../../../node/constant';
|
||||
import { FlowNodeTemplateType } from '../../../../type/node';
|
||||
import { type FlowNodeTemplateType } from '../../../../type/node';
|
||||
import {
|
||||
WorkflowIOValueTypeEnum,
|
||||
NodeInputKeyEnum,
|
||||
|
@@ -4,7 +4,7 @@ import {
|
||||
FlowNodeOutputTypeEnum,
|
||||
FlowNodeTypeEnum
|
||||
} from '../../../node/constant';
|
||||
import { FlowNodeTemplateType } from '../../../type/node';
|
||||
import { type FlowNodeTemplateType } from '../../../type/node';
|
||||
import {
|
||||
WorkflowIOValueTypeEnum,
|
||||
NodeInputKeyEnum,
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { FlowNodeInputTypeEnum, FlowNodeTypeEnum } from '../../node/constant';
|
||||
import { FlowNodeTemplateType } from '../../type/node.d';
|
||||
import { type FlowNodeTemplateType } from '../../type/node.d';
|
||||
import {
|
||||
WorkflowIOValueTypeEnum,
|
||||
NodeInputKeyEnum,
|
||||
|
@@ -3,7 +3,7 @@ import {
|
||||
FlowNodeOutputTypeEnum,
|
||||
FlowNodeTypeEnum
|
||||
} from '../../../node/constant';
|
||||
import { FlowNodeTemplateType } from '../../../type/node';
|
||||
import { type FlowNodeTemplateType } from '../../../type/node';
|
||||
import {
|
||||
WorkflowIOValueTypeEnum,
|
||||
NodeInputKeyEnum,
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { FlowNodeTypeEnum } from '../../node/constant';
|
||||
import { FlowNodeTemplateType } from '../../type/node.d';
|
||||
import { type FlowNodeTemplateType } from '../../type/node.d';
|
||||
import {
|
||||
FlowNodeTemplateTypeEnum,
|
||||
NodeInputKeyEnum,
|
||||
|
@@ -3,7 +3,7 @@ import {
|
||||
FlowNodeOutputTypeEnum,
|
||||
FlowNodeTypeEnum
|
||||
} from '../../../node/constant';
|
||||
import { FlowNodeTemplateType } from '../../../type/node';
|
||||
import { type FlowNodeTemplateType } from '../../../type/node';
|
||||
import {
|
||||
WorkflowIOValueTypeEnum,
|
||||
NodeInputKeyEnum,
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { WorkflowIOValueTypeEnum } from '../../../constants';
|
||||
import type { WorkflowIOValueTypeEnum } from '../../../constants';
|
||||
|
||||
export type ContextExtractAgentItemType = {
|
||||
valueType:
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { FlowNodeInputTypeEnum, FlowNodeTypeEnum } from '../../node/constant';
|
||||
import { FlowNodeTemplateType } from '../../type/node.d';
|
||||
import { type FlowNodeTemplateType } from '../../type/node.d';
|
||||
import {
|
||||
WorkflowIOValueTypeEnum,
|
||||
FlowNodeTemplateTypeEnum,
|
||||
|
@@ -4,7 +4,7 @@ import {
|
||||
FlowNodeOutputTypeEnum,
|
||||
FlowNodeTypeEnum
|
||||
} from '../../node/constant';
|
||||
import { FlowNodeTemplateType } from '../../type/node';
|
||||
import { type FlowNodeTemplateType } from '../../type/node';
|
||||
import {
|
||||
WorkflowIOValueTypeEnum,
|
||||
NodeInputKeyEnum,
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
} from '../../constants';
|
||||
import { getNanoid } from '../../../../common/string/tools';
|
||||
import { getHandleConfig } from '../utils';
|
||||
import { FlowNodeInputItemType } from '../../type/io.d';
|
||||
import { type FlowNodeInputItemType } from '../../type/io.d';
|
||||
import { i18nT } from '../../../../../web/i18n/utils';
|
||||
|
||||
export const getOneQuoteInputTemplate = ({
|
||||
|
@@ -5,7 +5,7 @@ import {
|
||||
FlowNodeOutputTypeEnum,
|
||||
FlowNodeTypeEnum
|
||||
} from '../../node/constant';
|
||||
import { FlowNodeTemplateType } from '../../type/node';
|
||||
import { type FlowNodeTemplateType } from '../../type/node';
|
||||
import {
|
||||
WorkflowIOValueTypeEnum,
|
||||
NodeInputKeyEnum,
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { FlowNodeTypeEnum } from '../../node/constant';
|
||||
import { FlowNodeTemplateType } from '../../type/node';
|
||||
import { type FlowNodeTemplateType } from '../../type/node';
|
||||
import { FlowNodeTemplateTypeEnum } from '../../constants';
|
||||
import { getHandleConfig } from '../utils';
|
||||
|
||||
|
@@ -3,7 +3,7 @@ import {
|
||||
FlowNodeOutputTypeEnum,
|
||||
FlowNodeTypeEnum
|
||||
} from '../../node/constant';
|
||||
import { FlowNodeTemplateType } from '../../type/node.d';
|
||||
import { type FlowNodeTemplateType } from '../../type/node.d';
|
||||
import {
|
||||
WorkflowIOValueTypeEnum,
|
||||
NodeInputKeyEnum,
|
||||
|
@@ -10,7 +10,7 @@ import {
|
||||
FlowNodeOutputTypeEnum,
|
||||
FlowNodeTypeEnum
|
||||
} from '../../../node/constant';
|
||||
import { FlowNodeTemplateType } from '../../../type/node';
|
||||
import { type FlowNodeTemplateType } from '../../../type/node';
|
||||
import { getHandleConfig } from '../../utils';
|
||||
|
||||
export const IfElseNode: FlowNodeTemplateType = {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { ReferenceItemValueType } from '../../../type/io';
|
||||
import { VariableConditionEnum } from './constant';
|
||||
import type { ReferenceItemValueType } from '../../../type/io';
|
||||
import type { VariableConditionEnum } from './constant';
|
||||
|
||||
export type IfElseConditionType = 'AND' | 'OR';
|
||||
export type ConditionListItemType = {
|
||||
|
@@ -10,7 +10,7 @@ import {
|
||||
FlowNodeOutputTypeEnum,
|
||||
FlowNodeTypeEnum
|
||||
} from '../../../node/constant';
|
||||
import { FlowNodeTemplateType } from '../../../type/node';
|
||||
import { type FlowNodeTemplateType } from '../../../type/node';
|
||||
import { getHandleConfig } from '../../utils';
|
||||
|
||||
export const FormInputNode: FlowNodeTemplateType = {
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import type { NodeOutputItemType } from '../../../../chat/type';
|
||||
import type { FlowNodeOutputItemType } from '../../../type/io';
|
||||
import { FlowNodeInputTypeEnum } from 'core/workflow/node/constant';
|
||||
import { WorkflowIOValueTypeEnum } from 'core/workflow/constants';
|
||||
import type { FlowNodeInputTypeEnum } from 'core/workflow/node/constant';
|
||||
import type { WorkflowIOValueTypeEnum } from 'core/workflow/constants';
|
||||
import type { ChatCompletionMessageParam } from '../../../../ai/type';
|
||||
|
||||
type InteractiveBasicType = {
|
||||
|
@@ -10,7 +10,7 @@ import {
|
||||
FlowNodeOutputTypeEnum,
|
||||
FlowNodeTypeEnum
|
||||
} from '../../../node/constant';
|
||||
import { FlowNodeTemplateType } from '../../../type/node.d';
|
||||
import { type FlowNodeTemplateType } from '../../../type/node.d';
|
||||
import { getHandleConfig } from '../../utils';
|
||||
|
||||
export const UserSelectNode: FlowNodeTemplateType = {
|
||||
|
@@ -3,7 +3,7 @@ import {
|
||||
FlowNodeOutputTypeEnum,
|
||||
FlowNodeTypeEnum
|
||||
} from '../../node/constant';
|
||||
import { FlowNodeTemplateType } from '../../type/node.d';
|
||||
import { type FlowNodeTemplateType } from '../../type/node.d';
|
||||
import {
|
||||
WorkflowIOValueTypeEnum,
|
||||
NodeInputKeyEnum,
|
||||
|
@@ -3,7 +3,7 @@ import {
|
||||
FlowNodeOutputTypeEnum,
|
||||
FlowNodeTypeEnum
|
||||
} from '../../../node/constant';
|
||||
import { FlowNodeTemplateType } from '../../../type/node';
|
||||
import { type FlowNodeTemplateType } from '../../../type/node';
|
||||
import {
|
||||
FlowNodeTemplateTypeEnum,
|
||||
NodeInputKeyEnum,
|
||||
|
@@ -5,7 +5,7 @@ import {
|
||||
WorkflowIOValueTypeEnum
|
||||
} from '../../../constants';
|
||||
import { FlowNodeInputTypeEnum, FlowNodeTypeEnum } from '../../../node/constant';
|
||||
import { FlowNodeTemplateType } from '../../../type/node';
|
||||
import { type FlowNodeTemplateType } from '../../../type/node';
|
||||
import { getHandleConfig } from '../../utils';
|
||||
|
||||
export const LoopEndNode: FlowNodeTemplateType = {
|
||||
|
@@ -3,7 +3,7 @@ import {
|
||||
FlowNodeOutputTypeEnum,
|
||||
FlowNodeTypeEnum
|
||||
} from '../../../node/constant';
|
||||
import { FlowNodeTemplateType } from '../../../type/node.d';
|
||||
import { type FlowNodeTemplateType } from '../../../type/node.d';
|
||||
import {
|
||||
FlowNodeTemplateTypeEnum,
|
||||
NodeInputKeyEnum,
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { FlowNodeTypeEnum } from '../../node/constant';
|
||||
import { FlowNodeTemplateType } from '../../type/node.d';
|
||||
import { type FlowNodeTemplateType } from '../../type/node.d';
|
||||
import { FlowNodeTemplateTypeEnum } from '../../constants';
|
||||
import { getHandleConfig } from '../utils';
|
||||
import { i18nT } from '../../../../../web/i18n/utils';
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { i18nT } from '../../../../../web/i18n/utils';
|
||||
import { FlowNodeTemplateTypeEnum } from '../../constants';
|
||||
import { FlowNodeTypeEnum } from '../../node/constant';
|
||||
import { FlowNodeTemplateType } from '../../type/node';
|
||||
import { type FlowNodeTemplateType } from '../../type/node';
|
||||
import { getHandleConfig } from '../utils';
|
||||
|
||||
export const PluginInputModule: FlowNodeTemplateType = {
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { i18nT } from '../../../../../web/i18n/utils';
|
||||
import { FlowNodeTemplateTypeEnum } from '../../constants';
|
||||
import { FlowNodeTypeEnum } from '../../node/constant';
|
||||
import { FlowNodeTemplateType } from '../../type/node';
|
||||
import { type FlowNodeTemplateType } from '../../type/node';
|
||||
import { getHandleConfig } from '../utils';
|
||||
|
||||
export const PluginOutputModule: FlowNodeTemplateType = {
|
||||
|
@@ -3,7 +3,7 @@ import {
|
||||
FlowNodeOutputTypeEnum,
|
||||
FlowNodeTypeEnum
|
||||
} from '../../node/constant';
|
||||
import { FlowNodeTemplateType } from '../../type/node.d';
|
||||
import { type FlowNodeTemplateType } from '../../type/node.d';
|
||||
import {
|
||||
WorkflowIOValueTypeEnum,
|
||||
NodeInputKeyEnum,
|
||||
|
@@ -10,7 +10,7 @@ import {
|
||||
FlowNodeOutputTypeEnum,
|
||||
FlowNodeTypeEnum
|
||||
} from '../../../node/constant';
|
||||
import { FlowNodeTemplateType } from '../../../type/node';
|
||||
import { type FlowNodeTemplateType } from '../../../type/node';
|
||||
import { getHandleConfig } from '../../utils';
|
||||
|
||||
export const ReadFilesNode: FlowNodeTemplateType = {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { FlowNodeTemplateTypeEnum } from '../../constants';
|
||||
import { FlowNodeTypeEnum } from '../../node/constant';
|
||||
import { FlowNodeTemplateType } from '../../type/node';
|
||||
import { type FlowNodeTemplateType } from '../../type/node';
|
||||
import { getHandleConfig } from '../utils';
|
||||
|
||||
export const RunAppNode: FlowNodeTemplateType = {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { FlowNodeTemplateTypeEnum } from '../../constants';
|
||||
import { FlowNodeTypeEnum } from '../../node/constant';
|
||||
import { FlowNodeTemplateType } from '../../type/node';
|
||||
import { type FlowNodeTemplateType } from '../../type/node';
|
||||
import { getHandleConfig } from '../utils';
|
||||
|
||||
export const RunPluginModule: FlowNodeTemplateType = {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { FlowNodeTemplateTypeEnum } from '../../constants';
|
||||
import { FlowNodeTypeEnum } from '../../node/constant';
|
||||
import { FlowNodeTemplateType } from '../../type/node';
|
||||
import { type FlowNodeTemplateType } from '../../type/node';
|
||||
import { getHandleConfig } from '../utils';
|
||||
|
||||
export const RunToolNode: FlowNodeTemplateType = {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { FlowNodeTemplateTypeEnum } from '../../constants';
|
||||
import { FlowNodeTypeEnum } from '../../node/constant';
|
||||
import { FlowNodeTemplateType } from '../../type/node';
|
||||
import { type FlowNodeTemplateType } from '../../type/node';
|
||||
import { getHandleConfig } from '../utils';
|
||||
|
||||
export const RunToolSetNode: FlowNodeTemplateType = {
|
||||
|
@@ -9,7 +9,7 @@ import {
|
||||
FlowNodeOutputTypeEnum,
|
||||
FlowNodeTypeEnum
|
||||
} from '../../../node/constant';
|
||||
import { FlowNodeTemplateType } from '../../../type/node';
|
||||
import { type FlowNodeTemplateType } from '../../../type/node';
|
||||
import { getHandleConfig } from '../../utils';
|
||||
import { Input_Template_DynamicInput } from '../../input';
|
||||
import { Output_Template_AddOutput } from '../../output';
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { FlowNodeTypeEnum } from '../../node/constant';
|
||||
import { FlowNodeTemplateType } from '../../type/node';
|
||||
import { type FlowNodeTemplateType } from '../../type/node';
|
||||
import { FlowNodeTemplateTypeEnum } from '../../constants';
|
||||
import { getHandleConfig } from '../utils';
|
||||
import { i18nT } from '../../../../../web/i18n/utils';
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { FlowNodeTypeEnum } from '../../node/constant';
|
||||
import { FlowNodeTemplateType } from '../../type/node.d';
|
||||
import { type FlowNodeTemplateType } from '../../type/node.d';
|
||||
import { FlowNodeTemplateTypeEnum } from '../../constants';
|
||||
import { getHandleConfig } from '../utils';
|
||||
import { i18nT } from '../../../../../web/i18n/utils';
|
||||
|
@@ -3,7 +3,7 @@ import {
|
||||
FlowNodeOutputTypeEnum,
|
||||
FlowNodeTypeEnum
|
||||
} from '../../node/constant';
|
||||
import { FlowNodeTemplateType } from '../../type/node.d';
|
||||
import { type FlowNodeTemplateType } from '../../type/node.d';
|
||||
import {
|
||||
WorkflowIOValueTypeEnum,
|
||||
NodeOutputKeyEnum,
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { FlowNodeTypeEnum } from '../../node/constant';
|
||||
import { FlowNodeTemplateType } from '../../type/node';
|
||||
import { type FlowNodeTemplateType } from '../../type/node';
|
||||
import { FlowNodeTemplateTypeEnum } from '../../constants';
|
||||
import { getHandleConfig } from '../utils';
|
||||
import { i18nT } from '../../../../../web/i18n/utils';
|
||||
|
@@ -3,7 +3,7 @@ import {
|
||||
FlowNodeOutputTypeEnum,
|
||||
FlowNodeTypeEnum
|
||||
} from '../../node/constant';
|
||||
import { FlowNodeTemplateType } from '../../type/node.d';
|
||||
import { type FlowNodeTemplateType } from '../../type/node.d';
|
||||
import {
|
||||
WorkflowIOValueTypeEnum,
|
||||
NodeOutputKeyEnum,
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { FlowNodeInputTypeEnum, FlowNodeTypeEnum } from '../../../node/constant';
|
||||
import { FlowNodeTemplateType } from '../../../type/node.d';
|
||||
import { type FlowNodeTemplateType } from '../../../type/node.d';
|
||||
import {
|
||||
FlowNodeTemplateTypeEnum,
|
||||
NodeInputKeyEnum,
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { FlowNodeInputTypeEnum } from '../../../node/constant';
|
||||
import { ReferenceItemValueType, ReferenceValueType } from '../../..//type/io';
|
||||
import { WorkflowIOValueTypeEnum } from '../../../constants';
|
||||
import type { FlowNodeInputTypeEnum } from '../../../node/constant';
|
||||
import type { ReferenceItemValueType, ReferenceValueType } from '../../..//type/io';
|
||||
import type { WorkflowIOValueTypeEnum } from '../../../constants';
|
||||
|
||||
export type TUpdateListItem = {
|
||||
variable?: ReferenceItemValueType;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { FlowNodeOutputTypeEnum, FlowNodeTypeEnum } from '../../node/constant';
|
||||
import { FlowNodeTemplateType } from '../../type/node.d';
|
||||
import { type FlowNodeTemplateType } from '../../type/node.d';
|
||||
import {
|
||||
WorkflowIOValueTypeEnum,
|
||||
NodeOutputKeyEnum,
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
import { getHandleConfig } from '../utils';
|
||||
import { Input_Template_UserChatInput } from '../input';
|
||||
import { i18nT } from '../../../../../web/i18n/utils';
|
||||
import { FlowNodeOutputItemType } from '../../type/io';
|
||||
import { type FlowNodeOutputItemType } from '../../type/io';
|
||||
|
||||
export const userFilesInput: FlowNodeOutputItemType = {
|
||||
id: NodeOutputKeyEnum.userFiles,
|
||||
|
2
packages/global/core/workflow/type/edge.d.ts
vendored
2
packages/global/core/workflow/type/edge.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
import { RuntimeEdgeStatusEnum } from '../constants';
|
||||
import type { RuntimeEdgeStatusEnum } from '../constants';
|
||||
|
||||
export type StoreEdgeItemType = {
|
||||
source: string;
|
||||
|
2
packages/global/core/workflow/type/fe.d.ts
vendored
2
packages/global/core/workflow/type/fe.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
import { FlowNodeInputItemType, FlowNodeOutputItemType } from './io';
|
||||
import type { FlowNodeInputItemType, FlowNodeOutputItemType } from './io';
|
||||
|
||||
export type FlowNodeChangeProps = { nodeId: string } & (
|
||||
| {
|
||||
|
11
packages/global/core/workflow/type/index.d.ts
vendored
11
packages/global/core/workflow/type/index.d.ts
vendored
@@ -15,11 +15,12 @@ import {
|
||||
} from '../../chat/type';
|
||||
import { ChatNodeUsageType } from '../../../support/wallet/bill/type';
|
||||
import { PluginTypeEnum } from '../../plugin/constants';
|
||||
import { StoreEdgeItemType } from './edge';
|
||||
import { AppChatConfigType } from '../../app/type';
|
||||
import { ParentIdType } from 'common/parentFolder/type';
|
||||
import { AppTypeEnum } from 'core/app/constants';
|
||||
import { FlowNodeTemplateType, StoreNodeItemType } from './node';
|
||||
import type { StoreEdgeItemType } from './edge';
|
||||
import type { AppChatConfigType } from '../../app/type';
|
||||
import type { ParentIdType } from 'common/parentFolder/type';
|
||||
import type { AppTypeEnum } from 'core/app/constants';
|
||||
import type { StoreNodeItemType } from './node';
|
||||
import { FlowNodeTemplateType } from './node';
|
||||
|
||||
export type WorkflowTemplateBasicType = {
|
||||
nodes: StoreNodeItemType[];
|
||||
|
8
packages/global/core/workflow/type/io.d.ts
vendored
8
packages/global/core/workflow/type/io.d.ts
vendored
@@ -1,7 +1,7 @@
|
||||
import { LLMModelItemType } from '../../ai/model.d';
|
||||
import { LLMModelTypeEnum } from '../../ai/constants';
|
||||
import { WorkflowIOValueTypeEnum, NodeInputKeyEnum, NodeOutputKeyEnum } from '../constants';
|
||||
import { FlowNodeInputTypeEnum, FlowNodeOutputTypeEnum } from '../node/constant';
|
||||
import type { LLMModelItemType } from '../../ai/model.d';
|
||||
import type { LLMModelTypeEnum } from '../../ai/constants';
|
||||
import type { WorkflowIOValueTypeEnum, NodeInputKeyEnum, NodeOutputKeyEnum } from '../constants';
|
||||
import type { FlowNodeInputTypeEnum, FlowNodeOutputTypeEnum } from '../node/constant';
|
||||
|
||||
// Dynamic input field configuration
|
||||
export type CustomFieldConfigType = {
|
||||
|
10
packages/global/core/workflow/type/node.d.ts
vendored
10
packages/global/core/workflow/type/node.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
import { FlowNodeTypeEnum } from '../node/constant';
|
||||
import type { FlowNodeTypeEnum } from '../node/constant';
|
||||
import {
|
||||
WorkflowIOValueTypeEnum,
|
||||
NodeOutputKeyEnum,
|
||||
@@ -6,10 +6,10 @@ import {
|
||||
VariableInputEnum
|
||||
} from '../constants';
|
||||
import { DispatchNodeResponseKeyEnum } from '../runtime/constants';
|
||||
import { FlowNodeInputItemType, FlowNodeOutputItemType } from './io.d';
|
||||
import type { FlowNodeInputItemType, FlowNodeOutputItemType } from './io.d';
|
||||
import { UserModelSchema } from '../../../support/user/type';
|
||||
import type { ChatHistoryItemResType } from '../../chat/type';
|
||||
import {
|
||||
ChatHistoryItemResType,
|
||||
ChatItemType,
|
||||
ChatItemValueItemType,
|
||||
ToolRunResponseItemType,
|
||||
@@ -21,9 +21,9 @@ import { PluginTypeEnum } from '../../plugin/constants';
|
||||
import { RuntimeEdgeItemType, StoreEdgeItemType } from './edge';
|
||||
import { NextApiResponse } from 'next';
|
||||
import { AppDetailType, AppSchema } from '../../app/type';
|
||||
import { ParentIdType } from 'common/parentFolder/type';
|
||||
import type { ParentIdType } from 'common/parentFolder/type';
|
||||
import { AppTypeEnum } from 'core/app/constants';
|
||||
import { WorkflowInteractiveResponseType } from '../template/system/interactive/type';
|
||||
import type { WorkflowInteractiveResponseType } from '../template/system/interactive/type';
|
||||
|
||||
export type FlowNodeCommonType = {
|
||||
parentNodeId?: string;
|
||||
|
@@ -13,12 +13,12 @@ import {
|
||||
NodeOutputKeyEnum
|
||||
} from './constants';
|
||||
import {
|
||||
FlowNodeInputItemType,
|
||||
FlowNodeOutputItemType,
|
||||
ReferenceArrayValueType,
|
||||
ReferenceItemValueType
|
||||
type FlowNodeInputItemType,
|
||||
type FlowNodeOutputItemType,
|
||||
type ReferenceArrayValueType,
|
||||
type ReferenceItemValueType
|
||||
} from './type/io.d';
|
||||
import { StoreNodeItemType } from './type/node';
|
||||
import { type StoreNodeItemType } from './type/node';
|
||||
import type {
|
||||
VariableItemType,
|
||||
AppTTSConfigType,
|
||||
@@ -29,7 +29,7 @@ import type {
|
||||
AppAutoExecuteConfigType,
|
||||
AppQGConfigType
|
||||
} from '../app/type';
|
||||
import { EditorVariablePickerType } from '../../../web/components/common/Textarea/PromptEditor/type';
|
||||
import { type EditorVariablePickerType } from '../../../web/components/common/Textarea/PromptEditor/type';
|
||||
import {
|
||||
defaultAutoExecuteConfig,
|
||||
defaultChatInputGuideConfig,
|
||||
@@ -38,7 +38,7 @@ import {
|
||||
defaultWhisperConfig
|
||||
} from '../app/constants';
|
||||
import { IfElseResultEnum } from './template/system/ifElse/constant';
|
||||
import { RuntimeNodeItemType } from './runtime/type';
|
||||
import { type RuntimeNodeItemType } from './runtime/type';
|
||||
import {
|
||||
Input_Template_File_Link,
|
||||
Input_Template_History,
|
||||
@@ -46,7 +46,7 @@ import {
|
||||
Input_Template_UserChatInput
|
||||
} from './template/input';
|
||||
import { i18nT } from '../../../web/i18n/utils';
|
||||
import { RuntimeUserPromptType, UserChatItemType } from '../../core/chat/type';
|
||||
import { type RuntimeUserPromptType, type UserChatItemType } from '../../core/chat/type';
|
||||
import { getNanoid } from '../../common/string/tools';
|
||||
import { ChatRoleEnum } from '../../core/chat/constants';
|
||||
import { runtimePrompt2ChatsValue } from '../../core/chat/adapt';
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { SourceMemberType } from '../user/type';
|
||||
import { OperationLogEventEnum } from './constants';
|
||||
import type { SourceMemberType } from '../user/type';
|
||||
import type { OperationLogEventEnum } from './constants';
|
||||
|
||||
export type OperationLogSchema = {
|
||||
_id: string;
|
||||
|
2
packages/global/support/outLink/api.d.ts
vendored
2
packages/global/support/outLink/api.d.ts
vendored
@@ -1,5 +1,5 @@
|
||||
import type { HistoryItemType } from '../../core/chat/type.d';
|
||||
import { OutLinkSchema } from './type.d';
|
||||
import type { OutLinkSchema } from './type.d';
|
||||
|
||||
export type AuthOutLinkInitProps = {
|
||||
outLinkUid: string;
|
||||
|
2
packages/global/support/outLink/type.d.ts
vendored
2
packages/global/support/outLink/type.d.ts
vendored
@@ -1,5 +1,5 @@
|
||||
import { AppSchema } from '../../core/app/type';
|
||||
import { PublishChannelEnum } from './constant';
|
||||
import type { PublishChannelEnum } from './constant';
|
||||
import { RequireOnlyOne } from '../../common/type/utils';
|
||||
|
||||
// Feishu Config interface
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { NullPermission, PermissionKeyEnum, PermissionList } from '../constant';
|
||||
import { PermissionListType } from '../type';
|
||||
import { type PermissionListType } from '../type';
|
||||
import { i18nT } from '../../../../web/i18n/utils';
|
||||
export enum AppPermissionKeyEnum {}
|
||||
export const AppPermissionList: PermissionListType = {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { PerConstructPros, Permission } from '../controller';
|
||||
import { type PerConstructPros, Permission } from '../controller';
|
||||
import { AppDefaultPermissionVal } from './constant';
|
||||
|
||||
export class AppPermission extends Permission {
|
||||
|
@@ -1,6 +1,7 @@
|
||||
import { RequireAtLeastOne, RequireOnlyOne } from '../../common/type/utils';
|
||||
import { Permission } from './controller';
|
||||
import { PermissionValueType } from './type';
|
||||
import type { RequireOnlyOne } from '../../common/type/utils';
|
||||
import { RequireAtLeastOne } from '../../common/type/utils';
|
||||
import type { Permission } from './controller';
|
||||
import type { PermissionValueType } from './type';
|
||||
|
||||
export type CollaboratorItemType = {
|
||||
teamId: string;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { PermissionListType } from './type';
|
||||
import { type PermissionListType } from './type';
|
||||
import { i18nT } from '../../../web/i18n/utils';
|
||||
export enum AuthUserTypeEnum {
|
||||
token = 'token',
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user