Bagbutik

2.1.2

Generated Swift code for the App Store Connect API based on the official OpenAPI spec.
MortenGregersen/Bagbutik

What's New

2.1.2

2022-07-30T19:04:32Z

What's Changed

Full Changelog: 2.1.1...2.1.2


Bagbutik

Generated Swift code for the App Store Connect API based on the official OpenAPI spec.
Swift versions Platforms
CI Documentation Twitter

What is Bagbutik?

Bag·bu·tik (noun) /ˈb̥a̝w-ˌb̥u-tiːk/ - (Danish) A room behind a store

Bagbutik is two things, a command line tool for generating Swift code, and library with the generated code for the App Store Connect API. The command line tool decodes the official OpenAPI spec for Apple's App Store Connect API.

The command line tool is only needed, when Apple publishes a new version of the spec. A GitHub Action automatically checks for new versions of the spec and creates a pull request with the changes.

How to use Bagbutik

Bagbutik uses JSON Web Tokens (JWT) for authorization. You obtain the required keys from your organization's App Store Connect account.

See Creating API Keys for App Store Connect API for how to create your keys.

Here is a basic example for fetching all bundle IDs for iOS apps including related profiles sorted by seed ID and the bundle ID itself descending.

let service = try BagbutikService(jwt: .init(
    keyId: "P9M252746H",
    issuerId: "82067982-6b3b-4a48-be4f-5b10b373c5f2",
    privateKey: """
    -----BEGIN PRIVATE KEY-----
    MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgevZzL1gdAFr88hb2
    OF/2NxApJCzGCEDdfSp6VQO30hyhRANCAAQRWz+jn65BtOMvdyHKcvjBeBSDZH2r
    1RTwjmYSi9R/zpBnuQ4EiMnCqfMPWiZqB4QdbAd0E7oH50VpuZ1P087G
    -----END PRIVATE KEY-----
    """
))
let response = try await service.request(
    .listBundleIds(fields: [.profiles([.bundleId, .name])],
                   filters: [.platform([.iOS])],
                   includes: [.profiles],
                   sorts: [.seedIdDescending, .idDescending])
)
print(response)

Description

  • Swift Tools 5.5.0
View More Packages from this Author

Dependencies

Last updated: Tue Aug 09 2022 03:24:25 GMT-0500 (GMT-05:00)