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

Function insertFileMetadataHelper

apps/sim/lib/uploads/core/storage-service.ts:68–87  ·  view source on GitHub ↗

* Insert file metadata into the database

(
  key: string,
  metadata: Record<string, string>,
  context: StorageContext,
  fileName: string,
  contentType: string,
  fileSize: number
)

Source from the content-addressed store, hash-verified

66 * Insert file metadata into the database
67 */
68async function insertFileMetadataHelper(
69 key: string,
70 metadata: Record<string, string>,
71 context: StorageContext,
72 fileName: string,
73 contentType: string,
74 fileSize: number
75): Promise<void> {
76 const { insertFileMetadata } = await import('../server/metadata')
77 await insertFileMetadata({
78 key,
79 userId: metadata.userId,
80 workspaceId: metadata.workspaceId || null,
81 folderId: metadata.folderId || null,
82 context,
83 originalName: metadata.originalName || fileName,
84 contentType,
85 size: fileSize,
86 })
87}
88
89/**
90 * Upload a file to the configured storage provider with context-aware configuration

Callers 1

uploadFileFunction · 0.85

Calls 1

insertFileMetadataFunction · 0.85

Tested by

no test coverage detected