@bubblewrap/core
Version:
Core Library to generate, build and sign TWA projects
82 lines (81 loc) • 4.25 kB
TypeScript
declare const TRACK_VALUES: string[];
export type PlayStoreTrack = typeof TRACK_VALUES[number];
export declare const PlayStoreTracks: PlayStoreTrack[];
export declare function asPlayStoreTrack(input?: string): PlayStoreTrack | null;
export declare class GooglePlay {
private _googlePlayApi;
/**
* Constructs a Google Play object with the gradleWrapper so we can use a
* gradle plugin to communicate with Google Play.
*
* @param serviceAccountJsonFilePath This is the service account file to communicate with the
* play publisher API.
*/
constructor(serviceAccountJsonFilePath: string);
/**
* Generates an editId that should be used in all play operations.
* @param packageName - The package that will be worked upon.
* @param operation - The Play Operation which requires an editId injected
* @param commitEdit - Whether or not this edit is a action or query edit. true indicates an action edit.
* @returns - A PlayOperationResult which contains the output of the operation in a field that was worked upon.
*/
performPlayOperation<Type>(packageName: string, operation: (editId: string) => Promise<Type>, commitEdit?: boolean): Promise<Type>;
/**
* This calls the publish bundle command and publishes an existing artifact to Google
* Play.
* Calls the following Play API commands in order:
* Edits.Insert
* Edits.Bundles.Upload
* Edits.Tracks.Update
* Edits.Commit
* https://developers.google.com/android-publisher/api-ref/rest/v3/edits.bundles/upload
* https://developers.google.com/android-publisher/edits#workflow
* @param track - Specifies the track that the user would like to publish to.
* @param filepath - Filepath of the App bundle you would like to upload.
* @param packageName - Package name of the bundle.
* @param retainedBundles - All bundles that should be retained on upload. This is useful for
* ChromeOS only releases.
*/
publishBundle(track: PlayStoreTrack, filepath: string, packageName: string, retainedBundles: number[], editId: string): Promise<void>;
/**
* This calls the Edits.Tracks.Update play publisher api command. This will do the updating of
* the user selected track for the reelase to the play store.
* @param track - Specifies the track that the user would like to publish to.
* @param versionCodes - Specifies all versions of the app bundle to be included on release
* (including retained artifacts).
* @param packageName - packageName of the bundle.
* @param editId - The current edit hosted on Google Play.
*/
private addBundleToTrack;
/**
* Connects to the Google Play Console and retrieves a list of all Android App Bundles for the
* given packageName. Finds the largest versionCode of those bundles and returns it. Considers
* both ChromeOS and Android Releases.
* @param packageName - The packageName of the versionCode we are looking up.
*/
getLargestVersionCode(packageName: string, editId: string): Promise<number>;
/**
* Starts an edit on the Play servers. This is the basis for any play publishing api operation.
* @param packageName - the packageName of the app we want to interact with.
*/
private startPlayOperation;
/**
* Cancels the edit in progress on the Play server.
* @param packageName - The packageName of the app we are interacting with.
* @param editId - The editId that is currently in progress.
*/
private endPlayOperation;
/**
* Checks to see if the version that we want to retain already exists within the Play Store.
* @param packageName - The packageName of the versionCode we are looking up.
* @param versionCode - The version code of the APK / Bundle we want to retain.
*/
versionExists(packageName: string, versionCode: number, editId: string): Promise<boolean>;
/**
* This fetches the Android client using the bubblewrap configuration file.
* @param serviceAccountJsonFilePath - The file path to the service account file. This allows
* communication to the Play Publisher API.
*/
private getAndroidClient;
}
export {};