From f49b4c9a356ee031ec3874354f4d273174e5c570 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Apr 2024 22:19:44 +0000 Subject: [PATCH] Make Sendable and Add Swift 6.0 Build (#25) * Bump github.com/apple/swift-openapi-generator from 1.2.1 to 1.4.0 Bumps [github.com/apple/swift-openapi-generator](https://github.com/apple/swift-openapi-generator) from 1.2.1 to 1.4.0. - [Release notes](https://github.com/apple/swift-openapi-generator/releases) - [Commits](https://github.com/apple/swift-openapi-generator/compare/1.2.1...1.4.0) --- updated-dependencies: - dependency-name: github.com/apple/swift-openapi-generator dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Bump github.com/apple/swift-openapi-urlsession from 1.0.0 to 1.0.2 Bumps [github.com/apple/swift-openapi-urlsession](https://github.com/apple/swift-openapi-urlsession) from 1.0.0 to 1.0.2. - [Release notes](https://github.com/apple/swift-openapi-urlsession/releases) - [Commits](https://github.com/apple/swift-openapi-urlsession/compare/1.0.0...1.0.2) --- updated-dependencies: - dependency-name: github.com/apple/swift-openapi-urlsession dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Bump github.com/apple/swift-openapi-runtime from 1.3.2 to 1.6.0 Bumps [github.com/apple/swift-openapi-runtime](https://github.com/apple/swift-openapi-runtime) from 1.3.2 to 1.6.0. - [Release notes](https://github.com/apple/swift-openapi-runtime/releases) - [Commits](https://github.com/apple/swift-openapi-runtime/compare/1.3.2...1.6.0) --- updated-dependencies: - dependency-name: github.com/apple/swift-openapi-runtime dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Bump github.com/apple/swift-openapi-runtime from 1.3.2 to 1.4.0 Bumps [github.com/apple/swift-openapi-runtime](https://github.com/apple/swift-openapi-runtime) from 1.3.2 to 1.4.0. - [Release notes](https://github.com/apple/swift-openapi-runtime/releases) - [Commits](https://github.com/apple/swift-openapi-runtime/compare/1.3.2...1.4.0) --- updated-dependencies: - dependency-name: github.com/apple/swift-openapi-runtime dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * adding dev container * adding ci update (#18) * Setting up Package for Swift 6 * setting up swift 6 * fixing swift 5.9 --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .devcontainer/devcontainer.json | 39 +++++++++++ .devcontainer/swift-5.9/devcontainer.json | 39 +++++++++++ .devcontainer/swift-6.0/devcontainer.json | 39 +++++++++++ .github/workflows/IPSWDownloads.yml | 28 +++++--- Package.resolved | 32 ++++----- Package.swift | 3 +- Package@swift-6.swift | 70 ++++++++++++++++++++ Sources/IPSWDownloads/Board.swift | 2 +- Sources/IPSWDownloads/Data.swift | 3 +- Sources/IPSWDownloads/Device.swift | 2 +- Sources/IPSWDownloads/Firmware.swift | 4 +- Sources/IPSWDownloads/FirmwareType.swift | 2 +- Sources/IPSWDownloads/Generated/Client.swift | 16 ++--- Sources/IPSWDownloads/Generated/Types.swift | 33 ++++++--- Sources/IPSWDownloads/IPSWDownloads.swift | 6 +- Sources/IPSWDownloads/RuntimeError.swift | 2 +- Sources/IPSWDownloads/URL.swift | 2 +- 17 files changed, 267 insertions(+), 55 deletions(-) create mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/swift-5.9/devcontainer.json create mode 100644 .devcontainer/swift-6.0/devcontainer.json create mode 100644 Package@swift-6.swift diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..068475e --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,39 @@ +{ + "name": "Swift", + "image": "swift:6.0", + "features": { + "ghcr.io/devcontainers/features/common-utils:2": { + "installZsh": "false", + "username": "vscode", + "upgradePackages": "false" + }, + "ghcr.io/devcontainers/features/git:1": { + "version": "os-provided", + "ppa": "false" + } + }, + "runArgs": [ + "--cap-add=SYS_PTRACE", + "--security-opt", + "seccomp=unconfined" + ], + // Configure tool-specific properties. + "customizations": { + // Configure properties specific to VS Code. + "vscode": { + // Set *default* container specific settings.json values on container create. + "settings": { + "lldb.library": "/usr/lib/liblldb.so" + }, + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "sswg.swift-lang" + ] + } + }, + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. + "remoteUser": "vscode" +} diff --git a/.devcontainer/swift-5.9/devcontainer.json b/.devcontainer/swift-5.9/devcontainer.json new file mode 100644 index 0000000..0da5c5f --- /dev/null +++ b/.devcontainer/swift-5.9/devcontainer.json @@ -0,0 +1,39 @@ +{ + "name": "Swift", + "image": "swift:5.9", + "features": { + "ghcr.io/devcontainers/features/common-utils:2": { + "installZsh": "false", + "username": "vscode", + "upgradePackages": "false" + }, + "ghcr.io/devcontainers/features/git:1": { + "version": "os-provided", + "ppa": "false" + } + }, + "runArgs": [ + "--cap-add=SYS_PTRACE", + "--security-opt", + "seccomp=unconfined" + ], + // Configure tool-specific properties. + "customizations": { + // Configure properties specific to VS Code. + "vscode": { + // Set *default* container specific settings.json values on container create. + "settings": { + "lldb.library": "/usr/lib/liblldb.so" + }, + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "sswg.swift-lang" + ] + } + }, + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. + "remoteUser": "root" +} diff --git a/.devcontainer/swift-6.0/devcontainer.json b/.devcontainer/swift-6.0/devcontainer.json new file mode 100644 index 0000000..068475e --- /dev/null +++ b/.devcontainer/swift-6.0/devcontainer.json @@ -0,0 +1,39 @@ +{ + "name": "Swift", + "image": "swift:6.0", + "features": { + "ghcr.io/devcontainers/features/common-utils:2": { + "installZsh": "false", + "username": "vscode", + "upgradePackages": "false" + }, + "ghcr.io/devcontainers/features/git:1": { + "version": "os-provided", + "ppa": "false" + } + }, + "runArgs": [ + "--cap-add=SYS_PTRACE", + "--security-opt", + "seccomp=unconfined" + ], + // Configure tool-specific properties. + "customizations": { + // Configure properties specific to VS Code. + "vscode": { + // Set *default* container specific settings.json values on container create. + "settings": { + "lldb.library": "/usr/lib/liblldb.so" + }, + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "sswg.swift-lang" + ] + } + }, + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. + "remoteUser": "vscode" +} diff --git a/.github/workflows/IPSWDownloads.yml b/.github/workflows/IPSWDownloads.yml index 71725c8..4e6c4b4 100644 --- a/.github/workflows/IPSWDownloads.yml +++ b/.github/workflows/IPSWDownloads.yml @@ -15,7 +15,7 @@ jobs: strategy: matrix: runs-on: [ubuntu-20.04, ubuntu-22.04] - swift-version: [5.9, "5.10"] + swift-version: [5.9, "5.10", "6.0"] steps: - uses: actions/checkout@v4 - name: Cache swift package modules @@ -58,7 +58,7 @@ jobs: - name: Prepare Code Coverage run: llvm-cov export -format="lcov" .build/x86_64-unknown-linux-gnu/debug/${{ env.PACKAGE_NAME }}PackageTests.xctest -instr-profile .build/debug/codecov/default.profdata > info.lcov - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} flags: spm,${{ env.RELEASE_NAME }},${{ env.SWIFT_VER }} @@ -89,6 +89,12 @@ jobs: watchOSVersion: "10.2" watchName: "Apple Watch Ultra 2 (49mm)" iPhoneName: "iPhone 15 Pro Max" + - runs-on: macos-15 + xcode: "/Applications/Xcode_16.1.app" + iOSVersion: "18.1" + watchOSVersion: "11.1" + watchName: "Apple Watch Ultra 2 (49mm)" + iPhoneName: "iPhone 16" steps: - uses: actions/checkout@v4 - name: Cache swift package modules @@ -104,7 +110,7 @@ jobs: ${{ runner.os }}-build- ${{ runner.os }}- - name: Cache mint - if: ${{ github.event_name == 'pull_request' && ( github.base_ref == 'main' || endsWith( github.ref_name , 'Prep') ) && matrix.xcode == '/Applications/Xcode_15.2.app' }} + if: ${{ github.event_name == 'pull_request' && ( github.base_ref == 'main' || endsWith( github.ref_name , 'Prep') ) && matrix.xcode == '/Applications/Xcode_16.1.app' }} id: cache-mint uses: actions/cache@v4 env: @@ -121,7 +127,7 @@ jobs: - name: Setup Xcode run: sudo xcode-select -s ${{ matrix.xcode }}/Contents/Developer - name: Install mint - if: ${{ github.event_name == 'pull_request' && ( github.base_ref == 'main' || endsWith( github.ref_name , 'Prep') ) && matrix.xcode == '/Applications/Xcode_15.2.app' }} + if: ${{ github.event_name == 'pull_request' && ( github.base_ref == 'main' || endsWith( github.ref_name , 'Prep') ) && matrix.xcode == '/Applications/Xcode_16.1.app' }} run: | brew update brew install mint @@ -130,6 +136,8 @@ jobs: - name: Run Swift Package tests run: swift test -v --enable-code-coverage - uses: sersoft-gmbh/swift-coverage-action@v4 + with: + fail-on-empty-output: true - name: Upload SPM to CodeCov.io run: bash <(curl https://codecov.io/bash) -F spm -F macOS -F ${XCODE_NAME} env: @@ -138,20 +146,22 @@ jobs: run: rm -rf .build - name: Lint run: ./scripts/lint.sh - if: ${{ github.event_name == 'pull_request' && ( github.base_ref == 'main' || endsWith( github.ref_name , 'Prep') ) && matrix.xcode == '/Applications/Xcode_15.2.app' }} + if: ${{ github.event_name == 'pull_request' && ( github.base_ref == 'main' || endsWith( github.ref_name , 'Prep') ) && matrix.xcode == '/Applications/Xcode_16.1.app' }} - name: Run iOS target tests - run: xcodebuild test -scheme IPSWDownloads -sdk iphonesimulator -destination 'platform=iOS Simulator,name=${{ matrix.iPhoneName }},OS=${{ matrix.iOSVersion }}' -enableCodeCoverage YES build test + run: xcodebuild test -scheme ${{ env.PACKAGE_NAME }} -sdk iphonesimulator -destination 'platform=iOS Simulator,name=${{ matrix.iPhoneName }},OS=${{ matrix.iOSVersion }}' -enableCodeCoverage YES build test - uses: sersoft-gmbh/swift-coverage-action@v4 - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} flags: iOS,iOS${{ matrix.iOSVersion }},macOS,${{ env.XCODE_NAME }} - name: Run watchOS target tests - run: xcodebuild test -scheme IPSWDownloads -sdk watchsimulator -destination 'platform=watchOS Simulator,name=${{ matrix.watchName }},OS=${{ matrix.watchOSVersion }}' -enableCodeCoverage YES build test + run: xcodebuild test -scheme ${{ env.PACKAGE_NAME }} -sdk watchsimulator -destination 'platform=watchOS Simulator,name=${{ matrix.watchName }},OS=${{ matrix.watchOSVersion }}' -enableCodeCoverage YES build test - uses: sersoft-gmbh/swift-coverage-action@v4 + with: + fail-on-empty-output: true - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} flags: watchOS,watchOS${{ matrix.watchOSVersion }},macOS,${{ env.XCODE_NAME }} diff --git a/Package.resolved b/Package.resolved index cbb1bb8..2e35865 100644 --- a/Package.resolved +++ b/Package.resolved @@ -5,8 +5,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/mattpolzin/OpenAPIKit", "state" : { - "revision" : "283454875cc6e5b2801d184d65835b92252d1784", - "version" : "3.1.2" + "revision" : "5b5ee49624dda5b3e3b85aff184f44a007862fb7", + "version" : "3.3.0" } }, { @@ -32,8 +32,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-argument-parser", "state" : { - "revision" : "c8ed701b513cf5177118a175d85fbbbcd707ab41", - "version" : "1.3.0" + "revision" : "41982a3656a71c768319979febd796c6fd111d5c", + "version" : "1.5.0" } }, { @@ -41,8 +41,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-collections", "state" : { - "revision" : "d029d9d39c87bed85b1c50adee7c41795261a192", - "version" : "1.0.6" + "revision" : "671108c96644956dddcd89dd59c203dcdb36cec7", + "version" : "1.1.4" } }, { @@ -50,8 +50,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-http-types", "state" : { - "revision" : "1827dc94bdab2eb5f2fc804e9b0cb43574282566", - "version" : "1.0.2" + "revision" : "ae67c8178eb46944fd85e4dc6dd970e1f3ed6ccd", + "version" : "1.3.0" } }, { @@ -68,8 +68,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-openapi-generator", "state" : { - "revision" : "7992d77065f2787e7651cf6d9be9b99ad38f5166", - "version" : "1.2.1" + "revision" : "9727261219af435e7e668b8813187e9bf5d61927", + "version" : "1.4.0" } }, { @@ -77,8 +77,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-openapi-runtime", "state" : { - "revision" : "76951d77a0609599d2dc233e7e40808a74767c6a", - "version" : "1.3.2" + "revision" : "daa2fb54fe4a7f5187d7286047d5144c8cb97477", + "version" : "1.6.0" } }, { @@ -86,8 +86,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-openapi-urlsession", "state" : { - "revision" : "aac0a8273fa1186641e0b336da3f1be01aa6a0eb", - "version" : "1.0.0" + "revision" : "9bf4c712ad7989d6a91dbe68748b8829a50837e4", + "version" : "1.0.2" } }, { @@ -95,8 +95,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/jpsim/Yams", "state" : { - "revision" : "0d9ee7ea8c4ebd4a489ad7a73d5c6cad55d6fed3", - "version" : "5.0.6" + "revision" : "3036ba9d69cf1fd04d433527bc339dc0dc75433d", + "version" : "5.1.3" } } ], diff --git a/Package.swift b/Package.swift index dcb5e72..6956fe4 100644 --- a/Package.swift +++ b/Package.swift @@ -42,7 +42,8 @@ let package = Package( .enableUpcomingFeature("ImplicitOpenExistentials"), .enableUpcomingFeature("StrictConcurrency"), .enableUpcomingFeature("DisableOutwardActorInference"), - .enableExperimentalFeature("StrictConcurrency") + .enableExperimentalFeature("StrictConcurrency"), + .enableExperimentalFeature("AccessLevelOnImport") ] ), .testTarget( diff --git a/Package@swift-6.swift b/Package@swift-6.swift new file mode 100644 index 0000000..e095ca1 --- /dev/null +++ b/Package@swift-6.swift @@ -0,0 +1,70 @@ +// swift-tools-version: 6.0 +// swiftlint:disable explicit_acl explicit_top_level_acl +import PackageDescription + +let swiftSettings: [SwiftSetting] = [ + SwiftSetting.enableExperimentalFeature("AccessLevelOnImport"), + SwiftSetting.enableExperimentalFeature("BitwiseCopyable"), + SwiftSetting.enableExperimentalFeature("GlobalActorIsolatedTypesUsability"), + SwiftSetting.enableExperimentalFeature("IsolatedAny"), + SwiftSetting.enableExperimentalFeature("MoveOnlyPartialConsumption"), + SwiftSetting.enableExperimentalFeature("NestedProtocols"), + SwiftSetting.enableExperimentalFeature("NoncopyableGenerics"), + SwiftSetting.enableExperimentalFeature("RegionBasedIsolation"), + SwiftSetting.enableExperimentalFeature("TransferringArgsAndResults"), + SwiftSetting.enableExperimentalFeature("VariadicGenerics"), + + SwiftSetting.enableUpcomingFeature("FullTypedThrows"), + SwiftSetting.enableUpcomingFeature("InternalImportsByDefault") + +// SwiftSetting.unsafeFlags([ +// "-Xfrontend", +// "-warn-long-function-bodies=100" +// ]), +// SwiftSetting.unsafeFlags([ +// "-Xfrontend", +// "-warn-long-expression-type-checking=100" +// ]) +] + +let package = Package( + name: "IPSWDownloads", + platforms: [.macOS(.v10_15), .iOS(.v13), .tvOS(.v13), .watchOS(.v6), .visionOS(.v1)], + products: [ + .library(name: "IPSWDownloads", targets: ["IPSWDownloads"]) + ], + dependencies: [ + .package( + url: "https://github.com/brightdigit/OperatingSystemVersion", + from: "1.0.0-beta.1" + ), + .package( + url: "https://github.com/apple/swift-openapi-generator", + from: "1.0.0" + ), + .package( + url: "https://github.com/apple/swift-openapi-runtime", + from: "1.0.0" + ), + .package( + url: "https://github.com/apple/swift-openapi-urlsession", + from: "1.0.0" + ) + ], + targets: [ + .target( + name: "IPSWDownloads", + dependencies: [ + .product(name: "OperatingSystemVersion", package: "OperatingSystemVersion"), + .product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"), + .product(name: "OpenAPIURLSession", package: "swift-openapi-urlsession") + ], + swiftSettings: swiftSettings + ), + .testTarget( + name: "IPSWDownloadsTests", + dependencies: ["IPSWDownloads"] + ) + ] +) +// swiftlint:enable explicit_acl explicit_top_level_acl diff --git a/Sources/IPSWDownloads/Board.swift b/Sources/IPSWDownloads/Board.swift index 91c08fb..6ebce60 100644 --- a/Sources/IPSWDownloads/Board.swift +++ b/Sources/IPSWDownloads/Board.swift @@ -27,7 +27,7 @@ // OTHER DEALINGS IN THE SOFTWARE. // -import Foundation +public import Foundation /// A struct representing a board with configuration details. public struct Board: Sendable, Codable, Hashable, Equatable { diff --git a/Sources/IPSWDownloads/Data.swift b/Sources/IPSWDownloads/Data.swift index 6d96730..88e7d75 100644 --- a/Sources/IPSWDownloads/Data.swift +++ b/Sources/IPSWDownloads/Data.swift @@ -27,7 +27,8 @@ // OTHER DEALINGS IN THE SOFTWARE. // -import Foundation +public import Foundation + extension Data { internal init(hexString: String) throws { var data = Data(capacity: hexString.count / 2) diff --git a/Sources/IPSWDownloads/Device.swift b/Sources/IPSWDownloads/Device.swift index f2636ac..9d18ef7 100644 --- a/Sources/IPSWDownloads/Device.swift +++ b/Sources/IPSWDownloads/Device.swift @@ -27,7 +27,7 @@ // OTHER DEALINGS IN THE SOFTWARE. // -import Foundation +public import Foundation /// A struct representing an Apple device along with its firmware and supported boards. public struct Device: Sendable, Codable, Hashable, Equatable { diff --git a/Sources/IPSWDownloads/Firmware.swift b/Sources/IPSWDownloads/Firmware.swift index 23ec356..090665b 100644 --- a/Sources/IPSWDownloads/Firmware.swift +++ b/Sources/IPSWDownloads/Firmware.swift @@ -27,8 +27,8 @@ // OTHER DEALINGS IN THE SOFTWARE. // -import Foundation -import OperatingSystemVersion +public import Foundation +public import OperatingSystemVersion /// A struct representing firmware details of a device. public struct Firmware: Sendable, Codable, Hashable, Equatable { diff --git a/Sources/IPSWDownloads/FirmwareType.swift b/Sources/IPSWDownloads/FirmwareType.swift index 5aed0f2..a77ed25 100644 --- a/Sources/IPSWDownloads/FirmwareType.swift +++ b/Sources/IPSWDownloads/FirmwareType.swift @@ -27,7 +27,7 @@ // OTHER DEALINGS IN THE SOFTWARE. // -import Foundation +public import Foundation /// Type of Firmware file. public enum FirmwareType: String, Sendable, Codable, Hashable, Equatable { diff --git a/Sources/IPSWDownloads/Generated/Client.swift b/Sources/IPSWDownloads/Generated/Client.swift index 74c4f61..3b2d100 100644 --- a/Sources/IPSWDownloads/Generated/Client.swift +++ b/Sources/IPSWDownloads/Generated/Client.swift @@ -1,15 +1,15 @@ // Generated by swift-openapi-generator, do not modify. -@_spi(Generated) import OpenAPIRuntime +@_spi(Generated) public import OpenAPIRuntime #if os(Linux) -@preconcurrency import struct Foundation.URL -@preconcurrency import struct Foundation.Data -@preconcurrency import struct Foundation.Date +@preconcurrency public import struct Foundation.URL +@preconcurrency public import struct Foundation.Data +@preconcurrency public import struct Foundation.Date #else -import struct Foundation.URL -import struct Foundation.Data -import struct Foundation.Date +public import struct Foundation.URL +public import struct Foundation.Data +public import struct Foundation.Date #endif -import HTTPTypes +public import HTTPTypes /// Download current and previous versions of Apple's iOS Firmware, iTunes and OTA updates. internal struct Client: APIProtocol { /// The underlying HTTP client. diff --git a/Sources/IPSWDownloads/Generated/Types.swift b/Sources/IPSWDownloads/Generated/Types.swift index c842f81..9076431 100644 --- a/Sources/IPSWDownloads/Generated/Types.swift +++ b/Sources/IPSWDownloads/Generated/Types.swift @@ -1,13 +1,13 @@ // Generated by swift-openapi-generator, do not modify. -@_spi(Generated) import OpenAPIRuntime +@_spi(Generated) public import OpenAPIRuntime #if os(Linux) -@preconcurrency import struct Foundation.URL -@preconcurrency import struct Foundation.Data -@preconcurrency import struct Foundation.Date +@preconcurrency public import struct Foundation.URL +@preconcurrency public import struct Foundation.Data +@preconcurrency public import struct Foundation.Date #else -import struct Foundation.URL -import struct Foundation.Data -import struct Foundation.Date +public import struct Foundation.URL +public import struct Foundation.Data +public import struct Foundation.Date #endif /// A type that performs HTTP operations defined by the OpenAPI document. internal protocol APIProtocol: Sendable { @@ -47,6 +47,15 @@ extension APIProtocol { /// Server URLs defined in the OpenAPI document. internal enum Servers { + internal enum Server1 { + internal static func url() throws -> Foundation.URL { + try Foundation.URL( + validatingOpenAPIServerURL: "https://api.ipsw.me/v4", + variables: [] + ) + } + } + @available(*, deprecated, renamed: "Servers.Server1.url") internal static func server1() throws -> Foundation.URL { try Foundation.URL( validatingOpenAPIServerURL: "https://api.ipsw.me/v4", @@ -250,6 +259,8 @@ internal enum Operations { internal struct Input: Sendable, Hashable { /// - Remark: Generated from `#/paths/device/{identifier}/GET/path`. internal struct Path: Sendable, Hashable { + /// + /// /// - Remark: Generated from `#/paths/device/{identifier}/GET/path/identifier`. internal var identifier: Swift.String /// Creates a new `Path`. @@ -263,6 +274,8 @@ internal enum Operations { internal var path: Operations.getDevice.Input.Path /// - Remark: Generated from `#/paths/device/{identifier}/GET/query`. internal struct Query: Sendable, Hashable { + /// + /// /// - Remark: Generated from `#/paths/device/{identifier}/GET/query/type`. internal var _type: Swift.String /// Creates a new `Query`. @@ -302,7 +315,7 @@ internal enum Operations { self.headers = headers } } - @frozen internal enum Output: Sendable, Hashable { + internal enum Output: Sendable, Hashable { internal struct Ok: Sendable, Hashable { /// - Remark: Generated from `#/paths/device/{identifier}/GET/responses/200/headers`. internal struct Headers: Sendable, Hashable { @@ -341,7 +354,7 @@ internal enum Operations { /// Received HTTP response headers internal var headers: Operations.getDevice.Output.Ok.Headers /// - Remark: Generated from `#/paths/device/{identifier}/GET/responses/200/content`. - @frozen internal enum Body: Sendable, Hashable { + internal enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/device/{identifier}/GET/responses/200/content/application\/json`. case json(Components.Schemas.Device) /// The associated value of the enum case if `self` is `.json`. @@ -501,7 +514,7 @@ internal enum Operations { /// A response with a code that is not documented in the OpenAPI document. case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } - @frozen internal enum AcceptableContentType: AcceptableProtocol { + internal enum AcceptableContentType: AcceptableProtocol { case json case application_x_hyphen_plist case xml diff --git a/Sources/IPSWDownloads/IPSWDownloads.swift b/Sources/IPSWDownloads/IPSWDownloads.swift index 13c9aac..015de2a 100644 --- a/Sources/IPSWDownloads/IPSWDownloads.swift +++ b/Sources/IPSWDownloads/IPSWDownloads.swift @@ -27,14 +27,14 @@ // OTHER DEALINGS IN THE SOFTWARE. // -import Foundation -import OpenAPIRuntime +public import Foundation +public import OpenAPIRuntime /// Client for downloading current and previous versions /// of Apple's iOS Firmware, iTunes and OTA updates. public struct IPSWDownloads: Sendable { // swiftlint:disable:next force_try - private static let serverURL = try! Servers.server1() + private static let serverURL = try! Servers.Server1.url() /// The underlying generated client to make HTTP requests to IPSWDownloads. private let underlyingClient: any APIProtocol diff --git a/Sources/IPSWDownloads/RuntimeError.swift b/Sources/IPSWDownloads/RuntimeError.swift index b5429f1..9ac2b72 100644 --- a/Sources/IPSWDownloads/RuntimeError.swift +++ b/Sources/IPSWDownloads/RuntimeError.swift @@ -27,7 +27,7 @@ // OTHER DEALINGS IN THE SOFTWARE. // -import Foundation +public import Foundation internal enum RuntimeError: Error, Sendable { case invalidURL(String) diff --git a/Sources/IPSWDownloads/URL.swift b/Sources/IPSWDownloads/URL.swift index 5c8fdd7..c0e8f4c 100644 --- a/Sources/IPSWDownloads/URL.swift +++ b/Sources/IPSWDownloads/URL.swift @@ -27,7 +27,7 @@ // OTHER DEALINGS IN THE SOFTWARE. // -import Foundation +public import Foundation extension URL { /// Returns a validated server URL, or throws an error.