UNPKG

firebase-app-distribution

Version:
144 lines (137 loc) 4.57 kB
import { GoogleAuthOptions } from 'google-auth-library'; type UploadReleaseResult = "UPLOAD_RELEASE_RESULT_UNSPECIFIED" | "RELEASE_CREATED" | "RELEASE_UPDATED" | "RELEASE_UNMODIFIED"; interface Release { name: string; releaseNotes?: string; displayVersion: string; buildVersion: string; createTime: Date; firebaseConsoleUri: string; testingUri: string; binaryDownloadUri: string; updateTime?: string; expireTime?: string; } interface Operation { name: string; done?: boolean; error?: { code: number; message: string; status: string; }; response?: { "@type": string; result: UploadReleaseResult; release: Release; }; metadata?: any; } declare class Operations { private parent; constructor(parent: FirebaseAppDistribution); get(operationName: string): Promise<Operation>; } interface Tester { name: string; displayName?: string; groups?: string[]; lastActivityTime?: string; email: string; } interface TesterListArgs { pageSize?: number; email?: string; displayName?: string; groups?: string; maxPages?: number; } interface TesterUpdateArgs { displayName?: string; groups?: string[]; } declare class Testers { private parent; constructor(parent: FirebaseAppDistribution); add(emails: string[]): Promise<Tester[]>; remove(emails: string[]): Promise<string[]>; list({ pageSize, email, displayName, groups, maxPages, }?: TesterListArgs): Promise<Tester[]>; get(email: string): Promise<Tester | null>; update(email: string, { displayName, groups }?: TesterUpdateArgs): Promise<Tester>; } interface ListReleasesOptions { pageSize?: number; orderBy?: string; filter?: string; maxPages?: number; } interface DistributeReleaseOptions { testerEmails: string[]; groupAliases: string[]; } declare class Releases { #private; private parent; operations: Operations; constructor(parent: FirebaseAppDistribution); upload(appId: string, binaryPath: string, fileName: string): Promise<Operation>; delete(appId: string, releaseNames: string[]): Promise<{}>; distribute(releaseName: string, { testerEmails, groupAliases }: DistributeReleaseOptions): Promise<{}>; get(releaseName: string): Promise<Release>; list(appId: string, { pageSize, orderBy, filter, maxPages }?: ListReleasesOptions): Promise<Release[]>; addReleaseNotes(releaseName: string, releaseNotes: string): Promise<Release>; } interface UploadAndDistributeOptions { appId: string; binaryPath: string; fileName: string; testerEmails: string[]; groupAliases: string[]; releaseNotes?: string; uploadOperationTimeout?: number; uploadOperationInteval?: number; } interface FirebaseAppDistributionAuthOptions extends Omit<GoogleAuthOptions, "scopes"> { } declare class FirebaseAppDistribution { private projectNumber; private projectId; private googleAuth; private accessToken; testers: Testers; groups: Groups; releases: Releases; constructor(authOptions: FirebaseAppDistributionAuthOptions); getProjectId(): Promise<string>; getProjectNumber(): Promise<string>; getAccessToken(): Promise<string>; uploadAndDistribute({ appId, binaryPath, fileName, testerEmails, groupAliases, releaseNotes, uploadOperationInteval, uploadOperationTimeout, }: UploadAndDistributeOptions): Promise<Release>; } interface Group { name: string; displayName: string; testerCount?: number; releaseCount?: number; inviteLinkCount?: number; id: string; } type ValidGroupId = Lowercase<string>; interface GroupListArgs { pageSize?: number; maxPages?: number; } interface GroupUpdateArgs { displayName?: string; } declare class Groups { private parent; constructor(parent: FirebaseAppDistribution); create(displayName: string, groupId?: string): Promise<Group>; delete(groupId: ValidGroupId): Promise<{}>; get(groupId: ValidGroupId): Promise<Group | null>; list({ pageSize, maxPages }?: GroupListArgs): Promise<Group[]>; update(groupId: ValidGroupId, { displayName }: GroupUpdateArgs): Promise<Group>; removeTesters(groupId: string, emails: string[]): Promise<{}>; addTesters(groupId: string, emails: string[]): Promise<{}>; } export { FirebaseAppDistribution as F, type Group as G, type Operation, Operations, Releases as R, type Release, type Tester as T, Testers as a, type FirebaseAppDistributionAuthOptions as b, Groups as c };