MCPcopy Index your code
hub / github.com/simstudioai/sim / getKnowledgeBaseStorageKey

Function getKnowledgeBaseStorageKey

apps/sim/lib/knowledge/documents/service.ts:1833–1845  ·  view source on GitHub ↗
(fileUrl: string | null)

Source from the content-addressed store, hash-verified

1831}
1832
1833function 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
1847export async function deleteDocumentStorageFiles(
1848 documentsToDelete: Array<{ id: string; fileUrl: string | null; workspaceId?: string | null }>,

Callers 4

createDocumentRecordsFunction · 0.85
createSingleDocumentFunction · 0.85

Calls 1

extractStorageKeyFunction · 0.90

Tested by

no test coverage detected