Skip to content

Commit

Permalink
Initial transport implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
polpielladev committed Mar 17, 2024
1 parent 937e441 commit cabccd4
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 2 deletions.
2 changes: 0 additions & 2 deletions Sources/XcodeCloudKit/Template.swift

This file was deleted.

20 changes: 20 additions & 0 deletions Sources/XcodeCloudKit/Transport/AppStoreConnectAPIAdapter.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import AppStoreConnect_Swift_SDK

class AppStoreConnectSDKTransport: Transport {
private let appStoreConnectSDK: APIProvider

init(appStoreConnectSDK: APIProvider) {
self.appStoreConnectSDK = appStoreConnectSDK
}

func perform<T: Decodable>(request: TransportRequest<T>) async throws -> T {
let request = Request<T>(
path: request.path,
method: request.method,
query: request.queryParameters,
id: ""
)

return try await appStoreConnectSDK.request(request)
}
}
9 changes: 9 additions & 0 deletions Sources/XcodeCloudKit/Transport/AuthenticatedTransport.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
protocol Transport {
func perform<T: Decodable>(request: TransportRequest<T>) async throws -> T
}

struct TransportRequest<T: Decodable> {
let path: String
let method: String
let queryParameters: [(key: String, value: String?)]?
}
6 changes: 6 additions & 0 deletions Sources/XcodeCloudKit/Transport/RequestBuilder.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import AppStoreConnect_Swift_SDK

// Will populate with requests
enum RequestBuilder {
}

0 comments on commit cabccd4

Please sign in to comment.