diff --git a/common/src/commonMain/kotlin/com/artemchep/keyguard/common/service/export/impl/ExportServiceImpl.kt b/common/src/commonMain/kotlin/com/artemchep/keyguard/common/service/export/impl/ExportServiceImpl.kt index 9e4f93a..8d820e3 100644 --- a/common/src/commonMain/kotlin/com/artemchep/keyguard/common/service/export/impl/ExportServiceImpl.kt +++ b/common/src/commonMain/kotlin/com/artemchep/keyguard/common/service/export/impl/ExportServiceImpl.kt @@ -146,6 +146,26 @@ class ExportServiceImpl( put("creationDate", instant = createdDate ?: revisionDate) put("deletedDate", deletedDate) + run { + val key = "attachments" + // TODO: Export local attachments with their + // local identifier. + val remoteAttachments = attachments + .mapNotNull { it as? DSecret.Attachment.Remote } + if (remoteAttachments.isNotEmpty()) { + putJsonArray(key) { + remoteAttachments.forEach { attachment -> + val obj = buildJsonObject { + put("id", attachment.remoteCipherId) + put("size", attachment.size) + put("fileName", attachment.fileName) + } + add(obj) + } + } + } + } + // // Type //