Modern Apps git

← xtool.git

Improve OpenAPI error handling (#78)

Commit
b5d49a63cfb5d24e581260b4af988c263b613d04
Author
Kabir Oberai <[email protected]>
When
2025-05-23 13:35 UTC (1 year ago)
Parents
cd3d72c
- Make some enums non-exhaustive (closes #77)
  - Also a tentative fix for #62 and #64
- Improve logging on deserialization failure

We now use raw JS to patch the OpenAPI spec instead of openapi-overlay.
It's a lot more flexible this way.

Diff

Makefile
diff --git a/Makefile b/Makefileindex 826b7ed..a7bd312 100644--- a/Makefile+++ b/Makefile@@ -144,8 +144,8 @@ api: openapi/openapi.json update-api: 	@+$(MAKE) -B api -openapi/openapi.json: openapi/base.json Sources/DeveloperAPI/openapi-overlay.yaml-	npx --yes bump-cli overlay openapi/base.json Sources/DeveloperAPI/openapi-overlay.yaml > openapi/openapi.json+openapi/openapi.json: openapi/base.json Sources/DeveloperAPI/patch.js+	node Sources/DeveloperAPI/patch.js < openapi/base.json > openapi/openapi.json  openapi/base.json: 	@mkdir -p openapi
Package.swift
diff --git a/Package.swift b/Package.swiftindex 3d85b24..2cadb58 100644--- a/Package.swift+++ b/Package.swift@@ -88,7 +88,7 @@ let package = Package(             dependencies: [                 .product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"),             ],-            exclude: ["openapi-generator-config.yaml", "openapi-overlay.yaml"]+            exclude: ["openapi-generator-config.yaml", "patch.js"]         ),         .target(             name: "XKit",
Sources/DeveloperAPI/Generated/Types.swift
diff --git a/Sources/DeveloperAPI/Generated/Types.swift b/Sources/DeveloperAPI/Generated/Types.swiftindex ace7e46..f23522a 100644--- a/Sources/DeveloperAPI/Generated/Types.swift+++ b/Sources/DeveloperAPI/Generated/Types.swift@@ -3464,14 +3464,60 @@ public enum Components {                 /// - Remark: Generated from `#/components/schemas/Device/attributes/udid`.                 public var udid: Swift.String?                 /// - Remark: Generated from `#/components/schemas/Device/attributes/deviceClass`.-                @frozen public enum DeviceClassPayload: String, Codable, Hashable, Sendable, CaseIterable {-                    case appleWatch = "APPLE_WATCH"-                    case ipad = "IPAD"-                    case iphone = "IPHONE"-                    case ipod = "IPOD"-                    case appleTv = "APPLE_TV"-                    case mac = "MAC"-                    case appleVisionPro = "APPLE_VISION_PRO"+                public struct DeviceClassPayload: Codable, Hashable, Sendable {+                    /// - Remark: Generated from `#/components/schemas/Device/attributes/deviceClass/value1`.+                    @frozen public enum Value1Payload: String, Codable, Hashable, Sendable, CaseIterable {+                        case appleWatch = "APPLE_WATCH"+                        case ipad = "IPAD"+                        case iphone = "IPHONE"+                        case ipod = "IPOD"+                        case appleTv = "APPLE_TV"+                        case mac = "MAC"+                    }+                    /// - Remark: Generated from `#/components/schemas/Device/attributes/deviceClass/value1`.+                    public var value1: Components.Schemas.Device.AttributesPayload.DeviceClassPayload.Value1Payload?+                    /// - Remark: Generated from `#/components/schemas/Device/attributes/deviceClass/value2`.+                    public var value2: Swift.String?+                    /// Creates a new `DeviceClassPayload`.+                    ///+                    /// - Parameters:+                    ///   - value1:+                    ///   - value2:+                    public init(+                        value1: Components.Schemas.Device.AttributesPayload.DeviceClassPayload.Value1Payload? = nil,+                        value2: Swift.String? = nil+                    ) {+                        self.value1 = value1+                        self.value2 = value2+                    }+                    public init(from decoder: any Decoder) throws {+                        var errors: [any Error] = []+                        do {+                            self.value1 = try decoder.decodeFromSingleValueContainer()+                        } catch {+                            errors.append(error)+                        }+                        do {+                            self.value2 = try decoder.decodeFromSingleValueContainer()+                        } catch {+                            errors.append(error)+                        }+                        try Swift.DecodingError.verifyAtLeastOneSchemaIsNotNil(+                            [+                                self.value1,+                                self.value2+                            ],+                            type: Self.self,+                            codingPath: decoder.codingPath,+                            errors: errors+                        )+                    }+                    public func encode(to encoder: any Encoder) throws {+                        try encoder.encodeFirstNonNilValueToSingleValueContainer([+                            self.value1,+                            self.value2+                        ])+                    }                 }                 /// - Remark: Generated from `#/components/schemas/Device/attributes/deviceClass`.                 public var deviceClass: Components.Schemas.Device.AttributesPayload.DeviceClassPayload?@@ -5015,12 +5061,57 @@ public enum Components {             }         }         /// - Remark: Generated from `#/components/schemas/BundleIdPlatform`.-        @frozen public enum BundleIdPlatform: String, Codable, Hashable, Sendable, CaseIterable {-            case ios = "IOS"-            case macOs = "MAC_OS"-            case universal = "UNIVERSAL"-            case services = "SERVICES"-            case macos = "MACOS"+        public struct BundleIdPlatform: Codable, Hashable, Sendable {+            /// - Remark: Generated from `#/components/schemas/BundleIdPlatform/value1`.+            @frozen public enum Value1Payload: String, Codable, Hashable, Sendable, CaseIterable {+                case ios = "IOS"+                case macOs = "MAC_OS"+                case universal = "UNIVERSAL"+            }+            /// - Remark: Generated from `#/components/schemas/BundleIdPlatform/value1`.+            public var value1: Components.Schemas.BundleIdPlatform.Value1Payload?+            /// - Remark: Generated from `#/components/schemas/BundleIdPlatform/value2`.+            public var value2: Swift.String?+            /// Creates a new `BundleIdPlatform`.+            ///+            /// - Parameters:+            ///   - value1:+            ///   - value2:+            public init(+                value1: Components.Schemas.BundleIdPlatform.Value1Payload? = nil,+                value2: Swift.String? = nil+            ) {+                self.value1 = value1+                self.value2 = value2+            }+            public init(from decoder: any Decoder) throws {+                var errors: [any Error] = []+                do {+                    self.value1 = try decoder.decodeFromSingleValueContainer()+                } catch {+                    errors.append(error)+                }+                do {+                    self.value2 = try decoder.decodeFromSingleValueContainer()+                } catch {+                    errors.append(error)+                }+                try Swift.DecodingError.verifyAtLeastOneSchemaIsNotNil(+                    [+                        self.value1,+                        self.value2+                    ],+                    type: Self.self,+                    codingPath: decoder.codingPath,+                    errors: errors+                )+            }+            public func encode(to encoder: any Encoder) throws {+                try encoder.encodeFirstNonNilValueToSingleValueContainer([+                    self.value1,+                    self.value2+                ])+            }         }         /// - Remark: Generated from `#/components/schemas/CapabilityOption`.         public struct CapabilityOption: Codable, Hashable, Sendable {@@ -5150,56 +5241,150 @@ public enum Components {             }         }         /// - Remark: Generated from `#/components/schemas/CapabilityType`.-        @frozen public enum CapabilityType: String, Codable, Hashable, Sendable, CaseIterable {-            case icloud = "ICLOUD"-            case inAppPurchase = "IN_APP_PURCHASE"-            case gameCenter = "GAME_CENTER"-            case pushNotifications = "PUSH_NOTIFICATIONS"-            case wallet = "WALLET"-            case interAppAudio = "INTER_APP_AUDIO"-            case maps = "MAPS"-            case associatedDomains = "ASSOCIATED_DOMAINS"-            case personalVpn = "PERSONAL_VPN"-            case appGroups = "APP_GROUPS"-            case healthkit = "HEALTHKIT"-            case homekit = "HOMEKIT"-            case wirelessAccessoryConfiguration = "WIRELESS_ACCESSORY_CONFIGURATION"-            case applePay = "APPLE_PAY"-            case dataProtection = "DATA_PROTECTION"-            case sirikit = "SIRIKIT"-            case networkExtensions = "NETWORK_EXTENSIONS"-            case multipath = "MULTIPATH"-            case hotSpot = "HOT_SPOT"-            case nfcTagReading = "NFC_TAG_READING"-            case classkit = "CLASSKIT"-            case autofillCredentialProvider = "AUTOFILL_CREDENTIAL_PROVIDER"-            case accessWifiInformation = "ACCESS_WIFI_INFORMATION"-            case networkCustomProtocol = "NETWORK_CUSTOM_PROTOCOL"-            case coremediaHlsLowLatency = "COREMEDIA_HLS_LOW_LATENCY"-            case systemExtensionInstall = "SYSTEM_EXTENSION_INSTALL"-            case userManagement = "USER_MANAGEMENT"-            case appleIdAuth = "APPLE_ID_AUTH"+        public struct CapabilityType: Codable, Hashable, Sendable {+            /// - Remark: Generated from `#/components/schemas/CapabilityType/value1`.+            @frozen public enum Value1Payload: String, Codable, Hashable, Sendable, CaseIterable {+                case icloud = "ICLOUD"+                case inAppPurchase = "IN_APP_PURCHASE"+                case gameCenter = "GAME_CENTER"+                case pushNotifications = "PUSH_NOTIFICATIONS"+                case wallet = "WALLET"+                case interAppAudio = "INTER_APP_AUDIO"+                case maps = "MAPS"+                case associatedDomains = "ASSOCIATED_DOMAINS"+                case personalVpn = "PERSONAL_VPN"+                case appGroups = "APP_GROUPS"+                case healthkit = "HEALTHKIT"+                case homekit = "HOMEKIT"+                case wirelessAccessoryConfiguration = "WIRELESS_ACCESSORY_CONFIGURATION"+                case applePay = "APPLE_PAY"+                case dataProtection = "DATA_PROTECTION"+                case sirikit = "SIRIKIT"+                case networkExtensions = "NETWORK_EXTENSIONS"+                case multipath = "MULTIPATH"+                case hotSpot = "HOT_SPOT"+                case nfcTagReading = "NFC_TAG_READING"+                case classkit = "CLASSKIT"+                case autofillCredentialProvider = "AUTOFILL_CREDENTIAL_PROVIDER"+                case accessWifiInformation = "ACCESS_WIFI_INFORMATION"+                case networkCustomProtocol = "NETWORK_CUSTOM_PROTOCOL"+                case coremediaHlsLowLatency = "COREMEDIA_HLS_LOW_LATENCY"+                case systemExtensionInstall = "SYSTEM_EXTENSION_INSTALL"+                case userManagement = "USER_MANAGEMENT"+                case appleIdAuth = "APPLE_ID_AUTH"+            }+            /// - Remark: Generated from `#/components/schemas/CapabilityType/value1`.+            public var value1: Components.Schemas.CapabilityType.Value1Payload?+            /// - Remark: Generated from `#/components/schemas/CapabilityType/value2`.+            public var value2: Swift.String?+            /// Creates a new `CapabilityType`.+            ///+            /// - Parameters:+            ///   - value1:+            ///   - value2:+            public init(+                value1: Components.Schemas.CapabilityType.Value1Payload? = nil,+                value2: Swift.String? = nil+            ) {+                self.value1 = value1+                self.value2 = value2+            }+            public init(from decoder: any Decoder) throws {+                var errors: [any Error] = []+                do {+                    self.value1 = try decoder.decodeFromSingleValueContainer()+                } catch {+                    errors.append(error)+                }+                do {+                    self.value2 = try decoder.decodeFromSingleValueContainer()+                } catch {+                    errors.append(error)+                }+                try Swift.DecodingError.verifyAtLeastOneSchemaIsNotNil(+                    [+                        self.value1,+                        self.value2+                    ],+                    type: Self.self,+                    codingPath: decoder.codingPath,+                    errors: errors+                )+            }+            public func encode(to encoder: any Encoder) throws {+                try encoder.encodeFirstNonNilValueToSingleValueContainer([+                    self.value1,+                    self.value2+                ])+            }         }         /// - Remark: Generated from `#/components/schemas/CertificateType`.-        @frozen public enum CertificateType: String, Codable, Hashable, Sendable, CaseIterable {-            case applePay = "APPLE_PAY"-            case applePayMerchantIdentity = "APPLE_PAY_MERCHANT_IDENTITY"-            case applePayPspIdentity = "APPLE_PAY_PSP_IDENTITY"-            case applePayRsa = "APPLE_PAY_RSA"-            case developerIdKext = "DEVELOPER_ID_KEXT"-            case developerIdKextG2 = "DEVELOPER_ID_KEXT_G2"-            case developerIdApplication = "DEVELOPER_ID_APPLICATION"-            case developerIdApplicationG2 = "DEVELOPER_ID_APPLICATION_G2"-            case development = "DEVELOPMENT"-            case distribution = "DISTRIBUTION"-            case identityAccess = "IDENTITY_ACCESS"-            case iosDevelopment = "IOS_DEVELOPMENT"-            case iosDistribution = "IOS_DISTRIBUTION"-            case macAppDistribution = "MAC_APP_DISTRIBUTION"-            case macInstallerDistribution = "MAC_INSTALLER_DISTRIBUTION"-            case macAppDevelopment = "MAC_APP_DEVELOPMENT"-            case passTypeId = "PASS_TYPE_ID"-            case passTypeIdWithNfc = "PASS_TYPE_ID_WITH_NFC"+        public struct CertificateType: Codable, Hashable, Sendable {+            /// - Remark: Generated from `#/components/schemas/CertificateType/value1`.+            @frozen public enum Value1Payload: String, Codable, Hashable, Sendable, CaseIterable {+                case applePay = "APPLE_PAY"+                case applePayMerchantIdentity = "APPLE_PAY_MERCHANT_IDENTITY"+                case applePayPspIdentity = "APPLE_PAY_PSP_IDENTITY"+                case applePayRsa = "APPLE_PAY_RSA"+                case developerIdKext = "DEVELOPER_ID_KEXT"+                case developerIdKextG2 = "DEVELOPER_ID_KEXT_G2"+                case developerIdApplication = "DEVELOPER_ID_APPLICATION"+                case developerIdApplicationG2 = "DEVELOPER_ID_APPLICATION_G2"+                case development = "DEVELOPMENT"+                case distribution = "DISTRIBUTION"+                case identityAccess = "IDENTITY_ACCESS"+                case iosDevelopment = "IOS_DEVELOPMENT"+                case iosDistribution = "IOS_DISTRIBUTION"+                case macAppDistribution = "MAC_APP_DISTRIBUTION"+                case macInstallerDistribution = "MAC_INSTALLER_DISTRIBUTION"+                case macAppDevelopment = "MAC_APP_DEVELOPMENT"+                case passTypeId = "PASS_TYPE_ID"+                case passTypeIdWithNfc = "PASS_TYPE_ID_WITH_NFC"+            }+            /// - Remark: Generated from `#/components/schemas/CertificateType/value1`.+            public var value1: Components.Schemas.CertificateType.Value1Payload?+            /// - Remark: Generated from `#/components/schemas/CertificateType/value2`.+            public var value2: Swift.String?+            /// Creates a new `CertificateType`.+            ///+            /// - Parameters:+            ///   - value1:+            ///   - value2:+            public init(+                value1: Components.Schemas.CertificateType.Value1Payload? = nil,+                value2: Swift.String? = nil+            ) {+                self.value1 = value1+                self.value2 = value2+            }+            public init(from decoder: any Decoder) throws {+                var errors: [any Error] = []+                do {+                    self.value1 = try decoder.decodeFromSingleValueContainer()+                } catch {+                    errors.append(error)+                }+                do {+                    self.value2 = try decoder.decodeFromSingleValueContainer()+                } catch {+                    errors.append(error)+                }+                try Swift.DecodingError.verifyAtLeastOneSchemaIsNotNil(+                    [+                        self.value1,+                        self.value2+                    ],+                    type: Self.self,+                    codingPath: decoder.codingPath,+                    errors: errors+                )+            }+            public func encode(to encoder: any Encoder) throws {+                try encoder.encodeFirstNonNilValueToSingleValueContainer([+                    self.value1,+                    self.value2+                ])+            }         }         /// - Remark: Generated from `#/components/schemas/SubscriptionStatusUrlVersion`.         @frozen public enum SubscriptionStatusUrlVersion: String, Codable, Hashable, Sendable, CaseIterable {
Sources/DeveloperAPI/openapi-overlay.yaml
diff --git a/Sources/DeveloperAPI/openapi-overlay.yaml b/Sources/DeveloperAPI/openapi-overlay.yamldeleted file mode 100644index 17bd240..0000000--- a/Sources/DeveloperAPI/openapi-overlay.yaml+++ /dev/null@@ -1,42 +0,0 @@-overlay: 1.0.0-info:-  title: Overlay for App Store Connect API-  version: 1.0.0-actions:-  # this field is required when using the private Xcode API-  - target: '$.components.schemas.BundleIdCapabilityCreateRequest.properties.data.properties.relationships'-    update:-      properties:-        capability:-          type: object-          properties:-            data:-              type: object-              properties:-                type:-                  type: string-                  enum: [capabilities]-                id:-                  "$ref": "#/components/schemas/CapabilityType"-              required: [id, type]-          required: [data]-      required: [capability]-  # we don't use this but it triggers a deprecation warning. see:-  # https://github.com/apple/swift-openapi-generator/issues/715-  - target: '$.components.schemas.App.properties.relationships.properties.inAppPurchases'-    update:-      deprecated: false-  # openapi-generator expects response enums to be exhaustive. Apple's ASC OpenAPI spec-  # misses some cases that they do, actually, return.-  - target: '$.components.schemas.Device.properties.attributes.properties.deviceClass'-    update:-      enum:-        - APPLE_VISION_PRO-  - target: '$.components.schemas.BundleIdPlatform'-    update:-      enum:-        - SERVICES-        # the spec already declares MAC_OS but ASC sometimes seems to-        # spell this as MACOS instead. see:-        # https://github.com/xtool-org/xtool/issues/64-        - MACOS
Sources/DeveloperAPI/patch.js
diff --git a/Sources/DeveloperAPI/patch.js b/Sources/DeveloperAPI/patch.jsnew file mode 100644index 0000000..064af46--- /dev/null+++ b/Sources/DeveloperAPI/patch.js@@ -0,0 +1,59 @@+#!/usr/bin/env node++import fs from 'fs';++function makeOpen(enumSchema) {+    const copy = structuredClone(enumSchema);+    Object.keys(enumSchema).forEach(k => delete enumSchema[k]);+    Object.assign(enumSchema, {+        anyOf: [+            copy,+            { type: 'string' },+        ]+    })+}++function format(schema) {+    const schemas = schema.components.schemas;++    // this field is required when using the private Xcode API+    const capabilityCreateRelationships = schemas.BundleIdCapabilityCreateRequest.properties.data.properties.relationships;+    capabilityCreateRelationships.properties.capability = {+        type: 'object',+        properties: {+            data: {+                type: 'object',+                properties: {+                    type: {+                        type: 'string',+                        enum: ['capabilities'],+                    },+                    id: { $ref: '#/components/schemas/CapabilityType' },+                },+                required: ['id', 'type'],+            },+        },+        required: ['data'],+    }+    capabilityCreateRelationships.required.push('capability');++    // we don't use this but it triggers a deprecation warning. see:+    // https://github.com/apple/swift-openapi-generator/issues/715+    schemas.App.properties.relationships.properties.inAppPurchases.deprecated = false;++    // openapi-generator expects response enums to be exhaustive. Apple's ASC OpenAPI spec+    // misses some cases that they do, actually, return.+    // https://swiftpackageindex.com/apple/swift-openapi-generator/1.7.2/documentation/swift-openapi-generator/useful-openapi-patterns#Open-enums-and-oneOfs+    makeOpen(schemas.BundleIdPlatform);+    makeOpen(schemas.CapabilityType);+    makeOpen(schemas.CertificateType);+    makeOpen(schemas.Device.properties.attributes.properties.deviceClass);++    return schema;+}++const text = fs.readFileSync(process.stdin.fd, 'utf8');+const json = JSON.parse(text);+const formatted = format(json);+const formattedText = JSON.stringify(formatted);+console.log(formattedText);
Sources/XKit/DeveloperServices/App IDs/DeveloperServicesAddAppOperation.swift
diff --git a/Sources/XKit/DeveloperServices/App IDs/DeveloperServicesAddAppOperation.swift b/Sources/XKit/DeveloperServices/App IDs/DeveloperServicesAddAppOperation.swiftindex 90684f8..0be5c69 100644--- a/Sources/XKit/DeveloperServices/App IDs/DeveloperServicesAddAppOperation.swift	+++ b/Sources/XKit/DeveloperServices/App IDs/DeveloperServicesAddAppOperation.swift	@@ -57,7 +57,7 @@ public struct DeveloperServicesAddAppOperation: DeveloperServicesOperation {                             _type: .bundleIds,                             attributes: .init(                                 name: name,-                                platform: .ios,+                                platform: .init(.ios),                                 identifier: newBundleID                             )                         )@@ -105,8 +105,8 @@ public struct DeveloperServicesAddAppOperation: DeveloperServicesOperation {                 }             } else {                 // DeveloperServices doesn't allow deleting these capabilities-                let requiredCapabilities: Set<Components.Schemas.CapabilityType> = [.inAppPurchase]-                if let capType = cap.attributes?.capabilityType, !requiredCapabilities.contains(capType) {+                let requiredCapabilities: Set<Components.Schemas.CapabilityType.Value1Payload> = [.inAppPurchase]+                if let capType = cap.attributes?.capabilityType?.value1, !requiredCapabilities.contains(capType) {                     _ = try await context.developerAPIClient                         .bundleIdCapabilitiesDeleteInstance(path: .init(id: cap.id))                         .noContent
Sources/XKit/DeveloperServices/App IDs/Entitlements/DeveloperServicesCapability.swift
diff --git a/Sources/XKit/DeveloperServices/App IDs/Entitlements/DeveloperServicesCapability.swift b/Sources/XKit/DeveloperServices/App IDs/Entitlements/DeveloperServicesCapability.swiftindex 6742ea1..0cc57f3 100644--- a/Sources/XKit/DeveloperServices/App IDs/Entitlements/DeveloperServicesCapability.swift	+++ b/Sources/XKit/DeveloperServices/App IDs/Entitlements/DeveloperServicesCapability.swift	@@ -15,11 +15,11 @@ public struct DeveloperServicesCapability: Sendable, Hashable {     public var settings: [Components.Schemas.CapabilitySetting]?      public init(-        _ capabilityType: Components.Schemas.CapabilityType,+        _ capabilityType: Components.Schemas.CapabilityType.Value1Payload,         isFree: Bool,         settings: [Components.Schemas.CapabilitySetting]? = nil     ) {-        self.capabilityType = capabilityType+        self.capabilityType = .init(capabilityType)         self.isFree = isFree         self.settings = settings     }
Sources/XKit/DeveloperServices/Certificates/DeveloperServicesFetchCertificateOperation.swift
diff --git a/Sources/XKit/DeveloperServices/Certificates/DeveloperServicesFetchCertificateOperation.swift b/Sources/XKit/DeveloperServices/Certificates/DeveloperServicesFetchCertificateOperation.swiftindex 26ae405..980cb9c 100644--- a/Sources/XKit/DeveloperServices/Certificates/DeveloperServicesFetchCertificateOperation.swift+++ b/Sources/XKit/DeveloperServices/Certificates/DeveloperServicesFetchCertificateOperation.swift@@ -54,7 +54,7 @@ public struct DeveloperServicesFetchCertificateOperation: DeveloperServicesOpera                 _type: .certificates,                 attributes: .init(                     csrContent: csr.pemString,-                    certificateType: .development+                    certificateType: .init(.development)                 )             )))         )
Sources/XKit/DeveloperServices/DeveloperServices+OpenAPI.swift
diff --git a/Sources/XKit/DeveloperServices/DeveloperServices+OpenAPI.swift b/Sources/XKit/DeveloperServices/DeveloperServices+OpenAPI.swiftindex 3ba555e..69da496 100644--- a/Sources/XKit/DeveloperServices/DeveloperServices+OpenAPI.swift+++ b/Sources/XKit/DeveloperServices/DeveloperServices+OpenAPI.swift@@ -256,3 +256,27 @@ struct LoggingMiddleware: ClientMiddleware {         return (response, body)     } }++// syntactic sugar to make it nicer to work with `anyOf:` types+public protocol OpenAPIExtensibleEnum {+    associatedtype Value1Payload: RawRepresentable<String>, Codable, Hashable, Sendable, CaseIterable+    var value1: Value1Payload? { get set }+    var value2: String? { get set }++    init(value1: Value1Payload?, value2: String?)+}++extension OpenAPIExtensibleEnum {+    public var rawValue: String {+        value2!+    }++    public init(_ value: Value1Payload) {+        self.init(value1: value, value2: nil)+    }+}++extension Components.Schemas.BundleIdPlatform: OpenAPIExtensibleEnum {}+extension Components.Schemas.CapabilityType: OpenAPIExtensibleEnum {}+extension Components.Schemas.CertificateType: OpenAPIExtensibleEnum {}+extension Components.Schemas.Device.AttributesPayload.DeviceClassPayload: OpenAPIExtensibleEnum {}
Sources/XKit/DeveloperServices/Devices/DeveloperServicesFetchDeviceOperation.swift
diff --git a/Sources/XKit/DeveloperServices/Devices/DeveloperServicesFetchDeviceOperation.swift b/Sources/XKit/DeveloperServices/Devices/DeveloperServicesFetchDeviceOperation.swiftindex b5cbc8d..9f5eaf7 100644--- a/Sources/XKit/DeveloperServices/Devices/DeveloperServicesFetchDeviceOperation.swift+++ b/Sources/XKit/DeveloperServices/Devices/DeveloperServicesFetchDeviceOperation.swift@@ -27,7 +27,7 @@ public struct DeveloperServicesFetchDeviceOperation: DeveloperServicesOperation                 _type: .devices,                 attributes: .init(                     name: self.context.deviceName,-                    platform: .ios,+                    platform: .init(.ios),                     udid: self.context.udid                 )             )))
Sources/XToolSupport/DevCommand.swift
diff --git a/Sources/XToolSupport/DevCommand.swift b/Sources/XToolSupport/DevCommand.swiftindex a53bf3e..0f17abc 100644--- a/Sources/XToolSupport/DevCommand.swift+++ b/Sources/XToolSupport/DevCommand.swift@@ -198,7 +198,14 @@ struct DevRunCommand: AsyncParsableCommand {          defer { print() } -        try await installer.install(app: output)+        do {+            try await installer.install(app: output)+        } catch let error as CancellationError {+            throw error+        } catch {+            print("\nError: \(error)")+            throw ExitCode.failure+        }     } } 
Sources/XToolSupport/InstallCommand.swift
diff --git a/Sources/XToolSupport/InstallCommand.swift b/Sources/XToolSupport/InstallCommand.swiftindex b0f4c9b..e805b58 100644--- a/Sources/XToolSupport/InstallCommand.swift+++ b/Sources/XToolSupport/InstallCommand.swift@@ -34,9 +34,11 @@ struct InstallCommand: AsyncParsableCommand {         do {             try await installer.install(app: URL(fileURLWithPath: path))             print("\nSuccessfully installed!")+        } catch let error as CancellationError {+            throw error         } catch {-            print("\nFailed :(")-            print("Error: \(error)")+            print("\nError: \(error)")+            throw ExitCode.failure         }     } }