0.0.20240516 • Published 5 days ago

@maxim_mazurok/gapi.client.androidpublisher-v3 v0.0.20240516

Weekly downloads
-
License
MIT
Repository
github
Last release
5 days ago

TypeScript typings for Google Play Android Developer API v3

Lets Android application developers access their Google Play accounts. At a high level, the expected workflow is to "insert" an Edit, make changes as necessary, and then "commit" it. For detailed description please check documentation.

Installing

Install typings for Google Play Android Developer API:

npm install @types/gapi.client.androidpublisher-v3 --save-dev

Usage

You need to initialize Google API client in your code:

gapi.load('client', () => {
  // now we can use gapi.client
  // ...
});

Then load api client wrapper:

gapi.client.load(
  'https://androidpublisher.googleapis.com/$discovery/rest?version=v3',
  () => {
    // now we can use:
    // gapi.client.androidpublisher
  }
);
// Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
gapi.client.load('androidpublisher', 'v3', () => {
  // now we can use:
  // gapi.client.androidpublisher
});

Don't forget to authenticate your client before sending any request to resources:

// declare client_id registered in Google Developers Console
var client_id = '',
  scope = [
    // View and manage your Google Play Developer account
    'https://www.googleapis.com/auth/androidpublisher',
  ],
  immediate = true;
// ...

gapi.auth.authorize(
  {client_id: client_id, scope: scope, immediate: immediate},
  authResult => {
    if (authResult && !authResult.error) {
      /* handle successful authorization */
    } else {
      /* handle authorization error */
    }
  }
);

After that you can use Google Play Android Developer API resources:

/*
Writes the Safety Labels declaration of an app.
*/
await gapi.client.androidpublisher.applications.dataSafety({
  packageName: 'packageName',
});

/*
Incrementally update targeting for a recovery action. Note that only the criteria selected during the creation of recovery action can be expanded.
*/
await gapi.client.androidpublisher.apprecovery.addTargeting({
  appRecoveryId: 'appRecoveryId',
  packageName: 'packageName',
});

/*
List all app recovery action resources associated with a particular package name and app version.
*/
await gapi.client.androidpublisher.apprecovery.appRecoveries({
  packageName: 'packageName',
});

/*
Cancel an already executing app recovery action. Note that this action changes status of the recovery action to CANCELED.
*/
await gapi.client.androidpublisher.apprecovery.cancel({
  appRecoveryId: 'appRecoveryId',
  packageName: 'packageName',
});

/*
Create an app recovery action with recovery status as DRAFT. Note that this action does not execute the recovery action.
*/
await gapi.client.androidpublisher.apprecovery.create({
  packageName: 'packageName',
});

/*
Deploy an already created app recovery action with recovery status DRAFT. Note that this action activates the recovery action for all targeted users and changes its status to ACTIVE.
*/
await gapi.client.androidpublisher.apprecovery.deploy({
  appRecoveryId: 'appRecoveryId',
  packageName: 'packageName',
});

/*
Commits an app edit.
*/
await gapi.client.androidpublisher.edits.commit({
  editId: 'editId',
  packageName: 'packageName',
});

/*
Deletes an app edit.
*/
await gapi.client.androidpublisher.edits.delete({
  editId: 'editId',
  packageName: 'packageName',
});

/*
Gets an app edit.
*/
await gapi.client.androidpublisher.edits.get({
  editId: 'editId',
  packageName: 'packageName',
});

/*
Creates a new edit for an app.
*/
await gapi.client.androidpublisher.edits.insert({packageName: 'packageName'});

/*
Validates an app edit.
*/
await gapi.client.androidpublisher.edits.validate({
  editId: 'editId',
  packageName: 'packageName',
});

/*
Creates a new external transaction.
*/
await gapi.client.androidpublisher.externaltransactions.createexternaltransaction(
  {parent: 'parent'}
);

/*
Gets an existing external transaction.
*/
await gapi.client.androidpublisher.externaltransactions.getexternaltransaction({
  name: 'name',
});

/*
Refunds or partially refunds an existing external transaction.
*/
await gapi.client.androidpublisher.externaltransactions.refundexternaltransaction(
  {name: 'name'}
);

/*
Downloads a single signed APK generated from an app bundle.
*/
await gapi.client.androidpublisher.generatedapks.download({
  downloadId: 'downloadId',
  packageName: 'packageName',
  versionCode: 1,
});

/*
Returns download metadata for all APKs that were generated from a given app bundle.
*/
await gapi.client.androidpublisher.generatedapks.list({
  packageName: 'packageName',
  versionCode: 1,
});

/*
Grant access for a user to the given package.
*/
await gapi.client.androidpublisher.grants.create({parent: 'parent'});

/*
Removes all access for the user to the given package or developer account.
*/
await gapi.client.androidpublisher.grants.delete({name: 'name'});

/*
Updates access for the user to the given package.
*/
await gapi.client.androidpublisher.grants.patch({name: 'name'});

/*
Deletes in-app products (managed products or subscriptions). Set the latencyTolerance field on nested requests to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT to achieve maximum update throughput. This method should not be used to delete subscriptions. See [this article](https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) for more information.
*/
await gapi.client.androidpublisher.inappproducts.batchDelete({
  packageName: 'packageName',
});

/*
Reads multiple in-app products, which can be managed products or subscriptions. This method should not be used to retrieve subscriptions. See [this article](https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) for more information.
*/
await gapi.client.androidpublisher.inappproducts.batchGet({
  packageName: 'packageName',
});

/*
Updates or inserts one or more in-app products (managed products or subscriptions). Set the latencyTolerance field on nested requests to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT to achieve maximum update throughput. This method should no longer be used to update subscriptions. See [this article](https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) for more information.
*/
await gapi.client.androidpublisher.inappproducts.batchUpdate({
  packageName: 'packageName',
});

/*
Deletes an in-app product (a managed product or a subscription). This method should no longer be used to delete subscriptions. See [this article](https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) for more information.
*/
await gapi.client.androidpublisher.inappproducts.delete({
  packageName: 'packageName',
  sku: 'sku',
});

/*
Gets an in-app product, which can be a managed product or a subscription. This method should no longer be used to retrieve subscriptions. See [this article](https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) for more information.
*/
await gapi.client.androidpublisher.inappproducts.get({
  packageName: 'packageName',
  sku: 'sku',
});

/*
Creates an in-app product (a managed product or a subscription). This method should no longer be used to create subscriptions. See [this article](https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) for more information.
*/
await gapi.client.androidpublisher.inappproducts.insert({
  packageName: 'packageName',
});

/*
Lists all in-app products - both managed products and subscriptions. If an app has a large number of in-app products, the response may be paginated. In this case the response field `tokenPagination.nextPageToken` will be set and the caller should provide its value as a `token` request parameter to retrieve the next page. This method should no longer be used to retrieve subscriptions. See [this article](https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) for more information.
*/
await gapi.client.androidpublisher.inappproducts.list({
  packageName: 'packageName',
});

/*
Patches an in-app product (a managed product or a subscription). This method should no longer be used to update subscriptions. See [this article](https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) for more information.
*/
await gapi.client.androidpublisher.inappproducts.patch({
  packageName: 'packageName',
  sku: 'sku',
});

/*
Updates an in-app product (a managed product or a subscription). This method should no longer be used to update subscriptions. See [this article](https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) for more information.
*/
await gapi.client.androidpublisher.inappproducts.update({
  packageName: 'packageName',
  sku: 'sku',
});

/*
Uploads an APK to internal app sharing. If you are using the Google API client libraries, please increase the timeout of the http request before calling this endpoint (a timeout of 2 minutes is recommended). See [Timeouts and Errors](https://developers.google.com/api-client-library/java/google-api-java-client/errors) for an example in java.
*/
await gapi.client.androidpublisher.internalappsharingartifacts.uploadapk({
  packageName: 'packageName',
});

/*
Uploads an app bundle to internal app sharing. If you are using the Google API client libraries, please increase the timeout of the http request before calling this endpoint (a timeout of 2 minutes is recommended). See [Timeouts and Errors](https://developers.google.com/api-client-library/java/google-api-java-client/errors) for an example in java.
*/
await gapi.client.androidpublisher.internalappsharingartifacts.uploadbundle({
  packageName: 'packageName',
});

/*
Calculates the region prices, using today's exchange rate and country-specific pricing patterns, based on the price in the request for a set of regions.
*/
await gapi.client.androidpublisher.monetization.convertRegionPrices({
  packageName: 'packageName',
});

/*
Refunds a user's subscription or in-app purchase order. Orders older than 3 years cannot be refunded.
*/
await gapi.client.androidpublisher.orders.refund({
  orderId: 'orderId',
  packageName: 'packageName',
});

/*
Gets a single review.
*/
await gapi.client.androidpublisher.reviews.get({
  packageName: 'packageName',
  reviewId: 'reviewId',
});

/*
Lists all reviews.
*/
await gapi.client.androidpublisher.reviews.list({packageName: 'packageName'});

/*
Replies to a single review, or updates an existing reply.
*/
await gapi.client.androidpublisher.reviews.reply({
  packageName: 'packageName',
  reviewId: 'reviewId',
});

/*
Grant access for a user to the given developer account.
*/
await gapi.client.androidpublisher.users.create({parent: 'parent'});

/*
Removes all access for the user to the given developer account.
*/
await gapi.client.androidpublisher.users.delete({name: 'name'});

/*
Lists all users with access to a developer account.
*/
await gapi.client.androidpublisher.users.list({parent: 'parent'});

/*
Updates access for the user to the developer account.
*/
await gapi.client.androidpublisher.users.patch({name: 'name'});
0.0.20240516

5 days ago

0.0.20240515

6 days ago

0.0.20240514

7 days ago

0.0.20240513

8 days ago

0.0.20240509

12 days ago

0.0.20240507

14 days ago

0.0.20240502

19 days ago

0.0.20240501

20 days ago

0.0.20240430

21 days ago

0.0.20240429

22 days ago

0.0.20240425

26 days ago

0.0.20240424

27 days ago

0.0.20240423

28 days ago

0.0.20240422

29 days ago

0.0.20240418

1 month ago

0.0.20240417

1 month ago

0.0.20240416

1 month ago

0.0.20240415

1 month ago

0.0.20240411

1 month ago

0.0.20240410

1 month ago

0.0.20240409

1 month ago

0.0.20240408

1 month ago

0.0.20240404

2 months ago

0.0.20240402

2 months ago

0.0.20240403

2 months ago

0.0.20240328

2 months ago

0.0.20240327

2 months ago

0.0.20240326

2 months ago

0.0.20240325

2 months ago

0.0.20240321

2 months ago

0.0.20240320

2 months ago

0.0.20240319

2 months ago

0.0.20240318

2 months ago

0.0.20240314

2 months ago

0.0.20240312

2 months ago

0.0.20240313

2 months ago

0.0.20240308

2 months ago

0.0.20240306

2 months ago

0.0.20240229

3 months ago

0.0.20240228

3 months ago

0.0.20240226

3 months ago

0.0.20240227

3 months ago

0.0.20240222

3 months ago

0.0.20240221

3 months ago

0.0.20240220

3 months ago

0.0.20240219

3 months ago

0.0.20240215

3 months ago

0.0.20240214

3 months ago

0.0.20240212

3 months ago

0.0.20240213

3 months ago

0.0.20240208

3 months ago

0.0.20240207

3 months ago

0.0.20240206

3 months ago

0.0.20240204

4 months ago

0.0.20240131

4 months ago

0.0.20240129

4 months ago

0.0.20240122

4 months ago

0.0.20240123

4 months ago

0.0.20240118

4 months ago

0.0.20240117

4 months ago

0.0.20240114

4 months ago

0.0.20240116

4 months ago

0.0.20240111

4 months ago

0.0.20240110

4 months ago

0.0.20240109

4 months ago

0.0.20231213

5 months ago

0.0.20231210

5 months ago

0.0.20231212

5 months ago

0.0.20231207

6 months ago

0.0.20231206

6 months ago

0.0.20231205

6 months ago

0.0.20231204

6 months ago

0.0.20231130

6 months ago

0.0.20230816

9 months ago

0.0.20230817

9 months ago

0.0.20231106

7 months ago

0.0.20230810

9 months ago

0.0.20231108

6 months ago

0.0.20231107

7 months ago

0.0.20230814

9 months ago

0.0.20230815

9 months ago

0.0.20231111

6 months ago

0.0.20231115

6 months ago

0.0.20230808

10 months ago

0.0.20230926

8 months ago

0.0.20230927

8 months ago

0.0.20230806

10 months ago

0.0.20230809

10 months ago

0.0.20230920

8 months ago

0.0.20230921

8 months ago

0.0.20230803

10 months ago

0.0.20230925

8 months ago

0.0.20230801

10 months ago

0.0.20230802

10 months ago

0.0.20230719

10 months ago

0.0.20230717

10 months ago

0.0.20230718

10 months ago

0.0.20231128

6 months ago

0.0.20230711

10 months ago

0.0.20231127

6 months ago

0.0.20230712

10 months ago

0.0.20230830

9 months ago

0.0.20231129

6 months ago

0.0.20230831

9 months ago

0.0.20230713

10 months ago

0.0.20231010

7 months ago

0.0.20231012

7 months ago

0.0.20231016

7 months ago

0.0.20230829

9 months ago

0.0.20230708

11 months ago

0.0.20230706

11 months ago

0.0.20230821

9 months ago

0.0.20231116

6 months ago

0.0.20230822

9 months ago

0.0.20230704

11 months ago

0.0.20230823

9 months ago

0.0.20230824

9 months ago

0.0.20231120

6 months ago

0.0.20231122

6 months ago

0.0.20231001

8 months ago

0.0.20231121

6 months ago

0.0.20231003

8 months ago

0.0.20231123

6 months ago

0.0.20230731

10 months ago

0.0.20231031

7 months ago

0.0.20231030

7 months ago

0.0.20231018

7 months ago

0.0.20231017

7 months ago

0.0.20230720

10 months ago

0.0.20231019

7 months ago

0.0.20230726

10 months ago

0.0.20230727

10 months ago

0.0.20230724

10 months ago

0.0.20231023

7 months ago

0.0.20231025

7 months ago

0.0.20231024

7 months ago

0.0.20230629

11 months ago

0.0.20230628

11 months ago

0.0.20230917

8 months ago

0.0.20230919

8 months ago

0.0.20230910

8 months ago

0.0.20230913

8 months ago

0.0.20230914

8 months ago

0.0.20230912

8 months ago

0.0.20230906

9 months ago

0.0.20230907

9 months ago

0.0.20230905

9 months ago

0.0.20230627

11 months ago

0.0.20230626

11 months ago

0.0.20230524

12 months ago

0.0.20230525

12 months ago

0.0.20230522

12 months ago

0.0.20230523

12 months ago

0.0.20230531

12 months ago

0.0.20230530

12 months ago

0.0.20230612

11 months ago

0.0.20230613

11 months ago

0.0.20230614

11 months ago

0.0.20230615

11 months ago

0.0.20230620

11 months ago

0.0.20230607

12 months ago

0.0.20230608

12 months ago

0.0.20230601

12 months ago

0.0.20230605

12 months ago

0.0.20230606

12 months ago

0.0.20230511

1 year ago

0.0.20230512

1 year ago

0.0.20230517

1 year ago

0.0.20230518

1 year ago

0.0.20230516

1 year ago

0.0.20230509

1 year ago

0.0.20230502

1 year ago

0.0.20230622

11 months ago

0.0.20230504

1 year ago

0.0.20230510

1 year ago

0.0.20230418

1 year ago

0.0.20230301

1 year ago

0.0.20230420

1 year ago

0.0.20230405

1 year ago

0.0.20230406

1 year ago

0.0.20230315

1 year ago

0.0.20230316

1 year ago

0.0.20230313

1 year ago

0.0.20230314

1 year ago

0.0.20230319

1 year ago

0.0.20230322

1 year ago

0.0.20230323

1 year ago

0.0.20230321

1 year ago

0.0.20230425

1 year ago

0.0.20230304

1 year ago

0.0.20230302

1 year ago

0.0.20230424

1 year ago

0.0.20230308

1 year ago

0.0.20230309

1 year ago

0.0.20230427

1 year ago

0.0.20230307

1 year ago

0.0.20230326

1 year ago

0.0.20230327

1 year ago

0.0.20230329

1 year ago

0.0.20230330

1 year ago

0.0.20230228

1 year ago

0.0.20230226

1 year ago

0.0.20230216

1 year ago

0.0.20230214

1 year ago

0.0.20230215

1 year ago

0.0.20230223

1 year ago

0.0.20230221

1 year ago

0.0.20230222

1 year ago

0.0.20230206

1 year ago

0.0.20230129

1 year ago

0.0.20230209

1 year ago

0.0.20230207

1 year ago

0.0.20230208

1 year ago

0.0.20230131

1 year ago

0.0.20230212

1 year ago

0.0.20230201

1 year ago

0.0.20230202

1 year ago

0.0.20221116

2 years ago

0.0.20221115

2 years ago

0.0.20221114

2 years ago

0.0.20221110

2 years ago

0.0.20230102

1 year ago

0.0.20221109

2 years ago

0.0.20221229

1 year ago

0.0.20221108

2 years ago

0.0.20221228

1 year ago

0.0.20221104

2 years ago

0.0.20230126

1 year ago

0.0.20221222

1 year ago

0.0.20230117

1 year ago

0.0.20221215

1 year ago

0.0.20230118

1 year ago

0.0.20221213

1 year ago

0.0.20221212

1 year ago

0.0.20230119

1 year ago

0.0.20230124

1 year ago

0.0.20221208

1 year ago

0.0.20230125

1 year ago

0.0.20221207

1 year ago

0.0.20221206

1 year ago

0.0.20221129

1 year ago

0.0.20230123

1 year ago

0.0.20221205

1 year ago

0.0.20221128

1 year ago

0.0.20230104

1 year ago

0.0.20230105

1 year ago

0.0.20221201

1 year ago

0.0.20221123

1 year ago

0.0.20221122

1 year ago

0.0.20221121

1 year ago

0.0.20230109

1 year ago

0.0.20230110

1 year ago

0.0.20230111

1 year ago

0.0.20230112

1 year ago

0.0.20221117

2 years ago

0.0.20221031

2 years ago

0.0.20221016

2 years ago

0.0.20221013

2 years ago

0.0.20221012

2 years ago

0.0.20221011

2 years ago

0.0.20221009

2 years ago

0.0.20221020

2 years ago

0.0.20221006

2 years ago

0.0.20221027

2 years ago

0.0.20221005

2 years ago

0.0.20221103

2 years ago

0.0.20221026

2 years ago

0.0.20221004

2 years ago

0.0.20221102

2 years ago

0.0.20221025

2 years ago

0.0.20221101

2 years ago

0.0.20221024

2 years ago

0.0.20221001

2 years ago

0.0.20220927

2 years ago

0.0.20220928

2 years ago

0.0.20220929

2 years ago

0.0.20221019

2 years ago

0.0.20221018

2 years ago

0.0.20220830

2 years ago

0.0.20220906

2 years ago

0.0.20220907

2 years ago

0.0.20220919

2 years ago

0.0.20220831

2 years ago

0.0.20220820

2 years ago

0.0.20220920

2 years ago

0.0.20220921

2 years ago

0.0.20220823

2 years ago

0.0.20220824

2 years ago

0.0.20220913

2 years ago

0.0.20220825

2 years ago

0.0.20220926

2 years ago

0.0.20220915

2 years ago

0.0.20220817

2 years ago

0.0.20220816

2 years ago

0.0.20220813

2 years ago

0.0.20220811

2 years ago