Start work on web services support in RSWeb.

This commit is contained in:
Brent Simmons 2017-12-09 11:27:06 -08:00
parent 3d72ba4b44
commit cc918daf37
8 changed files with 136 additions and 0 deletions

View File

@ -7,6 +7,20 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
84245C5A1FDC690A0074AFBB /* WebServiceProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84245C591FDC690A0074AFBB /* WebServiceProvider.swift */; };
84245C5B1FDC690A0074AFBB /* WebServiceProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84245C591FDC690A0074AFBB /* WebServiceProvider.swift */; };
84245C5D1FDC697A0074AFBB /* Credentials.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84245C5C1FDC697A0074AFBB /* Credentials.swift */; };
84245C5E1FDC697A0074AFBB /* Credentials.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84245C5C1FDC697A0074AFBB /* Credentials.swift */; };
84245C601FDC69F20074AFBB /* APICall.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84245C5F1FDC69F20074AFBB /* APICall.swift */; };
84245C611FDC69F20074AFBB /* APICall.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84245C5F1FDC69F20074AFBB /* APICall.swift */; };
84245C631FDC6A060074AFBB /* APIRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84245C621FDC6A060074AFBB /* APIRequest.swift */; };
84245C641FDC6A060074AFBB /* APIRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84245C621FDC6A060074AFBB /* APIRequest.swift */; };
84245C661FDC6A130074AFBB /* APIResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84245C651FDC6A120074AFBB /* APIResult.swift */; };
84245C671FDC6A130074AFBB /* APIResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84245C651FDC6A120074AFBB /* APIResult.swift */; };
84245C691FDC6A1E0074AFBB /* APIResultParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84245C681FDC6A1E0074AFBB /* APIResultParser.swift */; };
84245C6A1FDC6A1E0074AFBB /* APIResultParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84245C681FDC6A1E0074AFBB /* APIResultParser.swift */; };
84245C6C1FDC6A6D0074AFBB /* APIAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84245C6B1FDC6A6D0074AFBB /* APIAction.swift */; };
84245C6D1FDC6A6D0074AFBB /* APIAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84245C6B1FDC6A6D0074AFBB /* APIAction.swift */; };
842ED2E71E12FB8A000CF738 /* HTTPRequestHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 842ED2E61E12FB8A000CF738 /* HTTPRequestHeader.swift */; }; 842ED2E71E12FB8A000CF738 /* HTTPRequestHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 842ED2E61E12FB8A000CF738 /* HTTPRequestHeader.swift */; };
842ED2E81E12FB8A000CF738 /* HTTPRequestHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 842ED2E61E12FB8A000CF738 /* HTTPRequestHeader.swift */; }; 842ED2E81E12FB8A000CF738 /* HTTPRequestHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 842ED2E61E12FB8A000CF738 /* HTTPRequestHeader.swift */; };
842ED2EA1E12FB91000CF738 /* HTTPMethod.swift in Sources */ = {isa = PBXBuildFile; fileRef = 842ED2E91E12FB91000CF738 /* HTTPMethod.swift */; }; 842ED2EA1E12FB91000CF738 /* HTTPMethod.swift in Sources */ = {isa = PBXBuildFile; fileRef = 842ED2E91E12FB91000CF738 /* HTTPMethod.swift */; };
@ -53,6 +67,13 @@
/* End PBXContainerItemProxy section */ /* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
84245C591FDC690A0074AFBB /* WebServiceProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WebServiceProvider.swift; sourceTree = "<group>"; };
84245C5C1FDC697A0074AFBB /* Credentials.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = Credentials.swift; path = RSWeb/Credentials.swift; sourceTree = "<group>"; };
84245C5F1FDC69F20074AFBB /* APICall.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APICall.swift; sourceTree = "<group>"; };
84245C621FDC6A060074AFBB /* APIRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIRequest.swift; sourceTree = "<group>"; };
84245C651FDC6A120074AFBB /* APIResult.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIResult.swift; sourceTree = "<group>"; };
84245C681FDC6A1E0074AFBB /* APIResultParser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIResultParser.swift; sourceTree = "<group>"; };
84245C6B1FDC6A6D0074AFBB /* APIAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIAction.swift; sourceTree = "<group>"; };
842ED2E61E12FB8A000CF738 /* HTTPRequestHeader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = HTTPRequestHeader.swift; path = RSWeb/HTTPRequestHeader.swift; sourceTree = "<group>"; }; 842ED2E61E12FB8A000CF738 /* HTTPRequestHeader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = HTTPRequestHeader.swift; path = RSWeb/HTTPRequestHeader.swift; sourceTree = "<group>"; };
842ED2E91E12FB91000CF738 /* HTTPMethod.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = HTTPMethod.swift; path = RSWeb/HTTPMethod.swift; sourceTree = "<group>"; }; 842ED2E91E12FB91000CF738 /* HTTPMethod.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = HTTPMethod.swift; path = RSWeb/HTTPMethod.swift; sourceTree = "<group>"; };
842ED2EC1E12FB97000CF738 /* HTTPResponseCode.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = HTTPResponseCode.swift; path = RSWeb/HTTPResponseCode.swift; sourceTree = "<group>"; }; 842ED2EC1E12FB97000CF738 /* HTTPResponseCode.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = HTTPResponseCode.swift; path = RSWeb/HTTPResponseCode.swift; sourceTree = "<group>"; };
@ -104,6 +125,20 @@
/* End PBXFrameworksBuildPhase section */ /* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */ /* Begin PBXGroup section */
84245C581FDC690A0074AFBB /* WebServices */ = {
isa = PBXGroup;
children = (
84245C591FDC690A0074AFBB /* WebServiceProvider.swift */,
84245C5F1FDC69F20074AFBB /* APICall.swift */,
84245C621FDC6A060074AFBB /* APIRequest.swift */,
84245C651FDC6A120074AFBB /* APIResult.swift */,
84245C681FDC6A1E0074AFBB /* APIResultParser.swift */,
84245C6B1FDC6A6D0074AFBB /* APIAction.swift */,
);
name = WebServices;
path = RSWeb/WebServices;
sourceTree = "<group>";
};
842ED2D41E11FE8B000CF738 /* Constants */ = { 842ED2D41E11FE8B000CF738 /* Constants */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
@ -123,6 +158,8 @@
842ED30A1E12FBD8000CF738 /* URL+RSWeb.swift */, 842ED30A1E12FBD8000CF738 /* URL+RSWeb.swift */,
842ED3131E12FBE7000CF738 /* MimeType.swift */, 842ED3131E12FBE7000CF738 /* MimeType.swift */,
842ED3101E12FBE1000CF738 /* MacWebBrowser.swift */, 842ED3101E12FBE1000CF738 /* MacWebBrowser.swift */,
84245C5C1FDC697A0074AFBB /* Credentials.swift */,
84245C581FDC690A0074AFBB /* WebServices */,
849C08B81E0CAC85006B03FA /* RSWeb */, 849C08B81E0CAC85006B03FA /* RSWeb */,
849C08C31E0CAC86006B03FA /* RSWebTests */, 849C08C31E0CAC86006B03FA /* RSWebTests */,
849C08D61E0CACA3006B03FA /* RSWebiOS */, 849C08D61E0CACA3006B03FA /* RSWebiOS */,
@ -332,6 +369,7 @@
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
84245C5A1FDC690A0074AFBB /* WebServiceProvider.swift in Sources */,
842ED2F01E12FB9B000CF738 /* HTTPResponseHeader.swift in Sources */, 842ED2F01E12FB9B000CF738 /* HTTPResponseHeader.swift in Sources */,
842ED2FF1E12FBC1000CF738 /* UserAgent.swift in Sources */, 842ED2FF1E12FBC1000CF738 /* UserAgent.swift in Sources */,
842ED2FC1E12FBBB000CF738 /* DownloadObject.swift in Sources */, 842ED2FC1E12FBBB000CF738 /* DownloadObject.swift in Sources */,
@ -339,14 +377,20 @@
842ED2F61E12FBAF000CF738 /* OneShotDownload.swift in Sources */, 842ED2F61E12FBAF000CF738 /* OneShotDownload.swift in Sources */,
842ED2F31E12FBAA000CF738 /* DownloadSession.swift in Sources */, 842ED2F31E12FBAA000CF738 /* DownloadSession.swift in Sources */,
842ED3081E12FBD2000CF738 /* URLRequest+RSWeb.swift in Sources */, 842ED3081E12FBD2000CF738 /* URLRequest+RSWeb.swift in Sources */,
84245C691FDC6A1E0074AFBB /* APIResultParser.swift in Sources */,
842ED3051E12FBCC000CF738 /* NSMutableURLRequest+RSWeb.swift in Sources */, 842ED3051E12FBCC000CF738 /* NSMutableURLRequest+RSWeb.swift in Sources */,
842ED2E71E12FB8A000CF738 /* HTTPRequestHeader.swift in Sources */, 842ED2E71E12FB8A000CF738 /* HTTPRequestHeader.swift in Sources */,
842ED3111E12FBE1000CF738 /* MacWebBrowser.swift in Sources */, 842ED3111E12FBE1000CF738 /* MacWebBrowser.swift in Sources */,
842ED3141E12FBE7000CF738 /* MimeType.swift in Sources */, 842ED3141E12FBE7000CF738 /* MimeType.swift in Sources */,
84245C661FDC6A130074AFBB /* APIResult.swift in Sources */,
84245C5D1FDC697A0074AFBB /* Credentials.swift in Sources */,
84245C601FDC69F20074AFBB /* APICall.swift in Sources */,
842ED30B1E12FBD8000CF738 /* URL+RSWeb.swift in Sources */, 842ED30B1E12FBD8000CF738 /* URL+RSWeb.swift in Sources */,
842ED2F91E12FBB5000CF738 /* DownloadProgress.swift in Sources */, 842ED2F91E12FBB5000CF738 /* DownloadProgress.swift in Sources */,
84245C6C1FDC6A6D0074AFBB /* APIAction.swift in Sources */,
842ED2EA1E12FB91000CF738 /* HTTPMethod.swift in Sources */, 842ED2EA1E12FB91000CF738 /* HTTPMethod.swift in Sources */,
842ED3021E12FBC7000CF738 /* HTTPConditionalGetInfo.swift in Sources */, 842ED3021E12FBC7000CF738 /* HTTPConditionalGetInfo.swift in Sources */,
84245C631FDC6A060074AFBB /* APIRequest.swift in Sources */,
842ED2ED1E12FB97000CF738 /* HTTPResponseCode.swift in Sources */, 842ED2ED1E12FB97000CF738 /* HTTPResponseCode.swift in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
@ -367,15 +411,22 @@
842ED2F71E12FBAF000CF738 /* OneShotDownload.swift in Sources */, 842ED2F71E12FBAF000CF738 /* OneShotDownload.swift in Sources */,
842ED30F1E12FBDD000CF738 /* URLResponse+RSWeb.swift in Sources */, 842ED30F1E12FBDD000CF738 /* URLResponse+RSWeb.swift in Sources */,
842ED2E81E12FB8A000CF738 /* HTTPRequestHeader.swift in Sources */, 842ED2E81E12FB8A000CF738 /* HTTPRequestHeader.swift in Sources */,
84245C6D1FDC6A6D0074AFBB /* APIAction.swift in Sources */,
842ED3001E12FBC1000CF738 /* UserAgent.swift in Sources */, 842ED3001E12FBC1000CF738 /* UserAgent.swift in Sources */,
842ED2FA1E12FBB5000CF738 /* DownloadProgress.swift in Sources */, 842ED2FA1E12FBB5000CF738 /* DownloadProgress.swift in Sources */,
84245C641FDC6A060074AFBB /* APIRequest.swift in Sources */,
842ED2EB1E12FB91000CF738 /* HTTPMethod.swift in Sources */, 842ED2EB1E12FB91000CF738 /* HTTPMethod.swift in Sources */,
842ED2F11E12FB9B000CF738 /* HTTPResponseHeader.swift in Sources */, 842ED2F11E12FB9B000CF738 /* HTTPResponseHeader.swift in Sources */,
84245C611FDC69F20074AFBB /* APICall.swift in Sources */,
84245C6A1FDC6A1E0074AFBB /* APIResultParser.swift in Sources */,
842ED3061E12FBCC000CF738 /* NSMutableURLRequest+RSWeb.swift in Sources */, 842ED3061E12FBCC000CF738 /* NSMutableURLRequest+RSWeb.swift in Sources */,
84245C671FDC6A130074AFBB /* APIResult.swift in Sources */,
842ED2F41E12FBAA000CF738 /* DownloadSession.swift in Sources */, 842ED2F41E12FBAA000CF738 /* DownloadSession.swift in Sources */,
84245C5E1FDC697A0074AFBB /* Credentials.swift in Sources */,
842ED2EE1E12FB97000CF738 /* HTTPResponseCode.swift in Sources */, 842ED2EE1E12FB97000CF738 /* HTTPResponseCode.swift in Sources */,
842ED30C1E12FBD8000CF738 /* URL+RSWeb.swift in Sources */, 842ED30C1E12FBD8000CF738 /* URL+RSWeb.swift in Sources */,
842ED3151E12FBE7000CF738 /* MimeType.swift in Sources */, 842ED3151E12FBE7000CF738 /* MimeType.swift in Sources */,
84245C5B1FDC690A0074AFBB /* WebServiceProvider.swift in Sources */,
842ED3031E12FBC7000CF738 /* HTTPConditionalGetInfo.swift in Sources */, 842ED3031E12FBC7000CF738 /* HTTPConditionalGetInfo.swift in Sources */,
842ED2FD1E12FBBB000CF738 /* DownloadObject.swift in Sources */, 842ED2FD1E12FBBB000CF738 /* DownloadObject.swift in Sources */,
); );

View File

@ -0,0 +1,16 @@
//
// Credentials.swift
// RSWeb
//
// Created by Brent Simmons on 12/9/17.
// Copyright © 2017 Ranchero Software. All rights reserved.
//
import Foundation
public protocol Credentials {
var username: String? { get set }
var password: String? { get set }
}

View File

@ -0,0 +1,9 @@
//
// APIAction.swift
// RSWeb
//
// Created by Brent Simmons on 12/9/17.
// Copyright © 2017 Ranchero Software. All rights reserved.
//
import Foundation

View File

@ -0,0 +1,9 @@
//
// APICall.swift
// RSWeb
//
// Created by Brent Simmons on 12/9/17.
// Copyright © 2017 Ranchero Software. All rights reserved.
//
import Foundation

View File

@ -0,0 +1,9 @@
//
// APIRequest.swift
// RSWeb
//
// Created by Brent Simmons on 12/9/17.
// Copyright © 2017 Ranchero Software. All rights reserved.
//
import Foundation

View File

@ -0,0 +1,13 @@
//
// APIResult.swift
// RSWeb
//
// Created by Brent Simmons on 12/9/17.
// Copyright © 2017 Ranchero Software. All rights reserved.
//
import Foundation
public protocol APIResult {
}

View File

@ -0,0 +1,14 @@
//
// APIResultParser.swift
// RSWeb
//
// Created by Brent Simmons on 12/9/17.
// Copyright © 2017 Ranchero Software. All rights reserved.
//
import Foundation
public protocol APIResultParser {
func parsedObject(with: APIResult) -> Any?
}

View File

@ -0,0 +1,15 @@
//
// WebServiceProvider.swift
// RSWeb
//
// Created by Brent Simmons on 12/9/17.
// Copyright © 2017 Ranchero Software. All rights reserved.
//
import Foundation
public protocol WebServiceProvider {
}