Skip to main content

@idpass/data-collect-core / AttachmentStore

Interface: AttachmentStore

Defined in: interfaces/types.ts:1102

Storage interface for file attachments.

Provides CRUD operations for attachment metadata and binary data, along with sync-related queries for offline-first upload workflows.

Methods​

saveAttachment()​

saveAttachment(metadata, data): Promise<void>

Defined in: interfaces/types.ts:1104

Save attachment metadata and binary data

Parameters​

metadata​

AttachmentMetadata

data​

ArrayBuffer

Returns​

Promise<void>


getAttachment()​

getAttachment(guid): Promise<{ metadata: AttachmentMetadata; data: ArrayBuffer; } | null>

Defined in: interfaces/types.ts:1106

Get attachment metadata and binary data by GUID

Parameters​

guid​

string

Returns​

Promise<{ metadata: AttachmentMetadata; data: ArrayBuffer; } | null>


getAttachmentMetadata()​

getAttachmentMetadata(guid): Promise<AttachmentMetadata | null>

Defined in: interfaces/types.ts:1108

Get only the metadata for an attachment (without loading binary data)

Parameters​

guid​

string

Returns​

Promise<AttachmentMetadata | null>


listAttachments()​

listAttachments(entityGuid): Promise<AttachmentMetadata[]>

Defined in: interfaces/types.ts:1110

List all attachments for a specific entity

Parameters​

entityGuid​

string

Returns​

Promise<AttachmentMetadata[]>


deleteAttachment()​

deleteAttachment(guid): Promise<void>

Defined in: interfaces/types.ts:1112

Delete an attachment and its binary data

Parameters​

guid​

string

Returns​

Promise<void>


getPendingAttachments()​

getPendingAttachments(tenantId): Promise<AttachmentMetadata[]>

Defined in: interfaces/types.ts:1114

Get all attachments with 'pending' sync status for a tenant

Parameters​

tenantId​

string

Returns​

Promise<AttachmentMetadata[]>


updateSyncStatus()​

updateSyncStatus(guid, status): Promise<void>

Defined in: interfaces/types.ts:1116

Update the sync status of an attachment

Parameters​

guid​

string

status​

"pending" | "uploaded" | "failed"

Returns​

Promise<void>