feat: blobs fetch
PHP Unit Tests / test (pull_request) Failing after 11m59s
JS Unit Tests / test (pull_request) Failing after 12m1s
Build Test / test (pull_request) Failing after 12m3s

Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
2026-06-18 19:38:11 -04:00
parent 105f69c3a5
commit bb349646c3
4 changed files with 98 additions and 1 deletions
+17
View File
@@ -8,6 +8,7 @@ import { entityService } from '../services'
import { EntityObject, MessageObject } from '../models'
import type {
EntityBlobSelector,
EntityBlobsResponse,
EntityDownloadRequest,
EntityTransmitRequest,
EntityTransmitResponse,
@@ -508,6 +509,21 @@ export const useEntitiesStore = defineStore('mailEntitiesStore', () => {
}
}
/**
* Fetch one or more message parts (attachments) inline as Blobs, for preview.
*/
async function blobs(
target: EntityIdentifier,
parts: EntityBlobSelector[],
): Promise<EntityBlobsResponse> {
try {
return await entityService.blobs({ target, parts })
} catch (error: any) {
console.error('[Mail Manager][Store] - Failed to fetch attachment blobs:', error)
throw error
}
}
// Return public API
return {
// State (readonly)
@@ -530,5 +546,6 @@ export const useEntitiesStore = defineStore('mailEntitiesStore', () => {
move,
transmit,
download,
blobs,
}
})