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

Function headObject

apps/sim/lib/uploads/core/storage-service.ts:509–526  ·  view source on GitHub ↗
(
  key: string,
  context: StorageContext
)

Source from the content-addressed store, hash-verified

507 * Throws on errors other than "not found". For local filesystem, returns null.
508 */
509export async function headObject(
510 key: string,
511 context: StorageContext
512): Promise<{ size: number; contentType?: string } | null> {
513 const config = getStorageConfig(context)
514
515 if (USE_BLOB_STORAGE) {
516 const { headBlobObject } = await import('@/lib/uploads/providers/blob/client')
517 return headBlobObject(key, createBlobConfig(config))
518 }
519
520 if (USE_S3_STORAGE) {
521 const { headS3Object } = await import('@/lib/uploads/providers/s3/client')
522 return headS3Object(key, createS3Config(config))
523 }
524
525 return null
526}
527
528/**
529 * Generate a presigned URL for direct file upload

Callers 3

runTableImportFunction · 0.90
getOrCreateTableSnapshotFunction · 0.90

Calls 5

getStorageConfigFunction · 0.90
headBlobObjectFunction · 0.85
createBlobConfigFunction · 0.85
headS3ObjectFunction · 0.85
createS3ConfigFunction · 0.85

Tested by

no test coverage detected