* next 15

* lock

* feat: rename .d.ts to .ts for Next 15 compatibility

- Rename 104 .d.ts files to .ts (Next 15 no longer supports .d.ts in src)
- Remove 5 redundant .d.ts files that had .ts counterparts
- Update all import paths: remove .d suffix from 100 import statements
- Update tsconfig.json include patterns across all packages
- Add pnpm overrides to unify react@18.3.1 across monorepo
- Fix react version mismatch (packages/global and packages/service were resolving to react@19.1.1)

* fix: resolve 61 TypeScript errors from .d.ts to .ts migration

- Fix broken imports using non-relative module paths (e.g. 'support/user/team/type' → relative paths)
- Remove unused/dead imports referencing deleted modules
- Fix duplicate identifiers (show_emptyChat, concatMd, TrainingModeEnum)
- Add missing imports (BoxProps, GroupMemberRole, UsageSourceEnum, dashboard_evaluation)
- Fix generic type constraints (OutLinkEditType, createShareChat)
- Replace removed types with correct alternatives (ChatModelItemType → LLMModelItemType)
- Delete 5 dead code files with 0 references
- Add global type declaration for countTrackQueue
- Fix nullable type narrowing (sourceMember, ParentIdType, optional app fields)

* refactor: replace as ClientSession assertion with proper type narrowing via Omit & intersection

* fix: remove experimental.workerThreads to fix DataCloneError in Next 15 static generation

Next 15 worker threads attempt to structuredClone the config object,
which fails on the webpack function. workerThreads is not needed for
the build to work correctly.

* Update document/content/docs/upgrading/4-14/4148.mdx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix: ts

* update next config

* update next

* fix: dockerfile

* fix: comment

---------

Co-authored-by: Archer <c121914yu@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Archer
2026-02-25 18:28:16 +08:00
committed by GitHub
parent 37ce3cef07
commit 2e18f1ebc2
220 changed files with 630 additions and 1278 deletions
@@ -6,7 +6,7 @@ description: 'FastGPT V4.14.8 更新说明'
## 🚀 新增内容 ## 🚀 新增内容
1. Next.js 版本升级到 15。
## ⚙️ 优化 ## ⚙️ 优化
+4 -3
View File
@@ -20,7 +20,7 @@
"document/content/docs/introduction/development/custom-models/xinference.mdx": "2025-08-05T23:20:39+08:00", "document/content/docs/introduction/development/custom-models/xinference.mdx": "2025-08-05T23:20:39+08:00",
"document/content/docs/introduction/development/design/dataset.mdx": "2025-07-23T21:35:03+08:00", "document/content/docs/introduction/development/design/dataset.mdx": "2025-07-23T21:35:03+08:00",
"document/content/docs/introduction/development/design/design_plugin.mdx": "2025-11-06T14:47:55+08:00", "document/content/docs/introduction/development/design/design_plugin.mdx": "2025-11-06T14:47:55+08:00",
"document/content/docs/introduction/development/docker.mdx": "2026-02-12T20:12:18+08:00", "document/content/docs/introduction/development/docker.mdx": "2026-02-13T11:35:13+08:00",
"document/content/docs/introduction/development/faq.mdx": "2025-08-12T22:22:18+08:00", "document/content/docs/introduction/development/faq.mdx": "2025-08-12T22:22:18+08:00",
"document/content/docs/introduction/development/intro.mdx": "2026-02-12T18:02:02+08:00", "document/content/docs/introduction/development/intro.mdx": "2026-02-12T18:02:02+08:00",
"document/content/docs/introduction/development/migration/docker_db.mdx": "2025-07-23T21:35:03+08:00", "document/content/docs/introduction/development/migration/docker_db.mdx": "2025-07-23T21:35:03+08:00",
@@ -102,7 +102,7 @@
"document/content/docs/protocol/terms.en.mdx": "2025-12-15T23:36:54+08:00", "document/content/docs/protocol/terms.en.mdx": "2025-12-15T23:36:54+08:00",
"document/content/docs/protocol/terms.mdx": "2025-12-15T23:36:54+08:00", "document/content/docs/protocol/terms.mdx": "2025-12-15T23:36:54+08:00",
"document/content/docs/toc.en.mdx": "2026-02-12T18:02:02+08:00", "document/content/docs/toc.en.mdx": "2026-02-12T18:02:02+08:00",
"document/content/docs/toc.mdx": "2026-02-12T18:45:30+08:00", "document/content/docs/toc.mdx": "2026-02-24T13:48:31+08:00",
"document/content/docs/upgrading/4-10/4100.mdx": "2025-08-02T19:38:37+08:00", "document/content/docs/upgrading/4-10/4100.mdx": "2025-08-02T19:38:37+08:00",
"document/content/docs/upgrading/4-10/4101.mdx": "2025-09-08T20:07:20+08:00", "document/content/docs/upgrading/4-10/4101.mdx": "2025-09-08T20:07:20+08:00",
"document/content/docs/upgrading/4-11/4110.mdx": "2025-08-05T23:20:39+08:00", "document/content/docs/upgrading/4-11/4110.mdx": "2025-08-05T23:20:39+08:00",
@@ -124,6 +124,7 @@
"document/content/docs/upgrading/4-14/41451.mdx": "2026-01-20T11:53:27+08:00", "document/content/docs/upgrading/4-14/41451.mdx": "2026-01-20T11:53:27+08:00",
"document/content/docs/upgrading/4-14/4146.mdx": "2026-02-12T16:37:50+08:00", "document/content/docs/upgrading/4-14/4146.mdx": "2026-02-12T16:37:50+08:00",
"document/content/docs/upgrading/4-14/4147.mdx": "2026-02-13T11:23:02+08:00", "document/content/docs/upgrading/4-14/4147.mdx": "2026-02-13T11:23:02+08:00",
"document/content/docs/upgrading/4-14/4148.mdx": "2026-02-24T13:48:31+08:00",
"document/content/docs/upgrading/4-8/40.mdx": "2025-08-02T19:38:37+08:00", "document/content/docs/upgrading/4-8/40.mdx": "2025-08-02T19:38:37+08:00",
"document/content/docs/upgrading/4-8/41.mdx": "2025-08-02T19:38:37+08:00", "document/content/docs/upgrading/4-8/41.mdx": "2025-08-02T19:38:37+08:00",
"document/content/docs/upgrading/4-8/42.mdx": "2025-08-02T19:38:37+08:00", "document/content/docs/upgrading/4-8/42.mdx": "2025-08-02T19:38:37+08:00",
@@ -205,4 +206,4 @@
"document/content/docs/use-cases/external-integration/openapi.mdx": "2026-02-12T18:45:30+08:00", "document/content/docs/use-cases/external-integration/openapi.mdx": "2026-02-12T18:45:30+08:00",
"document/content/docs/use-cases/external-integration/wecom.mdx": "2025-12-10T20:07:05+08:00", "document/content/docs/use-cases/external-integration/wecom.mdx": "2025-12-10T20:07:05+08:00",
"document/content/docs/use-cases/index.mdx": "2025-07-24T14:23:04+08:00" "document/content/docs/use-cases/index.mdx": "2025-07-24T14:23:04+08:00"
} }
Vendored
-10
View File
@@ -1,10 +0,0 @@
declare global {
namespace NodeJS {
interface ProcessEnv {
DEFAULT_ROOT_PSW: string;
PRO_URL: string;
}
}
}
export {};
+8 -1
View File
@@ -24,7 +24,7 @@
"@typescript-eslint/parser": "^6.21.0", "@typescript-eslint/parser": "^6.21.0",
"@vitest/coverage-v8": "^3.0.9", "@vitest/coverage-v8": "^3.0.9",
"eslint": "^8.57.0", "eslint": "^8.57.0",
"eslint-config-next": "^14.1.0", "eslint-config-next": "^15.5.12",
"husky": "^8.0.3", "husky": "^8.0.3",
"i18next": "23.16.8", "i18next": "23.16.8",
"js-yaml": "^4.1.1", "js-yaml": "^4.1.1",
@@ -51,6 +51,13 @@
"git add ." "git add ."
] ]
}, },
"pnpm": {
"overrides": {
"react": "18.3.1",
"react-dom": "18.3.1",
"@types/react": "18.3.1"
}
},
"resolutions": { "resolutions": {
"mdast-util-gfm-autolink-literal": "2.0.0" "mdast-util-gfm-autolink-literal": "2.0.0"
}, },
@@ -1,11 +1,9 @@
import type { SubPlanType } from '../../../support/wallet/sub/type'; import type { SubPlanType } from '../../../support/wallet/sub/type';
import { StandSubPlanLevelMapType } from '../../../support/wallet/sub/type'; import { StandSubPlanLevelMapType } from '../../../support/wallet/sub/type';
import type { import type {
ChatModelItemType,
FunctionModelItemType,
LLMModelItemType, LLMModelItemType,
EmbeddingModelItemType, EmbeddingModelItemType,
AudioSpeechModels, TTSModelType,
STTModelType, STTModelType,
RerankModelItemType RerankModelItemType
} from '../../../core/ai/model.schema'; } from '../../../core/ai/model.schema';
@@ -34,7 +32,7 @@ export type FastGPTConfigFileType = {
subPlans?: SubPlanType; subPlans?: SubPlanType;
// Abandon // Abandon
llmModels?: ChatModelItemType[]; llmModels?: LLMModelItemType[];
vectorModels?: EmbeddingModelItemType[]; vectorModels?: EmbeddingModelItemType[];
reRankModels?: RerankModelItemType[]; reRankModels?: RerankModelItemType[];
audioSpeechModels?: TTSModelType[]; audioSpeechModels?: TTSModelType[];
@@ -55,7 +53,6 @@ export type FastGPTFeConfigsType = {
chineseRedirectUrl?: string; chineseRedirectUrl?: string;
botIframeUrl?: string; botIframeUrl?: string;
show_emptyChat?: boolean;
show_appStore?: boolean; show_appStore?: boolean;
show_git?: boolean; show_git?: boolean;
show_pay?: boolean; show_pay?: boolean;
@@ -67,7 +64,6 @@ export type FastGPTFeConfigsType = {
show_coupon?: boolean; show_coupon?: boolean;
show_discount_coupon?: boolean; show_discount_coupon?: boolean;
showWecomConfig?: boolean; showWecomConfig?: boolean;
concatMd?: string;
show_dataset_feishu?: boolean; show_dataset_feishu?: boolean;
show_dataset_yuque?: boolean; show_dataset_yuque?: boolean;
@@ -1,9 +1,5 @@
import type { RequireOnlyOne } from '../../common/type/utils'; import type { RequireOnlyOne } from '../../common/type/utils';
import { import { type UpdateClbPermissionProps } from '../../support/permission/collaborator';
type UpdateClbPermissionProps,
UpdatePermissionBody
} from '../../support/permission/collaborator';
import { PermissionValueType } from '../../support/permission/type';
export type UpdateAppCollaboratorBody = UpdateClbPermissionProps & { export type UpdateAppCollaboratorBody = UpdateClbPermissionProps & {
appId: string; appId: string;
-24
View File
@@ -1,24 +0,0 @@
import type { ParentIdType } from 'common/parentFolder/type';
import type { AppSchemaType } from './type';
import type { AppTypeEnum } from './constants';
export type CreateAppProps = {
parentId?: ParentIdType;
name?: string;
avatar?: string;
intro?: string;
type?: AppTypeEnum;
modules: AppSchemaType['modules'];
edges?: AppSchemaType['edges'];
};
export type CreateHttpPluginChildrenPros = Omit<CreateAppProps, 'type'> & {
parentId: ParentIdType;
name: string;
intro: string;
avatar: string;
modules: AppSchemaType['modules'];
edges: AppSchemaType['edges'];
pluginData: {
pluginUniId: string;
};
};
@@ -1,4 +1,4 @@
import type { PaginationProps } from '@fastgpt/web/common/fetch/type'; import type { PaginationProps } from '../../../openapi/api';
export type listEvaluationsBody = PaginationProps<{ export type listEvaluationsBody = PaginationProps<{
searchKey?: string; searchKey?: string;
@@ -1,14 +1,9 @@
import type { StoreEdgeItemType } from 'core/workflow/type/edge'; import type { StoreEdgeItemType } from '../../workflow/type/edge';
import { ModuleTemplateTypeEnum } from '../../workflow/constants';
import type { StoreNodeItemType } from '../../workflow/type/node'; import type { StoreNodeItemType } from '../../workflow/type/node';
import { MethodType } from './controller';
import type { FlowNodeTemplateType } from '../../workflow/type/node'; import type { FlowNodeTemplateType } from '../../workflow/type/node';
import type { WorkflowTemplateType } from '../../workflow/type'; import type { WorkflowTemplateType } from '../../workflow/type';
import type { FlowNodeInputItemType, FlowNodeOutputItemType } from '../../workflow/type/io'; import type { FlowNodeInputItemType, FlowNodeOutputItemType } from '../../workflow/type/io';
import type { ParentIdType } from 'common/parentFolder/type';
import type { I18nStringStrictType } from '../../../common/i18n/type';
import type { I18nStringType } from '../../../common/i18n/type'; import type { I18nStringType } from '../../../common/i18n/type';
import type { ToolSimpleType, ToolDetailType } from '../../../sdk/fastgpt-plugin';
import type { PluginStatusType, SystemPluginToolTagType } from '../../plugin/type'; import type { PluginStatusType, SystemPluginToolTagType } from '../../plugin/type';
import type { UserTagsEnum } from '../../../support/user/type'; import type { UserTagsEnum } from '../../../support/user/type';
@@ -1,17 +1,5 @@
import type { import type { ChunkSettingsType, DatasetDataIndexItemType, DatasetSchemaType } from './type';
ChunkSettingsType, import type { DatasetCollectionTypeEnum, DatasetCollectionDataProcessModeEnum } from './constants';
DatasetDataIndexItemType,
DatasetDataFieldType,
DatasetSchemaType
} from './type';
import type {
DatasetCollectionTypeEnum,
DatasetCollectionDataProcessModeEnum,
ChunkSettingModeEnum,
DataChunkSplitModeEnum,
ChunkTriggerConfigTypeEnum,
ParagraphChunkAIModeEnum
} from './constants';
import type { ParentIdType } from '../../common/parentFolder/type'; import type { ParentIdType } from '../../common/parentFolder/type';
import type { APIFileItemType } from './apiDataset/type'; import type { APIFileItemType } from './apiDataset/type';
@@ -1,5 +1,4 @@
import type { UpdateClbPermissionProps } from '../../support/permission/collaborator'; import type { UpdateClbPermissionProps } from '../../support/permission/collaborator';
import { PermissionValueType } from '../../support/permission/type';
import type { RequireOnlyOne } from '../../common/type/utils'; import type { RequireOnlyOne } from '../../common/type/utils';
export type UpdateDatasetCollaboratorBody = UpdateClbPermissionProps & { export type UpdateDatasetCollaboratorBody = UpdateClbPermissionProps & {
-21
View File
@@ -1,21 +0,0 @@
import type { PushDatasetDataChunkProps } from '../api';
import type { TrainingModeEnum } from '../constants';
export type PushDataToTrainingQueueProps = {
teamId: string;
tmbId: string;
datasetId: string;
collectionId: string;
data: PushDatasetDataChunkProps[];
mode?: TrainingModeEnum;
agentModel: string;
vectorModel: string;
vlmModel?: string;
indexSize?: number;
billId?: string;
session?: ClientSession;
};
@@ -20,9 +20,9 @@ import type {
FeishuServer, FeishuServer,
YuqueServer YuqueServer
} from './apiDataset/type'; } from './apiDataset/type';
import type { SourceMemberType } from 'support/user/type'; import type { SourceMemberType } from '../../support/user/type';
import type { DatasetDataIndexTypeEnum } from './data/constants'; import type { DatasetDataIndexTypeEnum } from './data/constants';
import type { ParentIdType } from 'common/parentFolder/type'; import type { ParentIdType } from '../../common/parentFolder/type';
export type ChunkSettingsType = { export type ChunkSettingsType = {
trainingType?: DatasetCollectionDataProcessModeEnum; trainingType?: DatasetCollectionDataProcessModeEnum;
+8
View File
@@ -1,3 +1,4 @@
import type { RequireOnlyOne } from '../common/type/utils';
import { z } from 'zod'; import { z } from 'zod';
export const PaginationSchema = z.object({ export const PaginationSchema = z.object({
@@ -7,6 +8,13 @@ export const PaginationSchema = z.object({
}); });
export type PaginationType = z.infer<typeof PaginationSchema>; export type PaginationType = z.infer<typeof PaginationSchema>;
export type PaginationProps<T = {}> = T & {
pageSize: number | string;
} & RequireOnlyOne<{
offset: number | string;
pageNum: number | string;
}>;
export const PaginationResponseSchema = <T extends z.ZodTypeAny>(itemSchema: T) => export const PaginationResponseSchema = <T extends z.ZodTypeAny>(itemSchema: T) =>
z.object({ z.object({
total: z.number().optional().default(0), total: z.number().optional().default(0),
+1 -1
View File
@@ -13,7 +13,7 @@
"jschardet": "3.1.1", "jschardet": "3.1.1",
"json5": "^2.2.3", "json5": "^2.2.3",
"nanoid": "^5.1.3", "nanoid": "^5.1.3",
"next": "14.2.35", "next": "15.5.12",
"openai": "4.61.0", "openai": "4.61.0",
"openapi-types": "^12.1.3", "openapi-types": "^12.1.3",
"timezones-list": "^3.0.2", "timezones-list": "^3.0.2",
@@ -1,7 +1,7 @@
import { z } from 'zod'; import { z } from 'zod';
import type { HistoryItemType } from '../../core/chat/type.d'; import type { HistoryItemType } from '../../core/chat/type';
import type { OutLinkSchema, PlaygroundVisibilityConfigType } from './type.d'; import type { OutLinkSchema, PlaygroundVisibilityConfigType } from './type';
import { PlaygroundVisibilityConfigSchema } from './type.d'; import { PlaygroundVisibilityConfigSchema } from './type';
export type AuthOutLinkInitProps = { export type AuthOutLinkInitProps = {
outLinkUid: string; outLinkUid: string;
@@ -1,7 +1,5 @@
import { z } from 'zod'; import { z } from 'zod';
import { AppSchema } from '../../core/app/type';
import type { PublishChannelEnum } from './constant'; import type { PublishChannelEnum } from './constant';
import { RequireOnlyOne } from '../../common/type/utils';
// Feishu Config interface // Feishu Config interface
export interface FeishuAppType { export interface FeishuAppType {
@@ -98,7 +96,7 @@ export type OutLinkSchema<T extends OutlinkAppType = undefined> = {
}; };
// Edit the Outlink // Edit the Outlink
export type OutLinkEditType<T = undefined> = { export type OutLinkEditType<T extends OutlinkAppType = undefined> = {
_id?: string; _id?: string;
name: string; name: string;
showCite?: OutLinkSchema<T>['showCite']; showCite?: OutLinkSchema<T>['showCite'];
@@ -1,8 +1,6 @@
import type { UpdateAppCollaboratorBody } from 'core/app/collaborator';
import type { RequireOnlyOne } from '../../common/type/utils'; import type { RequireOnlyOne } from '../../common/type/utils';
import { RequireAtLeastOne } from '../../common/type/utils';
import type { Permission } from './controller'; import type { Permission } from './controller';
import type { PermissionValueType, RoleValueType } from './type'; import type { PermissionValueType } from './type';
export type CollaboratorIdType = RequireOnlyOne<{ export type CollaboratorIdType = RequireOnlyOne<{
tmbId: string; tmbId: string;
@@ -9,7 +9,6 @@ import {
CommonPerList, CommonPerList,
CommonRoleList, CommonRoleList,
CommonRolePerMap, CommonRolePerMap,
NullPermissionVal,
NullRoleVal, NullRoleVal,
OwnerPermissionVal, OwnerPermissionVal,
OwnerRoleVal OwnerRoleVal
@@ -1,44 +0,0 @@
import { TeamMemberItemType } from 'support/user/team/type';
import { TeamPermission } from '../user/controller';
import type { GroupMemberRole } from './constant';
import type { Permission } from '../controller';
type MemberGroupSchemaType = {
_id: string;
teamId: string;
name: string;
avatar: string;
updateTime: Date;
};
type GroupMemberSchemaType = {
groupId: string;
tmbId: string;
role: `${GroupMemberRole}`;
};
type MemberGroupListItemType<WithMembers extends boolean | undefined> = MemberGroupSchemaType & {
members: WithMembers extends true
? {
tmbId: string;
name: string;
avatar: string;
}[]
: undefined;
count: WithMembers extends true ? number : undefined;
owner?: WithMembers extends true
? {
tmbId: string;
name: string;
avatar: string;
}
: undefined;
permission: WithMembers extends true ? Permission : undefined;
};
type GroupMemberItemType = {
tmbId: string;
name: string;
avatar: string;
role: `${GroupMemberRole}`;
};
@@ -0,0 +1,43 @@
import type { GroupMemberRole } from './constant';
import type { Permission } from '../controller';
export type MemberGroupSchemaType = {
_id: string;
teamId: string;
name: string;
avatar: string;
updateTime: Date;
};
export type GroupMemberSchemaType = {
groupId: string;
tmbId: string;
role: `${GroupMemberRole}`;
};
export type MemberGroupListItemType<WithMembers extends boolean | undefined> =
MemberGroupSchemaType & {
members: WithMembers extends true
? {
tmbId: string;
name: string;
avatar: string;
}[]
: undefined;
count: WithMembers extends true ? number : undefined;
owner?: WithMembers extends true
? {
tmbId: string;
name: string;
avatar: string;
}
: undefined;
permission: WithMembers extends true ? Permission : undefined;
};
export type GroupMemberItemType = {
tmbId: string;
name: string;
avatar: string;
role: `${GroupMemberRole}`;
};
@@ -1,4 +1,4 @@
import type { SourceMemberType } from '../user/type'; import type { SourceMemberType } from '../type';
import type { AuditEventEnum } from './constants'; import type { AuditEventEnum } from './constants';
export type TeamAuditSchemaType = { export type TeamAuditSchemaType = {
@@ -1,4 +1,4 @@
import type { UserAuthTypeEnum } from '@fastgpt/global/support/user/auth/constants'; import type { UserAuthTypeEnum } from './constants';
export type UserAuthSchemaType = { export type UserAuthSchemaType = {
key: string; key: string;
@@ -11,11 +11,6 @@ export type SendInform2UserProps = SendInformProps & {
teamId: string; teamId: string;
}; };
export type SendInform2User = SendInformProps & {
type: `${InformTypeEnum}`;
tmbId: string;
};
export type UserInformSchema = { export type UserInformSchema = {
_id: string; _id: string;
userId: string; userId: string;
@@ -1,8 +1,6 @@
import { PermissionValueType } from '../../permission/type';
import type { TeamMetaType } from '../type'; import type { TeamMetaType } from '../type';
import type { TeamMemberRoleEnum } from './constant'; import type { TeamMemberRoleEnum } from './constant';
import type { TeamMemberSchema, ThirdPartyAccountType } from './type'; import type { TeamMemberSchema, ThirdPartyAccountType } from './type';
import { LafAccountType } from './type';
export type AuthTeamRoleProps = { export type AuthTeamRoleProps = {
teamId: string; teamId: string;
@@ -1,8 +1,6 @@
import type { TeamPermission } from '../../../permission/user/controller'; import type { TeamPermission } from '../../../permission/user/controller';
import { ResourcePermissionType } from '../type';
import { SourceMemberType } from '../../type';
type OrgSchemaType = { export type OrgSchemaType = {
_id: string; _id: string;
teamId: string; teamId: string;
pathId: string; pathId: string;
@@ -13,7 +11,7 @@ type OrgSchemaType = {
updateTime: Date; updateTime: Date;
}; };
type OrgMemberSchemaType = { export type OrgMemberSchemaType = {
_id: string; _id: string;
teamId: string; teamId: string;
orgId: string; orgId: string;
@@ -1,7 +1,6 @@
import type { TeamMetaType, UserModelSchema } from '../type'; import type { TeamMetaType, UserModelSchema } from '../type';
import type { TeamMemberRoleEnum, TeamMemberStatusEnum } from './constant'; import type { TeamMemberRoleEnum, TeamMemberStatusEnum } from './constant';
import type { LafAccountType } from './type'; import type { GroupMemberRole } from '../../permission/memberGroup/constant';
import { PermissionValueType, ResourcePermissionType } from '../../permission/type';
import type { TeamPermission } from '../../permission/user/controller'; import type { TeamPermission } from '../../permission/user/controller';
export type ThirdPartyAccountType = { export type ThirdPartyAccountType = {
+1 -1
View File
@@ -3,5 +3,5 @@
"compilerOptions": { "compilerOptions": {
"baseUrl": "." "baseUrl": "."
}, },
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "**/*.d.ts"] "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"]
} }
+1 -1
View File
@@ -1,5 +1,5 @@
import { Schema, getMongoModel } from '../../../common/mongo'; import { Schema, getMongoModel } from '../../../common/mongo';
import { type TTSBufferSchemaType } from './type.d'; import { type TTSBufferSchemaType } from './type';
import { getLogger, LogCategories } from '../../logger'; import { getLogger, LogCategories } from '../../logger';
export const collectionName = 'buffer_tts'; export const collectionName = 'buffer_tts';
+1 -1
View File
@@ -1,6 +1,6 @@
import { TeamCollectionName } from '@fastgpt/global/support/user/team/constant'; import { TeamCollectionName } from '@fastgpt/global/support/user/team/constant';
import { Schema, getMongoModel } from '../../mongo'; import { Schema, getMongoModel } from '../../mongo';
import { type MongoImageSchemaType } from '@fastgpt/global/common/file/image/type.d'; import { type MongoImageSchemaType } from '@fastgpt/global/common/file/image/type';
import { getLogger, LogCategories } from '../../logger'; import { getLogger, LogCategories } from '../../logger';
const logger = getLogger(LogCategories.INFRA.MONGO); const logger = getLogger(LogCategories.INFRA.MONGO);
-17
View File
@@ -1,17 +0,0 @@
export type TracksQueueType = {
event: TrackEnum;
data: Record<string, any>;
};
declare global {
var countTrackQueue:
| Map<
string,
{
event: TrackEnum;
count: number;
data: Record<string, any>;
}
>
| undefined;
}
@@ -1,6 +1,6 @@
import { connectionMongo, getMongoModel } from '../../mongo'; import { connectionMongo, getMongoModel } from '../../mongo';
const { Schema } = connectionMongo; const { Schema } = connectionMongo;
import { type TimerLockSchemaType } from './type.d'; import { type TimerLockSchemaType } from './type';
import { getLogger, LogCategories } from '../../logger'; import { getLogger, LogCategories } from '../../logger';
export const collectionName = 'system_timer_locks'; export const collectionName = 'system_timer_locks';
@@ -2,7 +2,7 @@ import {
DatasetCollectionDataProcessModeEnum, DatasetCollectionDataProcessModeEnum,
DatasetCollectionTypeEnum DatasetCollectionTypeEnum
} from '@fastgpt/global/core/dataset/constants'; } from '@fastgpt/global/core/dataset/constants';
import type { CreateDatasetCollectionParams } from '@fastgpt/global/core/dataset/api.d'; import type { CreateDatasetCollectionParams } from '@fastgpt/global/core/dataset/api';
import { MongoDatasetCollection } from './schema'; import { MongoDatasetCollection } from './schema';
import type { import type {
DatasetCollectionSchemaType, DatasetCollectionSchemaType,
@@ -1,7 +1,7 @@
import { connectionMongo, getMongoModel } from '../../../common/mongo'; import { connectionMongo, getMongoModel } from '../../../common/mongo';
import { getLogger, LogCategories } from '../../../common/logger'; import { getLogger, LogCategories } from '../../../common/logger';
const { Schema } = connectionMongo; const { Schema } = connectionMongo;
import { type DatasetCollectionSchemaType } from '@fastgpt/global/core/dataset/type.d'; import { type DatasetCollectionSchemaType } from '@fastgpt/global/core/dataset/type';
import { DatasetCollectionTypeMap } from '@fastgpt/global/core/dataset/constants'; import { DatasetCollectionTypeMap } from '@fastgpt/global/core/dataset/constants';
import { ChunkSettings, DatasetCollectionName } from '../schema'; import { ChunkSettings, DatasetCollectionName } from '../schema';
import { import {
@@ -1,6 +1,6 @@
import { connectionMongo, getMongoModel } from '../../../common/mongo'; import { connectionMongo, getMongoModel } from '../../../common/mongo';
const { Schema } = connectionMongo; const { Schema } = connectionMongo;
import { type DatasetDataTextSchemaType } from '@fastgpt/global/core/dataset/type.d'; import { type DatasetDataTextSchemaType } from '@fastgpt/global/core/dataset/type';
import { TeamCollectionName } from '@fastgpt/global/support/user/team/constant'; import { TeamCollectionName } from '@fastgpt/global/support/user/team/constant';
import { DatasetCollectionName } from '../schema'; import { DatasetCollectionName } from '../schema';
import { DatasetColCollectionName } from '../collection/schema'; import { DatasetColCollectionName } from '../collection/schema';
+1 -1
View File
@@ -1,6 +1,6 @@
import { connectionMongo, getMongoModel } from '../../../common/mongo'; import { connectionMongo, getMongoModel } from '../../../common/mongo';
const { Schema, model, models } = connectionMongo; const { Schema, model, models } = connectionMongo;
import { type DatasetDataSchemaType } from '@fastgpt/global/core/dataset/type.d'; import { type DatasetDataSchemaType } from '@fastgpt/global/core/dataset/type';
import { import {
TeamCollectionName, TeamCollectionName,
TeamMemberCollectionName TeamMemberCollectionName
+1 -1
View File
@@ -12,7 +12,7 @@ import {
TeamCollectionName, TeamCollectionName,
TeamMemberCollectionName TeamMemberCollectionName
} from '@fastgpt/global/support/user/team/constant'; } from '@fastgpt/global/support/user/team/constant';
import type { DatasetSchemaType } from '@fastgpt/global/core/dataset/type.d'; import type { DatasetSchemaType } from '@fastgpt/global/core/dataset/type';
import { getLogger, LogCategories } from '../../common/logger'; import { getLogger, LogCategories } from '../../common/logger';
export const DatasetCollectionName = 'datasets'; export const DatasetCollectionName = 'datasets';
@@ -1,10 +1,12 @@
import { MongoDatasetTraining } from './schema'; import { MongoDatasetTraining } from './schema';
import type { PushDatasetDataResponse } from '@fastgpt/global/core/dataset/api.d'; import type {
PushDatasetDataChunkProps,
PushDatasetDataResponse
} from '@fastgpt/global/core/dataset/api';
import { TrainingModeEnum } from '@fastgpt/global/core/dataset/constants'; import { TrainingModeEnum } from '@fastgpt/global/core/dataset/constants';
import { type ClientSession } from '../../../common/mongo'; import { type ClientSession } from '../../../common/mongo';
import { getLLMModel, getEmbeddingModel, getVlmModel } from '../../ai/model'; import { getLLMModel, getEmbeddingModel, getVlmModel } from '../../ai/model';
import { mongoSessionRun } from '../../../common/mongo/sessionRun'; import { mongoSessionRun } from '../../../common/mongo/sessionRun';
import { type PushDataToTrainingQueueProps } from '@fastgpt/global/core/dataset/training/type';
import { i18nT } from '../../../../web/i18n/utils'; import { i18nT } from '../../../../web/i18n/utils';
import { getLLMMaxChunkSize } from '../../../../global/core/dataset/training/utils'; import { getLLMMaxChunkSize } from '../../../../global/core/dataset/training/utils';
import { retryFn } from '@fastgpt/global/common/system/utils'; import { retryFn } from '@fastgpt/global/common/system/utils';
@@ -38,7 +40,24 @@ export async function pushDataListToTrainingQueue({
mode = TrainingModeEnum.chunk, mode = TrainingModeEnum.chunk,
indexSize, indexSize,
session session
}: PushDataToTrainingQueueProps): Promise<PushDatasetDataResponse> { }: {
teamId: string;
tmbId: string;
datasetId: string;
collectionId: string;
data: PushDatasetDataChunkProps[];
mode?: TrainingModeEnum;
agentModel: string;
vectorModel: string;
vlmModel?: string;
indexSize?: number;
billId?: string;
session?: ClientSession;
}): Promise<PushDatasetDataResponse> {
const vectorModelData = getEmbeddingModel(vectorModel); const vectorModelData = getEmbeddingModel(vectorModel);
if (!vectorModelData) { if (!vectorModelData) {
return Promise.reject(i18nT('common:error_embedding_not_config')); return Promise.reject(i18nT('common:error_embedding_not_config'));
+1 -1
View File
@@ -50,7 +50,7 @@
"mongoose": "^8.10.1", "mongoose": "^8.10.1",
"multer": "2.0.2", "multer": "2.0.2",
"mysql2": "^3.11.3", "mysql2": "^3.11.3",
"next": "14.2.35", "next": "15.5.12",
"nextjs-cors": "^2.2.0", "nextjs-cors": "^2.2.0",
"node-cron": "^3.0.3", "node-cron": "^3.0.3",
"node-xlsx": "^0.24.0", "node-xlsx": "^0.24.0",
@@ -1,6 +1,6 @@
import { connectionMongo, getMongoModel, type Model } from '../../../common/mongo'; import { connectionMongo, getMongoModel, type Model } from '../../../common/mongo';
const { Schema, model, models } = connectionMongo; const { Schema, model, models } = connectionMongo;
import { type PromotionRecordSchema as PromotionRecordType } from '@fastgpt/global/support/activity/type.d'; import { type PromotionRecordSchema as PromotionRecordType } from '@fastgpt/global/support/activity/type';
const PromotionRecordSchema = new Schema({ const PromotionRecordSchema = new Schema({
userId: { userId: {
@@ -14,7 +14,6 @@ import { AppPermission } from '@fastgpt/global/support/permission/app/controller
import { type PermissionValueType } from '@fastgpt/global/support/permission/type'; import { type PermissionValueType } from '@fastgpt/global/support/permission/type';
import { AppFolderTypeList, AppTypeEnum } from '@fastgpt/global/core/app/constants'; import { AppFolderTypeList, AppTypeEnum } from '@fastgpt/global/core/app/constants';
import { type ParentIdType } from '@fastgpt/global/common/parentFolder/type'; import { type ParentIdType } from '@fastgpt/global/common/parentFolder/type';
import { AppToolSourceEnum } from '@fastgpt/global/core/app/tool/constants';
import { type AuthModeType, type AuthResponseType } from '../type'; import { type AuthModeType, type AuthResponseType } from '../type';
import { splitCombineToolId } from '@fastgpt/global/core/app/tool/utils'; import { splitCombineToolId } from '@fastgpt/global/core/app/tool/utils';
import { AppReadChatLogPerVal } from '@fastgpt/global/support/permission/app/constant'; import { AppReadChatLogPerVal } from '@fastgpt/global/support/permission/app/constant';
@@ -2,7 +2,7 @@ import type { ClientSession, AnyBulkWriteOperation } from '../../common/mongo';
import type { PerResourceTypeEnum } from '@fastgpt/global/support/permission/constant'; import type { PerResourceTypeEnum } from '@fastgpt/global/support/permission/constant';
import { ManageRoleVal, OwnerRoleVal } from '@fastgpt/global/support/permission/constant'; import { ManageRoleVal, OwnerRoleVal } from '@fastgpt/global/support/permission/constant';
import { MongoResourcePermission } from './schema'; import { MongoResourcePermission } from './schema';
import type { ResourcePermissionType, ResourceType } from '@fastgpt/global/support/permission/type'; import type { ResourcePermissionType } from '@fastgpt/global/support/permission/type';
import { type PermissionValueType } from '@fastgpt/global/support/permission/type'; import { type PermissionValueType } from '@fastgpt/global/support/permission/type';
import { getGroupsByTmbId } from './memberGroup/controllers'; import { getGroupsByTmbId } from './memberGroup/controllers';
import { Permission } from '@fastgpt/global/support/permission/controller'; import { Permission } from '@fastgpt/global/support/permission/controller';
@@ -1,6 +1,6 @@
import { connectionMongo, getMongoModel } from '../../../common/mongo'; import { connectionMongo, getMongoModel } from '../../../common/mongo';
const { Schema } = connectionMongo; const { Schema } = connectionMongo;
import { type TeamMemberSchema as TeamMemberType } from '@fastgpt/global/support/user/team/type.d'; import { type TeamMemberSchema as TeamMemberType } from '@fastgpt/global/support/user/team/type';
import { userCollectionName } from '../../user/schema'; import { userCollectionName } from '../../user/schema';
import { import {
TeamMemberStatusMap, TeamMemberStatusMap,
@@ -1,6 +1,6 @@
import { connectionMongo, getMongoModel } from '../../../common/mongo'; import { connectionMongo, getMongoModel } from '../../../common/mongo';
const { Schema } = connectionMongo; const { Schema } = connectionMongo;
import { type TeamSchema as TeamType } from '@fastgpt/global/support/user/team/type.d'; import { type TeamSchema as TeamType } from '@fastgpt/global/support/user/team/type';
import { userCollectionName } from '../../user/schema'; import { userCollectionName } from '../../user/schema';
import { TeamCollectionName } from '@fastgpt/global/support/user/team/constant'; import { TeamCollectionName } from '@fastgpt/global/support/user/team/constant';
import { getLogger, LogCategories } from '../../../common/logger'; import { getLogger, LogCategories } from '../../../common/logger';
@@ -1,6 +1,6 @@
import { connectionMongo, getMongoModel, type Model } from '../../../common/mongo'; import { connectionMongo, getMongoModel, type Model } from '../../../common/mongo';
const { Schema, model, models } = connectionMongo; const { Schema, model, models } = connectionMongo;
import { type TeamTagSchema as TeamTagsSchemaType } from '@fastgpt/global/support/user/team/type.d'; import { type TeamTagSchema as TeamTagsSchemaType } from '@fastgpt/global/support/user/team/type';
import { import {
TeamCollectionName, TeamCollectionName,
TeamTagsCollectionName TeamTagsCollectionName
+1 -1
View File
@@ -4,5 +4,5 @@
"baseUrl": ".", "baseUrl": ".",
"moduleResolution": "bundler" "moduleResolution": "bundler"
}, },
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "**/*.d.ts", "../../**/*.d.ts"] "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"]
} }
@@ -1,6 +1,10 @@
declare global { declare global {
var countTrackQueue: Map<string, { event: string; count: number; data: Record<string, any> }>;
namespace NodeJS { namespace NodeJS {
interface ProcessEnv { interface ProcessEnv {
DEFAULT_ROOT_PSW: string;
PRO_URL: string;
LOG_DEPTH: string; LOG_DEPTH: string;
DB_MAX_LINK: string; DB_MAX_LINK: string;
FILE_TOKEN_KEY: string; FILE_TOKEN_KEY: string;
@@ -33,15 +37,11 @@ declare global {
SHOW_COUPON?: string; SHOW_COUPON?: string;
SHOW_DISCOUNT_COUPON?: string; SHOW_DISCOUNT_COUPON?: string;
CONFIG_JSON_PATH?: string; CONFIG_JSON_PATH?: string;
PASSWORD_LOGIN_LOCK_SECONDS?: string; PASSWORD_LOGIN_LOCK_SECONDS?: string; // 密码登录锁定时间
PASSWORD_EXPIRED_MONTH?: string; PASSWORD_EXPIRED_MONTH?: string;
MAX_LOGIN_SESSION?: string; MAX_LOGIN_SESSION?: string;
CHAT_MAX_QPM?: string; CHAT_MAX_QPM?: string;
// 安全配置
// 密码登录锁定时间
PASSWORD_LOGIN_LOCK_SECONDS?: string;
CHAT_LOG_URL?: string; CHAT_LOG_URL?: string;
CHAT_LOG_INTERVAL?: string; CHAT_LOG_INTERVAL?: string;
CHAT_LOG_SOURCE_ID_PREFIX?: string; CHAT_LOG_SOURCE_ID_PREFIX?: string;
@@ -1,5 +1,3 @@
import { ReadFileByBufferParams } from '../../common/file/read/type';
export type ReadRawTextProps<T> = { export type ReadRawTextProps<T> = {
extension: string; extension: string;
buffer: T; buffer: T;
-27
View File
@@ -1,27 +0,0 @@
import type { RequireOnlyOne } from '@fastgpt/global/common/type/utils';
export type PaginationProps<T = {}> = T & {
pageSize: number | string;
} & RequireOnlyOne<{
offset: number | string;
pageNum: number | string;
}>;
export type PaginationResponse<T = {}> = {
total: number;
list: T[];
};
type LinkedPaginationProps<T = {}, A = any> = T & {
pageSize: number;
anchor?: A;
initialId?: string;
nextId?: string;
prevId?: string;
};
type LinkedListResponse<T = {}, A = any> = {
list: Array<T & { id: string; anchor?: A }>;
hasMorePrev: boolean;
hasMoreNext: boolean;
};
+16
View File
@@ -0,0 +1,16 @@
import type { PaginationProps, PaginationResponseType } from '@fastgpt/global/openapi/api';
export type { PaginationProps, PaginationResponseType as PaginationResponse };
export type LinkedPaginationProps<T = {}, A = any> = T & {
pageSize: number;
anchor?: A;
initialId?: string;
nextId?: string;
prevId?: string;
};
export type LinkedListResponse<T = {}, A = any> = {
list: Array<T & { id: string; anchor?: A }>;
hasMorePrev: boolean;
hasMoreNext: boolean;
};
@@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react';
import type { IconProps } from '@chakra-ui/react'; import type { IconProps } from '@chakra-ui/react';
import { Box, Icon } from '@chakra-ui/react'; import { Box, Icon } from '@chakra-ui/react';
import { iconPaths } from './constants'; import { iconPaths } from './constants';
import type { IconNameType } from './type.d'; import type { IconNameType } from './type';
const iconCache: Record<string, any> = {}; const iconCache: Record<string, any> = {};
@@ -1,6 +1,6 @@
import type { ButtonProps } from '@chakra-ui/react'; import type { ButtonProps } from '@chakra-ui/react';
type ListItemType = { export type ListItemType = {
alias?: string; alias?: string;
label: string | React.ReactNode; label: string | React.ReactNode;
value: any; value: any;
@@ -9,7 +9,7 @@ import { useTranslation } from 'next-i18next';
import MyIcon from '../../../../Icon'; import MyIcon from '../../../../Icon';
import { Box, Flex } from '@chakra-ui/react'; import { Box, Flex } from '@chakra-ui/react';
import { useBasicTypeaheadTriggerMatch } from '../../utils'; import { useBasicTypeaheadTriggerMatch } from '../../utils';
import { type EditorVariablePickerType } from '../../type.d'; import { type EditorVariablePickerType } from '../../type';
export default function VariablePickerPlugin({ export default function VariablePickerPlugin({
variables variables

Some files were not shown because too many files have changed in this diff Show More