Swiftpack.co - MortenGregersen/Bagbutik as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by MortenGregersen.
MortenGregersen/Bagbutik 1.1.1
Generated Swift code for the App Store Connect API based on the official OpenAPI spec.
⭐️ 96
🕓 1 week ago
iOS macOS watchOS tvOS linux
.package(url: "https://github.com/MortenGregersen/Bagbutik.git", from: "1.1.1")


Bagbutik

Generated Swift code for the App Store Connect API based on the official OpenAPI spec.
Created with StencilSwiftKit and swift-crypto

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)

GitHub

link
Stars: 96
Last commit: 1 week ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Dependencies

Release Notes

1.1.1
1 week ago

What's Changed

Full Changelog: https://github.com/MortenGregersen/Bagbutik/compare/1.1.0...1.1.1

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics