( perspectiveId: string, fileName: string )
| 70 | |
| 71 | /** Get asset binary data for serving. */ |
| 72 | export async function getAssetData( |
| 73 | perspectiveId: string, |
| 74 | fileName: string |
| 75 | ): Promise<{ file_data: Buffer; file_mime_type: string; file_name: string } | null> { |
| 76 | const result = await query<{ file_data: Buffer; file_mime_type: string; file_name: string }>( |
| 77 | `SELECT file_data, file_mime_type, file_name |
| 78 | FROM perspective_assets |
| 79 | WHERE perspective_id = $1 AND file_name = $2`, |
| 80 | [perspectiveId, fileName] |
| 81 | ); |
| 82 | return result.rows[0] || null; |
| 83 | } |
| 84 | |
| 85 | /** List all assets for a perspective (metadata only, no binary). */ |
| 86 | export async function getAssetsByPerspective(perspectiveId: string): Promise<PerspectiveAsset[]> { |
no outgoing calls
no test coverage detected