Skip to content

Commit

Permalink
Merge pull request #26 from Vacxe/release-045
Browse files Browse the repository at this point in the history
feat(release): 0.4.5
  • Loading branch information
Vacxe authored May 16, 2024
2 parents 01dd5a8 + a7fea1e commit 5451066
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 40 deletions.
2 changes: 1 addition & 1 deletion github-action/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/vacxe/google-play-cli:0.4.4
FROM ghcr.io/vacxe/google-play-cli:0.4.5

COPY entrypoint.sh /entrypoint.sh
COPY templates /templates
Expand Down
24 changes: 12 additions & 12 deletions src/main/kotlin/com/github/vacxe/googleplaycli/Commands.kt
Original file line number Diff line number Diff line change
Expand Up @@ -712,13 +712,13 @@ object Commands {
}
}

object Internalappsharingartifacts {
object InternalAppSharingArtifacts {
class UploadApk :
BaseCommand(name = "upload-apk", actionDescription = "Uploads an APK to internal app sharing") {
private val apk: File by option("--apk", "-a", help = "Apk file path").file().required()

override fun run(api: PlayStoreApi) = api.internalappsharingartifactsUploadapk(
InternalappsharingartifactsUploadapkModel(
override fun run(api: PlayStoreApi) = api.internalAppSharingArtifactsUploadApk(
InternalAppSharingArtifactsUploadApkModel(
packageName,
apk,
parameters
Expand All @@ -727,11 +727,11 @@ object Commands {
}

class UploadBundle :
BaseCommand(name = "upload-bunble", actionDescription = "Uploads an app bundle to internal app sharing") {
BaseCommand(name = "upload-bundle", actionDescription = "Uploads an app bundle to internal app sharing") {
private val bundle: File by option("--bundle", "-b", help = "Bundle file path").file().required()

override fun run(api: PlayStoreApi) = api.internalappsharingartifactsUploadbundle(
InternalappsharingartifactsUploadbundleModel(
override fun run(api: PlayStoreApi) = api.internalAppSharingArtifactsUploadBundle(
InternalAppSharingArtifactsUploadBundleModel(
packageName,
bundle,
parameters
Expand Down Expand Up @@ -769,7 +769,7 @@ object Commands {
).required()

override fun run(api: PlayStoreApi) =
api.inappproductsDelete(InappproductsDeleteModel(packageName, sku, parameters))
api.inAppProductsDelete(InappproductsDeleteModel(packageName, sku, parameters))
}

class Get :
Expand All @@ -781,7 +781,7 @@ object Commands {
).required()

override fun run(api: PlayStoreApi) =
api.inappproductsGet(InappproductsGetModel(packageName, sku, parameters))
api.inAppProductsGet(InappproductsGetModel(packageName, sku, parameters))
}

class Insert : BaseCommand(name = "insert", actionDescription = "Creates a new in-app product for an app") {
Expand All @@ -797,7 +797,7 @@ object Commands {
""".trimIndent()
).flag()

override fun run(api: PlayStoreApi) = api.inappproductsInsert(
override fun run(api: PlayStoreApi) = api.inAppProductsInsert(
InappproductsInsertModel(
packageName,
jsonPath,
Expand All @@ -811,7 +811,7 @@ object Commands {
name = "list",
actionDescription = "List all the in-app products for an Android app, both subscriptions and managed in-app products"
) {
override fun run(api: PlayStoreApi) = api.inappproductsList(DefaultModel(packageName, parameters))
override fun run(api: PlayStoreApi) = api.inAppProductsList(DefaultModel(packageName, parameters))
}

class Patch : BaseCommand(
Expand All @@ -835,7 +835,7 @@ object Commands {
""".trimIndent()
).flag()

override fun run(api: PlayStoreApi) = api.inappproductsPatch(
override fun run(api: PlayStoreApi) = api.inAppProductsPatch(
InappproductsPatchModel(
packageName,
sku,
Expand Down Expand Up @@ -864,7 +864,7 @@ object Commands {
""".trimIndent()
).flag()

override fun run(api: PlayStoreApi) = api.inappproductsUpdate(
override fun run(api: PlayStoreApi) = api.inAppProductsUpdate(
InappproductsUpdateModel(
packageName,
sku,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.github.vacxe.googleplaycli
import com.github.vacxe.googleplaycli.actions.*
import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport
import com.google.api.client.http.HttpRequestInitializer
import com.google.api.client.json.JsonFactory
import com.google.api.client.json.gson.GsonFactory
import com.google.api.services.androidpublisher.AndroidPublisher
import com.google.api.services.androidpublisher.AndroidPublisherScopes
Expand All @@ -15,14 +14,14 @@ import java.time.Duration
class PlayStoreApi(serviceAccountInputStream: InputStream, appName: String) :
Apks,
Bundles,
Deobfuscationfiles,
DeobfuscationFiles,
Details,
DeviceTierConfigs,
Edit,
ExpansionFiles,
Images,
Inappproducts,
Internalappsharingartifacts,
InAppProducts,
InternalAppSharingArtifacts,
Listings,
Orders,
Reviews,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ fun main(args: Array<String>) {
addCmd { Commands.Reviews.Reply() }
}
subcmd("internal-app-sharing-artifacts") {
addCmd { Commands.Internalappsharingartifacts.UploadApk() }
addCmd { Commands.Internalappsharingartifacts.UploadBundle() }
addCmd { Commands.InternalAppSharingArtifacts.UploadApk() }
addCmd { Commands.InternalAppSharingArtifacts.UploadBundle() }
}
subcmd("orders") {
addCmd { Commands.Orders.Refund() }
}
subcmd("inappproducts") {
subcmd("in-app-products") {
addCmd { Commands.Inappproducts.Delete() }
addCmd { Commands.Inappproducts.Get() }
addCmd { Commands.Inappproducts.Insert() }
Expand All @@ -86,7 +86,7 @@ fun main(args: Array<String>) {
addCmd {
object : CliktCommand(name = "version", help = "Library version code") {
override fun run() {
println("0.4.4")
println("0.4.5")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package com.github.vacxe.googleplaycli.actions

import com.github.vacxe.googleplaycli.actions.model.DeobfuscationfilesUploadModel
import com.github.vacxe.googleplaycli.core.constants.MediaType.MIME_TYPE_APK
import com.github.vacxe.googleplaycli.core.constants.MediaType.MIME_TYPE_STREAM
import com.google.api.client.http.AbstractInputStreamContent
import com.google.api.client.http.FileContent
import com.google.api.services.androidpublisher.AndroidPublisher
import com.google.api.services.androidpublisher.model.DeobfuscationFilesUploadResponse

interface Deobfuscationfiles : BaseAction {
interface DeobfuscationFiles : BaseAction {
fun deobfuscationFilesUpload(model: DeobfuscationfilesUploadModel): DeobfuscationFilesUploadResponse {
val edits: AndroidPublisher.Edits = androidPublisher.edits()
val editId = model.editId ?: edits.insert(model.packageName, null).execute().id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import com.google.api.services.androidpublisher.model.InAppProduct
import com.google.api.services.androidpublisher.model.InappproductsListResponse
import java.nio.file.Files

interface Inappproducts : BaseAction {
interface InAppProducts : BaseAction {

fun inappproductsDelete(model: InappproductsDeleteModel): Void {
fun inAppProductsDelete(model: InappproductsDeleteModel): Void {
return androidPublisher
.inappproducts()
.delete(model.packageName, model.sku)
Expand All @@ -17,7 +17,7 @@ interface Inappproducts : BaseAction {
.execute()
}

fun inappproductsGet(model: InappproductsGetModel): InAppProduct {
fun inAppProductsGet(model: InappproductsGetModel): InAppProduct {
return androidPublisher
.inappproducts()
.get(model.packageName, model.sku)
Expand All @@ -27,7 +27,7 @@ interface Inappproducts : BaseAction {
.execute()
}

fun inappproductsInsert(model: InappproductsInsertModel): InAppProduct {
fun inAppProductsInsert(model: InappproductsInsertModel): InAppProduct {
val product = Files.newInputStream(model.jsonPath).use {
androidPublisher.jsonFactory.fromInputStream(it, InAppProduct::class.java)
}
Expand All @@ -42,7 +42,7 @@ interface Inappproducts : BaseAction {
.execute()
}

fun inappproductsList(model: DefaultModel): InappproductsListResponse {
fun inAppProductsList(model: DefaultModel): InappproductsListResponse {
return androidPublisher.inappproducts()
.list(model.packageName)
.apply {
Expand All @@ -51,7 +51,7 @@ interface Inappproducts : BaseAction {
.execute()
}

fun inappproductsPatch(model: InappproductsPatchModel): InAppProduct {
fun inAppProductsPatch(model: InappproductsPatchModel): InAppProduct {
val product = Files.newInputStream(model.jsonPath).use {
androidPublisher.jsonFactory.fromInputStream(it, InAppProduct::class.java)
}
Expand All @@ -66,7 +66,7 @@ interface Inappproducts : BaseAction {
.execute()
}

fun inappproductsUpdate(model: InappproductsUpdateModel): InAppProduct {
fun inAppProductsUpdate(model: InappproductsUpdateModel): InAppProduct {
val product = Files.newInputStream(model.jsonPath).use {
androidPublisher.jsonFactory.fromInputStream(it, InAppProduct::class.java)
}
Expand All @@ -80,5 +80,4 @@ interface Inappproducts : BaseAction {
}
.execute()
}

}
}
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
package com.github.vacxe.googleplaycli.actions

import com.github.vacxe.googleplaycli.actions.model.InternalappsharingartifactsUploadapkModel
import com.github.vacxe.googleplaycli.actions.model.InternalappsharingartifactsUploadbundleModel
import com.github.vacxe.googleplaycli.actions.model.InternalAppSharingArtifactsUploadApkModel
import com.github.vacxe.googleplaycli.actions.model.InternalAppSharingArtifactsUploadBundleModel
import com.github.vacxe.googleplaycli.core.constants.MediaType
import com.google.api.client.http.AbstractInputStreamContent
import com.google.api.client.http.FileContent
import com.google.api.services.androidpublisher.model.InternalAppSharingArtifact

interface Internalappsharingartifacts : BaseAction {
fun internalappsharingartifactsUploadapk(model: InternalappsharingartifactsUploadapkModel): InternalAppSharingArtifact {
interface InternalAppSharingArtifacts : BaseAction {
fun internalAppSharingArtifactsUploadApk(model: InternalAppSharingArtifactsUploadApkModel): InternalAppSharingArtifact {
val apk: AbstractInputStreamContent = FileContent(MediaType.MIME_TYPE_APK, model.apk)
return androidPublisher
.internalappsharingartifacts()
.uploadapk(model.packageName, apk)

.apply {
model.parameters.forEach { (key, value) -> set(key, value) }
}
.execute()
}

fun internalappsharingartifactsUploadbundle(model: InternalappsharingartifactsUploadbundleModel): InternalAppSharingArtifact {
val bundle: AbstractInputStreamContent = FileContent(MediaType.MIME_TYPE_APK, model.bundle)
fun internalAppSharingArtifactsUploadBundle(model: InternalAppSharingArtifactsUploadBundleModel): InternalAppSharingArtifact {
val bundle: AbstractInputStreamContent = FileContent(MediaType.MIME_TYPE_STREAM, model.bundle)
return androidPublisher
.internalappsharingartifacts()
.uploadbundle(model.packageName, bundle)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.github.vacxe.googleplaycli.actions.model

import java.io.File

class InternalappsharingartifactsUploadapkModel(
class InternalAppSharingArtifactsUploadApkModel(
val packageName: String,
val apk: File,
requestParameters: String?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.github.vacxe.googleplaycli.actions.model

import java.io.File

class InternalappsharingartifactsUploadbundleModel(
class InternalAppSharingArtifactsUploadBundleModel(
val packageName: String,
val bundle: File,
requestParameters: String?
Expand Down

0 comments on commit 5451066

Please sign in to comment.