@capgo/cli
Version:
A CLI to upload to capgo servers
45 lines (44 loc) • 1.77 kB
TypeScript
/** Minimal shape of a Play Store app needed for reconciliation. */
export interface PlayAppLike {
packageName: string;
displayName: string;
}
/**
* Reconcile outcome for the Android package-select step.
*
* - `exact-match` — a Play app's `packageName` == a single clean Gradle id.
* Auto-confirm, no picker. Carries the matched package.
* - `wrong-build-id` — apps exist but the build id matches none → Path A picker.
* - `no-app` — no Play apps at all → Path B (create the app).
* - `multi-gradle` — several Gradle flavors and no clean single match → force
* the picker so the user disambiguates.
*/
export type AndroidReconcileResult = {
kind: 'exact-match';
packageName: string;
} | {
kind: 'wrong-build-id';
} | {
kind: 'no-app';
} | {
kind: 'multi-gradle';
};
export interface ReconcileAndroidAppInput {
/** Every distinct `applicationId` found in the project's Gradle files (≥0). */
gradleIds: string[];
/** Apps that actually exist in the user's Play Console. */
apps: PlayAppLike[];
}
/**
* Pure reconciliation of the Android app-existence invariant.
*
* The common Capacitor case is a single Gradle id, which defers entirely to the
* shared iOS classifier (`packageName` ↦ `bundleId`). Android has no
* Developer-portal registration split, so both iOS `no-app-*` results collapse
* to a single `no-app` route.
*
* Multiple Gradle ids are handled here: exactly one matching a Play app is
* still a clean single match (`exact-match`); zero apps is `no-app`; anything
* else forces the picker (`multi-gradle`).
*/
export declare function reconcileAndroidApp(input: ReconcileAndroidAppInput): AndroidReconcileResult;