Skip to content

Commit

Permalink
Merge branch 'release/0.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Blackjacx committed Mar 14, 2022
2 parents 9fbe472 + fe93b63 commit fea7f26
Show file tree
Hide file tree
Showing 30 changed files with 255 additions and 252 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## [Unreleased]

## [0.2.0] - 2022-03-14Z
* [#43](https://github.com/blackjacx/assist/pull/43): Async Await Support - [@Blackjacx](https://github.com/blackjacx).

## [0.1.1] - 2022-02-16Z
* [#42](https://github.com/blackjacx/assist/pull/42): Adding TestPlan Parameter - [@Blackjacx](https://github.com/blackjacx).

Expand Down
36 changes: 18 additions & 18 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ GEM
specs:
CFPropertyList (3.0.5)
rexml
activesupport (6.1.4.6)
activesupport (6.1.5)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
Expand All @@ -17,17 +17,17 @@ GEM
artifactory (3.0.15)
atomos (0.1.3)
aws-eventstream (1.2.0)
aws-partitions (1.554.0)
aws-sdk-core (3.126.1)
aws-partitions (1.566.0)
aws-sdk-core (3.130.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.525.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
aws-sdk-kms (1.54.0)
aws-sdk-core (~> 3, >= 3.126.0)
aws-sdk-kms (1.55.0)
aws-sdk-core (~> 3, >= 3.127.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.112.0)
aws-sdk-core (~> 3, >= 3.126.0)
aws-sdk-s3 (1.113.0)
aws-sdk-core (~> 3, >= 3.127.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.4)
aws-sigv4 (1.4.0)
Expand Down Expand Up @@ -82,7 +82,7 @@ GEM
concurrent-ruby (1.1.9)
cork (0.3.0)
colored2 (~> 3.1)
danger (8.4.2)
danger (8.4.5)
claide (~> 1.0)
claide-plugins (>= 0.9.2)
colored2 (~> 3.1)
Expand All @@ -101,7 +101,7 @@ GEM
danger-plugin-api (~> 1.0)
danger-plugin-api (1.0.0)
danger (> 2.0)
danger-swiftlint (0.30.0)
danger-swiftlint (0.30.1)
danger
rake (> 10)
thor (~> 0.19)
Expand All @@ -118,8 +118,8 @@ GEM
escape (0.0.4)
ethon (0.15.0)
ffi (>= 1.15.0)
excon (0.91.0)
faraday (1.9.3)
excon (0.92.0)
faraday (1.10.0)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
Expand Down Expand Up @@ -227,8 +227,8 @@ GEM
google-cloud-core (~> 1.6)
googleauth (>= 0.16.2, < 2.a)
mini_mime (~> 1.0)
googleauth (1.1.1)
faraday (>= 0.17.3, < 2.0)
googleauth (1.1.2)
faraday (>= 0.17.3, < 3.a)
jwt (>= 1.4, < 3.0)
memoist (~> 0.16)
multi_json (~> 1.11)
Expand All @@ -240,7 +240,7 @@ GEM
httpclient (2.8.3)
i18n (1.10.0)
concurrent-ruby (~> 1.0)
jmespath (1.6.0)
jmespath (1.6.1)
json (2.6.1)
jwt (2.3.0)
kramdown (2.3.1)
Expand Down Expand Up @@ -283,9 +283,9 @@ GEM
addressable (>= 2.3.5)
faraday (> 0.8, < 2.0)
security (0.1.3)
signet (0.16.0)
signet (0.16.1)
addressable (~> 2.8)
faraday (>= 0.17.3, < 2.0)
faraday (>= 0.17.5, < 3.0)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
simctl (1.6.8)
Expand All @@ -308,7 +308,7 @@ GEM
uber (0.1.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.8)
unf_ext (0.0.8.1)
unicode-display_width (1.8.0)
webrick (1.7.0)
word_wrap (1.0.0)
Expand All @@ -319,7 +319,7 @@ GEM
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (~> 3.2.4)
xcov (1.7.5)
xcov (1.8.1)
fastlane (>= 2.141.0, < 3.0.0)
multipart-post
slack-notifier
Expand Down
30 changes: 15 additions & 15 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,47 @@
"pins": [
{
"package": "ASCKit",
"repositoryURL": "https://github.com/blackjacx/asckit",
"repositoryURL": "https://github.com/blackjacx/ASCKit",
"state": {
"branch": "develop",
"revision": "070deeb220425884558e9473403832f4435d3350",
"version": null
"branch": null,
"revision": "90e05ac524dd800041af5244342cc2e5a35b5b98",
"version": "0.1.0"
}
},
{
"package": "Engine",
"repositoryURL": "https://github.com/blackjacx/Engine",
"state": {
"branch": "develop",
"revision": "47855b04cf96a56ed6dde6aa555db87f62cfdbcc",
"version": null
"branch": null,
"revision": "87ffff294809c405ccb558850a4bac93e5a32424",
"version": "0.0.3"
}
},
{
"package": "jwt-kit",
"repositoryURL": "https://github.com/vapor/jwt-kit.git",
"state": {
"branch": null,
"revision": "1822bb0abf0a31a4b5078ec19061c548835253b5",
"version": "4.3.0"
"revision": "5f9c44d4c196cc06c3fc601f279169f121d6f62d",
"version": "4.4.0"
}
},
{
"package": "swift-argument-parser",
"repositoryURL": "https://github.com/apple/swift-argument-parser",
"repositoryURL": "https://github.com/Blackjacx/swift-argument-parser",
"state": {
"branch": null,
"revision": "e1465042f195f374b94f915ba8ca49de24300a0d",
"version": "1.0.2"
"branch": "async",
"revision": "747d66953cd1c49e8f6110d2be9a9c51a07fd272",
"version": null
}
},
{
"package": "swift-crypto",
"repositoryURL": "https://github.com/apple/swift-crypto.git",
"state": {
"branch": null,
"revision": "9b5ef28601a9c745c9cdb54d3f243e28ac830982",
"version": "2.0.1"
"revision": "a8911e0fadc25aef1071d582355bd1037a176060",
"version": "2.0.4"
}
},
{
Expand Down
18 changes: 9 additions & 9 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// swift-tools-version:5.4
// swift-tools-version:5.5
import PackageDescription

let package = Package(
name: "Assist",
// platforms: [.macOS(.v10_15), .macCatalyst(.v13), .iOS(.v13), .tvOS(.v13), .watchOS(.v6)],
platforms: [
.macOS(.v11),
.macOS(.v12)
// .iOS(.v11),
// .watchOS(.v5),
// .tvOS(.v11)
Expand All @@ -15,13 +16,12 @@ let package = Package(
.executable(name: "snap", targets: ["Snap"])
],
dependencies: [
.package(name: "ASCKit", url: "https://github.com/blackjacx/asckit", .branch("develop")),
.package(name: "Engine", url: "https://github.com/blackjacx/Engine", .branch("develop")),
// .package(name: "ASCKit", path: "../ASCKit"),
// .package(name: "Engine", path: "../Engine"),
.package(url: "https://github.com/apple/swift-argument-parser", .upToNextMajor(from: "1.0.0")),
.package(url: "https://github.com/vapor/jwt-kit.git", .upToNextMajor(from: "4.1.0")),
.package(url: "https://github.com/kareman/SwiftShell", .upToNextMajor(from: "5.1.0"))
.package(name: "Engine", url: "https://github.com/blackjacx/Engine", from: "0.0.3"),
.package(name: "ASCKit", url: "https://github.com/blackjacx/ASCKit", from: "0.1.0"),
// Change back to https://github.com/Apple/swift-argument-parser
.package(url: "https://github.com/Blackjacx/swift-argument-parser", branch: "async"),
.package(url: "https://github.com/vapor/jwt-kit.git", from: "4.1.0"),
.package(url: "https://github.com/kareman/SwiftShell", from: "5.1.0")
],
targets: [
.target(
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
# App Store Connect API Command-Line Tool

[![Twitter](https://img.shields.io/twitter/follow/blackjacxxx?label=%40Blackjacxxx)](https://twitter.com/blackjacx)
[![Test](https://github.com/Blackjacx/Assist/actions/workflows/test.yml/badge.svg)](https://github.com/Blackjacx/Assist/actions/workflows/test.yml)
<!-- [![Test](https://github.com/Blackjacx/Assist/actions/workflows/test.yml/badge.svg)](https://github.com/Blackjacx/Assist/actions/workflows/test.yml) -->
[![Swift Package Manager Compatible](https://img.shields.io/badge/SPM-compatible-brightgreen.svg)](https://swift.org/package-manager/)
[![Swift Versions](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FBlackjacx%2FAssist%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/Blackjacx/Assist)
[![Platforms](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FBlackjacx%2FAssist%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/Blackjacx/Assist)
[![Xcode 12.5+](https://img.shields.io/badge/Xcode-12.5%2B-blue.svg)](https://developer.apple.com/download/)
[![License](https://img.shields.io/github/license/blackjacx/engine.svg)](https://github.com/blackjacx/engine/blob/master/LICENSE)
[![Xcode 13+](https://img.shields.io/badge/Xcode-13%2B-blue.svg)](https://developer.apple.com/download/)
[![Codebeat](https://codebeat.co/badges/6fb8ff62-9cb4-484a-8c0d-6f7f973d3f0d)](https://codebeat.co/projects/github-com-blackjacx-assist-develop)
[![License](https://img.shields.io/github/license/blackjacx/assist.svg)](https://github.com/blackjacx/assist/blob/master/LICENSE)
[![Donate](https://img.shields.io/badge/Donate-PayPal-blue.svg)](https://www.paypal.me/STHEROLD)

App Store Connect API access using your private API key. The great power of this tool is that it can operate on all apps of one or multiple teams (is you wish to), e.g. it is super easy to print the live versions of all of your apps, even across multiple teams:
Expand Down
3 changes: 2 additions & 1 deletion Sources/ASC/commands/ASC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import Engine
import ArgumentParser

/// The main class for the App Store Connect command line tool.
@main
public final class ASC: ParsableCommand {

/// The API key chosen by the user. If only one key is registered this one is automatically used.
Expand Down Expand Up @@ -65,6 +66,6 @@ struct ApiKeyOptions: ParsableArguments {
Network.verbosityLevel = verbose

// Set the api key ID passed as parameter
ApiKeysOperation.specifiedKeyId = keyId
ASCService.specifiedKeyId = keyId
}
}
4 changes: 2 additions & 2 deletions Sources/ASC/commands/sub/AppStoreVersions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ extension ASC.AppStoreVersions {
@Argument(help: "The attribute you are interested in. [attributes] (default: id).")
var attribute: String?

func run() throws {
let result = try ASCService.listAppStoreVersions(appIds: appIds, filters: filters, limit: limit)
func run() async throws {
let result = try await ASCService.listAppStoreVersions(appIds: appIds, filters: filters, limit: limit)
for item in result {
if let readyForSaleVersion = item.versions.filter({ $0.attributes.appStoreState == .readyForSale }).first {
print("\(item.app.name.padding(toLength: 30, withPad: " ", startingAt: 0)): \(readyForSaleVersion.attributes.versionString)")
Expand Down
4 changes: 2 additions & 2 deletions Sources/ASC/commands/sub/Apps.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ extension ASC.Apps {
@Argument(help: "The attribute you want to get. [name | bundleId | locale | attributes] (default: id).")
var attribute: String?

func run() throws {
let list: [App] = try ASCService.list(filters: filters, limit: limit)
func run() async throws {
let list: [App] = try await ASCService.list(filters: filters, limit: limit)
list.out(attribute)
}
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/ASC/commands/sub/BetaGroups.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ extension ASC.BetaGroups {
@Argument(help: "The attribute you are interested in. [firstName | lastName | email | attributes] (default: id).")
var attribute: String?

func run() throws {
let list: [BetaGroup] = try ASCService.list(filters: filters, limit: limit)
func run() async throws {
let list: [BetaGroup] = try await ASCService.list(filters: filters, limit: limit)
list.out(attribute)
}
}
Expand Down
37 changes: 22 additions & 15 deletions Sources/ASC/commands/sub/BetaTesters.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ extension ASC.BetaTesters {
@Argument(help: "The attribute you are interested in. [firstName | lastName | email | attributes] (default: id).")
var attribute: String?

func run() throws {
let list: [BetaTester] = try ASCService.list(filters: filters, limit: limit)
func run() async throws {
let list: [BetaTester] = try await ASCService.list(filters: filters, limit: limit)
list.out(attribute)
}
}
Expand All @@ -56,14 +56,14 @@ extension ASC.BetaTesters {
@OptionGroup()
var options: ApiKeyOptions

@Option(name: [.customShort("i", allowingJoined: false), .long], parsing: .upToNextOption, help: "The Apple app ID(s) that uniquely identifiy the app(s) (e.g. -i \"12345678\" -i \"14324567\").")
@Option(name: [.customShort("i", allowingJoined: false), .long], parsing: .upToNextOption, help: "The Apple app ID(s) that uniquely identifiy the app(s) (e.g. -i \"12345678\" \"14324567\").")
var appIds: [String] = []

@Option(name: .shortAndLong, help: "The unique email of the tester to send the invite to.")
var email: String

func run() throws {
try ASCService.inviteBetaTester(email: email, appIds: appIds)
func run() async throws {
try await ASCService.inviteBetaTester(email: email, appIds: appIds)
}
}

Expand All @@ -89,8 +89,8 @@ extension ASC.BetaTesters {
@Option(name: .shortAndLong, parsing: .upToNextOption, help: "The group names to add the new beta tester to.")
var groupNames: [String]

func run() throws {
try ASCService.addBetaTester(email: email, first: firstName, last: lastName, groupNames: groupNames)
func run() async throws {
try await ASCService.addBetaTester(email: email, first: firstName, last: lastName, groupNames: groupNames)
}
}

Expand All @@ -107,15 +107,22 @@ extension ASC.BetaTesters {
@Option(name: .shortAndLong, help: "A list of emails of users you want to remove.")
var emails: [String]

func run() throws {
// Get id's
let filter = Filter(key: BetaTester.FilterKey.email, value: emails.joined(separator: ","))
let list: [BetaTester] = try ASCService.list(filters: [filter], limit: nil)
func run() async throws {

// Delete items by id
let ops = list.map { DeleteOperation<BetaTester>(model: $0) }
ops.executeSync()
try ops.forEach { _ = try $0.result.get() } // logs error
var errors: [Error] = []

for email in emails {
do {
let deletedTester = try await ASCService.deleteBetaTester(email: email)
print("Successfully removed \(deletedTester)")
} catch {
errors.append(error)
}
}

if !errors.isEmpty {
throw AscError.requestFailed(underlyingErrors: errors)
}
}
}
}
11 changes: 5 additions & 6 deletions Sources/ASC/commands/sub/Builds.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ extension ASC.Builds {
@Argument(help: "The attribute you want to get [expired, minOsVersion, processingState, version, usesNonExemptEncryption, uploadedDate, expirationDate] (default: id).")
var attribute: String?

func run() throws {
let list: [Build] = try ASCService.list(filters: filters, limit: limit)
func run() async throws {
let list: [Build] = try await ASCService.list(filters: filters, limit: limit)
list.out(attribute)
}
}
Expand All @@ -62,10 +62,9 @@ extension ASC.Builds {
@Argument(help: "The attribute you want to get [expired, minOsVersion, processingState, version, usesNonExemptEncryption, uploadedDate, expirationDate] (default: id).")
var attribute: String?

func run() throws {
let op = BuildsOperation(.expire(ids: ids))
op.executeSync()
try op.result.get().out(attribute)
func run() async throws {
let expiredBuilds: [Build] = try await ASCService.expireBuilds(ids: ids)
expiredBuilds.out(attribute)
}
}
}
Loading

0 comments on commit fea7f26

Please sign in to comment.