Added a DocC catalog coverage check.

This commit is contained in:
javier committed 2026-10-25 18:30:43 +01:00
1 parent 2cfacd0e14
commit ff00fdd852
9 files changed
+134 -42

No files matched your search

@@ -8,33 +8,31 @@ ASConnectService exposes every endpoint of Apple's App Store Connect API as a Sw
### Creating a Client
Create a ``Client`` with a server URL, a transport, and a ``BearerAuthMiddleware`` that authenticates each request with a JSON Web Token (JWT):
Create a ``Client`` with a server URL, a transport, and a ``BearerAuthMiddleware``. With an API key from App Store Connect, ``APIKeyTokenProvider`` signs the JSON Web Tokens (JWT) the API requires, and renews them before they expire:
```swift
import ASConnectService
import OpenAPIURLSession
let client = Client(
serverURL: try Servers.Server1.url(),
transport: URLSessionTransport(),
middlewares: [
BearerAuthMiddleware(token: yourJWTToken)
]
)
```
Tokens expire after 20 minutes at most. For longer-lived clients, use ``APIKeyTokenProvider``, which signs new ones with your API key as needed:
```swift
let tokenProvider = try APIKeyTokenProvider(
issuerID: yourIssuerID,
keyID: yourKeyID,
privateKey: yourP8FileContents
)
BearerAuthMiddleware {
try await tokenProvider.token()
}
let client = Client(
serverURL: try Servers.Server1.url(),
transport: URLSessionTransport(),
middlewares: [
BearerAuthMiddleware { try await tokenProvider.token() }
]
)
```
To use a token you signed yourself, pass it directly. It expires after 20 minutes at most:
```swift
BearerAuthMiddleware(token: yourJWTToken)
```
### Making API Calls
@@ -1,4 +1,5 @@
// Generated by swift-openapi-generator, do not modify.
// swift-format-ignore-file
@_spi(Generated) import OpenAPIRuntime
#if os(Linux)
@preconcurrency import struct Foundation.URL
@@ -1,4 +1,5 @@
// Generated by swift-openapi-generator, do not modify.
// swift-format-ignore-file
@_spi(Generated) import OpenAPIRuntime
#if os(Linux)
@preconcurrency import struct Foundation.URL
@@ -17,3 +17,6 @@ generate:
- client
namingStrategy: idiomatic
accessModifier: public
# Stops swift-format from reformatting the generated code.
additionalFileComments:
- swift-format-ignore-file