@@ -6,7 +6,7 @@ class SwiftIosTarget < SwiftTarget
6
6
import Alamofire
7
7
import KeychainSwift
8
8
9
- protocol ApiCallsLogic: class {\n
9
+ public protocol ApiCallsLogic: class {\n
10
10
END
11
11
12
12
@ast .operations.each do |op |
24
24
@io << " }\n\n " # CloseAPICallsProtocol
25
25
@io << <<-END
26
26
27
- class API {
28
- static var customUrl: String?
29
- static var useStaging = false
30
- static var globalCallback: (_ method: String, _ result: ApiInternal.Result<Any?>, _ callback: ((ApiInternal.Result<Any?>) -> Void)?) -> Void = { _, result, callback in
27
+ public class API {
28
+ public static var customUrl: String?
29
+ public static var useStaging = false
30
+ public static var globalCallback: (_ method: String, _ result: ApiInternal.Result<Any?>, _ callback: ((ApiInternal.Result<Any?>) -> Void)?) -> Void = { _, result, callback in
31
31
callback?(result)
32
32
}
33
33
34
- static var isEnabledAssertion = true
35
- static var calls: ApiCallsLogic = Calls()
36
- static var apiInternal = ApiInternal()
34
+ public static var isEnabledAssertion = true
35
+ public static var calls: ApiCallsLogic = Calls()
36
+ public static var apiInternal = ApiInternal()
37
37
38
- static var decoder: JSONDecoder = {
38
+ public static var decoder: JSONDecoder = {
39
39
let currentDecoder = JSONDecoder()
40
40
currentDecoder.dateDecodingStrategy = .custom({ (decoder) -> Date in
41
41
let container = try decoder.singleValueContainer()
@@ -54,7 +54,7 @@ class API {
54
54
}()
55
55
56
56
// MARK: Struct and Enums
57
- struct NoReply: Codable {}\n\n
57
+ public struct NoReply: Codable {}\n\n
58
58
END
59
59
# ApiCalls
60
60
@io << ident(String .build do |io |
@@ -102,20 +102,20 @@ END
102
102
103
103
@io << <<-END
104
104
105
- class ApiInternal {
105
+ public class ApiInternal {
106
106
var baseUrl = #{ @ast .options.url.inspect}
107
107
108
108
// MARK: ApiInternal Inner classes
109
- enum Result<T> {
109
+ public enum Result<T> {
110
110
case success(T)
111
111
case failure(Error)
112
112
}
113
113
114
- class Error: Codable {
114
+ public class Error: Codable {
115
115
var type: API.ErrorType
116
116
var message: String
117
117
118
- init(type: API.ErrorType, message: String) {
118
+ public init(type: API.ErrorType, message: String) {
119
119
self.type = type
120
120
self.message = message
121
121
}
@@ -299,11 +299,11 @@ END
299
299
}
300
300
}
301
301
}
302
- protocol DisplayableValue: RawRepresentable {
302
+ public protocol DisplayableValue: RawRepresentable {
303
303
var displayableValue: String { get }
304
304
}
305
305
306
- extension DisplayableValue where RawValue == String {
306
+ public extension DisplayableValue where RawValue == String {
307
307
var displayableValue: String {
308
308
return self.rawValue
309
309
}
0 commit comments