(fileUrl: string | null)
| 1831 | } |
| 1832 | |
| 1833 | function getKnowledgeBaseStorageKey(fileUrl: string | null): string | null { |
| 1834 | if (!fileUrl) { |
| 1835 | return null |
| 1836 | } |
| 1837 | |
| 1838 | try { |
| 1839 | const urlPath = new URL(fileUrl, 'http://localhost').pathname |
| 1840 | const storageKey = extractStorageKey(urlPath) |
| 1841 | return storageKey !== urlPath ? storageKey : null |
| 1842 | } catch { |
| 1843 | return null |
| 1844 | } |
| 1845 | } |
| 1846 | |
| 1847 | export async function deleteDocumentStorageFiles( |
| 1848 | documentsToDelete: Array<{ id: string; fileUrl: string | null; workspaceId?: string | null }>, |
no test coverage detected