Commit 2e18f1eb by Archer Committed by GitHub

next 15 (#6457)

* 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>
parent 37ce3cef
......@@ -6,7 +6,7 @@ description: 'FastGPT V4.14.8 更新说明'
## 🚀 新增内容
1. Next.js 版本升级到 15。
## ⚙️ 优化
......
......@@ -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/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/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/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",
......@@ -102,7 +102,7 @@
"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/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/4101.mdx": "2025-09-08T20:07:20+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/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/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/41.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/wecom.mdx": "2025-12-10T20:07:05+08:00",
"document/content/docs/use-cases/index.mdx": "2025-07-24T14:23:04+08:00"
}
}
\ No newline at end of file
declare global {
namespace NodeJS {
interface ProcessEnv {
DEFAULT_ROOT_PSW: string;
PRO_URL: string;
}
}
}
export {};
......@@ -24,7 +24,7 @@
"@typescript-eslint/parser": "^6.21.0",
"@vitest/coverage-v8": "^3.0.9",
"eslint": "^8.57.0",
"eslint-config-next": "^14.1.0",
"eslint-config-next": "^15.5.12",
"husky": "^8.0.3",
"i18next": "23.16.8",
"js-yaml": "^4.1.1",
......@@ -51,6 +51,13 @@
"git add ."
]
},
"pnpm": {
"overrides": {
"react": "18.3.1",
"react-dom": "18.3.1",
"@types/react": "18.3.1"
}
},
"resolutions": {
"mdast-util-gfm-autolink-literal": "2.0.0"
},
......
import type { SubPlanType } from '../../../support/wallet/sub/type';
import { StandSubPlanLevelMapType } from '../../../support/wallet/sub/type';
import type {
ChatModelItemType,
FunctionModelItemType,
LLMModelItemType,
EmbeddingModelItemType,
AudioSpeechModels,
TTSModelType,
STTModelType,
RerankModelItemType
} from '../../../core/ai/model.schema';
......@@ -34,7 +32,7 @@ export type FastGPTConfigFileType = {
subPlans?: SubPlanType;
// Abandon
llmModels?: ChatModelItemType[];
llmModels?: LLMModelItemType[];
vectorModels?: EmbeddingModelItemType[];
reRankModels?: RerankModelItemType[];
audioSpeechModels?: TTSModelType[];
......@@ -55,7 +53,6 @@ export type FastGPTFeConfigsType = {
chineseRedirectUrl?: string;
botIframeUrl?: string;
show_emptyChat?: boolean;
show_appStore?: boolean;
show_git?: boolean;
show_pay?: boolean;
......@@ -67,7 +64,6 @@ export type FastGPTFeConfigsType = {
show_coupon?: boolean;
show_discount_coupon?: boolean;
showWecomConfig?: boolean;
concatMd?: string;
show_dataset_feishu?: boolean;
show_dataset_yuque?: boolean;
......
import type { RequireOnlyOne } from '../../common/type/utils';
import {
type UpdateClbPermissionProps,
UpdatePermissionBody
} from '../../support/permission/collaborator';
import { PermissionValueType } from '../../support/permission/type';
import { type UpdateClbPermissionProps } from '../../support/permission/collaborator';
export type UpdateAppCollaboratorBody = UpdateClbPermissionProps & {
appId: string;
......
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;
};
};
import type { PaginationProps } from '@fastgpt/web/common/fetch/type';
import type { PaginationProps } from '../../../openapi/api';
export type listEvaluationsBody = PaginationProps<{
searchKey?: string;
......
import type { StoreEdgeItemType } from 'core/workflow/type/edge';
import { ModuleTemplateTypeEnum } from '../../workflow/constants';
import type { StoreEdgeItemType } from '../../workflow/type/edge';
import type { StoreNodeItemType } from '../../workflow/type/node';
import { MethodType } from './controller';
import type { FlowNodeTemplateType } from '../../workflow/type/node';
import type { WorkflowTemplateType } from '../../workflow/type';
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 { ToolSimpleType, ToolDetailType } from '../../../sdk/fastgpt-plugin';
import type { PluginStatusType, SystemPluginToolTagType } from '../../plugin/type';
import type { UserTagsEnum } from '../../../support/user/type';
......
import type {
ChunkSettingsType,
DatasetDataIndexItemType,
DatasetDataFieldType,
DatasetSchemaType
} from './type';
import type {
DatasetCollectionTypeEnum,
DatasetCollectionDataProcessModeEnum,
ChunkSettingModeEnum,
DataChunkSplitModeEnum,
ChunkTriggerConfigTypeEnum,
ParagraphChunkAIModeEnum
} from './constants';
import type { ChunkSettingsType, DatasetDataIndexItemType, DatasetSchemaType } from './type';
import type { DatasetCollectionTypeEnum, DatasetCollectionDataProcessModeEnum } from './constants';
import type { ParentIdType } from '../../common/parentFolder/type';
import type { APIFileItemType } from './apiDataset/type';
......
import type { UpdateClbPermissionProps } from '../../support/permission/collaborator';
import { PermissionValueType } from '../../support/permission/type';
import type { RequireOnlyOne } from '../../common/type/utils';
export type UpdateDatasetCollaboratorBody = UpdateClbPermissionProps & {
......
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,
YuqueServer
} 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 { ParentIdType } from 'common/parentFolder/type';
import type { ParentIdType } from '../../common/parentFolder/type';
export type ChunkSettingsType = {
trainingType?: DatasetCollectionDataProcessModeEnum;
......
import type { RequireOnlyOne } from '../common/type/utils';
import { z } from 'zod';
export const PaginationSchema = z.object({
......@@ -7,6 +8,13 @@ export const PaginationSchema = z.object({
});
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) =>
z.object({
total: z.number().optional().default(0),
......
......@@ -13,7 +13,7 @@
"jschardet": "3.1.1",
"json5": "^2.2.3",
"nanoid": "^5.1.3",
"next": "14.2.35",
"next": "15.5.12",
"openai": "4.61.0",
"openapi-types": "^12.1.3",
"timezones-list": "^3.0.2",
......
import { z } from 'zod';
import type { HistoryItemType } from '../../core/chat/type.d';
import type { OutLinkSchema, PlaygroundVisibilityConfigType } from './type.d';
import { PlaygroundVisibilityConfigSchema } from './type.d';
import type { HistoryItemType } from '../../core/chat/type';
import type { OutLinkSchema, PlaygroundVisibilityConfigType } from './type';
import { PlaygroundVisibilityConfigSchema } from './type';
export type AuthOutLinkInitProps = {
outLinkUid: string;
......
import { z } from 'zod';
import { AppSchema } from '../../core/app/type';
import type { PublishChannelEnum } from './constant';
import { RequireOnlyOne } from '../../common/type/utils';
// Feishu Config interface
export interface FeishuAppType {
......@@ -98,7 +96,7 @@ export type OutLinkSchema<T extends OutlinkAppType = undefined> = {
};
// Edit the Outlink
export type OutLinkEditType<T = undefined> = {
export type OutLinkEditType<T extends OutlinkAppType = undefined> = {
_id?: string;
name: string;
showCite?: OutLinkSchema<T>['showCite'];
......
import type { UpdateAppCollaboratorBody } from 'core/app/collaborator';
import type { RequireOnlyOne } from '../../common/type/utils';
import { RequireAtLeastOne } from '../../common/type/utils';
import type { Permission } from './controller';
import type { PermissionValueType, RoleValueType } from './type';
import type { PermissionValueType } from './type';
export type CollaboratorIdType = RequireOnlyOne<{
tmbId: string;
......
......@@ -9,7 +9,6 @@ import {
CommonPerList,
CommonRoleList,
CommonRolePerMap,
NullPermissionVal,
NullRoleVal,
OwnerPermissionVal,
OwnerRoleVal
......
import { TeamMemberItemType } from 'support/user/team/type';
import { TeamPermission } from '../user/controller';
import type { GroupMemberRole } from './constant';
import type { Permission } from '../controller';
type MemberGroupSchemaType = {
export type MemberGroupSchemaType = {
_id: string;
teamId: string;
name: string;
......@@ -11,32 +9,33 @@ type MemberGroupSchemaType = {
updateTime: Date;
};
type GroupMemberSchemaType = {
export 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;
};
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;
};
type GroupMemberItemType = {
export type GroupMemberItemType = {
tmbId: string;
name: string;
avatar: string;
......
import type { SourceMemberType } from '../user/type';
import type { SourceMemberType } from '../type';
import type { AuditEventEnum } from './constants';
export type TeamAuditSchemaType = {
......
import type { UserAuthTypeEnum } from '@fastgpt/global/support/user/auth/constants';
import type { UserAuthTypeEnum } from './constants';
export type UserAuthSchemaType = {
key: string;
......
......@@ -11,11 +11,6 @@ export type SendInform2UserProps = SendInformProps & {
teamId: string;
};
export type SendInform2User = SendInformProps & {
type: `${InformTypeEnum}`;
tmbId: string;
};
export type UserInformSchema = {
_id: string;
userId: string;
......
import { PermissionValueType } from '../../permission/type';
import type { TeamMetaType } from '../type';
import type { TeamMemberRoleEnum } from './constant';
import type { TeamMemberSchema, ThirdPartyAccountType } from './type';
import { LafAccountType } from './type';
export type AuthTeamRoleProps = {
teamId: string;
......
import type { TeamPermission } from '../../../permission/user/controller';
import { ResourcePermissionType } from '../type';
import { SourceMemberType } from '../../type';
type OrgSchemaType = {
export type OrgSchemaType = {
_id: string;
teamId: string;
pathId: string;
......@@ -13,7 +11,7 @@ type OrgSchemaType = {
updateTime: Date;
};
type OrgMemberSchemaType = {
export type OrgMemberSchemaType = {
_id: string;
teamId: string;
orgId: string;
......
import type { TeamMetaType, UserModelSchema } from '../type';
import type { TeamMemberRoleEnum, TeamMemberStatusEnum } from './constant';
import type { LafAccountType } from './type';
import { PermissionValueType, ResourcePermissionType } from '../../permission/type';
import type { GroupMemberRole } from '../../permission/memberGroup/constant';
import type { TeamPermission } from '../../permission/user/controller';
export type ThirdPartyAccountType = {
......
......@@ -3,5 +3,5 @@
"compilerOptions": {
"baseUrl": "."
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "**/*.d.ts"]
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"]
}
import { Schema, getMongoModel } from '../../../common/mongo';
import { type TTSBufferSchemaType } from './type.d';
import { type TTSBufferSchemaType } from './type';
import { getLogger, LogCategories } from '../../logger';
export const collectionName = 'buffer_tts';
......
import { TeamCollectionName } from '@fastgpt/global/support/user/team/constant';
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';
const logger = getLogger(LogCategories.INFRA.MONGO);
......
export type TracksQueueType = {
event: TrackEnum;
data: Record<string, any>;
};
declare global {
var countTrackQueue:
| Map<
string,
{
event: TrackEnum;
count: number;
data: Record<string, any>;
}
>
| undefined;
}
import { connectionMongo, getMongoModel } from '../../mongo';
const { Schema } = connectionMongo;
import { type TimerLockSchemaType } from './type.d';
import { type TimerLockSchemaType } from './type';
import { getLogger, LogCategories } from '../../logger';
export const collectionName = 'system_timer_locks';
......
......@@ -2,7 +2,7 @@ import {
DatasetCollectionDataProcessModeEnum,
DatasetCollectionTypeEnum
} 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 type {
DatasetCollectionSchemaType,
......
import { connectionMongo, getMongoModel } from '../../../common/mongo';
import { getLogger, LogCategories } from '../../../common/logger';
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 { ChunkSettings, DatasetCollectionName } from '../schema';
import {
......
import { connectionMongo, getMongoModel } from '../../../common/mongo';
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 { DatasetCollectionName } from '../schema';
import { DatasetColCollectionName } from '../collection/schema';
......
import { connectionMongo, getMongoModel } from '../../../common/mongo';
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 {
TeamCollectionName,
TeamMemberCollectionName
......
......@@ -12,7 +12,7 @@ import {
TeamCollectionName,
TeamMemberCollectionName
} 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';
export const DatasetCollectionName = 'datasets';
......
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 { type ClientSession } from '../../../common/mongo';
import { getLLMModel, getEmbeddingModel, getVlmModel } from '../../ai/model';
import { mongoSessionRun } from '../../../common/mongo/sessionRun';
import { type PushDataToTrainingQueueProps } from '@fastgpt/global/core/dataset/training/type';
import { i18nT } from '../../../../web/i18n/utils';
import { getLLMMaxChunkSize } from '../../../../global/core/dataset/training/utils';
import { retryFn } from '@fastgpt/global/common/system/utils';
......@@ -38,7 +40,24 @@ export async function pushDataListToTrainingQueue({
mode = TrainingModeEnum.chunk,
indexSize,
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);
if (!vectorModelData) {
return Promise.reject(i18nT('common:error_embedding_not_config'));
......
......@@ -50,7 +50,7 @@
"mongoose": "^8.10.1",
"multer": "2.0.2",
"mysql2": "^3.11.3",
"next": "14.2.35",
"next": "15.5.12",
"nextjs-cors": "^2.2.0",
"node-cron": "^3.0.3",
"node-xlsx": "^0.24.0",
......
import { connectionMongo, getMongoModel, type Model } from '../../../common/mongo';
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({
userId: {
......
......@@ -14,7 +14,6 @@ import { AppPermission } from '@fastgpt/global/support/permission/app/controller
import { type PermissionValueType } from '@fastgpt/global/support/permission/type';
import { AppFolderTypeList, AppTypeEnum } from '@fastgpt/global/core/app/constants';
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 { splitCombineToolId } from '@fastgpt/global/core/app/tool/utils';
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 { ManageRoleVal, OwnerRoleVal } from '@fastgpt/global/support/permission/constant';
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 { getGroupsByTmbId } from './memberGroup/controllers';
import { Permission } from '@fastgpt/global/support/permission/controller';
......
import { connectionMongo, getMongoModel } from '../../../common/mongo';
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 {
TeamMemberStatusMap,
......
import { connectionMongo, getMongoModel } from '../../../common/mongo';
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 { TeamCollectionName } from '@fastgpt/global/support/user/team/constant';
import { getLogger, LogCategories } from '../../../common/logger';
......
import { connectionMongo, getMongoModel, type Model } from '../../../common/mongo';
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 {
TeamCollectionName,
TeamTagsCollectionName
......
......@@ -4,5 +4,5 @@
"baseUrl": ".",
"moduleResolution": "bundler"
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "**/*.d.ts", "../../**/*.d.ts"]
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"]
}
declare global {
var countTrackQueue: Map<string, { event: string; count: number; data: Record<string, any> }>;
namespace NodeJS {
interface ProcessEnv {
DEFAULT_ROOT_PSW: string;
PRO_URL: string;
LOG_DEPTH: string;
DB_MAX_LINK: string;
FILE_TOKEN_KEY: string;
......@@ -33,15 +37,11 @@ declare global {
SHOW_COUPON?: string;
SHOW_DISCOUNT_COUPON?: string;
CONFIG_JSON_PATH?: string;
PASSWORD_LOGIN_LOCK_SECONDS?: string;
PASSWORD_LOGIN_LOCK_SECONDS?: string; // 密码登录锁定时间
PASSWORD_EXPIRED_MONTH?: string;
MAX_LOGIN_SESSION?: string;
CHAT_MAX_QPM?: string;
// 安全配置
// 密码登录锁定时间
PASSWORD_LOGIN_LOCK_SECONDS?: string;
CHAT_LOG_URL?: string;
CHAT_LOG_INTERVAL?: string;
CHAT_LOG_SOURCE_ID_PREFIX?: string;
......
import { ReadFileByBufferParams } from '../../common/file/read/type';
export type ReadRawTextProps<T> = {
extension: string;
buffer: T;
......
import type { RequireOnlyOne } from '@fastgpt/global/common/type/utils';
import type { PaginationProps, PaginationResponseType } from '@fastgpt/global/openapi/api';
export type { PaginationProps, PaginationResponseType as PaginationResponse };
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 & {
export type LinkedPaginationProps<T = {}, A = any> = T & {
pageSize: number;
anchor?: A;
initialId?: string;
......@@ -20,7 +9,7 @@ type LinkedPaginationProps<T = {}, A = any> = T & {
prevId?: string;
};
type LinkedListResponse<T = {}, A = any> = {
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 { Box, Icon } from '@chakra-ui/react';
import { iconPaths } from './constants';
import type { IconNameType } from './type.d';
import type { IconNameType } from './type';
const iconCache: Record<string, any> = {};
......
import type { ButtonProps } from '@chakra-ui/react';
type ListItemType = {
export type ListItemType = {
alias?: string;
label: string | React.ReactNode;
value: any;
......
......@@ -9,7 +9,7 @@ import { useTranslation } from 'next-i18next';
import MyIcon from '../../../../Icon';
import { Box, Flex } from '@chakra-ui/react';
import { useBasicTypeaheadTriggerMatch } from '../../utils';
import { type EditorVariablePickerType } from '../../type.d';
import { type EditorVariablePickerType } from '../../type';
export default function VariablePickerPlugin({
variables
......
import type { WorkflowIOValueTypeEnum } from '@fastgpt/global/core/workflow/constants';
import type { FlowNodeTypeEnum } from '@fastgpt/global/core/workflow/node/constant';
import type { BoxProps } from '@chakra-ui/react';
export type EditorVariablePickerType = {
key: string;
......
......@@ -6,14 +6,14 @@ import { useTranslation } from 'next-i18next';
import Tag from '../Tag';
export type UserBoxProps = {
sourceMember: SourceMemberType;
sourceMember?: SourceMemberType;
avatarSize?: string;
} & StackProps;
function UserBox({ sourceMember, avatarSize = '1.25rem', ...props }: UserBoxProps) {
const { t } = useTranslation();
return (
return sourceMember ? (
<HStack space="1" {...props}>
<Avatar src={sourceMember.avatar} w={avatarSize} borderRadius={'xs'} />
<Box maxW={'150px'} whiteSpace={'nowrap'} overflow={'hidden'}>
......@@ -21,7 +21,7 @@ function UserBox({ sourceMember, avatarSize = '1.25rem', ...props }: UserBoxProp
</Box>
{sourceMember.status === 'leave' && <Tag color="gray">{t('common:user_leaved')}</Tag>}
</HStack>
);
) : null;
}
export default React.memo(UserBox);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment