diff --git a/Sources/NextcloudKit/NextcloudKit+E2EE.swift b/Sources/NextcloudKit/NextcloudKit+E2EE.swift index 28640a69..ec2eb9af 100644 --- a/Sources/NextcloudKit/NextcloudKit+E2EE.swift +++ b/Sources/NextcloudKit/NextcloudKit+E2EE.swift @@ -163,6 +163,25 @@ public extension NextcloudKit { } } + // Async wrapper for getE2EEMetadata + func getE2EEMetadataAsync(fileId: String, + e2eToken: String? = nil, + account: String, + options: NKRequestOptions = NKRequestOptions(), + taskHandler: @escaping (_ task: URLSessionTask) -> Void = { _ in }) async -> (account: String, e2eMetadata: String?, signature: String?, responseData: AFDataResponse?, error: NKError) { + await withCheckedContinuation { continuation in + getE2EEMetadata( + fileId: fileId, + e2eToken: e2eToken, + account: account, + options: options, + taskHandler: taskHandler + ) { account, e2eMetadata, signature, responseData, error in + continuation.resume(returning: (account: account, e2eMetadata: e2eMetadata, signature: signature, responseData: responseData, error: error)) + } + } + } + func putE2EEMetadata(fileId: String, e2eToken: String, e2eMetadata: String?,