diff --git a/.swiftformat b/.swiftformat index 6142b35..ee6b938 100644 --- a/.swiftformat +++ b/.swiftformat @@ -46,7 +46,8 @@ # MARK: - Comments and Documentation --doc-comments before-declarations ---header strip +--header "MIT License\n\nCopyright (c) 2026 Otávio C.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE." + --ifdef indent # MARK: - SwiftUI and Modern Swift Features diff --git a/Sources/MicroClient/Extensions/URLComponents.swift b/Sources/MicroClient/Extensions/URLComponents.swift index 7d9b764..b8ad43a 100644 --- a/Sources/MicroClient/Extensions/URLComponents.swift +++ b/Sources/MicroClient/Extensions/URLComponents.swift @@ -1,3 +1,25 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation extension URL { diff --git a/Sources/MicroClient/Extensions/URLRequest.swift b/Sources/MicroClient/Extensions/URLRequest.swift index 513c43e..b77a231 100644 --- a/Sources/MicroClient/Extensions/URLRequest.swift +++ b/Sources/MicroClient/Extensions/URLRequest.swift @@ -1,3 +1,25 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation extension URLRequest { diff --git a/Sources/MicroClient/Extensions/URLResponse.swift b/Sources/MicroClient/Extensions/URLResponse.swift index 980f341..02fd81a 100644 --- a/Sources/MicroClient/Extensions/URLResponse.swift +++ b/Sources/MicroClient/Extensions/URLResponse.swift @@ -1,3 +1,25 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation public extension URLResponse { diff --git a/Sources/MicroClient/Extensions/URLSessionProtocol.swift b/Sources/MicroClient/Extensions/URLSessionProtocol.swift index 72fceb8..ec141c0 100644 --- a/Sources/MicroClient/Extensions/URLSessionProtocol.swift +++ b/Sources/MicroClient/Extensions/URLSessionProtocol.swift @@ -1,3 +1,25 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation /// Protocol for URLSession to enable dependency injection and testing diff --git a/Sources/MicroClient/Extensions/Unwrap.swift b/Sources/MicroClient/Extensions/Unwrap.swift index da73e83..c87eba4 100644 --- a/Sources/MicroClient/Extensions/Unwrap.swift +++ b/Sources/MicroClient/Extensions/Unwrap.swift @@ -1,3 +1,25 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + func unwrap( value: T?, error: Error diff --git a/Sources/MicroClient/HTTPMethod.swift b/Sources/MicroClient/HTTPMethod.swift index 78f8182..cd16aaf 100644 --- a/Sources/MicroClient/HTTPMethod.swift +++ b/Sources/MicroClient/HTTPMethod.swift @@ -1,3 +1,25 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + /// The HTTP method used for the network request. public enum HTTPMethod: String, Sendable { diff --git a/Sources/MicroClient/Interceptors/APIKeyInterceptor.swift b/Sources/MicroClient/Interceptors/APIKeyInterceptor.swift index 4c0aa7f..6d9617d 100644 --- a/Sources/MicroClient/Interceptors/APIKeyInterceptor.swift +++ b/Sources/MicroClient/Interceptors/APIKeyInterceptor.swift @@ -1,3 +1,25 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation /// An interceptor that adds API key authentication to HTTP requests. diff --git a/Sources/MicroClient/Interceptors/AcceptHeaderInterceptor.swift b/Sources/MicroClient/Interceptors/AcceptHeaderInterceptor.swift index c9c0113..0ee14e6 100644 --- a/Sources/MicroClient/Interceptors/AcceptHeaderInterceptor.swift +++ b/Sources/MicroClient/Interceptors/AcceptHeaderInterceptor.swift @@ -1,3 +1,25 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation /// An interceptor that adds Accept headers to HTTP requests. diff --git a/Sources/MicroClient/Interceptors/BasicAuthInterceptor.swift b/Sources/MicroClient/Interceptors/BasicAuthInterceptor.swift index 1e30c13..8e7f39b 100644 --- a/Sources/MicroClient/Interceptors/BasicAuthInterceptor.swift +++ b/Sources/MicroClient/Interceptors/BasicAuthInterceptor.swift @@ -1,3 +1,25 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation /// An interceptor that adds Basic authentication to HTTP requests. diff --git a/Sources/MicroClient/Interceptors/BearerAuthorizationInterceptor.swift b/Sources/MicroClient/Interceptors/BearerAuthorizationInterceptor.swift index 51f423e..6c4edaa 100644 --- a/Sources/MicroClient/Interceptors/BearerAuthorizationInterceptor.swift +++ b/Sources/MicroClient/Interceptors/BearerAuthorizationInterceptor.swift @@ -1,3 +1,25 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation /// An interceptor that adds Bearer token authorization to HTTP requests. diff --git a/Sources/MicroClient/Interceptors/CacheControlInterceptor.swift b/Sources/MicroClient/Interceptors/CacheControlInterceptor.swift index 30d600a..cc61d7d 100644 --- a/Sources/MicroClient/Interceptors/CacheControlInterceptor.swift +++ b/Sources/MicroClient/Interceptors/CacheControlInterceptor.swift @@ -1,3 +1,25 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation /// An interceptor that adds Cache-Control headers to HTTP requests. diff --git a/Sources/MicroClient/Interceptors/ContentTypeInterceptor.swift b/Sources/MicroClient/Interceptors/ContentTypeInterceptor.swift index 13690d8..2ae711c 100644 --- a/Sources/MicroClient/Interceptors/ContentTypeInterceptor.swift +++ b/Sources/MicroClient/Interceptors/ContentTypeInterceptor.swift @@ -1,3 +1,25 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation /// An interceptor that adds Content-Type headers to HTTP requests with a body. diff --git a/Sources/MicroClient/Interceptors/MetricsCollectionInterceptor.swift b/Sources/MicroClient/Interceptors/MetricsCollectionInterceptor.swift index 3a1f55c..d74808c 100644 --- a/Sources/MicroClient/Interceptors/MetricsCollectionInterceptor.swift +++ b/Sources/MicroClient/Interceptors/MetricsCollectionInterceptor.swift @@ -1,3 +1,25 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation /// A protocol for receiving metrics collected from network responses. diff --git a/Sources/MicroClient/Interceptors/RequestIDInterceptor.swift b/Sources/MicroClient/Interceptors/RequestIDInterceptor.swift index e66dd6d..34f5159 100644 --- a/Sources/MicroClient/Interceptors/RequestIDInterceptor.swift +++ b/Sources/MicroClient/Interceptors/RequestIDInterceptor.swift @@ -1,3 +1,25 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation /// An interceptor that adds unique request IDs to HTTP requests. diff --git a/Sources/MicroClient/Interceptors/ResponseLoggingInterceptor.swift b/Sources/MicroClient/Interceptors/ResponseLoggingInterceptor.swift index db1f23f..6ede36f 100644 --- a/Sources/MicroClient/Interceptors/ResponseLoggingInterceptor.swift +++ b/Sources/MicroClient/Interceptors/ResponseLoggingInterceptor.swift @@ -1,3 +1,25 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation /// An interceptor that logs response information including status code, headers, and body data. diff --git a/Sources/MicroClient/Interceptors/RetryAfterInterceptor.swift b/Sources/MicroClient/Interceptors/RetryAfterInterceptor.swift index dc26860..11819ec 100644 --- a/Sources/MicroClient/Interceptors/RetryAfterInterceptor.swift +++ b/Sources/MicroClient/Interceptors/RetryAfterInterceptor.swift @@ -1,3 +1,25 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation /// Error thrown when a Retry-After header indicates the client should wait before retrying. diff --git a/Sources/MicroClient/Interceptors/StatusCodeValidationInterceptor.swift b/Sources/MicroClient/Interceptors/StatusCodeValidationInterceptor.swift index 354b3b8..160dccd 100644 --- a/Sources/MicroClient/Interceptors/StatusCodeValidationInterceptor.swift +++ b/Sources/MicroClient/Interceptors/StatusCodeValidationInterceptor.swift @@ -1,3 +1,25 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation /// An interceptor that validates HTTP status codes against a custom range or set of acceptable codes. diff --git a/Sources/MicroClient/Interceptors/TimeoutInterceptor.swift b/Sources/MicroClient/Interceptors/TimeoutInterceptor.swift index 30ed8e6..839377d 100644 --- a/Sources/MicroClient/Interceptors/TimeoutInterceptor.swift +++ b/Sources/MicroClient/Interceptors/TimeoutInterceptor.swift @@ -1,3 +1,25 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation /// An interceptor that configures custom timeout intervals for HTTP requests. diff --git a/Sources/MicroClient/Interceptors/UserAgentInterceptor.swift b/Sources/MicroClient/Interceptors/UserAgentInterceptor.swift index 0718585..0d0267e 100644 --- a/Sources/MicroClient/Interceptors/UserAgentInterceptor.swift +++ b/Sources/MicroClient/Interceptors/UserAgentInterceptor.swift @@ -1,3 +1,25 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation /// An interceptor that adds a User-Agent header to HTTP requests. diff --git a/Sources/MicroClient/Loggers/StdoutLogger.swift b/Sources/MicroClient/Loggers/StdoutLogger.swift index 49e84c4..ae758fc 100644 --- a/Sources/MicroClient/Loggers/StdoutLogger.swift +++ b/Sources/MicroClient/Loggers/StdoutLogger.swift @@ -1,3 +1,25 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation /// A simple logger implementation that outputs messages to standard output (stdout). diff --git a/Sources/MicroClient/NetworkClient.swift b/Sources/MicroClient/NetworkClient.swift index 7a92c4f..1322975 100644 --- a/Sources/MicroClient/NetworkClient.swift +++ b/Sources/MicroClient/NetworkClient.swift @@ -1,3 +1,25 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation /// The network client interface. diff --git a/Sources/MicroClient/NetworkClientError.swift b/Sources/MicroClient/NetworkClientError.swift index 36a0f76..7c4b126 100644 --- a/Sources/MicroClient/NetworkClientError.swift +++ b/Sources/MicroClient/NetworkClientError.swift @@ -1,3 +1,25 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation /// An enum representing possible errors that can occur during a network request. diff --git a/Sources/MicroClient/NetworkConfiguration.swift b/Sources/MicroClient/NetworkConfiguration.swift index c897576..53086df 100644 --- a/Sources/MicroClient/NetworkConfiguration.swift +++ b/Sources/MicroClient/NetworkConfiguration.swift @@ -1,3 +1,25 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation /// The network client configuration. diff --git a/Sources/MicroClient/NetworkLogLevel.swift b/Sources/MicroClient/NetworkLogLevel.swift index 097f7b7..a9ef53c 100644 --- a/Sources/MicroClient/NetworkLogLevel.swift +++ b/Sources/MicroClient/NetworkLogLevel.swift @@ -1,3 +1,25 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation /// The log level for the logger. diff --git a/Sources/MicroClient/NetworkLogger.swift b/Sources/MicroClient/NetworkLogger.swift index be586ba..9f09d79 100644 --- a/Sources/MicroClient/NetworkLogger.swift +++ b/Sources/MicroClient/NetworkLogger.swift @@ -1,3 +1,25 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation /// The logger protocol. diff --git a/Sources/MicroClient/NetworkRequest.swift b/Sources/MicroClient/NetworkRequest.swift index 14a1b77..42ce3ed 100644 --- a/Sources/MicroClient/NetworkRequest.swift +++ b/Sources/MicroClient/NetworkRequest.swift @@ -1,3 +1,25 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation /// The network request. @@ -6,9 +28,9 @@ import Foundation /// model and response models, encodable and decodable /// types respectively. public struct NetworkRequest< - RequestModel, - ResponseModel ->: Sendable where RequestModel: Encodable & Sendable, ResponseModel: Decodable & Sendable { + RequestModel: Encodable & Sendable, + ResponseModel: Decodable & Sendable +>: Sendable { // MARK: - Properties diff --git a/Sources/MicroClient/NetworkRequestInterceptor.swift b/Sources/MicroClient/NetworkRequestInterceptor.swift index e68698a..f885473 100644 --- a/Sources/MicroClient/NetworkRequestInterceptor.swift +++ b/Sources/MicroClient/NetworkRequestInterceptor.swift @@ -1,3 +1,25 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation /// A protocol for intercepting and modifying network requests before they are sent. diff --git a/Sources/MicroClient/NetworkResponse.swift b/Sources/MicroClient/NetworkResponse.swift index baf6403..e38de06 100644 --- a/Sources/MicroClient/NetworkResponse.swift +++ b/Sources/MicroClient/NetworkResponse.swift @@ -1,8 +1,30 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation /// The network response. It has the type /// used as response model. -public struct NetworkResponse: Sendable where ResponseModel: Sendable { +public struct NetworkResponse: Sendable { // MARK: - Properties diff --git a/Sources/MicroClient/NetworkResponseInterceptor.swift b/Sources/MicroClient/NetworkResponseInterceptor.swift index 2b67d5b..9e7e40c 100644 --- a/Sources/MicroClient/NetworkResponseInterceptor.swift +++ b/Sources/MicroClient/NetworkResponseInterceptor.swift @@ -1,3 +1,25 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation /// A protocol for intercepting and processing network responses after they are received and decoded. diff --git a/Sources/MicroClient/Responses/VoidRequest.swift b/Sources/MicroClient/Responses/VoidRequest.swift index 63dcddf..991f999 100644 --- a/Sources/MicroClient/Responses/VoidRequest.swift +++ b/Sources/MicroClient/Responses/VoidRequest.swift @@ -1,2 +1,24 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + /// An empty request type. public struct VoidRequest: Encodable, Sendable {} diff --git a/Sources/MicroClient/Responses/VoidResponse.swift b/Sources/MicroClient/Responses/VoidResponse.swift index 7ac0a2d..3fae9a3 100644 --- a/Sources/MicroClient/Responses/VoidResponse.swift +++ b/Sources/MicroClient/Responses/VoidResponse.swift @@ -1,2 +1,24 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + /// An empty response type. public struct VoidResponse: Decodable, Sendable {} diff --git a/Sources/MicroClient/RetryStrategy.swift b/Sources/MicroClient/RetryStrategy.swift index b3fba4d..f2686e2 100644 --- a/Sources/MicroClient/RetryStrategy.swift +++ b/Sources/MicroClient/RetryStrategy.swift @@ -1,3 +1,25 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation /// The retry strategy for network requests. diff --git a/Sources/MicroClient/URLFormItem.swift b/Sources/MicroClient/URLFormItem.swift index 7fa4c04..458f7fb 100644 --- a/Sources/MicroClient/URLFormItem.swift +++ b/Sources/MicroClient/URLFormItem.swift @@ -1,3 +1,25 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation /// A single name-value pair from the form portion of a request. diff --git a/Tests/MicroClientTests/APIKeyInterceptorTests.swift b/Tests/MicroClientTests/APIKeyInterceptorTests.swift index 7542343..fff36f7 100644 --- a/Tests/MicroClientTests/APIKeyInterceptorTests.swift +++ b/Tests/MicroClientTests/APIKeyInterceptorTests.swift @@ -1,6 +1,27 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation import Testing - @testable import MicroClient @Suite("APIKeyInterceptor Tests") diff --git a/Tests/MicroClientTests/AcceptHeaderInterceptorTests.swift b/Tests/MicroClientTests/AcceptHeaderInterceptorTests.swift index 50de3b5..9254632 100644 --- a/Tests/MicroClientTests/AcceptHeaderInterceptorTests.swift +++ b/Tests/MicroClientTests/AcceptHeaderInterceptorTests.swift @@ -1,6 +1,27 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation import Testing - @testable import MicroClient @Suite("AcceptHeaderInterceptor Tests") diff --git a/Tests/MicroClientTests/BasicAuthInterceptorTests.swift b/Tests/MicroClientTests/BasicAuthInterceptorTests.swift index b840086..02d1f88 100644 --- a/Tests/MicroClientTests/BasicAuthInterceptorTests.swift +++ b/Tests/MicroClientTests/BasicAuthInterceptorTests.swift @@ -1,6 +1,27 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation import Testing - @testable import MicroClient @Suite("BasicAuthInterceptor Tests") diff --git a/Tests/MicroClientTests/BearerAuthorizationInterceptorTests.swift b/Tests/MicroClientTests/BearerAuthorizationInterceptorTests.swift index ac0b92b..58f19ee 100644 --- a/Tests/MicroClientTests/BearerAuthorizationInterceptorTests.swift +++ b/Tests/MicroClientTests/BearerAuthorizationInterceptorTests.swift @@ -1,6 +1,27 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation import Testing - @testable import MicroClient @Suite("BearerAuthorizationInterceptor Tests") diff --git a/Tests/MicroClientTests/CacheControlInterceptorTests.swift b/Tests/MicroClientTests/CacheControlInterceptorTests.swift index 3c46e4d..fca7af1 100644 --- a/Tests/MicroClientTests/CacheControlInterceptorTests.swift +++ b/Tests/MicroClientTests/CacheControlInterceptorTests.swift @@ -1,6 +1,27 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation import Testing - @testable import MicroClient @Suite("CacheControlInterceptor Tests") diff --git a/Tests/MicroClientTests/ContentTypeInterceptorTests.swift b/Tests/MicroClientTests/ContentTypeInterceptorTests.swift index f579dcc..e3dcfa9 100644 --- a/Tests/MicroClientTests/ContentTypeInterceptorTests.swift +++ b/Tests/MicroClientTests/ContentTypeInterceptorTests.swift @@ -1,6 +1,27 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation import Testing - @testable import MicroClient @Suite("ContentTypeInterceptor Tests") diff --git a/Tests/MicroClientTests/Doubles/HeaderInterceptor.swift b/Tests/MicroClientTests/Doubles/HeaderInterceptor.swift index faa1722..2fede8d 100644 --- a/Tests/MicroClientTests/Doubles/HeaderInterceptor.swift +++ b/Tests/MicroClientTests/Doubles/HeaderInterceptor.swift @@ -1,5 +1,26 @@ -import Foundation +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +import Foundation @testable import MicroClient struct HeaderInterceptor: NetworkRequestInterceptor { diff --git a/Tests/MicroClientTests/Doubles/InterceptorMock.swift b/Tests/MicroClientTests/Doubles/InterceptorMock.swift index 5ba4dc5..8fe1f56 100644 --- a/Tests/MicroClientTests/Doubles/InterceptorMock.swift +++ b/Tests/MicroClientTests/Doubles/InterceptorMock.swift @@ -1,5 +1,26 @@ -import Foundation +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +import Foundation @testable import MicroClient struct InterceptorMock: NetworkRequestInterceptor { diff --git a/Tests/MicroClientTests/Doubles/LoggerMock.swift b/Tests/MicroClientTests/Doubles/LoggerMock.swift index 1b11da5..08818ef 100644 --- a/Tests/MicroClientTests/Doubles/LoggerMock.swift +++ b/Tests/MicroClientTests/Doubles/LoggerMock.swift @@ -1,5 +1,26 @@ -import Foundation +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +import Foundation @testable import MicroClient final class LoggerMock: NetworkLogger, @unchecked Sendable { diff --git a/Tests/MicroClientTests/Doubles/MetricsCollectorMock.swift b/Tests/MicroClientTests/Doubles/MetricsCollectorMock.swift index 1aeda86..7c33605 100644 --- a/Tests/MicroClientTests/Doubles/MetricsCollectorMock.swift +++ b/Tests/MicroClientTests/Doubles/MetricsCollectorMock.swift @@ -1,5 +1,26 @@ -import Foundation +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +import Foundation @testable import MicroClient final class MetricsCollectorMock: MetricsCollector, @unchecked Sendable { diff --git a/Tests/MicroClientTests/Doubles/MockInterceptorStorage.swift b/Tests/MicroClientTests/Doubles/MockInterceptorStorage.swift index 009866b..59b4981 100644 --- a/Tests/MicroClientTests/Doubles/MockInterceptorStorage.swift +++ b/Tests/MicroClientTests/Doubles/MockInterceptorStorage.swift @@ -1,3 +1,25 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + actor MockInterceptorStorage { // MARK: - Properties diff --git a/Tests/MicroClientTests/Doubles/ResponseInterceptorMock.swift b/Tests/MicroClientTests/Doubles/ResponseInterceptorMock.swift index 04536e2..8262a42 100644 --- a/Tests/MicroClientTests/Doubles/ResponseInterceptorMock.swift +++ b/Tests/MicroClientTests/Doubles/ResponseInterceptorMock.swift @@ -1,5 +1,26 @@ -import Foundation +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +import Foundation @testable import MicroClient final class ResponseInterceptorMock: NetworkResponseInterceptor, @unchecked Sendable { diff --git a/Tests/MicroClientTests/Doubles/ThrowingInterceptor.swift b/Tests/MicroClientTests/Doubles/ThrowingInterceptor.swift index cf7f9c5..a4ccf8b 100644 --- a/Tests/MicroClientTests/Doubles/ThrowingInterceptor.swift +++ b/Tests/MicroClientTests/Doubles/ThrowingInterceptor.swift @@ -1,5 +1,26 @@ -import Foundation +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +import Foundation @testable import MicroClient struct ThrowingInterceptor: NetworkRequestInterceptor { diff --git a/Tests/MicroClientTests/Doubles/URLSessionMock.swift b/Tests/MicroClientTests/Doubles/URLSessionMock.swift index 3883155..d22cceb 100644 --- a/Tests/MicroClientTests/Doubles/URLSessionMock.swift +++ b/Tests/MicroClientTests/Doubles/URLSessionMock.swift @@ -1,5 +1,26 @@ -import Foundation +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +import Foundation @testable import MicroClient final class URLSessionMock: URLSessionProtocol, @unchecked Sendable { diff --git a/Tests/MicroClientTests/Fixtures/NetworkClientMother.swift b/Tests/MicroClientTests/Fixtures/NetworkClientMother.swift index 19e5d22..0bf8eff 100644 --- a/Tests/MicroClientTests/Fixtures/NetworkClientMother.swift +++ b/Tests/MicroClientTests/Fixtures/NetworkClientMother.swift @@ -1,5 +1,26 @@ -import Foundation +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +import Foundation @testable import MicroClient // swiftlint:disable force_unwrapping diff --git a/Tests/MicroClientTests/Fixtures/TestModelMother.swift b/Tests/MicroClientTests/Fixtures/TestModelMother.swift index 3120215..ceb4c38 100644 --- a/Tests/MicroClientTests/Fixtures/TestModelMother.swift +++ b/Tests/MicroClientTests/Fixtures/TestModelMother.swift @@ -1,5 +1,26 @@ -import Foundation +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +import Foundation @testable import MicroClient // MARK: - NetworkClient Test Models @@ -74,15 +95,6 @@ struct ComplexModel: Decodable, Equatable { let timestamps: [Date] let isActive: Bool - static func == ( - lhs: ComplexModel, - rhs: ComplexModel - ) -> Bool { - lhs.id == rhs.id && - lhs.metadata == rhs.metadata && - lhs.timestamps == rhs.timestamps && - lhs.isActive == rhs.isActive - } } enum TestModelMother { diff --git a/Tests/MicroClientTests/HTTPMethodTests.swift b/Tests/MicroClientTests/HTTPMethodTests.swift index f50d506..1f12b1c 100644 --- a/Tests/MicroClientTests/HTTPMethodTests.swift +++ b/Tests/MicroClientTests/HTTPMethodTests.swift @@ -1,5 +1,26 @@ -import Testing +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +import Testing @testable import MicroClient @Suite("HTTPMethod Tests") diff --git a/Tests/MicroClientTests/MetricsCollectionInterceptorTests.swift b/Tests/MicroClientTests/MetricsCollectionInterceptorTests.swift index a63101c..d238a49 100644 --- a/Tests/MicroClientTests/MetricsCollectionInterceptorTests.swift +++ b/Tests/MicroClientTests/MetricsCollectionInterceptorTests.swift @@ -1,6 +1,27 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation import Testing - @testable import MicroClient @Suite("MetricsCollectionInterceptor Tests") diff --git a/Tests/MicroClientTests/NetworkClientCancellationTests.swift b/Tests/MicroClientTests/NetworkClientCancellationTests.swift index 99ac47f..9e5c388 100644 --- a/Tests/MicroClientTests/NetworkClientCancellationTests.swift +++ b/Tests/MicroClientTests/NetworkClientCancellationTests.swift @@ -1,6 +1,27 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation import Testing - @testable import MicroClient @Suite("NetworkClient Cancellation Tests") diff --git a/Tests/MicroClientTests/NetworkClientErrorHandlingTests.swift b/Tests/MicroClientTests/NetworkClientErrorHandlingTests.swift index 99bfed0..9fd7970 100644 --- a/Tests/MicroClientTests/NetworkClientErrorHandlingTests.swift +++ b/Tests/MicroClientTests/NetworkClientErrorHandlingTests.swift @@ -1,7 +1,28 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Combine import Foundation import Testing - @testable import MicroClient @Suite("NetworkClient Error Handling Tests") diff --git a/Tests/MicroClientTests/NetworkClientLoggingTests.swift b/Tests/MicroClientTests/NetworkClientLoggingTests.swift index a64ce50..4973346 100644 --- a/Tests/MicroClientTests/NetworkClientLoggingTests.swift +++ b/Tests/MicroClientTests/NetworkClientLoggingTests.swift @@ -1,6 +1,27 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation import Testing - @testable import MicroClient @Suite("NetworkClient Logging Tests") @@ -59,7 +80,7 @@ struct NetworkClientLoggingTests { } @Test("It should log error on failure") - func logErrorOnFailure() async throws { + func logErrorOnFailure() async { let mockLogger = LoggerMock() let mockSession = NetworkClientMother.makeMockSession() let client = NetworkClientMother.makeNetworkClient( @@ -84,7 +105,7 @@ struct NetworkClientLoggingTests { } @Test("It should log retries") - func logRetries() async throws { + func logRetries() async { let mockLogger = LoggerMock() let mockSession = NetworkClientMother.makeMockSession() let client = NetworkClientMother.makeNetworkClient( diff --git a/Tests/MicroClientTests/NetworkClientRetryTests.swift b/Tests/MicroClientTests/NetworkClientRetryTests.swift index 8e8c7e7..551b601 100644 --- a/Tests/MicroClientTests/NetworkClientRetryTests.swift +++ b/Tests/MicroClientTests/NetworkClientRetryTests.swift @@ -1,6 +1,27 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation import Testing - @testable import MicroClient @Suite("NetworkClient Retry Tests") @@ -34,7 +55,7 @@ struct NetworkClientRetryTests { } @Test("It should retry on failure up to the specified count") - func retryOnFailure() async throws { + func retryOnFailure() async { let mockSession = NetworkClientMother.makeMockSession() let client = NetworkClientMother.makeNetworkClient( session: mockSession, @@ -57,7 +78,7 @@ struct NetworkClientRetryTests { } @Test("It should not retry when strategy is .none") - func notRetryWhenStrategyIsNone() async throws { + func notRetryWhenStrategyIsNone() async { let mockSession = NetworkClientMother.makeMockSession() let client = NetworkClientMother.makeNetworkClient( session: mockSession, @@ -80,7 +101,7 @@ struct NetworkClientRetryTests { } @Test("Request-specific retry strategy should override configuration") - func requestSpecificRetryOverridesConfiguration() async throws { + func requestSpecificRetryOverridesConfiguration() async { let mockSession = NetworkClientMother.makeMockSession() let client = NetworkClientMother.makeNetworkClient( session: mockSession, diff --git a/Tests/MicroClientTests/NetworkClientTests.swift b/Tests/MicroClientTests/NetworkClientTests.swift index c6d25ef..bbb48fd 100644 --- a/Tests/MicroClientTests/NetworkClientTests.swift +++ b/Tests/MicroClientTests/NetworkClientTests.swift @@ -1,6 +1,27 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation import Testing - @testable import MicroClient // swiftlint:disable type_body_length diff --git a/Tests/MicroClientTests/NetworkConfigurationTests.swift b/Tests/MicroClientTests/NetworkConfigurationTests.swift index 96cedd3..1370e7e 100644 --- a/Tests/MicroClientTests/NetworkConfigurationTests.swift +++ b/Tests/MicroClientTests/NetworkConfigurationTests.swift @@ -1,6 +1,27 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation import Testing - @testable import MicroClient @Suite("NetworkConfiguration Tests") diff --git a/Tests/MicroClientTests/NetworkRequestDecodingTests.swift b/Tests/MicroClientTests/NetworkRequestDecodingTests.swift index e9f4228..2298354 100644 --- a/Tests/MicroClientTests/NetworkRequestDecodingTests.swift +++ b/Tests/MicroClientTests/NetworkRequestDecodingTests.swift @@ -1,6 +1,27 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation import Testing - @testable import MicroClient @Suite("NetworkRequest Decoding Tests") diff --git a/Tests/MicroClientTests/NetworkRequestEncodingTests.swift b/Tests/MicroClientTests/NetworkRequestEncodingTests.swift index c9d2b9a..9b0010c 100644 --- a/Tests/MicroClientTests/NetworkRequestEncodingTests.swift +++ b/Tests/MicroClientTests/NetworkRequestEncodingTests.swift @@ -1,6 +1,27 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation import Testing - @testable import MicroClient @Suite("NetworkRequest Encoding Tests") diff --git a/Tests/MicroClientTests/NetworkRequestHTTPBodyTests.swift b/Tests/MicroClientTests/NetworkRequestHTTPBodyTests.swift index e851975..929001e 100644 --- a/Tests/MicroClientTests/NetworkRequestHTTPBodyTests.swift +++ b/Tests/MicroClientTests/NetworkRequestHTTPBodyTests.swift @@ -1,6 +1,27 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation import Testing - @testable import MicroClient @Suite("NetworkRequest HTTP Body Tests") diff --git a/Tests/MicroClientTests/NetworkRequestHeadersTests.swift b/Tests/MicroClientTests/NetworkRequestHeadersTests.swift index a0b2661..491829b 100644 --- a/Tests/MicroClientTests/NetworkRequestHeadersTests.swift +++ b/Tests/MicroClientTests/NetworkRequestHeadersTests.swift @@ -1,6 +1,27 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation import Testing - @testable import MicroClient @Suite("NetworkRequest Headers Tests") diff --git a/Tests/MicroClientTests/NetworkRequestQueryItemsTests.swift b/Tests/MicroClientTests/NetworkRequestQueryItemsTests.swift index d7e6204..9fd6708 100644 --- a/Tests/MicroClientTests/NetworkRequestQueryItemsTests.swift +++ b/Tests/MicroClientTests/NetworkRequestQueryItemsTests.swift @@ -1,6 +1,27 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation import Testing - @testable import MicroClient @Suite("NetworkRequest Query Items Tests") diff --git a/Tests/MicroClientTests/NetworkRequestTests.swift b/Tests/MicroClientTests/NetworkRequestTests.swift index 5918dd6..f279a6e 100644 --- a/Tests/MicroClientTests/NetworkRequestTests.swift +++ b/Tests/MicroClientTests/NetworkRequestTests.swift @@ -1,6 +1,27 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation import Testing - @testable import MicroClient @Suite("NetworkRequest Tests") diff --git a/Tests/MicroClientTests/NetworkResponseComplexModelsTests.swift b/Tests/MicroClientTests/NetworkResponseComplexModelsTests.swift index 31154f9..d8655f4 100644 --- a/Tests/MicroClientTests/NetworkResponseComplexModelsTests.swift +++ b/Tests/MicroClientTests/NetworkResponseComplexModelsTests.swift @@ -1,6 +1,27 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation import Testing - @testable import MicroClient @Suite("NetworkResponse with Complex Models Tests") diff --git a/Tests/MicroClientTests/NetworkResponseTests.swift b/Tests/MicroClientTests/NetworkResponseTests.swift index a904300..3cb65f6 100644 --- a/Tests/MicroClientTests/NetworkResponseTests.swift +++ b/Tests/MicroClientTests/NetworkResponseTests.swift @@ -1,6 +1,27 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation import Testing - @testable import MicroClient @Suite("NetworkResponse Tests") diff --git a/Tests/MicroClientTests/RequestIDInterceptorTests.swift b/Tests/MicroClientTests/RequestIDInterceptorTests.swift index 75ba8df..92e24e1 100644 --- a/Tests/MicroClientTests/RequestIDInterceptorTests.swift +++ b/Tests/MicroClientTests/RequestIDInterceptorTests.swift @@ -1,6 +1,27 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation import Testing - @testable import MicroClient @Suite("RequestIDInterceptor Tests") diff --git a/Tests/MicroClientTests/ResponseLoggingInterceptorTests.swift b/Tests/MicroClientTests/ResponseLoggingInterceptorTests.swift index 9f6fb96..1c01620 100644 --- a/Tests/MicroClientTests/ResponseLoggingInterceptorTests.swift +++ b/Tests/MicroClientTests/ResponseLoggingInterceptorTests.swift @@ -1,6 +1,27 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation import Testing - @testable import MicroClient @Suite("ResponseLoggingInterceptor Tests") diff --git a/Tests/MicroClientTests/RetryAfterInterceptorTests.swift b/Tests/MicroClientTests/RetryAfterInterceptorTests.swift index 3cf396b..fdf3806 100644 --- a/Tests/MicroClientTests/RetryAfterInterceptorTests.swift +++ b/Tests/MicroClientTests/RetryAfterInterceptorTests.swift @@ -1,6 +1,27 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation import Testing - @testable import MicroClient @Suite("RetryAfterInterceptor Tests") diff --git a/Tests/MicroClientTests/StatusCodeValidationInterceptorTests.swift b/Tests/MicroClientTests/StatusCodeValidationInterceptorTests.swift index 568769a..f488bcc 100644 --- a/Tests/MicroClientTests/StatusCodeValidationInterceptorTests.swift +++ b/Tests/MicroClientTests/StatusCodeValidationInterceptorTests.swift @@ -1,6 +1,27 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation import Testing - @testable import MicroClient @Suite("StatusCodeValidationInterceptor Tests") diff --git a/Tests/MicroClientTests/TimeoutInterceptorTests.swift b/Tests/MicroClientTests/TimeoutInterceptorTests.swift index d70ed49..9f3bc4a 100644 --- a/Tests/MicroClientTests/TimeoutInterceptorTests.swift +++ b/Tests/MicroClientTests/TimeoutInterceptorTests.swift @@ -1,6 +1,27 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation import Testing - @testable import MicroClient @Suite("TimeoutInterceptor Tests") diff --git a/Tests/MicroClientTests/URLFormItemArrayExtensionTests.swift b/Tests/MicroClientTests/URLFormItemArrayExtensionTests.swift index 99eff1c..02994c2 100644 --- a/Tests/MicroClientTests/URLFormItemArrayExtensionTests.swift +++ b/Tests/MicroClientTests/URLFormItemArrayExtensionTests.swift @@ -1,5 +1,26 @@ -import Testing +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +import Testing @testable import MicroClient @Suite("URLFormItem Array Extension Tests") diff --git a/Tests/MicroClientTests/URLFormItemTests.swift b/Tests/MicroClientTests/URLFormItemTests.swift index 5757e74..5132837 100644 --- a/Tests/MicroClientTests/URLFormItemTests.swift +++ b/Tests/MicroClientTests/URLFormItemTests.swift @@ -1,5 +1,26 @@ -import Testing +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +import Testing @testable import MicroClient @Suite("URLFormItem Tests") diff --git a/Tests/MicroClientTests/UserAgentInterceptorTests.swift b/Tests/MicroClientTests/UserAgentInterceptorTests.swift index 4a7992f..c909ba7 100644 --- a/Tests/MicroClientTests/UserAgentInterceptorTests.swift +++ b/Tests/MicroClientTests/UserAgentInterceptorTests.swift @@ -1,6 +1,27 @@ +// MIT License +// +// Copyright (c) 2026 Otávio C. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + import Foundation import Testing - @testable import MicroClient @Suite("UserAgentInterceptor Tests")