├── .circleci └── config.yml ├── .gitignore ├── .swift-version ├── .swiftlint.yml ├── AutoGraph.podspec ├── AutoGraph.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings └── xcshareddata │ └── xcschemes │ ├── AutoGraph-Package.xcscheme │ └── AutoGraph.xcscheme ├── AutoGraph.xcworkspace ├── contents.xcworkspacedata └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── AutoGraph ├── AlamofireClient.swift ├── AuthHandler.swift ├── AutoGraph.h ├── AutoGraph.swift ├── Dispatcher.swift ├── Errors.swift ├── Info.plist ├── Request.swift ├── ResponseHandler.swift ├── SubscriptionRequest.swift ├── SubscriptionResponseHandler.swift ├── SubscriptionResponseSerializer.swift ├── Utilities.swift ├── WebSocketClient.swift └── WebSocketError.swift ├── AutoGraphTests ├── AlamofireClientTests.swift ├── AuthHandlerTests.swift ├── AutoGraphTests.swift ├── Data │ ├── AllFilms.json │ ├── Film.json │ ├── Film.swift │ ├── Film401.json │ └── VariableFilm.json ├── DispatcherTests.swift ├── ErrorTests.swift ├── Info.plist ├── Requests │ ├── AllFilmsRequest.swift │ ├── FilmRequest.swift │ └── FilmSubscriptionRequest.swift ├── ResponseHandlerTests.swift ├── Stub.swift ├── WebSocketClientTests.swift └── XCTestManifests.swift ├── LICENSE ├── LinuxMain.swift ├── Package.resolved ├── Package.swift ├── Podfile ├── Podfile.lock ├── Pods ├── Alamofire │ ├── LICENSE │ ├── README.md │ └── Source │ │ ├── AFError.swift │ │ ├── Alamofire.swift │ │ ├── AlamofireExtended.swift │ │ ├── AuthenticationInterceptor.swift │ │ ├── CachedResponseHandler.swift │ │ ├── Combine.swift │ │ ├── Concurrency.swift │ │ ├── DispatchQueue+Alamofire.swift │ │ ├── EventMonitor.swift │ │ ├── HTTPHeaders.swift │ │ ├── HTTPMethod.swift │ │ ├── MultipartFormData.swift │ │ ├── MultipartUpload.swift │ │ ├── NetworkReachabilityManager.swift │ │ ├── Notifications.swift │ │ ├── OperationQueue+Alamofire.swift │ │ ├── ParameterEncoder.swift │ │ ├── ParameterEncoding.swift │ │ ├── Protected.swift │ │ ├── RedirectHandler.swift │ │ ├── Request.swift │ │ ├── RequestCompression.swift │ │ ├── RequestInterceptor.swift │ │ ├── RequestTaskMap.swift │ │ ├── Response.swift │ │ ├── ResponseSerialization.swift │ │ ├── Result+Alamofire.swift │ │ ├── RetryPolicy.swift │ │ ├── ServerTrustEvaluation.swift │ │ ├── Session.swift │ │ ├── SessionDelegate.swift │ │ ├── StringEncoding+Alamofire.swift │ │ ├── URLConvertible+URLRequestConvertible.swift │ │ ├── URLEncodedFormEncoder.swift │ │ ├── URLRequest+Alamofire.swift │ │ ├── URLSessionConfiguration+Alamofire.swift │ │ └── Validation.swift ├── JSONValueRX │ ├── LICENSE │ ├── README.md │ └── Sources │ │ ├── JSON.swift │ │ ├── JSONable.swift │ │ └── Utilities.swift ├── Manifest.lock ├── Pods.xcodeproj │ └── project.pbxproj ├── Starscream │ ├── LICENSE │ ├── README.md │ └── Sources │ │ ├── Compression │ │ ├── Compression.swift │ │ └── WSCompression.swift │ │ ├── DataBytes │ │ └── Data+Extensions.swift │ │ ├── Engine │ │ ├── Engine.swift │ │ ├── NativeEngine.swift │ │ └── WSEngine.swift │ │ ├── Framer │ │ ├── FoundationHTTPHandler.swift │ │ ├── FoundationHTTPServerHandler.swift │ │ ├── FrameCollector.swift │ │ ├── Framer.swift │ │ ├── HTTPHandler.swift │ │ └── StringHTTPHandler.swift │ │ ├── PrivacyInfo.xcprivacy │ │ ├── Security │ │ ├── FoundationSecurity.swift │ │ └── Security.swift │ │ ├── Server │ │ ├── Server.swift │ │ └── WebSocketServer.swift │ │ ├── Starscream │ │ └── WebSocket.swift │ │ └── Transport │ │ ├── FoundationTransport.swift │ │ ├── TCPTransport.swift │ │ └── Transport.swift └── Target Support Files │ ├── Alamofire │ ├── Alamofire-Info.plist │ ├── Alamofire-dummy.m │ ├── Alamofire-prefix.pch │ ├── Alamofire-umbrella.h │ ├── Alamofire.debug.xcconfig │ ├── Alamofire.modulemap │ ├── Alamofire.release.xcconfig │ ├── Alamofire.xcconfig │ ├── Crust-Info.plist │ └── Info.plist │ ├── JSONValueRX │ ├── Crust-Info.plist │ ├── Info.plist │ ├── JSONValueRX-Info.plist │ ├── JSONValueRX-dummy.m │ ├── JSONValueRX-prefix.pch │ ├── JSONValueRX-umbrella.h │ ├── JSONValueRX.debug.xcconfig │ ├── JSONValueRX.modulemap │ ├── JSONValueRX.release.xcconfig │ └── JSONValueRX.xcconfig │ ├── Pods-AutoGraphQL-AutoGraphTests │ ├── Info.plist │ ├── OHHTTPStubs-Info.plist │ ├── Pods-AutoGraphQL-AutoGraphRealmTests-Info.plist │ ├── Pods-AutoGraphQL-AutoGraphTests-Info.plist │ ├── Pods-AutoGraphQL-AutoGraphTests-acknowledgements.markdown │ ├── Pods-AutoGraphQL-AutoGraphTests-acknowledgements.plist │ ├── Pods-AutoGraphQL-AutoGraphTests-dummy.m │ ├── Pods-AutoGraphQL-AutoGraphTests-frameworks.sh │ ├── Pods-AutoGraphQL-AutoGraphTests-resources.sh │ ├── Pods-AutoGraphQL-AutoGraphTests-umbrella.h │ ├── Pods-AutoGraphQL-AutoGraphTests.debug.xcconfig │ ├── Pods-AutoGraphQL-AutoGraphTests.modulemap │ └── Pods-AutoGraphQL-AutoGraphTests.release.xcconfig │ ├── Pods-AutoGraphQL-QueryBuilderTests │ ├── Info.plist │ ├── Pods-AutoGraphQL-QueryBuilderTests-Info.plist │ ├── Pods-AutoGraphQL-QueryBuilderTests-acknowledgements.markdown │ ├── Pods-AutoGraphQL-QueryBuilderTests-acknowledgements.plist │ ├── Pods-AutoGraphQL-QueryBuilderTests-dummy.m │ ├── Pods-AutoGraphQL-QueryBuilderTests-frameworks.sh │ ├── Pods-AutoGraphQL-QueryBuilderTests-resources.sh │ ├── Pods-AutoGraphQL-QueryBuilderTests-umbrella.h │ ├── Pods-AutoGraphQL-QueryBuilderTests.debug.xcconfig │ ├── Pods-AutoGraphQL-QueryBuilderTests.modulemap │ ├── Pods-AutoGraphQL-QueryBuilderTests.release.xcconfig │ └── Realm-Info.plist │ ├── Pods-AutoGraphQL │ ├── Info.plist │ ├── Pods-AutoGraphQL-Info.plist │ ├── Pods-AutoGraphQL-acknowledgements.markdown │ ├── Pods-AutoGraphQL-acknowledgements.plist │ ├── Pods-AutoGraphQL-dummy.m │ ├── Pods-AutoGraphQL-resources.sh │ ├── Pods-AutoGraphQL-umbrella.h │ ├── Pods-AutoGraphQL.debug.xcconfig │ ├── Pods-AutoGraphQL.modulemap │ └── Pods-AutoGraphQL.release.xcconfig │ ├── Pods-QueryBuilder │ ├── Info.plist │ ├── OHHTTPStubs-Info.plist │ ├── Pods-QueryBuilder-Info.plist │ ├── Pods-QueryBuilder-acknowledgements.markdown │ ├── Pods-QueryBuilder-acknowledgements.plist │ ├── Pods-QueryBuilder-dummy.m │ ├── Pods-QueryBuilder-resources.sh │ ├── Pods-QueryBuilder-umbrella.h │ ├── Pods-QueryBuilder.debug.xcconfig │ ├── Pods-QueryBuilder.modulemap │ └── Pods-QueryBuilder.release.xcconfig │ └── Starscream │ ├── ResourceBundle-Starscream_Privacy-Starscream-Info.plist │ ├── Starscream-Info.plist │ ├── Starscream-dummy.m │ ├── Starscream-prefix.pch │ ├── Starscream-umbrella.h │ ├── Starscream.debug.xcconfig │ ├── Starscream.modulemap │ └── Starscream.release.xcconfig ├── QueryBuilder ├── FoundationExtensions.swift ├── Info.plist ├── QueryBuilder.h └── QueryDSL.swift ├── QueryBuilderTests ├── FoundationExtensionsTests.swift ├── Info.plist ├── QueryBuilderTests.swift └── XCTestManifests.swift ├── README.md ├── autograph.png └── codecov.yml /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | # .circleci/config.yml 2 | 3 | # Specify the config version - version 2.1 is latest. 4 | version: 2.1 5 | 6 | # Define the jobs for the current project. 7 | jobs: 8 | build-and-test: 9 | # Specify the Xcode version to use. 10 | macos: 11 | xcode: "15.0" 12 | working_directory: /Users/distiller/project 13 | environment: 14 | FL_OUTPUT_DIR: output 15 | 16 | # Define the steps required to build the project. 17 | steps: 18 | # Get the code from the VCS provider. 19 | - checkout 20 | 21 | # Download CocoaPods specs via HTTPS (faster than Git) 22 | # and install CocoaPods. 23 | - run: 24 | name: pipefail 25 | command: set -o pipefail 26 | 27 | - run: 28 | name: version 29 | command: xcodebuild -version 30 | 31 | - run: 32 | name: sdks 33 | command: xcodebuild -showsdks 34 | 35 | - run: 36 | name: devices 37 | command: xcrun xctrace list devices 38 | 39 | - run: 40 | name: pre-start simulator 41 | command: xcrun instruments -w "iPhone 15 (17.0) [" || true 42 | 43 | - run: 44 | name: Build 45 | command: xcodebuild -workspace AutoGraph.xcworkspace -scheme AutoGraph -destination 'platform=iOS Simulator,OS=17.0,name=iPhone 15' ONLY_ACTIVE_ARCH=NO build 46 | 47 | - run: 48 | name: Run tests 49 | command: xcodebuild -workspace AutoGraph.xcworkspace -scheme AutoGraph -destination 'platform=iOS Simulator,OS=17.0,name=iPhone 15' ONLY_ACTIVE_ARCH=NO test CODE_SIGNING_ALLOWED=NO 50 | 51 | - store_test_results: 52 | path: output/scan 53 | - store_artifacts: 54 | path: output 55 | 56 | swiftlint: 57 | docker: 58 | - image: dantoml/swiftlint:latest 59 | steps: 60 | - checkout 61 | - run: swiftlint lint --reporter junit | tee result.xml 62 | - store_artifacts: 63 | path: result.xml 64 | - store_test_results: 65 | path: result.xml 66 | 67 | workflows: 68 | version: 2 69 | build-test-lint: 70 | jobs: 71 | - swiftlint 72 | - build-and-test 73 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xcuserstate 23 | 24 | ## Obj-C/Swift specific 25 | *.hmap 26 | *.ipa 27 | *.dSYM.zip 28 | *.dSYM 29 | 30 | ## Playgrounds 31 | timeline.xctimeline 32 | playground.xcworkspace 33 | 34 | # Swift Package Manager 35 | # 36 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 37 | # Packages/ 38 | .build/ 39 | .swiftpm/ 40 | 41 | # CocoaPods 42 | # 43 | # We recommend against adding the Pods directory to your .gitignore. However 44 | # you should judge for yourself, the pros and cons are mentioned at: 45 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 46 | # 47 | # Pods/ 48 | 49 | # Carthage 50 | # 51 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 52 | # Carthage/Checkouts 53 | 54 | Carthage/Build 55 | 56 | # fastlane 57 | # 58 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 59 | # screenshots whenever they are needed. 60 | # For more information about the recommended setup visit: 61 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 62 | 63 | fastlane/report.xml 64 | fastlane/Preview.html 65 | fastlane/screenshots 66 | fastlane/test_output 67 | 68 | # SPM 69 | .build 70 | -------------------------------------------------------------------------------- /.swift-version: -------------------------------------------------------------------------------- 1 | 5.9 2 | -------------------------------------------------------------------------------- /.swiftlint.yml: -------------------------------------------------------------------------------- 1 | disabled_rules: # rule identifiers to exclude from running 2 | - class_delegate_protocol 3 | - colon 4 | - cyclomatic_complexity 5 | - file_length 6 | - force_try 7 | - function_body_length 8 | - function_parameter_count 9 | - generic_type_name 10 | - identifier_name 11 | - large_tuple 12 | - leading_whitespace 13 | - line_length 14 | - nesting 15 | - opening_brace 16 | - statement_position 17 | - todo 18 | - trailing_whitespace 19 | - type_body_length 20 | - void_return 21 | - weak_delegate 22 | - xctfail_message 23 | opt_in_rules: # some rules are only opt-in 24 | included: # paths to include during linting. `--path` is ignored if present. 25 | - AutoGraph 26 | - QueryBuilder 27 | excluded: # paths to ignore during linting. Takes precedence over `included`. 28 | - Pods 29 | custom_rules: 30 | else_newline: 31 | name: Newline before else 32 | regex: (\}\h*else\s*\{) 33 | message: Else statements should go on a new line 34 | severity: warning 35 | 36 | weak_delegate: 37 | name: Weak delegate 38 | regex: (?<=\n)\h*(var delegate) 39 | message: Delegates should be weak 40 | severity: error 41 | -------------------------------------------------------------------------------- /AutoGraph.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod lib lint AutoGraph.podspec' to ensure this is a 3 | # valid spec before submitting. 4 | # 5 | # Any lines starting with a # are optional, but their use is encouraged 6 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | s.name = "AutoGraph" 11 | s.module_name = "AutoGraphQL" 12 | s.version = "0.18.0" 13 | s.summary = "Swift GraphQL Client with Zero Cost Abstractions" 14 | 15 | s.description = <<-DESC 16 | A flexible Swift framework for requesting and mapping data from a GraphQL to Pure Structs. 17 | DESC 18 | 19 | s.homepage = "https://github.com/remind101/AutoGraph" 20 | s.license = 'MIT' 21 | s.author = { "rexmas" => "rex@remindhq.com" } 22 | s.source = { :git => "https://github.com/remind101/AutoGraph.git", :tag => s.version.to_s } 23 | 24 | s.platform = :ios, '13.0' 25 | s.swift_version = '5.9' 26 | s.requires_arc = true 27 | 28 | s.dependency 'Alamofire', '~> 5.8.0' 29 | s.dependency 'JSONValueRX', '~> 8.0' 30 | s.dependency 'Starscream', '= 4.0.8' 31 | 32 | s.source_files = 'AutoGraph/**/*.swift', 'QueryBuilder/**/*.swift' 33 | s.resource_bundles = { 34 | } 35 | 36 | end 37 | -------------------------------------------------------------------------------- /AutoGraph.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AutoGraph.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /AutoGraph.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded 6 | 7 | 8 | -------------------------------------------------------------------------------- /AutoGraph.xcodeproj/xcshareddata/xcschemes/AutoGraph-Package.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 63 | 64 | 70 | 71 | 73 | 74 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /AutoGraph.xcodeproj/xcshareddata/xcschemes/AutoGraph.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 38 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 53 | 59 | 60 | 61 | 63 | 69 | 70 | 71 | 72 | 73 | 83 | 84 | 90 | 91 | 92 | 93 | 99 | 100 | 106 | 107 | 108 | 109 | 111 | 112 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /AutoGraph.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /AutoGraph.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /AutoGraph/AlamofireClient.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import Alamofire 3 | 4 | struct AutoGraphAlamofireClientError: LocalizedError { 5 | public var errorDescription: String? { 6 | return "Session of AlamofireClient must be initialized with `interceptor` of AuthHandler." 7 | } 8 | } 9 | 10 | open class AlamofireClient: Client { 11 | public let session: Session 12 | public let url: URL 13 | public var httpHeaders: [String : String] 14 | public var authHandler: AuthHandler? { 15 | self.session.interceptor as? AuthHandler 16 | } 17 | public var requestInterceptor: RequestInterceptor? { 18 | self.session.interceptor 19 | } 20 | 21 | public var sessionConfiguration: URLSessionConfiguration { 22 | return self.session.session.configuration 23 | } 24 | 25 | public var authTokens: AuthTokens { 26 | return (accessToken: self.authHandler?.accessToken, 27 | refreshToken: self.authHandler?.refreshToken) 28 | } 29 | 30 | public required init( 31 | url: URL, 32 | httpHeaders: [String : String] = [:], 33 | session: Session) 34 | { 35 | self.url = url 36 | self.httpHeaders = httpHeaders 37 | self.session = session 38 | } 39 | 40 | public convenience init( 41 | url: String, 42 | httpHeaders: [String : String] = [:], 43 | session: Session) 44 | throws 45 | { 46 | self.init(url: try url.asURL(), httpHeaders: httpHeaders, session: session) 47 | } 48 | 49 | public func sendRequest(parameters: [String : Any], completion: @escaping (AFDataResponse) -> ()) { 50 | self.session.request( 51 | self.url, 52 | method: .post, 53 | parameters: parameters, 54 | encoding: JSONEncoding.default, 55 | headers: HTTPHeaders(self.httpHeaders)) 56 | .responseJSON(completionHandler: completion) 57 | } 58 | 59 | public func authenticate(authTokens: AuthTokens) { 60 | self.authHandler?.reauthenticated(success: true, accessToken: authTokens.accessToken, refreshToken: authTokens.refreshToken) 61 | } 62 | 63 | public func cancelAll() { 64 | self.session.session.getTasksWithCompletionHandler { dataTasks, uploadTasks, downloadTasks in 65 | dataTasks.forEach { $0.cancel() } 66 | uploadTasks.forEach { $0.cancel() } 67 | downloadTasks.forEach { $0.cancel() } 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /AutoGraph/AuthHandler.swift: -------------------------------------------------------------------------------- 1 | import Alamofire 2 | import Foundation 3 | 4 | public typealias ReauthenticationRefreshCompletion = (_ succeeded: Bool, _ accessToken: String?, _ refreshToken: String?) -> Void 5 | 6 | internal protocol AuthHandlerDelegate: AnyObject { 7 | func authHandlerBeganReauthentication(_ authHandler: AuthHandler) 8 | func authHandler(_ authHandler: AuthHandler, reauthenticatedSuccessfully: Bool) 9 | } 10 | 11 | public protocol ReauthenticationDelegate: AnyObject { 12 | func autoGraphRequiresReauthentication(accessToken: String?, refreshToken: String?, completion: ReauthenticationRefreshCompletion) 13 | } 14 | 15 | public let Unauthorized401StatusCode = 401 16 | 17 | // NOTE: Currently too coupled to Alamofire, will need to write an adapter and 18 | // move some of this into AlamofireClient eventually. 19 | 20 | public class AuthHandler: RequestInterceptor { 21 | private typealias RequestRetryCompletion = (RetryResult) -> Void 22 | 23 | internal weak var delegate: AuthHandlerDelegate? 24 | public weak var reauthenticationDelegate: ReauthenticationDelegate? 25 | 26 | public fileprivate(set) var accessToken: String? 27 | public fileprivate(set) var refreshToken: String? 28 | public fileprivate(set) var isRefreshing = false 29 | 30 | private let lock = NSRecursiveLock() 31 | private var requestsToRetry: [RequestRetryCompletion] = [] 32 | 33 | public init(accessToken: String? = nil, refreshToken: String? = nil) { 34 | self.accessToken = accessToken 35 | self.refreshToken = refreshToken 36 | } 37 | } 38 | 39 | // MARK: - RequestAdapter 40 | 41 | extension AuthHandler: RequestAdapter { 42 | public func adapt( 43 | _ urlRequest: URLRequest, 44 | for session: Session, 45 | completion: @escaping (Result) -> Void) 46 | { 47 | self.lock.lock() 48 | 49 | var urlRequest = urlRequest 50 | if let accessToken = self.accessToken { 51 | urlRequest.headers.add(.authorization(bearerToken: accessToken)) 52 | } 53 | 54 | self.lock.unlock() 55 | completion(.success(urlRequest)) 56 | } 57 | } 58 | 59 | // MARK: - RequestRetrier 60 | 61 | extension AuthHandler: RequestRetrier { 62 | public func retry( 63 | _ request: Alamofire.Request, 64 | for session: Session, dueTo error: Error, 65 | completion: @escaping (RetryResult) -> Void) 66 | { 67 | self.lock.lock() 68 | defer { 69 | self.lock.unlock() 70 | } 71 | 72 | // Don't retry if we already failed once. 73 | guard request.retryCount == 0 else { 74 | completion(.doNotRetry) 75 | return 76 | } 77 | 78 | // Retry unless it's a 401, in which case, rauth. 79 | guard 80 | case let response as HTTPURLResponse = request.task?.response, 81 | response.statusCode == Unauthorized401StatusCode 82 | else { 83 | completion(.retry) 84 | return 85 | } 86 | 87 | self.requestsToRetry.append(completion) 88 | 89 | self.reauthenticate() 90 | } 91 | 92 | func reauthenticate() { 93 | self.lock.lock() 94 | defer { 95 | self.lock.unlock() 96 | } 97 | 98 | guard !self.isRefreshing else { 99 | return 100 | } 101 | 102 | self.isRefreshing = true 103 | 104 | DispatchQueue.main.async { [weak self] in 105 | guard let strongSelf = self else { return } 106 | 107 | strongSelf.delegate?.authHandlerBeganReauthentication(strongSelf) 108 | 109 | strongSelf.reauthenticationDelegate?.autoGraphRequiresReauthentication( 110 | accessToken: strongSelf.accessToken, 111 | refreshToken: strongSelf.refreshToken) 112 | { [weak self] succeeded, accessToken, refreshToken in 113 | 114 | self?.reauthenticated(success: succeeded, accessToken: accessToken, refreshToken: refreshToken) 115 | } 116 | } 117 | } 118 | 119 | public func reauthenticated(success: Bool, accessToken: String?, refreshToken: String?) { 120 | self.lock.lock() 121 | defer { 122 | self.lock.unlock() 123 | } 124 | 125 | if success { 126 | self.accessToken = accessToken 127 | self.refreshToken = refreshToken 128 | self.requestsToRetry.forEach { $0(.retry) } 129 | } 130 | else { 131 | self.accessToken = nil 132 | self.refreshToken = nil 133 | } 134 | 135 | self.requestsToRetry.removeAll() 136 | 137 | guard self.isRefreshing else { 138 | return 139 | } 140 | 141 | self.isRefreshing = false 142 | self.delegate?.authHandler(self, reauthenticatedSuccessfully: success) 143 | } 144 | } 145 | -------------------------------------------------------------------------------- /AutoGraph/AutoGraph.h: -------------------------------------------------------------------------------- 1 | // 2 | // AutoGraph.h 3 | // AutoGraph 4 | // 5 | // Created by Rex Fenley on 10/14/16. 6 | // Copyright © 2016 Remind. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for AutoGraph. 12 | FOUNDATION_EXPORT double AutoGraphVersionNumber; 13 | 14 | //! Project version string for AutoGraph. 15 | FOUNDATION_EXPORT const unsigned char AutoGraphVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /AutoGraph/Dispatcher.swift: -------------------------------------------------------------------------------- 1 | import Alamofire 2 | import Foundation 3 | 4 | public protocol RequestSender { 5 | func sendRequest(parameters: [String : Any], completion: @escaping (AFDataResponse) -> ()) 6 | } 7 | 8 | public final class Sendable { 9 | public let queryDocument: GraphQLDocument 10 | public let variables: GraphQLVariables? 11 | public let willSend: (() throws -> ())? 12 | public let dispatcherCompletion: (Sendable) -> (AFDataResponse) -> () 13 | public let dispatcherEarlyFailure: (Sendable) -> (Error) -> () 14 | 15 | public required init(queryDocument: GraphQLDocument, variables: GraphQLVariables?, willSend: (() throws -> ())?, dispatcherCompletion: @escaping (Sendable) -> (AFDataResponse) -> (), dispatcherEarlyFailure: @escaping (Sendable) -> (Error) -> ()) { 16 | self.queryDocument = queryDocument 17 | self.variables = variables 18 | self.willSend = willSend 19 | self.dispatcherCompletion = dispatcherCompletion 20 | self.dispatcherEarlyFailure = dispatcherEarlyFailure 21 | } 22 | 23 | public convenience init(dispatcher: Dispatcher, request: R, objectBindingPromise: @escaping (Sendable) -> ObjectBinding, globalWillSend: ((R) throws -> ())?) { 24 | 25 | let completion: (Sendable) -> (AFDataResponse) -> () = { [weak dispatcher] sendable in 26 | { [weak dispatcher] response in 27 | dispatcher?.responseHandler.handle(response: response, objectBinding: objectBindingPromise(sendable), preMappingHook: request.didFinishRequest) 28 | } 29 | } 30 | 31 | let earlyFailure: (Sendable) -> (Error) -> () = { [weak dispatcher] sendable in 32 | { [weak dispatcher] e in 33 | dispatcher?.responseHandler.fail(error: e, objectBinding: objectBindingPromise(sendable)) 34 | } 35 | } 36 | 37 | let willSend: (() throws -> ())? = { 38 | try globalWillSend?(request) 39 | try request.willSend() 40 | } 41 | 42 | self.init(queryDocument: request.queryDocument, variables: request.variables, willSend: willSend, dispatcherCompletion: completion, dispatcherEarlyFailure: earlyFailure) 43 | } 44 | } 45 | 46 | open class Dispatcher { 47 | public let responseHandler: ResponseHandler 48 | public let requestSender: RequestSender 49 | 50 | public internal(set) var pendingRequests = [Sendable]() 51 | 52 | public internal(set) var paused = false { 53 | didSet { 54 | if !self.paused { 55 | self.pendingRequests.forEach { sendable in 56 | self.send(sendable: sendable) 57 | } 58 | self.pendingRequests.removeAll() 59 | } 60 | } 61 | } 62 | 63 | public required init(requestSender: RequestSender, responseHandler: ResponseHandler) { 64 | self.requestSender = requestSender 65 | self.responseHandler = responseHandler 66 | } 67 | 68 | open func send(sendable: Sendable) { 69 | guard !self.paused else { 70 | self.pendingRequests.append(sendable) 71 | return 72 | } 73 | 74 | do { 75 | try sendable.willSend?() 76 | let query = try sendable.queryDocument.graphQLString() 77 | var parameters: [String : Any] = ["query" : query] 78 | if let variables = try sendable.variables?.graphQLVariablesDictionary() { 79 | parameters["variables"] = variables 80 | } 81 | 82 | if let operation = sendable.queryDocument as? Operation { 83 | parameters["operationName"] = operation.name 84 | } 85 | else if let document = sendable.queryDocument as? Document, let operation = document.operations.first { 86 | parameters["operationName"] = operation.name 87 | } 88 | 89 | self.requestSender.sendRequest(parameters: parameters, completion: sendable.dispatcherCompletion(sendable)) 90 | } 91 | catch let e { 92 | sendable.dispatcherEarlyFailure(sendable)(e) 93 | } 94 | } 95 | 96 | open func cancelAll() { 97 | self.pendingRequests.removeAll() 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /AutoGraph/Errors.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import JSONValueRX 3 | 4 | /* 5 | GraphQL errors have the following base shape: 6 | 7 | { 8 | "errors": [ 9 | { 10 | "message": "Cannot query field \"d\" on type \"Planet\".", 11 | "locations": [ 12 | { 13 | "line": 18, 14 | "column": 7 15 | } 16 | ] 17 | }, 18 | { 19 | "message": "Fragment \"planet\" is never used.", 20 | "locations": [ 21 | { 22 | "line": 23, 23 | "column": 1 24 | } 25 | ] 26 | } 27 | ] 28 | } 29 | 30 | */ 31 | 32 | public protocol NetworkError: Error { 33 | var statusCode: Int { get } 34 | var underlyingError: GraphQLError { get } 35 | } 36 | public typealias NetworkErrorParser = (_ graphQLError: GraphQLError) -> NetworkError? 37 | 38 | public indirect enum AutoGraphError: LocalizedError { 39 | case graphQL(errors: [GraphQLError], response: HTTPURLResponse?) 40 | case network(error: Error, statusCode: Int, response: HTTPURLResponse?, underlying: AutoGraphError?) 41 | case mapping(error: Error, response: HTTPURLResponse?) 42 | case invalidResponse(response: HTTPURLResponse?) 43 | case subscribeWithMissingWebSocketClient 44 | 45 | // TODO: make a subscriptions friendly version. 46 | 47 | public init?(graphQLResponseJSON: JSONValue, response: HTTPURLResponse?, networkErrorParser: NetworkErrorParser?) { 48 | guard let errorsJSON = graphQLResponseJSON["errors"] else { 49 | return nil 50 | } 51 | 52 | guard case .array(let errorsArray) = errorsJSON else { 53 | self = .invalidResponse(response: response) 54 | return 55 | } 56 | 57 | let errors = errorsArray.compactMap { GraphQLError(json: $0) } 58 | let graphQLError = AutoGraphError.graphQL(errors: errors, response: response) 59 | if let networkError: NetworkError = networkErrorParser.flatMap({ 60 | for error in errors { 61 | if let networkError = $0(error) { 62 | return networkError 63 | } 64 | } 65 | return nil 66 | }) 67 | { 68 | self = .network(error: networkError, statusCode: networkError.statusCode, response: nil, underlying: graphQLError) 69 | } 70 | else { 71 | self = graphQLError 72 | } 73 | } 74 | 75 | public var errorDescription: String? { 76 | switch self { 77 | case .graphQL(let errors, _): 78 | return errors.compactMap { $0.localizedDescription }.joined(separator: "\n") 79 | 80 | case .network(let error, let statusCode, _, let underlying): 81 | return "Network Failure - \(statusCode): " + error.localizedDescription + "\n" + (underlying?.localizedDescription ?? "") 82 | 83 | case .mapping(let error, _): 84 | return "Mapping Failure: " + error.localizedDescription 85 | 86 | case .invalidResponse: 87 | return "Invalid Response" 88 | 89 | case .subscribeWithMissingWebSocketClient: 90 | return "Attempting to subscribe to a subscription but AutoGraph was not initialized with a WebSocketClient. Please initialize with a WebSocketClient." 91 | } 92 | } 93 | } 94 | 95 | public struct GraphQLError: LocalizedError, Equatable { 96 | 97 | public struct Location: CustomStringConvertible, Equatable { 98 | public let line: Int 99 | public let column: Int 100 | 101 | public var description: String { 102 | return "line: \(line), column: \(column)" 103 | } 104 | 105 | init?(json: JSONValue) { 106 | guard case .some(.number(let line)) = json["line"] else { 107 | return nil 108 | } 109 | 110 | guard case .some(.number(let column)) = json["column"] else { 111 | return nil 112 | } 113 | 114 | self.line = line.asNSNumber.intValue 115 | self.column = column.asNSNumber.intValue 116 | } 117 | } 118 | 119 | public let message: String 120 | public let locations: [Location] 121 | public let jsonPayload: JSONValue 122 | 123 | public var errorDescription: String? { 124 | return self.message 125 | } 126 | 127 | init(json: JSONValue) { 128 | self.jsonPayload = json 129 | self.message = { 130 | guard case .some(.string(let message)) = json["message"] else { 131 | return "" 132 | } 133 | return message 134 | }() 135 | 136 | self.locations = { 137 | guard case .some(.array(let locations)) = json["locations"] else { 138 | return [] 139 | } 140 | return locations.compactMap { Location(json: $0) } 141 | }() 142 | } 143 | 144 | public static func == (lhs: GraphQLError, rhs: GraphQLError) -> Bool { 145 | return lhs.message == rhs.message && lhs.locations == rhs.locations 146 | } 147 | } 148 | -------------------------------------------------------------------------------- /AutoGraph/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 0.10.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /AutoGraph/Request.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import JSONValueRX 3 | 4 | /// A `Request` to be sent by AutoGraph. 5 | public protocol Request { 6 | /// The returned type for the request. 7 | associatedtype SerializedObject: Decodable 8 | 9 | associatedtype QueryDocument: GraphQLDocument 10 | associatedtype Variables: GraphQLVariables 11 | 12 | /// The query to be sent to GraphQL. 13 | var queryDocument: QueryDocument { get } 14 | 15 | /// The Operation Name for the query document. 16 | var operationName: String { get } 17 | 18 | /// The variables sent along with the query. 19 | var variables: Variables? { get } 20 | 21 | /// The key path to the result object in the data 22 | var rootKeyPath: String { get } 23 | 24 | /// Called at the moment before the request will be sent from the `Client`. 25 | func willSend() throws 26 | 27 | /// Called as soon as the http request finishes. 28 | func didFinishRequest(response: HTTPURLResponse?, json: JSONValue) throws 29 | 30 | /// Called right before calling the completion handler for the sent request, i.e. at the end of the lifecycle. 31 | func didFinish(result: AutoGraphResult) throws 32 | } 33 | 34 | extension Request where QueryDocument == Operation { 35 | public var operationName: String { 36 | return self.queryDocument.name 37 | } 38 | } 39 | 40 | /// A weird enum that collects info for a request. 41 | public enum ObjectBinding { 42 | case object(keyPath: String, isRequestIncludingNetworkResponse: Bool, completion: RequestCompletion) 43 | } 44 | 45 | extension Request { 46 | func generateBinding(completion: @escaping RequestCompletion) -> ObjectBinding { 47 | return ObjectBinding.object(keyPath: self.rootKeyPath, isRequestIncludingNetworkResponse: self is IsRequestIncludingNetworking, completion: completion) 48 | } 49 | } 50 | 51 | private protocol IsRequestIncludingNetworking {} 52 | extension RequestIncludingNetworkResponse: IsRequestIncludingNetworking {} 53 | 54 | public struct HTTPResponse: Decodable { 55 | public let urlString: String 56 | public let statusCode: Int 57 | public let headerFields: [String : String] 58 | } 59 | 60 | public struct DataIncludingNetworkResponse: Decodable { 61 | public let value: T 62 | public let json: JSONValue 63 | public let httpResponse: HTTPResponse? 64 | } 65 | 66 | public struct RequestIncludingNetworkResponse: Request { 67 | public typealias SerializedObject = DataIncludingNetworkResponse 68 | public typealias QueryDocument = R.QueryDocument 69 | public typealias Variables = R.Variables 70 | 71 | public let request: R 72 | 73 | public var queryDocument: R.QueryDocument { 74 | return self.request.queryDocument 75 | } 76 | 77 | public var operationName: String { 78 | return self.request.operationName 79 | } 80 | 81 | public var variables: R.Variables? { 82 | return self.request.variables 83 | } 84 | 85 | public var rootKeyPath: String { 86 | return self.request.rootKeyPath 87 | } 88 | 89 | public func willSend() throws { 90 | try self.request.willSend() 91 | } 92 | 93 | public func didFinishRequest(response: HTTPURLResponse?, json: JSONValue) throws { 94 | try self.request.didFinishRequest(response: response, json: json) 95 | } 96 | 97 | public func didFinish(result: Result, Error>) throws { 98 | try self.request.didFinish(result: { 99 | switch result { 100 | case .success(let data): 101 | return .success(data.value) 102 | case .failure(let error): 103 | return .failure(error) 104 | } 105 | }()) 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /AutoGraph/ResponseHandler.swift: -------------------------------------------------------------------------------- 1 | import Alamofire 2 | import Foundation 3 | import JSONValueRX 4 | 5 | open class ResponseHandler { 6 | 7 | public struct ObjectKeyPathError: LocalizedError { 8 | let keyPath: String 9 | public var errorDescription: String? { 10 | return "No object to map found at keyPath '\(self.keyPath)'" 11 | } 12 | } 13 | 14 | private let queue: OperationQueue 15 | private let callbackQueue: OperationQueue 16 | public var networkErrorParser: NetworkErrorParser? 17 | 18 | public init(queue: OperationQueue = OperationQueue(), 19 | callbackQueue: OperationQueue = OperationQueue.main) { 20 | self.queue = queue 21 | self.callbackQueue = callbackQueue 22 | } 23 | 24 | func handle(response: AFDataResponse, 25 | objectBinding: ObjectBinding, 26 | preMappingHook: (HTTPURLResponse?, JSONValue) throws -> ()) { 27 | do { 28 | let json = try response.extractJSON(networkErrorParser: self.networkErrorParser ?? { _ in return nil }) 29 | try preMappingHook(response.response, json) 30 | 31 | self.queue.addOperation { [weak self] in 32 | self?.map(json: json, response: response.response, objectBinding: objectBinding) 33 | } 34 | } 35 | catch let e { 36 | self.fail(error: e, objectBinding: objectBinding) 37 | } 38 | } 39 | 40 | private func map(json: JSONValue, response: HTTPURLResponse?, objectBinding: ObjectBinding) { 41 | do { 42 | switch objectBinding { 43 | case .object(let keyPath, let isRequestIncludingNetworkResponse, let completion): 44 | let decoder = JSONDecoder() 45 | let decodingJSON: JSONValue = try { 46 | guard let objectJson = json[keyPath] else { 47 | throw ObjectKeyPathError(keyPath: keyPath) 48 | } 49 | 50 | switch isRequestIncludingNetworkResponse { 51 | case true: 52 | let httpResponseJson = response.flatMap { 53 | try? JSONValue(dict: [ 54 | "urlString" : $0.url?.absoluteString ?? "", 55 | "statusCode" : $0.statusCode, 56 | "headerFields" : $0.allHeaderFields 57 | ]) 58 | } ?? .null 59 | 60 | let result: [String : JSONValue] = [ 61 | "json" : objectJson, 62 | "value" : objectJson, 63 | "httpResponse" : httpResponseJson 64 | ] 65 | 66 | return .object(result) 67 | case false: 68 | return objectJson 69 | } 70 | }() 71 | let object = try decoder.decode(SerializedObject.self, from: decodingJSON.encode()) 72 | 73 | self.callbackQueue.addOperation { 74 | completion(.success(object)) 75 | } 76 | } 77 | } 78 | catch let e { 79 | self.fail(error: AutoGraphError.mapping(error: e, response: response), objectBinding: objectBinding) 80 | } 81 | } 82 | 83 | // MARK: - Post mapping. 84 | 85 | func fail(error: Error, completion: @escaping RequestCompletion) { 86 | self.callbackQueue.addOperation { 87 | completion(.failure(error)) 88 | } 89 | } 90 | 91 | func fail(error: Error, objectBinding: ObjectBinding) { 92 | switch objectBinding { 93 | case .object(_, _, completion: let completion): 94 | self.fail(error: error, completion: completion) 95 | } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /AutoGraph/SubscriptionRequest.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public protocol SubscriptionRequestSerializable { 4 | func serializedSubscriptionPayload() throws -> String 5 | } 6 | 7 | public struct SubscriptionRequest: SubscriptionRequestSerializable { 8 | let operationName: String 9 | let request: R 10 | let subscriptionID: SubscriptionID 11 | 12 | init(request: R) throws { 13 | self.operationName = request.operationName 14 | self.request = request 15 | self.subscriptionID = try SubscriptionRequest.generateSubscriptionID(request: request, 16 | operationName: operationName) 17 | } 18 | 19 | public func serializedSubscriptionPayload() throws -> String { 20 | let query = try self.request.queryDocument.graphQLString() 21 | 22 | var body: [String : Any] = [ 23 | "operationName": self.operationName, 24 | "query": query 25 | ] 26 | 27 | if let variables = try self.request.variables?.graphQLVariablesDictionary() { 28 | body["variables"] = variables 29 | } 30 | 31 | let payload: [String : Any] = [ 32 | "payload": body, 33 | "id": self.subscriptionID, 34 | "type": GraphQLWSProtocol.start.rawValue 35 | ] 36 | 37 | let serialized: Data = try { 38 | do { 39 | return try JSONSerialization.data(withJSONObject: payload, options: .fragmentsAllowed) 40 | } 41 | catch let e { 42 | throw WebSocketError.subscriptionPayloadFailedSerialization(payload, underlyingError: e) 43 | } 44 | }() 45 | 46 | // TODO: Do we need to convert this to a string? 47 | guard let serializedString = String(data: serialized, encoding: .utf8) else { 48 | throw WebSocketError.subscriptionPayloadFailedSerialization(payload, underlyingError: nil) 49 | } 50 | 51 | return serializedString 52 | } 53 | 54 | static func generateSubscriptionID(request: Req, operationName: String) throws -> SubscriptionID { 55 | guard let variablesString = try request.variables?.graphQLVariablesDictionary().reduce(into: "", { (result, arg1) in 56 | result += "\(String(describing: arg1.key)):\(String(describing: arg1.value))," 57 | }) 58 | else { 59 | return operationName 60 | } 61 | return "\(operationName):{\(variablesString)}" 62 | } 63 | } 64 | 65 | public enum GraphQLWSProtocol: String { 66 | case connectionInit = "connection_init" // Client -> Server 67 | case connectionTerminate = "connection_terminate" // Client -> Server 68 | case start = "start" // Client -> Server 69 | case stop = "stop" // Client -> Server 70 | 71 | case connectionAck = "connection_ack" // Server -> Client 72 | case connectionError = "connection_error" // Server -> Client 73 | case connectionKeepAlive = "ka" // Server -> Client 74 | case data = "data" // Server -> Client For Subscription Payload 75 | case error = "error" // Server -> Client For Subscription Payload 76 | case complete = "complete" // Server -> Client 77 | case unknownResponse // Server -> Client 78 | 79 | public func serializedSubscriptionPayload(id: String? = nil) throws -> String { 80 | var payload: [String : Any] = [ 81 | "type": self.rawValue 82 | ] 83 | 84 | if let id = id { 85 | payload["id"] = id 86 | } 87 | let serialized: Data = try { 88 | do { 89 | return try JSONSerialization.data(withJSONObject: payload, options: .fragmentsAllowed) 90 | } 91 | catch let e { 92 | throw WebSocketError.subscriptionPayloadFailedSerialization(payload, underlyingError: e) 93 | } 94 | }() 95 | 96 | // TODO: Do we need to convert this to a string? 97 | guard let serializedString = String(data: serialized, encoding: .utf8) else { 98 | throw WebSocketError.subscriptionPayloadFailedSerialization(payload, underlyingError: nil) 99 | } 100 | 101 | return serializedString 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /AutoGraph/SubscriptionResponseHandler.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public struct SubscriptionResponseHandler { 4 | public typealias WebSocketCompletionBlock = (Result) -> Void 5 | 6 | private let completion: WebSocketCompletionBlock 7 | 8 | init(completion: @escaping WebSocketCompletionBlock) { 9 | self.completion = completion 10 | } 11 | 12 | public func didReceive(subscriptionResponse: SubscriptionResponse) { 13 | if let error = subscriptionResponse.error { 14 | didReceive(error: error) 15 | } 16 | else if let data = subscriptionResponse.payload { 17 | self.completion(.success(data)) 18 | } 19 | } 20 | 21 | public func didReceive(error: Error) { 22 | self.completion(.failure(error)) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /AutoGraph/SubscriptionResponseSerializer.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import JSONValueRX 3 | 4 | public enum ResponseSerializerError: Error { 5 | case failedToConvertTextToData(String) 6 | case webSocketError(String) 7 | 8 | public var localizedDescription: String { 9 | switch self { 10 | case let .failedToConvertTextToData(text): 11 | return "Failed to convert into data: \(text)" 12 | case let .webSocketError(error): 13 | return "Received websocket error event: \(error)" 14 | } 15 | } 16 | } 17 | 18 | public final class SubscriptionResponseSerializer { 19 | private let queue = DispatchQueue(label: "org.autograph.subscription_response_handler", qos: .default) 20 | 21 | func serialize(data: Data) throws -> SubscriptionResponse { 22 | return try JSONDecoder().decode(SubscriptionResponse.self, from: data) 23 | } 24 | 25 | func serialize(text: String) throws -> SubscriptionResponse { 26 | guard let data = text.data(using: .utf8) else { 27 | throw ResponseSerializerError.failedToConvertTextToData(text) 28 | } 29 | 30 | return try self.serialize(data: data) 31 | } 32 | 33 | func serializeFinalObject(data: Data, completion: @escaping (Result) -> Void) { 34 | self.queue.async { 35 | do { 36 | let serializedObject = try JSONDecoder().decode(SerializedObject.self, from: data) 37 | DispatchQueue.main.async { 38 | completion(.success(serializedObject)) 39 | } 40 | } 41 | catch let error { 42 | DispatchQueue.main.async { 43 | completion(.failure(error)) 44 | } 45 | } 46 | } 47 | } 48 | } 49 | 50 | public struct SubscriptionResponse: Decodable { 51 | enum CodingKeys: String, CodingKey { 52 | case id 53 | case payload 54 | case type 55 | } 56 | 57 | enum PayloadCodingKeys: String, CodingKey { 58 | case data 59 | case errors 60 | } 61 | 62 | let id: String 63 | let payload: Data? 64 | let type: GraphQLWSProtocol 65 | let error: AutoGraphError? 66 | 67 | public init(from decoder: Decoder) throws { 68 | let container = try decoder.container(keyedBy: CodingKeys.self) 69 | self.id = try container.decode(String.self, forKey: .id) 70 | self.type = GraphQLWSProtocol(rawValue: try container.decode(String.self, forKey: .type)) ?? .unknownResponse 71 | let payloadContainer = try container.nestedContainer(keyedBy: PayloadCodingKeys.self, forKey: .payload) 72 | self.payload = try payloadContainer.decodeIfPresent(JSONValue.self, forKey: .data)?.encode() 73 | 74 | let payloadJSON = try container.decode(JSONValue.self, forKey: .payload) 75 | self.error = AutoGraphError(graphQLResponseJSON: payloadJSON, response: nil, networkErrorParser: nil) 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /AutoGraph/Utilities.swift: -------------------------------------------------------------------------------- 1 | import Alamofire 2 | import Foundation 3 | import JSONValueRX 4 | 5 | public typealias AutoGraphResult = Swift.Result 6 | public typealias ResultIncludingNetworkResponse = AutoGraphResult> 7 | 8 | extension DataResponse { 9 | func extractValue() throws -> Any { 10 | switch self.result { 11 | case .success(let value): 12 | return value 13 | 14 | case .failure(let e): 15 | 16 | let gqlError: AutoGraphError? = { 17 | guard let data = self.data, let json = try? JSONValue.decode(data) else { 18 | return nil 19 | } 20 | 21 | return AutoGraphError(graphQLResponseJSON: json, response: self.response, networkErrorParser: nil) 22 | }() 23 | 24 | throw AutoGraphError.network(error: e, statusCode: self.response?.statusCode ?? -1, response: self.response, underlying: gqlError) 25 | } 26 | } 27 | 28 | func extractJSON(networkErrorParser: @escaping NetworkErrorParser) throws -> JSONValue { 29 | let value = try self.extractValue() 30 | let json = try JSONValue(object: value) 31 | 32 | if let queryError = AutoGraphError(graphQLResponseJSON: json, response: self.response, networkErrorParser: networkErrorParser) { 33 | throw queryError 34 | } 35 | 36 | return json 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /AutoGraph/WebSocketError.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public enum WebSocketError: Error { 4 | case webSocketNotConnected(subscriptionPayload: String) 5 | case subscriptionRequestBodyFailed(operationName: String) 6 | case subscriptionPayloadFailedSerialization([String : Any], underlyingError: Error?) 7 | 8 | public var localizedDescription: String { 9 | switch self { 10 | case let .webSocketNotConnected(subscriptionPayload): 11 | return "WebSocket is not connected, cannot yet make a subscription: \(subscriptionPayload)" 12 | case let .subscriptionRequestBodyFailed(operationName): 13 | return "Subscription request body failed to serialize for query: \(operationName)" 14 | case let .subscriptionPayloadFailedSerialization(payload, underlyingError): 15 | return "Subscription message payload failed to serialize message string: \(payload) underlying error: \(String(describing: underlyingError))" 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /AutoGraphTests/AuthHandlerTests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | import Alamofire 3 | import JSONValueRX 4 | @testable import AutoGraphQL 5 | 6 | class AuthHandlerTests: XCTestCase { 7 | 8 | var subject: AuthHandler! 9 | 10 | override func setUp() { 11 | super.setUp() 12 | 13 | self.subject = AuthHandler(accessToken: "token", refreshToken: "token") 14 | } 15 | 16 | override func tearDown() { 17 | self.subject = nil 18 | 19 | super.tearDown() 20 | } 21 | 22 | func testAdaptsAuthToken() { 23 | self.subject.adapt( 24 | URLRequest(url: URL(string: "localhost")!), 25 | for: Session(interceptor: self.subject), 26 | completion: 27 | { urlRequestResult in 28 | let urlRequest = try! urlRequestResult.get() 29 | XCTAssertEqual(urlRequest.allHTTPHeaderFields!["Authorization"]!, "Bearer token") 30 | }) 31 | } 32 | 33 | func testGetsAuthTokensIfSuccess() { 34 | self.subject.reauthenticated(success: true, accessToken: "a", refreshToken: "b") 35 | XCTAssertEqual(self.subject.accessToken, "a") 36 | XCTAssertEqual(self.subject.refreshToken, "b") 37 | } 38 | 39 | func testDoesNotGetAuthTokensIfFailure() { 40 | XCTAssertNotNil(self.subject.accessToken) 41 | XCTAssertNotNil(self.subject.refreshToken) 42 | self.subject.reauthenticated(success: false, accessToken: "a", refreshToken: "b") 43 | XCTAssertNil(self.subject.accessToken) 44 | XCTAssertNil(self.subject.refreshToken) 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /AutoGraphTests/Data/AllFilms.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": { 3 | "allFilms": { 4 | "films": [ 5 | { 6 | "id": "ZmlsbXM6MQ==", 7 | "title": "A New Hope", 8 | "episodeID": 4, 9 | "openingCrawl": "It is a period of civil war.\r\nRebel spaceships, striking\r\nfrom a hidden base, have won\r\ntheir first victory against\r\nthe evil Galactic Empire.\r\n\r\nDuring the battle, Rebel\r\nspies managed to steal secret\r\nplans to the Empire's\r\nultimate weapon, the DEATH\r\nSTAR, an armored space\r\nstation with enough power\r\nto destroy an entire planet.\r\n\r\nPursued by the Empire's\r\nsinister agents, Princess\r\nLeia races home aboard her\r\nstarship, custodian of the\r\nstolen plans that can save her\r\npeople and restore\r\nfreedom to the galaxy....", 10 | "director": "George Lucas" 11 | }, 12 | { 13 | "id": "ZmlsbXM6Mg==", 14 | "title": "The Empire Strikes Back", 15 | "episodeID": 5, 16 | "openingCrawl": "It is a dark time for the\r\nRebellion. Although the Death\r\nStar has been destroyed,\r\nImperial troops have driven the\r\nRebel forces from their hidden\r\nbase and pursued them across\r\nthe galaxy.\r\n\r\nEvading the dreaded Imperial\r\nStarfleet, a group of freedom\r\nfighters led by Luke Skywalker\r\nhas established a new secret\r\nbase on the remote ice world\r\nof Hoth.\r\n\r\nThe evil lord Darth Vader,\r\nobsessed with finding young\r\nSkywalker, has dispatched\r\nthousands of remote probes into\r\nthe far reaches of space....", 17 | "director": "Irvin Kershner" 18 | }, 19 | { 20 | "id": "ZmlsbXM6Mw==", 21 | "title": "Return of the Jedi", 22 | "episodeID": 6, 23 | "openingCrawl": "Luke Skywalker has returned to\r\nhis home planet of Tatooine in\r\nan attempt to rescue his\r\nfriend Han Solo from the\r\nclutches of the vile gangster\r\nJabba the Hutt.\r\n\r\nLittle does Luke know that the\r\nGALACTIC EMPIRE has secretly\r\nbegun construction on a new\r\narmored space station even\r\nmore powerful than the first\r\ndreaded Death Star.\r\n\r\nWhen completed, this ultimate\r\nweapon will spell certain doom\r\nfor the small band of rebels\r\nstruggling to restore freedom\r\nto the galaxy...", 24 | "director": "Richard Marquand" 25 | }, 26 | { 27 | "id": "ZmlsbXM6NA==", 28 | "title": "The Phantom Menace", 29 | "episodeID": 1, 30 | "openingCrawl": "Turmoil has engulfed the\r\nGalactic Republic. The taxation\r\nof trade routes to outlying star\r\nsystems is in dispute.\r\n\r\nHoping to resolve the matter\r\nwith a blockade of deadly\r\nbattleships, the greedy Trade\r\nFederation has stopped all\r\nshipping to the small planet\r\nof Naboo.\r\n\r\nWhile the Congress of the\r\nRepublic endlessly debates\r\nthis alarming chain of events,\r\nthe Supreme Chancellor has\r\nsecretly dispatched two Jedi\r\nKnights, the guardians of\r\npeace and justice in the\r\ngalaxy, to settle the conflict....", 31 | "director": "George Lucas" 32 | }, 33 | { 34 | "id": "ZmlsbXM6NQ==", 35 | "title": "Attack of the Clones", 36 | "episodeID": 2, 37 | "openingCrawl": "There is unrest in the Galactic\r\nSenate. Several thousand solar\r\nsystems have declared their\r\nintentions to leave the Republic.\r\n\r\nThis separatist movement,\r\nunder the leadership of the\r\nmysterious Count Dooku, has\r\nmade it difficult for the limited\r\nnumber of Jedi Knights to maintain \r\npeace and order in the galaxy.\r\n\r\nSenator Amidala, the former\r\nQueen of Naboo, is returning\r\nto the Galactic Senate to vote\r\non the critical issue of creating\r\nan ARMY OF THE REPUBLIC\r\nto assist the overwhelmed\r\nJedi....", 38 | "director": "George Lucas" 39 | }, 40 | { 41 | "id": "ZmlsbXM6Ng==", 42 | "title": "Revenge of the Sith", 43 | "episodeID": 3, 44 | "openingCrawl": "War! The Republic is crumbling\r\nunder attacks by the ruthless\r\nSith Lord, Count Dooku.\r\nThere are heroes on both sides.\r\nEvil is everywhere.\r\n\r\nIn a stunning move, the\r\nfiendish droid leader, General\r\nGrievous, has swept into the\r\nRepublic capital and kidnapped\r\nChancellor Palpatine, leader of\r\nthe Galactic Senate.\r\n\r\nAs the Separatist Droid Army\r\nattempts to flee the besieged\r\ncapital with their valuable\r\nhostage, two Jedi Knights lead a\r\ndesperate mission to rescue the\r\ncaptive Chancellor....", 45 | "director": "George Lucas" 46 | } 47 | ] 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /AutoGraphTests/Data/Film.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": { 3 | "film": { 4 | "id": "ZmlsbXM6MQ==", 5 | "title": "A New Hope", 6 | "episodeID": 4, 7 | "director": "George Lucas", 8 | "openingCrawl": "It is a period of civil war.\r\nRebel spaceships, striking\r\nfrom a hidden base, have won\r\ntheir first victory against\r\nthe evil Galactic Empire.\r\n\r\nDuring the battle, Rebel\r\nspies managed to steal secret\r\nplans to the Empire's\r\nultimate weapon, the DEATH\r\nSTAR, an armored space\r\nstation with enough power\r\nto destroy an entire planet.\r\n\r\nPursued by the Empire's\r\nsinister agents, Princess\r\nLeia races home aboard her\r\nstarship, custodian of the\r\nstolen plans that can save her\r\npeople and restore\r\nfreedom to the galaxy...." 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /AutoGraphTests/Data/Film.swift: -------------------------------------------------------------------------------- 1 | import AutoGraphQL 2 | import Foundation 3 | import JSONValueRX 4 | 5 | struct Film: Decodable, Equatable { 6 | let remoteId: String 7 | let title: String 8 | let episode: Int 9 | let openingCrawl: String 10 | let director: String 11 | 12 | enum CodingKeys: String, CodingKey { 13 | case remoteId = "id" 14 | case title 15 | case episode = "episodeID" 16 | case openingCrawl 17 | case director 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /AutoGraphTests/Data/Film401.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": { 3 | "film": null 4 | }, 5 | "errors": [ 6 | { 7 | "__restql_adapter__": { 8 | "service_response": { 9 | "error": "Unauthenticated", 10 | "error_code": "unauthenticated" 11 | }, 12 | "service_status": 401 13 | }, 14 | "locations": [ 15 | { 16 | "column": 1, 17 | "line": 3 18 | } 19 | ], 20 | "message": "401 - {\"error\":\"Unauthenticated\",\"error_code\":\"unauthenticated\"}", 21 | "path": [ 22 | "film" 23 | ] 24 | } 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /AutoGraphTests/Data/VariableFilm.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": { 3 | "allFilms": { 4 | "films": [ 5 | { 6 | "id": "ZmlsbXM6Ng==", 7 | "title": "Revenge of the Sith", 8 | "episodeID": 3, 9 | "director": "George Lucas", 10 | "openingCrawl": "War! The Republic is crumbling\r\nunder attacks by the ruthless\r\nSith Lord, Count Dooku.\r\nThere are heroes on both sides.\r\nEvil is everywhere.\r\n\r\nIn a stunning move, the\r\nfiendish droid leader, General\r\nGrievous, has swept into the\r\nRepublic capital and kidnapped\r\nChancellor Palpatine, leader of\r\nthe Galactic Senate.\r\n\r\nAs the Separatist Droid Army\r\nattempts to flee the besieged\r\ncapital with their valuable\r\nhostage, two Jedi Knights lead a\r\ndesperate mission to rescue the\r\ncaptive Chancellor...." 11 | } 12 | ] 13 | }, 14 | "node": { 15 | "id": "ZmlsbXM6MQ==", 16 | "title": "A New Hope", 17 | "episodeID": 4, 18 | "director": "George Lucas", 19 | "openingCrawl": "It is a period of civil war.\r\nRebel spaceships, striking\r\nfrom a hidden base, have won\r\ntheir first victory against\r\nthe evil Galactic Empire.\r\n\r\nDuring the battle, Rebel\r\nspies managed to steal secret\r\nplans to the Empire's\r\nultimate weapon, the DEATH\r\nSTAR, an armored space\r\nstation with enough power\r\nto destroy an entire planet.\r\n\r\nPursued by the Empire's\r\nsinister agents, Princess\r\nLeia races home aboard her\r\nstarship, custodian of the\r\nstolen plans that can save her\r\npeople and restore\r\nfreedom to the galaxy...." 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /AutoGraphTests/ErrorTests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | import Alamofire 3 | import JSONValueRX 4 | @testable import AutoGraphQL 5 | 6 | struct MockNetworkError: NetworkError { 7 | let statusCode: Int 8 | let underlyingError: GraphQLError 9 | } 10 | 11 | class ErrorTests: XCTestCase { 12 | func testInvalidResponseLocalizedErrorDoesntCrash() { 13 | let description = AutoGraphError.invalidResponse(response: nil).localizedDescription 14 | XCTAssertGreaterThan(description.count, 0) 15 | } 16 | 17 | func testAutoGraphErrorGraphQLErrorUsesMessages() { 18 | let message1 = "Cannot query field \"d\" on type \"Planet\"." 19 | let message2 = "401 - {\"error\":\"Unauthenticated\",\"error_code\":\"unauthenticated\"}" 20 | let line = 18 21 | let column = 7 22 | let jsonObj: [AnyHashable : Any] = [ 23 | "errors" : [ 24 | [ 25 | "message": message1, 26 | "locations": [ 27 | [ 28 | "line": line, 29 | "column": column 30 | ] 31 | ] 32 | ], 33 | [ 34 | "message": message2, 35 | "locations": [ 36 | [ 37 | "line": line, 38 | "column": column 39 | ] 40 | ] 41 | ] 42 | ] 43 | ] 44 | 45 | let json = try! JSONValue(object: jsonObj) 46 | let error = AutoGraphError(graphQLResponseJSON: json, response: nil, networkErrorParser: nil)! 47 | XCTAssertEqual(error.errorDescription!, "\(message1)\n\(message2)") 48 | XCTAssertEqual(error.localizedDescription, "\(message1)\n\(message2)") 49 | } 50 | 51 | func testGraphQLErrorUsesMessageForLocalizedDescription() { 52 | let message = "Cannot query field \"d\" on type \"Planet\"." 53 | let line = 18 54 | let column = 7 55 | let jsonObj: [AnyHashable : Any] = [ 56 | "message": message, 57 | "locations": [ 58 | [ 59 | "line": line, 60 | "column": column 61 | ] 62 | ] 63 | ] 64 | 65 | let error = GraphQLError(json: try! JSONValue(object: jsonObj)) 66 | XCTAssertEqual(error.errorDescription!, message) 67 | XCTAssertEqual(error.localizedDescription, message) 68 | } 69 | 70 | func testAutoGraphErrorProducesNetworkErrorForNetworkErrorParserMatch() { 71 | let message = "401 - {\"error\":\"Unauthenticated\",\"error_code\":\"unauthenticated\"}" 72 | let line = 18 73 | let column = 7 74 | let jsonObj: [AnyHashable : Any] = [ 75 | "errors" : [ 76 | [ 77 | "message": message, 78 | "locations": [ 79 | [ 80 | "line": line, 81 | "column": column 82 | ] 83 | ] 84 | ] 85 | ] 86 | ] 87 | 88 | let json = try! JSONValue(object: jsonObj) 89 | let error = AutoGraphError(graphQLResponseJSON: json, response: nil, networkErrorParser: { (gqlError) -> NetworkError? in 90 | guard message == gqlError.message else { 91 | return nil 92 | } 93 | 94 | return MockNetworkError(statusCode: 401, underlyingError: gqlError) 95 | }) 96 | 97 | guard 98 | case .some(.network(let baseError, let statusCode, _, let underlying)) = error, 99 | case .some(.graphQL(errors: let underlyingErrors, _)) = underlying, 100 | case let networkError as NetworkError = baseError, 101 | networkError.statusCode == 401, 102 | networkError.underlyingError == underlyingErrors.first, 103 | networkError.statusCode == statusCode 104 | else { 105 | XCTFail() 106 | return 107 | } 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /AutoGraphTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /AutoGraphTests/Requests/AllFilmsRequest.swift: -------------------------------------------------------------------------------- 1 | @testable import AutoGraphQL 2 | import Foundation 3 | import JSONValueRX 4 | 5 | class AllFilmsRequest: Request { 6 | /* 7 | query allFilms { 8 | film(id: "ZmlsbXM6MQ==") { 9 | id 10 | title 11 | episodeID 12 | director 13 | openingCrawl 14 | } 15 | } 16 | */ 17 | 18 | let queryDocument = Operation(type: .query, 19 | name: "allFilms", 20 | selectionSet: [ 21 | Object(name: "allFilms", 22 | arguments: nil, 23 | selectionSet: [ 24 | Object(name: "films", 25 | alias: nil, 26 | arguments: nil, 27 | selectionSet: [ 28 | "id", 29 | Scalar(name: "title", alias: nil), 30 | Scalar(name: "episodeID", alias: nil), 31 | Scalar(name: "director", alias: nil), 32 | Scalar(name: "openingCrawl", alias: nil)]) 33 | ]) 34 | ]) 35 | 36 | let variables: [AnyHashable : Any]? = nil 37 | 38 | let rootKeyPath: String = "data.allFilms.films" 39 | 40 | public func willSend() throws { } 41 | public func didFinishRequest(response: HTTPURLResponse?, json: JSONValue) throws { } 42 | public func didFinish(result: AutoGraphResult<[Film]>) throws { } 43 | } 44 | 45 | class AllFilmsStub: Stub { 46 | override var jsonFixtureFile: String? { 47 | get { return "AllFilms" } 48 | set { } 49 | } 50 | 51 | override var urlPath: String? { 52 | get { return "/graphql" } 53 | set { } 54 | } 55 | 56 | override var graphQLQuery: String { 57 | get { 58 | return "query allFilms {\n" + 59 | "allFilms {\n" + 60 | "films {\n" + 61 | "id\n" + 62 | "title\n" + 63 | "episodeID\n" + 64 | "director\n" + 65 | "openingCrawl\n" + 66 | "}\n" + 67 | "}\n" + 68 | "}\n" 69 | 70 | } 71 | set { } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /AutoGraphTests/Requests/FilmRequest.swift: -------------------------------------------------------------------------------- 1 | @testable import AutoGraphQL 2 | import Foundation 3 | import JSONValueRX 4 | 5 | class FilmRequest: Request { 6 | /* 7 | query film { 8 | film(id: "ZmlsbXM6MQ==") { 9 | id 10 | title 11 | episodeID 12 | director 13 | openingCrawl 14 | } 15 | } 16 | */ 17 | 18 | let queryDocument = Operation(type: .query, 19 | name: "film", 20 | selectionSet: [ 21 | Object(name: "film", 22 | alias: nil, 23 | arguments: ["id" : "ZmlsbXM6MQ=="], 24 | selectionSet: [ 25 | "id", 26 | Scalar(name: "title", alias: nil), 27 | Scalar(name: "episodeID", alias: nil), 28 | Scalar(name: "director", alias: nil), 29 | Scalar(name: "openingCrawl", alias: nil)]) 30 | ]) 31 | 32 | let variables: [AnyHashable : Any]? = nil 33 | 34 | let rootKeyPath: String = "data.film" 35 | 36 | public func willSend() throws { } 37 | public func didFinishRequest(response: HTTPURLResponse?, json: JSONValue) throws { } 38 | public func didFinish(result: AutoGraphResult) throws { } 39 | } 40 | 41 | class FilmStub: Stub { 42 | override var jsonFixtureFile: String? { 43 | get { return "Film" } 44 | set { } 45 | } 46 | 47 | override var urlPath: String? { 48 | get { return "/graphql" } 49 | set { } 50 | } 51 | 52 | override var graphQLQuery: String { 53 | get { 54 | return "query film {\n" + 55 | "film(id: \"ZmlsbXM6MQ==\") {\n" + 56 | "id\n" + 57 | "title\n" + 58 | "episodeID\n" + 59 | "director\n" + 60 | "openingCrawl\n" + 61 | "}\n" + 62 | "}\n" 63 | } 64 | set { } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Remind 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /LinuxMain.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | 3 | import AutoGraphTests 4 | import QueryBuilderTests 5 | 6 | var tests = [XCTestCaseEntry]() 7 | tests += AutoGraphTests.__allTests() 8 | tests += QueryBuilderTests.__allTests() 9 | 10 | XCTMain(tests) 11 | -------------------------------------------------------------------------------- /Package.resolved: -------------------------------------------------------------------------------- 1 | { 2 | "pins" : [ 3 | { 4 | "identity" : "alamofire", 5 | "kind" : "remoteSourceControl", 6 | "location" : "https://github.com/Alamofire/Alamofire.git", 7 | "state" : { 8 | "revision" : "b2fa556e4e48cbf06cf8c63def138c98f4b811fa", 9 | "version" : "5.8.0" 10 | } 11 | }, 12 | { 13 | "identity" : "jsonvalue", 14 | "kind" : "remoteSourceControl", 15 | "location" : "https://github.com/rexmas/JSONValue.git", 16 | "state" : { 17 | "revision" : "696916c028fdb0e30ec2771639135172700d424c", 18 | "version" : "7.2.0" 19 | } 20 | }, 21 | { 22 | "identity" : "starscream", 23 | "kind" : "remoteSourceControl", 24 | "location" : "https://github.com/daltoniam/Starscream.git", 25 | "state" : { 26 | "revision" : "c6bfd1af48efcc9a9ad203665db12375ba6b145a", 27 | "version" : "4.0.8" 28 | } 29 | } 30 | ], 31 | "version" : 2 32 | } 33 | -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:5.9.0 2 | // The swift-tools-version declares the minimum version of Swift required to build this package. 3 | 4 | import PackageDescription 5 | 6 | let package = Package( 7 | name: "AutoGraph", 8 | platforms: [ 9 | .macOS(.v10_15), 10 | .iOS(.v13) 11 | ], 12 | products: [ 13 | .library( 14 | name: "AutoGraphQL", 15 | targets: ["AutoGraphQL"] 16 | ) 17 | ], 18 | dependencies: [ 19 | .package(url: "https://github.com/Alamofire/Alamofire.git", .upToNextMinor(from: "5.8.0")), 20 | .package(url: "https://github.com/rexmas/JSONValue.git", .upToNextMinor(from: "8.0.0")), 21 | .package(url: "https://github.com/daltoniam/Starscream.git", .exact("4.0.8")) 22 | ], 23 | targets: [ 24 | .target( 25 | name: "AutoGraphQL", 26 | dependencies: [ 27 | "Alamofire", 28 | .product(name: "JSONValueRX", package: "JSONValue"), 29 | "Starscream" 30 | ], 31 | path: ".", 32 | exclude: ["AutoGraph/Info.plist", "QueryBuilder/Info.plist"], 33 | sources: ["AutoGraph", "QueryBuilder"] 34 | ), 35 | .testTarget( 36 | name: "AutoGraphTests", 37 | dependencies: ["AutoGraphQL"], 38 | path: "./AutoGraphTests" 39 | ), 40 | .testTarget( 41 | name: "QueryBuilderTests", 42 | dependencies: ["AutoGraphQL"], 43 | path: "./QueryBuilderTests" 44 | ) 45 | ] 46 | ) 47 | 48 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '13.0' 2 | 3 | # ignore all warnings from all pods 4 | inhibit_all_warnings! 5 | use_frameworks! 6 | 7 | def jsonvalue 8 | pod 'JSONValueRX', '~> 8.0' 9 | end 10 | 11 | target 'AutoGraphQL' do 12 | pod 'Alamofire', '~> 5.8.0' 13 | # Starscream breaks semvar and we should likely move off of it anyway. 14 | pod 'Starscream', '= 4.0.8' 15 | jsonvalue 16 | 17 | target 'AutoGraphTests' do 18 | inherit! :complete 19 | end 20 | 21 | target 'QueryBuilderTests' do 22 | inherit! :complete 23 | end 24 | end 25 | 26 | target 'QueryBuilder' do 27 | jsonvalue 28 | end 29 | 30 | post_install do |installer| 31 | installer.pods_project.build_configurations.each do |config| 32 | if config.name.include?("Debug") or config.name.include?("Developer") or config.name.include?("Localhost") 33 | config.build_settings['GCC_OPTIMIZATION_LEVEL'] = '0' 34 | config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)'] 35 | config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'DEBUG=1 RCT_DEBUG=1 RCT_DEV=1 RCT_NSASSERT=1' 36 | end 37 | end 38 | 39 | installer.generated_projects.each do |project| 40 | project.targets.each do |target| 41 | target.build_configurations.each do |config| 42 | config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0' 43 | end 44 | end 45 | end 46 | end 47 | 48 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Alamofire (5.8.1) 3 | - JSONValueRX (8.0.0) 4 | - Starscream (4.0.8) 5 | 6 | DEPENDENCIES: 7 | - Alamofire (~> 5.8.0) 8 | - JSONValueRX (~> 8.0) 9 | - Starscream (= 4.0.8) 10 | 11 | SPEC REPOS: 12 | trunk: 13 | - Alamofire 14 | - JSONValueRX 15 | - Starscream 16 | 17 | SPEC CHECKSUMS: 18 | Alamofire: 3ca42e259043ee0dc5c0cdd76c4bc568b8e42af7 19 | JSONValueRX: 08c9ad9367a9355b9739bb51bd3901486bb67536 20 | Starscream: 19b5533ddb925208db698f0ac508a100b884a1b9 21 | 22 | PODFILE CHECKSUM: a23e81270e4936afc2af38e99a4bc540a1bb414b 23 | 24 | COCOAPODS: 1.16.2 25 | -------------------------------------------------------------------------------- /Pods/Alamofire/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2022 Alamofire Software Foundation (http://alamofire.org/) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Pods/Alamofire/Source/Alamofire.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Alamofire.swift 3 | // 4 | // Copyright (c) 2014-2021 Alamofire Software Foundation (http://alamofire.org/) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | import Dispatch 26 | import Foundation 27 | #if canImport(FoundationNetworking) 28 | @_exported import FoundationNetworking 29 | #endif 30 | 31 | // Enforce minimum Swift version for all platforms and build systems. 32 | #if swift(<5.5) 33 | #error("Alamofire doesn't support Swift versions below 5.5.") 34 | #endif 35 | 36 | /// Reference to `Session.default` for quick bootstrapping and examples. 37 | public let AF = Session.default 38 | 39 | /// Current Alamofire version. Necessary since SPM doesn't use dynamic libraries. Plus this will be more accurate. 40 | let version = "5.8.0" 41 | -------------------------------------------------------------------------------- /Pods/Alamofire/Source/AlamofireExtended.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AlamofireExtended.swift 3 | // 4 | // Copyright (c) 2019 Alamofire Software Foundation (http://alamofire.org/) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | /// Type that acts as a generic extension point for all `AlamofireExtended` types. 26 | public struct AlamofireExtension { 27 | /// Stores the type or meta-type of any extended type. 28 | public private(set) var type: ExtendedType 29 | 30 | /// Create an instance from the provided value. 31 | /// 32 | /// - Parameter type: Instance being extended. 33 | public init(_ type: ExtendedType) { 34 | self.type = type 35 | } 36 | } 37 | 38 | /// Protocol describing the `af` extension points for Alamofire extended types. 39 | public protocol AlamofireExtended { 40 | /// Type being extended. 41 | associatedtype ExtendedType 42 | 43 | /// Static Alamofire extension point. 44 | static var af: AlamofireExtension.Type { get set } 45 | /// Instance Alamofire extension point. 46 | var af: AlamofireExtension { get set } 47 | } 48 | 49 | extension AlamofireExtended { 50 | /// Static Alamofire extension point. 51 | public static var af: AlamofireExtension.Type { 52 | get { AlamofireExtension.self } 53 | set {} 54 | } 55 | 56 | /// Instance Alamofire extension point. 57 | public var af: AlamofireExtension { 58 | get { AlamofireExtension(self) } 59 | set {} 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Pods/Alamofire/Source/CachedResponseHandler.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CachedResponseHandler.swift 3 | // 4 | // Copyright (c) 2019 Alamofire Software Foundation (http://alamofire.org/) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | import Foundation 26 | 27 | /// A type that handles whether the data task should store the HTTP response in the cache. 28 | public protocol CachedResponseHandler { 29 | /// Determines whether the HTTP response should be stored in the cache. 30 | /// 31 | /// The `completion` closure should be passed one of three possible options: 32 | /// 33 | /// 1. The cached response provided by the server (this is the most common use case). 34 | /// 2. A modified version of the cached response (you may want to modify it in some way before caching). 35 | /// 3. A `nil` value to prevent the cached response from being stored in the cache. 36 | /// 37 | /// - Parameters: 38 | /// - task: The data task whose request resulted in the cached response. 39 | /// - response: The cached response to potentially store in the cache. 40 | /// - completion: The closure to execute containing cached response, a modified response, or `nil`. 41 | func dataTask(_ task: URLSessionDataTask, 42 | willCacheResponse response: CachedURLResponse, 43 | completion: @escaping (CachedURLResponse?) -> Void) 44 | } 45 | 46 | // MARK: - 47 | 48 | /// `ResponseCacher` is a convenience `CachedResponseHandler` making it easy to cache, not cache, or modify a cached 49 | /// response. 50 | public struct ResponseCacher { 51 | /// Defines the behavior of the `ResponseCacher` type. 52 | public enum Behavior { 53 | /// Stores the cached response in the cache. 54 | case cache 55 | /// Prevents the cached response from being stored in the cache. 56 | case doNotCache 57 | /// Modifies the cached response before storing it in the cache. 58 | case modify((URLSessionDataTask, CachedURLResponse) -> CachedURLResponse?) 59 | } 60 | 61 | /// Returns a `ResponseCacher` with a `.cache` `Behavior`. 62 | public static let cache = ResponseCacher(behavior: .cache) 63 | /// Returns a `ResponseCacher` with a `.doNotCache` `Behavior`. 64 | public static let doNotCache = ResponseCacher(behavior: .doNotCache) 65 | 66 | /// The `Behavior` of the `ResponseCacher`. 67 | public let behavior: Behavior 68 | 69 | /// Creates a `ResponseCacher` instance from the `Behavior`. 70 | /// 71 | /// - Parameter behavior: The `Behavior`. 72 | public init(behavior: Behavior) { 73 | self.behavior = behavior 74 | } 75 | } 76 | 77 | extension ResponseCacher: CachedResponseHandler { 78 | public func dataTask(_ task: URLSessionDataTask, 79 | willCacheResponse response: CachedURLResponse, 80 | completion: @escaping (CachedURLResponse?) -> Void) { 81 | switch behavior { 82 | case .cache: 83 | completion(response) 84 | case .doNotCache: 85 | completion(nil) 86 | case let .modify(closure): 87 | let response = closure(task, response) 88 | completion(response) 89 | } 90 | } 91 | } 92 | 93 | extension CachedResponseHandler where Self == ResponseCacher { 94 | /// Provides a `ResponseCacher` which caches the response, if allowed. Equivalent to `ResponseCacher.cache`. 95 | public static var cache: ResponseCacher { .cache } 96 | 97 | /// Provides a `ResponseCacher` which does not cache the response. Equivalent to `ResponseCacher.doNotCache`. 98 | public static var doNotCache: ResponseCacher { .doNotCache } 99 | 100 | /// Creates a `ResponseCacher` which modifies the proposed `CachedURLResponse` using the provided closure. 101 | /// 102 | /// - Parameter closure: Closure used to modify the `CachedURLResponse`. 103 | /// - Returns: The `ResponseCacher`. 104 | public static func modify(using closure: @escaping ((URLSessionDataTask, CachedURLResponse) -> CachedURLResponse?)) -> ResponseCacher { 105 | ResponseCacher(behavior: .modify(closure)) 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /Pods/Alamofire/Source/DispatchQueue+Alamofire.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DispatchQueue+Alamofire.swift 3 | // 4 | // Copyright (c) 2014-2018 Alamofire Software Foundation (http://alamofire.org/) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | import Dispatch 26 | import Foundation 27 | 28 | extension DispatchQueue { 29 | /// Execute the provided closure after a `TimeInterval`. 30 | /// 31 | /// - Parameters: 32 | /// - delay: `TimeInterval` to delay execution. 33 | /// - closure: Closure to execute. 34 | func after(_ delay: TimeInterval, execute closure: @escaping () -> Void) { 35 | asyncAfter(deadline: .now() + delay, execute: closure) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Pods/Alamofire/Source/HTTPMethod.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HTTPMethod.swift 3 | // 4 | // Copyright (c) 2014-2018 Alamofire Software Foundation (http://alamofire.org/) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | /// Type representing HTTP methods. Raw `String` value is stored and compared case-sensitively, so 26 | /// `HTTPMethod.get != HTTPMethod(rawValue: "get")`. 27 | /// 28 | /// See https://tools.ietf.org/html/rfc7231#section-4.3 29 | public struct HTTPMethod: RawRepresentable, Equatable, Hashable { 30 | /// `CONNECT` method. 31 | public static let connect = HTTPMethod(rawValue: "CONNECT") 32 | /// `DELETE` method. 33 | public static let delete = HTTPMethod(rawValue: "DELETE") 34 | /// `GET` method. 35 | public static let get = HTTPMethod(rawValue: "GET") 36 | /// `HEAD` method. 37 | public static let head = HTTPMethod(rawValue: "HEAD") 38 | /// `OPTIONS` method. 39 | public static let options = HTTPMethod(rawValue: "OPTIONS") 40 | /// `PATCH` method. 41 | public static let patch = HTTPMethod(rawValue: "PATCH") 42 | /// `POST` method. 43 | public static let post = HTTPMethod(rawValue: "POST") 44 | /// `PUT` method. 45 | public static let put = HTTPMethod(rawValue: "PUT") 46 | /// `QUERY` method. 47 | public static let query = HTTPMethod(rawValue: "QUERY") 48 | /// `TRACE` method. 49 | public static let trace = HTTPMethod(rawValue: "TRACE") 50 | 51 | public let rawValue: String 52 | 53 | public init(rawValue: String) { 54 | self.rawValue = rawValue 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Pods/Alamofire/Source/MultipartUpload.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MultipartUpload.swift 3 | // 4 | // Copyright (c) 2014-2018 Alamofire Software Foundation (http://alamofire.org/) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | import Foundation 26 | 27 | /// Internal type which encapsulates a `MultipartFormData` upload. 28 | final class MultipartUpload { 29 | lazy var result = Result { try build() } 30 | 31 | private let multipartFormData: Protected 32 | 33 | let encodingMemoryThreshold: UInt64 34 | let request: URLRequestConvertible 35 | let fileManager: FileManager 36 | 37 | init(encodingMemoryThreshold: UInt64, 38 | request: URLRequestConvertible, 39 | multipartFormData: MultipartFormData) { 40 | self.encodingMemoryThreshold = encodingMemoryThreshold 41 | self.request = request 42 | fileManager = multipartFormData.fileManager 43 | self.multipartFormData = Protected(multipartFormData) 44 | } 45 | 46 | func build() throws -> UploadRequest.Uploadable { 47 | let uploadable: UploadRequest.Uploadable 48 | if multipartFormData.contentLength < encodingMemoryThreshold { 49 | let data = try multipartFormData.read { try $0.encode() } 50 | 51 | uploadable = .data(data) 52 | } else { 53 | let tempDirectoryURL = fileManager.temporaryDirectory 54 | let directoryURL = tempDirectoryURL.appendingPathComponent("org.alamofire.manager/multipart.form.data") 55 | let fileName = UUID().uuidString 56 | let fileURL = directoryURL.appendingPathComponent(fileName) 57 | 58 | try fileManager.createDirectory(at: directoryURL, withIntermediateDirectories: true, attributes: nil) 59 | 60 | do { 61 | try multipartFormData.read { try $0.writeEncodedData(to: fileURL) } 62 | } catch { 63 | // Cleanup after attempted write if it fails. 64 | try? fileManager.removeItem(at: fileURL) 65 | throw error 66 | } 67 | 68 | uploadable = .file(fileURL, shouldRemove: true) 69 | } 70 | 71 | return uploadable 72 | } 73 | } 74 | 75 | extension MultipartUpload: UploadConvertible { 76 | func asURLRequest() throws -> URLRequest { 77 | var urlRequest = try request.asURLRequest() 78 | 79 | multipartFormData.read { multipartFormData in 80 | urlRequest.headers.add(.contentType(multipartFormData.contentType)) 81 | } 82 | 83 | return urlRequest 84 | } 85 | 86 | func createUploadable() throws -> UploadRequest.Uploadable { 87 | try result.get() 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /Pods/Alamofire/Source/OperationQueue+Alamofire.swift: -------------------------------------------------------------------------------- 1 | // 2 | // OperationQueue+Alamofire.swift 3 | // 4 | // Copyright (c) 2014-2018 Alamofire Software Foundation (http://alamofire.org/) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | import Foundation 26 | 27 | extension OperationQueue { 28 | /// Creates an instance using the provided parameters. 29 | /// 30 | /// - Parameters: 31 | /// - qualityOfService: `QualityOfService` to be applied to the queue. `.default` by default. 32 | /// - maxConcurrentOperationCount: Maximum concurrent operations. 33 | /// `OperationQueue.defaultMaxConcurrentOperationCount` by default. 34 | /// - underlyingQueue: Underlying `DispatchQueue`. `nil` by default. 35 | /// - name: Name for the queue. `nil` by default. 36 | /// - startSuspended: Whether the queue starts suspended. `false` by default. 37 | convenience init(qualityOfService: QualityOfService = .default, 38 | maxConcurrentOperationCount: Int = OperationQueue.defaultMaxConcurrentOperationCount, 39 | underlyingQueue: DispatchQueue? = nil, 40 | name: String? = nil, 41 | startSuspended: Bool = false) { 42 | self.init() 43 | self.qualityOfService = qualityOfService 44 | self.maxConcurrentOperationCount = maxConcurrentOperationCount 45 | self.underlyingQueue = underlyingQueue 46 | self.name = name 47 | isSuspended = startSuspended 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Pods/Alamofire/Source/Result+Alamofire.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Result+Alamofire.swift 3 | // 4 | // Copyright (c) 2019 Alamofire Software Foundation (http://alamofire.org/) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | import Foundation 26 | 27 | /// Default type of `Result` returned by Alamofire, with an `AFError` `Failure` type. 28 | public typealias AFResult = Result 29 | 30 | // MARK: - Internal APIs 31 | 32 | extension Result { 33 | /// Returns whether the instance is `.success`. 34 | var isSuccess: Bool { 35 | guard case .success = self else { return false } 36 | return true 37 | } 38 | 39 | /// Returns whether the instance is `.failure`. 40 | var isFailure: Bool { 41 | !isSuccess 42 | } 43 | 44 | /// Returns the associated value if the result is a success, `nil` otherwise. 45 | var success: Success? { 46 | guard case let .success(value) = self else { return nil } 47 | return value 48 | } 49 | 50 | /// Returns the associated error value if the result is a failure, `nil` otherwise. 51 | var failure: Failure? { 52 | guard case let .failure(error) = self else { return nil } 53 | return error 54 | } 55 | 56 | /// Initializes a `Result` from value or error. Returns `.failure` if the error is non-nil, `.success` otherwise. 57 | /// 58 | /// - Parameters: 59 | /// - value: A value. 60 | /// - error: An `Error`. 61 | init(value: Success, error: Failure?) { 62 | if let error = error { 63 | self = .failure(error) 64 | } else { 65 | self = .success(value) 66 | } 67 | } 68 | 69 | /// Evaluates the specified closure when the `Result` is a success, passing the unwrapped value as a parameter. 70 | /// 71 | /// Use the `tryMap` method with a closure that may throw an error. For example: 72 | /// 73 | /// let possibleData: Result = .success(Data(...)) 74 | /// let possibleObject = possibleData.tryMap { 75 | /// try JSONSerialization.jsonObject(with: $0) 76 | /// } 77 | /// 78 | /// - parameter transform: A closure that takes the success value of the instance. 79 | /// 80 | /// - returns: A `Result` containing the result of the given closure. If this instance is a failure, returns the 81 | /// same failure. 82 | func tryMap(_ transform: (Success) throws -> NewSuccess) -> Result { 83 | switch self { 84 | case let .success(value): 85 | do { 86 | return try .success(transform(value)) 87 | } catch { 88 | return .failure(error) 89 | } 90 | case let .failure(error): 91 | return .failure(error) 92 | } 93 | } 94 | 95 | /// Evaluates the specified closure when the `Result` is a failure, passing the unwrapped error as a parameter. 96 | /// 97 | /// Use the `tryMapError` function with a closure that may throw an error. For example: 98 | /// 99 | /// let possibleData: Result = .success(Data(...)) 100 | /// let possibleObject = possibleData.tryMapError { 101 | /// try someFailableFunction(taking: $0) 102 | /// } 103 | /// 104 | /// - Parameter transform: A throwing closure that takes the error of the instance. 105 | /// 106 | /// - Returns: A `Result` instance containing the result of the transform. If this instance is a success, returns 107 | /// the same success. 108 | func tryMapError(_ transform: (Failure) throws -> NewFailure) -> Result { 109 | switch self { 110 | case let .failure(error): 111 | do { 112 | return try .failure(transform(error)) 113 | } catch { 114 | return .failure(error) 115 | } 116 | case let .success(value): 117 | return .success(value) 118 | } 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /Pods/Alamofire/Source/StringEncoding+Alamofire.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StringEncoding+Alamofire.swift 3 | // 4 | // Copyright (c) 2020 Alamofire Software Foundation (http://alamofire.org/) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | import Foundation 26 | 27 | extension String.Encoding { 28 | /// Creates an encoding from the IANA charset name. 29 | /// 30 | /// - Notes: These mappings match those [provided by CoreFoundation](https://opensource.apple.com/source/CF/CF-476.18/CFStringUtilities.c.auto.html) 31 | /// 32 | /// - Parameter name: IANA charset name. 33 | init?(ianaCharsetName name: String) { 34 | switch name.lowercased() { 35 | case "utf-8": 36 | self = .utf8 37 | case "iso-8859-1": 38 | self = .isoLatin1 39 | case "unicode-1-1", "iso-10646-ucs-2", "utf-16": 40 | self = .utf16 41 | case "utf-16be": 42 | self = .utf16BigEndian 43 | case "utf-16le": 44 | self = .utf16LittleEndian 45 | case "utf-32": 46 | self = .utf32 47 | case "utf-32be": 48 | self = .utf32BigEndian 49 | case "utf-32le": 50 | self = .utf32LittleEndian 51 | default: 52 | return nil 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Pods/Alamofire/Source/URLConvertible+URLRequestConvertible.swift: -------------------------------------------------------------------------------- 1 | // 2 | // URLConvertible+URLRequestConvertible.swift 3 | // 4 | // Copyright (c) 2014-2018 Alamofire Software Foundation (http://alamofire.org/) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | import Foundation 26 | 27 | /// Types adopting the `URLConvertible` protocol can be used to construct `URL`s, which can then be used to construct 28 | /// `URLRequests`. 29 | public protocol URLConvertible { 30 | /// Returns a `URL` from the conforming instance or throws. 31 | /// 32 | /// - Returns: The `URL` created from the instance. 33 | /// - Throws: Any error thrown while creating the `URL`. 34 | func asURL() throws -> URL 35 | } 36 | 37 | extension String: URLConvertible { 38 | /// Returns a `URL` if `self` can be used to initialize a `URL` instance, otherwise throws. 39 | /// 40 | /// - Returns: The `URL` initialized with `self`. 41 | /// - Throws: An `AFError.invalidURL` instance. 42 | public func asURL() throws -> URL { 43 | guard let url = URL(string: self) else { throw AFError.invalidURL(url: self) } 44 | 45 | return url 46 | } 47 | } 48 | 49 | extension URL: URLConvertible { 50 | /// Returns `self`. 51 | public func asURL() throws -> URL { self } 52 | } 53 | 54 | extension URLComponents: URLConvertible { 55 | /// Returns a `URL` if the `self`'s `url` is not nil, otherwise throws. 56 | /// 57 | /// - Returns: The `URL` from the `url` property. 58 | /// - Throws: An `AFError.invalidURL` instance. 59 | public func asURL() throws -> URL { 60 | guard let url = url else { throw AFError.invalidURL(url: self) } 61 | 62 | return url 63 | } 64 | } 65 | 66 | // MARK: - 67 | 68 | /// Types adopting the `URLRequestConvertible` protocol can be used to safely construct `URLRequest`s. 69 | public protocol URLRequestConvertible { 70 | /// Returns a `URLRequest` or throws if an `Error` was encountered. 71 | /// 72 | /// - Returns: A `URLRequest`. 73 | /// - Throws: Any error thrown while constructing the `URLRequest`. 74 | func asURLRequest() throws -> URLRequest 75 | } 76 | 77 | extension URLRequestConvertible { 78 | /// The `URLRequest` returned by discarding any `Error` encountered. 79 | public var urlRequest: URLRequest? { try? asURLRequest() } 80 | } 81 | 82 | extension URLRequest: URLRequestConvertible { 83 | /// Returns `self`. 84 | public func asURLRequest() throws -> URLRequest { self } 85 | } 86 | 87 | // MARK: - 88 | 89 | extension URLRequest { 90 | /// Creates an instance with the specified `url`, `method`, and `headers`. 91 | /// 92 | /// - Parameters: 93 | /// - url: The `URLConvertible` value. 94 | /// - method: The `HTTPMethod`. 95 | /// - headers: The `HTTPHeaders`, `nil` by default. 96 | /// - Throws: Any error thrown while converting the `URLConvertible` to a `URL`. 97 | public init(url: URLConvertible, method: HTTPMethod, headers: HTTPHeaders? = nil) throws { 98 | let url = try url.asURL() 99 | 100 | self.init(url: url) 101 | 102 | httpMethod = method.rawValue 103 | allHTTPHeaderFields = headers?.dictionary 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /Pods/Alamofire/Source/URLRequest+Alamofire.swift: -------------------------------------------------------------------------------- 1 | // 2 | // URLRequest+Alamofire.swift 3 | // 4 | // Copyright (c) 2019 Alamofire Software Foundation (http://alamofire.org/) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | import Foundation 26 | 27 | extension URLRequest { 28 | /// Returns the `httpMethod` as Alamofire's `HTTPMethod` type. 29 | public var method: HTTPMethod? { 30 | get { httpMethod.map(HTTPMethod.init) } 31 | set { httpMethod = newValue?.rawValue } 32 | } 33 | 34 | public func validate() throws { 35 | if method == .get, let bodyData = httpBody { 36 | throw AFError.urlRequestValidationFailed(reason: .bodyDataInGETRequest(bodyData)) 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Pods/Alamofire/Source/URLSessionConfiguration+Alamofire.swift: -------------------------------------------------------------------------------- 1 | // 2 | // URLSessionConfiguration+Alamofire.swift 3 | // 4 | // Copyright (c) 2014-2018 Alamofire Software Foundation (http://alamofire.org/) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | import Foundation 26 | 27 | extension URLSessionConfiguration: AlamofireExtended {} 28 | extension AlamofireExtension where ExtendedType: URLSessionConfiguration { 29 | /// Alamofire's default configuration. Same as `URLSessionConfiguration.default` but adds Alamofire default 30 | /// `Accept-Language`, `Accept-Encoding`, and `User-Agent` headers. 31 | public static var `default`: URLSessionConfiguration { 32 | let configuration = URLSessionConfiguration.default 33 | configuration.headers = .default 34 | 35 | return configuration 36 | } 37 | 38 | /// `.ephemeral` configuration with Alamofire's default `Accept-Language`, `Accept-Encoding`, and `User-Agent` 39 | /// headers. 40 | public static var ephemeral: URLSessionConfiguration { 41 | let configuration = URLSessionConfiguration.ephemeral 42 | configuration.headers = .default 43 | 44 | return configuration 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Pods/JSONValueRX/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015-Present Rex Fenley 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Pods/JSONValueRX/Sources/Utilities.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension NSNumber { 4 | public var isBool: Bool { 5 | let trueNumber = NSNumber(value: true as Bool) 6 | let falseNumber = NSNumber(value: false as Bool) 7 | let trueObjCType = String(cString: trueNumber.objCType) 8 | let falseObjCType = String(cString: falseNumber.objCType) 9 | 10 | let objCType = String(cString: self.objCType) 11 | let isTrueNumber = (self.compare(trueNumber) == ComparisonResult.orderedSame && objCType == trueObjCType) 12 | let isFalseNumber = (self.compare(falseNumber) == ComparisonResult.orderedSame && objCType == falseObjCType) 13 | 14 | return isTrueNumber || isFalseNumber 15 | } 16 | 17 | public var isDouble: Bool { 18 | let encoding = String(cString: self.objCType) 19 | return encoding == "d" 20 | } 21 | 22 | public var isFloat: Bool { 23 | let encoding = String(cString: self.objCType) 24 | return encoding == "f" 25 | } 26 | 27 | public var isReal: Bool { 28 | return self.isDouble || self.isFloat 29 | } 30 | 31 | public var isInteger: Bool { 32 | return !self.isReal 33 | } 34 | 35 | public var asJSONNumber: JSONNumber { 36 | if !self.isReal, let i = Int64(exactly: self) { 37 | return .int(i) 38 | } 39 | return .fraction(self.doubleValue) 40 | } 41 | } 42 | 43 | extension Dictionary { 44 | func mapValues(_ transform: (Value) throws -> OutValue) rethrows -> [Key: OutValue] { 45 | var outDict = [Key: OutValue]() 46 | try self.forEach { key, value in 47 | outDict[key] = try transform(value) 48 | } 49 | return outDict 50 | } 51 | } 52 | 53 | // Consider using SwiftDate library if requirements increase. 54 | public extension DateFormatter { 55 | @nonobjc static let isoFormatterMilli: DateFormatter = { 56 | let dateFormatter = DateFormatter() 57 | dateFormatter.locale = Locale(identifier: "en_US_POSIX") 58 | dateFormatter.timeZone = TimeZone(abbreviation: "UTC") 59 | dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXXX" 60 | return dateFormatter 61 | }() 62 | 63 | @nonobjc static let isoFormatter: DateFormatter = { 64 | let dateFormatter = DateFormatter() 65 | dateFormatter.locale = Locale(identifier: "en_US_POSIX") 66 | dateFormatter.timeZone = TimeZone(abbreviation: "UTC") 67 | dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss'Z'" 68 | return dateFormatter 69 | }() 70 | } 71 | 72 | public extension Date { 73 | init?(isoString: String) { 74 | let dateFormatter = DateFormatter.isoFormatter 75 | let dateFormatterMilli = DateFormatter.isoFormatterMilli 76 | guard let date = (dateFormatter.date(from: isoString) ?? dateFormatterMilli.date(from: isoString)) else { 77 | return nil 78 | } 79 | self = date 80 | } 81 | 82 | var isoString: String { 83 | let dateFromatter = DateFormatter.isoFormatter 84 | return dateFromatter.string(from: self) 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Alamofire (5.8.1) 3 | - JSONValueRX (8.0.0) 4 | - Starscream (4.0.8) 5 | 6 | DEPENDENCIES: 7 | - Alamofire (~> 5.8.0) 8 | - JSONValueRX (~> 8.0) 9 | - Starscream (= 4.0.8) 10 | 11 | SPEC REPOS: 12 | trunk: 13 | - Alamofire 14 | - JSONValueRX 15 | - Starscream 16 | 17 | SPEC CHECKSUMS: 18 | Alamofire: 3ca42e259043ee0dc5c0cdd76c4bc568b8e42af7 19 | JSONValueRX: 08c9ad9367a9355b9739bb51bd3901486bb67536 20 | Starscream: 19b5533ddb925208db698f0ac508a100b884a1b9 21 | 22 | PODFILE CHECKSUM: a23e81270e4936afc2af38e99a4bc540a1bb414b 23 | 24 | COCOAPODS: 1.16.2 25 | -------------------------------------------------------------------------------- /Pods/Starscream/Sources/Compression/Compression.swift: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Compression.swift 4 | // Starscream 5 | // 6 | // Created by Dalton Cherry on 2/4/19. 7 | // Copyright © 2019 Vluxe. All rights reserved. 8 | // 9 | // Licensed under the Apache License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://www.apache.org/licenses/LICENSE-2.0 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | // 21 | ////////////////////////////////////////////////////////////////////////////////////////////////// 22 | 23 | import Foundation 24 | 25 | public protocol CompressionHandler { 26 | func load(headers: [String: String]) 27 | func decompress(data: Data, isFinal: Bool) -> Data? 28 | func compress(data: Data) -> Data? 29 | } 30 | -------------------------------------------------------------------------------- /Pods/Starscream/Sources/DataBytes/Data+Extensions.swift: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Data+Extensions.swift 4 | // Starscream 5 | // 6 | // Created by Dalton Cherry on 3/27/19. 7 | // Copyright © 2019 Vluxe. All rights reserved. 8 | // 9 | // Fix for deprecation warnings 10 | // 11 | // Licensed under the Apache License, Version 2.0 (the "License"); 12 | // you may not use this file except in compliance with the License. 13 | // You may obtain a copy of the License at 14 | // 15 | // http://www.apache.org/licenses/LICENSE-2.0 16 | // 17 | // Unless required by applicable law or agreed to in writing, software 18 | // distributed under the License is distributed on an "AS IS" BASIS, 19 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | // See the License for the specific language governing permissions and 21 | // limitations under the License. 22 | // 23 | ////////////////////////////////////////////////////////////////////////////////////////////////// 24 | 25 | import Foundation 26 | 27 | internal extension Data { 28 | struct ByteError: Swift.Error {} 29 | 30 | #if swift(>=5.0) 31 | func withUnsafeBytes(_ completion: (UnsafePointer) throws -> ResultType) rethrows -> ResultType { 32 | return try withUnsafeBytes { 33 | if let baseAddress = $0.baseAddress, $0.count > 0 { 34 | return try completion(baseAddress.assumingMemoryBound(to: ContentType.self)) 35 | } else { 36 | throw ByteError() 37 | } 38 | } 39 | } 40 | #endif 41 | 42 | #if swift(>=5.0) 43 | mutating func withUnsafeMutableBytes(_ completion: (UnsafeMutablePointer) throws -> ResultType) rethrows -> ResultType { 44 | return try withUnsafeMutableBytes { 45 | if let baseAddress = $0.baseAddress, $0.count > 0 { 46 | return try completion(baseAddress.assumingMemoryBound(to: ContentType.self)) 47 | } else { 48 | throw ByteError() 49 | } 50 | } 51 | } 52 | #endif 53 | } 54 | -------------------------------------------------------------------------------- /Pods/Starscream/Sources/Engine/Engine.swift: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Engine.swift 4 | // Starscream 5 | // 6 | // Created by Dalton Cherry on 6/15/19 7 | // Copyright © 2019 Vluxe. All rights reserved. 8 | // 9 | // Licensed under the Apache License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://www.apache.org/licenses/LICENSE-2.0 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | // 21 | ////////////////////////////////////////////////////////////////////////////////////////////////// 22 | 23 | import Foundation 24 | 25 | public protocol EngineDelegate: AnyObject { 26 | func didReceive(event: WebSocketEvent) 27 | } 28 | 29 | public protocol Engine { 30 | func register(delegate: EngineDelegate) 31 | func start(request: URLRequest) 32 | func stop(closeCode: UInt16) 33 | func forceStop() 34 | func write(data: Data, opcode: FrameOpCode, completion: (() -> ())?) 35 | func write(string: String, completion: (() -> ())?) 36 | } 37 | -------------------------------------------------------------------------------- /Pods/Starscream/Sources/Engine/NativeEngine.swift: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // NativeEngine.swift 4 | // Starscream 5 | // 6 | // Created by Dalton Cherry on 6/15/19 7 | // Copyright © 2019 Vluxe. All rights reserved. 8 | // 9 | // Licensed under the Apache License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://www.apache.org/licenses/LICENSE-2.0 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | // 21 | ////////////////////////////////////////////////////////////////////////////////////////////////// 22 | 23 | import Foundation 24 | 25 | @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) 26 | public class NativeEngine: NSObject, Engine, URLSessionDataDelegate, URLSessionWebSocketDelegate { 27 | private var task: URLSessionWebSocketTask? 28 | weak var delegate: EngineDelegate? 29 | 30 | public func register(delegate: EngineDelegate) { 31 | self.delegate = delegate 32 | } 33 | 34 | public func start(request: URLRequest) { 35 | let session = URLSession(configuration: URLSessionConfiguration.default, delegate: self, delegateQueue: nil) 36 | task = session.webSocketTask(with: request) 37 | doRead() 38 | task?.resume() 39 | } 40 | 41 | public func stop(closeCode: UInt16) { 42 | let closeCode = URLSessionWebSocketTask.CloseCode(rawValue: Int(closeCode)) ?? .normalClosure 43 | task?.cancel(with: closeCode, reason: nil) 44 | } 45 | 46 | public func forceStop() { 47 | stop(closeCode: UInt16(URLSessionWebSocketTask.CloseCode.abnormalClosure.rawValue)) 48 | } 49 | 50 | public func write(string: String, completion: (() -> ())?) { 51 | task?.send(.string(string), completionHandler: { (error) in 52 | completion?() 53 | }) 54 | } 55 | 56 | public func write(data: Data, opcode: FrameOpCode, completion: (() -> ())?) { 57 | switch opcode { 58 | case .binaryFrame: 59 | task?.send(.data(data), completionHandler: { (error) in 60 | completion?() 61 | }) 62 | case .textFrame: 63 | let text = String(data: data, encoding: .utf8)! 64 | write(string: text, completion: completion) 65 | case .ping: 66 | task?.sendPing(pongReceiveHandler: { (error) in 67 | completion?() 68 | }) 69 | default: 70 | break //unsupported 71 | } 72 | } 73 | 74 | private func doRead() { 75 | task?.receive { [weak self] (result) in 76 | switch result { 77 | case .success(let message): 78 | switch message { 79 | case .string(let string): 80 | self?.broadcast(event: .text(string)) 81 | case .data(let data): 82 | self?.broadcast(event: .binary(data)) 83 | @unknown default: 84 | break 85 | } 86 | break 87 | case .failure(let error): 88 | self?.broadcast(event: .error(error)) 89 | return 90 | } 91 | self?.doRead() 92 | } 93 | } 94 | 95 | private func broadcast(event: WebSocketEvent) { 96 | delegate?.didReceive(event: event) 97 | } 98 | 99 | public func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didOpenWithProtocol protocol: String?) { 100 | let p = `protocol` ?? "" 101 | broadcast(event: .connected([HTTPWSHeader.protocolName: p])) 102 | } 103 | 104 | public func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didCloseWith closeCode: URLSessionWebSocketTask.CloseCode, reason: Data?) { 105 | var r = "" 106 | if let d = reason { 107 | r = String(data: d, encoding: .utf8) ?? "" 108 | } 109 | broadcast(event: .disconnected(r, UInt16(closeCode.rawValue))) 110 | } 111 | 112 | public func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) { 113 | broadcast(event: .error(error)) 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /Pods/Starscream/Sources/Framer/FoundationHTTPHandler.swift: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // FoundationHTTPHandler.swift 4 | // Starscream 5 | // 6 | // Created by Dalton Cherry on 1/25/19. 7 | // Copyright © 2019 Vluxe. All rights reserved. 8 | // 9 | // Licensed under the Apache License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://www.apache.org/licenses/LICENSE-2.0 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | // 21 | ////////////////////////////////////////////////////////////////////////////////////////////////// 22 | 23 | import Foundation 24 | #if os(watchOS) 25 | public typealias FoundationHTTPHandler = StringHTTPHandler 26 | #else 27 | public class FoundationHTTPHandler: HTTPHandler { 28 | 29 | var buffer = Data() 30 | weak var delegate: HTTPHandlerDelegate? 31 | 32 | public init() { 33 | 34 | } 35 | 36 | public func convert(request: URLRequest) -> Data { 37 | let msg = CFHTTPMessageCreateRequest(kCFAllocatorDefault, request.httpMethod! as CFString, 38 | request.url! as CFURL, kCFHTTPVersion1_1).takeRetainedValue() 39 | if let headers = request.allHTTPHeaderFields { 40 | for (aKey, aValue) in headers { 41 | CFHTTPMessageSetHeaderFieldValue(msg, aKey as CFString, aValue as CFString) 42 | } 43 | } 44 | if let body = request.httpBody { 45 | CFHTTPMessageSetBody(msg, body as CFData) 46 | } 47 | guard let data = CFHTTPMessageCopySerializedMessage(msg) else { 48 | return Data() 49 | } 50 | return data.takeRetainedValue() as Data 51 | } 52 | 53 | public func parse(data: Data) -> Int { 54 | let offset = findEndOfHTTP(data: data) 55 | if offset > 0 { 56 | buffer.append(data.subdata(in: 0.. Bool { 68 | var pointer = [UInt8]() 69 | data.withUnsafeBytes { pointer.append(contentsOf: $0) } 70 | 71 | let response = CFHTTPMessageCreateEmpty(kCFAllocatorDefault, false).takeRetainedValue() 72 | if !CFHTTPMessageAppendBytes(response, pointer, data.count) { 73 | return false //not enough data, wait for more 74 | } 75 | if !CFHTTPMessageIsHeaderComplete(response) { 76 | return false //not enough data, wait for more 77 | } 78 | 79 | if let cfHeaders = CFHTTPMessageCopyAllHeaderFields(response) { 80 | let nsHeaders = cfHeaders.takeRetainedValue() as NSDictionary 81 | var headers = [String: String]() 82 | for (key, value) in nsHeaders { 83 | if let key = key as? String, let value = value as? String { 84 | headers[key] = value 85 | } 86 | } 87 | 88 | let code = CFHTTPMessageGetResponseStatusCode(response) 89 | if code != HTTPWSHeader.switchProtocolCode { 90 | delegate?.didReceiveHTTP(event: .failure(HTTPUpgradeError.notAnUpgrade(code, headers))) 91 | return true 92 | } 93 | 94 | delegate?.didReceiveHTTP(event: .success(headers)) 95 | return true 96 | } 97 | 98 | delegate?.didReceiveHTTP(event: .failure(HTTPUpgradeError.invalidData)) 99 | return true 100 | } 101 | 102 | public func register(delegate: HTTPHandlerDelegate) { 103 | self.delegate = delegate 104 | } 105 | 106 | private func findEndOfHTTP(data: Data) -> Int { 107 | let endBytes = [UInt8(ascii: "\r"), UInt8(ascii: "\n"), UInt8(ascii: "\r"), UInt8(ascii: "\n")] 108 | var pointer = [UInt8]() 109 | data.withUnsafeBytes { pointer.append(contentsOf: $0) } 110 | var k = 0 111 | for i in 0.. Data { 35 | #if os(watchOS) 36 | //TODO: build response header 37 | return Data() 38 | #else 39 | let response = CFHTTPMessageCreateResponse(kCFAllocatorDefault, HTTPWSHeader.switchProtocolCode, 40 | nil, kCFHTTPVersion1_1).takeRetainedValue() 41 | 42 | //TODO: add other values to make a proper response here... 43 | //TODO: also sec key thing (Sec-WebSocket-Key) 44 | for (key, value) in headers { 45 | CFHTTPMessageSetHeaderFieldValue(response, key as CFString, value as CFString) 46 | } 47 | guard let cfData = CFHTTPMessageCopySerializedMessage(response)?.takeRetainedValue() else { 48 | return Data() 49 | } 50 | return cfData as Data 51 | #endif 52 | } 53 | 54 | public func parse(data: Data) { 55 | buffer.append(data) 56 | if parseContent(data: buffer) { 57 | buffer = Data() 58 | } 59 | } 60 | 61 | //returns true when the buffer should be cleared 62 | func parseContent(data: Data) -> Bool { 63 | var pointer = [UInt8]() 64 | data.withUnsafeBytes { pointer.append(contentsOf: $0) } 65 | #if os(watchOS) 66 | //TODO: parse data 67 | return false 68 | #else 69 | let response = CFHTTPMessageCreateEmpty(kCFAllocatorDefault, true).takeRetainedValue() 70 | if !CFHTTPMessageAppendBytes(response, pointer, data.count) { 71 | return false //not enough data, wait for more 72 | } 73 | if !CFHTTPMessageIsHeaderComplete(response) { 74 | return false //not enough data, wait for more 75 | } 76 | if let method = CFHTTPMessageCopyRequestMethod(response)?.takeRetainedValue() { 77 | if (method as NSString) != getVerb { 78 | delegate?.didReceive(event: .failure(HTTPUpgradeError.invalidData)) 79 | return true 80 | } 81 | } 82 | 83 | if let cfHeaders = CFHTTPMessageCopyAllHeaderFields(response) { 84 | let nsHeaders = cfHeaders.takeRetainedValue() as NSDictionary 85 | var headers = [String: String]() 86 | for (key, value) in nsHeaders { 87 | if let key = key as? String, let value = value as? String { 88 | headers[key] = value 89 | } 90 | } 91 | delegate?.didReceive(event: .success(headers)) 92 | return true 93 | } 94 | 95 | delegate?.didReceive(event: .failure(HTTPUpgradeError.invalidData)) 96 | return true 97 | #endif 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /Pods/Starscream/Sources/Framer/FrameCollector.swift: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // FrameCollector.swift 4 | // Starscream 5 | // 6 | // Created by Dalton Cherry on 1/24/19. 7 | // Copyright © 2019 Vluxe. All rights reserved. 8 | // 9 | // Licensed under the Apache License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://www.apache.org/licenses/LICENSE-2.0 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | // 21 | ////////////////////////////////////////////////////////////////////////////////////////////////// 22 | 23 | import Foundation 24 | 25 | public protocol FrameCollectorDelegate: AnyObject { 26 | func didForm(event: FrameCollector.Event) 27 | func decompress(data: Data, isFinal: Bool) -> Data? 28 | } 29 | 30 | public class FrameCollector { 31 | public enum Event { 32 | case text(String) 33 | case binary(Data) 34 | case pong(Data?) 35 | case ping(Data?) 36 | case error(Error) 37 | case closed(String, UInt16) 38 | } 39 | weak var delegate: FrameCollectorDelegate? 40 | var buffer = Data() 41 | var frameCount = 0 42 | var isText = false //was the first frame a text frame or a binary frame? 43 | var needsDecompression = false 44 | 45 | public func add(frame: Frame) { 46 | //check single frame action and out of order frames 47 | if frame.opcode == .connectionClose { 48 | var code = frame.closeCode 49 | var reason = "connection closed by server" 50 | if let customCloseReason = String(data: frame.payload, encoding: .utf8) { 51 | reason = customCloseReason 52 | } else { 53 | code = CloseCode.protocolError.rawValue 54 | } 55 | delegate?.didForm(event: .closed(reason, code)) 56 | return 57 | } else if frame.opcode == .pong { 58 | delegate?.didForm(event: .pong(frame.payload)) 59 | return 60 | } else if frame.opcode == .ping { 61 | delegate?.didForm(event: .ping(frame.payload)) 62 | return 63 | } else if frame.opcode == .continueFrame && frameCount == 0 { 64 | let errCode = CloseCode.protocolError.rawValue 65 | delegate?.didForm(event: .error(WSError(type: .protocolError, message: "first frame can't be a continue frame", code: errCode))) 66 | reset() 67 | return 68 | } else if frameCount > 0 && frame.opcode != .continueFrame { 69 | let errCode = CloseCode.protocolError.rawValue 70 | delegate?.didForm(event: .error(WSError(type: .protocolError, message: "second and beyond of fragment message must be a continue frame", code: errCode))) 71 | reset() 72 | return 73 | } 74 | if frameCount == 0 { 75 | isText = frame.opcode == .textFrame 76 | needsDecompression = frame.needsDecompression 77 | } 78 | 79 | let payload: Data 80 | if needsDecompression { 81 | payload = delegate?.decompress(data: frame.payload, isFinal: frame.isFin) ?? frame.payload 82 | } else { 83 | payload = frame.payload 84 | } 85 | buffer.append(payload) 86 | frameCount += 1 87 | 88 | if frame.isFin { 89 | if isText { 90 | if let string = String(data: buffer, encoding: .utf8) { 91 | delegate?.didForm(event: .text(string)) 92 | } else { 93 | let errCode = CloseCode.protocolError.rawValue 94 | delegate?.didForm(event: .error(WSError(type: .protocolError, message: "not valid UTF-8 data", code: errCode))) 95 | } 96 | } else { 97 | delegate?.didForm(event: .binary(buffer)) 98 | } 99 | reset() 100 | } 101 | } 102 | 103 | func reset() { 104 | buffer = Data() 105 | frameCount = 0 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /Pods/Starscream/Sources/PrivacyInfo.xcprivacy: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSPrivacyTracking 6 | 7 | NSPrivacyTrackingDomains 8 | 9 | NSPrivacyCollectedDataTypes 10 | 11 | NSPrivacyAccessedAPITypes 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Pods/Starscream/Sources/Security/FoundationSecurity.swift: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // FoundationSecurity.swift 4 | // Starscream 5 | // 6 | // Created by Dalton Cherry on 3/16/19. 7 | // Copyright © 2019 Vluxe. All rights reserved. 8 | // 9 | // Licensed under the Apache License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://www.apache.org/licenses/LICENSE-2.0 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | // 21 | ////////////////////////////////////////////////////////////////////////////////////////////////// 22 | 23 | import Foundation 24 | import CommonCrypto 25 | 26 | public enum FoundationSecurityError: Error { 27 | case invalidRequest 28 | } 29 | 30 | public class FoundationSecurity { 31 | var allowSelfSigned = false 32 | 33 | public init(allowSelfSigned: Bool = false) { 34 | self.allowSelfSigned = allowSelfSigned 35 | } 36 | 37 | 38 | } 39 | 40 | extension FoundationSecurity: CertificatePinning { 41 | public func evaluateTrust(trust: SecTrust, domain: String?, completion: ((PinningState) -> ())) { 42 | if allowSelfSigned { 43 | completion(.success) 44 | return 45 | } 46 | 47 | SecTrustSetPolicies(trust, SecPolicyCreateSSL(true, domain as NSString?)) 48 | 49 | handleSecurityTrust(trust: trust, completion: completion) 50 | } 51 | 52 | private func handleSecurityTrust(trust: SecTrust, completion: ((PinningState) -> ())) { 53 | if #available(iOS 12.0, OSX 10.14, watchOS 5.0, tvOS 12.0, *) { 54 | var error: CFError? 55 | if SecTrustEvaluateWithError(trust, &error) { 56 | completion(.success) 57 | } else { 58 | completion(.failed(error)) 59 | } 60 | } else { 61 | handleOldSecurityTrust(trust: trust, completion: completion) 62 | } 63 | } 64 | 65 | private func handleOldSecurityTrust(trust: SecTrust, completion: ((PinningState) -> ())) { 66 | var result: SecTrustResultType = .unspecified 67 | SecTrustEvaluate(trust, &result) 68 | if result == .unspecified || result == .proceed { 69 | completion(.success) 70 | } else { 71 | let e = CFErrorCreate(kCFAllocatorDefault, "FoundationSecurityError" as NSString?, Int(result.rawValue), nil) 72 | completion(.failed(e)) 73 | } 74 | } 75 | } 76 | 77 | extension FoundationSecurity: HeaderValidator { 78 | public func validate(headers: [String: String], key: String) -> Error? { 79 | if let acceptKey = headers[HTTPWSHeader.acceptName] { 80 | let sha = "\(key)258EAFA5-E914-47DA-95CA-C5AB0DC85B11".sha1Base64() 81 | if sha != acceptKey { 82 | return WSError(type: .securityError, message: "accept header doesn't match", code: SecurityErrorCode.acceptFailed.rawValue) 83 | } 84 | } 85 | return nil 86 | } 87 | } 88 | 89 | private extension String { 90 | func sha1Base64() -> String { 91 | let data = self.data(using: .utf8)! 92 | let pointer = data.withUnsafeBytes { (bytes: UnsafeRawBufferPointer) -> [UInt8] in 93 | var digest = [UInt8](repeating: 0, count:Int(CC_SHA1_DIGEST_LENGTH)) 94 | CC_SHA1(bytes.baseAddress, CC_LONG(data.count), &digest) 95 | return digest 96 | } 97 | return Data(pointer).base64EncodedString() 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /Pods/Starscream/Sources/Security/Security.swift: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Security.swift 4 | // Starscream 5 | // 6 | // Created by Dalton Cherry on 3/16/19. 7 | // Copyright © 2019 Vluxe. All rights reserved. 8 | // 9 | // Licensed under the Apache License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://www.apache.org/licenses/LICENSE-2.0 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | // 21 | ////////////////////////////////////////////////////////////////////////////////////////////////// 22 | 23 | import Foundation 24 | 25 | public enum SecurityErrorCode: UInt16 { 26 | case acceptFailed = 1 27 | case pinningFailed = 2 28 | } 29 | 30 | public enum PinningState { 31 | case success 32 | case failed(CFError?) 33 | } 34 | 35 | // CertificatePinning protocol provides an interface for Transports to handle Certificate 36 | // or Public Key Pinning. 37 | public protocol CertificatePinning: AnyObject { 38 | func evaluateTrust(trust: SecTrust, domain: String?, completion: ((PinningState) -> ())) 39 | } 40 | 41 | // validates the "Sec-WebSocket-Accept" header as defined 1.3 of the RFC 6455 42 | // https://tools.ietf.org/html/rfc6455#section-1.3 43 | public protocol HeaderValidator: AnyObject { 44 | func validate(headers: [String: String], key: String) -> Error? 45 | } 46 | -------------------------------------------------------------------------------- /Pods/Starscream/Sources/Server/Server.swift: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Server.swift 4 | // Starscream 5 | // 6 | // Created by Dalton Cherry on 4/2/19. 7 | // Copyright © 2019 Vluxe. All rights reserved. 8 | // 9 | // Licensed under the Apache License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://www.apache.org/licenses/LICENSE-2.0 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | // 21 | ////////////////////////////////////////////////////////////////////////////////////////////////// 22 | 23 | import Foundation 24 | 25 | public enum ConnectionEvent { 26 | case connected([String: String]) 27 | case disconnected(String, UInt16) 28 | case text(String) 29 | case binary(Data) 30 | case pong(Data?) 31 | case ping(Data?) 32 | case error(Error) 33 | } 34 | 35 | public protocol Connection { 36 | func write(data: Data, opcode: FrameOpCode) 37 | } 38 | 39 | public protocol ConnectionDelegate: AnyObject { 40 | func didReceive(event: ServerEvent) 41 | } 42 | 43 | public enum ServerEvent { 44 | case connected(Connection, [String: String]) 45 | case disconnected(Connection, String, UInt16) 46 | case text(Connection, String) 47 | case binary(Connection, Data) 48 | case pong(Connection, Data?) 49 | case ping(Connection, Data?) 50 | } 51 | 52 | public protocol Server { 53 | func start(address: String, port: UInt16) -> Error? 54 | } 55 | 56 | 57 | -------------------------------------------------------------------------------- /Pods/Starscream/Sources/Transport/Transport.swift: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Transport.swift 4 | // Starscream 5 | // 6 | // Created by Dalton Cherry on 1/23/19. 7 | // Copyright © 2019 Vluxe. All rights reserved. 8 | // 9 | // Licensed under the Apache License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://www.apache.org/licenses/LICENSE-2.0 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | // 21 | ////////////////////////////////////////////////////////////////////////////////////////////////// 22 | 23 | import Foundation 24 | 25 | public enum ConnectionState { 26 | /// Ready connections can send and receive data 27 | case connected 28 | 29 | /// Waiting connections have not yet been started, or do not have a viable network 30 | case waiting 31 | 32 | /// Cancelled connections have been invalidated by the client and will send no more events 33 | case cancelled 34 | 35 | /// Failed connections are disconnected and can no longer send or receive data 36 | case failed(Error?) 37 | 38 | /// Viability (connection status) of the connection has updated 39 | /// e.g. connection is down, connection came back up, etc. 40 | case viability(Bool) 41 | 42 | /// Connection ca be upgraded to wifi from cellular. 43 | /// You should consider reconnecting to take advantage of this. 44 | case shouldReconnect(Bool) 45 | 46 | /// Received data 47 | case receive(Data) 48 | 49 | /// Remote peer has closed the network connection. 50 | case peerClosed 51 | } 52 | 53 | public protocol TransportEventClient: AnyObject { 54 | func connectionChanged(state: ConnectionState) 55 | } 56 | 57 | public protocol Transport: AnyObject { 58 | func register(delegate: TransportEventClient) 59 | func connect(url: URL, timeout: Double, certificatePinning: CertificatePinning?) 60 | func disconnect() 61 | func write(data: Data, completion: @escaping ((Error?) -> ())) 62 | var usingTLS: Bool { get } 63 | } 64 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/Alamofire-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | ${PODS_DEVELOPMENT_LANGUAGE} 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 5.8.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/Alamofire-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Alamofire : NSObject 3 | @end 4 | @implementation PodsDummy_Alamofire 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/Alamofire-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/Alamofire-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double AlamofireVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char AlamofireVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/Alamofire.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Alamofire 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LIBRARY_SEARCH_PATHS = $(inherited) "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 5 | OTHER_LDFLAGS = $(inherited) -framework "CFNetwork" 6 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -suppress-warnings 7 | PODS_BUILD_DIR = ${BUILD_DIR} 8 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_DEVELOPMENT_LANGUAGE = ${DEVELOPMENT_LANGUAGE} 10 | PODS_ROOT = ${SRCROOT} 11 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Alamofire 12 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 13 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 14 | SKIP_INSTALL = YES 15 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 16 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/Alamofire.modulemap: -------------------------------------------------------------------------------- 1 | framework module Alamofire { 2 | umbrella header "Alamofire-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/Alamofire.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Alamofire 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LIBRARY_SEARCH_PATHS = $(inherited) "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 5 | OTHER_LDFLAGS = $(inherited) -framework "CFNetwork" 6 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -suppress-warnings 7 | PODS_BUILD_DIR = ${BUILD_DIR} 8 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_DEVELOPMENT_LANGUAGE = ${DEVELOPMENT_LANGUAGE} 10 | PODS_ROOT = ${SRCROOT} 11 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Alamofire 12 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 13 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 14 | SKIP_INSTALL = YES 15 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 16 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/Alamofire.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Alamofire 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -suppress-warnings 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Alamofire 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/Crust-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 0.11.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 4.8.2 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/JSONValueRX/Crust-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 0.11.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/JSONValueRX/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 4.2.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/JSONValueRX/JSONValueRX-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | ${PODS_DEVELOPMENT_LANGUAGE} 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 8.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/JSONValueRX/JSONValueRX-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_JSONValueRX : NSObject 3 | @end 4 | @implementation PodsDummy_JSONValueRX 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/JSONValueRX/JSONValueRX-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/JSONValueRX/JSONValueRX-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double JSONValueRXVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char JSONValueRXVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/JSONValueRX/JSONValueRX.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LIBRARY_SEARCH_PATHS = $(inherited) "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 5 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -suppress-warnings 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_DEVELOPMENT_LANGUAGE = ${DEVELOPMENT_LANGUAGE} 9 | PODS_ROOT = ${SRCROOT} 10 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/JSONValueRX 11 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 12 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 13 | SKIP_INSTALL = YES 14 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 15 | -------------------------------------------------------------------------------- /Pods/Target Support Files/JSONValueRX/JSONValueRX.modulemap: -------------------------------------------------------------------------------- 1 | framework module JSONValueRX { 2 | umbrella header "JSONValueRX-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/JSONValueRX/JSONValueRX.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LIBRARY_SEARCH_PATHS = $(inherited) "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 5 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -suppress-warnings 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_DEVELOPMENT_LANGUAGE = ${DEVELOPMENT_LANGUAGE} 9 | PODS_ROOT = ${SRCROOT} 10 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/JSONValueRX 11 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 12 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 13 | SKIP_INSTALL = YES 14 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 15 | -------------------------------------------------------------------------------- /Pods/Target Support Files/JSONValueRX/JSONValueRX.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -suppress-warnings 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/JSONValueRX 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-AutoGraphQL-AutoGraphTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-AutoGraphQL-AutoGraphTests/OHHTTPStubs-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 8.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-AutoGraphQL-AutoGraphTests/Pods-AutoGraphQL-AutoGraphRealmTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-AutoGraphQL-AutoGraphTests/Pods-AutoGraphQL-AutoGraphTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | ${PODS_DEVELOPMENT_LANGUAGE} 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-AutoGraphQL-AutoGraphTests/Pods-AutoGraphQL-AutoGraphTests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_AutoGraphQL_AutoGraphTests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_AutoGraphQL_AutoGraphTests 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-AutoGraphQL-AutoGraphTests/Pods-AutoGraphQL-AutoGraphTests-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_AutoGraphQL_AutoGraphTestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_AutoGraphQL_AutoGraphTestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-AutoGraphQL-AutoGraphTests/Pods-AutoGraphQL-AutoGraphTests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX" "${PODS_CONFIGURATION_BUILD_DIR}/Starscream" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX/JSONValueRX.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Starscream/Starscream.framework/Headers" 6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) /usr/lib/swift "$(PLATFORM_DIR)/Developer/Library/Frameworks" '@executable_path/Frameworks' '@loader_path/Frameworks' 7 | LIBRARY_SEARCH_PATHS = $(inherited) "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 8 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" -isystem "${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX/JSONValueRX.framework/Headers" -isystem "${PODS_CONFIGURATION_BUILD_DIR}/Starscream/Starscream.framework/Headers" -iframework "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" -iframework "${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX" -iframework "${PODS_CONFIGURATION_BUILD_DIR}/Starscream" 9 | OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "CFNetwork" -framework "JSONValueRX" -framework "Starscream" 10 | OTHER_MODULE_VERIFIER_FLAGS = $(inherited) "-F${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "-F${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX" "-F${PODS_CONFIGURATION_BUILD_DIR}/Starscream" 11 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 12 | PODS_BUILD_DIR = ${BUILD_DIR} 13 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 14 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 15 | PODS_ROOT = ${SRCROOT}/Pods 16 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 17 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 18 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-AutoGraphQL-AutoGraphTests/Pods-AutoGraphQL-AutoGraphTests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_AutoGraphQL_AutoGraphTests { 2 | umbrella header "Pods-AutoGraphQL-AutoGraphTests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-AutoGraphQL-AutoGraphTests/Pods-AutoGraphQL-AutoGraphTests.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX" "${PODS_CONFIGURATION_BUILD_DIR}/Starscream" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX/JSONValueRX.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Starscream/Starscream.framework/Headers" 6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) /usr/lib/swift "$(PLATFORM_DIR)/Developer/Library/Frameworks" '@executable_path/Frameworks' '@loader_path/Frameworks' 7 | LIBRARY_SEARCH_PATHS = $(inherited) "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 8 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" -isystem "${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX/JSONValueRX.framework/Headers" -isystem "${PODS_CONFIGURATION_BUILD_DIR}/Starscream/Starscream.framework/Headers" -iframework "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" -iframework "${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX" -iframework "${PODS_CONFIGURATION_BUILD_DIR}/Starscream" 9 | OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "CFNetwork" -framework "JSONValueRX" -framework "Starscream" 10 | OTHER_MODULE_VERIFIER_FLAGS = $(inherited) "-F${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "-F${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX" "-F${PODS_CONFIGURATION_BUILD_DIR}/Starscream" 11 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 12 | PODS_BUILD_DIR = ${BUILD_DIR} 13 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 14 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 15 | PODS_ROOT = ${SRCROOT}/Pods 16 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 17 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 18 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-AutoGraphQL-QueryBuilderTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-AutoGraphQL-QueryBuilderTests/Pods-AutoGraphQL-QueryBuilderTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | ${PODS_DEVELOPMENT_LANGUAGE} 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-AutoGraphQL-QueryBuilderTests/Pods-AutoGraphQL-QueryBuilderTests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_AutoGraphQL_QueryBuilderTests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_AutoGraphQL_QueryBuilderTests 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-AutoGraphQL-QueryBuilderTests/Pods-AutoGraphQL-QueryBuilderTests-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_AutoGraphQL_QueryBuilderTestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_AutoGraphQL_QueryBuilderTestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-AutoGraphQL-QueryBuilderTests/Pods-AutoGraphQL-QueryBuilderTests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX" "${PODS_CONFIGURATION_BUILD_DIR}/Starscream" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX/JSONValueRX.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Starscream/Starscream.framework/Headers" 6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) /usr/lib/swift "$(PLATFORM_DIR)/Developer/Library/Frameworks" '@executable_path/Frameworks' '@loader_path/Frameworks' 7 | LIBRARY_SEARCH_PATHS = $(inherited) "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 8 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" -isystem "${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX/JSONValueRX.framework/Headers" -isystem "${PODS_CONFIGURATION_BUILD_DIR}/Starscream/Starscream.framework/Headers" -iframework "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" -iframework "${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX" -iframework "${PODS_CONFIGURATION_BUILD_DIR}/Starscream" 9 | OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "CFNetwork" -framework "JSONValueRX" -framework "Starscream" 10 | OTHER_MODULE_VERIFIER_FLAGS = $(inherited) "-F${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "-F${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX" "-F${PODS_CONFIGURATION_BUILD_DIR}/Starscream" 11 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 12 | PODS_BUILD_DIR = ${BUILD_DIR} 13 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 14 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 15 | PODS_ROOT = ${SRCROOT}/Pods 16 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 17 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 18 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-AutoGraphQL-QueryBuilderTests/Pods-AutoGraphQL-QueryBuilderTests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_AutoGraphQL_QueryBuilderTests { 2 | umbrella header "Pods-AutoGraphQL-QueryBuilderTests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-AutoGraphQL-QueryBuilderTests/Pods-AutoGraphQL-QueryBuilderTests.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX" "${PODS_CONFIGURATION_BUILD_DIR}/Starscream" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX/JSONValueRX.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Starscream/Starscream.framework/Headers" 6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) /usr/lib/swift "$(PLATFORM_DIR)/Developer/Library/Frameworks" '@executable_path/Frameworks' '@loader_path/Frameworks' 7 | LIBRARY_SEARCH_PATHS = $(inherited) "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 8 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" -isystem "${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX/JSONValueRX.framework/Headers" -isystem "${PODS_CONFIGURATION_BUILD_DIR}/Starscream/Starscream.framework/Headers" -iframework "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" -iframework "${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX" -iframework "${PODS_CONFIGURATION_BUILD_DIR}/Starscream" 9 | OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "CFNetwork" -framework "JSONValueRX" -framework "Starscream" 10 | OTHER_MODULE_VERIFIER_FLAGS = $(inherited) "-F${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "-F${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX" "-F${PODS_CONFIGURATION_BUILD_DIR}/Starscream" 11 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 12 | PODS_BUILD_DIR = ${BUILD_DIR} 13 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 14 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 15 | PODS_ROOT = ${SRCROOT}/Pods 16 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 17 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 18 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-AutoGraphQL-QueryBuilderTests/Realm-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 3.10.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-AutoGraphQL/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-AutoGraphQL/Pods-AutoGraphQL-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | ${PODS_DEVELOPMENT_LANGUAGE} 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-AutoGraphQL/Pods-AutoGraphQL-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_AutoGraphQL : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_AutoGraphQL 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-AutoGraphQL/Pods-AutoGraphQL-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_AutoGraphQLVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_AutoGraphQLVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-AutoGraphQL/Pods-AutoGraphQL.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX" "${PODS_CONFIGURATION_BUILD_DIR}/Starscream" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX/JSONValueRX.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Starscream/Starscream.framework/Headers" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) /usr/lib/swift '@executable_path/Frameworks' '@loader_path/Frameworks' '@executable_path/../../Frameworks' 6 | LIBRARY_SEARCH_PATHS = $(inherited) "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 7 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" -isystem "${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX/JSONValueRX.framework/Headers" -isystem "${PODS_CONFIGURATION_BUILD_DIR}/Starscream/Starscream.framework/Headers" -iframework "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" -iframework "${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX" -iframework "${PODS_CONFIGURATION_BUILD_DIR}/Starscream" 8 | OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "CFNetwork" -framework "JSONValueRX" -framework "Starscream" 9 | OTHER_MODULE_VERIFIER_FLAGS = $(inherited) "-F${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "-F${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX" "-F${PODS_CONFIGURATION_BUILD_DIR}/Starscream" 10 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 11 | PODS_BUILD_DIR = ${BUILD_DIR} 12 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 13 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 14 | PODS_ROOT = ${SRCROOT}/Pods 15 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 16 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-AutoGraphQL/Pods-AutoGraphQL.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_AutoGraphQL { 2 | umbrella header "Pods-AutoGraphQL-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-AutoGraphQL/Pods-AutoGraphQL.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX" "${PODS_CONFIGURATION_BUILD_DIR}/Starscream" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX/JSONValueRX.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Starscream/Starscream.framework/Headers" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) /usr/lib/swift '@executable_path/Frameworks' '@loader_path/Frameworks' '@executable_path/../../Frameworks' 6 | LIBRARY_SEARCH_PATHS = $(inherited) "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 7 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" -isystem "${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX/JSONValueRX.framework/Headers" -isystem "${PODS_CONFIGURATION_BUILD_DIR}/Starscream/Starscream.framework/Headers" -iframework "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" -iframework "${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX" -iframework "${PODS_CONFIGURATION_BUILD_DIR}/Starscream" 8 | OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "CFNetwork" -framework "JSONValueRX" -framework "Starscream" 9 | OTHER_MODULE_VERIFIER_FLAGS = $(inherited) "-F${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "-F${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX" "-F${PODS_CONFIGURATION_BUILD_DIR}/Starscream" 10 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 11 | PODS_BUILD_DIR = ${BUILD_DIR} 12 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 13 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 14 | PODS_ROOT = ${SRCROOT}/Pods 15 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 16 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-QueryBuilder/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-QueryBuilder/OHHTTPStubs-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 8.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-QueryBuilder/Pods-QueryBuilder-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | ${PODS_DEVELOPMENT_LANGUAGE} 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-QueryBuilder/Pods-QueryBuilder-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## JSONValueRX 5 | 6 | The MIT License (MIT) 7 | 8 | Copyright (c) 2015-Present Rex Fenley 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | 28 | 29 | Generated by CocoaPods - https://cocoapods.org 30 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-QueryBuilder/Pods-QueryBuilder-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | The MIT License (MIT) 18 | 19 | Copyright (c) 2015-Present Rex Fenley 20 | 21 | Permission is hereby granted, free of charge, to any person obtaining a copy 22 | of this software and associated documentation files (the "Software"), to deal 23 | in the Software without restriction, including without limitation the rights 24 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 25 | copies of the Software, and to permit persons to whom the Software is 26 | furnished to do so, subject to the following conditions: 27 | 28 | The above copyright notice and this permission notice shall be included in all 29 | copies or substantial portions of the Software. 30 | 31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 34 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 36 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 37 | SOFTWARE. 38 | 39 | 40 | License 41 | MIT 42 | Title 43 | JSONValueRX 44 | Type 45 | PSGroupSpecifier 46 | 47 | 48 | FooterText 49 | Generated by CocoaPods - https://cocoapods.org 50 | Title 51 | 52 | Type 53 | PSGroupSpecifier 54 | 55 | 56 | StringsTable 57 | Acknowledgements 58 | Title 59 | Acknowledgements 60 | 61 | 62 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-QueryBuilder/Pods-QueryBuilder-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_QueryBuilder : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_QueryBuilder 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-QueryBuilder/Pods-QueryBuilder-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_QueryBuilderVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_QueryBuilderVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-QueryBuilder/Pods-QueryBuilder.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX/JSONValueRX.framework/Headers" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) /usr/lib/swift '@executable_path/Frameworks' '@loader_path/Frameworks' '@executable_path/../../Frameworks' 6 | LIBRARY_SEARCH_PATHS = $(inherited) "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 7 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX/JSONValueRX.framework/Headers" -iframework "${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX" 8 | OTHER_LDFLAGS = $(inherited) -framework "JSONValueRX" 9 | OTHER_MODULE_VERIFIER_FLAGS = $(inherited) "-F${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX" 10 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 11 | PODS_BUILD_DIR = ${BUILD_DIR} 12 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 13 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 14 | PODS_ROOT = ${SRCROOT}/Pods 15 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 16 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-QueryBuilder/Pods-QueryBuilder.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_QueryBuilder { 2 | umbrella header "Pods-QueryBuilder-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-QueryBuilder/Pods-QueryBuilder.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX/JSONValueRX.framework/Headers" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) /usr/lib/swift '@executable_path/Frameworks' '@loader_path/Frameworks' '@executable_path/../../Frameworks' 6 | LIBRARY_SEARCH_PATHS = $(inherited) "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 7 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX/JSONValueRX.framework/Headers" -iframework "${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX" 8 | OTHER_LDFLAGS = $(inherited) -framework "JSONValueRX" 9 | OTHER_MODULE_VERIFIER_FLAGS = $(inherited) "-F${PODS_CONFIGURATION_BUILD_DIR}/JSONValueRX" 10 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 11 | PODS_BUILD_DIR = ${BUILD_DIR} 12 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 13 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 14 | PODS_ROOT = ${SRCROOT}/Pods 15 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 16 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Starscream/ResourceBundle-Starscream_Privacy-Starscream-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | ${PODS_DEVELOPMENT_LANGUAGE} 7 | CFBundleIdentifier 8 | ${PRODUCT_BUNDLE_IDENTIFIER} 9 | CFBundleInfoDictionaryVersion 10 | 6.0 11 | CFBundleName 12 | ${PRODUCT_NAME} 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 4.0.8 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Starscream/Starscream-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | ${PODS_DEVELOPMENT_LANGUAGE} 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 4.0.8 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Starscream/Starscream-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Starscream : NSObject 3 | @end 4 | @implementation PodsDummy_Starscream 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Starscream/Starscream-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Starscream/Starscream-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double StarscreamVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char StarscreamVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Starscream/Starscream.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Starscream 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LIBRARY_SEARCH_PATHS = $(inherited) "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 5 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -suppress-warnings 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_DEVELOPMENT_LANGUAGE = ${DEVELOPMENT_LANGUAGE} 9 | PODS_ROOT = ${SRCROOT} 10 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Starscream 11 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 12 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 13 | SKIP_INSTALL = YES 14 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 15 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Starscream/Starscream.modulemap: -------------------------------------------------------------------------------- 1 | framework module Starscream { 2 | umbrella header "Starscream-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Starscream/Starscream.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Starscream 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LIBRARY_SEARCH_PATHS = $(inherited) "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 5 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -suppress-warnings 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_DEVELOPMENT_LANGUAGE = ${DEVELOPMENT_LANGUAGE} 9 | PODS_ROOT = ${SRCROOT} 10 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Starscream 11 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 12 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 13 | SKIP_INSTALL = YES 14 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 15 | -------------------------------------------------------------------------------- /QueryBuilder/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /QueryBuilder/QueryBuilder.h: -------------------------------------------------------------------------------- 1 | // 2 | // QueryBuilder.h 3 | // QueryBuilder 4 | // 5 | // Created by Rex Fenley on 10/18/16. 6 | // Copyright © 2016 Remind. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for QueryBuilder. 12 | FOUNDATION_EXPORT double QueryBuilderVersionNumber; 13 | 14 | //! Project version string for QueryBuilder. 15 | FOUNDATION_EXPORT const unsigned char QueryBuilderVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /QueryBuilderTests/FoundationExtensionsTests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | @testable import AutoGraphQL 3 | 4 | class FoundationExtensionsTests: XCTestCase { 5 | func testArgumentStringJsonEncodes() { 6 | XCTAssertEqual(try! "arg arg".graphQLInputValue(), "\"arg arg\"") 7 | } 8 | 9 | func testNSNullJsonEncodes() { 10 | XCTAssertEqual(try! NSNull().graphQLInputValue(), "null") 11 | } 12 | 13 | func testNSNumberJsonEncodes() { 14 | // 1.1 -> "1.1000000000000001" https://bugs.swift.org/browse/SR-5961 15 | XCTAssertEqual(try! (1.2).graphQLInputValue(), "1.2") 16 | } 17 | } 18 | 19 | class OrderedDictionaryTests: XCTestCase { 20 | func testsMaintainsOrder() { 21 | var orderedDictionary = OrderedDictionary() 22 | orderedDictionary["first"] = "firstThing" 23 | orderedDictionary["second"] = "secondThing" 24 | orderedDictionary["third"] = "thirdThing" 25 | orderedDictionary["forth"] = "forthThing" 26 | 27 | XCTAssertEqual(orderedDictionary.values, ["firstThing", "secondThing", "thirdThing", "forthThing"]) 28 | 29 | orderedDictionary["second"] = nil 30 | orderedDictionary["third"] = nil 31 | orderedDictionary["third"] = nil // Some redundancy to test assigning `nil` twice. 32 | 33 | XCTAssertEqual(orderedDictionary.values, ["firstThing", "forthThing"]) 34 | 35 | orderedDictionary["fifth"] = "fifthThing" 36 | 37 | XCTAssertEqual(orderedDictionary.values, ["firstThing", "forthThing", "fifthThing"]) 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /QueryBuilderTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /autograph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/remind101/AutoGraph/b3ee5f98fdd56ca2e748a1cd5709bc080865c026/autograph.png -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | codecov: 2 | notify: 3 | require_ci_to_pass: true 4 | comment: 5 | behavior: default 6 | layout: header, diff 7 | require_changes: false 8 | coverage: 9 | precision: 2 10 | range: 11 | - 70.0 12 | - 100.0 13 | round: down 14 | status: 15 | default: 16 | threshold: 0% 17 | changes: false 18 | patch: true 19 | project: true 20 | parsers: 21 | gcov: 22 | branch_detection: 23 | conditional: true 24 | loop: true 25 | macro: false 26 | method: false 27 | javascript: 28 | enable_partials: false 29 | ignore: 30 | - ./Pods 31 | - ./QueryBuilderTests 32 | - ./AutoGraphTests 33 | --------------------------------------------------------------------------------