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

Function getFileMetadataById

apps/sim/lib/uploads/server/metadata.ts:211–224  ·  view source on GitHub ↗
(
  id: string,
  options?: { includeDeleted?: boolean }
)

Source from the content-addressed store, hash-verified

209 * Get file metadata by ID
210 */
211export async function getFileMetadataById(
212 id: string,
213 options?: { includeDeleted?: boolean }
214): Promise<FileMetadataRecord | null> {
215 const { includeDeleted = false } = options ?? {}
216 const conditions = [eq(workspaceFiles.id, id)]
217 if (!includeDeleted) conditions.push(isNull(workspaceFiles.deletedAt))
218 const [record] = await db
219 .select()
220 .from(workspaceFiles)
221 .where(conditions.length > 1 ? and(...conditions) : conditions[0])
222 .limit(1)
223 return record ?? null
224}
225
226/**
227 * Delete file metadata by key

Callers 3

route.tsFile · 0.90
route.tsFile · 0.90

Calls 2

eqFunction · 0.50
pushMethod · 0.45

Tested by

no test coverage detected