From 3bb5d4a3e9eb3bda5addd336dfde24279fd36c0e Mon Sep 17 00:00:00 2001 From: Andrey Frolov Date: Fri, 31 May 2024 16:26:19 +0200 Subject: [PATCH] SPT-1998 fix pr --- NodeKit/NodeKit/CacheNode/ETag/ETagConstants.swift | 4 ++-- .../NodeKit/CacheNode/ETag/URLETagReaderNode.swift | 6 +++--- .../NodeKit/CacheNode/ETag/URLETagSaverNode.swift | 12 ++++++------ NodeKit/NodeKit/CacheNode/FirstCachePolicyNode.swift | 10 +++++----- .../CacheNode/IfServerFailsFromCacheNode.swift | 2 +- .../CacheNode/URLNotModifiedTriggerNode.swift | 2 +- NodeKit/NodeKit/Chains/ChainBuilder.swift | 2 +- NodeKit/NodeKit/Core/Convertion/DTOConvertible.swift | 10 +++++----- .../Extensions/RawMappable+Dictionary.swift | 2 +- NodeKit/NodeKit/Core/Node/Async/AsyncNode.swift | 2 +- .../NodeKit/Core/Node/Async/AsyncStreamNode.swift | 2 +- NodeKit/NodeKit/Core/Node/Node.swift | 2 +- NodeKit/NodeKit/Core/Node/NodeResult.swift | 8 ++++---- .../Encodings/URLJsonRequestEncodingNode.swift | 2 +- .../Layers/DTOProcessingLayer/DTOMapperNode.swift | 2 +- .../Layers/DTOProcessingLayer/RawEncoderNode.swift | 4 ++-- .../Layers/InputProcessingLayer/DTOEncoderNode.swift | 2 +- .../Layers/InputProcessingLayer/ModelInputNode.swift | 4 ++-- .../Layers/InputProcessingLayer/VoidInputNode.swift | 2 +- .../RequestBuildingLayer/MetadataConnectorNode.swift | 4 ++-- .../RequestBuildingLayer/Models/RequestModel.swift | 2 +- .../Models/RoutableRequestModel.swift | 2 +- .../MultipartURLRequestTrasformatorNode.swift | 2 +- .../RequestBuildingLayer/RequestEncoderNode.swift | 4 ++-- .../RequestBuildingLayer/RequestRouterNode.swift | 4 ++-- .../RequestBuildingLayer/URLQueryInjectorNode.swift | 4 ++-- .../URLRequestTrasformatorNode.swift | 2 +- .../MultipartRequestCreatorNode.swift | 2 +- .../RequestProcessingLayer/RequestCreatorNode.swift | 2 +- .../RequestProcessingLayer/RequestSenderNode.swift | 4 ++-- .../Models/URLProcessedResponse.swift | 2 +- .../DataLoading/DataLoadingResponseProcessor.swift | 4 ++-- .../Models/URLDataResponse.swift | 2 +- .../ResponseDataParserNode.swift | 2 +- .../ResponseDataPreprocessorNode.swift | 2 +- .../ResponseHttpErrorProcessorNode.swift | 2 +- .../ResponseProcessorNode.swift | 2 +- .../TrasportLayer/TechnicaErrorMapperNode.swift | 2 +- .../Layers/Utils/AccessSafe/AccessSafeNode.swift | 4 ++-- .../NodeKit/Layers/Utils/HeaderInjectorNode.swift | 2 +- .../NodeKit/Layers/Utils/RequestAborterNode.swift | 2 +- NodeKit/NodeKit/Utils/Logging/LoggerNode.swift | 2 +- NodeKit/NodeKit/Utils/Logging/LoggerStreamNode.swift | 2 +- TechDocs/Chains.md | 2 +- TechDocs/MainConcept.md | 1 + 45 files changed, 73 insertions(+), 72 deletions(-) diff --git a/NodeKit/NodeKit/CacheNode/ETag/ETagConstants.swift b/NodeKit/NodeKit/CacheNode/ETag/ETagConstants.swift index 64aab329..3c146ff0 100644 --- a/NodeKit/NodeKit/CacheNode/ETag/ETagConstants.swift +++ b/NodeKit/NodeKit/CacheNode/ETag/ETagConstants.swift @@ -12,7 +12,7 @@ import Foundation /// These constants are described in accordance with RFC and AppleDeveloper. public enum ETagConstants { - /// In the **response** headers, the eTag token should be placed under **this** key. + /// There should be the eTag token under **this** key in the **response** headers. /// /// - SeeAlso: /// - [AppleDeveloper](https://developer.apple.com/documentation/foundation/httpurlresponse/1417930-allheaderfields) @@ -21,7 +21,7 @@ public enum ETagConstants { return "Etag" } - /// In the **request** headers, the eTag token should be placed under **this** key. + /// /// There should be the eTag token under **this** key in the **response** headers. /// /// - SeeAlso: [RFC-7232](https://tools.ietf.org/html/rfc7232#section-3.2) /// diff --git a/NodeKit/NodeKit/CacheNode/ETag/URLETagReaderNode.swift b/NodeKit/NodeKit/CacheNode/ETag/URLETagReaderNode.swift index ab5c5ec7..d59f874c 100644 --- a/NodeKit/NodeKit/CacheNode/ETag/URLETagReaderNode.swift +++ b/NodeKit/NodeKit/CacheNode/ETag/URLETagReaderNode.swift @@ -15,14 +15,14 @@ open class URLETagReaderNode: AsyncNode { public var next: any TransportLayerNode /// The key to retrieve the eTag token from the headers. - /// By default, it has the value `eTagRequestHeaderKey`. + /// The default value is `eTagRequestHeaderKey`. public var etagHeaderKey: String - /// Initializes the node. + /// Initializer. /// /// - Parameters: /// - next: The next node for processing. - /// - eTagHeaderKey: The key to add the eTag token to the request. + /// - eTagHeaderKey: The key to retrieve the eTag token from the headers. public init(next: some TransportLayerNode, etagHeaderKey: String = ETagConstants.eTagRequestHeaderKey) { self.next = next diff --git a/NodeKit/NodeKit/CacheNode/ETag/URLETagSaverNode.swift b/NodeKit/NodeKit/CacheNode/ETag/URLETagSaverNode.swift index 1ece2cb7..22a9e341 100644 --- a/NodeKit/NodeKit/CacheNode/ETag/URLETagSaverNode.swift +++ b/NodeKit/NodeKit/CacheNode/ETag/URLETagSaverNode.swift @@ -24,10 +24,10 @@ open class URLETagSaverNode: AsyncNode { public var next: (any ResponsePostprocessorLayerNode)? /// The key to retrieve the eTag token from the headers. - /// By default, it has the value `ETagConstants.eTagResponseHeaderKey`. + /// The default value is `ETagConstants.eTagResponseHeaderKey`. public var eTagHeaderKey: String - /// Initializes the node. + /// Initializer. /// /// - Parameters: /// - next: The next node for processing. @@ -61,16 +61,16 @@ open class URLETagSaverNode: AsyncNode { public extension URL { /// Takes the original URL - /// Gets the dictionary of query parameters + /// Gets dictionary of query parameters /// If there are no parameters - returns `self.absoluteString` - /// If parameters exist - sorts them, joins into one string + /// If parameters exist - sorts them and joins them into one string /// Removes query parameters from the original URL /// Concatenates the string representation of the URL without parameters with the parameter string /// /// **IMPORTANT** /// - /// The resulting string may be an invalid URL - since the task of this method is to obtain a unique identifier from the URL - /// Moreover, the order of query parameters is not important. + /// The resulting string may be an invalid URL - since the purpose of this method is to extract a unique identifier from the URL + /// Moreover, the order of query parameters does not matter. func withOrderedQuery() -> String? { guard var comp = URLComponents(string: self.absoluteString) else { return nil diff --git a/NodeKit/NodeKit/CacheNode/FirstCachePolicyNode.swift b/NodeKit/NodeKit/CacheNode/FirstCachePolicyNode.swift index 4403e9e8..538495a1 100644 --- a/NodeKit/NodeKit/CacheNode/FirstCachePolicyNode.swift +++ b/NodeKit/NodeKit/CacheNode/FirstCachePolicyNode.swift @@ -18,15 +18,15 @@ enum BaseFirstCachePolicyNodeError: Error { } /// This node implements the caching policy -/// "Read from cache first, then request from server" +/// "First, read from the cache, then request from the server" /// - Important: In general, the listener may be notified twice. The first time when the response is read from the cache, and the second time when it is received from the server. class FirstCachePolicyNode: AsyncStreamNode { // MARK: - Nested - /// Type for the node reading from URL cache + /// Type of the node reading from URL cache typealias CacheReaderNode = AsyncNode - /// Type for the next node + /// Type of the next node typealias NextProcessorNode = AsyncNode // MARK: - Properties @@ -39,11 +39,11 @@ class FirstCachePolicyNode: AsyncStreamNode { // MARK: - Init and Deinit - /// Initializes the node. + /// Initializer. /// /// - Parameters: /// - cacheReaderNode: Node for reading from cache. - /// - next: The next node for processing. + /// - next: Next node for processing. init(cacheReaderNode: any CacheReaderNode, next: any NextProcessorNode) { self.cacheReaderNode = cacheReaderNode self.next = next diff --git a/NodeKit/NodeKit/CacheNode/IfServerFailsFromCacheNode.swift b/NodeKit/NodeKit/CacheNode/IfServerFailsFromCacheNode.swift index f3eda398..0a3e0acc 100644 --- a/NodeKit/NodeKit/CacheNode/IfServerFailsFromCacheNode.swift +++ b/NodeKit/NodeKit/CacheNode/IfServerFailsFromCacheNode.swift @@ -17,7 +17,7 @@ open class IfConnectionFailedFromCacheNode: AsyncNode { /// Node that reads data from the URL cache. public var cacheReaderNode: any AsyncNode - /// Initializes the node. + /// Initializer. /// /// - Parameters: /// - next: The next node for processing. diff --git a/NodeKit/NodeKit/CacheNode/URLNotModifiedTriggerNode.swift b/NodeKit/NodeKit/CacheNode/URLNotModifiedTriggerNode.swift index 8a148a93..d1dd3f51 100644 --- a/NodeKit/NodeKit/CacheNode/URLNotModifiedTriggerNode.swift +++ b/NodeKit/NodeKit/CacheNode/URLNotModifiedTriggerNode.swift @@ -22,7 +22,7 @@ open class URLNotModifiedTriggerNode: AsyncNode { // MARK: - Init and deinit - /// Initializes the node. + /// Initializer. /// /// - Parameters: /// - next: The next node for processing. diff --git a/NodeKit/NodeKit/Chains/ChainBuilder.swift b/NodeKit/NodeKit/Chains/ChainBuilder.swift index 0ae1d69a..212da6d0 100644 --- a/NodeKit/NodeKit/Chains/ChainBuilder.swift +++ b/NodeKit/NodeKit/Chains/ChainBuilder.swift @@ -50,7 +50,7 @@ open class URLChainBuilder: ChainConfigBuilder, ChainBu public let serviceChainProvider: ServiceChainProvider public let logFilter: [String] - /// Model for configuring URL query in the request. + /// Model for configuring URL query of the request. public var config: URLQueryConfigModel /// Array of header providers for the request. diff --git a/NodeKit/NodeKit/Core/Convertion/DTOConvertible.swift b/NodeKit/NodeKit/Core/Convertion/DTOConvertible.swift index e8b268cf..8ff1a596 100644 --- a/NodeKit/NodeKit/Core/Convertion/DTOConvertible.swift +++ b/NodeKit/NodeKit/Core/Convertion/DTOConvertible.swift @@ -3,7 +3,7 @@ import Foundation /// The composition of protocols ``DTOEncodable`` and ``DTODecodable``. public typealias DTOConvertible = DTOEncodable & DTODecodable -/// Describes an entity from the upper DTO layer. +/// Describes an entity from the higher DTO layer. /// Can convert itself to the DTO layer. public protocol DTOEncodable { /// DTO entity type. @@ -16,21 +16,21 @@ public protocol DTOEncodable { func toDTO() throws -> DTO } -/// Describes an entity from the upper DTO layer. +/// Describes an entity from the higher DTO layer. /// Can convert the DTO layer into itself. public protocol DTODecodable { /// DTO entity type. associatedtype DTO: RawDecodable - /// Converts a model from the lower-level DTO into a model of the upper-level DTO. + /// Converts a model from the lower-level DTO into a model of the higher-level DTO. /// - /// - Parameter from: The lower-level DTO model from which to obtain the upper-level model. + /// - Parameter from: The lower-level DTO model from which to obtain the higher-level model. /// - Returns: The conversion result. /// - Throws: Any user-defined exceptions may occur. static func from(dto: DTO) throws -> Self } -/// Allowing one-line mapping of optional models. +/// Syntactic sugar that allows one-line mapping of optional models. public extension Optional where Wrapped: DTODecodable { static func from(dto: Wrapped.DTO?) throws -> Wrapped? { guard let guarded = dto else { diff --git a/NodeKit/NodeKit/Core/Convertion/Extensions/RawMappable+Dictionary.swift b/NodeKit/NodeKit/Core/Convertion/Extensions/RawMappable+Dictionary.swift index 4e24661f..ed20ec33 100644 --- a/NodeKit/NodeKit/Core/Convertion/Extensions/RawMappable+Dictionary.swift +++ b/NodeKit/NodeKit/Core/Convertion/Extensions/RawMappable+Dictionary.swift @@ -9,7 +9,7 @@ extension Dictionary: RawMappable where Dictionary.Key == String, Dictionary.Val return self } - /// Returns the ``Json`` received as input. + /// Just returns the input. /// - Throws: Does not throw errors. public static func from(raw: Json) throws -> Json { return raw diff --git a/NodeKit/NodeKit/Core/Node/Async/AsyncNode.swift b/NodeKit/NodeKit/Core/Node/Async/AsyncNode.swift index f55de638..be087969 100644 --- a/NodeKit/NodeKit/Core/Node/Async/AsyncNode.swift +++ b/NodeKit/NodeKit/Core/Node/Async/AsyncNode.swift @@ -42,7 +42,7 @@ public extension AsyncNode { /// Method for obtaining a Publisher to subscribe to the result. /// Base implementation of ``CombineCompatibleNode``. /// Calls the `process` method with a new task upon each subscription. - /// Calls `cancel` on the task when c`ancel` is invoked in `AnyCancellable` object. + /// Calls `cancel` on the task when `cancel` is invoked in `AnyCancellable` object. /// /// - Parameters: /// - data: Input data for the node. diff --git a/NodeKit/NodeKit/Core/Node/Async/AsyncStreamNode.swift b/NodeKit/NodeKit/Core/Node/Async/AsyncStreamNode.swift index 6cabe926..0596284d 100644 --- a/NodeKit/NodeKit/Core/Node/Async/AsyncStreamNode.swift +++ b/NodeKit/NodeKit/Core/Node/Async/AsyncStreamNode.swift @@ -42,7 +42,7 @@ extension AsyncStreamNode { /// Method for obtaining a Publisher to subscribe to the result. /// Base implementation of ``CombineCompatibleNode``. /// Calls the `process` method with a new task upon each subscription. - /// Calls `cancel` on the task when c`ancel` is invoked in `AnyCancellable` object. + /// Calls `cancel` on the task when `cancel` is invoked in `AnyCancellable` object. /// /// - Parameters: /// - data: Input data for the node. diff --git a/NodeKit/NodeKit/Core/Node/Node.swift b/NodeKit/NodeKit/Core/Node/Node.swift index 6d5e3f46..c45c129b 100644 --- a/NodeKit/NodeKit/Core/Node/Node.swift +++ b/NodeKit/NodeKit/Core/Node/Node.swift @@ -19,7 +19,7 @@ public extension Node { return "\(type(of: self))" } - /// Name of the object in format: + /// Name of the object in following format: /// <<<===\(self.objectName)===>>>" + `String.lineTabDeilimeter` var logViewObjectName: String { return "<<<===\(self.objectName)===>>>" + .lineTabDeilimeter diff --git a/NodeKit/NodeKit/Core/Node/NodeResult.swift b/NodeKit/NodeKit/Core/Node/NodeResult.swift index c46ebb74..4ee4463f 100644 --- a/NodeKit/NodeKit/Core/Node/NodeResult.swift +++ b/NodeKit/NodeKit/Core/Node/NodeResult.swift @@ -11,7 +11,7 @@ public typealias NodeResult = Result public extension NodeResult { - /// Asynchronous positive result transformation method + /// Method for asynchronous transformation of positive result /// /// - Parameter transform: Asynchronous function to transform the positive result /// - Returns: The result of applying the transformation. @@ -26,7 +26,7 @@ public extension NodeResult { } } - /// Asynchronous error transformation method + /// Method for asynchronous transformation of negative result /// /// - Parameter transform: Asynchronous function to transform the error /// - Returns: The result of applying the transformation. @@ -41,7 +41,7 @@ public extension NodeResult { } } - /// Positive result transformation method that can throw an Exception + /// Method for transformation of positive result that can throw an Exception /// /// - Parameter transform: Transformation function that can throw an Exception /// - Returns: The result of applying the transformation or an Exception. @@ -73,7 +73,7 @@ public extension NodeResult { } } - /// Method that calls an asynchronous function, checking if the task is still alive. + /// Method that calls an asynchronous function and checks if the task was canceled. /// If the task was canceled, it returns a `CancellationError`. /// /// - Parameters: diff --git a/NodeKit/NodeKit/Encodings/URLJsonRequestEncodingNode.swift b/NodeKit/NodeKit/Encodings/URLJsonRequestEncodingNode.swift index 618d4338..ff67587e 100644 --- a/NodeKit/NodeKit/Encodings/URLJsonRequestEncodingNode.swift +++ b/NodeKit/NodeKit/Encodings/URLJsonRequestEncodingNode.swift @@ -13,7 +13,7 @@ open class URLJsonRequestEncodingNode: AsyncNode { /// The next node for processing. public var next: any AsyncNode - /// Initializes the node. + /// Initializer. /// /// - Parameters: /// - next: The next node for processing. diff --git a/NodeKit/NodeKit/Layers/DTOProcessingLayer/DTOMapperNode.swift b/NodeKit/NodeKit/Layers/DTOProcessingLayer/DTOMapperNode.swift index b4f52b86..ffae1474 100644 --- a/NodeKit/NodeKit/Layers/DTOProcessingLayer/DTOMapperNode.swift +++ b/NodeKit/NodeKit/Layers/DTOProcessingLayer/DTOMapperNode.swift @@ -14,7 +14,7 @@ open class DTOMapperNode: AsyncNode where Input: RawEncodable, Ou /// The next node for processing. public var next: any AsyncNode - /// Initializes the node. + /// Initializer. /// /// - Parameter next: The next node for processing. public init(next: any AsyncNode) { diff --git a/NodeKit/NodeKit/Layers/DTOProcessingLayer/RawEncoderNode.swift b/NodeKit/NodeKit/Layers/DTOProcessingLayer/RawEncoderNode.swift index dde7c56b..d2e65f53 100644 --- a/NodeKit/NodeKit/Layers/DTOProcessingLayer/RawEncoderNode.swift +++ b/NodeKit/NodeKit/Layers/DTOProcessingLayer/RawEncoderNode.swift @@ -14,14 +14,14 @@ open class RawEncoderNode: AsyncNode where Input: RawEncodable { /// The next node for processing. open var next: any AsyncNode - /// Initializes the node. + /// Initializer. /// /// - Parameter next: The next node for processing. public init(next: some AsyncNode) { self.next = next } - /// Tries to convert the model to Raw, and then simply passes the conversion result to the next node. + /// Tries to convert the model to Raw and then simply passes the conversion result to the next node. /// If an error occurs during conversion, it aborts the chain execution. /// /// - Parameter data: The incoming model. diff --git a/NodeKit/NodeKit/Layers/InputProcessingLayer/DTOEncoderNode.swift b/NodeKit/NodeKit/Layers/InputProcessingLayer/DTOEncoderNode.swift index 55c076b2..8f768409 100644 --- a/NodeKit/NodeKit/Layers/InputProcessingLayer/DTOEncoderNode.swift +++ b/NodeKit/NodeKit/Layers/InputProcessingLayer/DTOEncoderNode.swift @@ -21,7 +21,7 @@ open class DTOEncoderNode: AsyncNode where Input: DTOEncodable { self.rawEncodable = rawEncodable } - /// Tries to convert the model to a DTO, and then passes the conversion result to the next node. + /// Tries to convert the model to a DTO and then passes the conversion result to the next node. /// If an error occurs during conversion, it interrupts the execution of the chain. /// /// - Parameter data: Incoming model. diff --git a/NodeKit/NodeKit/Layers/InputProcessingLayer/ModelInputNode.swift b/NodeKit/NodeKit/Layers/InputProcessingLayer/ModelInputNode.swift index bb7cff8b..38b04a14 100644 --- a/NodeKit/NodeKit/Layers/InputProcessingLayer/ModelInputNode.swift +++ b/NodeKit/NodeKit/Layers/InputProcessingLayer/ModelInputNode.swift @@ -15,7 +15,7 @@ public class ModelInputNode: AsyncNode where Input: DTOEncodable, /// The next node for processing. public var next: any AsyncNode - /// Initializes the node. + /// Initializer. /// /// - Parameter next: The next node for processing. public init(next: any AsyncNode) { @@ -23,7 +23,7 @@ public class ModelInputNode: AsyncNode where Input: DTOEncodable, } /// Passes control to the next node, - /// and upon receiving a response, attempts to map the lower DTO layer to the upper one. + /// and upon receiving a response, attempts to map the lower DTO layer to the higher one. /// /// - Parameter data: Data for the request. open func process( diff --git a/NodeKit/NodeKit/Layers/InputProcessingLayer/VoidInputNode.swift b/NodeKit/NodeKit/Layers/InputProcessingLayer/VoidInputNode.swift index cb3017df..6c6d8465 100644 --- a/NodeKit/NodeKit/Layers/InputProcessingLayer/VoidInputNode.swift +++ b/NodeKit/NodeKit/Layers/InputProcessingLayer/VoidInputNode.swift @@ -14,7 +14,7 @@ open class VoidInputNode: AsyncNode { /// The next node for processing. public var next: any AsyncNode - /// Initializes the node. + /// Initializer. /// /// - Parameter next: The next node for processing. public init(next: any AsyncNode) { diff --git a/NodeKit/NodeKit/Layers/RequestBuildingLayer/MetadataConnectorNode.swift b/NodeKit/NodeKit/Layers/RequestBuildingLayer/MetadataConnectorNode.swift index 5b07630b..512b717f 100644 --- a/NodeKit/NodeKit/Layers/RequestBuildingLayer/MetadataConnectorNode.swift +++ b/NodeKit/NodeKit/Layers/RequestBuildingLayer/MetadataConnectorNode.swift @@ -1,6 +1,6 @@ import Foundation -/// The task of this node is to add metadata to the created request. +/// The purpose of this node is to add metadata to the created request. /// Initializes the chain for building an HTTP request. open class MetadataConnectorNode: AsyncNode { @@ -10,7 +10,7 @@ open class MetadataConnectorNode: AsyncNode { /// Metadata for request. public var metadata: [String: String] - /// Initializes the node. + /// Initializer. /// /// - Parameters: /// - next: The next node in the chain. diff --git a/NodeKit/NodeKit/Layers/RequestBuildingLayer/Models/RequestModel.swift b/NodeKit/NodeKit/Layers/RequestBuildingLayer/Models/RequestModel.swift index 7fed70ef..5fd090f1 100644 --- a/NodeKit/NodeKit/Layers/RequestBuildingLayer/Models/RequestModel.swift +++ b/NodeKit/NodeKit/Layers/RequestBuildingLayer/Models/RequestModel.swift @@ -10,7 +10,7 @@ import Foundation /// Model for network request. /// It serves as an intermediate representation for passing data within the chain. -/// It is later converted into ``RoutableRequestModel``. +/// It is subsequently converted into ``RoutableRequestModel``. public struct RequestModel { /// Метаданные public var metadata: [String: String] diff --git a/NodeKit/NodeKit/Layers/RequestBuildingLayer/Models/RoutableRequestModel.swift b/NodeKit/NodeKit/Layers/RequestBuildingLayer/Models/RoutableRequestModel.swift index ddf03569..003b0b60 100644 --- a/NodeKit/NodeKit/Layers/RequestBuildingLayer/Models/RoutableRequestModel.swift +++ b/NodeKit/NodeKit/Layers/RequestBuildingLayer/Models/RoutableRequestModel.swift @@ -11,7 +11,7 @@ import Foundation /// Model for network request. /// It serves as an intermediate representation. /// It is the next stage after ``RequestModel``. -/// It is later converted into ``EncodableRequestModel``. +/// It is subsequently converted into ``EncodableRequestModel``. public struct RoutableRequestModel { /// Метаданные public var metadata: [String: String] diff --git a/NodeKit/NodeKit/Layers/RequestBuildingLayer/MultipartURLRequestTrasformatorNode.swift b/NodeKit/NodeKit/Layers/RequestBuildingLayer/MultipartURLRequestTrasformatorNode.swift index 8e2a2496..aef632a3 100644 --- a/NodeKit/NodeKit/Layers/RequestBuildingLayer/MultipartURLRequestTrasformatorNode.swift +++ b/NodeKit/NodeKit/Layers/RequestBuildingLayer/MultipartURLRequestTrasformatorNode.swift @@ -10,7 +10,7 @@ open class MultipartURLRequestTrasformatorNode: AsyncNode { /// HTTP method for the request. open var method: Method - /// Initializes the node. + /// Initializer. /// /// - Parameters: /// - next: The next node for processing. diff --git a/NodeKit/NodeKit/Layers/RequestBuildingLayer/RequestEncoderNode.swift b/NodeKit/NodeKit/Layers/RequestBuildingLayer/RequestEncoderNode.swift index 60bc5cd5..1019ff14 100644 --- a/NodeKit/NodeKit/Layers/RequestBuildingLayer/RequestEncoderNode.swift +++ b/NodeKit/NodeKit/Layers/RequestBuildingLayer/RequestEncoderNode.swift @@ -11,7 +11,7 @@ import Foundation /// This node adds encoding to the request being created. open class RequestEncoderNode: AsyncNode { - /// Type for the next node. + /// Type of the next node. public typealias NextNode = AsyncNode, Output> /// The next node for processing. @@ -20,7 +20,7 @@ open class RequestEncoderNode: AsyncNode { /// Encoding for the request. public var encoding: Encoding - /// Initializes the node. + /// Initializer. /// /// - Parameters: /// - next: The next node for processing. diff --git a/NodeKit/NodeKit/Layers/RequestBuildingLayer/RequestRouterNode.swift b/NodeKit/NodeKit/Layers/RequestBuildingLayer/RequestRouterNode.swift index 95764601..c698cc04 100644 --- a/NodeKit/NodeKit/Layers/RequestBuildingLayer/RequestRouterNode.swift +++ b/NodeKit/NodeKit/Layers/RequestBuildingLayer/RequestRouterNode.swift @@ -11,7 +11,7 @@ import Foundation /// This node adds a route to the request. open class RequestRouterNode: AsyncNode { - /// Type for the next node. + /// Type of the next node. public typealias NextNode = AsyncNode, Output> /// The next node for processing. @@ -20,7 +20,7 @@ open class RequestRouterNode: AsyncNode { /// Route for the request. public var route: Route - /// Initializes the node + /// Initializer /// /// - Parameters: /// - next: The next node for processing. diff --git a/NodeKit/NodeKit/Layers/RequestBuildingLayer/URLQueryInjectorNode.swift b/NodeKit/NodeKit/Layers/RequestBuildingLayer/URLQueryInjectorNode.swift index cf34ed09..dd11d191 100644 --- a/NodeKit/NodeKit/Layers/RequestBuildingLayer/URLQueryInjectorNode.swift +++ b/NodeKit/NodeKit/Layers/RequestBuildingLayer/URLQueryInjectorNode.swift @@ -2,7 +2,7 @@ import Foundation /// Errors for ``URLQueryInjectorNode`` public enum URLQueryInjectorNodeError: Error { - /// Occurs if URLComponents couldn't be created from the URL. + /// Occurs if URLComponents could not be created from the URL. case cantCreateURLComponentsFromURLString /// Occurs if building URLComponents succeeded but obtaining the URL from it failed. case cantCreateURLFromURLComponents @@ -60,7 +60,7 @@ open class URLQueryInjectorNode: AsyncNode { } } - /// Allows you to obtain a list of URL query components by key and value. + /// Allows to obtain a list of URL query components by key and value. /// - Parameter object: The value of the URL query parameter. /// - Parameter key: The key of the URL query parameter. open func makeQueryComponents(from object: Any, by key: String) -> [URLQueryItem] { diff --git a/NodeKit/NodeKit/Layers/RequestBuildingLayer/URLRequestTrasformatorNode.swift b/NodeKit/NodeKit/Layers/RequestBuildingLayer/URLRequestTrasformatorNode.swift index 4e4e1a5a..5a50a1a3 100644 --- a/NodeKit/NodeKit/Layers/RequestBuildingLayer/URLRequestTrasformatorNode.swift +++ b/NodeKit/NodeKit/Layers/RequestBuildingLayer/URLRequestTrasformatorNode.swift @@ -10,7 +10,7 @@ open class URLRequestTrasformatorNode: AsyncNode { /// HTTP method for the request. public var method: Method - /// Initializes the node. + /// Initializer. /// /// - Parameters: /// - next: The next node for processing. diff --git a/NodeKit/NodeKit/Layers/RequestProcessingLayer/MultipartRequestCreatorNode.swift b/NodeKit/NodeKit/Layers/RequestProcessingLayer/MultipartRequestCreatorNode.swift index 7b9e2981..da4cb67e 100644 --- a/NodeKit/NodeKit/Layers/RequestProcessingLayer/MultipartRequestCreatorNode.swift +++ b/NodeKit/NodeKit/Layers/RequestProcessingLayer/MultipartRequestCreatorNode.swift @@ -36,7 +36,7 @@ open class MultipartRequestCreatorNode: AsyncNode { private let multipartFormDataFactory: MultipartFormDataFactory - /// Initializes the node. + /// Initializer. /// /// - Parameter next: The next node for processing. public init( diff --git a/NodeKit/NodeKit/Layers/RequestProcessingLayer/RequestCreatorNode.swift b/NodeKit/NodeKit/Layers/RequestProcessingLayer/RequestCreatorNode.swift index b598153d..0e3c3cd0 100644 --- a/NodeKit/NodeKit/Layers/RequestProcessingLayer/RequestCreatorNode.swift +++ b/NodeKit/NodeKit/Layers/RequestProcessingLayer/RequestCreatorNode.swift @@ -9,7 +9,7 @@ open class RequestCreatorNode: AsyncNode { /// Metadata providers public var providers: [MetadataProvider] - /// Initializes the node. + /// Initializer. /// /// - Parameter next: The next node for processing. public init(next: some AsyncNode, providers: [MetadataProvider] = []) { diff --git a/NodeKit/NodeKit/Layers/RequestProcessingLayer/RequestSenderNode.swift b/NodeKit/NodeKit/Layers/RequestProcessingLayer/RequestSenderNode.swift index 5100c039..ee43448b 100644 --- a/NodeKit/NodeKit/Layers/RequestProcessingLayer/RequestSenderNode.swift +++ b/NodeKit/NodeKit/Layers/RequestProcessingLayer/RequestSenderNode.swift @@ -18,7 +18,7 @@ public struct NodeDataResponse { /// - Important: This node is statefull. open class RequestSenderNode: AsyncNode, Aborter { - /// Type for the node that will handle the server response. + /// Type of the node that will handle the server response. public typealias RawResponseProcessor = AsyncNode /// Node for processing the response. @@ -28,7 +28,7 @@ open class RequestSenderNode: AsyncNode, Aborter { private(set) var manager: URLSession private let dataTaskActor: URLSessionDataTaskActorProtocol - /// Initializes the node. + /// Initializer. /// /// - Parameter rawResponseProcessor: The node for processing the response. /// - Parameter manager: URLSession manager, by default set to the session from ServerRequestsManager. diff --git a/NodeKit/NodeKit/Layers/ResponsePostprocessingNode/Models/URLProcessedResponse.swift b/NodeKit/NodeKit/Layers/ResponsePostprocessingNode/Models/URLProcessedResponse.swift index 2696f308..d69440cc 100644 --- a/NodeKit/NodeKit/Layers/ResponsePostprocessingNode/Models/URLProcessedResponse.swift +++ b/NodeKit/NodeKit/Layers/ResponsePostprocessingNode/Models/URLProcessedResponse.swift @@ -8,7 +8,7 @@ import Foundation -/// Used to transfer data within the request post-processing layer. +/// Used to transfer data within the layer of the post-processing request public struct URLProcessedResponse { private let _dataResponse: URLDataResponse diff --git a/NodeKit/NodeKit/Layers/ResponseProcessingLayer/DataLoading/DataLoadingResponseProcessor.swift b/NodeKit/NodeKit/Layers/ResponseProcessingLayer/DataLoading/DataLoadingResponseProcessor.swift index 110c6526..6c0293dc 100644 --- a/NodeKit/NodeKit/Layers/ResponseProcessingLayer/DataLoading/DataLoadingResponseProcessor.swift +++ b/NodeKit/NodeKit/Layers/ResponseProcessingLayer/DataLoading/DataLoadingResponseProcessor.swift @@ -17,14 +17,14 @@ open class DataLoadingResponseProcessor: AsyncNode { /// Node for post-processing loaded data. open var next: (any AsyncNode)? - /// Initializes the node. + /// Initializer. /// /// - Parameter next: The node for post-processing loaded data. Default is nil. public init(next: (any AsyncNode)? = nil) { self.next = next } - /// If the post-processing node exists, it calls it; if not, it returns the data. + /// If the post-processing node exists, it calls it; otherwise, it returns the data. open func process( _ data: URLDataResponse, logContext: LoggingContextProtocol diff --git a/NodeKit/NodeKit/Layers/ResponseProcessingLayer/Models/URLDataResponse.swift b/NodeKit/NodeKit/Layers/ResponseProcessingLayer/Models/URLDataResponse.swift index 336bb45a..d55ad791 100644 --- a/NodeKit/NodeKit/Layers/ResponseProcessingLayer/Models/URLDataResponse.swift +++ b/NodeKit/NodeKit/Layers/ResponseProcessingLayer/Models/URLDataResponse.swift @@ -9,7 +9,7 @@ import Foundation /// Server response model. -/// Used for passing information within the response handling chain. +/// Used for passing information within the chain of response handling. public struct URLDataResponse: Equatable { /// The request sent to the server. public let request: URLRequest diff --git a/NodeKit/NodeKit/Layers/ResponseProcessingLayer/ResponseDataParserNode.swift b/NodeKit/NodeKit/Layers/ResponseProcessingLayer/ResponseDataParserNode.swift index c6030128..cc3d4b32 100644 --- a/NodeKit/NodeKit/Layers/ResponseProcessingLayer/ResponseDataParserNode.swift +++ b/NodeKit/NodeKit/Layers/ResponseProcessingLayer/ResponseDataParserNode.swift @@ -23,7 +23,7 @@ open class ResponseDataParserNode: AsyncNode { /// The next node for processing. public var next: (any ResponsePostprocessorLayerNode)? - /// Initializes the node. + /// Initializer. /// /// - Parameter next: The next node for processing. public init(next: (any ResponsePostprocessorLayerNode)? = nil) { diff --git a/NodeKit/NodeKit/Layers/ResponseProcessingLayer/ResponseDataPreprocessorNode.swift b/NodeKit/NodeKit/Layers/ResponseProcessingLayer/ResponseDataPreprocessorNode.swift index ed5cd0b9..9ce50482 100644 --- a/NodeKit/NodeKit/Layers/ResponseProcessingLayer/ResponseDataPreprocessorNode.swift +++ b/NodeKit/NodeKit/Layers/ResponseProcessingLayer/ResponseDataPreprocessorNode.swift @@ -15,7 +15,7 @@ open class ResponseDataPreprocessorNode: AsyncNode { /// The next node for processing. public var next: any ResponseProcessingLayerNode - /// Initializes the node. + /// Initializer. /// /// - Parameter next: The next node for processing. public init(next: some ResponseProcessingLayerNode) { diff --git a/NodeKit/NodeKit/Layers/ResponseProcessingLayer/ResponseHttpErrorProcessorNode.swift b/NodeKit/NodeKit/Layers/ResponseProcessingLayer/ResponseHttpErrorProcessorNode.swift index 13521da7..56a2d9c3 100644 --- a/NodeKit/NodeKit/Layers/ResponseProcessingLayer/ResponseHttpErrorProcessorNode.swift +++ b/NodeKit/NodeKit/Layers/ResponseProcessingLayer/ResponseHttpErrorProcessorNode.swift @@ -33,7 +33,7 @@ open class ResponseHttpErrorProcessorNode: AsyncNode { /// The next node for processing. public var next: any AsyncNode - /// Initializes the node. + /// Initializer. /// /// - Parameter next: The next node for processing. public init(next: some AsyncNode) { diff --git a/NodeKit/NodeKit/Layers/ResponseProcessingLayer/ResponseProcessorNode.swift b/NodeKit/NodeKit/Layers/ResponseProcessingLayer/ResponseProcessorNode.swift index 7d46b916..be3c700b 100644 --- a/NodeKit/NodeKit/Layers/ResponseProcessingLayer/ResponseProcessorNode.swift +++ b/NodeKit/NodeKit/Layers/ResponseProcessingLayer/ResponseProcessorNode.swift @@ -21,7 +21,7 @@ open class ResponseProcessorNode: AsyncNode { /// The next node for processing. public let next: any AsyncNode - /// Initializes the node. + /// Initializer. /// /// - Parameter next: The next node for processing. public init(next: some AsyncNode) { diff --git a/NodeKit/NodeKit/Layers/TrasportLayer/TechnicaErrorMapperNode.swift b/NodeKit/NodeKit/Layers/TrasportLayer/TechnicaErrorMapperNode.swift index 4b76110c..56098bc5 100644 --- a/NodeKit/NodeKit/Layers/TrasportLayer/TechnicaErrorMapperNode.swift +++ b/NodeKit/NodeKit/Layers/TrasportLayer/TechnicaErrorMapperNode.swift @@ -29,7 +29,7 @@ open class TechnicaErrorMapperNode: AsyncNode { open var next: any AsyncNode - /// Initializes the node. + /// Initializer. /// /// - Parameter next: The next node for processing. public init(next: any AsyncNode) { diff --git a/NodeKit/NodeKit/Layers/Utils/AccessSafe/AccessSafeNode.swift b/NodeKit/NodeKit/Layers/Utils/AccessSafe/AccessSafeNode.swift index c49e3dc4..d9d257c2 100644 --- a/NodeKit/NodeKit/Layers/Utils/AccessSafe/AccessSafeNode.swift +++ b/NodeKit/NodeKit/Layers/Utils/AccessSafe/AccessSafeNode.swift @@ -17,7 +17,7 @@ public enum AccessSafeNodeError: Error { /// ## Description /// Node implementing logic for maintaining access to a remote resource. -/// For example, you can consider a scheme for OAuth 2.0. +/// Let us consider a scheme for OAuth 2.0. /// /// ## Example /// After authorization, the user receives: @@ -53,7 +53,7 @@ open class AccessSafeNode: AsyncNode { /// Out of the box, this is implemented by the ``TokenRefresherNode`` node. public var updateTokenChain: any AsyncNode - /// Initializes the node. + /// Initializer. /// /// - Parameters: /// - next: The next node in the chain. diff --git a/NodeKit/NodeKit/Layers/Utils/HeaderInjectorNode.swift b/NodeKit/NodeKit/Layers/Utils/HeaderInjectorNode.swift index c1796660..4ca3e231 100644 --- a/NodeKit/NodeKit/Layers/Utils/HeaderInjectorNode.swift +++ b/NodeKit/NodeKit/Layers/Utils/HeaderInjectorNode.swift @@ -18,7 +18,7 @@ open class HeaderInjectorNode: AsyncNode { /// Headers to be added. public var headers: [String: String] - /// Initializes the node. + /// Initializer. /// /// - Parameters: /// - next: The next node for processing. diff --git a/NodeKit/NodeKit/Layers/Utils/RequestAborterNode.swift b/NodeKit/NodeKit/Layers/Utils/RequestAborterNode.swift index 07603647..d5ce884e 100644 --- a/NodeKit/NodeKit/Layers/Utils/RequestAborterNode.swift +++ b/NodeKit/NodeKit/Layers/Utils/RequestAborterNode.swift @@ -26,7 +26,7 @@ open class AborterNode: AsyncNode { /// Entity canceling transformation. public var aborter: Aborter - /// Initializes the node. + /// Initializer. /// /// - Parameters: /// - next: The next node in the chain. diff --git a/NodeKit/NodeKit/Utils/Logging/LoggerNode.swift b/NodeKit/NodeKit/Utils/Logging/LoggerNode.swift index cda1c9d9..2b83a7e2 100644 --- a/NodeKit/NodeKit/Utils/Logging/LoggerNode.swift +++ b/NodeKit/NodeKit/Utils/Logging/LoggerNode.swift @@ -9,7 +9,7 @@ open class LoggerNode: AsyncNode { ///List of keys by which the log will be filtered. open var filters: [String] - /// Initializes the node. + /// Initializer. /// /// - Parameters: /// - next: The next node for processing. diff --git a/NodeKit/NodeKit/Utils/Logging/LoggerStreamNode.swift b/NodeKit/NodeKit/Utils/Logging/LoggerStreamNode.swift index 407ff4de..0480e429 100644 --- a/NodeKit/NodeKit/Utils/Logging/LoggerStreamNode.swift +++ b/NodeKit/NodeKit/Utils/Logging/LoggerStreamNode.swift @@ -15,7 +15,7 @@ class LoggerStreamNode: AsyncStreamNode { ///List of keys by which the log will be filtered. var filters: [String] - /// Initializes the node. + /// Initializer. /// /// - Parameters: /// - next: The next node for processing. diff --git a/TechDocs/Chains.md b/TechDocs/Chains.md index 8c50d829..d0f6f9ea 100644 --- a/TechDocs/Chains.md +++ b/TechDocs/Chains.md @@ -25,7 +25,7 @@ This chain **DOES NOT** contain caching. `build` - a classic request. Expects data both as input and output (described above) -`build` - a chain that does not expect data as input or output +`build` - a chain that does not expect data either as input or output `build` - a chain that expects data as input but does not return data (server responds with an empty body) diff --git a/TechDocs/MainConcept.md b/TechDocs/MainConcept.md index f107eed8..e0fed2e6 100644 --- a/TechDocs/MainConcept.md +++ b/TechDocs/MainConcept.md @@ -11,6 +11,7 @@ Every node is required to implement the `process(_ data: Input, logContext: Logg When creating custom nodes, it is recommended to pass `logContext` further along the chain; otherwise, a new `LoggingContext` will be created, and subsequent logs will be ignored when outputting to the console. It's essential to note that the process method operates asynchronously, and the thread in which it executes is not predetermined. +For more details read Swift Concurrency documentation. If it's required for the method to execute only in the main thread, the @MainActor attribute must be added to the method. ```Swift