MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / analyzeIncrementalImport

Method analyzeIncrementalImport

src/services/import/fetch.ts:193–212  ·  view source on GitHub ↗
(sessionId: string, file: File | string)

Source from the content-addressed store, hash-verified

191 }
192
193 async analyzeIncrementalImport(sessionId: string, file: File | string): Promise<IncrementalAnalysis> {
194 if (typeof file === 'string') {
195 return { newMessageCount: 0, duplicateCount: 0, totalInFile: 0, error: 'File path not supported in Web mode' }
196 }
197
198 const form = new FormData()
199 form.append('file', file)
200
201 const res = await fetchWithAuth(`${getBaseUrl()}/sessions/${sessionId}/import/incremental/analyze`, {
202 method: 'POST',
203 body: form,
204 })
205
206 if (!res.ok) {
207 const text = await res.text()
208 return { newMessageCount: 0, duplicateCount: 0, totalInFile: 0, error: `HTTP ${res.status}: ${text}` }
209 }
210
211 return (await res.json()) as IncrementalAnalysis
212 }
213
214 async incrementalImport(
215 sessionId: string,

Callers

nothing calls this directly

Calls 3

fetchWithAuthFunction · 0.90
getBaseUrlFunction · 0.90
textMethod · 0.80

Tested by

no test coverage detected