= []
33 |
34 | init() {
35 | $result
36 | .compactMap { $0 }
37 | .map {
38 | if case .success = $0 {
39 | return "Successful!"
40 | } else {
41 | return "Failed!"
42 | }
43 | }
44 | .assign(to: \.message, on: self)
45 | .store(in: &storage)
46 | }
47 |
48 | func performRequest() {
49 | AF.request("https://httpbin.org/get").responseDecodable(of: HTTPBinResponse.self) { response in
50 | self.result = response.result
51 | }
52 | }
53 | }
54 |
55 | struct HTTPBinResponse: Decodable {
56 | let url: String
57 | }
58 |
--------------------------------------------------------------------------------
/Carthage/Checkouts/Alamofire/docs/js/jazzy.search.js:
--------------------------------------------------------------------------------
1 | $(function(){
2 | var $typeahead = $('[data-typeahead]');
3 | var $form = $typeahead.parents('form');
4 | var searchURL = $form.attr('action');
5 |
6 | function displayTemplate(result) {
7 | return result.name;
8 | }
9 |
10 | function suggestionTemplate(result) {
11 | var t = '';
12 | t += '' + result.name + '';
13 | if (result.parent_name) {
14 | t += '' + result.parent_name + '';
15 | }
16 | t += '
';
17 | return t;
18 | }
19 |
20 | $typeahead.one('focus', function() {
21 | $form.addClass('loading');
22 |
23 | $.getJSON(searchURL).then(function(searchData) {
24 | const searchIndex = lunr(function() {
25 | this.ref('url');
26 | this.field('name');
27 | this.field('abstract');
28 | for (const [url, doc] of Object.entries(searchData)) {
29 | this.add({url: url, name: doc.name, abstract: doc.abstract});
30 | }
31 | });
32 |
33 | $typeahead.typeahead(
34 | {
35 | highlight: true,
36 | minLength: 3,
37 | autoselect: true
38 | },
39 | {
40 | limit: 10,
41 | display: displayTemplate,
42 | templates: { suggestion: suggestionTemplate },
43 | source: function(query, sync) {
44 | const lcSearch = query.toLowerCase();
45 | const results = searchIndex.query(function(q) {
46 | q.term(lcSearch, { boost: 100 });
47 | q.term(lcSearch, {
48 | boost: 10,
49 | wildcard: lunr.Query.wildcard.TRAILING
50 | });
51 | }).map(function(result) {
52 | var doc = searchData[result.ref];
53 | doc.url = result.ref;
54 | return doc;
55 | });
56 | sync(results);
57 | }
58 | }
59 | );
60 | $form.removeClass('loading');
61 | $typeahead.trigger('focus');
62 | });
63 | });
64 |
65 | var baseURL = searchURL.slice(0, -"search.json".length);
66 |
67 | $typeahead.on('typeahead:select', function(e, result) {
68 | window.location = baseURL + result.url;
69 | });
70 | });
71 |
--------------------------------------------------------------------------------
/AlamofireURLCacheDemo/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // AlamofireURLCacheDemo
4 | //
5 | // Created by Kenshin Cui on 2017/5/23.
6 | // Copyright © 2017年 CMJStudio. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 |
14 | var window: UIWindow?
15 |
16 |
17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
18 | // Override point for customization after application launch.
19 | return true
20 | }
21 |
22 | func applicationWillResignActive(_ application: UIApplication) {
23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
24 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
25 | }
26 |
27 | func applicationDidEnterBackground(_ application: UIApplication) {
28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
30 | }
31 |
32 | func applicationWillEnterForeground(_ application: UIApplication) {
33 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
34 | }
35 |
36 | func applicationDidBecomeActive(_ application: UIApplication) {
37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
38 | }
39 |
40 | func applicationWillTerminate(_ application: UIApplication) {
41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
42 | }
43 |
44 |
45 | }
46 |
47 |
--------------------------------------------------------------------------------
/Carthage/Checkouts/Alamofire/docs/docsets/Alamofire.docset/Contents/Resources/Documents/js/jazzy.search.js:
--------------------------------------------------------------------------------
1 | $(function(){
2 | var $typeahead = $('[data-typeahead]');
3 | var $form = $typeahead.parents('form');
4 | var searchURL = $form.attr('action');
5 |
6 | function displayTemplate(result) {
7 | return result.name;
8 | }
9 |
10 | function suggestionTemplate(result) {
11 | var t = '';
12 | t += '' + result.name + '';
13 | if (result.parent_name) {
14 | t += '' + result.parent_name + '';
15 | }
16 | t += '
';
17 | return t;
18 | }
19 |
20 | $typeahead.one('focus', function() {
21 | $form.addClass('loading');
22 |
23 | $.getJSON(searchURL).then(function(searchData) {
24 | const searchIndex = lunr(function() {
25 | this.ref('url');
26 | this.field('name');
27 | this.field('abstract');
28 | for (const [url, doc] of Object.entries(searchData)) {
29 | this.add({url: url, name: doc.name, abstract: doc.abstract});
30 | }
31 | });
32 |
33 | $typeahead.typeahead(
34 | {
35 | highlight: true,
36 | minLength: 3,
37 | autoselect: true
38 | },
39 | {
40 | limit: 10,
41 | display: displayTemplate,
42 | templates: { suggestion: suggestionTemplate },
43 | source: function(query, sync) {
44 | const lcSearch = query.toLowerCase();
45 | const results = searchIndex.query(function(q) {
46 | q.term(lcSearch, { boost: 100 });
47 | q.term(lcSearch, {
48 | boost: 10,
49 | wildcard: lunr.Query.wildcard.TRAILING
50 | });
51 | }).map(function(result) {
52 | var doc = searchData[result.ref];
53 | doc.url = result.ref;
54 | return doc;
55 | });
56 | sync(results);
57 | }
58 | }
59 | );
60 | $form.removeClass('loading');
61 | $typeahead.trigger('focus');
62 | });
63 | });
64 |
65 | var baseURL = searchURL.slice(0, -"search.json".length);
66 |
67 | $typeahead.on('typeahead:select', function(e, result) {
68 | window.location = baseURL + result.url;
69 | });
70 | });
71 |
--------------------------------------------------------------------------------
/Pods/Alamofire/Source/StringEncoding+Alamofire.swift:
--------------------------------------------------------------------------------
1 | //
2 | // StringEncoding+Alamofire.swift
3 | //
4 | // Copyright (c) 2020 Alamofire Software Foundation (http://alamofire.org/)
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 | //
24 |
25 | import Foundation
26 |
27 | extension String.Encoding {
28 | /// Creates an encoding from the IANA charset name.
29 | ///
30 | /// - Notes: These mappings match those [provided by CoreFoundation](https://opensource.apple.com/source/CF/CF-476.18/CFStringUtilities.c.auto.html)
31 | ///
32 | /// - Parameter name: IANA charset name.
33 | init?(ianaCharsetName name: String) {
34 | switch name.lowercased() {
35 | case "utf-8":
36 | self = .utf8
37 | case "iso-8859-1":
38 | self = .isoLatin1
39 | case "unicode-1-1", "iso-10646-ucs-2", "utf-16":
40 | self = .utf16
41 | case "utf-16be":
42 | self = .utf16BigEndian
43 | case "utf-16le":
44 | self = .utf16LittleEndian
45 | case "utf-32":
46 | self = .utf32
47 | case "utf-32be":
48 | self = .utf32BigEndian
49 | case "utf-32le":
50 | self = .utf32LittleEndian
51 | default:
52 | return nil
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/Carthage/Checkouts/Alamofire/Source/StringEncoding+Alamofire.swift:
--------------------------------------------------------------------------------
1 | //
2 | // StringEncoding+Alamofire.swift
3 | //
4 | // Copyright (c) 2020 Alamofire Software Foundation (http://alamofire.org/)
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 | //
24 |
25 | import Foundation
26 |
27 | extension String.Encoding {
28 | /// Creates an encoding from the IANA charset name.
29 | ///
30 | /// - Notes: These mappings match those [provided by CoreFoundation](https://opensource.apple.com/source/CF/CF-476.18/CFStringUtilities.c.auto.html)
31 | ///
32 | /// - Parameter name: IANA charset name.
33 | init?(ianaCharsetName name: String) {
34 | switch name.lowercased() {
35 | case "utf-8":
36 | self = .utf8
37 | case "iso-8859-1":
38 | self = .isoLatin1
39 | case "unicode-1-1", "iso-10646-ucs-2", "utf-16":
40 | self = .utf16
41 | case "utf-16be":
42 | self = .utf16BigEndian
43 | case "utf-16le":
44 | self = .utf16LittleEndian
45 | case "utf-32":
46 | self = .utf32
47 | case "utf-32be":
48 | self = .utf32BigEndian
49 | case "utf-32le":
50 | self = .utf32LittleEndian
51 | default:
52 | return nil
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-AlamofireURLCacheDemo/Pods-AlamofireURLCacheDemo-acknowledgements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreferenceSpecifiers
6 |
7 |
8 | FooterText
9 | This application makes use of the following third party libraries:
10 | Title
11 | Acknowledgements
12 | Type
13 | PSGroupSpecifier
14 |
15 |
16 | FooterText
17 | Copyright (c) 2014-2020 Alamofire Software Foundation (http://alamofire.org/)
18 |
19 | Permission is hereby granted, free of charge, to any person obtaining a copy
20 | of this software and associated documentation files (the "Software"), to deal
21 | in the Software without restriction, including without limitation the rights
22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
23 | copies of the Software, and to permit persons to whom the Software is
24 | furnished to do so, subject to the following conditions:
25 |
26 | The above copyright notice and this permission notice shall be included in
27 | all copies or substantial portions of the Software.
28 |
29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
35 | THE SOFTWARE.
36 |
37 | License
38 | MIT
39 | Title
40 | Alamofire
41 | Type
42 | PSGroupSpecifier
43 |
44 |
45 | FooterText
46 | Generated by CocoaPods - https://cocoapods.org
47 | Title
48 |
49 | Type
50 | PSGroupSpecifier
51 |
52 |
53 | StringsTable
54 | Acknowledgements
55 | Title
56 | Acknowledgements
57 |
58 |
59 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-AlamofireURLCache-AlamofireURLCacheTests/Pods-AlamofireURLCache-AlamofireURLCacheTests-acknowledgements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreferenceSpecifiers
6 |
7 |
8 | FooterText
9 | This application makes use of the following third party libraries:
10 | Title
11 | Acknowledgements
12 | Type
13 | PSGroupSpecifier
14 |
15 |
16 | FooterText
17 | Copyright (c) 2014-2020 Alamofire Software Foundation (http://alamofire.org/)
18 |
19 | Permission is hereby granted, free of charge, to any person obtaining a copy
20 | of this software and associated documentation files (the "Software"), to deal
21 | in the Software without restriction, including without limitation the rights
22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
23 | copies of the Software, and to permit persons to whom the Software is
24 | furnished to do so, subject to the following conditions:
25 |
26 | The above copyright notice and this permission notice shall be included in
27 | all copies or substantial portions of the Software.
28 |
29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
35 | THE SOFTWARE.
36 |
37 | License
38 | MIT
39 | Title
40 | Alamofire
41 | Type
42 | PSGroupSpecifier
43 |
44 |
45 | FooterText
46 | Generated by CocoaPods - https://cocoapods.org
47 | Title
48 |
49 | Type
50 | PSGroupSpecifier
51 |
52 |
53 | StringsTable
54 | Acknowledgements
55 | Title
56 | Acknowledgements
57 |
58 |
59 |
--------------------------------------------------------------------------------
/Pods/Alamofire/Source/HTTPMethod.swift:
--------------------------------------------------------------------------------
1 | //
2 | // HTTPMethod.swift
3 | //
4 | // Copyright (c) 2014-2018 Alamofire Software Foundation (http://alamofire.org/)
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 | //
24 |
25 | /// Type representing HTTP methods. Raw `String` value is stored and compared case-sensitively, so
26 | /// `HTTPMethod.get != HTTPMethod(rawValue: "get")`.
27 | ///
28 | /// See https://tools.ietf.org/html/rfc7231#section-4.3
29 | public struct HTTPMethod: RawRepresentable, Equatable, Hashable {
30 | /// `CONNECT` method.
31 | public static let connect = HTTPMethod(rawValue: "CONNECT")
32 | /// `DELETE` method.
33 | public static let delete = HTTPMethod(rawValue: "DELETE")
34 | /// `GET` method.
35 | public static let get = HTTPMethod(rawValue: "GET")
36 | /// `HEAD` method.
37 | public static let head = HTTPMethod(rawValue: "HEAD")
38 | /// `OPTIONS` method.
39 | public static let options = HTTPMethod(rawValue: "OPTIONS")
40 | /// `PATCH` method.
41 | public static let patch = HTTPMethod(rawValue: "PATCH")
42 | /// `POST` method.
43 | public static let post = HTTPMethod(rawValue: "POST")
44 | /// `PUT` method.
45 | public static let put = HTTPMethod(rawValue: "PUT")
46 | /// `TRACE` method.
47 | public static let trace = HTTPMethod(rawValue: "TRACE")
48 |
49 | public let rawValue: String
50 |
51 | public init(rawValue: String) {
52 | self.rawValue = rawValue
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/Carthage/Checkouts/Alamofire/Source/HTTPMethod.swift:
--------------------------------------------------------------------------------
1 | //
2 | // HTTPMethod.swift
3 | //
4 | // Copyright (c) 2014-2018 Alamofire Software Foundation (http://alamofire.org/)
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 | //
24 |
25 | /// Type representing HTTP methods. Raw `String` value is stored and compared case-sensitively, so
26 | /// `HTTPMethod.get != HTTPMethod(rawValue: "get")`.
27 | ///
28 | /// See https://tools.ietf.org/html/rfc7231#section-4.3
29 | public struct HTTPMethod: RawRepresentable, Equatable, Hashable {
30 | /// `CONNECT` method.
31 | public static let connect = HTTPMethod(rawValue: "CONNECT")
32 | /// `DELETE` method.
33 | public static let delete = HTTPMethod(rawValue: "DELETE")
34 | /// `GET` method.
35 | public static let get = HTTPMethod(rawValue: "GET")
36 | /// `HEAD` method.
37 | public static let head = HTTPMethod(rawValue: "HEAD")
38 | /// `OPTIONS` method.
39 | public static let options = HTTPMethod(rawValue: "OPTIONS")
40 | /// `PATCH` method.
41 | public static let patch = HTTPMethod(rawValue: "PATCH")
42 | /// `POST` method.
43 | public static let post = HTTPMethod(rawValue: "POST")
44 | /// `PUT` method.
45 | public static let put = HTTPMethod(rawValue: "PUT")
46 | /// `TRACE` method.
47 | public static let trace = HTTPMethod(rawValue: "TRACE")
48 |
49 | public let rawValue: String
50 |
51 | public init(rawValue: String) {
52 | self.rawValue = rawValue
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/Pods/Alamofire/Source/AlamofireExtended.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AlamofireExtended.swift
3 | //
4 | // Copyright (c) 2019 Alamofire Software Foundation (http://alamofire.org/)
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 | //
24 |
25 | /// Type that acts as a generic extension point for all `AlamofireExtended` types.
26 | public struct AlamofireExtension {
27 | /// Stores the type or meta-type of any extended type.
28 | public private(set) var type: ExtendedType
29 |
30 | /// Create an instance from the provided value.
31 | ///
32 | /// - Parameter type: Instance being extended.
33 | public init(_ type: ExtendedType) {
34 | self.type = type
35 | }
36 | }
37 |
38 | /// Protocol describing the `af` extension points for Alamofire extended types.
39 | public protocol AlamofireExtended {
40 | /// Type being extended.
41 | associatedtype ExtendedType
42 |
43 | /// Static Alamofire extension point.
44 | static var af: AlamofireExtension.Type { get set }
45 | /// Instance Alamofire extension point.
46 | var af: AlamofireExtension { get set }
47 | }
48 |
49 | public extension AlamofireExtended {
50 | /// Static Alamofire extension point.
51 | static var af: AlamofireExtension.Type {
52 | get { AlamofireExtension.self }
53 | set {}
54 | }
55 |
56 | /// Instance Alamofire extension point.
57 | var af: AlamofireExtension {
58 | get { AlamofireExtension(self) }
59 | set {}
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/Carthage/Checkouts/Alamofire/Source/AlamofireExtended.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AlamofireExtended.swift
3 | //
4 | // Copyright (c) 2019 Alamofire Software Foundation (http://alamofire.org/)
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 | //
24 |
25 | /// Type that acts as a generic extension point for all `AlamofireExtended` types.
26 | public struct AlamofireExtension {
27 | /// Stores the type or meta-type of any extended type.
28 | public private(set) var type: ExtendedType
29 |
30 | /// Create an instance from the provided value.
31 | ///
32 | /// - Parameter type: Instance being extended.
33 | public init(_ type: ExtendedType) {
34 | self.type = type
35 | }
36 | }
37 |
38 | /// Protocol describing the `af` extension points for Alamofire extended types.
39 | public protocol AlamofireExtended {
40 | /// Type being extended.
41 | associatedtype ExtendedType
42 |
43 | /// Static Alamofire extension point.
44 | static var af: AlamofireExtension.Type { get set }
45 | /// Instance Alamofire extension point.
46 | var af: AlamofireExtension { get set }
47 | }
48 |
49 | public extension AlamofireExtended {
50 | /// Static Alamofire extension point.
51 | static var af: AlamofireExtension.Type {
52 | get { AlamofireExtension.self }
53 | set {}
54 | }
55 |
56 | /// Instance Alamofire extension point.
57 | var af: AlamofireExtension {
58 | get { AlamofireExtension(self) }
59 | set {}
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/Carthage/Checkouts/Alamofire/Package.swift:
--------------------------------------------------------------------------------
1 | // swift-tools-version:5.1
2 | //
3 | // Package.swift
4 | //
5 | // Copyright (c) 2014-2018 Alamofire Software Foundation (http://alamofire.org/)
6 | //
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy
8 | // of this software and associated documentation files (the "Software"), to deal
9 | // in the Software without restriction, including without limitation the rights
10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | // copies of the Software, and to permit persons to whom the Software is
12 | // furnished to do so, subject to the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be included in
15 | // all copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | // THE SOFTWARE.
24 | //
25 |
26 | import PackageDescription
27 |
28 | let package = Package(name: "Alamofire",
29 | platforms: [.macOS(.v10_12),
30 | .iOS(.v10),
31 | .tvOS(.v10),
32 | .watchOS(.v3)],
33 | products: [.library(name: "Alamofire",
34 | targets: ["Alamofire"])],
35 | targets: [.target(name: "Alamofire",
36 | path: "Source",
37 | linkerSettings: [.linkedFramework("CFNetwork",
38 | .when(platforms: [.iOS,
39 | .macOS,
40 | .tvOS,
41 | .watchOS]))]),
42 | .testTarget(name: "AlamofireTests",
43 | dependencies: ["Alamofire"],
44 | path: "Tests")],
45 | swiftLanguageVersions: [.v5])
46 |
--------------------------------------------------------------------------------
/Pods/Alamofire/Source/OperationQueue+Alamofire.swift:
--------------------------------------------------------------------------------
1 | //
2 | // OperationQueue+Alamofire.swift
3 | //
4 | // Copyright (c) 2014-2018 Alamofire Software Foundation (http://alamofire.org/)
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 | //
24 |
25 | import Foundation
26 |
27 | extension OperationQueue {
28 | /// Creates an instance using the provided parameters.
29 | ///
30 | /// - Parameters:
31 | /// - qualityOfService: `QualityOfService` to be applied to the queue. `.default` by default.
32 | /// - maxConcurrentOperationCount: Maximum concurrent operations.
33 | /// `OperationQueue.defaultMaxConcurrentOperationCount` by default.
34 | /// - underlyingQueue: Underlying `DispatchQueue`. `nil` by default.
35 | /// - name: Name for the queue. `nil` by default.
36 | /// - startSuspended: Whether the queue starts suspended. `false` by default.
37 | convenience init(qualityOfService: QualityOfService = .default,
38 | maxConcurrentOperationCount: Int = OperationQueue.defaultMaxConcurrentOperationCount,
39 | underlyingQueue: DispatchQueue? = nil,
40 | name: String? = nil,
41 | startSuspended: Bool = false) {
42 | self.init()
43 | self.qualityOfService = qualityOfService
44 | self.maxConcurrentOperationCount = maxConcurrentOperationCount
45 | self.underlyingQueue = underlyingQueue
46 | self.name = name
47 | isSuspended = startSuspended
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/Carthage/Checkouts/Alamofire/Tests/BaseTestCase.swift:
--------------------------------------------------------------------------------
1 | //
2 | // BaseTestCase.swift
3 | //
4 | // Copyright (c) 2014-2018 Alamofire Software Foundation (http://alamofire.org/)
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 | //
24 |
25 | import Alamofire
26 | import Foundation
27 | import XCTest
28 |
29 | class BaseTestCase: XCTestCase {
30 | let timeout: TimeInterval = 10
31 |
32 | static var testDirectoryURL: URL { FileManager.temporaryDirectoryURL.appendingPathComponent("org.alamofire.tests") }
33 | var testDirectoryURL: URL { BaseTestCase.testDirectoryURL }
34 |
35 | override func setUp() {
36 | super.setUp()
37 |
38 | FileManager.removeAllItemsInsideDirectory(at: testDirectoryURL)
39 | FileManager.createDirectory(at: testDirectoryURL)
40 | }
41 |
42 | func url(forResource fileName: String, withExtension ext: String) -> URL {
43 | let bundle = Bundle(for: BaseTestCase.self)
44 | return bundle.url(forResource: fileName, withExtension: ext)!
45 | }
46 |
47 | /// Runs assertions on a particular `DispatchQueue`.
48 | ///
49 | /// - Parameters:
50 | /// - queue: The `DispatchQueue` on which to run the assertions.
51 | /// - assertions: Closure containing assertions to run
52 | func assert(on queue: DispatchQueue, assertions: @escaping () -> Void) {
53 | let expect = expectation(description: "all assertions are complete")
54 |
55 | queue.async {
56 | assertions()
57 | expect.fulfill()
58 | }
59 |
60 | waitForExpectations(timeout: timeout)
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/Carthage/Checkouts/Alamofire/Source/OperationQueue+Alamofire.swift:
--------------------------------------------------------------------------------
1 | //
2 | // OperationQueue+Alamofire.swift
3 | //
4 | // Copyright (c) 2014-2018 Alamofire Software Foundation (http://alamofire.org/)
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 | //
24 |
25 | import Foundation
26 |
27 | extension OperationQueue {
28 | /// Creates an instance using the provided parameters.
29 | ///
30 | /// - Parameters:
31 | /// - qualityOfService: `QualityOfService` to be applied to the queue. `.default` by default.
32 | /// - maxConcurrentOperationCount: Maximum concurrent operations.
33 | /// `OperationQueue.defaultMaxConcurrentOperationCount` by default.
34 | /// - underlyingQueue: Underlying `DispatchQueue`. `nil` by default.
35 | /// - name: Name for the queue. `nil` by default.
36 | /// - startSuspended: Whether the queue starts suspended. `false` by default.
37 | convenience init(qualityOfService: QualityOfService = .default,
38 | maxConcurrentOperationCount: Int = OperationQueue.defaultMaxConcurrentOperationCount,
39 | underlyingQueue: DispatchQueue? = nil,
40 | name: String? = nil,
41 | startSuspended: Bool = false) {
42 | self.init()
43 | self.qualityOfService = qualityOfService
44 | self.maxConcurrentOperationCount = maxConcurrentOperationCount
45 | self.underlyingQueue = underlyingQueue
46 | self.name = name
47 | isSuspended = startSuspended
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/Carthage/Checkouts/Alamofire/Example/Source/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | //
4 | // Copyright (c) 2014-2018 Alamofire Software Foundation (http://alamofire.org/)
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 | //
24 |
25 | import UIKit
26 |
27 | @UIApplicationMain
28 | class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDelegate {
29 | // MARK: - Properties
30 |
31 | var window: UIWindow?
32 |
33 | // MARK: - UIApplicationDelegate
34 |
35 | func application(_ application: UIApplication,
36 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
37 | let splitViewController = window!.rootViewController as! UISplitViewController
38 | let navigationController = splitViewController.viewControllers.last as! UINavigationController
39 | navigationController.topViewController!.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem
40 | splitViewController.delegate = self
41 |
42 | return true
43 | }
44 |
45 | // MARK: - UISplitViewControllerDelegate
46 |
47 | func splitViewController(_ splitViewController: UISplitViewController,
48 | collapseSecondary secondaryViewController: UIViewController,
49 | onto primaryViewController: UIViewController)
50 | -> Bool {
51 | if
52 | let secondaryAsNavController = secondaryViewController as? UINavigationController,
53 | let topAsDetailController = secondaryAsNavController.topViewController as? DetailViewController {
54 | return topAsDetailController.request == nil
55 | }
56 |
57 | return false
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/Carthage/Checkouts/Alamofire/Tests/HTTPBin.swift:
--------------------------------------------------------------------------------
1 | //
2 | // HTTPBin.swift
3 | //
4 | // Copyright (c) 2014-2018 Alamofire Software Foundation (http://alamofire.org/)
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 | //
24 |
25 | import Alamofire
26 | import Foundation
27 |
28 | extension String {
29 | static let httpBinURLString = "https://httpbin.org"
30 | }
31 |
32 | extension URL {
33 | static func makeHTTPBinURL(path: String = "get") -> URL {
34 | let url = URL(string: .httpBinURLString)!
35 | return url.appendingPathComponent(path)
36 | }
37 | }
38 |
39 | extension URLRequest {
40 | static func makeHTTPBinRequest(path: String = "get",
41 | method: HTTPMethod = .get,
42 | headers: HTTPHeaders = .init(),
43 | timeout: TimeInterval = 60,
44 | cachePolicy: URLRequest.CachePolicy = .useProtocolCachePolicy) -> URLRequest {
45 | var request = URLRequest(url: .makeHTTPBinURL(path: path))
46 | request.httpMethod = method.rawValue
47 | request.headers = headers
48 | request.timeoutInterval = timeout
49 | request.cachePolicy = cachePolicy
50 |
51 | return request
52 | }
53 | }
54 |
55 | extension Data {
56 | var asString: String {
57 | String(decoding: self, as: UTF8.self)
58 | }
59 | }
60 |
61 | struct HTTPBinResponse: Decodable {
62 | let headers: [String: String]
63 | let origin: String
64 | let url: String
65 | let data: String?
66 | let form: [String: String]?
67 | let args: [String: String]
68 | }
69 |
70 | struct HTTPBinParameters: Encodable {
71 | static let `default` = HTTPBinParameters(property: "property")
72 |
73 | let property: String
74 | }
75 |
--------------------------------------------------------------------------------
/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire watchOS.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
50 |
51 |
52 |
53 |
59 |
60 |
66 |
67 |
68 |
69 |
71 |
72 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/AlamofireURLCacheDemo.xcodeproj/xcshareddata/xcschemes/AlamofireURLCache.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
50 |
51 |
52 |
53 |
59 |
60 |
66 |
67 |
68 |
69 |
71 |
72 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/Carthage/Checkouts/Alamofire/Alamofire.xcodeproj/xcshareddata/xcschemes/Cleanup Whitespace.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
34 |
35 |
45 |
46 |
52 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
70 |
71 |
72 |
73 |
75 |
76 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/Carthage/Checkouts/Alamofire/Gemfile.lock:
--------------------------------------------------------------------------------
1 | GEM
2 | remote: https://rubygems.org/
3 | specs:
4 | CFPropertyList (3.0.2)
5 | activesupport (4.2.11.3)
6 | i18n (~> 0.7)
7 | minitest (~> 5.1)
8 | thread_safe (~> 0.3, >= 0.3.4)
9 | tzinfo (~> 1.1)
10 | algoliasearch (1.27.3)
11 | httpclient (~> 2.8, >= 2.8.3)
12 | json (>= 1.5.1)
13 | atomos (0.1.3)
14 | claide (1.0.3)
15 | cocoapods (1.9.3)
16 | activesupport (>= 4.0.2, < 5)
17 | claide (>= 1.0.2, < 2.0)
18 | cocoapods-core (= 1.9.3)
19 | cocoapods-deintegrate (>= 1.0.3, < 2.0)
20 | cocoapods-downloader (>= 1.2.2, < 2.0)
21 | cocoapods-plugins (>= 1.0.0, < 2.0)
22 | cocoapods-search (>= 1.0.0, < 2.0)
23 | cocoapods-stats (>= 1.0.0, < 2.0)
24 | cocoapods-trunk (>= 1.4.0, < 2.0)
25 | cocoapods-try (>= 1.1.0, < 2.0)
26 | colored2 (~> 3.1)
27 | escape (~> 0.0.4)
28 | fourflusher (>= 2.3.0, < 3.0)
29 | gh_inspector (~> 1.0)
30 | molinillo (~> 0.6.6)
31 | nap (~> 1.0)
32 | ruby-macho (~> 1.4)
33 | xcodeproj (>= 1.14.0, < 2.0)
34 | cocoapods-core (1.9.3)
35 | activesupport (>= 4.0.2, < 6)
36 | algoliasearch (~> 1.0)
37 | concurrent-ruby (~> 1.1)
38 | fuzzy_match (~> 2.0.4)
39 | nap (~> 1.0)
40 | netrc (~> 0.11)
41 | typhoeus (~> 1.0)
42 | cocoapods-deintegrate (1.0.4)
43 | cocoapods-downloader (1.3.0)
44 | cocoapods-plugins (1.0.0)
45 | nap
46 | cocoapods-search (1.0.0)
47 | cocoapods-stats (1.1.0)
48 | cocoapods-trunk (1.5.0)
49 | nap (>= 0.8, < 2.0)
50 | netrc (~> 0.11)
51 | cocoapods-try (1.2.0)
52 | colored2 (3.1.2)
53 | concurrent-ruby (1.1.6)
54 | escape (0.0.4)
55 | ethon (0.12.0)
56 | ffi (>= 1.3.0)
57 | ffi (1.13.1)
58 | fourflusher (2.3.1)
59 | fuzzy_match (2.0.4)
60 | gh_inspector (1.1.3)
61 | httpclient (2.8.3)
62 | i18n (0.9.5)
63 | concurrent-ruby (~> 1.0)
64 | jazzy (0.13.5)
65 | cocoapods (~> 1.5)
66 | mustache (~> 1.1)
67 | open4
68 | redcarpet (~> 3.4)
69 | rouge (>= 2.0.6, < 4.0)
70 | sassc (~> 2.1)
71 | sqlite3 (~> 1.3)
72 | xcinvoke (~> 0.3.0)
73 | json (2.3.1)
74 | liferaft (0.0.6)
75 | minitest (5.14.1)
76 | molinillo (0.6.6)
77 | mustache (1.1.1)
78 | nanaimo (0.3.0)
79 | nap (1.1.0)
80 | netrc (0.11.0)
81 | open4 (1.3.4)
82 | redcarpet (3.5.0)
83 | rouge (2.0.7)
84 | ruby-macho (1.4.0)
85 | sassc (2.4.0)
86 | ffi (~> 1.9)
87 | sqlite3 (1.4.2)
88 | thread_safe (0.3.6)
89 | typhoeus (1.4.0)
90 | ethon (>= 0.9.0)
91 | tzinfo (1.2.7)
92 | thread_safe (~> 0.1)
93 | xcinvoke (0.3.0)
94 | liferaft (~> 0.0.6)
95 | xcodeproj (1.17.1)
96 | CFPropertyList (>= 2.3.3, < 4.0)
97 | atomos (~> 0.1.3)
98 | claide (>= 1.0.2, < 2.0)
99 | colored2 (~> 3.1)
100 | nanaimo (~> 0.3.0)
101 | xcpretty (0.3.0)
102 | rouge (~> 2.0.7)
103 |
104 | PLATFORMS
105 | ruby
106 |
107 | DEPENDENCIES
108 | cocoapods
109 | jazzy
110 | xcpretty
111 |
112 | BUNDLED WITH
113 | 2.1.4
114 |
--------------------------------------------------------------------------------
/Carthage/Checkouts/Alamofire/Tests/FileManager+AlamofireTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // FileManager+AlamofireTests.swift
3 | //
4 | // Copyright (c) 2014-2018 Alamofire Software Foundation (http://alamofire.org/)
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 | //
24 |
25 | import Foundation
26 |
27 | extension FileManager {
28 | // MARK: - Common Directories
29 |
30 | static var temporaryDirectoryPath: String {
31 | NSTemporaryDirectory()
32 | }
33 |
34 | static var temporaryDirectoryURL: URL {
35 | URL(fileURLWithPath: FileManager.temporaryDirectoryPath, isDirectory: true)
36 | }
37 |
38 | // MARK: - File System Modification
39 |
40 | @discardableResult
41 | static func createDirectory(atPath path: String) -> Bool {
42 | do {
43 | try FileManager.default.createDirectory(atPath: path, withIntermediateDirectories: true, attributes: nil)
44 | return true
45 | } catch {
46 | return false
47 | }
48 | }
49 |
50 | @discardableResult
51 | static func createDirectory(at url: URL) -> Bool {
52 | createDirectory(atPath: url.path)
53 | }
54 |
55 | @discardableResult
56 | static func removeItem(atPath path: String) -> Bool {
57 | do {
58 | try FileManager.default.removeItem(atPath: path)
59 | return true
60 | } catch {
61 | return false
62 | }
63 | }
64 |
65 | @discardableResult
66 | static func removeItem(at url: URL) -> Bool {
67 | removeItem(atPath: url.path)
68 | }
69 |
70 | @discardableResult
71 | static func removeAllItemsInsideDirectory(atPath path: String) -> Bool {
72 | let enumerator = FileManager.default.enumerator(atPath: path)
73 | var result = true
74 |
75 | while let fileName = enumerator?.nextObject() as? String {
76 | let success = removeItem(atPath: path + "/\(fileName)")
77 | if !success { result = false }
78 | }
79 |
80 | return result
81 | }
82 |
83 | @discardableResult
84 | static func removeAllItemsInsideDirectory(at url: URL) -> Bool {
85 | removeAllItemsInsideDirectory(atPath: url.path)
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/Carthage/Checkouts/Alamofire/Tests/LeaksTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // LeaksTests.swift
3 | //
4 | // Copyright (c) 2020 Alamofire Software Foundation (http://alamofire.org/)
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 | //
24 |
25 | import XCTest
26 |
27 | // Only build when built through SPM, as tests run through Xcode don't like this.
28 | // Add LEAKS flag once we figure out a way to automate this.
29 | // Can run by invoking swift test -c debug -Xswiftc -DLEAKS in the Alamofire directory.
30 | // Sample code from the Swift forums: https://forums.swift.org/t/test-for-memory-leaks-in-ci/36526/19
31 | #if SWIFT_PACKAGE && LEAKS && os(macOS)
32 | final class LeaksTests: XCTestCase {
33 | func testForLeaks() {
34 | // Sets up an atexit handler that invokes the leaks tool.
35 | atexit {
36 | @discardableResult
37 | func leaksTo(_ file: String) -> Process {
38 | let out = FileHandle(forWritingAtPath: file)!
39 | defer {
40 | if #available(OSX 10.15, *) {
41 | try! out.close()
42 | } else {
43 | // Fallback on earlier versions
44 | }
45 | }
46 | let process = Process()
47 | process.launchPath = "/usr/bin/leaks"
48 | process.arguments = ["\(getpid())"]
49 | process.standardOutput = out
50 | process.standardError = out
51 | process.launch()
52 | process.waitUntilExit()
53 | return process
54 | }
55 | let process = leaksTo("/dev/null")
56 | guard process.terminationReason == .exit && [0, 1].contains(process.terminationStatus) else {
57 | print("Process terminated: \(process.terminationReason): \(process.terminationStatus)")
58 | exit(255)
59 | }
60 | if process.terminationStatus == 1 {
61 | print("================")
62 | print("Leaks Detected!!!")
63 | leaksTo("/dev/tty")
64 | }
65 | exit(process.terminationStatus)
66 | }
67 | }
68 | }
69 | #endif
70 |
--------------------------------------------------------------------------------
/Carthage/Checkouts/Alamofire/watchOS Example/watchOS Example WatchKit Extension/ExtensionDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ExtensionDelegate.swift
3 | //
4 | // Copyright (c) 2020 Alamofire Software Foundation (http://alamofire.org/)
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 | //
24 |
25 | import WatchKit
26 |
27 | class ExtensionDelegate: NSObject, WKExtensionDelegate {
28 | func handle(_ backgroundTasks: Set) {
29 | // Sent when the system needs to launch the application in the background to process tasks. Tasks arrive in a set, so loop through and process each one.
30 | for task in backgroundTasks {
31 | // Use a switch statement to check the task type
32 | switch task {
33 | case let backgroundTask as WKApplicationRefreshBackgroundTask:
34 | // Be sure to complete the background task once you’re done.
35 | backgroundTask.setTaskCompletedWithSnapshot(false)
36 | case let snapshotTask as WKSnapshotRefreshBackgroundTask:
37 | // Snapshot tasks have a unique completion call, make sure to set your expiration date
38 | snapshotTask.setTaskCompleted(restoredDefaultState: true, estimatedSnapshotExpiration: Date.distantFuture, userInfo: nil)
39 | case let connectivityTask as WKWatchConnectivityRefreshBackgroundTask:
40 | // Be sure to complete the connectivity task once you’re done.
41 | connectivityTask.setTaskCompletedWithSnapshot(false)
42 | case let urlSessionTask as WKURLSessionRefreshBackgroundTask:
43 | // Be sure to complete the URL session task once you’re done.
44 | urlSessionTask.setTaskCompletedWithSnapshot(false)
45 | case let relevantShortcutTask as WKRelevantShortcutRefreshBackgroundTask:
46 | // Be sure to complete the relevant-shortcut task once you're done.
47 | relevantShortcutTask.setTaskCompletedWithSnapshot(false)
48 | case let intentDidRunTask as WKIntentDidRunRefreshBackgroundTask:
49 | // Be sure to complete the intent-did-run task once you're done.
50 | intentDidRunTask.setTaskCompletedWithSnapshot(false)
51 | default:
52 | // make sure to complete unhandled task types
53 | task.setTaskCompletedWithSnapshot(false)
54 | }
55 | }
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/Carthage/Checkouts/Alamofire/.github/workflows/ci.yml:
--------------------------------------------------------------------------------
1 | name: "Alamofire CI"
2 |
3 | on:
4 | push:
5 | branches:
6 | - master
7 | - hotfix
8 | pull_request:
9 | branches:
10 | - '*'
11 |
12 | jobs:
13 | macOS_5_1:
14 | name: Test macOS (5.1)
15 | runs-on: macOS-latest
16 | env:
17 | DEVELOPER_DIR: /Applications/Xcode_11.3.1.app/Contents/Developer
18 | steps:
19 | - uses: actions/checkout@v2
20 | - name: macOS (5.1)
21 | run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire macOS" -destination "platform=macOS" clean test | xcpretty
22 | macOS_5_2:
23 | name: Test macOS (5.2)
24 | runs-on: macOS-latest
25 | env:
26 | DEVELOPER_DIR: /Applications/Xcode_11.5.app/Contents/Developer
27 | steps:
28 | - uses: actions/checkout@v2
29 | - name: macOS (5.2)
30 | run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire macOS" -destination "platform=macOS" clean test | xcpretty
31 | Catalyst:
32 | name: Test Catalyst
33 | runs-on: macOS-latest
34 | env:
35 | DEVELOPER_DIR: /Applications/Xcode_11.5.app/Contents/Developer
36 | steps:
37 | - uses: actions/checkout@v2
38 | - name: Catalyst
39 | run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire iOS" -destination "platform=macOS" clean test | xcpretty
40 | iOS:
41 | name: Test iOS
42 | runs-on: macOS-latest
43 | env:
44 | DEVELOPER_DIR: /Applications/Xcode_11.5.app/Contents/Developer
45 | strategy:
46 | matrix:
47 | destination: ["OS=13.5,name=iPhone 11 Pro"] #, "OS=12.4,name=iPhone XS", "OS=11.4,name=iPhone X", "OS=10.3.1,name=iPhone SE"]
48 | steps:
49 | - uses: actions/checkout@v2
50 | - name: iOS - ${{ matrix.destination }}
51 | run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire iOS" -destination "${{ matrix.destination }}" clean test | xcpretty
52 | tvOS:
53 | name: Test tvOS
54 | runs-on: macOS-latest
55 | env:
56 | DEVELOPER_DIR: /Applications/Xcode_11.5.app/Contents/Developer
57 | strategy:
58 | matrix:
59 | destination: ["OS=13.4,name=Apple TV 4K"] #, "OS=11.4,name=Apple TV 4K", "OS=10.2,name=Apple TV 1080p"]
60 | steps:
61 | - uses: actions/checkout@v2
62 | - name: tvOS - ${{ matrix.destination }}
63 | run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire tvOS" -destination "${{ matrix.destination }}" clean test | xcpretty
64 | watchOS:
65 | name: Build watchOS
66 | runs-on: macOS-latest
67 | env:
68 | DEVELOPER_DIR: /Applications/Xcode_11.5.app/Contents/Developer
69 | strategy:
70 | matrix:
71 | destination: ["OS=6.2.1,name=Apple Watch Series 5 - 44mm"] #, "OS=4.2,name=Apple Watch Series 3 - 42mm", "OS=3.2,name=Apple Watch Series 2 - 42mm"]
72 | steps:
73 | - uses: actions/checkout@v2
74 | - name: watchOS - ${{ matrix.destination }}
75 | run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire watchOS" -destination "${{ matrix.destination }}" clean build | xcpretty
76 | spm:
77 | name: Test with SPM
78 | runs-on: macOS-latest
79 | env:
80 | DEVELOPER_DIR: /Applications/Xcode_11.5.app/Contents/Developer
81 | steps:
82 | - uses: actions/checkout@v2
83 | - name: SPM Test
84 | run: swift test -c debug
85 |
--------------------------------------------------------------------------------
/Carthage/Checkouts/Alamofire/.travis.yml:
--------------------------------------------------------------------------------
1 | os: osx
2 | osx_image: xcode10.1
3 | branches:
4 | only:
5 | - master
6 | cache: bundler
7 | env:
8 | global:
9 | - LC_CTYPE=en_US.UTF-8
10 | - LANG=en_US.UTF-8
11 | - WORKSPACE=Alamofire.xcworkspace
12 | - IOS_FRAMEWORK_SCHEME="Alamofire iOS"
13 | - MACOS_FRAMEWORK_SCHEME="Alamofire macOS"
14 | - TVOS_FRAMEWORK_SCHEME="Alamofire tvOS"
15 | - WATCHOS_FRAMEWORK_SCHEME="Alamofire watchOS"
16 | - EXAMPLE_SCHEME="iOS Example"
17 | matrix:
18 | - DESTINATION="OS=5.1,name=Apple Watch Series 4 - 44mm" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" RUN_TESTS="NO" BUILD_EXAMPLE="NO" POD_LINT="NO"
19 | - DESTINATION="OS=4.2,name=Apple Watch Series 3 - 42mm" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" RUN_TESTS="NO" BUILD_EXAMPLE="NO" POD_LINT="NO"
20 | - DESTINATION="OS=3.2,name=Apple Watch Series 2 - 42mm" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" RUN_TESTS="NO" BUILD_EXAMPLE="NO" POD_LINT="NO"
21 | - DESTINATION="OS=2.2,name=Apple Watch - 42mm" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" RUN_TESTS="NO" BUILD_EXAMPLE="NO" POD_LINT="NO"
22 |
23 | - DESTINATION="OS=12.1,name=iPhone XS" SCHEME="$IOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO"
24 | - DESTINATION="OS=11.4,name=iPhone X" SCHEME="$IOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO"
25 | - DESTINATION="OS=10.3.1,name=iPhone 7 Plus" SCHEME="$IOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO"
26 | - DESTINATION="OS=9.3,name=iPhone 6" SCHEME="$IOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO"
27 | - DESTINATION="OS=8.4,name=iPhone 4S" SCHEME="$IOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO"
28 |
29 | - DESTINATION="OS=12.1,name=Apple TV 4K" SCHEME="$TVOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO"
30 | - DESTINATION="OS=11.4,name=Apple TV 4K" SCHEME="$TVOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO"
31 | - DESTINATION="OS=10.2,name=Apple TV 1080p" SCHEME="$TVOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO"
32 | - DESTINATION="OS=9.2,name=Apple TV 1080p" SCHEME="$TVOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO"
33 |
34 | - DESTINATION="arch=x86_64" SCHEME="$MACOS_FRAMEWORK_SCHEME" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="YES"
35 | script:
36 | - set -o pipefail
37 | - xcodebuild -version
38 | - xcodebuild -showsdks
39 |
40 | # Build Framework in Debug and Run Tests if specified
41 | - if [ $RUN_TESTS == "YES" ]; then
42 | xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO ENABLE_TESTABILITY=YES test | xcpretty;
43 | else
44 | xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty;
45 | fi
46 |
47 | # Build Framework in Release and Run Tests if specified
48 | - if [ $RUN_TESTS == "YES" ]; then
49 | xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -destination "$DESTINATION" -configuration Release ONLY_ACTIVE_ARCH=NO ENABLE_TESTABILITY=YES test | xcpretty;
50 | else
51 | xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -destination "$DESTINATION" -configuration Release ONLY_ACTIVE_ARCH=NO build | xcpretty;
52 | fi
53 |
54 | # Build Example in Debug if specified
55 | - if [ $BUILD_EXAMPLE == "YES" ]; then
56 | xcodebuild -workspace "$WORKSPACE" -scheme "$EXAMPLE_SCHEME" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty;
57 | fi
58 |
59 | # Run `pod lib lint` if specified
60 | - if [ $POD_LINT == "YES" ]; then
61 | pod lib lint;
62 | fi
63 |
--------------------------------------------------------------------------------
/Pods/Alamofire/Source/MultipartUpload.swift:
--------------------------------------------------------------------------------
1 | //
2 | // MultipartUpload.swift
3 | //
4 | // Copyright (c) 2014-2018 Alamofire Software Foundation (http://alamofire.org/)
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 | //
24 |
25 | import Foundation
26 |
27 | /// Internal type which encapsulates a `MultipartFormData` upload.
28 | final class MultipartUpload {
29 | lazy var result = Result { try build() }
30 |
31 | let isInBackgroundSession: Bool
32 | let multipartFormData: MultipartFormData
33 | let encodingMemoryThreshold: UInt64
34 | let request: URLRequestConvertible
35 | let fileManager: FileManager
36 |
37 | init(isInBackgroundSession: Bool,
38 | encodingMemoryThreshold: UInt64,
39 | request: URLRequestConvertible,
40 | multipartFormData: MultipartFormData) {
41 | self.isInBackgroundSession = isInBackgroundSession
42 | self.encodingMemoryThreshold = encodingMemoryThreshold
43 | self.request = request
44 | fileManager = multipartFormData.fileManager
45 | self.multipartFormData = multipartFormData
46 | }
47 |
48 | func build() throws -> (request: URLRequest, uploadable: UploadRequest.Uploadable) {
49 | var urlRequest = try request.asURLRequest()
50 | urlRequest.setValue(multipartFormData.contentType, forHTTPHeaderField: "Content-Type")
51 |
52 | let uploadable: UploadRequest.Uploadable
53 | if multipartFormData.contentLength < encodingMemoryThreshold && !isInBackgroundSession {
54 | let data = try multipartFormData.encode()
55 |
56 | uploadable = .data(data)
57 | } else {
58 | let tempDirectoryURL = fileManager.temporaryDirectory
59 | let directoryURL = tempDirectoryURL.appendingPathComponent("org.alamofire.manager/multipart.form.data")
60 | let fileName = UUID().uuidString
61 | let fileURL = directoryURL.appendingPathComponent(fileName)
62 |
63 | try fileManager.createDirectory(at: directoryURL, withIntermediateDirectories: true, attributes: nil)
64 |
65 | do {
66 | try multipartFormData.writeEncodedData(to: fileURL)
67 | } catch {
68 | // Cleanup after attempted write if it fails.
69 | try? fileManager.removeItem(at: fileURL)
70 | }
71 |
72 | uploadable = .file(fileURL, shouldRemove: true)
73 | }
74 |
75 | return (request: urlRequest, uploadable: uploadable)
76 | }
77 | }
78 |
79 | extension MultipartUpload: UploadConvertible {
80 | func asURLRequest() throws -> URLRequest {
81 | try result.get().request
82 | }
83 |
84 | func createUploadable() throws -> UploadRequest.Uploadable {
85 | try result.get().uploadable
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/Carthage/Checkouts/Alamofire/Source/MultipartUpload.swift:
--------------------------------------------------------------------------------
1 | //
2 | // MultipartUpload.swift
3 | //
4 | // Copyright (c) 2014-2018 Alamofire Software Foundation (http://alamofire.org/)
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining a copy
7 | // of this software and associated documentation files (the "Software"), to deal
8 | // in the Software without restriction, including without limitation the rights
9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | // copies of the Software, and to permit persons to whom the Software is
11 | // furnished to do so, subject to the following conditions:
12 | //
13 | // The above copyright notice and this permission notice shall be included in
14 | // all copies or substantial portions of the Software.
15 | //
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | // THE SOFTWARE.
23 | //
24 |
25 | import Foundation
26 |
27 | /// Internal type which encapsulates a `MultipartFormData` upload.
28 | final class MultipartUpload {
29 | lazy var result = Result { try build() }
30 |
31 | let isInBackgroundSession: Bool
32 | let multipartFormData: MultipartFormData
33 | let encodingMemoryThreshold: UInt64
34 | let request: URLRequestConvertible
35 | let fileManager: FileManager
36 |
37 | init(isInBackgroundSession: Bool,
38 | encodingMemoryThreshold: UInt64,
39 | request: URLRequestConvertible,
40 | multipartFormData: MultipartFormData) {
41 | self.isInBackgroundSession = isInBackgroundSession
42 | self.encodingMemoryThreshold = encodingMemoryThreshold
43 | self.request = request
44 | fileManager = multipartFormData.fileManager
45 | self.multipartFormData = multipartFormData
46 | }
47 |
48 | func build() throws -> (request: URLRequest, uploadable: UploadRequest.Uploadable) {
49 | var urlRequest = try request.asURLRequest()
50 | urlRequest.setValue(multipartFormData.contentType, forHTTPHeaderField: "Content-Type")
51 |
52 | let uploadable: UploadRequest.Uploadable
53 | if multipartFormData.contentLength < encodingMemoryThreshold && !isInBackgroundSession {
54 | let data = try multipartFormData.encode()
55 |
56 | uploadable = .data(data)
57 | } else {
58 | let tempDirectoryURL = fileManager.temporaryDirectory
59 | let directoryURL = tempDirectoryURL.appendingPathComponent("org.alamofire.manager/multipart.form.data")
60 | let fileName = UUID().uuidString
61 | let fileURL = directoryURL.appendingPathComponent(fileName)
62 |
63 | try fileManager.createDirectory(at: directoryURL, withIntermediateDirectories: true, attributes: nil)
64 |
65 | do {
66 | try multipartFormData.writeEncodedData(to: fileURL)
67 | } catch {
68 | // Cleanup after attempted write if it fails.
69 | try? fileManager.removeItem(at: fileURL)
70 | }
71 |
72 | uploadable = .file(fileURL, shouldRemove: true)
73 | }
74 |
75 | return (request: urlRequest, uploadable: uploadable)
76 | }
77 | }
78 |
79 | extension MultipartUpload: UploadConvertible {
80 | func asURLRequest() throws -> URLRequest {
81 | try result.get().request
82 | }
83 |
84 | func createUploadable() throws -> UploadRequest.Uploadable {
85 | try result.get().uploadable
86 | }
87 | }
88 |
--------------------------------------------------------------------------------