@@ -131,6 +131,18 @@ public extension NextcloudKit {
131131 }
132132 }
133133
134+ func getExternalSiteAsync( account: String ,
135+ options: NKRequestOptions = NKRequestOptions ( ) ,
136+ taskHandler: @escaping ( _ task: URLSessionTask ) -> Void = { _ in } ) async -> ( account: String , externalFiles: [ NKExternalSite ] , responseData: AFDataResponse < Data > ? , error: NKError ) {
137+ await withUnsafeContinuation { continuation in
138+ getExternalSite ( account: account,
139+ options: options,
140+ taskHandler: taskHandler) { account, externalFiles, responseData, error in
141+ continuation. resume ( returning: ( account, externalFiles, responseData, error) )
142+ }
143+ }
144+ }
145+
134146 // MARK: - getServerStatus
135147
136148 struct ServerInfo {
@@ -151,17 +163,6 @@ public extension NextcloudKit {
151163 case failure( NKError )
152164 }
153165
154- ///
155- /// Asynchronous method wrapper for ``getServerStatus(serverUrl:options:taskHandler:completion:)``.
156- ///
157- func getServerStatus( serverUrl: String , options: NKRequestOptions = NKRequestOptions ( ) , taskHandler: @escaping ( _ task: URLSessionTask ) -> Void = { _ in } ) async -> ServerInfoResult {
158- await withCheckedContinuation { continuation in
159- getServerStatus ( serverUrl: serverUrl, options: options, taskHandler: taskHandler) { _, serverInfoResult in
160- continuation. resume ( returning: serverInfoResult)
161- }
162- }
163- }
164-
165166 func getServerStatus( serverUrl: String ,
166167 options: NKRequestOptions = NKRequestOptions ( ) ,
167168 taskHandler: @escaping ( _ task: URLSessionTask ) -> Void = { _ in } ,
@@ -217,12 +218,15 @@ public extension NextcloudKit {
217218 }
218219
219220 func getServerStatusAsync( serverUrl: String ,
220- options: NKRequestOptions = NKRequestOptions ( ) ) async -> NextcloudKit . ServerInfoResult {
221- await withUnsafeContinuation ( { continuation in
222- NextcloudKit . shared. getServerStatus ( serverUrl: serverUrl) { _, serverInfoResult in
223- continuation. resume ( returning: serverInfoResult)
221+ options: NKRequestOptions = NKRequestOptions ( ) ,
222+ taskHandler: @escaping ( _ task: URLSessionTask ) -> Void = { _ in } ) async -> ( responseData: AFDataResponse < Data > ? , result: ServerInfoResult ) {
223+ await withUnsafeContinuation { continuation in
224+ getServerStatus ( serverUrl: serverUrl,
225+ options: options,
226+ taskHandler: taskHandler) { responseData, result in
227+ continuation. resume ( returning: ( responseData, result) )
224228 }
225- } )
229+ }
226230 }
227231
228232 // MARK: -
@@ -463,6 +467,28 @@ public extension NextcloudKit {
463467 }
464468 }
465469
470+ func downloadAvatarAsync( user: String ,
471+ fileNameLocalPath: String ,
472+ sizeImage: Int ,
473+ avatarSizeRounded: Int = 0 ,
474+ etag: String ? ,
475+ account: String ,
476+ options: NKRequestOptions = NKRequestOptions ( ) ,
477+ taskHandler: @escaping ( _ task: URLSessionTask ) -> Void = { _ in } ) async -> ( account: String , imageAvatar: UIImage ? , imageOriginal: UIImage ? , etag: String ? , responseData: AFDataResponse < Data ? > ? , error: NKError ) {
478+ await withUnsafeContinuation { continuation in
479+ downloadAvatar ( user: user,
480+ fileNameLocalPath: fileNameLocalPath,
481+ sizeImage: sizeImage,
482+ avatarSizeRounded: avatarSizeRounded,
483+ etag: etag,
484+ account: account,
485+ options: options,
486+ taskHandler: taskHandler) { account, imageAvatar, imageOriginal, etag, responseData, error in
487+ continuation. resume ( returning: ( account, imageAvatar, imageOriginal, etag, responseData, error) )
488+ }
489+ }
490+ }
491+
466492 func downloadContent( serverUrl: String ,
467493 account: String ,
468494 options: NKRequestOptions = NKRequestOptions ( ) ,
@@ -624,7 +650,6 @@ public extension NextcloudKit {
624650 }
625651 // MARK: -
626652
627-
628653 func getCapabilities( account: String ,
629654 options: NKRequestOptions = NKRequestOptions ( ) ,
630655 taskHandler: @escaping ( _ task: URLSessionTask ) -> Void = { _ in } ,
@@ -653,6 +678,18 @@ public extension NextcloudKit {
653678 }
654679 }
655680
681+ func getCapabilitiesAsync( account: String ,
682+ options: NKRequestOptions = NKRequestOptions ( ) ,
683+ taskHandler: @escaping ( _ task: URLSessionTask ) -> Void = { _ in } ) async -> ( account: String , responseData: AFDataResponse < Data ? > ? , error: NKError ) {
684+ await withUnsafeContinuation { continuation in
685+ getCapabilities ( account: account,
686+ options: options,
687+ taskHandler: taskHandler) { account, responseData, error in
688+ continuation. resume ( returning: ( account, responseData, error) )
689+ }
690+ }
691+ }
692+
656693 // MARK: -
657694
658695 func getRemoteWipeStatus( serverUrl: String ,
0 commit comments