(file: {
id: string
name: string
folderId?: string | null
folderPath?: string | null
vfsPath?: string
contentType: string
size: number
uploadedAt: Date
})
| 282 | * Serialize workspace file metadata for VFS files/{path}/{name}/meta.json. |
| 283 | */ |
| 284 | export function serializeFileMeta(file: { |
| 285 | id: string |
| 286 | name: string |
| 287 | folderId?: string | null |
| 288 | folderPath?: string | null |
| 289 | vfsPath?: string |
| 290 | contentType: string |
| 291 | size: number |
| 292 | uploadedAt: Date |
| 293 | }): string { |
| 294 | return JSON.stringify( |
| 295 | { |
| 296 | id: file.id, |
| 297 | name: file.name, |
| 298 | folderId: file.folderId || undefined, |
| 299 | folderPath: file.folderPath || undefined, |
| 300 | vfsPath: file.vfsPath, |
| 301 | contentType: file.contentType, |
| 302 | size: file.size, |
| 303 | uploadedAt: file.uploadedAt.toISOString(), |
| 304 | readContentWith: file.vfsPath ? `${file.vfsPath}/content` : undefined, |
| 305 | note: 'This is file metadata only. To read the file text/bytes, read the readContentWith path (i.e. append /content).', |
| 306 | }, |
| 307 | null, |
| 308 | 2 |
| 309 | ) |
| 310 | } |
| 311 | |
| 312 | /** |
| 313 | * Serialize table metadata for VFS tables/{name}/meta.json |
no outgoing calls
no test coverage detected