Skip to main content

@idpass/data-collect-core / AttachmentStore

Interface: AttachmentStore

Defined in: interfaces/types.ts:1021

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:1023

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:1025

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:1027

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:1029

List all attachments for a specific entity

Parameters

entityGuid

string

Returns

Promise<AttachmentMetadata[]>


deleteAttachment()

deleteAttachment(guid): Promise<void>

Defined in: interfaces/types.ts:1031

Delete an attachment and its binary data

Parameters

guid

string

Returns

Promise<void>


getPendingAttachments()

getPendingAttachments(tenantId): Promise<AttachmentMetadata[]>

Defined in: interfaces/types.ts:1033

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:1035

Update the sync status of an attachment

Parameters

guid

string

status

"pending" | "uploaded" | "failed"

Returns

Promise<void>