diff --git a/.swiftlint.yml b/.swiftlint.yml index 99cf33ad5..c1c407f31 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -3,6 +3,9 @@ swiftlint_version: 0.54.0 parent_config: https://raw.githubusercontent.com/Automattic/swiftlint-config/0f8ab6388bd8d15a04391825ab125f80cfb90704/.swiftlint.yml remote_timeout: 10.0 +excluded: + .build # `swift build` etc. output folder + opt_in_rules: - overridden_super_call - discarded_notification_center_observer diff --git a/Package.resolved b/Package.resolved new file mode 100644 index 000000000..a25dc7e56 --- /dev/null +++ b/Package.resolved @@ -0,0 +1,122 @@ +{ + "pins" : [ + { + "identity" : "alamofire", + "kind" : "remoteSourceControl", + "location" : "https://github.com/Alamofire/Alamofire", + "state" : { + "revision" : "f455c2975872ccd2d9c81594c658af65716e9b9a", + "version" : "5.9.1" + } + }, + { + "identity" : "collectionconcurrencykit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/JohnSundell/CollectionConcurrencyKit.git", + "state" : { + "revision" : "b4f23e24b5a1bff301efc5e70871083ca029ff95", + "version" : "0.2.0" + } + }, + { + "identity" : "cryptoswift", + "kind" : "remoteSourceControl", + "location" : "https://github.com/krzyzanowskim/CryptoSwift.git", + "state" : { + "revision" : "7892a123f7e8d0fe62f9f03728b17bbd4f94df5c", + "version" : "1.8.1" + } + }, + { + "identity" : "ohhttpstubs", + "kind" : "remoteSourceControl", + "location" : "https://github.com/AliSoftware/OHHTTPStubs", + "state" : { + "revision" : "12f19662426d0434d6c330c6974d53e2eb10ecd9", + "version" : "9.1.0" + } + }, + { + "identity" : "sourcekitten", + "kind" : "remoteSourceControl", + "location" : "https://github.com/jpsim/SourceKitten.git", + "state" : { + "revision" : "b6dc09ee51dfb0c66e042d2328c017483a1a5d56", + "version" : "0.34.1" + } + }, + { + "identity" : "swift-argument-parser", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-argument-parser.git", + "state" : { + "revision" : "8f4d2753f0e4778c76d5f05ad16c74f707390531", + "version" : "1.2.3" + } + }, + { + "identity" : "swift-syntax", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-syntax.git", + "state" : { + "revision" : "6ad4ea24b01559dde0773e3d091f1b9e36175036", + "version" : "509.0.2" + } + }, + { + "identity" : "swiftlint", + "kind" : "remoteSourceControl", + "location" : "https://github.com/realm/SwiftLint", + "state" : { + "revision" : "f17a4f9dfb6a6afb0408426354e4180daaf49cee", + "version" : "0.54.0" + } + }, + { + "identity" : "swiftytexttable", + "kind" : "remoteSourceControl", + "location" : "https://github.com/scottrhoyt/SwiftyTextTable.git", + "state" : { + "revision" : "c6df6cf533d120716bff38f8ff9885e1ce2a4ac3", + "version" : "0.9.0" + } + }, + { + "identity" : "swxmlhash", + "kind" : "remoteSourceControl", + "location" : "https://github.com/drmohundro/SWXMLHash.git", + "state" : { + "revision" : "a853604c9e9a83ad9954c7e3d2a565273982471f", + "version" : "7.0.2" + } + }, + { + "identity" : "wordpress-ios-shared", + "kind" : "remoteSourceControl", + "location" : "https://github.com/wordpress-mobile/WordPress-iOS-Shared.git", + "state" : { + "branch" : "mokagio/swiftlint-read-as-dependency", + "revision" : "422950b28f01d7cc11218e7d70a6cd65004d23ae" + } + }, + { + "identity" : "wpxmlrpc", + "kind" : "remoteSourceControl", + "location" : "https://github.com/wordpress-mobile/wpxmlrpc", + "state" : { + "revision" : "bfc413d336bdeaab89e62dc483380baa99b2257e", + "version" : "0.10.0" + } + }, + { + "identity" : "yams", + "kind" : "remoteSourceControl", + "location" : "https://github.com/jpsim/Yams.git", + "state" : { + "revision" : "8a835d918245ca22f36663dd3862138805d7f707", + "version" : "5.1.0" + } + } + ], + "version" : 2 +} diff --git a/Package.swift b/Package.swift index b19919f10..688f38a60 100644 --- a/Package.swift +++ b/Package.swift @@ -4,12 +4,46 @@ import PackageDescription let package = Package( name: "WordPressKit", - platforms: [.iOS(.v13)], + platforms: [ + .iOS(.v13), + // The package(s) are meant for iOS only, but the use of the SwiftLint plugin down the dependency chain requires specifying a compatible macOS version. + .macOS(.v12), + ], products: [ .library(name: "APIInterface", targets: ["APIInterface"]), + .library(name: "CoreAPI", targets: ["CoreAPI"]), + ], + dependencies: [ + // .package(url: "https://github.com/wordpress-mobile/WordPress-iOS-Shared.git", from: "2.3.1"), + // See https://github.com/wordpress-mobile/WordPress-iOS-Shared/pull/354 + .package(url: "https://github.com/wordpress-mobile/WordPress-iOS-Shared.git", branch: "mokagio/swiftlint-read-as-dependency"), + .package(url: "https://github.com/wordpress-mobile/wpxmlrpc", from: "0.10.0"), + // Test dependencies + .package(url: "https://github.com/AliSoftware/OHHTTPStubs", from: "9.1.0"), + .package(url: "https://github.com/Alamofire/Alamofire", from: "5.8.1"), ], - dependencies: [], targets: [ - .target(name: "APIInterface") + .target(name: "APIInterface"), + .target( + name: "CoreAPI", + dependencies: [ + .target(name: "APIInterface"), + .product(name: "WordPressShared", package: "WordPress-iOS-Shared"), + "wpxmlrpc" + ] + ), + .testTarget( + name: "CoreAPITests", + dependencies: [ + .target(name: "CoreAPI"), + .product(name: "OHHTTPStubs", package: "OHHTTPStubs"), + .product(name: "OHHTTPStubsSwift", package: "OHHTTPStubs"), + "Alamofire", + ], + path: "Tests/CoreAPITests", + resources: [ + .process("Stubs") // Relative to path + ] + ), ] ) diff --git a/Sources/APIInterface/WordPressComRESTAPIVersionedPathBuilder.m b/Sources/APIInterface/WordPressComRESTAPIVersionedPathBuilder.m new file mode 100644 index 000000000..073dcc0e0 --- /dev/null +++ b/Sources/APIInterface/WordPressComRESTAPIVersionedPathBuilder.m @@ -0,0 +1,60 @@ +#import +#if SWIFT_PACKAGE +#import "WordPressComRESTAPIVersionedPathBuilder.h" +#import "WordPressComRESTAPIVersion.h" +#else +#import "WordPressKit/WordPressComRESTAPIVersionedPathBuilder.h" +#endif + +static NSString* const WordPressComRESTApiVersionStringInvalid = @"invalid_api_version"; +static NSString* const WordPressComRESTApiVersionString_1_0 = @"rest/v1"; +static NSString* const WordPressComRESTApiVersionString_1_1 = @"rest/v1.1"; +static NSString* const WordPressComRESTApiVersionString_1_2 = @"rest/v1.2"; +static NSString* const WordPressComRESTApiVersionString_1_3 = @"rest/v1.3"; +static NSString* const WordPressComRESTApiVersionString_2_0 = @"wpcom/v2"; + +@implementation WordPressComRESTAPIVersionedPathBuilder + ++ (NSString *)pathForEndpoint:(NSString *)endpoint + withVersion:(WordPressComRESTAPIVersion)apiVersion +{ + NSString *apiVersionString = [self apiVersionStringWithEnumValue:apiVersion]; + + return [NSString stringWithFormat:@"%@/%@", apiVersionString, endpoint]; +} + ++ (NSString *)apiVersionStringWithEnumValue:(WordPressComRESTAPIVersion)apiVersion +{ + NSString *result = nil; + + switch (apiVersion) { + case WordPressComRESTAPIVersion_1_0: + result = WordPressComRESTApiVersionString_1_0; + break; + + case WordPressComRESTAPIVersion_1_1: + result = WordPressComRESTApiVersionString_1_1; + break; + + case WordPressComRESTAPIVersion_1_2: + result = WordPressComRESTApiVersionString_1_2; + break; + + case WordPressComRESTAPIVersion_1_3: + result = WordPressComRESTApiVersionString_1_3; + break; + + case WordPressComRESTAPIVersion_2_0: + result = WordPressComRESTApiVersionString_2_0; + break; + + default: + NSAssert(NO, @"This should never by executed"); + result = WordPressComRESTApiVersionStringInvalid; + break; + } + + return result; +} + +@end diff --git a/Sources/APIInterface/include/WordPressComRESTAPIVersionedPathBuilder.h b/Sources/APIInterface/include/WordPressComRESTAPIVersionedPathBuilder.h new file mode 100644 index 000000000..d9f8b8162 --- /dev/null +++ b/Sources/APIInterface/include/WordPressComRESTAPIVersionedPathBuilder.h @@ -0,0 +1,14 @@ +#import +#if SWIFT_PACKAGE +#import "WordPressComRESTAPIVersion.h" +#else +#import +#endif + +@interface WordPressComRESTAPIVersionedPathBuilder: NSObject + ++ (NSString *)pathForEndpoint:(NSString *)endpoint + withVersion:(WordPressComRESTAPIVersion)apiVersion +NS_SWIFT_NAME(path(forEndpoint:withVersion:)); + +@end diff --git a/Sources/APIInterface/include/WordPressComRestApiErrorDomain.h b/Sources/APIInterface/include/WordPressComRestApiErrorDomain.h new file mode 100644 index 000000000..c4b6aa423 --- /dev/null +++ b/Sources/APIInterface/include/WordPressComRestApiErrorDomain.h @@ -0,0 +1,9 @@ +#import + +/// Error domain of `NSError` instances that are converted from `WordPressComRestApiEndpointError` +/// and `WordPressAPIError` instances. +/// +/// This matches the compiler generated value and is used to ensure consistent error domain across error types and SPM or Framework build modes. +/// +/// See `extension WordPressComRestApiEndpointError: CustomNSError` in CoreAPI package for context. +static NSString *const _Nonnull WordPressComRestApiErrorDomain = @"WordPressKit.WordPressComRestApiError"; diff --git a/Sources/WordPressKit/Services/ServiceRemoteWordPressComREST.h b/Sources/BasicBlogAPIObjc/ServiceRemoteWordPressComREST.h similarity index 95% rename from Sources/WordPressKit/Services/ServiceRemoteWordPressComREST.h rename to Sources/BasicBlogAPIObjc/ServiceRemoteWordPressComREST.h index f6cc94c94..6d7ad96ab 100644 --- a/Sources/WordPressKit/Services/ServiceRemoteWordPressComREST.h +++ b/Sources/BasicBlogAPIObjc/ServiceRemoteWordPressComREST.h @@ -15,6 +15,7 @@ NS_ASSUME_NONNULL_BEGIN /** * @brief The API object to use for communications. */ +// TODO: This needs to go before being able to put this ObjC in a package. @property (nonatomic, strong, readonly) WordPressComRestApi *wordPressComRestApi; /** diff --git a/Sources/BasicBlogAPIObjc/ServiceRemoteWordPressComREST.m b/Sources/BasicBlogAPIObjc/ServiceRemoteWordPressComREST.m new file mode 100644 index 000000000..b3f1f359a --- /dev/null +++ b/Sources/BasicBlogAPIObjc/ServiceRemoteWordPressComREST.m @@ -0,0 +1,29 @@ +#import "ServiceRemoteWordPressComREST.h" +#import "WPKit-Swift.h" + +@implementation ServiceRemoteWordPressComREST + +- (instancetype)initWithWordPressComRestApi:(WordPressComRestApi *)wordPressComRestApi { + + NSParameterAssert([wordPressComRestApi isKindOfClass:[WordPressComRestApi class]]); + + self = [super init]; + if (self) { + _wordPressComRestApi = wordPressComRestApi; + _wordPressComRESTAPI = wordPressComRestApi; + } + return self; +} + +#pragma mark - Request URL construction + +- (NSString *)pathForEndpoint:(NSString *)resourceUrl + withVersion:(WordPressComRESTAPIVersion)apiVersion +{ + NSParameterAssert([resourceUrl isKindOfClass:[NSString class]]); + + return [WordPressComRESTAPIVersionedPathBuilder pathForEndpoint:resourceUrl + withVersion:apiVersion]; +} + +@end diff --git a/Sources/WordPressKit/Utility/AppTransportSecuritySettings.swift b/Sources/CoreAPI/AppTransportSecuritySettings.swift similarity index 100% rename from Sources/WordPressKit/Utility/AppTransportSecuritySettings.swift rename to Sources/CoreAPI/AppTransportSecuritySettings.swift diff --git a/Sources/WordPressKit/WordPressAPI/Date+WordPressCom.swift b/Sources/CoreAPI/Date+WordPressCom.swift similarity index 97% rename from Sources/WordPressKit/WordPressAPI/Date+WordPressCom.swift rename to Sources/CoreAPI/Date+WordPressCom.swift index 5619c59b0..3bbc47e05 100644 --- a/Sources/WordPressKit/WordPressAPI/Date+WordPressCom.swift +++ b/Sources/CoreAPI/Date+WordPressCom.swift @@ -1,3 +1,5 @@ +import Foundation + extension Date { /// Parses a date string diff --git a/Sources/WordPressKit/WordPressAPI/DateFormatter+WordPressCom.swift b/Sources/CoreAPI/DateFormatter+WordPressCom.swift similarity index 96% rename from Sources/WordPressKit/WordPressAPI/DateFormatter+WordPressCom.swift rename to Sources/CoreAPI/DateFormatter+WordPressCom.swift index 1bb03baf0..930b87f83 100644 --- a/Sources/WordPressKit/WordPressAPI/DateFormatter+WordPressCom.swift +++ b/Sources/CoreAPI/DateFormatter+WordPressCom.swift @@ -1,3 +1,5 @@ +import Foundation + extension DateFormatter { /// A `DateFormatter` configured to manage dates compatible with the WordPress.com API. diff --git a/Sources/WordPressKit/Utility/Either.swift b/Sources/CoreAPI/Either.swift similarity index 100% rename from Sources/WordPressKit/Utility/Either.swift rename to Sources/CoreAPI/Either.swift diff --git a/Sources/WordPressKit/WordPressAPI/HTTPAuthenticationAlertController.swift b/Sources/CoreAPI/HTTPAuthenticationAlertController.swift similarity index 99% rename from Sources/WordPressKit/WordPressAPI/HTTPAuthenticationAlertController.swift rename to Sources/CoreAPI/HTTPAuthenticationAlertController.swift index 3773ae3b6..c588fa058 100644 --- a/Sources/WordPressKit/WordPressAPI/HTTPAuthenticationAlertController.swift +++ b/Sources/CoreAPI/HTTPAuthenticationAlertController.swift @@ -1,4 +1,5 @@ import Foundation +import UIKit /// URLAuthenticationChallenge Handler: It's up to the Host App to actually use this, whenever `WordPressOrgXMLRPCApi.onChallenge` is hit! /// diff --git a/Sources/WordPressKit/WordPressAPI/HTTPClient.swift b/Sources/CoreAPI/HTTPClient.swift similarity index 100% rename from Sources/WordPressKit/WordPressAPI/HTTPClient.swift rename to Sources/CoreAPI/HTTPClient.swift diff --git a/Sources/WordPressKit/WordPressAPI/HTTPRequestBuilder.swift b/Sources/CoreAPI/HTTPRequestBuilder.swift similarity index 100% rename from Sources/WordPressKit/WordPressAPI/HTTPRequestBuilder.swift rename to Sources/CoreAPI/HTTPRequestBuilder.swift diff --git a/Sources/WordPressKit/Utility/MultipartForm.swift b/Sources/CoreAPI/MultipartForm.swift similarity index 100% rename from Sources/WordPressKit/Utility/MultipartForm.swift rename to Sources/CoreAPI/MultipartForm.swift diff --git a/Sources/WordPressKit/WordPressAPI/NSDate+WordPressCom.swift b/Sources/CoreAPI/NSDate+WordPressCom.swift similarity index 100% rename from Sources/WordPressKit/WordPressAPI/NSDate+WordPressCom.swift rename to Sources/CoreAPI/NSDate+WordPressCom.swift diff --git a/Sources/WordPressKit/WordPressAPI/NonceRetrieval.swift b/Sources/CoreAPI/NonceRetrieval.swift similarity index 100% rename from Sources/WordPressKit/WordPressAPI/NonceRetrieval.swift rename to Sources/CoreAPI/NonceRetrieval.swift diff --git a/Sources/WordPressKit/Utility/Result+Callback.swift b/Sources/CoreAPI/Result+Callback.swift similarity index 94% rename from Sources/WordPressKit/Utility/Result+Callback.swift rename to Sources/CoreAPI/Result+Callback.swift index 0e3724e1f..f34fcae8b 100644 --- a/Sources/WordPressKit/Utility/Result+Callback.swift +++ b/Sources/CoreAPI/Result+Callback.swift @@ -1,4 +1,4 @@ -extension Swift.Result { +public extension Swift.Result { // Notice there are no explicit unit tests for this utility because it is implicitly tested via the consuming code's tests. func execute(onSuccess: (Success) -> Void, onFailure: (Failure) -> Void) { diff --git a/Sources/WordPressKit/Models/SocialLogin2FANonceInfo.swift b/Sources/CoreAPI/SocialLogin2FANonceInfo.swift similarity index 100% rename from Sources/WordPressKit/Models/SocialLogin2FANonceInfo.swift rename to Sources/CoreAPI/SocialLogin2FANonceInfo.swift diff --git a/Sources/CoreAPI/StringEncoding+IANA.swift b/Sources/CoreAPI/StringEncoding+IANA.swift new file mode 100644 index 000000000..c4d92d7ef --- /dev/null +++ b/Sources/CoreAPI/StringEncoding+IANA.swift @@ -0,0 +1,44 @@ +import Foundation + +extension String.Encoding { + /// See: https://www.iana.org/assignments/character-sets/character-sets.xhtml + init?(ianaCharsetName: String) { + let encoding: CFStringEncoding = CFStringConvertIANACharSetNameToEncoding(ianaCharsetName as CFString) + guard encoding != kCFStringEncodingInvalidId, + let builtInEncoding = CFStringBuiltInEncodings(rawValue: encoding) + else { + return nil + } + + switch builtInEncoding { + case .macRoman: + self = .macOSRoman + case .windowsLatin1: + self = .windowsCP1252 + case .isoLatin1: + self = .isoLatin1 + case .nextStepLatin: + self = .nextstep + case .ASCII: + self = .ascii + case .unicode: + self = .unicode + case .UTF8: + self = .utf8 + case .nonLossyASCII: + self = .nonLossyASCII + case .UTF16BE: + self = .utf16BigEndian + case .UTF16LE: + self = .utf16LittleEndian + case .UTF32: + self = .utf32 + case .UTF32BE: + self = .utf32BigEndian + case .UTF32LE: + self = .utf32LittleEndian + @unknown default: + return nil + } + } +} diff --git a/Sources/WordPressKit/Models/WebauthChallengeInfo.swift b/Sources/CoreAPI/WebauthChallengeInfo.swift similarity index 100% rename from Sources/WordPressKit/Models/WebauthChallengeInfo.swift rename to Sources/CoreAPI/WebauthChallengeInfo.swift diff --git a/Sources/WordPressKit/WordPressAPI/WordPressAPIError+NSErrorBrdige.swift b/Sources/CoreAPI/WordPressAPIError+NSErrorBridge.swift similarity index 96% rename from Sources/WordPressKit/WordPressAPI/WordPressAPIError+NSErrorBrdige.swift rename to Sources/CoreAPI/WordPressAPIError+NSErrorBridge.swift index 7a6539012..594c3e3e8 100644 --- a/Sources/WordPressKit/WordPressAPI/WordPressAPIError+NSErrorBrdige.swift +++ b/Sources/CoreAPI/WordPressAPIError+NSErrorBridge.swift @@ -1,4 +1,7 @@ import Foundation +#if SWIFT_PACKAGE +import APIInterface +#endif /// Custom `NSError` bridge implementation. /// @@ -86,8 +89,7 @@ extension WordPressAPIError: CustomNSError { /// And in cases where additional user info was provided, they need to be carried over to the `NSError` instances. extension WordPressComRestApiEndpointError: CustomNSError { - // This value is the same as the `WordPressComRestApiErrorDomain` constant generated by Swift compiler. - public static let errorDomain = "WordPressKit.WordPressComRestApiError" + public static let errorDomain = WordPressComRestApiErrorDomain public var errorCode: Int { code.rawValue diff --git a/Sources/WordPressKit/WordPressAPI/WordPressAPIError.swift b/Sources/CoreAPI/WordPressAPIError.swift similarity index 100% rename from Sources/WordPressKit/WordPressAPI/WordPressAPIError.swift rename to Sources/CoreAPI/WordPressAPIError.swift diff --git a/Sources/WordPressKit/WordPressAPI/WordPressComOAuthClient.swift b/Sources/CoreAPI/WordPressComOAuthClient.swift similarity index 98% rename from Sources/WordPressKit/WordPressAPI/WordPressComOAuthClient.swift rename to Sources/CoreAPI/WordPressComOAuthClient.swift index 38f58ed44..3060708b8 100644 --- a/Sources/WordPressKit/WordPressAPI/WordPressComOAuthClient.swift +++ b/Sources/CoreAPI/WordPressComOAuthClient.swift @@ -187,7 +187,7 @@ public final class WordPressComOAuthClient: NSObject { .mapSuccess { response in let responseObject = try JSONSerialization.jsonObject(with: response.body) - WPKitLogVerbose("Received OAuth2 response: \(self.cleanedUpResponseForLogging(responseObject as AnyObject? ?? "nil" as AnyObject))") + // WPKitLogVerbose("Received OAuth2 response: \(self.cleanedUpResponseForLogging(responseObject as AnyObject? ?? "nil" as AnyObject))") guard let responseDictionary = responseObject as? [String: AnyObject] else { throw URLError(.cannotParseResponse) @@ -380,7 +380,7 @@ public final class WordPressComOAuthClient: NSObject { .perform(request: builder, errorType: AuthenticationFailure.self) .mapUnacceptableStatusCodeError(AuthenticationFailure.init(response:body:)) .mapSuccess { response in - WPKitLogVerbose("Received Social Login Oauth response.") + // WPKitLogVerbose("Received Social Login Oauth response.") // Make sure we received expected data. let responseObject = try? JSONSerialization.jsonObject(with: response.body) @@ -700,7 +700,7 @@ public final class WordPressComOAuthClient: NSObject { .mapSuccess { response in let responseObject = try JSONSerialization.jsonObject(with: response.body) - WPKitLogVerbose("Received Social Login Oauth response: \(self.cleanedUpResponseForLogging(responseObject as AnyObject? ?? "nil" as AnyObject))") + // WPKitLogVerbose("Received Social Login Oauth response: \(self.cleanedUpResponseForLogging(responseObject as AnyObject? ?? "nil" as AnyObject))") guard let responseDictionary = responseObject as? [String: AnyObject], let responseData = responseDictionary["data"] as? [String: AnyObject], let authToken = responseData["bearer_token"] as? String else { diff --git a/Sources/WordPressKit/WordPressAPI/WordPressComRestApi.swift b/Sources/CoreAPI/WordPressComRestApi.swift similarity index 99% rename from Sources/WordPressKit/WordPressAPI/WordPressComRestApi.swift rename to Sources/CoreAPI/WordPressComRestApi.swift index a0b9d6058..6983e8c84 100644 --- a/Sources/WordPressKit/WordPressAPI/WordPressComRestApi.swift +++ b/Sources/CoreAPI/WordPressComRestApi.swift @@ -1,3 +1,6 @@ +#if SWIFT_PACKAGE +import APIInterface +#endif import Foundation import WordPressShared diff --git a/Sources/WordPressKit/WordPressAPI/WordPressOrgRestApi.swift b/Sources/CoreAPI/WordPressOrgRestApi.swift similarity index 99% rename from Sources/WordPressKit/WordPressAPI/WordPressOrgRestApi.swift rename to Sources/CoreAPI/WordPressOrgRestApi.swift index 30adcb2d1..337ea2980 100644 --- a/Sources/WordPressKit/WordPressAPI/WordPressOrgRestApi.swift +++ b/Sources/CoreAPI/WordPressOrgRestApi.swift @@ -1,4 +1,5 @@ import Foundation +import WordPressShared public struct WordPressOrgRestApiError: LocalizedError, Decodable, HTTPURLResponseProviding { public enum CodingKeys: String, CodingKey { diff --git a/Sources/WordPressKit/WordPressAPI/WordPressOrgXMLRPCApi.swift b/Sources/CoreAPI/WordPressOrgXMLRPCApi.swift similarity index 100% rename from Sources/WordPressKit/WordPressAPI/WordPressOrgXMLRPCApi.swift rename to Sources/CoreAPI/WordPressOrgXMLRPCApi.swift diff --git a/Sources/WordPressKit/WordPressAPI/WordPressOrgXMLRPCValidator.swift b/Sources/CoreAPI/WordPressOrgXMLRPCValidator.swift similarity index 96% rename from Sources/WordPressKit/WordPressAPI/WordPressOrgXMLRPCValidator.swift rename to Sources/CoreAPI/WordPressOrgXMLRPCValidator.swift index 715ad5f4a..c26d54abd 100644 --- a/Sources/WordPressKit/WordPressAPI/WordPressOrgXMLRPCValidator.swift +++ b/Sources/CoreAPI/WordPressOrgXMLRPCValidator.swift @@ -137,13 +137,13 @@ open class WordPressOrgXMLRPCValidator: NSObject { xmlrpcURL = try urlForXMLRPCFromURLString(nextSite, addXMLRPC: true) originalXMLRPCURL = try urlForXMLRPCFromURLString(nextSite, addXMLRPC: false) } catch let error as NSError { - WPKitLogError(error.localizedDescription) + // WPKitLogError(error.localizedDescription) errorHandler(error) return } validateXMLRPCURL(xmlrpcURL, success: success, failure: { (error) in - WPKitLogError(error.localizedDescription) + // WPKitLogError(error.localizedDescription) if (error.domain == NSURLErrorDomain && error.code == NSURLErrorUserCancelledAuthentication) || (error.domain == NSURLErrorDomain && error.code == NSURLErrorCannotFindHost) || (error.domain == NSURLErrorDomain && error.code == NSURLErrorNetworkConnectionLost) || @@ -152,12 +152,12 @@ open class WordPressOrgXMLRPCValidator: NSObject { return } // Try the original given url as an XML-RPC endpoint - WPKitLogError("Try the original given url as an XML-RPC endpoint: \(originalXMLRPCURL)") + // WPKitLogError("Try the original given url as an XML-RPC endpoint: \(originalXMLRPCURL)") self.validateXMLRPCURL(originalXMLRPCURL, success: success, failure: { (error) in - WPKitLogError(error.localizedDescription) + // WPKitLogError(error.localizedDescription) // Fetch the original url and look for the RSD link self.guessXMLRPCURLFromHTMLURL(originalXMLRPCURL, success: success, failure: { (error) in - WPKitLogError(error.localizedDescription) + // WPKitLogError(error.localizedDescription) errorHandler(error) }) @@ -193,7 +193,7 @@ open class WordPressOrgXMLRPCValidator: NSObject { if baseURL.lastPathComponent != "xmlrpc.php" && addXMLRPC { // Assume the given url is the home page and XML-RPC sits at /xmlrpc.php - WPKitLogInfo("Assume the given url is the home page and XML-RPC sits at /xmlrpc.php") + // WPKitLogInfo("Assume the given url is the home page and XML-RPC sits at /xmlrpc.php") resultURLString = "\(resultURLString)/xmlrpc.php" } @@ -263,7 +263,7 @@ open class WordPressOrgXMLRPCValidator: NSObject { private func guessXMLRPCURLFromHTMLURL(_ htmlURL: URL, success: @escaping (_ xmlrpcURL: URL) -> Void, failure: @escaping (_ error: NSError) -> Void) { - WPKitLogInfo("Fetch the original url and look for the RSD link by using RegExp") + // WPKitLogInfo("Fetch the original url and look for the RSD link by using RegExp") var isWpSite = false let session = URLSession(configuration: URLSessionConfiguration.ephemeral) @@ -338,7 +338,7 @@ open class WordPressOrgXMLRPCValidator: NSObject { private func guessXMLRPCURLFromRSD(_ rsd: String, success: @escaping (_ xmlrpcURL: URL) -> Void, failure: @escaping (_ error: NSError) -> Void) { - WPKitLogInfo("Parse the RSD document at the following URL: \(rsd)") + // WPKitLogInfo("Parse the RSD document at the following URL: \(rsd)") guard let rsdURL = URL(string: rsd) else { failure(WordPressOrgXMLRPCValidatorError.invalid as NSError) return @@ -358,7 +358,7 @@ open class WordPressOrgXMLRPCValidator: NSObject { failure(WordPressOrgXMLRPCValidatorError.invalid as NSError) return } - WPKitLogInfo("Bingo! We found the WordPress XML-RPC element: \(xmlrpcURL)") + // WPKitLogInfo("Bingo! We found the WordPress XML-RPC element: \(xmlrpcURL)") self.validateXMLRPCURL(xmlrpcURL, success: success, failure: failure) }) dataTask.resume() diff --git a/Sources/WordPressKit/WordPressAPI/WordPressRSDParser.swift b/Sources/CoreAPI/WordPressRSDParser.swift similarity index 96% rename from Sources/WordPressKit/WordPressAPI/WordPressRSDParser.swift rename to Sources/CoreAPI/WordPressRSDParser.swift index 29a4cf4f5..5d6d1f784 100644 --- a/Sources/WordPressKit/WordPressAPI/WordPressRSDParser.swift +++ b/Sources/CoreAPI/WordPressRSDParser.swift @@ -47,7 +47,7 @@ open class WordPressRSDParser: NSObject, XMLParserDelegate { } open func parser(_ parser: XMLParser, parseErrorOccurred parseError: Error) { - WPKitLogInfo("Error parsing RSD: \(parseError)") + // WPKitLogInfo("Error parsing RSD: \(parseError)") } } diff --git a/Sources/WordPressKit/Services/MediaServiceRemoteREST.m b/Sources/WordPressKit/Services/MediaServiceRemoteREST.m index 6aca3d445..5c50b0854 100644 --- a/Sources/WordPressKit/Services/MediaServiceRemoteREST.m +++ b/Sources/WordPressKit/Services/MediaServiceRemoteREST.m @@ -244,7 +244,9 @@ - (NSError *)processMediaUploadErrors:(NSArray *)errorList { errorMessage = errorInfo[@"message"]; } NSDictionary *errorDictionary = @{NSLocalizedDescriptionKey: errorMessage}; - error = [NSError errorWithDomain:WordPressComRestApiErrorDomain code:WordPressComRestApiErrorCodeUploadFailed userInfo:errorDictionary]; + error = [[NSError alloc] initWithDomain:WordPressComRestApiErrorDomain + code:WordPressComRestApiErrorCodeUploadFailed + userInfo:errorDictionary]; } return error; } @@ -296,9 +298,9 @@ - (void)deleteMedia:(RemoteMedia *)media } } else { if (failure) { - NSError *error = [NSError errorWithDomain:WordPressComRestApiErrorDomain - code:WordPressComRestApiErrorCodeUnknown - userInfo:nil]; + NSError *error = [[NSError alloc] initWithDomain:WordPressComRestApiErrorDomain + code:WordPressComRestApiErrorCodeUnknown + userInfo:nil]; failure(error); } } @@ -369,9 +371,9 @@ -(void)getVideoPressToken:(NSString *)videoPressID } } else { if (failure) { - NSError *error = [NSError errorWithDomain:WordPressComRestApiErrorDomain - code:WordPressComRestApiErrorCodeUnknown - userInfo:nil]; + NSError *error = [[NSError alloc] initWithDomain:WordPressComRestApiErrorDomain + code:WordPressComRestApiErrorCodeUnknown + userInfo:nil]; failure(error); } } diff --git a/Sources/WordPressKit/Services/ServiceRemoteWordPressComREST.m b/Sources/WordPressKit/Services/ServiceRemoteWordPressComREST.m deleted file mode 100644 index cfe4a43f9..000000000 --- a/Sources/WordPressKit/Services/ServiceRemoteWordPressComREST.m +++ /dev/null @@ -1,74 +0,0 @@ -#import "ServiceRemoteWordPressComREST.h" -#import "WPKit-Swift.h" - -static NSString* const ServiceRemoteWordPressComRESTApiVersionStringInvalid = @"invalid_api_version"; -static NSString* const ServiceRemoteWordPressComRESTApiVersionString_1_0 = @"rest/v1"; -static NSString* const ServiceRemoteWordPressComRESTApiVersionString_1_1 = @"rest/v1.1"; -static NSString* const ServiceRemoteWordPressComRESTApiVersionString_1_2 = @"rest/v1.2"; -static NSString* const ServiceRemoteWordPressComRESTApiVersionString_1_3 = @"rest/v1.3"; -static NSString* const ServiceRemoteWordPressComRESTApiVersionString_2_0 = @"wpcom/v2"; - -@implementation ServiceRemoteWordPressComREST - -- (instancetype)initWithWordPressComRestApi:(WordPressComRestApi *)wordPressComRestApi { - - NSParameterAssert([wordPressComRestApi isKindOfClass:[WordPressComRestApi class]]); - - self = [super init]; - if (self) { - _wordPressComRestApi = wordPressComRestApi; - _wordPressComRESTAPI = wordPressComRestApi; - } - return self; -} - - -#pragma mark - API Version - -- (NSString *)apiVersionStringWithEnumValue:(WordPressComRESTAPIVersion)apiVersion -{ - NSString *result = nil; - - switch (apiVersion) { - case WordPressComRESTAPIVersion_1_0: - result = ServiceRemoteWordPressComRESTApiVersionString_1_0; - break; - - case WordPressComRESTAPIVersion_1_1: - result = ServiceRemoteWordPressComRESTApiVersionString_1_1; - break; - - case WordPressComRESTAPIVersion_1_2: - result = ServiceRemoteWordPressComRESTApiVersionString_1_2; - break; - - case WordPressComRESTAPIVersion_1_3: - result = ServiceRemoteWordPressComRESTApiVersionString_1_3; - break; - - case WordPressComRESTAPIVersion_2_0: - result = ServiceRemoteWordPressComRESTApiVersionString_2_0; - break; - - default: - NSAssert(NO, @"This should never by executed"); - result = ServiceRemoteWordPressComRESTApiVersionStringInvalid; - break; - } - - return result; -} - -#pragma mark - Request URL construction - -- (NSString *)pathForEndpoint:(NSString *)resourceUrl - withVersion:(WordPressComRESTAPIVersion)apiVersion -{ - NSParameterAssert([resourceUrl isKindOfClass:[NSString class]]); - - NSString *apiVersionString = [self apiVersionStringWithEnumValue:apiVersion]; - - return [NSString stringWithFormat:@"%@/%@", apiVersionString, resourceUrl]; -} - -@end diff --git a/Sources/WordPressKit/Services/WordPressComServiceRemote.m b/Sources/WordPressKit/Services/WordPressComServiceRemote.m index 20cf3a879..28555c7ea 100644 --- a/Sources/WordPressKit/Services/WordPressComServiceRemote.m +++ b/Sources/WordPressKit/Services/WordPressComServiceRemote.m @@ -182,7 +182,6 @@ - (void)createWPComBlogWithUrl:(NSString *)blogUrl NSError *errorWithLocalizedMessage = [[NSError alloc] initWithDomain:WordPressComRestApiErrorDomain code:WordPressComRestApiErrorCodeUnknown userInfo:userInfo]; - failure(errorWithLocalizedMessage); } else { success(responseObject); @@ -229,7 +228,7 @@ - (void)createWPComBlogWithUrl:(NSString *)blogUrl - (NSError *)errorWithLocalizedMessage:(NSError *)error { NSError *errorWithLocalizedMessage = error; - if ([error.domain isEqualToString:WordPressComRestApiErrorDomain] && + if ([error.domain isEqual:WordPressComRestApiErrorDomain] && [error.userInfo objectForKey:WordPressComRestApi.ErrorKeyErrorCode] != nil) { NSString *localizedErrorMessage = [self errorMessageForError:error]; diff --git a/Sources/WordPressKit/Utility/Constants.h b/Sources/WordPressKit/Utility/Constants.h deleted file mode 100644 index 92d103659..000000000 --- a/Sources/WordPressKit/Utility/Constants.h +++ /dev/null @@ -1,7 +0,0 @@ -#import - -NS_ASSUME_NONNULL_BEGIN - -FOUNDATION_EXTERN NSString *WordPressComRestApiErrorDomain; - -NS_ASSUME_NONNULL_END diff --git a/Sources/WordPressKit/Utility/Constants.m b/Sources/WordPressKit/Utility/Constants.m deleted file mode 100644 index 87c8320f4..000000000 --- a/Sources/WordPressKit/Utility/Constants.m +++ /dev/null @@ -1,7 +0,0 @@ -#import "Constants.h" - -/// Error domain of `NSError` instances that are converted from `WordPressComRestApiEndpointError` -/// and `WordPressAPIError` instances. -/// -/// See `extension WordPressComRestApiEndpointError: CustomNSError` for context. -NSString *WordPressComRestApiErrorDomain = @"WordPressKit.WordPressComRestApiError"; diff --git a/Sources/WordPressKit/Utility/HTTPProtocolHelpers.swift b/Sources/WordPressKit/Utility/HTTPProtocolHelpers.swift index b21feda1e..b446e31d8 100644 --- a/Sources/WordPressKit/Utility/HTTPProtocolHelpers.swift +++ b/Sources/WordPressKit/Utility/HTTPProtocolHelpers.swift @@ -1,48 +1,5 @@ import Foundation -extension String.Encoding { - /// See: https://www.iana.org/assignments/character-sets/character-sets.xhtml - init?(ianaCharsetName: String) { - let encoding: CFStringEncoding = CFStringConvertIANACharSetNameToEncoding(ianaCharsetName as CFString) - guard encoding != kCFStringEncodingInvalidId, - let builtInEncoding = CFStringBuiltInEncodings(rawValue: encoding) - else { - return nil - } - - switch builtInEncoding { - case .macRoman: - self = .macOSRoman - case .windowsLatin1: - self = .windowsCP1252 - case .isoLatin1: - self = .isoLatin1 - case .nextStepLatin: - self = .nextstep - case .ASCII: - self = .ascii - case .unicode: - self = .unicode - case .UTF8: - self = .utf8 - case .nonLossyASCII: - self = .nonLossyASCII - case .UTF16BE: - self = .utf16BigEndian - case .UTF16LE: - self = .utf16LittleEndian - case .UTF32: - self = .utf32 - case .UTF32BE: - self = .utf32BigEndian - case .UTF32LE: - self = .utf32LittleEndian - @unknown default: - return nil - } - } -} - extension HTTPURLResponse { /// Return parameter value in a header field. diff --git a/Sources/WordPressKit/WordPressKit.h b/Sources/WordPressKit/WordPressKit.h index 395134db1..482fdb30e 100644 --- a/Sources/WordPressKit/WordPressKit.h +++ b/Sources/WordPressKit/WordPressKit.h @@ -9,6 +9,8 @@ FOUNDATION_EXPORT const unsigned char WordPressKitVersionString[]; #import #import #import +#import +#import #import #import @@ -53,4 +55,3 @@ FOUNDATION_EXPORT const unsigned char WordPressKitVersionString[]; #import #import -#import diff --git a/Tests/WordPressKitTests/Tests/Utilities/AppTransportSecuritySettingsTests.swift b/Tests/CoreAPITests/AppTransportSecuritySettingsTests.swift similarity index 98% rename from Tests/WordPressKitTests/Tests/Utilities/AppTransportSecuritySettingsTests.swift rename to Tests/CoreAPITests/AppTransportSecuritySettingsTests.swift index 513596b8e..0fd612fcc 100644 --- a/Tests/WordPressKitTests/Tests/Utilities/AppTransportSecuritySettingsTests.swift +++ b/Tests/CoreAPITests/AppTransportSecuritySettingsTests.swift @@ -1,5 +1,9 @@ import XCTest +#if SWIFT_PACKAGE +@testable import CoreAPI +#else @testable import WordPressKit +#endif final class AppTransportSecuritySettingsTests: XCTestCase { diff --git a/Tests/CoreAPITests/Bundle+SPMSupport.swift b/Tests/CoreAPITests/Bundle+SPMSupport.swift new file mode 100644 index 000000000..0c3d02c28 --- /dev/null +++ b/Tests/CoreAPITests/Bundle+SPMSupport.swift @@ -0,0 +1,25 @@ +import Foundation + +extension Bundle { + /// Returns the `Bundle` for the target. + /// + /// If installed via CocoaPods, this will be `.bundle`, otherwise it will be the framework bundle. + @objc public class var coreAPITestsBundle: Bundle { +#if SWIFT_PACKAGE + return Bundle.module +#else + let defaultBundle = Bundle(for: BundleFinder.self) + + guard let bundleURL = defaultBundle.resourceURL, + let resourceBundle = Bundle(url: bundleURL.appendingPathComponent("CoreAPITests.bundle")) else { + return defaultBundle + } + + return resourceBundle +#endif + } +} + +#if !SWIFT_PACKAGE +private class BundleFinder: NSObject {} +#endif diff --git a/Tests/WordPressKitTests/Fakes/FakeInfoDictionaryObjectProvider.swift b/Tests/CoreAPITests/FakeInfoDictionaryObjectProvider.swift similarity index 88% rename from Tests/WordPressKitTests/Fakes/FakeInfoDictionaryObjectProvider.swift rename to Tests/CoreAPITests/FakeInfoDictionaryObjectProvider.swift index 405922f78..74569e5bf 100644 --- a/Tests/WordPressKitTests/Fakes/FakeInfoDictionaryObjectProvider.swift +++ b/Tests/CoreAPITests/FakeInfoDictionaryObjectProvider.swift @@ -1,5 +1,8 @@ -import Foundation +#if SWIFT_PACKAGE +@testable import CoreAPI +#else @testable import WordPressKit +#endif class FakeInfoDictionaryObjectProvider: InfoDictionaryObjectProvider { private let appTransportSecurity: [String: Any]? diff --git a/Tests/WordPressKitTests/Tests/Utilities/HTTPRequestBuilderTests.swift b/Tests/CoreAPITests/HTTPRequestBuilderTests.swift similarity index 98% rename from Tests/WordPressKitTests/Tests/Utilities/HTTPRequestBuilderTests.swift rename to Tests/CoreAPITests/HTTPRequestBuilderTests.swift index 12824e66a..4b455c76c 100644 --- a/Tests/WordPressKitTests/Tests/Utilities/HTTPRequestBuilderTests.swift +++ b/Tests/CoreAPITests/HTTPRequestBuilderTests.swift @@ -1,8 +1,10 @@ -import Foundation -import XCTest -import wpxmlrpc - +#if SWIFT_PACKAGE +@testable import CoreAPI +#else @testable import WordPressKit +#endif +import wpxmlrpc +import XCTest class HTTPRequestBuilderTests: XCTestCase { @@ -413,7 +415,7 @@ class HTTPRequestBuilderTests: XCTestCase { } func testXMLRPCUpload() throws { - let file = try XCTUnwrap(Bundle(for: type(of: self)).url(forResource: "me-settings-success", withExtension: "json")) + let file = try XCTUnwrap(Bundle.coreAPITestsBundle.url(forResource: "me-settings-success", withExtension: "json")) let fileContentBase64 = try Data(contentsOf: file).base64EncodedString() let fileStream = try XCTUnwrap(InputStream(url: file)) let request = try HTTPRequestBuilder(url: URL(string: "https://w.org/xmlrpc.php")!) diff --git a/Tests/WordPressKitTests/Tests/Utilities/MultipartFormTests.swift b/Tests/CoreAPITests/MultipartFormTests.swift similarity index 99% rename from Tests/WordPressKitTests/Tests/Utilities/MultipartFormTests.swift rename to Tests/CoreAPITests/MultipartFormTests.swift index f675261cf..c966ff9db 100644 --- a/Tests/WordPressKitTests/Tests/Utilities/MultipartFormTests.swift +++ b/Tests/CoreAPITests/MultipartFormTests.swift @@ -2,8 +2,11 @@ import Foundation import Alamofire import XCTest import CryptoKit - +#if SWIFT_PACKAGE +@testable import CoreAPI +#else @testable import WordPressKit +#endif class MutliparFormDataTests: XCTestCase { struct Form: Codable { diff --git a/Tests/WordPressKitTests/Tests/WordPressAPI/NonceRetrievalTests.swift b/Tests/CoreAPITests/NonceRetrievalTests.swift similarity index 97% rename from Tests/WordPressKitTests/Tests/WordPressAPI/NonceRetrievalTests.swift rename to Tests/CoreAPITests/NonceRetrievalTests.swift index 811dad8a2..c27c8cd1d 100644 --- a/Tests/WordPressKitTests/Tests/WordPressAPI/NonceRetrievalTests.swift +++ b/Tests/CoreAPITests/NonceRetrievalTests.swift @@ -1,8 +1,12 @@ import Foundation import XCTest import OHHTTPStubs - +#if SWIFT_PACKAGE +@testable import CoreAPI +import OHHTTPStubsSwift +#else @testable import WordPressKit +#endif class NonceRetrievalTests: XCTestCase { diff --git a/Tests/WordPressKitTests/Tests/Utilities/RSDParserTests.swift b/Tests/CoreAPITests/RSDParserTests.swift similarity index 97% rename from Tests/WordPressKitTests/Tests/Utilities/RSDParserTests.swift rename to Tests/CoreAPITests/RSDParserTests.swift index d73a3df85..700c283ac 100644 --- a/Tests/WordPressKitTests/Tests/Utilities/RSDParserTests.swift +++ b/Tests/CoreAPITests/RSDParserTests.swift @@ -1,7 +1,10 @@ import Foundation import XCTest - +#if SWIFT_PACKAGE +@testable import CoreAPI +#else @testable import WordPressKit +#endif class RSDParserTests: XCTestCase { diff --git a/Tests/WordPressKitTests/Mock Data/xmlrpc-response-invalid.html b/Tests/CoreAPITests/Stubs/HTML/xmlrpc-response-invalid.html similarity index 100% rename from Tests/WordPressKitTests/Mock Data/xmlrpc-response-invalid.html rename to Tests/CoreAPITests/Stubs/HTML/xmlrpc-response-invalid.html diff --git a/Tests/WordPressKitTests/Mock Data/xmlrpc-response-mobile-plugin-redirect.html b/Tests/CoreAPITests/Stubs/HTML/xmlrpc-response-mobile-plugin-redirect.html similarity index 100% rename from Tests/WordPressKitTests/Mock Data/xmlrpc-response-mobile-plugin-redirect.html rename to Tests/CoreAPITests/Stubs/HTML/xmlrpc-response-mobile-plugin-redirect.html diff --git a/Tests/WordPressKitTests/Mock Data/WordPressComAuthenticateWithIDToken2FANeededSuccess.json b/Tests/CoreAPITests/Stubs/JSON/WordPressComAuthenticateWithIDToken2FANeededSuccess.json similarity index 100% rename from Tests/WordPressKitTests/Mock Data/WordPressComAuthenticateWithIDToken2FANeededSuccess.json rename to Tests/CoreAPITests/Stubs/JSON/WordPressComAuthenticateWithIDToken2FANeededSuccess.json diff --git a/Tests/WordPressKitTests/Mock Data/WordPressComAuthenticateWithIDTokenBearerTokenSuccess.json b/Tests/CoreAPITests/Stubs/JSON/WordPressComAuthenticateWithIDTokenBearerTokenSuccess.json similarity index 100% rename from Tests/WordPressKitTests/Mock Data/WordPressComAuthenticateWithIDTokenBearerTokenSuccess.json rename to Tests/CoreAPITests/Stubs/JSON/WordPressComAuthenticateWithIDTokenBearerTokenSuccess.json diff --git a/Tests/WordPressKitTests/Mock Data/WordPressComAuthenticateWithIDTokenExistingUserNeedsConnection.json b/Tests/CoreAPITests/Stubs/JSON/WordPressComAuthenticateWithIDTokenExistingUserNeedsConnection.json similarity index 100% rename from Tests/WordPressKitTests/Mock Data/WordPressComAuthenticateWithIDTokenExistingUserNeedsConnection.json rename to Tests/CoreAPITests/Stubs/JSON/WordPressComAuthenticateWithIDTokenExistingUserNeedsConnection.json diff --git a/Tests/WordPressKitTests/Mock Data/WordPressComOAuthAuthenticateSignature.json b/Tests/CoreAPITests/Stubs/JSON/WordPressComOAuthAuthenticateSignature.json similarity index 100% rename from Tests/WordPressKitTests/Mock Data/WordPressComOAuthAuthenticateSignature.json rename to Tests/CoreAPITests/Stubs/JSON/WordPressComOAuthAuthenticateSignature.json diff --git a/Tests/WordPressKitTests/Mock Data/WordPressComOAuthNeeds2FAFail.json b/Tests/CoreAPITests/Stubs/JSON/WordPressComOAuthNeeds2FAFail.json similarity index 100% rename from Tests/WordPressKitTests/Mock Data/WordPressComOAuthNeeds2FAFail.json rename to Tests/CoreAPITests/Stubs/JSON/WordPressComOAuthNeeds2FAFail.json diff --git a/Tests/WordPressKitTests/Mock Data/WordPressComOAuthNeedsWebauthnMFA.json b/Tests/CoreAPITests/Stubs/JSON/WordPressComOAuthNeedsWebauthnMFA.json similarity index 100% rename from Tests/WordPressKitTests/Mock Data/WordPressComOAuthNeedsWebauthnMFA.json rename to Tests/CoreAPITests/Stubs/JSON/WordPressComOAuthNeedsWebauthnMFA.json diff --git a/Tests/WordPressKitTests/Mock Data/WordPressComOAuthRequestChallenge.json b/Tests/CoreAPITests/Stubs/JSON/WordPressComOAuthRequestChallenge.json similarity index 100% rename from Tests/WordPressKitTests/Mock Data/WordPressComOAuthRequestChallenge.json rename to Tests/CoreAPITests/Stubs/JSON/WordPressComOAuthRequestChallenge.json diff --git a/Tests/WordPressKitTests/Mock Data/WordPressComOAuthSuccess.json b/Tests/CoreAPITests/Stubs/JSON/WordPressComOAuthSuccess.json similarity index 100% rename from Tests/WordPressKitTests/Mock Data/WordPressComOAuthSuccess.json rename to Tests/CoreAPITests/Stubs/JSON/WordPressComOAuthSuccess.json diff --git a/Tests/WordPressKitTests/Mock Data/WordPressComOAuthWrongPasswordFail.json b/Tests/CoreAPITests/Stubs/JSON/WordPressComOAuthWrongPasswordFail.json similarity index 100% rename from Tests/WordPressKitTests/Mock Data/WordPressComOAuthWrongPasswordFail.json rename to Tests/CoreAPITests/Stubs/JSON/WordPressComOAuthWrongPasswordFail.json diff --git a/Tests/WordPressKitTests/Mock Data/WordPressComRestApiFailInvalidInput.json b/Tests/CoreAPITests/Stubs/JSON/WordPressComRestApiFailInvalidInput.json similarity index 100% rename from Tests/WordPressKitTests/Mock Data/WordPressComRestApiFailInvalidInput.json rename to Tests/CoreAPITests/Stubs/JSON/WordPressComRestApiFailInvalidInput.json diff --git a/Tests/WordPressKitTests/Mock Data/WordPressComRestApiFailInvalidJSON.json b/Tests/CoreAPITests/Stubs/JSON/WordPressComRestApiFailInvalidJSON.json similarity index 100% rename from Tests/WordPressKitTests/Mock Data/WordPressComRestApiFailInvalidJSON.json rename to Tests/CoreAPITests/Stubs/JSON/WordPressComRestApiFailInvalidJSON.json diff --git a/Tests/WordPressKitTests/Mock Data/WordPressComRestApiFailRequestInvalidToken.json b/Tests/CoreAPITests/Stubs/JSON/WordPressComRestApiFailRequestInvalidToken.json similarity index 100% rename from Tests/WordPressKitTests/Mock Data/WordPressComRestApiFailRequestInvalidToken.json rename to Tests/CoreAPITests/Stubs/JSON/WordPressComRestApiFailRequestInvalidToken.json diff --git a/Tests/WordPressKitTests/Mock Data/WordPressComRestApiFailThrottled.json b/Tests/CoreAPITests/Stubs/JSON/WordPressComRestApiFailThrottled.json similarity index 100% rename from Tests/WordPressKitTests/Mock Data/WordPressComRestApiFailThrottled.json rename to Tests/CoreAPITests/Stubs/JSON/WordPressComRestApiFailThrottled.json diff --git a/Tests/WordPressKitTests/Mock Data/WordPressComRestApiFailUnauthorized.json b/Tests/CoreAPITests/Stubs/JSON/WordPressComRestApiFailUnauthorized.json similarity index 100% rename from Tests/WordPressKitTests/Mock Data/WordPressComRestApiFailUnauthorized.json rename to Tests/CoreAPITests/Stubs/JSON/WordPressComRestApiFailUnauthorized.json diff --git a/Tests/WordPressKitTests/Mock Data/WordPressComRestApiMedia.json b/Tests/CoreAPITests/Stubs/JSON/WordPressComRestApiMedia.json similarity index 100% rename from Tests/WordPressKitTests/Mock Data/WordPressComRestApiMedia.json rename to Tests/CoreAPITests/Stubs/JSON/WordPressComRestApiMedia.json diff --git a/Tests/WordPressKitTests/Mock Data/WordPressComRestApiMultipleErrors.json b/Tests/CoreAPITests/Stubs/JSON/WordPressComRestApiMultipleErrors.json similarity index 100% rename from Tests/WordPressKitTests/Mock Data/WordPressComRestApiMultipleErrors.json rename to Tests/CoreAPITests/Stubs/JSON/WordPressComRestApiMultipleErrors.json diff --git a/Tests/WordPressKitTests/Mock Data/WordPressComSocial2FACodeSuccess.json b/Tests/CoreAPITests/Stubs/JSON/WordPressComSocial2FACodeSuccess.json similarity index 100% rename from Tests/WordPressKitTests/Mock Data/WordPressComSocial2FACodeSuccess.json rename to Tests/CoreAPITests/Stubs/JSON/WordPressComSocial2FACodeSuccess.json diff --git a/WordPressKitTests/me-settings-success.json b/Tests/CoreAPITests/Stubs/JSON/me-settings-success.json similarity index 100% rename from WordPressKitTests/me-settings-success.json rename to Tests/CoreAPITests/Stubs/JSON/me-settings-success.json diff --git a/Tests/WordPressKitTests/Mock Data/wp-forbidden.json b/Tests/CoreAPITests/Stubs/JSON/wp-forbidden.json similarity index 100% rename from Tests/WordPressKitTests/Mock Data/wp-forbidden.json rename to Tests/CoreAPITests/Stubs/JSON/wp-forbidden.json diff --git a/Tests/WordPressKitTests/Mock Data/wp-pages.json b/Tests/CoreAPITests/Stubs/JSON/wp-pages.json similarity index 100% rename from Tests/WordPressKitTests/Mock Data/wp-pages.json rename to Tests/CoreAPITests/Stubs/JSON/wp-pages.json diff --git a/Tests/WordPressKitTests/Mock Data/wp-reusable-blocks.json b/Tests/CoreAPITests/Stubs/JSON/wp-reusable-blocks.json similarity index 100% rename from Tests/WordPressKitTests/Mock Data/wp-reusable-blocks.json rename to Tests/CoreAPITests/Stubs/JSON/wp-reusable-blocks.json diff --git a/Tests/WordPressKitTests/Mock Data/xmlrpc-bad-username-password-error.xml b/Tests/CoreAPITests/Stubs/XML/xmlrpc-bad-username-password-error.xml similarity index 100% rename from Tests/WordPressKitTests/Mock Data/xmlrpc-bad-username-password-error.xml rename to Tests/CoreAPITests/Stubs/XML/xmlrpc-bad-username-password-error.xml diff --git a/Tests/WordPressKitTests/Mock Data/xmlrpc-response-getpost.xml b/Tests/CoreAPITests/Stubs/XML/xmlrpc-response-getpost.xml similarity index 100% rename from Tests/WordPressKitTests/Mock Data/xmlrpc-response-getpost.xml rename to Tests/CoreAPITests/Stubs/XML/xmlrpc-response-getpost.xml diff --git a/Tests/WordPressKitTests/Mock Data/xmlrpc-response-list-methods.xml b/Tests/CoreAPITests/Stubs/XML/xmlrpc-response-list-methods.xml similarity index 100% rename from Tests/WordPressKitTests/Mock Data/xmlrpc-response-list-methods.xml rename to Tests/CoreAPITests/Stubs/XML/xmlrpc-response-list-methods.xml diff --git a/Tests/WordPressKitTests/Tests/Utilities/HTTPRequestHelpers.swift b/Tests/CoreAPITests/URLRequest+HTTPBodyText.swift similarity index 100% rename from Tests/WordPressKitTests/Tests/Utilities/HTTPRequestHelpers.swift rename to Tests/CoreAPITests/URLRequest+HTTPBodyText.swift diff --git a/Tests/WordPressKitTests/Tests/WordPressComOAuthClientTests.swift b/Tests/CoreAPITests/WordPressComOAuthClientTests.swift similarity index 92% rename from Tests/WordPressKitTests/Tests/WordPressComOAuthClientTests.swift rename to Tests/CoreAPITests/WordPressComOAuthClientTests.swift index 49bfff09e..37e1c0af2 100644 --- a/Tests/WordPressKitTests/Tests/WordPressComOAuthClientTests.swift +++ b/Tests/CoreAPITests/WordPressComOAuthClientTests.swift @@ -1,8 +1,12 @@ import Foundation import XCTest import OHHTTPStubs - +#if SWIFT_PACKAGE +@testable import CoreAPI +import OHHTTPStubsSwift +#else @testable import WordPressKit +#endif class WordPressComOAuthClientTests: XCTestCase { @@ -27,7 +31,7 @@ class WordPressComOAuthClientTests: XCTestCase { } func testAuthenticateUsernameNo2FASuccessCase() throws { - let stubPath = try XCTUnwrap(OHPathForFile("WordPressComOAuthSuccess.json", type(of: self))) + let stubPath = try XCTUnwrap(OHPathForFileInBundle("WordPressComOAuthSuccess.json", Bundle.coreAPITestsBundle)) stub(condition: isOauthTokenRequest(url: .oAuthTokenUrl)) { _ in return fixture(filePath: stubPath, headers: ["Content-Type" as NSObject: "application/json" as AnyObject]) } @@ -53,7 +57,7 @@ class WordPressComOAuthClientTests: XCTestCase { } func testAuthenticateUsernameNo2FASuccessCase_withMFAClosure() throws { - let stubPath = try XCTUnwrap(OHPathForFile("WordPressComOAuthSuccess.json", type(of: self))) + let stubPath = try XCTUnwrap(OHPathForFileInBundle("WordPressComOAuthSuccess.json", Bundle.coreAPITestsBundle)) stub(condition: isOauthTokenRequest(url: .oAuthTokenUrl)) { _ in return fixture(filePath: stubPath, headers: ["Content-Type" as NSObject: "application/json" as AnyObject]) } @@ -83,7 +87,7 @@ class WordPressComOAuthClientTests: XCTestCase { func testAuthenticateUsernameNo2FAFailureWrongPasswordCase() throws { let stubPath = try XCTUnwrap( - OHPathForFile("WordPressComOAuthWrongPasswordFail.json", type(of: self)) + OHPathForFileInBundle("WordPressComOAuthWrongPasswordFail.json", Bundle.coreAPITestsBundle) ) stub(condition: isOauthTokenRequest(url: .oAuthTokenUrl)) { _ in return fixture(filePath: stubPath, status: 400, headers: ["Content-Type" as NSObject: "application/json" as AnyObject]) @@ -110,7 +114,7 @@ class WordPressComOAuthClientTests: XCTestCase { func testAuthenticateUsernameNo2FAFailureWrongPasswordCase_withMFAClosure() throws { let stubPath = try XCTUnwrap( - OHPathForFile("WordPressComOAuthWrongPasswordFail.json", type(of: self)) + OHPathForFileInBundle("WordPressComOAuthWrongPasswordFail.json", Bundle.coreAPITestsBundle) ) stub(condition: isOauthTokenRequest(url: .oAuthTokenUrl)) { _ in return fixture(filePath: stubPath, status: 400, headers: ["Content-Type" as NSObject: "application/json" as AnyObject]) @@ -140,7 +144,7 @@ class WordPressComOAuthClientTests: XCTestCase { func testAuthenticateUsername2FAWrong2FACase() throws { let stubPath = try XCTUnwrap( - OHPathForFile("WordPressComOAuthNeeds2FAFail.json", type(of: self)) + OHPathForFileInBundle("WordPressComOAuthNeeds2FAFail.json", Bundle.coreAPITestsBundle) ) stub(condition: isOauthTokenRequest(url: .oAuthTokenUrl)) { _ in return fixture( @@ -191,7 +195,7 @@ class WordPressComOAuthClientTests: XCTestCase { func testAuthenticateUsername2FAWrong2FACase_withMFAClosure() throws { let stubPath = try XCTUnwrap( - OHPathForFile("WordPressComOAuthNeeds2FAFail.json", type(of: self)) + OHPathForFileInBundle("WordPressComOAuthNeeds2FAFail.json", Bundle.coreAPITestsBundle) ) stub(condition: isOauthTokenRequest(url: .oAuthTokenUrl)) { _ in return fixture( @@ -245,7 +249,7 @@ class WordPressComOAuthClientTests: XCTestCase { func testAuthenticateUsernameRequiresWebauthnMultifactorAuthentication() throws { let stubPath = try XCTUnwrap( - OHPathForFile("WordPressComOAuthNeedsWebauthnMFA.json", type(of: self)) + OHPathForFileInBundle("WordPressComOAuthNeedsWebauthnMFA.json", Bundle.coreAPITestsBundle) ) stub(condition: isOauthTokenRequest(url: .oAuthTokenUrl)) { _ in return fixture(filePath: stubPath, headers: ["Content-Type" as NSObject: "application/json" as AnyObject]) @@ -276,7 +280,7 @@ class WordPressComOAuthClientTests: XCTestCase { func testRequestOneTimeCodeWithUsername() throws { let stubPath = try XCTUnwrap( - OHPathForFile("WordPressComOAuthNeeds2FAFail.json", type(of: self)) + OHPathForFileInBundle("WordPressComOAuthNeeds2FAFail.json", Bundle.coreAPITestsBundle) ) stub(condition: isOauthTokenRequest(url: .oAuthTokenUrl)) { _ in return fixture(filePath: stubPath, headers: ["Content-Type" as NSObject: "application/json" as AnyObject]) @@ -297,7 +301,7 @@ class WordPressComOAuthClientTests: XCTestCase { func testRequestSocial2FACodeWithUserID() throws { let stubPath = try XCTUnwrap( - OHPathForFile("WordPressComSocial2FACodeSuccess.json", type(of: self)) + OHPathForFileInBundle("WordPressComSocial2FACodeSuccess.json", Bundle.coreAPITestsBundle) ) stub(condition: isOauthTokenRequest(url: .socialLoginNewSMS2FA)) { _ in return fixture(filePath: stubPath, headers: ["Content-Type" as NSObject: "application/json" as AnyObject]) @@ -320,7 +324,7 @@ class WordPressComOAuthClientTests: XCTestCase { func testAuthenticateWithIDToken() throws { let stubPath = try XCTUnwrap( - OHPathForFile("WordPressComAuthenticateWithIDTokenBearerTokenSuccess.json", type(of: self)) + OHPathForFileInBundle("WordPressComAuthenticateWithIDTokenBearerTokenSuccess.json", Bundle.coreAPITestsBundle) ) stub(condition: isOauthTokenRequest(url: .socialLogin)) { _ in return fixture(filePath: stubPath, headers: ["Content-Type" as NSObject: "application/json" as AnyObject]) @@ -355,7 +359,7 @@ class WordPressComOAuthClientTests: XCTestCase { func testAuthenticateWithIDToken2FANeeded() throws { let stubPath = try XCTUnwrap( - OHPathForFile("WordPressComAuthenticateWithIDToken2FANeededSuccess.json", type(of: self)) + OHPathForFileInBundle("WordPressComAuthenticateWithIDToken2FANeededSuccess.json", Bundle.coreAPITestsBundle) ) stub(condition: isOauthTokenRequest(url: .socialLogin)) { _ in return fixture(filePath: stubPath, headers: ["Content-Type" as NSObject: "application/json" as AnyObject]) @@ -391,7 +395,7 @@ class WordPressComOAuthClientTests: XCTestCase { func testAuthenticateWithIDTokenUserNeedsConnection() throws { let stubPath = try XCTUnwrap( - OHPathForFile("WordPressComAuthenticateWithIDTokenExistingUserNeedsConnection.json", type(of: self)) + OHPathForFileInBundle("WordPressComAuthenticateWithIDTokenExistingUserNeedsConnection.json", Bundle.coreAPITestsBundle) ) stub(condition: isOauthTokenRequest(url: .socialLogin)) { _ in return fixture(filePath: stubPath, status: 400, headers: ["Content-Type" as NSObject: "application/json" as AnyObject]) @@ -425,7 +429,7 @@ class WordPressComOAuthClientTests: XCTestCase { func testAuthenticateSocialLoginUser() throws { let stubPath = try XCTUnwrap( - OHPathForFile("WordPressComAuthenticateWithIDTokenBearerTokenSuccess.json", type(of: self)) + OHPathForFileInBundle("WordPressComAuthenticateWithIDTokenBearerTokenSuccess.json", Bundle.coreAPITestsBundle) ) stub(condition: isOauthTokenRequest(url: .socialLogin2FA)) { _ in return fixture(filePath: stubPath, headers: ["Content-Type" as NSObject: "application/json" as AnyObject]) @@ -448,7 +452,7 @@ class WordPressComOAuthClientTests: XCTestCase { func testRequestWebauthnChallengeReturnsCompleteChallengeInfo() throws { let stubPath = try XCTUnwrap( - OHPathForFile("WordPressComOAuthRequestChallenge.json", type(of: self)) + OHPathForFileInBundle("WordPressComOAuthRequestChallenge.json", Bundle.coreAPITestsBundle) ) stub(condition: isOauthTokenRequest(url: .requestWebauthnChallenge)) { _ in return fixture(filePath: stubPath, headers: ["Content-Type" as NSObject: "application/json" as AnyObject]) @@ -471,7 +475,7 @@ class WordPressComOAuthClientTests: XCTestCase { func testAuthenticateWebauthSignatureReturnsOauthToken() throws { let stubPath = try XCTUnwrap( - OHPathForFile("WordPressComOAuthAuthenticateSignature.json", type(of: self)) + OHPathForFileInBundle("WordPressComOAuthAuthenticateSignature.json", Bundle.coreAPITestsBundle) ) stub(condition: isOauthTokenRequest(url: .verifySignature)) { _ in return fixture(filePath: stubPath, headers: ["Content-Type" as NSObject: "application/json" as AnyObject]) diff --git a/Tests/WordPressKitTests/Tests/WordPressComRestApiTests+Error.swift b/Tests/CoreAPITests/WordPressComRestApiTests+Error.swift similarity index 89% rename from Tests/WordPressKitTests/Tests/WordPressComRestApiTests+Error.swift rename to Tests/CoreAPITests/WordPressComRestApiTests+Error.swift index b8d3a58b1..f122bbec4 100644 --- a/Tests/WordPressKitTests/Tests/WordPressComRestApiTests+Error.swift +++ b/Tests/CoreAPITests/WordPressComRestApiTests+Error.swift @@ -1,7 +1,10 @@ -import Foundation import XCTest - +#if SWIFT_PACKAGE +import APIInterface +@testable import CoreAPI +#else @testable import WordPressKit +#endif class WordPressComRestApiErrorTests: XCTestCase { diff --git a/Tests/WordPressKitTests/Tests/WordPressComRestApiTests+Locale.swift b/Tests/CoreAPITests/WordPressComRestApiTests+Locale.swift similarity index 97% rename from Tests/WordPressKitTests/Tests/WordPressComRestApiTests+Locale.swift rename to Tests/CoreAPITests/WordPressComRestApiTests+Locale.swift index 2c5aa658c..0435003a5 100644 --- a/Tests/WordPressKitTests/Tests/WordPressComRestApiTests+Locale.swift +++ b/Tests/CoreAPITests/WordPressComRestApiTests+Locale.swift @@ -1,9 +1,12 @@ -import Foundation import XCTest import OHHTTPStubs - import WordPressShared +#if SWIFT_PACKAGE +@testable import CoreAPI +import OHHTTPStubsSwift +#else @testable import WordPressKit +#endif extension WordPressComRestApiTests { diff --git a/Tests/WordPressKitTests/Tests/WordPressComRestApiTests.swift b/Tests/CoreAPITests/WordPressComRestApiTests.swift similarity index 93% rename from Tests/WordPressKitTests/Tests/WordPressComRestApiTests.swift rename to Tests/CoreAPITests/WordPressComRestApiTests.swift index 611b4298b..a7f65b69c 100644 --- a/Tests/WordPressKitTests/Tests/WordPressComRestApiTests.swift +++ b/Tests/CoreAPITests/WordPressComRestApiTests.swift @@ -1,8 +1,13 @@ -import Foundation import XCTest import OHHTTPStubs import WordPressShared +#if SWIFT_PACKAGE +import APIInterface +@testable import CoreAPI +import OHHTTPStubsSwift +#else @testable import WordPressKit +#endif class WordPressComRestApiTests: XCTestCase { @@ -113,7 +118,7 @@ class WordPressComRestApiTests: XCTestCase { func testSuccessfullCall() throws { let stubPath = try XCTUnwrap( - OHPathForFile("WordPressComRestApiMedia.json", type(of: self)) + OHPathForFileInBundle("WordPressComRestApiMedia.json", Bundle.coreAPITestsBundle) ) stub(condition: isRestAPIRequest()) { _ in return fixture(filePath: stubPath, headers: ["Content-Type" as NSObject: "application/json" as AnyObject]) @@ -170,7 +175,7 @@ class WordPressComRestApiTests: XCTestCase { func testInvalidTokenFailedCall() throws { let stubPath = try XCTUnwrap( - OHPathForFile("WordPressComRestApiFailRequestInvalidToken.json", type(of: self)) + OHPathForFileInBundle("WordPressComRestApiFailRequestInvalidToken.json", Bundle.coreAPITestsBundle) ) stub(condition: isRestAPIRequest()) { _ in return fixture(filePath: stubPath, status: 400, headers: ["Content-Type" as NSObject: "application/json" as AnyObject]) @@ -191,7 +196,7 @@ class WordPressComRestApiTests: XCTestCase { func testInvalidJSONReceivedFailedCall() throws { let stubPath = try XCTUnwrap( - OHPathForFile("WordPressComRestApiFailInvalidJSON.json", type(of: self)) + OHPathForFileInBundle("WordPressComRestApiFailInvalidJSON.json", Bundle.coreAPITestsBundle) ) stub(condition: isRestAPIRequest()) { _ in return fixture(filePath: stubPath, status: 200, headers: ["Content-Type" as NSObject: "application/json" as AnyObject]) @@ -211,7 +216,7 @@ class WordPressComRestApiTests: XCTestCase { func testInvalidJSONSentFailedCall() throws { let stubPath = try XCTUnwrap( - OHPathForFile("WordPressComRestApiFailInvalidInput.json", type(of: self)) + OHPathForFileInBundle("WordPressComRestApiFailInvalidInput.json", Bundle.coreAPITestsBundle) ) stub(condition: isRestAPIMediaNewRequest()) { _ in return fixture(filePath: stubPath, status: 400, headers: ["Content-Type" as NSObject: "application/json" as AnyObject]) @@ -231,7 +236,7 @@ class WordPressComRestApiTests: XCTestCase { func testUnauthorizedFailedCall() throws { let stubPath = try XCTUnwrap( - OHPathForFile("WordPressComRestApiFailUnauthorized.json", type(of: self)) + OHPathForFileInBundle("WordPressComRestApiFailUnauthorized.json", Bundle.coreAPITestsBundle) ) stub(condition: isRestAPIMediaNewRequest()) { _ in return fixture(filePath: stubPath, status: 403, headers: ["Content-Type" as NSObject: "application/json" as AnyObject]) @@ -250,7 +255,7 @@ class WordPressComRestApiTests: XCTestCase { } func testMultipleErrorsFailedCall() throws { - let stubPath = try XCTUnwrap(OHPathForFile("WordPressComRestApiMultipleErrors.json", type(of: self))) + let stubPath = try XCTUnwrap(OHPathForFileInBundle("WordPressComRestApiMultipleErrors.json", Bundle.coreAPITestsBundle)) stub(condition: isRestAPIMediaNewRequest()) { _ in return fixture(filePath: stubPath, status: 403, headers: ["Content-Type" as NSObject: "application/json" as AnyObject]) } @@ -269,7 +274,7 @@ class WordPressComRestApiTests: XCTestCase { func testMultipleErrorsFailedMultiPartPostCall() throws { let stubPath = try XCTUnwrap( - OHPathForFile("WordPressComRestApiMultipleErrors.json", type(of: self)) + OHPathForFileInBundle("WordPressComRestApiMultipleErrors.json", Bundle.coreAPITestsBundle) ) stub(condition: isRestAPIMediaNewRequest()) { _ in return fixture(filePath: stubPath, status: 403, headers: ["Content-Type" as NSObject: "application/json" as AnyObject]) @@ -288,7 +293,7 @@ class WordPressComRestApiTests: XCTestCase { } func testStreamMethodCallWithInvalidFile() throws { - let stubPath = try XCTUnwrap(OHPathForFile("WordPressComRestApiMedia.json", type(of: self))) + let stubPath = try XCTUnwrap(OHPathForFileInBundle("WordPressComRestApiMedia.json", Bundle.coreAPITestsBundle)) stub(condition: isRestAPIMediaNewRequest()) { _ in return fixture(filePath: stubPath, headers: ["Content-Type" as NSObject: "application/json" as AnyObject]) } @@ -307,12 +312,12 @@ class WordPressComRestApiTests: XCTestCase { } func testStreamMethodParallelCalls() throws { - let stubPath = try XCTUnwrap(OHPathForFile("WordPressComRestApiMedia.json", type(of: self))) + let stubPath = try XCTUnwrap(OHPathForFileInBundle("WordPressComRestApiMedia.json", Bundle.coreAPITestsBundle)) stub(condition: isRestAPIMediaNewRequest()) { _ in return fixture(filePath: stubPath, headers: ["Content-Type" as NSObject: "application/json" as AnyObject]) } guard - let mediaPath = OHPathForFile("test-image.jpg", type(of: self)) + let mediaPath = OHPathForFileInBundle("test-image.jpg", Bundle.coreAPITestsBundle) else { return } @@ -357,7 +362,7 @@ class WordPressComRestApiTests: XCTestCase { } func testSuccessfullCallCommonGETStructure() throws { - let stubPath = try XCTUnwrap(OHPathForFile("WordPressComRestApiMedia.json", type(of: self))) + let stubPath = try XCTUnwrap(OHPathForFileInBundle("WordPressComRestApiMedia.json", Bundle.coreAPITestsBundle)) stub(condition: isRestAPIRequest()) { _ in return fixture(filePath: stubPath, headers: ["Content-Type" as NSObject: "application/json" as AnyObject]) } @@ -377,7 +382,7 @@ class WordPressComRestApiTests: XCTestCase { func testFailureCallCommonGETStructure() throws { let stubPath = try XCTUnwrap( - OHPathForFile("WordPressComRestApiFailInvalidJSON.json", type(of: self)) + OHPathForFileInBundle("WordPressComRestApiFailInvalidJSON.json", Bundle.coreAPITestsBundle) ) stub(condition: isRestAPIRequest()) { _ in return fixture(filePath: stubPath, status: 200, headers: ["Content-Type" as NSObject: "application/json" as AnyObject]) @@ -447,7 +452,7 @@ class WordPressComRestApiTests: XCTestCase { func testTooManyRequestError() throws { let stubPath = try XCTUnwrap( - OHPathForFile("WordPressComRestApiFailThrottled.json", type(of: self)) + OHPathForFileInBundle("WordPressComRestApiFailThrottled.json", Bundle.coreAPITestsBundle) ) stub(condition: isAbsoluteURLString("https://public-api.wordpress.com/rest/v1/foo?locale=en")) { _ in return fixture(filePath: stubPath, status: 500, headers: ["Content-Type" as NSObject: "application/html" as AnyObject]) diff --git a/Tests/WordPressKitTests/Tests/WordPressAPI/WordPressOrgAPITests.swift b/Tests/CoreAPITests/WordPressOrgAPITests.swift similarity index 99% rename from Tests/WordPressKitTests/Tests/WordPressAPI/WordPressOrgAPITests.swift rename to Tests/CoreAPITests/WordPressOrgAPITests.swift index 5521373ad..6b3a6b311 100644 --- a/Tests/WordPressKitTests/Tests/WordPressAPI/WordPressOrgAPITests.swift +++ b/Tests/CoreAPITests/WordPressOrgAPITests.swift @@ -1,8 +1,11 @@ -import Foundation import XCTest import OHHTTPStubs - +#if SWIFT_PACKAGE +@testable import CoreAPI +import OHHTTPStubsSwift +#else @testable import WordPressKit +#endif class WordPressOrgAPITests: XCTestCase { diff --git a/Tests/WordPressKitTests/Tests/WordPressOrgRestApiTests.swift b/Tests/CoreAPITests/WordPressOrgRestApiTests.swift similarity index 94% rename from Tests/WordPressKitTests/Tests/WordPressOrgRestApiTests.swift rename to Tests/CoreAPITests/WordPressOrgRestApiTests.swift index ec2ac0b9a..595d2c5d0 100644 --- a/Tests/WordPressKitTests/Tests/WordPressOrgRestApiTests.swift +++ b/Tests/CoreAPITests/WordPressOrgRestApiTests.swift @@ -1,7 +1,11 @@ -import Foundation import XCTest import OHHTTPStubs +#if SWIFT_PACKAGE +@testable import CoreAPI +import OHHTTPStubsSwift +#else @testable import WordPressKit +#endif class WordPressOrgRestApiTests: XCTestCase { @@ -23,7 +27,7 @@ class WordPressOrgRestApiTests: XCTestCase { } func testUnauthorizedCall() async throws { - let stubPath = try XCTUnwrap(OHPathForFile("wp-forbidden.json", type(of: self))) + let stubPath = try XCTUnwrap(OHPathForFileInBundle("wp-forbidden.json", Bundle.coreAPITestsBundle)) stub(condition: isAPIRequest()) { _ in return fixture(filePath: stubPath, status: 401, headers: ["Content-Type" as NSObject: "application/json" as AnyObject]) } @@ -38,7 +42,7 @@ class WordPressOrgRestApiTests: XCTestCase { } func testSuccessfulGetCall() async throws { - let stubPath = try XCTUnwrap(OHPathForFile("wp-pages.json", type(of: self))) + let stubPath = try XCTUnwrap(OHPathForFileInBundle("wp-pages.json", Bundle.coreAPITestsBundle)) stub(condition: isAPIRequest()) { _ in return fixture(filePath: stubPath, headers: ["Content-Type" as NSObject: "application/json" as AnyObject]) } @@ -48,7 +52,7 @@ class WordPressOrgRestApiTests: XCTestCase { } func testSuccessfulPostCall() async throws { - let stubPath = try XCTUnwrap(OHPathForFile("wp-reusable-blocks.json", type(of: self))) + let stubPath = try XCTUnwrap(OHPathForFileInBundle("wp-reusable-blocks.json", Bundle.coreAPITestsBundle)) stub(condition: isAPIRequest()) { _ in return fixture(filePath: stubPath, headers: ["Content-Type" as NSObject: "application/json" as AnyObject]) } diff --git a/Tests/WordPressKitTests/Tests/WordPressOrgXMLRPCApiTests.swift b/Tests/CoreAPITests/WordPressOrgXMLRPCApiTests.swift similarity index 89% rename from Tests/WordPressKitTests/Tests/WordPressOrgXMLRPCApiTests.swift rename to Tests/CoreAPITests/WordPressOrgXMLRPCApiTests.swift index f536e8930..b198c5d09 100644 --- a/Tests/WordPressKitTests/Tests/WordPressOrgXMLRPCApiTests.swift +++ b/Tests/CoreAPITests/WordPressOrgXMLRPCApiTests.swift @@ -1,8 +1,12 @@ -import Foundation import XCTest import OHHTTPStubs import wpxmlrpc +#if SWIFT_PACKAGE +@testable import CoreAPI +import OHHTTPStubsSwift +#else @testable import WordPressKit +#endif class WordPressOrgXMLRPCApiTests: XCTestCase { @@ -25,7 +29,7 @@ class WordPressOrgXMLRPCApiTests: XCTestCase { } func testSuccessfullCall() throws { - let stubPath = try XCTUnwrap(OHPathForFile("xmlrpc-response-getpost.xml", type(of: self))) + let stubPath = try XCTUnwrap(OHPathForFileInBundle("xmlrpc-response-getpost.xml", Bundle.coreAPITestsBundle)) stub(condition: isXmlRpcAPIRequest()) { _ in return fixture(filePath: stubPath, headers: self.xmlContentTypeHeaders) } @@ -59,8 +63,12 @@ class WordPressOrgXMLRPCApiTests: XCTestCase { }, failure: { (error, _) in expect.fulfill() - + // When building for SPM, the compiler doesn't generate the domain constant. +#if SWIFT_PACKAGE + XCTAssertEqual(error.domain, "CoreAPI.WordPressOrgXMLRPCApiError") +#else XCTAssertEqual(error.domain, WordPressOrgXMLRPCApiErrorDomain) +#endif XCTAssertEqual(error.code, WordPressOrgXMLRPCApiError.httpErrorStatusCode.rawValue) XCTAssertEqual(error.localizedFailureReason, "An HTTP error code 404 was returned.") XCTAssertNotNil(error.userInfo[WordPressOrgXMLRPCApi.WordPressOrgXMLRPCApiErrorKeyData as String]) @@ -88,7 +96,12 @@ class WordPressOrgXMLRPCApiTests: XCTestCase { expect.fulfill() XCTAssertFalse(error is WordPressOrgXMLRPCApiError) + // When building for SPM, the compiler doesn't generate the domain constant. +#if SWIFT_PACKAGE + XCTAssertEqual(error.domain, "CoreAPI.WordPressOrgXMLRPCApiError") +#else XCTAssertEqual(error.domain, WordPressOrgXMLRPCApiErrorDomain) +#endif XCTAssertEqual(error.code, 403) XCTAssertEqual(error.localizedFailureReason, "An HTTP error code 403 was returned.") XCTAssertNotNil(error.userInfo[WordPressOrgXMLRPCApi.WordPressOrgXMLRPCApiErrorKeyData as String]) @@ -116,7 +129,12 @@ class WordPressOrgXMLRPCApiTests: XCTestCase { expect.fulfill() XCTAssertTrue(error is WordPressOrgXMLRPCApiError) + // When building for SPM, the compiler doesn't generate the domain constant. +#if SWIFT_PACKAGE + XCTAssertEqual(error.domain, "CoreAPI.WordPressOrgXMLRPCApiError") +#else XCTAssertEqual(error.domain, WordPressOrgXMLRPCApiErrorDomain) +#endif XCTAssertEqual(error.code, WordPressOrgXMLRPCApiError.unknown.rawValue) XCTAssertEqual(error.localizedFailureReason, WordPressOrgXMLRPCApiError.unknown.failureReason) XCTAssertNotNil(error.userInfo[WordPressOrgXMLRPCApi.WordPressOrgXMLRPCApiErrorKeyData as String]) @@ -152,7 +170,7 @@ class WordPressOrgXMLRPCApiTests: XCTestCase { } func testFault() throws { - let responseFile = try XCTUnwrap(OHPathForFile("xmlrpc-bad-username-password-error.xml", WordPressOrgXMLRPCApiTests.self)) + let responseFile = try XCTUnwrap(OHPathForFileInBundle("xmlrpc-bad-username-password-error.xml", Bundle.coreAPITestsBundle)) stub(condition: isXmlRpcAPIRequest()) { _ in fixture(filePath: responseFile, headers: self.xmlContentTypeHeaders) } @@ -180,7 +198,7 @@ class WordPressOrgXMLRPCApiTests: XCTestCase { } func testFault401() throws { - let responseFile = try XCTUnwrap(OHPathForFile("xmlrpc-bad-username-password-error.xml", WordPressOrgXMLRPCApiTests.self)) + let responseFile = try XCTUnwrap(OHPathForFileInBundle("xmlrpc-bad-username-password-error.xml", Bundle.coreAPITestsBundle)) stub(condition: isXmlRpcAPIRequest()) { _ in fixture(filePath: responseFile, status: 401, headers: self.xmlContentTypeHeaders) } @@ -237,7 +255,7 @@ class WordPressOrgXMLRPCApiTests: XCTestCase { } func testInvalidXML() throws { - let responseFile = try XCTUnwrap(OHPathForFile("xmlrpc-response-invalid.html", WordPressOrgXMLRPCApiTests.self)) + let responseFile = try XCTUnwrap(OHPathForFileInBundle("xmlrpc-response-invalid.html", Bundle.coreAPITestsBundle)) stub(condition: isXmlRpcAPIRequest()) { _ in fixture(filePath: responseFile, headers: self.xmlContentTypeHeaders) } @@ -264,7 +282,7 @@ class WordPressOrgXMLRPCApiTests: XCTestCase { } func testProgressUpdate() throws { - let stubPath = try XCTUnwrap(OHPathForFile("xmlrpc-response-getpost.xml", type(of: self))) + let stubPath = try XCTUnwrap(OHPathForFileInBundle("xmlrpc-response-getpost.xml", Bundle.coreAPITestsBundle)) stub(condition: isXmlRpcAPIRequest()) { _ in return fixture(filePath: stubPath, headers: self.xmlContentTypeHeaders) } @@ -292,7 +310,7 @@ class WordPressOrgXMLRPCApiTests: XCTestCase { } func testProgressUpdateFailure() throws { - let stubPath = try XCTUnwrap(OHPathForFile("xmlrpc-bad-username-password-error.xml", type(of: self))) + let stubPath = try XCTUnwrap(OHPathForFileInBundle("xmlrpc-bad-username-password-error.xml", Bundle.coreAPITestsBundle)) stub(condition: isXmlRpcAPIRequest()) { _ in return fixture(filePath: stubPath, headers: self.xmlContentTypeHeaders) } @@ -320,7 +338,7 @@ class WordPressOrgXMLRPCApiTests: XCTestCase { } func testProgressUpdateStreamAPI() throws { - let stubPath = try XCTUnwrap(OHPathForFile("xmlrpc-response-getpost.xml", type(of: self))) + let stubPath = try XCTUnwrap(OHPathForFileInBundle("xmlrpc-response-getpost.xml", Bundle.coreAPITestsBundle)) stub(condition: isXmlRpcAPIRequest()) { _ in return fixture(filePath: stubPath, headers: self.xmlContentTypeHeaders) } @@ -348,7 +366,7 @@ class WordPressOrgXMLRPCApiTests: XCTestCase { } func testProgressUpdateStreamAPIFailure() throws { - let stubPath = try XCTUnwrap(OHPathForFile("xmlrpc-bad-username-password-error.xml", type(of: self))) + let stubPath = try XCTUnwrap(OHPathForFileInBundle("xmlrpc-bad-username-password-error.xml", Bundle.coreAPITestsBundle)) stub(condition: isXmlRpcAPIRequest()) { _ in return fixture(filePath: stubPath, headers: self.xmlContentTypeHeaders) } diff --git a/Tests/WordPressKitTests/Tests/WordPressAPI/WordPressOrgXMLRPCValidatorTests.swift b/Tests/CoreAPITests/WordPressOrgXMLRPCValidatorTests.swift similarity index 88% rename from Tests/WordPressKitTests/Tests/WordPressAPI/WordPressOrgXMLRPCValidatorTests.swift rename to Tests/CoreAPITests/WordPressOrgXMLRPCValidatorTests.swift index 0b4e086be..3a79b643d 100644 --- a/Tests/WordPressKitTests/Tests/WordPressAPI/WordPressOrgXMLRPCValidatorTests.swift +++ b/Tests/CoreAPITests/WordPressOrgXMLRPCValidatorTests.swift @@ -1,7 +1,11 @@ import XCTest import OHHTTPStubs - +#if SWIFT_PACKAGE +@testable import CoreAPI +import OHHTTPStubsSwift +#else @testable import WordPressKit +#endif final class WordPressOrgXMLRPCValidatorTests: XCTestCase { @@ -87,24 +91,16 @@ final class WordPressOrgXMLRPCValidatorTests: XCTestCase { XCTAssertEqual(schemes, Set(arrayLiteral: "https", "http")) } - func testNotWordPressSiteError() { + func testNotWordPressSiteError() throws { // Create HTTP stubs to simulate a plain static website // - Return a plain HTML webpage for all GET requests // - Return a 405 method not allowed error for all POST requests - + let path = try XCTUnwrap(xmlrpcResponseInvalidPath) stub(condition: isHost("www.apple.com") && isMethodGET()) { _ in - fixture( - filePath: OHPathForFile("xmlrpc-response-invalid.html", type(of: self))!, - status: 200, - headers: nil - ) + fixture(filePath: path, status: 200, headers: nil) } stub(condition: isHost("www.apple.com") && isMethodPOST()) { _ in - fixture( - filePath: OHPathForFile("xmlrpc-response-invalid.html", type(of: self))!, - status: 405, - headers: nil - ) + fixture(filePath: path, status: 405, headers: nil) } let failure = self.expectation(description: "returns error") @@ -122,10 +118,13 @@ final class WordPressOrgXMLRPCValidatorTests: XCTestCase { wait(for: [failure], timeout: 0.3) } - func testSuccessWithSiteAddress() { + func testSuccessWithSiteAddress() throws { + let path = try XCTUnwrap( + OHPathForFileInBundle("xmlrpc-response-list-methods.xml", Bundle.coreAPITestsBundle) + ) stub(condition: isHost("www.apple.com") && isPath("/blog/xmlrpc.php")) { _ in fixture( - filePath: OHPathForFile("xmlrpc-response-list-methods.xml", type(of: self))!, + filePath: path, status: 200, headers: [ "Content-Type": "application/xml" @@ -144,25 +143,25 @@ final class WordPressOrgXMLRPCValidatorTests: XCTestCase { wait(for: [success], timeout: 0.3) } - func testSuccessWithIrregularXMLRPCAddress() { + func testSuccessWithIrregularXMLRPCAddress() throws { let apiCalls = [ expectation(description: "Request #1: call xmlrpc.php"), expectation(description: "Request #2: call the url argument"), ] + let responseInvalidPath = try XCTUnwrap(xmlrpcResponseInvalidPath) stub(condition: isHost("www.apple.com") && isPath("/blog/xmlrpc.php")) { _ in apiCalls[0].fulfill() - return fixture( - filePath: OHPathForFile("xmlrpc-response-invalid.html", type(of: self))!, - status: 403, - headers: nil - ) + return fixture(filePath: responseInvalidPath, status: 403, headers: nil) } + let responseListPath = try XCTUnwrap( + OHPathForFileInBundle("xmlrpc-response-list-methods.xml", Bundle.coreAPITestsBundle) + ) stub(condition: isHost("www.apple.com") && isPath("/blog")) { _ in apiCalls[1].fulfill() return fixture( - filePath: OHPathForFile("xmlrpc-response-list-methods.xml", type(of: self))!, + filePath: responseListPath, status: 200, headers: [ "Content-Type": "application/xml" @@ -181,13 +180,10 @@ final class WordPressOrgXMLRPCValidatorTests: XCTestCase { wait(for: apiCalls + [success], timeout: 0.3, enforceOrder: true) } - func testSuccessWithRSDLink() { + func testSuccessWithRSDLink() throws { + let responseInvalidPath = try XCTUnwrap(xmlrpcResponseInvalidPath) stub(condition: isHost("www.apple.com") && isPath("/blog/xmlrpc.php")) { _ in - return fixture( - filePath: OHPathForFile("xmlrpc-response-invalid.html", type(of: self))!, - status: 403, - headers: nil - ) + return fixture(filePath: responseInvalidPath, status: 403, headers: nil) } stub(condition: isHost("www.apple.com") && isPath("/blog")) { _ in @@ -231,9 +227,12 @@ final class WordPressOrgXMLRPCValidatorTests: XCTestCase { ) } + let responseList = try XCTUnwrap( + OHPathForFileInBundle("xmlrpc-response-list-methods.xml", Bundle.coreAPITestsBundle) + ) stub(condition: isHost("www.apple.com") && isPath("/blog-xmlrpc.php")) { _ in fixture( - filePath: OHPathForFile("xmlrpc-response-list-methods.xml", type(of: self))!, + filePath: responseList, status: 200, headers: [ "Content-Type": "application/xml" @@ -252,7 +251,7 @@ final class WordPressOrgXMLRPCValidatorTests: XCTestCase { wait(for: [success], timeout: 0.3) } - func testManyRedirectsError() { + func testManyRedirectsError() throws { // redirect 'POST /redirect/' to '/redirect/'. for number in 1...30 { stub(condition: isMethodPOST() && { $0.url!.path.hasPrefix("/redirect/\(number)-req") }) { @@ -263,12 +262,9 @@ final class WordPressOrgXMLRPCValidatorTests: XCTestCase { } // All GET requests get a html webpage. + let path = try XCTUnwrap(xmlrpcResponseInvalidPath) stub(condition: isMethodGET()) { _ in - fixture( - filePath: OHPathForFile("xmlrpc-response-invalid.html", type(of: self))!, - status: 405, - headers: nil - ) + fixture(filePath: path, status: 405, headers: nil) } let failure = self.expectation(description: "returns error") @@ -288,16 +284,19 @@ final class WordPressOrgXMLRPCValidatorTests: XCTestCase { wait(for: [failure], timeout: 0.3) } - func testMobilePluginRedirectedError() { + func testMobilePluginRedirectedError() throws { // redirect 'POST /redirect/' to '/redirect/'. stub(condition: isMethodPOST() && isHost("www.apple.com")) { _ in HTTPStubsResponse(data: Data(), statusCode: 302, headers: [ "Location": "https://m.apple.com" ]) } + let path = try XCTUnwrap( + OHPathForFileInBundle("xmlrpc-response-mobile-plugin-redirect.html", Bundle.coreAPITestsBundle) + ) stub(condition: isMethodPOST() && isHost("m.apple.com")) { _ in fixture( - filePath: OHPathForFile("xmlrpc-response-mobile-plugin-redirect.html", type(of: self))!, + filePath: path, status: 200, headers: nil ) @@ -376,6 +375,10 @@ final class WordPressOrgXMLRPCValidatorTests: XCTestCase { wait(for: [failure], timeout: 0.3) } + let xmlrpcResponseInvalidPath = OHPathForFileInBundle( + "xmlrpc-response-invalid.html", + Bundle.coreAPITestsBundle + ) } private extension WordPressOrgXMLRPCValidatorTests { diff --git a/WordPressKit.xcodeproj/project.pbxproj b/WordPressKit.xcodeproj/project.pbxproj index 393460ce4..6b7eca319 100644 --- a/WordPressKit.xcodeproj/project.pbxproj +++ b/WordPressKit.xcodeproj/project.pbxproj @@ -42,7 +42,6 @@ 1DF972C129B107E7007A72BC /* videopress-site-default-video.json in Resources */ = {isa = PBXBuildFile; fileRef = 1DF972BE29B107E7007A72BC /* videopress-site-default-video.json */; }; 240315B0A1D6C2B981572B5B /* Pods_WordPressKitTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED05C8FF3E61D93CE5BA527E /* Pods_WordPressKitTests.framework */; }; 24ADA24E24F9B32D001B5DAE /* FeatureFlagSerializationTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24ADA24D24F9B32D001B5DAE /* FeatureFlagSerializationTest.swift */; }; - 264E09B32AD0B3BB004B5A5F /* WebauthChallengeInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 264E09B22AD0B3BB004B5A5F /* WebauthChallengeInfo.swift */; }; 264E09B52AD259FF004B5A5F /* WordPressComOAuthRequestChallenge.json in Resources */ = {isa = PBXBuildFile; fileRef = 264E09B42AD259FF004B5A5F /* WordPressComOAuthRequestChallenge.json */; }; 264E09B72AD25ED9004B5A5F /* WordPressComOAuthAuthenticateSignature.json in Resources */ = {isa = PBXBuildFile; fileRef = 264E09B62AD25ED9004B5A5F /* WordPressComOAuthAuthenticateSignature.json */; }; 264E09B92AD2709A004B5A5F /* WordPressComOAuthNeedsWebauthnMFA.json in Resources */ = {isa = PBXBuildFile; fileRef = 264E09B82AD2709A004B5A5F /* WordPressComOAuthNeedsWebauthnMFA.json */; }; @@ -64,20 +63,34 @@ 32FC1D29255C91ED00CD0A7B /* JetpackScanServiceRemote.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32FC1D27255C91ED00CD0A7B /* JetpackScanServiceRemote.swift */; }; 32FC20CE255DCC6100CD0A7B /* JetpackScanThreat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32FC20CD255DCC6100CD0A7B /* JetpackScanThreat.swift */; }; 3F3195AD266FF94B00397EE7 /* ZendeskMetadata.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F3195AC266FF94B00397EE7 /* ZendeskMetadata.swift */; }; - 3F391E1A2B50F3EB007975C4 /* Result+Callback.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F391E192B50F3EB007975C4 /* Result+Callback.swift */; }; 3F3C9E9C289A3E31009A1357 /* TestCollector+Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F3C9E9B289A3E31009A1357 /* TestCollector+Constants.swift */; }; 3F758FD324F6C68200BBA2FC /* AnnouncementServiceRemote.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F758FD224F6C68200BBA2FC /* AnnouncementServiceRemote.swift */; }; 3F8308A729EE683500354497 /* ActivityTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F8308A629EE683500354497 /* ActivityTests.swift */; }; + 3FA4258F2BCCFDA6007539BF /* WordPressComRestApiErrorDomain.h in Headers */ = {isa = PBXBuildFile; fileRef = 3FA4258E2BCCFDA6007539BF /* WordPressComRestApiErrorDomain.h */; settings = {ATTRIBUTES = (Public, ); }; }; 3FB8642C2888089F003A86BE /* BuildkiteTestCollector in Frameworks */ = {isa = PBXBuildFile; productRef = 3FB8642B2888089F003A86BE /* BuildkiteTestCollector */; }; + 3FD634E52BC3A55F00CEDF5E /* WordPressOrgXMLRPCValidator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FD634E32BC3A55F00CEDF5E /* WordPressOrgXMLRPCValidator.swift */; }; + 3FD634E62BC3A55F00CEDF5E /* Date+WordPressCom.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FD634E42BC3A55F00CEDF5E /* Date+WordPressCom.swift */; }; + 3FD634F22BC3AD6200CEDF5E /* MultipartForm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FD634EB2BC3AD6200CEDF5E /* MultipartForm.swift */; }; + 3FD634F32BC3AD6200CEDF5E /* Result+Callback.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FD634EC2BC3AD6200CEDF5E /* Result+Callback.swift */; }; + 3FD634F42BC3AD6200CEDF5E /* Either.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FD634ED2BC3AD6200CEDF5E /* Either.swift */; }; + 3FD634F52BC3AD6200CEDF5E /* SocialLogin2FANonceInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FD634EE2BC3AD6200CEDF5E /* SocialLogin2FANonceInfo.swift */; }; + 3FD634F62BC3AD6200CEDF5E /* AppTransportSecuritySettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FD634EF2BC3AD6200CEDF5E /* AppTransportSecuritySettings.swift */; }; + 3FD634F72BC3AD6200CEDF5E /* WebauthChallengeInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FD634F02BC3AD6200CEDF5E /* WebauthChallengeInfo.swift */; }; + 3FD634F82BC3AD6200CEDF5E /* StringEncoding+IANA.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FD634F12BC3AD6200CEDF5E /* StringEncoding+IANA.swift */; }; + 3FD634FA2BC3AE6800CEDF5E /* AppTransportSecuritySettingsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46ABD0E9262EEE0400C7FF24 /* AppTransportSecuritySettingsTests.swift */; }; + 3FD634FB2BC3AE6C00CEDF5E /* Bundle+SPMSupport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FD634E92BC3A6BA00CEDF5E /* Bundle+SPMSupport.swift */; }; + 3FD635042BC3F05400CEDF5E /* WordPressComRESTAPIVersionedPathBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 3FD635032BC3F03200CEDF5E /* WordPressComRESTAPIVersionedPathBuilder.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3FD635062BC3F08400CEDF5E /* WordPressComRESTAPIVersionedPathBuilder.m in Sources */ = {isa = PBXBuildFile; fileRef = 3FD635052BC3F08400CEDF5E /* WordPressComRESTAPIVersionedPathBuilder.m */; }; 3FE2E94F2BB29A1B002CA2E1 /* FilePart.m in Sources */ = {isa = PBXBuildFile; fileRef = 3FE2E94D2BB29A1B002CA2E1 /* FilePart.m */; }; 3FE2E9502BB29A1B002CA2E1 /* FilePart.h in Headers */ = {isa = PBXBuildFile; fileRef = 3FE2E94E2BB29A1B002CA2E1 /* FilePart.h */; settings = {ATTRIBUTES = (Public, ); }; }; 3FE2E9672BBEB8D2002CA2E1 /* WordPressComRESTAPIVersion.h in Headers */ = {isa = PBXBuildFile; fileRef = 3FE2E9662BBEB8D2002CA2E1 /* WordPressComRESTAPIVersion.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3FE2E97B2BC3A332002CA2E1 /* WordPressAPIError+NSErrorBridge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FE2E9792BC3A332002CA2E1 /* WordPressAPIError+NSErrorBridge.swift */; }; + 3FE2E97C2BC3A332002CA2E1 /* WordPressComRestApi.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FE2E97A2BC3A332002CA2E1 /* WordPressComRestApi.swift */; }; 3FFCC0412BA995290051D229 /* Date+WordPressComTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FFCC0402BA995290051D229 /* Date+WordPressComTests.swift */; }; 3FFCC0472BAA6EF40051D229 /* NSDate+WordPressCom.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FFCC0462BAA6EF40051D229 /* NSDate+WordPressCom.swift */; }; 3FFCC0492BAB98130051D229 /* DateFormatter+WordPressCom.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FFCC0482BAB98130051D229 /* DateFormatter+WordPressCom.swift */; }; 3FFCC04B2BABA5220051D229 /* DateFormatter+WordPressComTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FFCC04A2BABA5220051D229 /* DateFormatter+WordPressComTests.swift */; }; 3FFCC04D2BABA6980051D229 /* NSDate+WordPressComTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FFCC04C2BABA6980051D229 /* NSDate+WordPressComTests.swift */; }; - 3FFCC04F2BABA6E60051D229 /* Date+WordPressCom.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FFCC04E2BABA6E60051D229 /* Date+WordPressCom.swift */; }; 3FFCC0572BABC7E00051D229 /* WordPressComRESTAPIInterfacing.h in Headers */ = {isa = PBXBuildFile; fileRef = 3FFCC0552BABC78B0051D229 /* WordPressComRESTAPIInterfacing.h */; settings = {ATTRIBUTES = (Public, ); }; }; 40247DFA2120D8E100AE1C3C /* AutomatedTransferService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 40247DF92120D8E100AE1C3C /* AutomatedTransferService.swift */; }; 40247DFC2120E69600AE1C3C /* AutomatedTransferStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = 40247DFB2120E69600AE1C3C /* AutomatedTransferStatus.swift */; }; @@ -157,12 +170,11 @@ 465F88BF263B54EE00F4C950 /* ChecksumUtilTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 465F88BE263B54EE00F4C950 /* ChecksumUtilTests.swift */; }; 46ABD0E0262EED3D00C7FF24 /* WordPressOrgXMLRPCValidatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46ABD0DF262EED3D00C7FF24 /* WordPressOrgXMLRPCValidatorTests.swift */; }; 46ABD0E6262EEDAB00C7FF24 /* FakeInfoDictionaryObjectProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46ABD0E5262EEDAB00C7FF24 /* FakeInfoDictionaryObjectProvider.swift */; }; - 46ABD0EA262EEE0400C7FF24 /* AppTransportSecuritySettingsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46ABD0E9262EEE0400C7FF24 /* AppTransportSecuritySettingsTests.swift */; }; 4A05E7962B2FCB6400C25E3B /* NonceRetrieval.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A05E7952B2FCB6400C25E3B /* NonceRetrieval.swift */; }; 4A05E7982B2FCB9A00C25E3B /* NonceRetrievalTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A05E7972B2FCB9A00C25E3B /* NonceRetrievalTests.swift */; }; 4A05E79A2B2FDC3200C25E3B /* WordPressOrgRestApi.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A05E7992B2FDC3200C25E3B /* WordPressOrgRestApi.swift */; }; 4A05E79C2B2FDC6100C25E3B /* WordPressOrgAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A05E79B2B2FDC6100C25E3B /* WordPressOrgAPITests.swift */; }; - 4A05E79E2B30F3C500C25E3B /* HTTPRequestHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A05E79D2B30F3C500C25E3B /* HTTPRequestHelpers.swift */; }; + 4A05E79E2B30F3C500C25E3B /* URLRequest+HTTPBodyText.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A05E79D2B30F3C500C25E3B /* URLRequest+HTTPBodyText.swift */; }; 4A05E7A62B34142200C25E3B /* xmlrpc-response-invalid.html in Resources */ = {isa = PBXBuildFile; fileRef = 4A05E7A52B34142200C25E3B /* xmlrpc-response-invalid.html */; }; 4A05E7A82B34EAF400C25E3B /* xmlrpc-response-mobile-plugin-redirect.html in Resources */ = {isa = PBXBuildFile; fileRef = 4A05E7A72B34EAF400C25E3B /* xmlrpc-response-mobile-plugin-redirect.html */; }; 4A05E7AA2B34FC4300C25E3B /* xmlrpc-response-list-methods.xml in Resources */ = {isa = PBXBuildFile; fileRef = 4A05E7A92B34FC4300C25E3B /* xmlrpc-response-list-methods.xml */; }; @@ -170,7 +182,6 @@ 4A11239A2B19269A004690CF /* WordPressAPIError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A1123992B19269A004690CF /* WordPressAPIError.swift */; }; 4A11239C2B1926B7004690CF /* HTTPRequestBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A11239B2B1926B7004690CF /* HTTPRequestBuilder.swift */; }; 4A11239E2B1926D1004690CF /* HTTPClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A11239D2B1926D1004690CF /* HTTPClient.swift */; }; - 4A1123A02B196821004690CF /* MultipartForm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A11239F2B196821004690CF /* MultipartForm.swift */; }; 4A1123A22B19690C004690CF /* MultipartFormTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A1123A12B19690C004690CF /* MultipartFormTests.swift */; }; 4A1DEF44293051BC00322608 /* LoggingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A1DEF43293051BC00322608 /* LoggingTests.swift */; }; 4A1DEF46293051C600322608 /* LoggingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A1DEF45293051C600322608 /* LoggingTests.m */; }; @@ -179,10 +190,6 @@ 4A3239682B74319400EFD2A8 /* self-hosted-plugins-install.json in Resources */ = {isa = PBXBuildFile; fileRef = 4A3239672B74319400EFD2A8 /* self-hosted-plugins-install.json */; }; 4A40F6552B2A5A1A0015DA77 /* WordPressAPIErrorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A40F6542B2A5A1A0015DA77 /* WordPressAPIErrorTests.swift */; }; 4A57A6812B549144008D0660 /* WordPressComRestApiTests+Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A57A6802B549144008D0660 /* WordPressComRestApiTests+Error.swift */; }; - 4A57A6832B54A326008D0660 /* WordPressAPIError+NSErrorBrdige.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A57A6822B54A326008D0660 /* WordPressAPIError+NSErrorBrdige.swift */; }; - 4A57A6872B54C68C008D0660 /* Constants.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A57A6852B54C68C008D0660 /* Constants.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4A57A6882B54C68C008D0660 /* Constants.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A57A6862B54C68C008D0660 /* Constants.m */; }; - 4A5BC1A82B59DE6600C7D037 /* Either.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A5BC1A72B59DE6600C7D037 /* Either.swift */; }; 4A68E3CD29404181004AC3DC /* RemoteBlog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A68E3CC29404181004AC3DC /* RemoteBlog.swift */; }; 4A68E3CF29404289004AC3DC /* RemoteBlogOptionsHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A68E3CE29404289004AC3DC /* RemoteBlogOptionsHelper.swift */; }; 4A68E3D329406AA0004AC3DC /* RemoteMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A68E3D029406AA0004AC3DC /* RemoteMenu.swift */; }; @@ -201,7 +208,6 @@ 4AE2784A2B2FC6C600E4D9B1 /* HTTPHeaderValueParserTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4AE278492B2FC6C600E4D9B1 /* HTTPHeaderValueParserTests.swift */; }; 4AE7E36B2B9A995500C8CED5 /* AnnouncementServiceRemoteTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4AE7E36A2B9A995500C8CED5 /* AnnouncementServiceRemoteTests.swift */; }; 4AE7E36D2B9A9BC400C8CED5 /* site-zendesk-metadata-success.json in Resources */ = {isa = PBXBuildFile; fileRef = 4AE7E36C2B9A9BC400C8CED5 /* site-zendesk-metadata-success.json */; }; - 57BCD3D426209D9500292CB3 /* AppTransportSecuritySettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57BCD3D326209D9500292CB3 /* AppTransportSecuritySettings.swift */; }; 730E869F21E44EFD00753E1A /* WordPressComServiceRemote+SiteVerticals.swift in Sources */ = {isa = PBXBuildFile; fileRef = 730E869E21E44EFD00753E1A /* WordPressComServiceRemote+SiteVerticals.swift */; }; 731BA83621DECD61000FDFCD /* SiteCreationRequestEncodingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 731BA83521DECD61000FDFCD /* SiteCreationRequestEncodingTests.swift */; }; 731BA83821DECD97000FDFCD /* SiteCreationResponseDecodingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 731BA83721DECD97000FDFCD /* SiteCreationResponseDecodingTests.swift */; }; @@ -488,9 +494,7 @@ 93BD27721EE737A9002BB00B /* ServiceRemoteWordPressXMLRPC.m in Sources */ = {isa = PBXBuildFile; fileRef = 93BD276E1EE737A8002BB00B /* ServiceRemoteWordPressXMLRPC.m */; }; 93BD277C1EE73944002BB00B /* HTTPAuthenticationAlertController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93BD27741EE73944002BB00B /* HTTPAuthenticationAlertController.swift */; }; 93BD277F1EE73944002BB00B /* WordPressComOAuthClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93BD27771EE73944002BB00B /* WordPressComOAuthClient.swift */; }; - 93BD27801EE73944002BB00B /* WordPressComRestApi.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93BD27781EE73944002BB00B /* WordPressComRestApi.swift */; }; 93BD27811EE73944002BB00B /* WordPressOrgXMLRPCApi.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93BD27791EE73944002BB00B /* WordPressOrgXMLRPCApi.swift */; }; - 93BD27821EE73944002BB00B /* WordPressOrgXMLRPCValidator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93BD277A1EE73944002BB00B /* WordPressOrgXMLRPCValidator.swift */; }; 93BD27831EE73944002BB00B /* WordPressRSDParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93BD277B1EE73944002BB00B /* WordPressRSDParser.swift */; }; 93C674EE1EE834B700BFAF05 /* RemoteBlogSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93C674ED1EE834B700BFAF05 /* RemoteBlogSettings.swift */; }; 93C674F11EE8351E00BFAF05 /* NSMutableDictionary+Helpers.h in Headers */ = {isa = PBXBuildFile; fileRef = 93C674EF1EE8351E00BFAF05 /* NSMutableDictionary+Helpers.h */; }; @@ -634,7 +638,6 @@ E1E89C6A1FD6BDB1006E7A33 /* PluginDirectoryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1E89C691FD6BDB1006E7A33 /* PluginDirectoryTests.swift */; }; E1EF5D5D1F9F329900B6D53E /* SitePluginCapabilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1EF5D5C1F9F329900B6D53E /* SitePluginCapabilities.swift */; }; E61A51A621B172A900A5F902 /* RemoteWpcomPlan.swift in Sources */ = {isa = PBXBuildFile; fileRef = E61A51A521B172A900A5F902 /* RemoteWpcomPlan.swift */; }; - E632D7781F6E047400297F6D /* SocialLogin2FANonceInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = E632D7771F6E047400297F6D /* SocialLogin2FANonceInfo.swift */; }; E670CD722277A85000E75735 /* plans-me-sites-success.json in Resources */ = {isa = PBXBuildFile; fileRef = E670CD712277A85000E75735 /* plans-me-sites-success.json */; }; E689431E21B0A1A800C5E4A7 /* plans-mobile-success.json in Resources */ = {isa = PBXBuildFile; fileRef = E689431D21B0A1A800C5E4A7 /* plans-mobile-success.json */; }; E6B0460925E5B4DD00DF6F4F /* RemoteInviteLink.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6B0460825E5B4DD00DF6F4F /* RemoteInviteLink.swift */; }; @@ -786,7 +789,6 @@ 1DF972BD29B107E7007A72BC /* videopress-public-video.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "videopress-public-video.json"; sourceTree = ""; }; 1DF972BE29B107E7007A72BC /* videopress-site-default-video.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "videopress-site-default-video.json"; sourceTree = ""; }; 24ADA24D24F9B32D001B5DAE /* FeatureFlagSerializationTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeatureFlagSerializationTest.swift; sourceTree = ""; }; - 264E09B22AD0B3BB004B5A5F /* WebauthChallengeInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebauthChallengeInfo.swift; sourceTree = ""; }; 264E09B42AD259FF004B5A5F /* WordPressComOAuthRequestChallenge.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = WordPressComOAuthRequestChallenge.json; sourceTree = ""; }; 264E09B62AD25ED9004B5A5F /* WordPressComOAuthAuthenticateSignature.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = WordPressComOAuthAuthenticateSignature.json; sourceTree = ""; }; 264E09B82AD2709A004B5A5F /* WordPressComOAuthNeedsWebauthnMFA.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = WordPressComOAuthNeedsWebauthnMFA.json; sourceTree = ""; }; @@ -809,20 +811,33 @@ 32FC1D27255C91ED00CD0A7B /* JetpackScanServiceRemote.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JetpackScanServiceRemote.swift; sourceTree = ""; }; 32FC20CD255DCC6100CD0A7B /* JetpackScanThreat.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JetpackScanThreat.swift; sourceTree = ""; }; 3F3195AC266FF94B00397EE7 /* ZendeskMetadata.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ZendeskMetadata.swift; sourceTree = ""; }; - 3F391E192B50F3EB007975C4 /* Result+Callback.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Result+Callback.swift"; sourceTree = ""; }; 3F3C9E9B289A3E31009A1357 /* TestCollector+Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "TestCollector+Constants.swift"; sourceTree = ""; }; 3F758FD224F6C68200BBA2FC /* AnnouncementServiceRemote.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnnouncementServiceRemote.swift; sourceTree = ""; }; 3F8308A629EE683500354497 /* ActivityTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActivityTests.swift; sourceTree = ""; }; + 3FA4258E2BCCFDA6007539BF /* WordPressComRestApiErrorDomain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WordPressComRestApiErrorDomain.h; sourceTree = ""; }; 3FB8642D288813E9003A86BE /* UnitTests.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = UnitTests.xctestplan; sourceTree = ""; }; + 3FD634E32BC3A55F00CEDF5E /* WordPressOrgXMLRPCValidator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WordPressOrgXMLRPCValidator.swift; sourceTree = ""; }; + 3FD634E42BC3A55F00CEDF5E /* Date+WordPressCom.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Date+WordPressCom.swift"; sourceTree = ""; }; + 3FD634E92BC3A6BA00CEDF5E /* Bundle+SPMSupport.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Bundle+SPMSupport.swift"; sourceTree = ""; }; + 3FD634EB2BC3AD6200CEDF5E /* MultipartForm.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MultipartForm.swift; sourceTree = ""; }; + 3FD634EC2BC3AD6200CEDF5E /* Result+Callback.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Result+Callback.swift"; sourceTree = ""; }; + 3FD634ED2BC3AD6200CEDF5E /* Either.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Either.swift; sourceTree = ""; }; + 3FD634EE2BC3AD6200CEDF5E /* SocialLogin2FANonceInfo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SocialLogin2FANonceInfo.swift; sourceTree = ""; }; + 3FD634EF2BC3AD6200CEDF5E /* AppTransportSecuritySettings.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppTransportSecuritySettings.swift; sourceTree = ""; }; + 3FD634F02BC3AD6200CEDF5E /* WebauthChallengeInfo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WebauthChallengeInfo.swift; sourceTree = ""; }; + 3FD634F12BC3AD6200CEDF5E /* StringEncoding+IANA.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "StringEncoding+IANA.swift"; sourceTree = ""; }; + 3FD635032BC3F03200CEDF5E /* WordPressComRESTAPIVersionedPathBuilder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WordPressComRESTAPIVersionedPathBuilder.h; sourceTree = ""; }; + 3FD635052BC3F08400CEDF5E /* WordPressComRESTAPIVersionedPathBuilder.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WordPressComRESTAPIVersionedPathBuilder.m; sourceTree = ""; }; 3FE2E94D2BB29A1B002CA2E1 /* FilePart.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FilePart.m; sourceTree = ""; }; 3FE2E94E2BB29A1B002CA2E1 /* FilePart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FilePart.h; sourceTree = ""; }; 3FE2E9662BBEB8D2002CA2E1 /* WordPressComRESTAPIVersion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WordPressComRESTAPIVersion.h; sourceTree = ""; }; + 3FE2E9792BC3A332002CA2E1 /* WordPressAPIError+NSErrorBridge.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "WordPressAPIError+NSErrorBridge.swift"; sourceTree = ""; }; + 3FE2E97A2BC3A332002CA2E1 /* WordPressComRestApi.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WordPressComRestApi.swift; sourceTree = ""; }; 3FFCC0402BA995290051D229 /* Date+WordPressComTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Date+WordPressComTests.swift"; sourceTree = ""; }; 3FFCC0462BAA6EF40051D229 /* NSDate+WordPressCom.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSDate+WordPressCom.swift"; sourceTree = ""; }; 3FFCC0482BAB98130051D229 /* DateFormatter+WordPressCom.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "DateFormatter+WordPressCom.swift"; sourceTree = ""; }; 3FFCC04A2BABA5220051D229 /* DateFormatter+WordPressComTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "DateFormatter+WordPressComTests.swift"; sourceTree = ""; }; 3FFCC04C2BABA6980051D229 /* NSDate+WordPressComTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSDate+WordPressComTests.swift"; sourceTree = ""; }; - 3FFCC04E2BABA6E60051D229 /* Date+WordPressCom.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Date+WordPressCom.swift"; sourceTree = ""; }; 3FFCC0552BABC78B0051D229 /* WordPressComRESTAPIInterfacing.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WordPressComRESTAPIInterfacing.h; sourceTree = ""; }; 40247DF92120D8E100AE1C3C /* AutomatedTransferService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutomatedTransferService.swift; sourceTree = ""; }; 40247DFB2120E69600AE1C3C /* AutomatedTransferStatus.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutomatedTransferStatus.swift; sourceTree = ""; }; @@ -907,7 +922,7 @@ 4A05E7972B2FCB9A00C25E3B /* NonceRetrievalTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NonceRetrievalTests.swift; sourceTree = ""; }; 4A05E7992B2FDC3200C25E3B /* WordPressOrgRestApi.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WordPressOrgRestApi.swift; sourceTree = ""; }; 4A05E79B2B2FDC6100C25E3B /* WordPressOrgAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WordPressOrgAPITests.swift; sourceTree = ""; }; - 4A05E79D2B30F3C500C25E3B /* HTTPRequestHelpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HTTPRequestHelpers.swift; sourceTree = ""; }; + 4A05E79D2B30F3C500C25E3B /* URLRequest+HTTPBodyText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "URLRequest+HTTPBodyText.swift"; sourceTree = ""; }; 4A05E7A52B34142200C25E3B /* xmlrpc-response-invalid.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = "xmlrpc-response-invalid.html"; sourceTree = ""; }; 4A05E7A72B34EAF400C25E3B /* xmlrpc-response-mobile-plugin-redirect.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = "xmlrpc-response-mobile-plugin-redirect.html"; sourceTree = ""; }; 4A05E7A92B34FC4300C25E3B /* xmlrpc-response-list-methods.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = "xmlrpc-response-list-methods.xml"; sourceTree = ""; }; @@ -915,7 +930,6 @@ 4A1123992B19269A004690CF /* WordPressAPIError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WordPressAPIError.swift; sourceTree = ""; }; 4A11239B2B1926B7004690CF /* HTTPRequestBuilder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HTTPRequestBuilder.swift; sourceTree = ""; }; 4A11239D2B1926D1004690CF /* HTTPClient.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HTTPClient.swift; sourceTree = ""; }; - 4A11239F2B196821004690CF /* MultipartForm.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MultipartForm.swift; sourceTree = ""; }; 4A1123A12B19690C004690CF /* MultipartFormTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MultipartFormTests.swift; sourceTree = ""; }; 4A1DEF43293051BC00322608 /* LoggingTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoggingTests.swift; sourceTree = ""; }; 4A1DEF45293051C600322608 /* LoggingTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LoggingTests.m; sourceTree = ""; }; @@ -924,10 +938,6 @@ 4A3239672B74319400EFD2A8 /* self-hosted-plugins-install.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "self-hosted-plugins-install.json"; sourceTree = ""; }; 4A40F6542B2A5A1A0015DA77 /* WordPressAPIErrorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WordPressAPIErrorTests.swift; sourceTree = ""; }; 4A57A6802B549144008D0660 /* WordPressComRestApiTests+Error.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WordPressComRestApiTests+Error.swift"; sourceTree = ""; }; - 4A57A6822B54A326008D0660 /* WordPressAPIError+NSErrorBrdige.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WordPressAPIError+NSErrorBrdige.swift"; sourceTree = ""; }; - 4A57A6852B54C68C008D0660 /* Constants.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Constants.h; sourceTree = ""; }; - 4A57A6862B54C68C008D0660 /* Constants.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Constants.m; sourceTree = ""; }; - 4A5BC1A72B59DE6600C7D037 /* Either.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Either.swift; sourceTree = ""; }; 4A68E3CC29404181004AC3DC /* RemoteBlog.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RemoteBlog.swift; sourceTree = ""; }; 4A68E3CE29404289004AC3DC /* RemoteBlogOptionsHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RemoteBlogOptionsHelper.swift; sourceTree = ""; }; 4A68E3D029406AA0004AC3DC /* RemoteMenu.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RemoteMenu.swift; sourceTree = ""; }; @@ -946,7 +956,6 @@ 4AE278492B2FC6C600E4D9B1 /* HTTPHeaderValueParserTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HTTPHeaderValueParserTests.swift; sourceTree = ""; }; 4AE7E36A2B9A995500C8CED5 /* AnnouncementServiceRemoteTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnnouncementServiceRemoteTests.swift; sourceTree = ""; }; 4AE7E36C2B9A9BC400C8CED5 /* site-zendesk-metadata-success.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "site-zendesk-metadata-success.json"; sourceTree = ""; }; - 57BCD3D326209D9500292CB3 /* AppTransportSecuritySettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppTransportSecuritySettings.swift; sourceTree = ""; }; 6C2A33D76FD1052D6F30466D /* Pods-WordPressKit.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WordPressKit.debug.xcconfig"; path = "Pods/Target Support Files/Pods-WordPressKit/Pods-WordPressKit.debug.xcconfig"; sourceTree = ""; }; 6F2E0CC4FA01B5475A378DA2 /* Pods-WordPressKitTests.release-alpha.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WordPressKitTests.release-alpha.xcconfig"; path = "Pods/Target Support Files/Pods-WordPressKitTests/Pods-WordPressKitTests.release-alpha.xcconfig"; sourceTree = ""; }; 730E869E21E44EFD00753E1A /* WordPressComServiceRemote+SiteVerticals.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WordPressComServiceRemote+SiteVerticals.swift"; sourceTree = ""; }; @@ -981,7 +990,7 @@ 7403A2F01EF06FEB00DED7DC /* me-settings-change-primary-site-success.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = "me-settings-change-primary-site-success.json"; path = "WordPressKitTests/me-settings-change-primary-site-success.json"; sourceTree = SOURCE_ROOT; }; 7403A2F11EF06FEB00DED7DC /* me-settings-change-web-address-success.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = "me-settings-change-web-address-success.json"; path = "WordPressKitTests/me-settings-change-web-address-success.json"; sourceTree = SOURCE_ROOT; }; 7403A2F21EF06FEB00DED7DC /* me-settings-revert-email-success.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = "me-settings-revert-email-success.json"; path = "WordPressKitTests/me-settings-revert-email-success.json"; sourceTree = SOURCE_ROOT; }; - 7403A2F31EF06FEB00DED7DC /* me-settings-success.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = "me-settings-success.json"; path = "WordPressKitTests/me-settings-success.json"; sourceTree = SOURCE_ROOT; }; + 7403A2F31EF06FEB00DED7DC /* me-settings-success.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = "me-settings-success.json"; path = "Tests/CoreAPITests/Stubs/JSON/me-settings-success.json"; sourceTree = SOURCE_ROOT; }; 7403A3011EF0726E00DED7DC /* AccountSettings.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AccountSettings.swift; sourceTree = ""; }; 740B23B21F17EC7300067A2A /* PostServiceRemote.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PostServiceRemote.h; sourceTree = ""; }; 740B23B31F17EC7300067A2A /* PostServiceRemoteREST.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PostServiceRemoteREST.h; sourceTree = ""; }; @@ -1239,9 +1248,7 @@ 93BD276E1EE737A8002BB00B /* ServiceRemoteWordPressXMLRPC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ServiceRemoteWordPressXMLRPC.m; sourceTree = ""; }; 93BD27741EE73944002BB00B /* HTTPAuthenticationAlertController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HTTPAuthenticationAlertController.swift; sourceTree = ""; }; 93BD27771EE73944002BB00B /* WordPressComOAuthClient.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WordPressComOAuthClient.swift; sourceTree = ""; }; - 93BD27781EE73944002BB00B /* WordPressComRestApi.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WordPressComRestApi.swift; sourceTree = ""; }; 93BD27791EE73944002BB00B /* WordPressOrgXMLRPCApi.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WordPressOrgXMLRPCApi.swift; sourceTree = ""; }; - 93BD277A1EE73944002BB00B /* WordPressOrgXMLRPCValidator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WordPressOrgXMLRPCValidator.swift; sourceTree = ""; }; 93BD277B1EE73944002BB00B /* WordPressRSDParser.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WordPressRSDParser.swift; sourceTree = ""; }; 93C674ED1EE834B700BFAF05 /* RemoteBlogSettings.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RemoteBlogSettings.swift; sourceTree = ""; }; 93C674EF1EE8351E00BFAF05 /* NSMutableDictionary+Helpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMutableDictionary+Helpers.h"; sourceTree = ""; }; @@ -1386,7 +1393,6 @@ E1EF5D5C1F9F329900B6D53E /* SitePluginCapabilities.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SitePluginCapabilities.swift; sourceTree = ""; }; E33F1EA3284E0454909D1967 /* Pods-WordPressKit.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WordPressKit.release.xcconfig"; path = "Pods/Target Support Files/Pods-WordPressKit/Pods-WordPressKit.release.xcconfig"; sourceTree = ""; }; E61A51A521B172A900A5F902 /* RemoteWpcomPlan.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RemoteWpcomPlan.swift; sourceTree = ""; }; - E632D7771F6E047400297F6D /* SocialLogin2FANonceInfo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SocialLogin2FANonceInfo.swift; sourceTree = ""; }; E670CD712277A85000E75735 /* plans-me-sites-success.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "plans-me-sites-success.json"; sourceTree = ""; }; E689431D21B0A1A800C5E4A7 /* plans-mobile-success.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "plans-mobile-success.json"; sourceTree = ""; }; E6B0460825E5B4DD00DF6F4F /* RemoteInviteLink.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RemoteInviteLink.swift; sourceTree = ""; }; @@ -1555,26 +1561,94 @@ path = Plans; sourceTree = ""; }; - 3FE2E9352BB10D92002CA2E1 /* WordPressAPI */ = { + 3FD634E82BC3A6A800CEDF5E /* CoreAPITests */ = { isa = PBXGroup; children = ( - 4A05E7952B2FCB6400C25E3B /* NonceRetrieval.swift */, - 4A05E7992B2FDC3200C25E3B /* WordPressOrgRestApi.swift */, - 93BD27741EE73944002BB00B /* HTTPAuthenticationAlertController.swift */, - 3FFCC0462BAA6EF40051D229 /* NSDate+WordPressCom.swift */, - 3FFCC04E2BABA6E60051D229 /* Date+WordPressCom.swift */, - 3FFCC0482BAB98130051D229 /* DateFormatter+WordPressCom.swift */, - 93BD27771EE73944002BB00B /* WordPressComOAuthClient.swift */, - 93BD27781EE73944002BB00B /* WordPressComRestApi.swift */, - 93BD27791EE73944002BB00B /* WordPressOrgXMLRPCApi.swift */, - 93BD277A1EE73944002BB00B /* WordPressOrgXMLRPCValidator.swift */, - 93BD277B1EE73944002BB00B /* WordPressRSDParser.swift */, - 4A11239D2B1926D1004690CF /* HTTPClient.swift */, - 4A11239B2B1926B7004690CF /* HTTPRequestBuilder.swift */, - 4A1123992B19269A004690CF /* WordPressAPIError.swift */, - 4A57A6822B54A326008D0660 /* WordPressAPIError+NSErrorBrdige.swift */, + 3FD634FC2BC3B23600CEDF5E /* Stubs */, + 46ABD0E9262EEE0400C7FF24 /* AppTransportSecuritySettingsTests.swift */, + 3FD634E92BC3A6BA00CEDF5E /* Bundle+SPMSupport.swift */, + 46ABD0E5262EEDAB00C7FF24 /* FakeInfoDictionaryObjectProvider.swift */, + 4A6B4A832B26974F00802316 /* HTTPRequestBuilderTests.swift */, + 4A1123A12B19690C004690CF /* MultipartFormTests.swift */, + 4A05E7972B2FCB9A00C25E3B /* NonceRetrievalTests.swift */, + 4A05E7AB2B35048A00C25E3B /* RSDParserTests.swift */, + 4A05E79D2B30F3C500C25E3B /* URLRequest+HTTPBodyText.swift */, + FFE247A620C891D1002DF3A2 /* WordPressComOAuthClientTests.swift */, + 74B335D91F06F3D60053A184 /* WordPressComRestApiTests.swift */, + 4A57A6802B549144008D0660 /* WordPressComRestApiTests+Error.swift */, + 73B3DAD521FBB20D00B2CF18 /* WordPressComRestApiTests+Locale.swift */, + 4A05E79B2B2FDC6100C25E3B /* WordPressOrgAPITests.swift */, + FFA4D4A82423B10A00BF5180 /* WordPressOrgRestApiTests.swift */, + 74B335DB1F06F4180053A184 /* WordPressOrgXMLRPCApiTests.swift */, + 46ABD0DF262EED3D00C7FF24 /* WordPressOrgXMLRPCValidatorTests.swift */, ); - path = WordPressAPI; + path = CoreAPITests; + sourceTree = ""; + }; + 3FD634FC2BC3B23600CEDF5E /* Stubs */ = { + isa = PBXGroup; + children = ( + 3FD635012BC3C03100CEDF5E /* JSON */, + 3FD634FD2BC3B25400CEDF5E /* HTML */, + 3FD635002BC3BFBB00CEDF5E /* XML */, + ); + path = Stubs; + sourceTree = ""; + }; + 3FD634FD2BC3B25400CEDF5E /* HTML */ = { + isa = PBXGroup; + children = ( + 4A05E7A52B34142200C25E3B /* xmlrpc-response-invalid.html */, + 4A05E7A72B34EAF400C25E3B /* xmlrpc-response-mobile-plugin-redirect.html */, + ); + path = HTML; + sourceTree = ""; + }; + 3FD635002BC3BFBB00CEDF5E /* XML */ = { + isa = PBXGroup; + children = ( + 740B23EB1F17FB7E00067A2A /* xmlrpc-bad-username-password-error.xml */, + 74B335E91F06F76B0053A184 /* xmlrpc-response-getpost.xml */, + 4A05E7A92B34FC4300C25E3B /* xmlrpc-response-list-methods.xml */, + ); + path = XML; + sourceTree = ""; + }; + 3FD635012BC3C03100CEDF5E /* JSON */ = { + isa = PBXGroup; + children = ( + 7403A2F31EF06FEB00DED7DC /* me-settings-success.json */, + FFE247A920C891E5002DF3A2 /* WordPressComAuthenticateWithIDToken2FANeededSuccess.json */, + FFE247AB20C891E5002DF3A2 /* WordPressComAuthenticateWithIDTokenBearerTokenSuccess.json */, + FFE247AE20C891E6002DF3A2 /* WordPressComAuthenticateWithIDTokenExistingUserNeedsConnection.json */, + 264E09B62AD25ED9004B5A5F /* WordPressComOAuthAuthenticateSignature.json */, + FFE247AC20C891E5002DF3A2 /* WordPressComOAuthNeeds2FAFail.json */, + 264E09B82AD2709A004B5A5F /* WordPressComOAuthNeedsWebauthnMFA.json */, + 264E09B42AD259FF004B5A5F /* WordPressComOAuthRequestChallenge.json */, + FFE247AD20C891E5002DF3A2 /* WordPressComOAuthSuccess.json */, + FFE247A820C891E5002DF3A2 /* WordPressComOAuthWrongPasswordFail.json */, + 74B335DF1F06F6290053A184 /* WordPressComRestApiFailInvalidInput.json */, + 74B335DD1F06F5A50053A184 /* WordPressComRestApiFailInvalidJSON.json */, + 74B335E11F06F6730053A184 /* WordPressComRestApiFailRequestInvalidToken.json */, + 93F50A3B1F226C0100B5BEBA /* WordPressComRestApiFailThrottled.json */, + 74B335E71F06F7200053A184 /* WordPressComRestApiFailUnauthorized.json */, + 74B335E51F06F6E90053A184 /* WordPressComRestApiMedia.json */, + 74B335E31F06F6B30053A184 /* WordPressComRestApiMultipleErrors.json */, + FFE247AA20C891E5002DF3A2 /* WordPressComSocial2FACodeSuccess.json */, + FFA4D4AE2423B33800BF5180 /* wp-forbidden.json */, + FFA4D4AF2423B33800BF5180 /* wp-pages.json */, + 1D969EB229D45745001FE37C /* wp-reusable-blocks.json */, + ); + path = JSON; + sourceTree = ""; + }; + 3FD635022BC3E7A700CEDF5E /* BasicBlogAPIObjc */ = { + isa = PBXGroup; + children = ( + 93BD276B1EE737A8002BB00B /* ServiceRemoteWordPressComREST.h */, + 93BD276C1EE737A8002BB00B /* ServiceRemoteWordPressComREST.m */, + ); + path = BasicBlogAPIObjc; sourceTree = ""; }; 3FE2E9362BB10EC7002CA2E1 /* Stats */ = { @@ -1703,8 +1777,6 @@ 9856BE952630B5C200C12FEB /* RemoteUser+Likes.swift */, 436D563B2118E18D00CEAA33 /* WPState.swift */, E1D6B555200E46F200325669 /* WPTimeZone.swift */, - E632D7771F6E047400297F6D /* SocialLogin2FANonceInfo.swift */, - 264E09B22AD0B3BB004B5A5F /* WebauthChallengeInfo.swift */, 17CE77F020C6EB41001DEA5A /* ReaderFeed.swift */, 32E1DD22236AA09A008914B0 /* RemotePostAutosave.swift */, F9E56DF524EB11EF00916770 /* FeatureFlag.swift */, @@ -1806,8 +1878,6 @@ 7430C9A21F1927180051B8E6 /* ReaderTopicServiceRemote.m */, 3236F77724AE34B40088E8F3 /* ReaderTopicServiceRemote+Interests.swift */, 9F3E0BA12087345E009CB5BA /* ReaderTopicServiceRemote+Subscription.swift */, - 93BD276B1EE737A8002BB00B /* ServiceRemoteWordPressComREST.h */, - 93BD276C1EE737A8002BB00B /* ServiceRemoteWordPressComREST.m */, 93BD276D1EE737A8002BB00B /* ServiceRemoteWordPressXMLRPC.h */, 93BD276E1EE737A8002BB00B /* ServiceRemoteWordPressXMLRPC.m */, 9F3E0BA02087345E009CB5BA /* ServiceRequest.swift */, @@ -1849,15 +1919,9 @@ 93C674EF1EE8351E00BFAF05 /* NSMutableDictionary+Helpers.h */, 93C674F01EE8351E00BFAF05 /* NSMutableDictionary+Helpers.m */, 9F4E51FF2088E38200424676 /* ObjectValidation.swift */, - 57BCD3D326209D9500292CB3 /* AppTransportSecuritySettings.swift */, 465F88A1263B325C00F4C950 /* ChecksumUtil.swift */, 3F3195AC266FF94B00397EE7 /* ZendeskMetadata.swift */, - 4A11239F2B196821004690CF /* MultipartForm.swift */, 4AE278432B2FAF6200E4D9B1 /* HTTPProtocolHelpers.swift */, - 3F391E192B50F3EB007975C4 /* Result+Callback.swift */, - 4A5BC1A72B59DE6600C7D037 /* Either.swift */, - 4A57A6852B54C68C008D0660 /* Constants.h */, - 4A57A6862B54C68C008D0660 /* Constants.m */, ); path = Utility; sourceTree = ""; @@ -1961,12 +2025,6 @@ 93F50A431F227CFB00B5BEBA /* UsersServiceRemoteXMLRPCTests.swift */, F9E56DF924EB18A300916770 /* Utilities */, 57A38E502624F7D000472480 /* WordPressAPI */, - FFE247A620C891D1002DF3A2 /* WordPressComOAuthClientTests.swift */, - 74B335D91F06F3D60053A184 /* WordPressComRestApiTests.swift */, - 73B3DAD521FBB20D00B2CF18 /* WordPressComRestApiTests+Locale.swift */, - 4A57A6802B549144008D0660 /* WordPressComRestApiTests+Error.swift */, - FFA4D4A82423B10A00BF5180 /* WordPressOrgRestApiTests.swift */, - 74B335DB1F06F4180053A184 /* WordPressOrgXMLRPCApiTests.swift */, 740B23D51F17F7C100067A2A /* XMLRPCTestable.swift */, 3FFCC0402BA995290051D229 /* Date+WordPressComTests.swift */, 3FFCC04C2BABA6980051D229 /* NSDate+WordPressComTests.swift */, @@ -1978,6 +2036,8 @@ 3FE2E9432BB11413002CA2E1 /* Sources */ = { isa = PBXGroup; children = ( + 3FD635022BC3E7A700CEDF5E /* BasicBlogAPIObjc */, + 3FE2E9762BC395C2002CA2E1 /* CoreAPI */, 3FE2E9532BB3F4ED002CA2E1 /* APIInterface */, 3FE2E9462BB12020002CA2E1 /* WordPressKit */, ); @@ -1987,6 +2047,7 @@ 3FE2E9442BB11592002CA2E1 /* Tests */ = { isa = PBXGroup; children = ( + 3FD634E82BC3A6A800CEDF5E /* CoreAPITests */, 3FE2E9472BB12113002CA2E1 /* WordPressKitTests */, ); path = Tests; @@ -2005,7 +2066,6 @@ 3FE2E9462BB12020002CA2E1 /* WordPressKit */ = { isa = PBXGroup; children = ( - 3FE2E9352BB10D92002CA2E1 /* WordPressAPI */, B5A4821F20AC6B5C009D95F6 /* Private */, 3FE2E9452BB11BA7002CA2E1 /* Logging */, 3FE2E93F2BB11038002CA2E1 /* Models */, @@ -2034,8 +2094,10 @@ isa = PBXGroup; children = ( 3FE2E94E2BB29A1B002CA2E1 /* FilePart.h */, + 3FA4258E2BCCFDA6007539BF /* WordPressComRestApiErrorDomain.h */, 3FFCC0552BABC78B0051D229 /* WordPressComRESTAPIInterfacing.h */, 3FE2E9662BBEB8D2002CA2E1 /* WordPressComRESTAPIVersion.h */, + 3FD635032BC3F03200CEDF5E /* WordPressComRESTAPIVersionedPathBuilder.h */, ); path = include; sourceTree = ""; @@ -2045,10 +2107,40 @@ children = ( 3FE2E9522BB3F4ED002CA2E1 /* include */, 3FE2E94D2BB29A1B002CA2E1 /* FilePart.m */, + 3FD635052BC3F08400CEDF5E /* WordPressComRESTAPIVersionedPathBuilder.m */, ); path = APIInterface; sourceTree = ""; }; + 3FE2E9762BC395C2002CA2E1 /* CoreAPI */ = { + isa = PBXGroup; + children = ( + 3FD634EF2BC3AD6200CEDF5E /* AppTransportSecuritySettings.swift */, + 3FD634E42BC3A55F00CEDF5E /* Date+WordPressCom.swift */, + 3FFCC0482BAB98130051D229 /* DateFormatter+WordPressCom.swift */, + 3FD634ED2BC3AD6200CEDF5E /* Either.swift */, + 93BD27741EE73944002BB00B /* HTTPAuthenticationAlertController.swift */, + 4A11239D2B1926D1004690CF /* HTTPClient.swift */, + 4A11239B2B1926B7004690CF /* HTTPRequestBuilder.swift */, + 3FD634EB2BC3AD6200CEDF5E /* MultipartForm.swift */, + 4A05E7952B2FCB6400C25E3B /* NonceRetrieval.swift */, + 3FFCC0462BAA6EF40051D229 /* NSDate+WordPressCom.swift */, + 3FD634EC2BC3AD6200CEDF5E /* Result+Callback.swift */, + 3FD634EE2BC3AD6200CEDF5E /* SocialLogin2FANonceInfo.swift */, + 3FD634F12BC3AD6200CEDF5E /* StringEncoding+IANA.swift */, + 3FD634F02BC3AD6200CEDF5E /* WebauthChallengeInfo.swift */, + 4A1123992B19269A004690CF /* WordPressAPIError.swift */, + 3FE2E9792BC3A332002CA2E1 /* WordPressAPIError+NSErrorBridge.swift */, + 93BD27771EE73944002BB00B /* WordPressComOAuthClient.swift */, + 3FE2E97A2BC3A332002CA2E1 /* WordPressComRestApi.swift */, + 4A05E7992B2FDC3200C25E3B /* WordPressOrgRestApi.swift */, + 93BD27791EE73944002BB00B /* WordPressOrgXMLRPCApi.swift */, + 3FD634E32BC3A55F00CEDF5E /* WordPressOrgXMLRPCValidator.swift */, + 93BD277B1EE73944002BB00B /* WordPressRSDParser.swift */, + ); + path = CoreAPI; + sourceTree = ""; + }; 404057C3221B30140060250C /* Time Interval */ = { isa = PBXGroup; children = ( @@ -2099,9 +2191,6 @@ 57A38E502624F7D000472480 /* WordPressAPI */ = { isa = PBXGroup; children = ( - 46ABD0DF262EED3D00C7FF24 /* WordPressOrgXMLRPCValidatorTests.swift */, - 4A05E7972B2FCB9A00C25E3B /* NonceRetrievalTests.swift */, - 4A05E79B2B2FDC6100C25E3B /* WordPressOrgAPITests.swift */, ); path = WordPressAPI; sourceTree = ""; @@ -2109,7 +2198,6 @@ 57A38E572624FF1000472480 /* Fakes */ = { isa = PBXGroup; children = ( - 46ABD0E5262EEDAB00C7FF24 /* FakeInfoDictionaryObjectProvider.swift */, ); path = Fakes; sourceTree = ""; @@ -2247,7 +2335,6 @@ 93AEA69226CE4EED009502D2 /* me-settings-close-account-failure.json */, 93A4232226CBC845004CCA31 /* me-settings-close-account-success.json */, 7403A2F21EF06FEB00DED7DC /* me-settings-revert-email-success.json */, - 7403A2F31EF06FEB00DED7DC /* me-settings-success.json */, 93BD274D1EE73442002BB00B /* me-sites-auth-failure.json */, 93BD274E1EE73442002BB00B /* me-sites-bad-json-failure.json */, 93BD274F1EE73442002BB00B /* me-sites-empty-success.json */, @@ -2403,28 +2490,7 @@ 1DF972BD29B107E7007A72BC /* videopress-public-video.json */, 1DF972BE29B107E7007A72BC /* videopress-site-default-video.json */, 1DF972B729B0DF8C007A72BC /* videopress-token.json */, - FFE247A920C891E5002DF3A2 /* WordPressComAuthenticateWithIDToken2FANeededSuccess.json */, - FFE247AB20C891E5002DF3A2 /* WordPressComAuthenticateWithIDTokenBearerTokenSuccess.json */, - FFE247AE20C891E6002DF3A2 /* WordPressComAuthenticateWithIDTokenExistingUserNeedsConnection.json */, - FFE247AC20C891E5002DF3A2 /* WordPressComOAuthNeeds2FAFail.json */, - 264E09B82AD2709A004B5A5F /* WordPressComOAuthNeedsWebauthnMFA.json */, - 264E09B42AD259FF004B5A5F /* WordPressComOAuthRequestChallenge.json */, - 264E09B62AD25ED9004B5A5F /* WordPressComOAuthAuthenticateSignature.json */, - FFE247AD20C891E5002DF3A2 /* WordPressComOAuthSuccess.json */, - FFE247A820C891E5002DF3A2 /* WordPressComOAuthWrongPasswordFail.json */, - 74B335DF1F06F6290053A184 /* WordPressComRestApiFailInvalidInput.json */, - 74B335DD1F06F5A50053A184 /* WordPressComRestApiFailInvalidJSON.json */, - 74B335E11F06F6730053A184 /* WordPressComRestApiFailRequestInvalidToken.json */, - 93F50A3B1F226C0100B5BEBA /* WordPressComRestApiFailThrottled.json */, - 74B335E71F06F7200053A184 /* WordPressComRestApiFailUnauthorized.json */, - 74B335E51F06F6E90053A184 /* WordPressComRestApiMedia.json */, - 74B335E31F06F6B30053A184 /* WordPressComRestApiMultipleErrors.json */, - FFE247AA20C891E5002DF3A2 /* WordPressComSocial2FACodeSuccess.json */, FFA4D4AC2423B1FE00BF5180 /* wp-admin-post-new.html */, - FFA4D4AE2423B33800BF5180 /* wp-forbidden.json */, - FFA4D4AF2423B33800BF5180 /* wp-pages.json */, - 1D969EB229D45745001FE37C /* wp-reusable-blocks.json */, - 740B23EB1F17FB7E00067A2A /* xmlrpc-bad-username-password-error.xml */, 740B23EC1F17FB7E00067A2A /* xmlrpc-malformed-request-xml-error.xml */, 740B23D71F17FB4200067A2A /* xmlrpc-metaweblog-editpost-bad-xml-failure.xml */, 740B23D81F17FB4200067A2A /* xmlrpc-metaweblog-editpost-change-format-failure.xml */, @@ -2433,10 +2499,6 @@ 740B23DB1F17FB4200067A2A /* xmlrpc-metaweblog-newpost-bad-xml-failure.xml */, 740B23DC1F17FB4200067A2A /* xmlrpc-metaweblog-newpost-invalid-posttype-failure.xml */, 740B23DD1F17FB4200067A2A /* xmlrpc-metaweblog-newpost-success.xml */, - 74B335E91F06F76B0053A184 /* xmlrpc-response-getpost.xml */, - 4A05E7A92B34FC4300C25E3B /* xmlrpc-response-list-methods.xml */, - 4A05E7A52B34142200C25E3B /* xmlrpc-response-invalid.html */, - 4A05E7A72B34EAF400C25E3B /* xmlrpc-response-mobile-plugin-redirect.html */, 93F50A451F227F3600B5BEBA /* xmlrpc-response-getprofile.xml */, 93F50A461F227F3600B5BEBA /* xmlrpc-response-valid-but-unexpected-dictionary.xml */, 98EA910426BC96B8004098A1 /* xmlrpc-site-comments-success.xml */, @@ -2570,21 +2632,16 @@ F9E56DF924EB18A300916770 /* Utilities */ = { isa = PBXGroup; children = ( - 46ABD0E9262EEE0400C7FF24 /* AppTransportSecuritySettingsTests.swift */, F9E56DFA24EB18C300916770 /* FeatureFlagRemoteTests.swift */, 24ADA24D24F9B32D001B5DAE /* FeatureFlagSerializationTest.swift */, 465F88BE263B54EE00F4C950 /* ChecksumUtilTests.swift */, 803DE81028FFA9C4007D4E9C /* RemoteConfigRemoteTests.swift */, 4A1DEF43293051BC00322608 /* LoggingTests.swift */, 4A1DEF45293051C600322608 /* LoggingTests.m */, - 4A1123A12B19690C004690CF /* MultipartFormTests.swift */, - 4A6B4A832B26974F00802316 /* HTTPRequestBuilderTests.swift */, 4A6B4A852B269D0C00802316 /* URLSessionHelperTests.swift */, 4A40F6542B2A5A1A0015DA77 /* WordPressAPIErrorTests.swift */, 4AE278472B2FBF1100E4D9B1 /* HTTPBodyEncodingTests.swift */, 4AE278492B2FC6C600E4D9B1 /* HTTPHeaderValueParserTests.swift */, - 4A05E7AB2B35048A00C25E3B /* RSDParserTests.swift */, - 4A05E79D2B30F3C500C25E3B /* HTTPRequestHelpers.swift */, ); path = Utilities; sourceTree = ""; @@ -2619,7 +2676,9 @@ 9368C78C1EC5EF1B0092CE8E /* WordPressKit.h in Headers */, 93C674F11EE8351E00BFAF05 /* NSMutableDictionary+Helpers.h in Headers */, 93BD273C1EE73282002BB00B /* AccountServiceRemoteREST.h in Headers */, + 3FD635042BC3F05400CEDF5E /* WordPressComRESTAPIVersionedPathBuilder.h in Headers */, 93BD27711EE737A8002BB00B /* ServiceRemoteWordPressXMLRPC.h in Headers */, + 3FA4258F2BCCFDA6007539BF /* WordPressComRestApiErrorDomain.h in Headers */, 3FE2E9672BBEB8D2002CA2E1 /* WordPressComRESTAPIVersion.h in Headers */, 93BD276F1EE737A8002BB00B /* ServiceRemoteWordPressComREST.h in Headers */, 93BD273B1EE73282002BB00B /* AccountServiceRemote.h in Headers */, @@ -2662,7 +2721,6 @@ 740B23C41F17EE8000067A2A /* RemotePost.h in Headers */, 740B23C21F17EE8000067A2A /* RemotePostCategory.h in Headers */, B5A4822F20AC6C1A009D95F6 /* WPKitLogging.h in Headers */, - 4A57A6872B54C68C008D0660 /* Constants.h in Headers */, 9309995B1F16616A00F006A1 /* RemoteTheme.h in Headers */, 1A4F98672279A87D00D86E8E /* WPKit-Swift.h in Headers */, 93F50A371F226B9300B5BEBA /* WordPressComServiceRemote.h in Headers */, @@ -3188,9 +3246,11 @@ files = ( C7A09A53284104DB003096ED /* QRLoginValidationResponse.swift in Sources */, F181EA0227184D3D00F26141 /* ProductServiceRemote.swift in Sources */, + 3FD634F82BC3AD6200CEDF5E /* StringEncoding+IANA.swift in Sources */, 32E1DD23236AA09A008914B0 /* RemotePostAutosave.swift in Sources */, 464BAB0B262F6736006AEED5 /* RemoteBlockEditorSettings.swift in Sources */, FEFFD99126C1347D00F34231 /* ShareAppContentServiceRemote.swift in Sources */, + 3FD634F52BC3AD6200CEDF5E /* SocialLogin2FANonceInfo.swift in Sources */, 74585B8E1F0D51A100E7E667 /* DomainsServiceRemote.swift in Sources */, FEAE3AC7298AC2A300E05A24 /* JetpackProxyServiceRemote.swift in Sources */, 4625B965253A343900C04AAD /* RemotePageLayouts.swift in Sources */, @@ -3225,11 +3285,10 @@ 4A05E7962B2FCB6400C25E3B /* NonceRetrieval.swift in Sources */, 93BD27701EE737A8002BB00B /* ServiceRemoteWordPressComREST.m in Sources */, E61A51A621B172A900A5F902 /* RemoteWpcomPlan.swift in Sources */, + 3FD634F62BC3AD6200CEDF5E /* AppTransportSecuritySettings.swift in Sources */, 0CED1FE82B617CF300E6DD52 /* AtomicSiteServiceRemote.swift in Sources */, 93BD277F1EE73944002BB00B /* WordPressComOAuthClient.swift in Sources */, 740B23B91F17EC7300067A2A /* PostServiceRemoteREST.m in Sources */, - 93BD27801EE73944002BB00B /* WordPressComRestApi.swift in Sources */, - 3FFCC04F2BABA6E60051D229 /* Date+WordPressCom.swift in Sources */, 404057D2221C56AB0060250C /* StatsTopCountryTimeIntervalData.swift in Sources */, E11C2AD21FA77FB90023BDE2 /* SitePlugin.swift in Sources */, 4A68E3DF29407100004AC3DC /* RemoteReaderTopic.swift in Sources */, @@ -3238,7 +3297,9 @@ 74E229501F1E741B0085F7F2 /* RemotePublicizeConnection.swift in Sources */, 40E7FEB722106A8D0032834E /* StatsCommentsInsight.swift in Sources */, 9856BE962630B5C200C12FEB /* RemoteUser+Likes.swift in Sources */, - 57BCD3D426209D9500292CB3 /* AppTransportSecuritySettings.swift in Sources */, + 3FD634E52BC3A55F00CEDF5E /* WordPressOrgXMLRPCValidator.swift in Sources */, + 3FE2E97B2BC3A332002CA2E1 /* WordPressAPIError+NSErrorBridge.swift in Sources */, + 3FD634F22BC3AD6200CEDF5E /* MultipartForm.swift in Sources */, 9311A6891F22625A00704AC9 /* TaxonomyServiceRemoteREST.m in Sources */, 9AB6D647218705E90008F274 /* RemoteDiff.swift in Sources */, 93BD277C1EE73944002BB00B /* HTTPAuthenticationAlertController.swift in Sources */, @@ -3248,7 +3309,6 @@ B5969E1D20A49AC4005E9DF1 /* NSString+MD5.m in Sources */, 01438D3B2B6A36BF0097D60A /* StatsTotalsSummaryData.swift in Sources */, 4A68E3E1294076C1004AC3DC /* RemoteReaderSiteInfo.swift in Sources */, - 3F391E1A2B50F3EB007975C4 /* Result+Callback.swift in Sources */, 8236EB4D2024B9F8007C7CF9 /* RemoteBlogJetpackModulesSettings.swift in Sources */, 73A2F38A21E7F81E00388609 /* WordPressComServiceRemote+SiteVerticalsPrompt.swift in Sources */, 740B23BB1F17EC7300067A2A /* PostServiceRemoteXMLRPC.m in Sources */, @@ -3265,8 +3325,8 @@ C797196E2679007B0072F984 /* SelfHostedPluginManagementClient.swift in Sources */, 40414060220F9F1F00CF7C5B /* StatsAllTimesInsight.swift in Sources */, E194CB731FBDEF6500B0A8B8 /* PluginState.swift in Sources */, - 4A57A6882B54C68C008D0660 /* Constants.m in Sources */, 404057D6221C92660060250C /* StatsTopClicksTimeIntervalData.swift in Sources */, + 3FD634F42BC3AD6200CEDF5E /* Either.swift in Sources */, 9AF4F2FC218331DC00570E4B /* PostServiceRemoteREST+Revisions.swift in Sources */, FE6C67392BB739950083ECAB /* Date+endOfDay.swift in Sources */, F4B0F4732ACAF498003ABC61 /* DomainsServiceRemote+AllDomains.swift in Sources */, @@ -3291,7 +3351,6 @@ 74BA04FA1F06DC3900ED5CD8 /* RemoteComment.m in Sources */, 40F98809221AC88700B7B369 /* StatsPostingStreakInsight.swift in Sources */, 465F889E263B0C5500F4C950 /* BlockEditorSettingsServiceRemote.swift in Sources */, - E632D7781F6E047400297F6D /* SocialLogin2FANonceInfo.swift in Sources */, 32FC1D29255C91ED00CD0A7B /* JetpackScanServiceRemote.swift in Sources */, 9F3E0B9B208732B3009CB5BA /* RemoteReaderSiteInfoSubscription.swift in Sources */, 3FFCC0472BAA6EF40051D229 /* NSDate+WordPressCom.swift in Sources */, @@ -3312,7 +3371,6 @@ 4A11239C2B1926B7004690CF /* HTTPRequestBuilder.swift in Sources */, 40E7FEB1220FB3B60032834E /* StatsAnnualAndMostPopularTimeInsight.swift in Sources */, 3F758FD324F6C68200BBA2FC /* AnnouncementServiceRemote.swift in Sources */, - 4A1123A02B196821004690CF /* MultipartForm.swift in Sources */, FAB4F32324EC072700F259BA /* ReaderPostServiceRemote+Subscriptions.swift in Sources */, 82FFBF561F460DD400F4573F /* BlogJetpackSettingsServiceRemote.swift in Sources */, 3297E15625645C7D00287D21 /* JetpackCredentials.swift in Sources */, @@ -3332,6 +3390,7 @@ 8B2F4BF124ACE3C30056C08A /* RemoteReaderInterest.swift in Sources */, 74B5F0E71EF8699C00B411E7 /* RemotePostType.m in Sources */, 93188D1F1F2262BF0028ED4D /* RemotePostTag.m in Sources */, + 3FD634F72BC3AD6200CEDF5E /* WebauthChallengeInfo.swift in Sources */, 74D67F081F15BEB70010C5ED /* RemotePerson.swift in Sources */, FEE4EF59272FF78C003CDA3C /* CommentServiceRemoteREST+ApiV2.swift in Sources */, 984E34EB22EF7209005C3F92 /* StatsFileDownloadsTimeIntervalData.swift in Sources */, @@ -3344,6 +3403,7 @@ FAD1344525908F5F00A8FEB1 /* JetpackBackupServiceRemote.swift in Sources */, 0C1C08452B9CDB0B00E52F8C /* PostServiceRemoteXMLRPC+Extended.swift in Sources */, F1BB7806240FB90B0030ADDC /* AtomicAuthenticationServiceRemote.swift in Sources */, + 3FD634E62BC3A55F00CEDF5E /* Date+WordPressCom.swift in Sources */, 404057CE221C38130060250C /* StatsTopVideosTimeIntervalData.swift in Sources */, 7E0D64FF22D855700092AD10 /* EditorServiceRemote.swift in Sources */, 0C1C08412B9CD79900E52F8C /* PostServiceRemoteExtended.swift in Sources */, @@ -3368,11 +3428,12 @@ 436D563C2118E18D00CEAA33 /* WPState.swift in Sources */, 439A44DA2107C93000795ED7 /* RemotePlan_ApiVersion1_3.swift in Sources */, 93BD27811EE73944002BB00B /* WordPressOrgXMLRPCApi.swift in Sources */, - 4A57A6832B54A326008D0660 /* WordPressAPIError+NSErrorBrdige.swift in Sources */, 439A44D62107C66A00795ED7 /* JSONDecoderExtension.swift in Sources */, 0C9CD7992B9A107E0045BE03 /* RemotePostParameters.swift in Sources */, B5A4822B20AC6C0B009D95F6 /* WPKitLogging.swift in Sources */, + 3FD634F32BC3AD6200CEDF5E /* Result+Callback.swift in Sources */, B5A4822E20AC6C1A009D95F6 /* WPKitLogging.m in Sources */, + 3FE2E97C2BC3A332002CA2E1 /* WordPressComRestApi.swift in Sources */, FE6C673C2BB739950083ECAB /* NSAttributedString+extensions.swift in Sources */, 7430C9A61F1927180051B8E6 /* ReaderSiteServiceRemote.m in Sources */, FEE4EF57272FDD4B003CDA3C /* RemoteCommentV2.swift in Sources */, @@ -3384,12 +3445,10 @@ 74A44DD11F13C64B006CD8F4 /* RemoteNotificationSettings.swift in Sources */, FEF7419D28085D89002C4203 /* RemoteBloggingPrompt.swift in Sources */, 74DA56331F06EAF000FE9BF4 /* MediaServiceRemoteREST.m in Sources */, - 264E09B32AD0B3BB004B5A5F /* WebauthChallengeInfo.swift in Sources */, 17CD0CC320C58A0D000D9620 /* ReaderSiteSearchServiceRemote.swift in Sources */, 74DA563B1F06EB3000FE9BF4 /* RemoteMedia.m in Sources */, 9311A6861F22625A00704AC9 /* RemoteTaxonomyPaging.m in Sources */, FE6C673D2BB739950083ECAB /* NSMutableParagraphStyle+extensions.swift in Sources */, - 93BD27821EE73944002BB00B /* WordPressOrgXMLRPCValidator.swift in Sources */, F9E56DF824EB125600916770 /* FeatureFlagRemote.swift in Sources */, 40247DFC2120E69600AE1C3C /* AutomatedTransferStatus.swift in Sources */, 730E869F21E44EFD00753E1A /* WordPressComServiceRemote+SiteVerticals.swift in Sources */, @@ -3409,9 +3468,9 @@ FA28A3D6259079960082C7B0 /* JetpackRestoreTypes.swift in Sources */, FE6C673B2BB739950083ECAB /* Enum+UnknownCaseRepresentable.swift in Sources */, 32FC20CE255DCC6100CD0A7B /* JetpackScanThreat.swift in Sources */, - 4A5BC1A82B59DE6600C7D037 /* Either.swift in Sources */, FE50965F2A2E42A500DDD071 /* JetpackSocialServiceRemote.swift in Sources */, 3F3195AD266FF94B00397EE7 /* ZendeskMetadata.swift in Sources */, + 3FD635062BC3F08400CEDF5E /* WordPressComRESTAPIVersionedPathBuilder.m in Sources */, 40A71C6E220E1D8E002E3D25 /* StatsServiceRemoteV2.swift in Sources */, 82FFBF521F45F04100F4573F /* RemoteBlogJetpackMonitorSettings.swift in Sources */, 462422292548B98A002B8A12 /* SiteDesignServiceRemote.swift in Sources */, @@ -3439,12 +3498,11 @@ FE5096682A309E4600DDD071 /* JetpackSocialServiceRemoteTests.swift in Sources */, 74A44DD41F13C6D8006CD8F4 /* RemoteNotificationTests.swift in Sources */, 74A923B21F2BE2DF00EC8F92 /* RESTTestable.swift in Sources */, - 46ABD0EA262EEE0400C7FF24 /* AppTransportSecuritySettingsTests.swift in Sources */, 74D67F0A1F15C24C0010C5ED /* PeopleServiceRemoteTests.swift in Sources */, 4A1123A22B19690C004690CF /* MultipartFormTests.swift in Sources */, B04D8C0D2BB7895A002717A2 /* StatsInsightDecodingTests.swift in Sources */, 9F3E0BAE20873836009CB5BA /* ReaderTopicServiceRemoteTest+Subscriptions.swift in Sources */, - 4A05E79E2B30F3C500C25E3B /* HTTPRequestHelpers.swift in Sources */, + 4A05E79E2B30F3C500C25E3B /* URLRequest+HTTPBodyText.swift in Sources */, BA0637ED2492382200AF8419 /* PluginStateTests.swift in Sources */, 7328420621CD798A00126755 /* WordPressComServiceRemoteTests+SiteCreation.swift in Sources */, FACBDD3825ECB4480026705B /* ReaderPostServiceRemote+RelatedPostsTests.swift in Sources */, @@ -3471,6 +3529,7 @@ 74B335D81F06F1CA0053A184 /* MockWordPressComRestApi.swift in Sources */, 08C7493E2A45EA11000DA0E2 /* IPLocationRemoteTests.swift in Sources */, 32AF21E3236DEB3C001C6502 /* PostServiceRemoteRESTAutosaveTests.swift in Sources */, + 3FD634FB2BC3AE6C00CEDF5E /* Bundle+SPMSupport.swift in Sources */, 3236F79A24AE406D0088E8F3 /* ReaderTopicServiceRemote+InterestsTests.swift in Sources */, FEE4EF5B27302317003CDA3C /* CommentServiceRemoteREST+APIv2Tests.swift in Sources */, 803DE81128FFA9C4007D4E9C /* RemoteConfigRemoteTests.swift in Sources */, @@ -3538,6 +3597,7 @@ 74A44DD51F13C6D8006CD8F4 /* PushAuthenticationServiceRemoteTests.swift in Sources */, 4AE278482B2FBF1100E4D9B1 /* HTTPBodyEncodingTests.swift in Sources */, 731BA83621DECD61000FDFCD /* SiteCreationRequestEncodingTests.swift in Sources */, + 3FD634FA2BC3AE6800CEDF5E /* AppTransportSecuritySettingsTests.swift in Sources */, 7EC60EBE22DC4F9000FB0336 /* EditorServiceRemoteTests.swift in Sources */, 931924241F1662FA0069CBCC /* JSONLoader.swift in Sources */, E1787DB2200E5690004CB3AF /* TimeZoneServiceRemoteTests.swift in Sources */,