diff --git a/packages/global/openapi/core/app/publishChannel/playground/api.ts b/packages/global/openapi/core/app/publishChannel/playground/api.ts index 807b0df1c..4ba8ed7ac 100644 --- a/packages/global/openapi/core/app/publishChannel/playground/api.ts +++ b/packages/global/openapi/core/app/publishChannel/playground/api.ts @@ -7,7 +7,7 @@ const PlaygroundVisibilityConfigFieldsSchema = z.object({ example: true, description: '是否显示运行状态' }), - showQuote: z.boolean().meta({ + showCite: z.boolean().meta({ example: true, description: '是否显示引用' }), diff --git a/packages/global/support/outLink/type.d.ts b/packages/global/support/outLink/type.d.ts index 14891d9b0..964a42222 100644 --- a/packages/global/support/outLink/type.d.ts +++ b/packages/global/support/outLink/type.d.ts @@ -65,7 +65,7 @@ export type OutLinkSchema = { type: PublishChannelEnum; // whether to show the quote - showQuote: boolean; + showCite: boolean; // whether to show the running status showRunningStatus?: boolean; // whether to show the full text reader @@ -94,7 +94,7 @@ export type OutLinkSchema = { export type OutLinkEditType = { _id?: string; name: string; - showQuote?: OutLinkSchema['showQuote']; + showCite?: OutLinkSchema['showCite']; showRunningStatus?: OutLinkSchema['showRunningStatus']; showFullText?: OutLinkSchema['showFullText']; canDownloadSource?: OutLinkSchema['canDownloadSource']; @@ -110,7 +110,7 @@ export type OutLinkEditType = { export const PlaygroundVisibilityConfigSchema = z.object({ showRunningStatus: z.boolean(), - showQuote: z.boolean(), + showCite: z.boolean(), showFullText: z.boolean(), canDownloadSource: z.boolean() }); diff --git a/packages/service/support/outLink/schema.ts b/packages/service/support/outLink/schema.ts index e7aed2b53..ecc1f4b29 100644 --- a/packages/service/support/outLink/schema.ts +++ b/packages/service/support/outLink/schema.ts @@ -43,7 +43,7 @@ const OutLinkSchema = new Schema({ type: Date }, - showQuote: { + showCite: { type: Boolean, default: false }, diff --git a/projects/app/src/pageComponents/app/detail/Publish/DingTalk/index.tsx b/projects/app/src/pageComponents/app/detail/Publish/DingTalk/index.tsx index 3a2b82188..65acf43f3 100644 --- a/projects/app/src/pageComponents/app/detail/Publish/DingTalk/index.tsx +++ b/projects/app/src/pageComponents/app/detail/Publish/DingTalk/index.tsx @@ -186,7 +186,7 @@ const DingTalk = ({ appId }: { appId: string }) => { name: item.name, limit: item.limit, app: item.app, - showQuote: item.showQuote, + showCite: item.showCite, defaultResponse: item.defaultResponse, immediateResponse: item.immediateResponse }); diff --git a/projects/app/src/pageComponents/app/detail/Publish/FeiShu/index.tsx b/projects/app/src/pageComponents/app/detail/Publish/FeiShu/index.tsx index 73cc5ad9b..5cb2687af 100644 --- a/projects/app/src/pageComponents/app/detail/Publish/FeiShu/index.tsx +++ b/projects/app/src/pageComponents/app/detail/Publish/FeiShu/index.tsx @@ -185,7 +185,7 @@ const FeiShu = ({ appId }: { appId: string }) => { name: item.name, limit: item.limit, app: item.app, - showQuote: item.showQuote, + showCite: item.showCite, defaultResponse: item.defaultResponse, immediateResponse: item.immediateResponse }); diff --git a/projects/app/src/pageComponents/app/detail/Publish/Link/index.tsx b/projects/app/src/pageComponents/app/detail/Publish/Link/index.tsx index 4eec3c2d1..9a1ed5f03 100644 --- a/projects/app/src/pageComponents/app/detail/Publish/Link/index.tsx +++ b/projects/app/src/pageComponents/app/detail/Publish/Link/index.tsx @@ -140,7 +140,7 @@ const Share = ({ appId }: { appId: string; type: PublishChannelEnum }) => { }` : ''} - {item.showQuote ? '✔' : '✖'} + {item.showCite ? '✔' : '✖'} {feConfigs?.isPlus && ( <> {item?.limit?.QPM || '-'} @@ -182,7 +182,7 @@ const Share = ({ appId }: { appId: string; type: PublishChannelEnum }) => { setEditLinkData({ _id: item._id, name: item.name, - showQuote: item.showQuote ?? false, + showCite: item.showCite ?? false, canDownloadSource: item.canDownloadSource ?? false, showFullText: item.showFullText ?? true, showRunningStatus: item.showRunningStatus ?? false, @@ -281,7 +281,7 @@ function EditLinkModal({ defaultValues: defaultData }); - const showQuote = watch('showQuote'); + const showCite = watch('showCite'); const showFullText = watch('showFullText'); const canDownloadSource = watch('canDownloadSource'); @@ -424,7 +424,7 @@ function EditLinkModal({ > @@ -449,7 +449,7 @@ function EditLinkModal({ if (!e.target.checked) { setValue('canDownloadSource', false); } else { - setValue('showQuote', true); + setValue('showCite', true); } } })} @@ -469,7 +469,7 @@ function EditLinkModal({ onChange(e) { if (e.target.checked) { setValue('showFullText', true); - setValue('showQuote', true); + setValue('showCite', true); } } })} diff --git a/projects/app/src/pageComponents/app/detail/Publish/OffiAccount/index.tsx b/projects/app/src/pageComponents/app/detail/Publish/OffiAccount/index.tsx index f5fbbbb64..08c458115 100644 --- a/projects/app/src/pageComponents/app/detail/Publish/OffiAccount/index.tsx +++ b/projects/app/src/pageComponents/app/detail/Publish/OffiAccount/index.tsx @@ -188,7 +188,7 @@ const OffiAccount = ({ appId }: { appId: string }) => { name: item.name, limit: item.limit, app: item.app, - showQuote: item.showQuote, + showCite: item.showCite, defaultResponse: item.defaultResponse, immediateResponse: item.immediateResponse }); diff --git a/projects/app/src/pageComponents/app/detail/Publish/Playground/index.tsx b/projects/app/src/pageComponents/app/detail/Publish/Playground/index.tsx index dde381352..ce5186ef4 100644 --- a/projects/app/src/pageComponents/app/detail/Publish/Playground/index.tsx +++ b/projects/app/src/pageComponents/app/detail/Publish/Playground/index.tsx @@ -15,7 +15,7 @@ import { useCopyData } from '@fastgpt/web/hooks/useCopyData'; const defaultPlaygroundVisibilityForm: PlaygroundVisibilityConfigType = { showRunningStatus: true, - showQuote: true, + showCite: true, showFullText: true, canDownloadSource: true }; @@ -28,7 +28,7 @@ const PlaygroundVisibilityConfig = ({ appId }: { appId: string }) => { defaultValues: defaultPlaygroundVisibilityForm }); - const showQuote = watch('showQuote'); + const showCite = watch('showCite'); const showFullText = watch('showFullText'); const canDownloadSource = watch('canDownloadSource'); @@ -43,7 +43,7 @@ const PlaygroundVisibilityConfig = ({ appId }: { appId: string }) => { onSuccess: (data) => { reset({ showRunningStatus: data.showRunningStatus, - showQuote: data.showQuote, + showCite: data.showCite, showFullText: data.showFullText, canDownloadSource: data.canDownloadSource }); @@ -123,7 +123,7 @@ const PlaygroundVisibilityConfig = ({ appId }: { appId: string }) => { { autoSave(); } })} - isChecked={showQuote} + isChecked={showCite} /> @@ -149,7 +149,7 @@ const PlaygroundVisibilityConfig = ({ appId }: { appId: string }) => { if (!e.target.checked) { setValue('canDownloadSource', false); } else { - setValue('showQuote', true); + setValue('showCite', true); } autoSave(); } @@ -169,7 +169,7 @@ const PlaygroundVisibilityConfig = ({ appId }: { appId: string }) => { onChange(e) { if (e.target.checked) { setValue('showFullText', true); - setValue('showQuote', true); + setValue('showCite', true); } autoSave(); } diff --git a/projects/app/src/pageComponents/app/detail/Publish/Wecom/index.tsx b/projects/app/src/pageComponents/app/detail/Publish/Wecom/index.tsx index e8327e862..54814301a 100644 --- a/projects/app/src/pageComponents/app/detail/Publish/Wecom/index.tsx +++ b/projects/app/src/pageComponents/app/detail/Publish/Wecom/index.tsx @@ -200,7 +200,7 @@ const Wecom = ({ appId }: { appId: string }) => { name: item.name, limit: item.limit, app: item.app, - showQuote: item.showQuote, + showCite: item.showCite, defaultResponse: item.defaultResponse, immediateResponse: item.immediateResponse }); diff --git a/projects/app/src/pages/api/admin/initv4145.ts b/projects/app/src/pages/api/admin/initv4145.ts index 1293f0937..b40fec388 100644 --- a/projects/app/src/pages/api/admin/initv4145.ts +++ b/projects/app/src/pages/api/admin/initv4145.ts @@ -28,7 +28,7 @@ export type ResponseType = { * 2. 为所有 share 类型的 OutLink 记录添加 showFullText 字段 * 3. 重命名字段: * - showNodeStatus -> showRunningStatus - * - responseDetail -> showQuote + * - responseDetail -> showCite * - showRawSource -> canDownloadSource */ @@ -171,11 +171,11 @@ async function migrateOutLinkData(): Promise<{ ); } - // 3. 重命名字段:responseDetail -> showQuote + // 3. 重命名字段:responseDetail -> showCite const responseDetailLinks = await outLinkCollection .find({ responseDetail: { $exists: true }, - showQuote: { $exists: false } + showCite: { $exists: false } }) .toArray(); @@ -185,7 +185,7 @@ async function migrateOutLinkData(): Promise<{ filter: { _id: link._id }, update: [ { - $set: { showQuote: '$responseDetail' } + $set: { showCite: '$responseDetail' } }, { $unset: 'responseDetail' @@ -197,12 +197,12 @@ async function migrateOutLinkData(): Promise<{ const renameResponseDetailResult = await outLinkCollection.bulkWrite(renameResponseDetailOps); totalUpdated += renameResponseDetailResult.modifiedCount; updateResults.push({ - operation: 'Rename responseDetail to showQuote', + operation: 'Rename responseDetail to showCite', updated: renameResponseDetailResult.modifiedCount }); console.log( - `Renamed responseDetail to showQuote for ${renameResponseDetailResult.modifiedCount} links` + `Renamed responseDetail to showCite for ${renameResponseDetailResult.modifiedCount} links` ); } diff --git a/projects/app/src/pages/api/core/chat/getPaginationRecords.ts b/projects/app/src/pages/api/core/chat/getPaginationRecords.ts index deae19333..fda2877c9 100644 --- a/projects/app/src/pages/api/core/chat/getPaginationRecords.ts +++ b/projects/app/src/pages/api/core/chat/getPaginationRecords.ts @@ -40,7 +40,7 @@ async function handler( }; } - const [app, { showQuote, showRunningStatus, authType }] = await Promise.all([ + const [app, { showCite, showRunningStatus, authType }] = await Promise.all([ MongoApp.findById(appId, 'type').lean(), authChatCrud({ req, @@ -81,7 +81,7 @@ async function handler( if (item.obj === ChatRoleEnum.AI) { item.responseData = filterPublicNodeResponseData({ nodeRespones: item.responseData, - responseDetail: showQuote + responseDetail: showCite }); if (showRunningStatus === false) { @@ -90,7 +90,7 @@ async function handler( } }); } - if (!showQuote) { + if (!showCite) { histories.forEach((item) => { if (item.obj === ChatRoleEnum.AI) { item.value = removeAIResponseCite(item.value, false); @@ -99,7 +99,7 @@ async function handler( } return { - list: isPlugin ? histories : transformPreviewHistories(histories, showQuote), + list: isPlugin ? histories : transformPreviewHistories(histories, showCite), total }; } diff --git a/projects/app/src/pages/api/core/chat/getRecords_v2.ts b/projects/app/src/pages/api/core/chat/getRecords_v2.ts index a69e34ff5..8328d642a 100644 --- a/projects/app/src/pages/api/core/chat/getRecords_v2.ts +++ b/projects/app/src/pages/api/core/chat/getRecords_v2.ts @@ -50,7 +50,7 @@ async function handler( }; } - const [app, { showQuote, showRunningStatus, authType }] = await Promise.all([ + const [app, { showCite, showRunningStatus, authType }] = await Promise.all([ MongoApp.findById(appId, 'type').lean(), authChatCrud({ req, @@ -93,7 +93,7 @@ async function handler( if (item.obj === ChatRoleEnum.AI) { item.responseData = filterPublicNodeResponseData({ nodeRespones: item.responseData, - responseDetail: showQuote + responseDetail: showCite }); if (showRunningStatus === false) { @@ -102,7 +102,7 @@ async function handler( } }); } - if (!showQuote) { + if (!showCite) { result.histories.forEach((item) => { if (item.obj === ChatRoleEnum.AI) { item.value = removeAIResponseCite(item.value, false); @@ -110,7 +110,7 @@ async function handler( }); } - const list = isPlugin ? result.histories : transformPreviewHistories(result.histories, showQuote); + const list = isPlugin ? result.histories : transformPreviewHistories(result.histories, showCite); return { list: list.map((item) => ({ diff --git a/projects/app/src/pages/api/core/chat/getResData.ts b/projects/app/src/pages/api/core/chat/getResData.ts index 87da071e5..bed36e025 100644 --- a/projects/app/src/pages/api/core/chat/getResData.ts +++ b/projects/app/src/pages/api/core/chat/getResData.ts @@ -27,7 +27,7 @@ async function handler( return []; } - const [{ showQuote }, chatData, nodeResponses] = await Promise.all([ + const [{ showCite }, chatData, nodeResponses] = await Promise.all([ authChatCrud({ req, authToken: true, @@ -57,7 +57,7 @@ async function handler( const flowResponses = chatData.responseData?.length ? chatData.responseData : nodeResponses; return req.query.shareId ? filterPublicNodeResponseData({ - responseDetail: showQuote, + responseDetail: showCite, nodeRespones: flowResponses }) : flowResponses; diff --git a/projects/app/src/pages/api/core/chat/quote/getQuote.ts b/projects/app/src/pages/api/core/chat/quote/getQuote.ts index 00142dc08..487083d59 100644 --- a/projects/app/src/pages/api/core/chat/quote/getQuote.ts +++ b/projects/app/src/pages/api/core/chat/quote/getQuote.ts @@ -39,7 +39,7 @@ async function handler(req: ApiRequestProps): Promise): Promise): Promise): Promise) { - const { appId, showRunningStatus, showQuote, showFullText, canDownloadSource } = + const { appId, showRunningStatus, showCite, showFullText, canDownloadSource } = UpdatePlaygroundVisibilityConfigBodySchema.parse(req.body); const { teamId, tmbId } = await authApp({ @@ -33,7 +33,7 @@ async function handler(req: ApiRequestProps ): Promise { - const { _id, name, showQuote, limit, app, canDownloadSource, showRunningStatus, showFullText } = + const { _id, name, showCite, limit, app, canDownloadSource, showRunningStatus, showFullText } = req.body; if (!_id) { @@ -47,7 +47,7 @@ async function handler( const doc = await MongoOutLink.findByIdAndUpdate(_id, { name, - showQuote, + showCite, canDownloadSource, showRunningStatus, showFullText, diff --git a/projects/app/src/pages/api/v1/chat/completions.ts b/projects/app/src/pages/api/v1/chat/completions.ts index 8d398a7ea..68e9387e3 100644 --- a/projects/app/src/pages/api/v1/chat/completions.ts +++ b/projects/app/src/pages/api/v1/chat/completions.ts @@ -91,7 +91,7 @@ type AuthResponseType = { teamId: string; tmbId: string; app: AppSchema; - showQuote?: boolean; + showCite?: boolean; showRunningStatus?: boolean; authType: `${AuthUserTypeEnum}`; apikey?: string; @@ -157,7 +157,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse) { teamId, tmbId, app, - showQuote, + showCite, authType, sourceName, apikey, @@ -205,7 +205,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse) { pushTrack.teamChatQPM({ teamId }); - retainDatasetCite = retainDatasetCite && !!showQuote; + retainDatasetCite = retainDatasetCite && !!showCite; const isPlugin = app.type === AppTypeEnum.workflowTool; // Check message type @@ -388,7 +388,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse) { /* select fe response field */ const feResponseData = responseAllData ? flowResponses - : filterPublicNodeResponseData({ nodeRespones: flowResponses, responseDetail: showQuote }); + : filterPublicNodeResponseData({ nodeRespones: flowResponses, responseDetail: showCite }); if (stream) { workflowResponseWrite({ @@ -508,7 +508,7 @@ const authShareChat = async ({ shareId: string; chatId?: string; }): Promise => { - const { teamId, tmbId, appId, authType, showQuote, showRunningStatus, uid, sourceName } = + const { teamId, tmbId, appId, authType, showCite, showRunningStatus, uid, sourceName } = await authOutLinkChatStart(data); const app = await MongoApp.findById(appId).lean(); @@ -530,7 +530,7 @@ const authShareChat = async ({ apikey: '', authType, responseAllData: false, - showQuote, + showCite, outLinkUserId: uid, showRunningStatus }; @@ -569,7 +569,7 @@ const authTeamSpaceChat = async ({ authType: AuthUserTypeEnum.outLink, apikey: '', responseAllData: false, - showQuote: true, + showCite: true, outLinkUserId: uid }; }; @@ -651,7 +651,7 @@ const authHeaderRequest = async ({ authType, sourceName, responseAllData: true, - showQuote: true + showCite: true }; }; diff --git a/projects/app/src/pages/api/v2/chat/completions.ts b/projects/app/src/pages/api/v2/chat/completions.ts index efc9ed1cd..8cfde3e15 100644 --- a/projects/app/src/pages/api/v2/chat/completions.ts +++ b/projects/app/src/pages/api/v2/chat/completions.ts @@ -92,7 +92,7 @@ type AuthResponseType = { teamId: string; tmbId: string; app: AppSchema; - showQuote?: boolean; + showCite?: boolean; showRunningStatus?: boolean; authType: `${AuthUserTypeEnum}`; apikey?: string; @@ -158,7 +158,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse) { teamId, tmbId, app, - showQuote, + showCite, authType, sourceName, apikey, @@ -206,7 +206,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse) { pushTrack.teamChatQPM({ teamId }); - retainDatasetCite = retainDatasetCite && !!showQuote; + retainDatasetCite = retainDatasetCite && !!showCite; const isPlugin = app.type === AppTypeEnum.workflowTool; // Check message type @@ -321,7 +321,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse) { maxRunTimes: WORKFLOW_MAX_RUN_TIMES, workflowStreamResponse: workflowResponseWrite, responseAllData, - responseDetail: showQuote + responseDetail: showCite }); } return Promise.reject('您的工作流版本过低,请重新发布一次'); @@ -390,7 +390,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse) { /* select fe response field */ const feResponseData = responseAllData ? flowResponses - : filterPublicNodeResponseData({ nodeRespones: flowResponses, responseDetail: showQuote }); + : filterPublicNodeResponseData({ nodeRespones: flowResponses, responseDetail: showCite }); if (stream) { workflowResponseWrite({ @@ -503,7 +503,7 @@ const authShareChat = async ({ shareId: string; chatId?: string; }): Promise => { - const { teamId, tmbId, appId, authType, showQuote, showRunningStatus, uid, sourceName } = + const { teamId, tmbId, appId, authType, showCite, showRunningStatus, uid, sourceName } = await authOutLinkChatStart(data); const app = await MongoApp.findById(appId).lean(); @@ -525,7 +525,7 @@ const authShareChat = async ({ apikey: '', authType, responseAllData: false, - showQuote, + showCite, outLinkUserId: uid, showRunningStatus }; @@ -564,7 +564,7 @@ const authTeamSpaceChat = async ({ authType: AuthUserTypeEnum.outLink, apikey: '', responseAllData: false, - showQuote: true, + showCite: true, outLinkUserId: uid }; }; @@ -646,7 +646,7 @@ const authHeaderRequest = async ({ authType, sourceName, responseAllData: true, - showQuote: true + showCite: true }; }; diff --git a/projects/app/src/pages/chat/index.tsx b/projects/app/src/pages/chat/index.tsx index 8543159be..7b5c4bd39 100644 --- a/projects/app/src/pages/chat/index.tsx +++ b/projects/app/src/pages/chat/index.tsx @@ -95,7 +95,7 @@ const Render = (props: { appId: string; isStandalone?: string; showRunningStatus: boolean; - showQuote: boolean; + showCite: boolean; showFullText: boolean; canDownloadSource: boolean; }) => { @@ -150,7 +150,7 @@ const Render = (props: { showRouteToDatasetDetail={isStandalone !== '1'} showRunningStatus={props.showRunningStatus} canDownloadSource={props.canDownloadSource} - isShowQuote={props.showQuote} + isShowQuote={props.showCite} isShowFullText={props.showFullText} > @@ -176,7 +176,7 @@ export async function getServerSideProps(context: any) { appId, type: PublishChannelEnum.playground }, - 'showRunningStatus showQuote showFullText canDownloadSource' + 'showRunningStatus showCite showFullText canDownloadSource' ).lean(); return config; @@ -190,7 +190,7 @@ export async function getServerSideProps(context: any) { props: { appId, showRunningStatus: chatQuoteReaderConfig?.showRunningStatus ?? true, - showQuote: chatQuoteReaderConfig?.showQuote ?? true, + showCite: chatQuoteReaderConfig?.showCite ?? true, showFullText: chatQuoteReaderConfig?.showFullText ?? true, canDownloadSource: chatQuoteReaderConfig?.canDownloadSource ?? true, ...(await serviceSideProps(context, ['file', 'app', 'chat', 'workflow'])) diff --git a/projects/app/src/pages/chat/share.tsx b/projects/app/src/pages/chat/share.tsx index 526c82bce..2b29260c3 100644 --- a/projects/app/src/pages/chat/share.tsx +++ b/projects/app/src/pages/chat/share.tsx @@ -416,7 +416,7 @@ export async function getServerSideProps(context: any) { { shareId }, - 'appId canDownloadSource showQuote showFullText showRunningStatus' + 'appId canDownloadSource showCite showFullText showRunningStatus' ) .populate<{ associatedApp: AppSchema }>('associatedApp', 'name avatar intro') .lean(); @@ -433,7 +433,7 @@ export async function getServerSideProps(context: any) { appAvatar: app?.associatedApp?.avatar ?? '', appIntro: app?.associatedApp?.intro ?? 'AI', canDownloadSource: app?.canDownloadSource ?? false, - isShowQuote: app?.showQuote ?? false, + isShowQuote: app?.showCite ?? false, isShowFullText: app?.showFullText ?? false, showRunningStatus: app?.showRunningStatus ?? false, shareId: shareId ?? '', diff --git a/projects/app/src/service/support/permission/auth/chat.ts b/projects/app/src/service/support/permission/auth/chat.ts index d7b13eafd..e9dbd76f5 100644 --- a/projects/app/src/service/support/permission/auth/chat.ts +++ b/projects/app/src/service/support/permission/auth/chat.ts @@ -24,7 +24,7 @@ import { ChatRoleEnum } from '@fastgpt/global/core/chat/constants'; Chat没有读写的权限之分,鉴权过了,都可以操作。 */ export const defaultResponseShow = { - showQuote: true, + showCite: true, showRunningStatus: true, showFullText: true, canDownloadSource: true @@ -55,7 +55,7 @@ export async function authChatCrud({ tmbId: string; uid: string; chat?: ChatSchemaType; - showQuote: boolean; + showCite: boolean; showRunningStatus: boolean; showFullText: boolean; canDownloadSource: boolean; @@ -111,7 +111,7 @@ export async function authChatCrud({ teamId: String(outLinkConfig.teamId), tmbId: String(outLinkConfig.tmbId), uid, - showQuote: outLinkConfig.showQuote, + showCite: outLinkConfig.showCite, showRunningStatus: outLinkConfig.showRunningStatus ?? true, showFullText: outLinkConfig.showFullText ?? false, canDownloadSource: outLinkConfig.canDownloadSource ?? false, @@ -126,7 +126,7 @@ export async function authChatCrud({ teamId: String(outLinkConfig.teamId), tmbId: String(outLinkConfig.tmbId), uid, - showQuote: outLinkConfig.showQuote, + showCite: outLinkConfig.showCite, showRunningStatus: outLinkConfig.showRunningStatus ?? true, showFullText: outLinkConfig.showFullText ?? false, canDownloadSource: outLinkConfig.canDownloadSource ?? false, @@ -139,7 +139,7 @@ export async function authChatCrud({ tmbId: String(outLinkConfig.tmbId), chat, uid, - showQuote: outLinkConfig.showQuote, + showCite: outLinkConfig.showCite, showRunningStatus: outLinkConfig.showRunningStatus ?? true, showFullText: outLinkConfig.showFullText ?? false, canDownloadSource: outLinkConfig.canDownloadSource ?? false, diff --git a/projects/app/src/service/support/permission/auth/outLink.ts b/projects/app/src/service/support/permission/auth/outLink.ts index 34256b804..edb74abb0 100644 --- a/projects/app/src/service/support/permission/auth/outLink.ts +++ b/projects/app/src/service/support/permission/auth/outLink.ts @@ -63,7 +63,7 @@ export async function authOutLinkChatStart({ teamId: outLinkConfig.teamId, tmbId: outLinkConfig.tmbId, authType: AuthUserTypeEnum.token, - showQuote: outLinkConfig.showQuote, + showCite: outLinkConfig.showCite, showRunningStatus: outLinkConfig.showRunningStatus, showFullText: outLinkConfig.showFullText, canDownloadSource: outLinkConfig.canDownloadSource, diff --git a/projects/app/src/web/core/app/constants.ts b/projects/app/src/web/core/app/constants.ts index ee7d3d848..429d0746c 100644 --- a/projects/app/src/web/core/app/constants.ts +++ b/projects/app/src/web/core/app/constants.ts @@ -27,7 +27,7 @@ export const defaultApp: AppDetailType = { export const defaultOutLinkForm: OutLinkEditType = { name: '', showRunningStatus: true, - showQuote: false, + showCite: false, showFullText: false, canDownloadSource: false, limit: { diff --git a/projects/app/test/pages/api/support/outLink/playground/config.test.ts b/projects/app/test/pages/api/support/outLink/playground/config.test.ts index a0c0d3d0d..8fedb72a2 100644 --- a/projects/app/test/pages/api/support/outLink/playground/config.test.ts +++ b/projects/app/test/pages/api/support/outLink/playground/config.test.ts @@ -49,7 +49,7 @@ describe('Playground Visibility Config API', () => { expect(res.error).toBeUndefined(); expect(res.data).toEqual({ showRunningStatus: true, - showQuote: true, + showCite: true, showFullText: true, canDownloadSource: true }); @@ -70,7 +70,7 @@ describe('Playground Visibility Config API', () => { name: 'Playground Chat', type: PublishChannelEnum.playground, showRunningStatus: false, - showQuote: false, + showCite: false, showFullText: false, canDownloadSource: false, usagePoints: 0, @@ -89,7 +89,7 @@ describe('Playground Visibility Config API', () => { expect(res.error).toBeUndefined(); expect(res.data).toEqual({ showRunningStatus: false, - showQuote: false, + showCite: false, showFullText: false, canDownloadSource: false }); @@ -132,7 +132,7 @@ describe('Playground Visibility Config API', () => { name: 'Playground Chat', type: PublishChannelEnum.playground, showRunningStatus: true, - showQuote: false, + showCite: false, showFullText: true, canDownloadSource: false, usagePoints: 0, @@ -151,7 +151,7 @@ describe('Playground Visibility Config API', () => { expect(res.error).toBeUndefined(); expect(res.data).toEqual({ showRunningStatus: true, - showQuote: false, + showCite: false, showFullText: true, canDownloadSource: false }); diff --git a/projects/app/test/pages/api/support/outLink/playground/update.test.ts b/projects/app/test/pages/api/support/outLink/playground/update.test.ts index 66a73b734..6784372f1 100644 --- a/projects/app/test/pages/api/support/outLink/playground/update.test.ts +++ b/projects/app/test/pages/api/support/outLink/playground/update.test.ts @@ -40,7 +40,7 @@ describe('Playground Visibility Update API', () => { const updateData: UpdatePlaygroundVisibilityConfigBody = { appId: testApp._id, showRunningStatus: false, - showQuote: false, + showCite: false, showFullText: false, canDownloadSource: false }; @@ -64,7 +64,7 @@ describe('Playground Visibility Update API', () => { expect(createdConfig.appId).toBe(testApp._id); expect(createdConfig.type).toBe(PublishChannelEnum.playground); expect(createdConfig.showRunningStatus).toBe(false); - expect(createdConfig.showQuote).toBe(false); + expect(createdConfig.showCite).toBe(false); expect(createdConfig.showFullText).toBe(false); expect(createdConfig.canDownloadSource).toBe(false); } @@ -79,7 +79,7 @@ describe('Playground Visibility Update API', () => { const updateData: UpdatePlaygroundVisibilityConfigBody = { appId: testApp._id, showRunningStatus: true, - showQuote: true, + showCite: true, showFullText: true, canDownloadSource: true }; @@ -101,7 +101,7 @@ describe('Playground Visibility Update API', () => { if (createdConfig) { expect(createdConfig.showRunningStatus).toBe(true); - expect(createdConfig.showQuote).toBe(true); + expect(createdConfig.showCite).toBe(true); expect(createdConfig.showFullText).toBe(true); expect(createdConfig.canDownloadSource).toBe(true); } @@ -116,7 +116,7 @@ describe('Playground Visibility Update API', () => { const updateData: UpdatePlaygroundVisibilityConfigBody = { appId: testApp._id, showRunningStatus: false, - showQuote: true, + showCite: true, showFullText: false, canDownloadSource: true }; @@ -138,7 +138,7 @@ describe('Playground Visibility Update API', () => { if (createdConfig) { expect(createdConfig.showRunningStatus).toBe(false); - expect(createdConfig.showQuote).toBe(true); + expect(createdConfig.showCite).toBe(true); expect(createdConfig.showFullText).toBe(false); expect(createdConfig.canDownloadSource).toBe(true); } @@ -167,7 +167,7 @@ describe('Playground Visibility Update API', () => { const updateData: UpdatePlaygroundVisibilityConfigBody = { appId: '', showRunningStatus: false, - showQuote: false, + showCite: false, showFullText: false, canDownloadSource: false }; @@ -185,7 +185,7 @@ describe('Playground Visibility Update API', () => { const updateData: UpdatePlaygroundVisibilityConfigBody = { appId: testApp._id, showRunningStatus: false, - showQuote: false, + showCite: false, showFullText: false, canDownloadSource: false }; @@ -233,7 +233,7 @@ describe('Playground Visibility Update API', () => { name: 'Playground Chat', type: PublishChannelEnum.playground, showRunningStatus: true, - showQuote: true, + showCite: true, showFullText: true, canDownloadSource: true, usagePoints: 0, @@ -244,7 +244,7 @@ describe('Playground Visibility Update API', () => { const updateData: UpdatePlaygroundVisibilityConfigBody = { appId: testApp2._id, showRunningStatus: false, - showQuote: false, + showCite: false, showFullText: true, canDownloadSource: true }; @@ -266,7 +266,7 @@ describe('Playground Visibility Update API', () => { if (config1) { expect(config1.showRunningStatus).toBe(true); - expect(config1.showQuote).toBe(true); + expect(config1.showCite).toBe(true); } // Verify second app config was created with new values @@ -277,7 +277,7 @@ describe('Playground Visibility Update API', () => { if (config2) { expect(config2.showRunningStatus).toBe(false); - expect(config2.showQuote).toBe(false); + expect(config2.showCite).toBe(false); expect(config2.showFullText).toBe(true); expect(config2.canDownloadSource).toBe(true); } diff --git a/projects/app/test/service/support/permission/auth/chat.test.ts b/projects/app/test/service/support/permission/auth/chat.test.ts index 5615f4540..dd1544138 100644 --- a/projects/app/test/service/support/permission/auth/chat.test.ts +++ b/projects/app/test/service/support/permission/auth/chat.test.ts @@ -80,7 +80,7 @@ describe('authChatCrud', () => { teamId: 'team1', tmbId: 'tmb1', uid: 'user1', - showQuote: true, + showCite: true, showRunningStatus: true, showFullText: true, canDownloadSource: true, @@ -117,7 +117,7 @@ describe('authChatCrud', () => { tmbId: 'tmb1', uid: 'user1', chat: mockChat, - showQuote: true, + showCite: true, showRunningStatus: true, showFullText: true, canDownloadSource: true, @@ -147,7 +147,7 @@ describe('authChatCrud', () => { teamId: 'team1', tmbId: 'tmb1', uid: 'user1', - showQuote: true, + showCite: true, showRunningStatus: true, showFullText: true, canDownloadSource: true, @@ -189,7 +189,7 @@ describe('authChatCrud', () => { outLinkConfig: { teamId: 'team1', tmbId: 'tmb1', - showQuote: true, + showCite: true, showRunningStatus: true, canDownloadSource: true }, @@ -209,7 +209,7 @@ describe('authChatCrud', () => { teamId: 'team1', tmbId: 'tmb1', uid: 'user1', - showQuote: true, + showCite: true, showRunningStatus: true, showFullText: false, canDownloadSource: true, @@ -222,7 +222,7 @@ describe('authChatCrud', () => { outLinkConfig: { teamId: 'team1', tmbId: 'tmb1', - showQuote: false, + showCite: false, shareId: 'share1', outLinkUid: 'user1' }, @@ -242,7 +242,7 @@ describe('authChatCrud', () => { teamId: 'team1', tmbId: 'tmb1', uid: 'user1', - showQuote: false, + showCite: false, showRunningStatus: true, // default canDownloadSource: false, // default authType: AuthUserTypeEnum.outLink @@ -259,7 +259,7 @@ describe('authChatCrud', () => { outLinkConfig: { teamId: 'team1', tmbId: 'tmb1', - showQuote: true, + showCite: true, showRunningStatus: true, canDownloadSource: true }, @@ -285,7 +285,7 @@ describe('authChatCrud', () => { tmbId: 'tmb1', uid: 'user1', chat: mockChat, - showQuote: true, + showCite: true, showRunningStatus: true, showFullText: false, canDownloadSource: true, @@ -298,7 +298,7 @@ describe('authChatCrud', () => { outLinkConfig: { teamId: 'team1', tmbId: 'tmb1', - showQuote: true, + showCite: true, showRunningStatus: false, canDownloadSource: true }, @@ -323,7 +323,7 @@ describe('authChatCrud', () => { teamId: 'team1', tmbId: 'tmb1', uid: 'user1', - showQuote: true, + showCite: true, showRunningStatus: false, showFullText: false, canDownloadSource: true, @@ -341,7 +341,7 @@ describe('authChatCrud', () => { outLinkConfig: { teamId: 'team1', tmbId: 'tmb1', - showQuote: true, + showCite: true, showFullText: true, showRunningStatus: true, canDownloadSource: true @@ -437,7 +437,7 @@ describe('authChatCrud', () => { teamId: 'team1', tmbId: 'tmb1', uid: 'tmb1', - showQuote: true, + showCite: true, showRunningStatus: true, showFullText: true, canDownloadSource: true, @@ -477,7 +477,7 @@ describe('authChatCrud', () => { tmbId: 'tmb1', uid: 'tmb1', chat: mockChat, - showQuote: true, + showCite: true, showRunningStatus: true, showFullText: true, canDownloadSource: true, @@ -518,7 +518,7 @@ describe('authChatCrud', () => { tmbId: 'tmb1', uid: 'tmb1', chat: mockChat, - showQuote: true, + showCite: true, showRunningStatus: true, showFullText: true, canDownloadSource: true, @@ -551,7 +551,7 @@ describe('authChatCrud', () => { teamId: 'team1', tmbId: 'tmb1', uid: 'tmb1', - showQuote: true, + showCite: true, showRunningStatus: true, showFullText: true, canDownloadSource: true,