Skip to content

Blobs

A blob is an opaque binary object stored on the node — an application bundle or arbitrary app data. mero.admin covers the full lifecycle; blob bytes are plain Data.

let bytes: Data = try Data(contentsOf: fileURL)
let info = try await mero.admin.uploadBlob(
UploadBlobRequest(data: bytes, hash: nil, contextId: contextId) // hash & contextId optional
)
let blobId = info.blobId

The body is sent as raw application/octet-stream to PUT /admin-api/blobs.

let blobs = try await mero.admin.listBlobs().blobs // [BlobInfo] — blobId, size

getBlobInfo issues a HEAD request — size, hash, and MIME type come from the response headers without transferring the body:

let meta = try await mero.admin.getBlobInfo(blobId)
// meta.blobId, meta.size, meta.hash, meta.mimeType

getBlob returns the raw bytes as Data (the endpoint streams the content, not JSON):

let data: Data = try await mero.admin.getBlob(blobId)
let result = try await mero.admin.deleteBlob(blobId) // result.deleted