Overhauled the library with several new features #5

Merged
javier merged 15 commits from library/api-update into main 2026-10-25 17:52:41 +00:00
8 changed files with 77 additions and 7 deletions
Showing only changes of commit 2cfacd0e14 - Show all commits

No files matched your search

+10
View File
@@ -107,6 +107,16 @@ oas-download: ## Downloads the latest App Store Connect OpenAPI specification do
oas-patch: # Patches the OpenAPI specification document with the patches in Scripts/patch-oas.jq
@jq --from-file Scripts/patch-oas.jq "$(OAS_DOWNLOAD_OUTPUT)" > "$(OAS_DOWNLOAD_OUTPUT).tmp"
@mv "$(OAS_DOWNLOAD_OUTPUT).tmp" "$(OAS_DOWNLOAD_OUTPUT)"
@$(MAKE) --no-print-directory oas-validate
oas-validate: ## Validates the OpenAPI specification document
@swift run \
--configuration release \
--package-path "$(OAS_GENERATE_TOOLS)" \
swift-openapi-generator generate \
--config "$(OAS_GENERATE_CONFIG)" \
--dry-run \
"$(OAS_DOWNLOAD_OUTPUT)"
oas-generate: ## Generates the library source code from the OpenAPI specification document
@mkdir -p "$(OAS_GENERATE_OUTPUT)"
+4 -2
View File
@@ -1,15 +1,17 @@
// swift-tools-version: 5.10
// swift-tools-version: 6.0
// ===----------------------------------------------------------------------===
//
// This source file is part of the ASConnectService open source project
//
// Copyright (c) 2026 Röck+Cöde VoF. and the ASConnectService project authors
// Licensed under the EUPL 1.2 or later.
// Licensed under Apache license v2.0
//
// See LICENSE for license information
// See CONTRIBUTORS for the list of ASConnectService project authors
//
// SPDX-License-Identifier: Apache-2.0
//
// ===----------------------------------------------------------------------===
import class Foundation.ProcessInfo
+4 -1
View File
@@ -12,7 +12,7 @@ Add `ASConnectService` as a dependency in your `Package.swift` file:
```swift
dependencies: [
.package(url: "https://github.com/rock-n-code/asconnect-service.git", from: "1.0.0")
.package(url: "https://github.com/rock-n-code/asconnect-service.git", from: "2.0.0")
]
```
@@ -142,6 +142,9 @@ make oas-download
# Regenerate the code only
make oas-generate
# Validate the specification only
make oas-validate
```
## Dependencies
@@ -1,3 +1,17 @@
// ===----------------------------------------------------------------------===
//
// This source file is part of the ASConnectService open source project
//
// Copyright (c) 2026 Röck+Cöde VoF. and the ASConnectService project authors
// Licensed under Apache license v2.0
//
// See LICENSE for license information
// See CONTRIBUTORS for the list of ASConnectService project authors
//
// SPDX-License-Identifier: Apache-2.0
//
// ===----------------------------------------------------------------------===
import Testing
// A non-testable import ensures that the extension can be used from outside the module.
@@ -1,3 +1,17 @@
// ===----------------------------------------------------------------------===
//
// This source file is part of the ASConnectService open source project
//
// Copyright (c) 2026 Röck+Cöde VoF. and the ASConnectService project authors
// Licensed under Apache license v2.0
//
// See LICENSE for license information
// See CONTRIBUTORS for the list of ASConnectService project authors
//
// SPDX-License-Identifier: Apache-2.0
//
// ===----------------------------------------------------------------------===
import Foundation
import HTTPTypes
import OpenAPIRuntime
@@ -1,3 +1,17 @@
// ===----------------------------------------------------------------------===
//
// This source file is part of the ASConnectService open source project
//
// Copyright (c) 2026 Röck+Cöde VoF. and the ASConnectService project authors
// Licensed under Apache license v2.0
//
// See LICENSE for license information
// See CONTRIBUTORS for the list of ASConnectService project authors
//
// SPDX-License-Identifier: Apache-2.0
//
// ===----------------------------------------------------------------------===
import Foundation
import HTTPTypes
import OpenAPIRuntime
@@ -1,3 +1,17 @@
// ===----------------------------------------------------------------------===
//
// This source file is part of the ASConnectService open source project
//
// Copyright (c) 2026 Röck+Cöde VoF. and the ASConnectService project authors
// Licensed under Apache license v2.0
//
// See LICENSE for license information
// See CONTRIBUTORS for the list of ASConnectService project authors
//
// SPDX-License-Identifier: Apache-2.0
//
// ===----------------------------------------------------------------------===
#if canImport(CryptoKit)
import CryptoKit
import Foundation
@@ -96,9 +110,8 @@ private extension APIKeyTokenProviderTests {
try #require(parts.count == 3)
let header = try JSONDecoder().decode([String: String].self, from: try #require(Data(base64URL: parts[0])))
let payload = try #require(
try JSONSerialization.jsonObject(with: try #require(Data(base64URL: parts[1]))) as? [String: Any]
)
let payloadData = try #require(Data(base64URL: parts[1]))
let payload = try #require(try JSONSerialization.jsonObject(with: payloadData) as? [String: Any])
return (header, payload)
}
+1 -1
View File
@@ -1,4 +1,4 @@
// swift-tools-version: 5.10
// swift-tools-version: 6.0
// ===----------------------------------------------------------------------===
//