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

+19 -17
View File
@@ -31,33 +31,31 @@ Then add it to your target dependencies:
### 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). To get a token, create an API key in App Store Connect and sign a JWT with its key ID, issuer ID, and private key:
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
@@ -97,8 +95,9 @@ middlewares: [
]
```
## Supported Platforms
## Requirements
- Swift 6.0+ (Xcode 16+)
- iOS 14.0+
- macOS 11.0+
- tvOS 14.0+
@@ -130,6 +129,9 @@ make doc-generate-github
# Preview documentation locally in Safari
make doc-preview
# Check the catalog covers the generated code
make doc-check
```
### Updating the API