refactor(chatApi): type the request builders as unknown

The four params/body objects these endpoints assemble are written to and
handed straight to http — nothing reads a property back — so they carry
Record<string, unknown> instead of Record<string, any>. Suppression
budget shrinks with them.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Kinyoo
2026-08-17 11:56:02 +08:00
parent f489c1dd1d
commit 3cd62f3909
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -65,7 +65,7 @@
},
"src/api/chatApi.ts": {
"@typescript-eslint/no-explicit-any": {
"count": 19
"count": 16
}
},
"src/api/index.ts": {
+4 -4
View File
@@ -597,7 +597,7 @@ export async function getFolderSessions(
spaceId: string | number,
folderId?: string | number
): Promise<FolderSession[]> {
const params: Record<string, any> = {};
const params: Record<string, unknown> = {};
if (folderId != null && folderId !== "") params.folder_id = folderId;
const res = await http.get(
`/api/v1/knowledge/space/${spaceId}/chat/folder/session`,
@@ -614,7 +614,7 @@ export async function createFolderSession(
spaceId: string | number,
folderId?: number
): Promise<FolderSession> {
const body: Record<string, any> = {};
const body: Record<string, unknown> = {};
if (folderId != null) body.folder_id = folderId;
const res = await http.post(
`/api/v1/knowledge/space/${spaceId}/chat/folder/session`,
@@ -629,7 +629,7 @@ export async function deleteFolderSession(
chatId: string,
folderId?: number
): Promise<void> {
const body: Record<string, any> = { chat_id: chatId };
const body: Record<string, unknown> = { chat_id: chatId };
if (folderId != null) body.folder_id = folderId;
await http.deleteWithOptions(
`/api/v1/knowledge/space/${spaceId}/chat/folder/session`,
@@ -657,7 +657,7 @@ export async function getFolderChatHistory(
pageSize?: number;
}
): Promise<ChatMessage[]> {
const queryParams: Record<string, any> = {};
const queryParams: Record<string, unknown> = {};
if (params.folderId != null && params.folderId !== "")
queryParams.folder_id = params.folderId;
if (params.chatId) queryParams.chat_id = params.chatId;