@@ -32,11 +32,11 @@ public final class Provider {
32
32
}
33
33
34
34
@discardableResult
35
- public func intercept( action: @escaping ( Request , ( Request ) async throws -> Response ) async throws -> Response ) -> Self {
35
+ public func intercept( action: @escaping ( PapyrusRequest , ( PapyrusRequest ) async throws -> PapyrusResponse ) async throws -> PapyrusResponse ) -> Self {
36
36
struct AnonymousInterceptor : Interceptor {
37
- let action : ( Request , Interceptor . Next ) async throws -> Response
37
+ let action : ( PapyrusRequest , Interceptor . Next ) async throws -> PapyrusResponse
38
38
39
- func intercept( req: Request , next: Interceptor . Next ) async throws -> Response {
39
+ func intercept( req: PapyrusRequest , next: Interceptor . Next ) async throws -> PapyrusResponse {
40
40
try await action ( req, next)
41
41
}
42
42
}
@@ -46,9 +46,9 @@ public final class Provider {
46
46
}
47
47
48
48
@discardableResult
49
- public func request( _ builder: inout RequestBuilder ) async throws -> Response {
49
+ public func request( _ builder: inout RequestBuilder ) async throws -> PapyrusResponse {
50
50
let request = try createRequest ( & builder)
51
- var next : ( Request ) async throws -> Response = http. request
51
+ var next : ( PapyrusRequest ) async throws -> PapyrusResponse = http. request
52
52
for interceptor in interceptors. reversed ( ) {
53
53
let _next = next
54
54
next = { try await interceptor. intercept ( req: $0, next: _next) }
@@ -57,7 +57,7 @@ public final class Provider {
57
57
return try await next ( request)
58
58
}
59
59
60
- private func createRequest( _ builder: inout RequestBuilder ) throws -> Request {
60
+ private func createRequest( _ builder: inout RequestBuilder ) throws -> PapyrusRequest {
61
61
for modifier in modifiers {
62
62
try modifier. modify ( req: & builder)
63
63
}
@@ -69,8 +69,8 @@ public final class Provider {
69
69
}
70
70
71
71
public protocol Interceptor {
72
- typealias Next = ( Request ) async throws -> Response
73
- func intercept( req: Request , next: Next ) async throws -> Response
72
+ typealias Next = ( PapyrusRequest ) async throws -> PapyrusResponse
73
+ func intercept( req: PapyrusRequest , next: Next ) async throws -> PapyrusResponse
74
74
}
75
75
76
76
public protocol RequestModifier {
0 commit comments