From 230f0fcbd8fa81b850b01661770ef14e23ff8404 Mon Sep 17 00:00:00 2001 From: Eric Gilmore Date: Fri, 31 May 2019 14:39:29 -0700 Subject: [PATCH 1/2] Adding comments for admin.projectManagement. --- src/index.d.ts | 293 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 293 insertions(+) diff --git a/src/index.d.ts b/src/index.d.ts index b5aa716732..e3222cf826 100755 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -4786,56 +4786,349 @@ declare namespace admin.instanceId { } declare namespace admin.projectManagement { + + /** + * A SHA-1 or SHA-256 certificate. + * + * Do not call this constructor directly. Instead, use + * [`projectManagement.shaCertificate()`](admin.projectManagement.ProjectManagement#shaCertificate). + */ interface ShaCertificate { + + /** + * The SHA certificate type. + * + * @example + * ```javascript + * var certType = shaCertificate.certType; + * ``` + */ certType: ('sha1' | 'sha256'); + + /** + * The SHA-1 or SHA-256 hash for this certificate. + * + * @example + * ```javascript + * var shaHash = shaCertificate.shaHash; + * ``` + */ shaHash: string; + + /** + * The fully-qualified resource name that identifies this sha-key. + * + * This is useful when manually constructing requests for Firebase's public API. + * + * @example + * ```javascript + * var resourceName = shaCertificate.resourceName; + * ``` + */ resourceName?: string; } + /** + * Metadata about a Firebase Android app. + */ interface AndroidAppMetadata { + + /** + * The fully-qualified resource name that identifies this app. + * + * This is useful when manually constructing requests for Firebase's public API. + * + * @example + * ```javascript + * var resourceName = androidAppMetadata.resourceName; + * ``` + */ resourceName: string; + + /** + * The optional user-assigned display name of the app. + * + * @example + * ```javascript + * var displayName = androidAppMetadata.displayName; + * ``` + */ appId: string; + + /** + * The optional user-assigned display name of the app. + * + * @example + * ```javascript + * var displayName = androidAppMetadata.displayName; + * ``` + */ displayName: string | null; + + /** + * The globally unique, user-assigned ID of the parent project for the app. + * + * @example + * ```javascript + * var projectId = androidAppMetadata.projectId; + * ``` + */ projectId: string; + + /** + * The canonical package name of the Android App, as would appear in the Google + * Play Developer Console. + * + * @example + * ```javascript + * var packageName = androidAppMetadata.packageName; + * ``` + */ packageName: string; } + /** + * A reference to a Firebase Android app. + * + * Do not call this constructor directly. Instead, use + * [`projectManagement.androidApp()`](admin.projectManagement.ProjectManagement#androidApp). + */ interface AndroidApp { appId: string; + + /** + * Retrieves metadata about this Android app. + * + * @return A promise that resolves to the retrieved metadata about this Android app. + */ getMetadata(): Promise; + + /** + * Sets the optional user-assigned display name of the app. + * + * @param newDisplayName The new display name to set. + * + * @return A promise that resolves when the display name has + * been set. + */ setDisplayName(newDisplayName: string): Promise; + + /** + * Gets the list of SHA certificates associated with this Android app in + * Firebase. + * + * @return The list of SHA-1 and SHA-256 certificates associated with this Android app in + * Firebase. + */ getShaCertificates(): Promise; + + /** + * Adds the given SHA certificate to this Android app. + * + * @param certificateToAdd The SHA certificate to add. + * + * @return A promise that resolves when the given certificate + * has been added to the Android app. + */ addShaCertificate(certificateToAdd: ShaCertificate): Promise; + + /** + * Deletes the specified SHA certificate from this Android app. + * + * @param certificateToDelete The SHA certificate to delete. + * + * @return A promise that resolves when the specified + * certificate has been removed from the Android app. + */ deleteShaCertificate(certificateToRemove: ShaCertificate): Promise; + + /** + * Gets the configuration artifact associated with this app. + * + * @return A promise that resolves to the Android app's + * Firebase config file, in UTF-8 string format. This string is typically + * intended to be written to a JSON file that gets shipped with your Android + * app. + */ getConfig(): Promise; } + /** + * Metadata about a Firebase iOS app. + */ interface IosAppMetadata { + + /** + * The fully-qualified resource name that identifies this app. + * + * This is useful when manually constructing requests for Firebase's public API. + * + * @example + * ```javascript + * var resourceName = iOSAppMetadata.resourceName; + * ``` + */ resourceName: string; + + /** + * The optional user-assigned display name of the app. + * + * @example + * ```javascript + * var displayName = iOSAppMetadata.displayName; + * ``` + */ appId: string; + + /** + * The optional user-assigned display name of the app. + * + * @example + * ```javascript + * var displayName = iOSAppMetadata.displayName; + * ``` + */ displayName: string; + + /** + * The globally unique, user-assigned ID of the parent project for the app. + * + * @example + * ```javascript + * var projectId = iOSAppMetadata.projectId; + * ``` + */ projectId: string; + + /** + * The canonical bundle ID of the iOS App as it would appear in the iOS App + * Store. + * + * @example + * ```javascript + * var bundleId = iosAppMetadata.bundleId; + *``` + */ bundleId: string; } + /** + * A reference to a Firebase iOS app. + * + * Do not call this constructor directly. Instead, use + * [`projectManagement.iosApp()`](admin.projectManagement.ProjectManagement#iosApp). + */ interface IosApp { appId: string; + /** + * Retrieves metadata about this iOS app. + * + * @return {!Promise} A promise that + * resolves to the retrieved metadata about this iOS app. + */ getMetadata(): Promise; + + /** + * Sets the optional user-assigned display name of the app. + * + * @param newDisplayName The new display name to set. + * + * @return A promise that resolves when the display name has + * been set. + */ setDisplayName(newDisplayName: string): Promise; + + /** + * Gets the configuration artifact associated with this app. + * + * @return A promise that resolves to the iOS app's Firebase + * config file, in UTF-8 string format. This string is typically intended to + * be written to a plist file that gets shipped with your iOS app. + */ getConfig(): Promise; } + /** + * The Firebase ProjectManagement service interface. + * + * Do not call this constructor directly. Instead, use + * [`admin.projectManagement()`](admin.projectManagement#projectManagement). + */ interface ProjectManagement { app: admin.app.App; + /** + * Lists up to 100 Firebase Android apps associated with this Firebase project. + * + * @return The list of Android apps. + */ listAndroidApps(): Promise; + + /** + * Lists up to 100 Firebase iOS apps associated with this Firebase project. + * + * @return The list of iOS apps. + */ listIosApps(): Promise; + + /** + * Creates an `AndroidApp` object, referencing the specified Android app within + * this Firebase project. + * + * This method does not perform an RPC. + * + * @param appId The `appId` of the Android app to reference. + * + * @return An `AndroidApp` object that references the specified Firebase Android app. + */ androidApp(appId: string): admin.projectManagement.AndroidApp; + + /** + * Creates an `iOSApp` object, referencing the specified iOS app within + * this Firebase project. + * + * This method does not perform an RPC. + * + * @param appId The `appId` of the iOS app to reference. + * + * @return An `iOSApp` object that references the specified Firebase iOS app. + */ iosApp(appId: string): admin.projectManagement.IosApp; + + /** + * Creates a `ShaCertificate` object. + * + * This method does not perform an RPC. + * + * @param shaHash The SHA-1 or SHA-256 hash for this certificate. + * + * @return A `ShaCertificate` object contains the specified SHA hash. + */ shaCertificate(shaHash: string): admin.projectManagement.ShaCertificate; + + /** + * Creates a new Firebase Android app associated with this Firebase project. + * + * @param packageName The canonical package name of the Android App, + * as would appear in the Google Play Developer Console. + * @param displayName An optional user-assigned display name for this + * new app. + * + * @return A promise that resolves to the newly created Android app. + */ createAndroidApp( packageName: string, displayName?: string): Promise; + + /** + * Creates a new Firebase iOS app associated with this Firebase project. + * + * @param bundleId The iOS app bundle ID to use for this new app. + * @param displayName An optional user-assigned display name for this + * new app. + * + * @return A promise that resolves to the newly created iOS app. + */ createIosApp(bundleId: string, displayName?: string): Promise; } } From 9ef1c1471610659cb9cc056180188e4a33c72f2a Mon Sep 17 00:00:00 2001 From: Eric Gilmore Date: Tue, 4 Jun 2019 08:21:12 -0700 Subject: [PATCH 2/2] Fixing misplaced comments for appId metadata. --- src/index.d.ts | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/index.d.ts b/src/index.d.ts index e3222cf826..7e5c1e3e9d 100755 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -4846,11 +4846,11 @@ declare namespace admin.projectManagement { resourceName: string; /** - * The optional user-assigned display name of the app. + * The globally unique, Firebase-assigned identifier of the app. * * @example * ```javascript - * var displayName = androidAppMetadata.displayName; + * var appId = androidAppMetadata.appId; * ``` */ appId: string; @@ -4908,14 +4908,12 @@ declare namespace admin.projectManagement { * * @param newDisplayName The new display name to set. * - * @return A promise that resolves when the display name has - * been set. + * @return A promise that resolves when the display name has been set. */ setDisplayName(newDisplayName: string): Promise; /** - * Gets the list of SHA certificates associated with this Android app in - * Firebase. + * Gets the list of SHA certificates associated with this Android app in Firebase. * * @return The list of SHA-1 and SHA-256 certificates associated with this Android app in * Firebase. @@ -4971,12 +4969,12 @@ declare namespace admin.projectManagement { resourceName: string; /** - * The optional user-assigned display name of the app. + * The globally unique, Firebase-assigned identifier of the app. * * @example * ```javascript - * var displayName = iOSAppMetadata.displayName; - * ``` + * var appId = androidAppMetadata.appId; + * `` */ appId: string;