Commit 4dfc186c by 赵月辉

fix: 修复 .d.ts 与 .ts 并存冲突及 next.config 冲突

合并4组 .d.ts 独有导出到对应 .ts 并删除 .d.ts:
- outLink/api.d.ts: PostShareLoginProps 合并到 api.ts
- outLink/type.d.ts: 补全 password/responseDetail 字段到 type.ts
- chat/type.d.ts: ChatItemType/ChatFeedbackLogSchema等合并到 type.ts
- user/team/type.d.ts: tagsType/LafAccountType等合并到 type.ts

next.config 冲突修复:
- 删除 lufa 的 next.config.js(与官方 next.config.ts 并存导致加载冲突)
- 将 @xmldom/xmldom 加入 next.config.ts 的 serverExternalPackages

修复9处 .d import 路径(去掉 .d 后缀,正确指向官方 .ts):
- type.d → type, api.d → api, chat.d → chat, userRes.d → userRes
parent 9a3eabd4
import { ClassifyQuestionAgentItemType } from '../workflow/template/system/classifyQuestion/type';
import type { SearchDataResponseItemType } from '../dataset/type';
import type {
ChatFileTypeEnum,
ChatItemValueTypeEnum,
ChatRoleEnum,
ChatSourceEnum,
ChatStatusEnum
} from './constants';
import type { FlowNodeTypeEnum } from '../workflow/node/constant';
import type { NodeInputKeyEnum, 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 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';
import type { FlowNodeTemplateType } from '../workflow/type/node.d';
export type ChatSchemaType = {
_id: string;
chatId: string;
userId: string;
teamId: string;
tmbId: string;
appId: string;
createTime: Date;
updateTime: Date;
title: string;
customTitle: string;
top: boolean;
source: `${ChatSourceEnum}`;
sourceName?: string;
shareId?: string;
outLinkUid?: string;
variableList?: VariableItemType[];
welcomeText?: string;
variables: Record<string, any>;
pluginInputs?: FlowNodeInputItemType[];
metadata?: Record<string, any>;
};
export type ChatWithAppSchema = Omit<ChatSchemaType, 'appId'> & {
appId: AppSchema;
};
export type UserChatItemValueItemType = {
type: ChatItemValueTypeEnum.text | ChatItemValueTypeEnum.file;
text?: {
content: string;
};
file?: {
type: `${ChatFileTypeEnum}`;
name?: string;
url: string;
};
};
export type UserChatItemType = {
obj: ChatRoleEnum.Human;
value: UserChatItemValueItemType[];
hideInUI?: boolean;
};
export type SystemChatItemValueItemType = {
type: ChatItemValueTypeEnum.text;
text?: {
content: string;
};
};
export type SystemChatItemType = {
obj: ChatRoleEnum.System;
value: SystemChatItemValueItemType[];
};
export type AIChatItemValueItemType = {
type:
| ChatItemValueTypeEnum.text
| ChatItemValueTypeEnum.reasoning
| ChatItemValueTypeEnum.tool
| ChatItemValueTypeEnum.interactive;
text?: {
content: string;
};
reasoning?: {
content: string;
};
tools?: ToolModuleResponseItemType[];
interactive?: WorkflowInteractiveResponseType;
};
export type AIChatItemType = {
obj: ChatRoleEnum.AI;
value: AIChatItemValueItemType[];
memories?: Record<string, any>;
userGoodFeedback?: string;
userBadFeedback?: string;
customFeedbacks?: string[];
adminFeedback?: AdminFbkType;
[DispatchNodeResponseKeyEnum.nodeResponse]?: ChatHistoryItemResType[];
};
export type ChatItemValueItemType =
| UserChatItemValueItemType
| SystemChatItemValueItemType
| AIChatItemValueItemType;
export type ChatItemSchema = (UserChatItemType | SystemChatItemType | AIChatItemType) & {
dataId: string;
chatId: string;
userId: string;
teamId: string;
tmbId: string;
appId: string;
time: Date;
durationSeconds?: number;
errorMsg?: string;
};
export type ChatFeedbackLogSchema = (UserChatItemType | SystemChatItemType | AIChatItemType) & {
dataId: string;
chatId: string;
userId: string;
teamId: string;
tmbId: string;
appId: string;
time: Date;
qvalue: UserChatItemValueItemType[];
status: string;
responseData?: ChatHistoryItemResType[];
// Additional properties used in the application
appName?: string;
datasetName?: string;
datasetList?: Array<{ datasetId: string; name?: string }>;
q?: string;
a?: string;
};
export type ChatFeedbackLogRelationSchema = {
datasetId: string;
collectionId: string;
};
export type AdminFbkType = {
feedbackDataId: string;
datasetId: string;
collectionId: string;
q: string;
a?: string;
};
/* --------- chat item ---------- */
export type ResponseTagItemType = {
totalQuoteList?: SearchDataResponseItemType[];
llmModuleAccount?: number;
historyPreviewLength?: number;
toolCiteLinks?: ToolCiteLinksType[];
};
export type ChatItemType = (UserChatItemType | SystemChatItemType | AIChatItemType) & {
dataId?: string;
} & ResponseTagItemType;
// Frontend type
export type ChatSiteItemType = (UserChatItemType | SystemChatItemType | AIChatItemType) & {
_id?: string;
dataId: string;
status: `${ChatStatusEnum}`;
moduleName?: string;
ttsBuffer?: Uint8Array;
responseData?: ChatHistoryItemResType[];
time?: Date;
durationSeconds?: number;
errorMsg?: string;
} & ChatBoxInputType &
ResponseTagItemType;
/* --------- team chat --------- */
export type ChatAppListSchema = {
apps: AppType[];
teamInfo: teamInfoSchema;
uid?: string;
};
/* ---------- history ------------- */
export type HistoryItemType = {
chatId: string;
updateTime: Date;
customTitle?: string;
title: string;
};
export type ChatHistoryItemType = HistoryItemType & {
appId: string;
top: boolean;
};
/* ------- response data ------------ */
export type ChatHistoryItemResType = DispatchNodeResponseType & {
nodeId: string;
id: string;
moduleType: FlowNodeTypeEnum;
moduleName: string;
};
/* ---------- node outputs ------------ */
export type NodeOutputItemType = {
nodeId: string;
key: NodeOutputKeyEnum;
value: any;
};
/* One tool run response */
export type ToolRunResponseItemType = any;
/* tool module response */
export type ToolModuleResponseItemType = {
id: string;
toolName: string; // tool name
toolAvatar: string;
params: string; // tool params
response: string;
functionName: string;
};
export type ToolCiteLinksType = {
name: string;
url: string;
};
/* dispatch run time */
export type RuntimeUserPromptType = {
files: UserChatItemValueItemType['file'][];
text: string;
};
...@@ -369,3 +369,32 @@ export const ChatItemMiniSchema = ChatItemObjItemSchema.and( ...@@ -369,3 +369,32 @@ export const ChatItemMiniSchema = ChatItemObjItemSchema.and(
}) })
).and(ResponseTagItemSchema); ).and(ResponseTagItemSchema);
export type ChatItemMiniType = z.infer<typeof ChatItemMiniSchema>; export type ChatItemMiniType = z.infer<typeof ChatItemMiniSchema>;
/* --------- lufa legacy types --------- */
export type ChatItemType = ChatItemObjItemType & {
dataId?: string;
} & ResponseTagItemType;
export type ChatFeedbackLogSchema = ChatItemObjItemType & {
dataId: string;
chatId: string;
userId: string;
teamId: string;
tmbId: string;
appId: string;
time: Date;
qvalue: UserChatItemValueItemType[];
status: string;
responseData?: ChatHistoryItemResType[];
// Additional properties used in the application
appName?: string;
datasetName?: string;
datasetList?: Array<{ datasetId: string; name?: string }>;
q?: string;
a?: string;
};
export type ChatFeedbackLogRelationSchema = {
datasetId: string;
collectionId: string;
};
import type { HistoryItemType } from '../../core/chat/type.d';
import type { OutLinkSchema } from './type.d';
export type AuthOutLinkInitProps = {
outLinkUid: string;
tokenUrl?: string;
};
export type AuthOutLinkChatProps = { ip?: string | null; outLinkUid: string; question: string };
export type AuthOutLinkLimitProps = AuthOutLinkChatProps & { outLink: OutLinkSchema };
export type AuthOutLinkResponse = {
uid: string;
};
export type PostShareLoginProps = {
shareId: string;
password: string;
};
...@@ -23,3 +23,8 @@ export const PlaygroundVisibilityConfigQuerySchema = z.object({ ...@@ -23,3 +23,8 @@ export const PlaygroundVisibilityConfigQuerySchema = z.object({
appId: z.string().min(1, 'App ID is required') appId: z.string().min(1, 'App ID is required')
}); });
export type PlaygroundVisibilityConfigQuery = z.infer<typeof PlaygroundVisibilityConfigQuerySchema>; export type PlaygroundVisibilityConfigQuery = z.infer<typeof PlaygroundVisibilityConfigQuerySchema>;
export type PostShareLoginProps = {
shareId: string;
password: string;
};
import { AppSchema } from '../../core/app/type';
import type { PublishChannelEnum } from './constant';
// Feishu Config interface
export interface FeishuAppType {
appId: string;
appSecret: string;
// Encrypt config
// refer to: https://open.feishu.cn/document/server-docs/event-subscription-guide/event-subscription-configure-/configure-encrypt-key
encryptKey?: string; // no secret if null
// Token Verification
// refer to: https://open.feishu.cn/document/server-docs/event-subscription-guide/event-subscription-configure-/encrypt-key-encryption-configuration-case
verificationToken?: string;
}
export interface DingtalkAppType {
clientId: string;
clientSecret: string;
}
export interface WecomAppType {
AgentId: string;
CorpId: string;
SuiteSecret: string;
CallbackToken: string;
CallbackEncodingAesKey: string;
}
// TODO: unused
export interface WechatAppType {}
export interface OffiAccountAppType {
appId: string;
isVerified?: boolean; // if isVerified, we could use '客服接口' to reply
secret: string;
CallbackToken: string;
CallbackEncodingAesKey?: string;
timeoutReply?: string; // if timeout (15s), will reply this content.
// timeout reply is optional, but when isVerified is false, the wechat will reply a default message which is `该公众号暂时无法提供服务,请稍后再试`
// because we can not reply anything in 15s. Thus, the wechat server will treat this request as a failed request.
}
export type OutlinkAppType =
| FeishuAppType
| WecomAppType
| OffiAccountAppType
| DingtalkAppType
| undefined;
export type OutLinkSchema<T extends OutlinkAppType = undefined> = {
_id: string;
shareId: string;
teamId: string;
tmbId: string;
appId: string;
name: string;
usagePoints: number;
lastTime: Date;
type: PublishChannelEnum;
// whether the response content is detailed
responseDetail: boolean;
// whether to hide the node status
showNodeStatus?: boolean;
// wheter to show the full text reader
// showFullText?: boolean;
// whether to show the complete quote
showRawSource?: boolean;
// response when request
immediateResponse?: string;
// response when error or other situation
defaultResponse?: string;
limit?: {
expiredTime?: Date;
// Questions per minute
QPM: number;
maxUsagePoints: number;
// Verification message hook url
hookUrl?: string;
password?: string;
};
app: T;
};
// Edit the Outlink
export type OutLinkEditType<T = undefined> = {
_id?: string;
name: string;
responseDetail?: OutLinkSchema<T>['responseDetail'];
showNodeStatus?: OutLinkSchema<T>['showNodeStatus'];
// showFullText?: OutLinkSchema<T>['showFullText'];
showRawSource?: OutLinkSchema<T>['showRawSource'];
// response when request
immediateResponse?: string;
// response when error or other situation
defaultResponse?: string;
limit?: OutLinkSchema<T>['limit'];
// config for specific platform
app?: T;
};
...@@ -95,6 +95,7 @@ export type OutLinkSchemaType<T extends OutlinkAppType = undefined> = { ...@@ -95,6 +95,7 @@ export type OutLinkSchemaType<T extends OutlinkAppType = undefined> = {
maxUsagePoints: number; maxUsagePoints: number;
// Verification message hook url // Verification message hook url
hookUrl?: string; hookUrl?: string;
password?: string;
}; };
app: T; app: T;
...@@ -114,6 +115,8 @@ export type OutLinkEditType<T extends OutlinkAppType = undefined> = { ...@@ -114,6 +115,8 @@ export type OutLinkEditType<T extends OutlinkAppType = undefined> = {
showSkillReferences?: OutLinkSchemaType<T>['showSkillReferences']; showSkillReferences?: OutLinkSchemaType<T>['showSkillReferences'];
showFullText?: OutLinkSchemaType<T>['showFullText']; showFullText?: OutLinkSchemaType<T>['showFullText'];
canDownloadSource?: OutLinkSchemaType<T>['canDownloadSource']; canDownloadSource?: OutLinkSchemaType<T>['canDownloadSource'];
//@deprecated
responseDetail?: OutLinkSchemaType<T>['responseDetail'];
// response when request // response when request
immediateResponse?: string; immediateResponse?: string;
// response when error or other situation // response when error or other situation
......
import type { UserModelSchema } from '../type';
import type { TeamMemberRoleEnum, TeamMemberStatusEnum } from './constant';
import type { LafAccountType } from './type';
import { PermissionValueType, ResourcePermissionType } from '../../permission/type';
import type { TeamPermission } from '../../permission/user/controller';
export type ThirdPartyAccountType = {
lafAccount?: LafAccountType;
openaiAccount?: OpenaiAccountType;
externalWorkflowVariables?: Record<string, string>;
};
export type TeamSchema = {
_id: string;
name: string;
ownerId: string;
avatar: string;
createTime: Date;
balance: number;
teamDomain: string;
limit: {
lastExportDatasetTime: Date;
lastWebsiteSyncTime: Date;
};
notificationAccount?: string;
} & ThirdPartyAccountType;
export type tagsType = {
label: string;
key: string;
};
export type TeamTagSchema = TeamTagItemType & {
_id: string;
teamId: string;
createTime: Date;
updateTime?: Date;
};
export type TeamMemberSchema = {
_id: string;
teamId: string;
userId: string;
createTime: Date;
updateTime?: Date;
name: string;
role: `${TeamMemberRoleEnum}` | 'admin';
status: `${TeamMemberStatusEnum}`;
avatar: string;
};
export type TeamMemberWithTeamAndUserSchema = TeamMemberSchema & {
team: TeamSchema;
user: UserModelSchema;
};
export type TeamTmbItemType = {
userId: string;
teamId: string;
teamAvatar?: string;
teamName: string;
memberName: string;
avatar: string;
balance?: number;
tmbId: string;
teamDomain: string;
role: `${TeamMemberRoleEnum}` | 'admin';
status: `${TeamMemberStatusEnum}`;
notificationAccount?: string;
permission: TeamPermission;
} & ThirdPartyAccountType;
export type TeamMemberItemType<
Options extends {
withPermission?: boolean;
withOrgs?: boolean;
withGroupRole?: boolean;
} = { withPermission: true; withOrgs: true; withGroupRole: false }
> = {
userId: string;
tmbId: string;
teamId: string;
memberName: string;
avatar: string;
role: `${TeamMemberRoleEnum}` | 'admin';
status: `${TeamMemberStatusEnum}`;
contact?: string;
createTime: Date;
updateTime?: Date;
} & (Options extends { withPermission: true }
? {
permission: TeamPermission;
}
: {}) &
(Options extends { withOrgs: true }
? {
orgs?: string[]; // full path name, pattern: /teamName/orgname1/orgname2
}
: {}) &
(Options extends { withGroupRole: true }
? {
groupRole?: `${GroupMemberRole}`;
}
: {});
export type TeamTagItemType = {
label: string;
key: string;
};
export type LafAccountType = {
appid: string;
token: string;
pat: string;
};
export type OpenaiAccountType = {
key: string;
baseUrl: string;
};
export type TeamInvoiceHeaderType = {
teamName: string;
unifiedCreditCode: string;
companyAddress?: string;
companyPhone?: string;
bankName?: string;
bankAccount?: string;
needSpecialInvoice: boolean;
contactPhone: string;
emailAddress: string;
};
export type TeamInvoiceHeaderInfoSchemaType = TeamInvoiceHeaderType & {
_id: string;
teamId: string;
};
...@@ -115,3 +115,27 @@ export type TeamInvoiceHeaderInfoSchemaType = TeamInvoiceHeaderType & { ...@@ -115,3 +115,27 @@ export type TeamInvoiceHeaderInfoSchemaType = TeamInvoiceHeaderType & {
_id: string; _id: string;
teamId: string; teamId: string;
}; };
/* --------- lufa legacy types --------- */
export type tagsType = {
label: string;
key: string;
};
export type TeamTagItemType = {
label: string;
key: string;
};
export type TeamTagSchema = TeamTagItemType & {
_id: string;
teamId: string;
createTime: Date;
updateTime?: Date;
};
export type LafAccountType = {
appid: string;
token: string;
pat: string;
};
...@@ -8,7 +8,7 @@ import { ...@@ -8,7 +8,7 @@ import {
DatasetTypeMap, DatasetTypeMap,
ParagraphChunkAIModeEnum ParagraphChunkAIModeEnum
} from '@fastgpt/global/core/dataset/constants'; } from '@fastgpt/global/core/dataset/constants';
import type { DatasetSchemaType } from '@fastgpt/global/core/dataset/type.d'; import type { DatasetSchemaType } from '@fastgpt/global/core/dataset/type';
import { import {
TeamCollectionName, TeamCollectionName,
TeamMemberCollectionName TeamMemberCollectionName
......
import type { ChatItemType } from '@fastgpt/global/core/chat/type.d'; import type { ChatItemType } from '@fastgpt/global/core/chat/type';
import type { ModuleDispatchProps } from '@fastgpt/global/core/workflow/runtime/type'; import type { ModuleDispatchProps } from '@fastgpt/global/core/workflow/runtime/type';
import { dispatchWorkFlow } from '../index'; import { dispatchWorkFlow } from '../index';
import { ChatRoleEnum } from '@fastgpt/global/core/chat/constants'; import { ChatRoleEnum } from '@fastgpt/global/core/chat/constants';
......
const { i18n } = require('./next-i18next.config.js');
const path = require('path');
const fs = require('fs');
const isDev = process.env.NODE_ENV === 'development';
/** @type {import('next').NextConfig} */
const nextConfig = {
basePath: process.env.NEXT_PUBLIC_BASE_URL,
i18n,
output: 'standalone',
reactStrictMode: isDev ? false : true,
compress: true,
async headers() {
return [
{
source: '/((?!chat/share$).*)',
headers: [
{
key: 'X-Content-Type-Options',
value: 'nosniff'
},
{
key: 'X-XSS-Protection',
value: '1; mode=block'
},
{
key: 'Permissions-Policy',
value: 'geolocation=(self), microphone=(self), camera=(self)'
}
]
}
];
},
webpack(config, { isServer, nextRuntime }) {
Object.assign(config.resolve.alias, {
'@mongodb-js/zstd': false,
'@aws-sdk/credential-providers': false,
snappy: false,
aws4: false,
'mongodb-client-encryption': false,
kerberos: false,
'supports-color': false,
'bson-ext': false,
'pg-native': false
});
config.module = {
...config.module,
rules: config.module.rules.concat([
{
test: /\.svg$/i,
issuer: /\.[jt]sx?$/,
use: ['@svgr/webpack']
}
]),
exprContextCritical: false,
unknownContextCritical: false
};
if (!config.externals) {
config.externals = [];
}
if (isServer) {
config.externals.push('@node-rs/jieba');
if (nextRuntime === 'nodejs') {
const oldEntry = config.entry;
config = {
...config,
async entry(...args) {
const entries = await oldEntry(...args);
return {
...entries,
...getWorkerConfig()
};
}
};
}
} else {
config.resolve = {
...config.resolve,
fallback: {
...config.resolve.fallback,
fs: false
}
};
}
config.experiments = {
asyncWebAssembly: true,
layers: true
};
return config;
},
// 需要转译的包
transpilePackages: ['@modelcontextprotocol/sdk', 'ahooks'],
experimental: {
// 优化 Server Components 的构建和运行,避免不必要的客户端打包。
serverComponentsExternalPackages: [
'mongoose',
'pg',
'bullmq',
'@zilliz/milvus2-sdk-node',
'tiktoken',
'@xmldom/xmldom'
],
outputFileTracingRoot: path.join(__dirname, '../../'),
instrumentationHook: true
}
};
module.exports = nextConfig;
function getWorkerConfig() {
const result = fs.readdirSync(path.resolve(__dirname, '../../packages/service/worker'));
// 获取所有的目录名
const folderList = result.filter((item) => {
return fs
.statSync(path.resolve(__dirname, '../../packages/service/worker', item))
.isDirectory();
});
const workerConfig = folderList.reduce((acc, item) => {
acc[`worker/${item}`] = path.resolve(
process.cwd(),
`../../packages/service/worker/${item}/index.ts`
);
return acc;
}, {});
return workerConfig;
}
...@@ -77,7 +77,8 @@ const nextConfig: NextConfig = { ...@@ -77,7 +77,8 @@ const nextConfig: NextConfig = {
'@zilliz/milvus2-sdk-node', '@zilliz/milvus2-sdk-node',
'@opentelemetry/api-logs', '@opentelemetry/api-logs',
'@mariozechner/pi-agent-core', '@mariozechner/pi-agent-core',
'@mariozechner/pi-ai' '@mariozechner/pi-ai',
'@xmldom/xmldom'
], ],
// 优化大库的 barrel exports tree-shaking // 优化大库的 barrel exports tree-shaking
experimental: { experimental: {
......
import type { GetChatTypeEnum } from '@/global/core/chat/constants'; import type { GetChatTypeEnum } from '@/global/core/chat/constants';
import type { AppTypeEnum } from '@fastgpt/global/core/app/constants'; import type { AppTypeEnum } from '@fastgpt/global/core/app/constants';
import type { AppChatConfigType, AppTTSConfigType } from '@fastgpt/global/core/app/type.d'; import type { AppChatConfigType, AppTTSConfigType } from '@fastgpt/global/core/app/type';
import type { ChatSourceEnum } from '@fastgpt/global/core/chat/constants'; import type { ChatSourceEnum } from '@fastgpt/global/core/chat/constants';
import type { AdminFbkType } from '@fastgpt/global/core/chat/type'; import type { AdminFbkType } from '@fastgpt/global/core/chat/type';
import type { OutLinkChatAuthProps } from '@fastgpt/global/support/permission/chat.d'; import type { OutLinkChatAuthProps } from '@fastgpt/global/support/permission/chat';
import { ChatItemType } from '@fastgpt/global/core/chat/type'; import { ChatItemType } from '@fastgpt/global/core/chat/type';
import { RequestPaging } from '@/types'; import { RequestPaging } from '@/types';
export type GetChatSpeechProps = OutLinkChatAuthProps & { export type GetChatSpeechProps = OutLinkChatAuthProps & {
......
...@@ -27,7 +27,7 @@ import { ...@@ -27,7 +27,7 @@ import {
} from '@chakra-ui/react'; } from '@chakra-ui/react';
import { formatTimeToChatTime } from '@fastgpt/global/common/string/time'; import { formatTimeToChatTime } from '@fastgpt/global/common/string/time';
import { PublishChannelEnum } from '@fastgpt/global/support/outLink/constant'; import { PublishChannelEnum } from '@fastgpt/global/support/outLink/constant';
import type { OutLinkEditType, OutLinkSchema } from '@fastgpt/global/support/outLink/type.d'; import type { OutLinkEditType, OutLinkSchema } from '@fastgpt/global/support/outLink/type';
import EmptyTip from '@fastgpt/web/components/common/EmptyTip'; import EmptyTip from '@fastgpt/web/components/common/EmptyTip';
import MyIcon from '@fastgpt/web/components/common/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import MyBox from '@fastgpt/web/components/common/MyBox'; import MyBox from '@fastgpt/web/components/common/MyBox';
......
...@@ -10,7 +10,7 @@ import { ...@@ -10,7 +10,7 @@ import {
ModalFooter ModalFooter
} from '@chakra-ui/react'; } from '@chakra-ui/react';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
import { type AppSchema, type AppSimpleEditFormType } from '@fastgpt/global/core/app/type.d'; import { type AppSchema, type AppSimpleEditFormType } from '@fastgpt/global/core/app/type';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
import Avatar from '@fastgpt/web/components/common/Avatar'; import Avatar from '@fastgpt/web/components/common/Avatar';
import MyIcon from '@fastgpt/web/components/common/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
......
import type { NextApiResponse } from 'next'; import type { NextApiResponse } from 'next';
import { jsonRes } from '@fastgpt/service/common/response'; import { jsonRes } from '@fastgpt/service/common/response';
import type { GetChatSpeechProps } from '@/global/core/chat/api.d'; import type { GetChatSpeechProps } from '@/global/core/chat/api';
import { text2Speech } from '@fastgpt/service/core/ai/audio/speech'; import { text2Speech } from '@fastgpt/service/core/ai/audio/speech';
import { pushAudioSpeechUsage } from '@/service/support/wallet/usage/push'; import { pushAudioSpeechUsage } from '@/service/support/wallet/usage/push';
import { authChatCrud } from '@/service/support/permission/auth/chat'; import { authChatCrud } from '@/service/support/permission/auth/chat';
......
import type { InitChatResponse, InitTeamChatProps } from '@/global/core/chat/api.d'; import type { InitChatResponse, InitTeamChatProps } from '@/global/core/chat/api';
import { getChatModelNameListByModules } from '@/service/core/app/workflow'; import { getChatModelNameListByModules } from '@/service/core/app/workflow';
import { NextAPI } from '@/service/middleware/entry'; import { NextAPI } from '@/service/middleware/entry';
import { type ApiRequestProps } from '@fastgpt/service/type/next'; import { type ApiRequestProps } from '@fastgpt/service/type/next';
......
...@@ -3,9 +3,9 @@ import type { ApiRequestProps } from '@fastgpt/service/type/next'; ...@@ -3,9 +3,9 @@ import type { ApiRequestProps } from '@fastgpt/service/type/next';
import { ReadPermissionVal } from '@fastgpt/global/support/permission/constant'; import { ReadPermissionVal } from '@fastgpt/global/support/permission/constant';
import { authUserPer } from '@fastgpt/service/support/permission/user/auth'; import { authUserPer } from '@fastgpt/service/support/permission/user/auth';
import { MongoTeamMember } from '@fastgpt/service/support/user/team/teamMemberSchema'; import { MongoTeamMember } from '@fastgpt/service/support/user/team/teamMemberSchema';
import type { SearchResult } from '@fastgpt/global/support/user/api.d'; import type { SearchResult } from '@fastgpt/global/support/user/api';
import type { TeamMemberItemType } from '@fastgpt/global/support/user/team/type.d'; import type { TeamMemberItemType } from '@fastgpt/global/support/user/team/type';
import type { TeamMemberSchema } from '@fastgpt/global/support/user/team/type.d'; import type { TeamMemberSchema } from '@fastgpt/global/support/user/team/type';
import { Types } from 'mongoose'; import { Types } from 'mongoose';
export type SearchQuery = { export type SearchQuery = {
searchKey?: string; searchKey?: string;
......
import { NextAPI } from '@/service/middleware/entry'; import { NextAPI } from '@/service/middleware/entry';
import type { ApiRequestProps } from '@fastgpt/service/type/next'; import type { ApiRequestProps } from '@fastgpt/service/type/next';
import { MongoTeamMember } from '@fastgpt/service/support/user/team/teamMemberSchema'; import { MongoTeamMember } from '@fastgpt/service/support/user/team/teamMemberSchema';
import type { TeamMemberSchema } from '@fastgpt/global/support/user/team/type.d'; import type { TeamMemberSchema } from '@fastgpt/global/support/user/team/type';
import type { TeamMemberItemType } from '@fastgpt/global/support/user/team/type.d'; import type { TeamMemberItemType } from '@fastgpt/global/support/user/team/type';
import { ReadPermissionVal } from '@fastgpt/global/support/permission/constant'; import { ReadPermissionVal } from '@fastgpt/global/support/permission/constant';
import { authUserPer } from '@fastgpt/service/support/permission/user/auth'; import { authUserPer } from '@fastgpt/service/support/permission/user/auth';
import { Types } from 'mongoose'; import { Types } from 'mongoose';
......
import type { PostShareLoginProps } from '@fastgpt/global/support/outLink/api.d'; import type { PostShareLoginProps } from '@fastgpt/global/support/outLink/api';
import type { OutLinkSchema } from '@fastgpt/global/support/outLink/type'; import type { OutLinkSchema } from '@fastgpt/global/support/outLink/type';
import { jsonRes } from '@fastgpt/service/common/response'; import { jsonRes } from '@fastgpt/service/common/response';
import { MongoOutLink } from '@fastgpt/service/support/outLink/schema'; import { MongoOutLink } from '@fastgpt/service/support/outLink/schema';
......
import I18nLngSelector from '@/components/Select/I18nLngSelector'; import I18nLngSelector from '@/components/Select/I18nLngSelector';
import type { ResLogin } from '@/global/support/api/userRes.d'; import type { ResLogin } from '@/global/support/api/userRes';
import { useSystemStore } from '@/web/common/system/useSystemStore'; import { useSystemStore } from '@/web/common/system/useSystemStore';
import type { LoginPageTypeEnum } from '@/web/support/user/login/constants'; import type { LoginPageTypeEnum } from '@/web/support/user/login/constants';
import { Box, Flex, useDisclosure } from '@chakra-ui/react'; import { Box, Flex, useDisclosure } from '@chakra-ui/react';
......
import type { ResLogin } from '@/global/support/api/userRes.d'; import type { ResLogin } from '@/global/support/api/userRes';
import { useChatStore } from '@/web/core/chat/context/useChatStore'; import { useChatStore } from '@/web/core/chat/context/useChatStore';
import { ssoLogin } from '@/web/support/user/api'; import { ssoLogin } from '@/web/support/user/api';
import { clearToken, setToken } from '@/web/support/user/auth'; import { clearToken, setToken } from '@/web/support/user/auth';
......
import { GET, POST, PUT, DELETE } from '@/web/common/api/request'; import { GET, POST, PUT, DELETE } from '@/web/common/api/request';
import type { ChatFeedbackLogSchema } from '@fastgpt/global/core/chat/type.d'; import type { ChatFeedbackLogSchema } from '@fastgpt/global/core/chat/type';
import type { ListFeedbackBody } from '@/pages/api/core/feedback/list'; import type { ListFeedbackBody } from '@/pages/api/core/feedback/list';
import type { ApproveBody } from '@/pages/api/core/feedback/Approve'; import type { ApproveBody } from '@/pages/api/core/feedback/Approve';
import type { PaginationProps } from '@fastgpt/web/common/fetch/type'; import type { PaginationProps } from '@fastgpt/web/common/fetch/type';
......
...@@ -16,7 +16,7 @@ import { MongoCollaboratorPermission } from '@fastgpt/service/core/app/collabora ...@@ -16,7 +16,7 @@ import { MongoCollaboratorPermission } from '@fastgpt/service/core/app/collabora
import { MongoResourcePermission } from '@fastgpt/service/support/permission/schema'; import { MongoResourcePermission } from '@fastgpt/service/support/permission/schema';
import { PerResourceTypeEnum } from '@fastgpt/global/support/permission/constant'; import { PerResourceTypeEnum } from '@fastgpt/global/support/permission/constant';
import { MongoTeamMember } from '@fastgpt/service/support/user/team/teamMemberSchema'; import { MongoTeamMember } from '@fastgpt/service/support/user/team/teamMemberSchema';
import type { TeamMemberSchema } from '@fastgpt/global/support/user/team/type.d'; import type { TeamMemberSchema } from '@fastgpt/global/support/user/team/type';
interface CollaboratorPermissionDoc { interface CollaboratorPermissionDoc {
_id: string; _id: string;
......
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