From dc6a17860c5214ed58ff97c26a6bd6af50c16551 Mon Sep 17 00:00:00 2001 From: Cole Rogers Date: Tue, 10 May 2022 08:11:54 -0400 Subject: [PATCH 1/2] updating docs --- src/v2/providers/alerts/alerts.ts | 10 +- src/v2/providers/alerts/appDistribution.ts | 27 +++- src/v2/providers/alerts/billing.ts | 33 +++++ src/v2/providers/alerts/crashlytics.ts | 152 ++++++++++++++++++++- 4 files changed, 216 insertions(+), 6 deletions(-) diff --git a/src/v2/providers/alerts/alerts.ts b/src/v2/providers/alerts/alerts.ts index df800fadb..228f5cead 100644 --- a/src/v2/providers/alerts/alerts.ts +++ b/src/v2/providers/alerts/alerts.ts @@ -4,6 +4,7 @@ import * as options from '../../options'; /** * The CloudEvent data emitted by Firebase Alerts. + * @typeParam T - the payload type that is expected for this alert. */ export interface FirebaseAlertData { /** Time that the event has created. */ @@ -16,6 +17,7 @@ export interface FirebaseAlertData { /** * A custom CloudEvent for Firebase Alerts (with custom extension attributes). + * @typeParam T - the data type for this alert that is wrapped in a FirebaseAlertData object. */ export interface AlertEvent extends CloudEvent> { /** The type of the alerts that got triggered. */ @@ -50,14 +52,18 @@ export type AlertType = * Configuration for Firebase Alert functions. */ export interface FirebaseAlertOptions extends options.EventHandlerOptions { + /** Scope the handler to trigger on an alert type. */ alertType: AlertType; + /** Scope the function to trigger on a specific application. */ appId?: string; } /** * Declares a function that can handle Firebase Alerts from CloudEvents. + * @typeParam T - The type of FirebaseAlertData the function receives. * @param alertTypeOrOpts the alert type or Firebase Alert function configuration. * @param handler a function that can handle the Firebase Alert inside a CloudEvent. + * @returns A CloudFunction with the passed in type as an AlertEvent. */ export function onAlertPublished( alertTypeOrOpts: AlertType | FirebaseAlertOptions, @@ -76,8 +82,8 @@ export function onAlertPublished( } /** - * @internal * Helper function for getting the endpoint annotation used in alert handling functions. + * @internal */ export function getEndpointAnnotation( opts: options.EventHandlerOptions, @@ -109,8 +115,8 @@ export function getEndpointAnnotation( } /** - * @internal * Helper function to parse the function opts, alert type, and appId. + * @internal */ export function getOptsAndAlertTypeAndApp( alertTypeOrOpts: AlertType | FirebaseAlertOptions diff --git a/src/v2/providers/alerts/appDistribution.ts b/src/v2/providers/alerts/appDistribution.ts index e22f847c0..c57df6a6b 100644 --- a/src/v2/providers/alerts/appDistribution.ts +++ b/src/v2/providers/alerts/appDistribution.ts @@ -20,6 +20,7 @@ export interface NewTesterDevicePayload { /** * A custom CloudEvent for Firebase Alerts (with custom extension attributes). + * @typeParam T - the data type for app distribution alerts that is wrapped in a FirebaseAlertData object. */ export interface AppDistributionEvent extends CloudEvent> { @@ -36,29 +37,53 @@ export const newTesterIosDeviceAlert = 'appDistribution.newTesterIosDevice'; * Configuration for app distribution functions. */ export interface AppDistributionOptions extends options.EventHandlerOptions { + /** Scope the function to trigger on a specific application. */ appId?: string; } /** * Declares a function that can handle adding a new tester iOS device. + * @param handler - Event handler which is run every time a new tester iOS devices is added. + * @returns A Cloud Function that you can export and deploy. */ export function onNewTesterIosDevicePublished( handler: ( event: AppDistributionEvent ) => any | Promise ): CloudFunction>; + +/** + * Declares a function that can handle adding a new tester iOS device. + * @param appId - A specific application the handler will trigger on. + * @param handler - Event handler which is run every time a new tester iOS devices is added. + * @returns A Cloud Function that you can export and deploy. + */ export function onNewTesterIosDevicePublished( appId: string, handler: ( event: AppDistributionEvent ) => any | Promise ): CloudFunction>; + +/** + * Declares a function that can handle adding a new tester iOS device. + * @param opts - Options that can be set on the Cloud Function. + * @param handler - Event handler which is run every time a new tester iOS devices is added. + * @returns A Cloud Function that you can export and deploy. + */ export function onNewTesterIosDevicePublished( opts: AppDistributionOptions, handler: ( event: AppDistributionEvent ) => any | Promise ): CloudFunction>; + +/** + * Declares a function that can handle adding a new tester iOS device. + * @param appIdOrOptsOrHandler - A specific application, options, or an event-handling function. + * @param handler - Event handler which is run every time a new tester iOS devices is added. + * @returns A Cloud Function that you can export and deploy. + */ export function onNewTesterIosDevicePublished( appIdOrOptsOrHandler: | string @@ -90,8 +115,8 @@ export function onNewTesterIosDevicePublished( } /** - * @internal * Helper function to parse the function opts and appId. + * @internal */ export function getOptsAndApp( appIdOrOpts: string | AppDistributionOptions diff --git a/src/v2/providers/alerts/billing.ts b/src/v2/providers/alerts/billing.ts index 4439546a5..94490091c 100644 --- a/src/v2/providers/alerts/billing.ts +++ b/src/v2/providers/alerts/billing.ts @@ -30,6 +30,7 @@ export interface PlanAutomatedUpdatePayload { /** * A custom CloudEvent for billing Firebase Alerts (with custom extension attributes). + * @typeParam T - the data type for billing alerts that is wrapped in a FirebaseAlertData object. */ export interface BillingEvent extends CloudEvent> { /** The type of the alerts that got triggered. */ @@ -43,14 +44,30 @@ export const planAutomatedUpdateAlert = 'billing.planAutomatedUpdate'; /** * Declares a function that can handle a billing plan update event. + * @param handler - Event handler which is run every time a billing plan is updated. + * @returns A Cloud Function that you can export and deploy. */ export function onPlanUpdatePublished( handler: (event: BillingEvent) => any | Promise ): CloudFunction>; + +/** + * Declares a function that can handle a billing plan update event. + * @param opts - Options that can be set on the Cloud Function. + * @param handler - Event handler which is run every time a billing plan is updated. + * @returns A Cloud Function that you can export and deploy. + */ export function onPlanUpdatePublished( opts: options.EventHandlerOptions, handler: (event: BillingEvent) => any | Promise ): CloudFunction>; + +/** + * Declares a function that can handle a billing plan update event. + * @param optsOrHandler - Options or an event-handling function. + * @param handler - Event handler which is run every time a billing plan is updated. + * @returns A Cloud Function that you can export and deploy. + */ export function onPlanUpdatePublished( optsOrHandler: | options.EventHandlerOptions @@ -66,18 +83,34 @@ export function onPlanUpdatePublished( /** * Declares a function that can handle an automated billing plan update event. + * @param handler - Event handler which is run every time an automated billing plan update occurs. + * @returns A Cloud Function that you can export and deploy. */ export function onPlanAutomatedUpdatePublished( handler: ( event: BillingEvent ) => any | Promise ): CloudFunction>; + +/** + * Declares a function that can handle an automated billing plan update event. + * @param opts - Options that can be set on the Cloud Function. + * @param handler - Event handler which is run every time an automated billing plan update occurs. + * @returns A Cloud Function that you can export and deploy. + */ export function onPlanAutomatedUpdatePublished( opts: options.EventHandlerOptions, handler: ( event: BillingEvent ) => any | Promise ): CloudFunction>; + +/** + * Declares a function that can handle an automated billing plan update event. + * @param optsOrHandler - Options or an event-handling function. + * @param handler - Event handler which is run every time an automated billing plan update occurs. + * @returns A Cloud Function that you can export and deploy. + */ export function onPlanAutomatedUpdatePublished( optsOrHandler: | options.EventHandlerOptions diff --git a/src/v2/providers/alerts/crashlytics.ts b/src/v2/providers/alerts/crashlytics.ts index 1cbe13760..76faafaf1 100644 --- a/src/v2/providers/alerts/crashlytics.ts +++ b/src/v2/providers/alerts/crashlytics.ts @@ -117,6 +117,7 @@ export interface NewAnrIssuePayload { /** * A custom CloudEvent for Firebase Alerts (with custom extension attributes). + * @typeParam T - the data type for crashlytics alerts that is wrapped in a FirebaseAlertData object. */ export interface CrashlyticsEvent extends CloudEvent> { /** The type of the alerts that got triggered. */ @@ -142,23 +143,47 @@ export const newAnrIssueAlert = 'crashlytics.newAnrIssue'; * Configuration for crashlytics functions. */ export interface CrashlyticsOptions extends options.EventHandlerOptions { + /** Scope the function to trigger on a specific application. */ appId?: string; } /** - * Declares a function that can handle a new fatal issue published to crashlytics. + * Declares a function that can handle a new fatal issue published to Crashlytics. + * @param handler - Event handler that is triggered when a new fatal issue is published to Crashlytics. + * @returns A Cloud Function that you can export and deploy. */ export function onNewFatalIssuePublished( handler: (event: CrashlyticsEvent) => any | Promise ): CloudFunction>; + +/** + * Declares a function that can handle a new fatal issue published to Crashlytics. + * @param appId - A specific application the handler will trigger on. + * @param handler - Event handler that is triggered when a new fatal issue is published to Crashlytics. + * @returns A Cloud Function that you can export and deploy. + */ export function onNewFatalIssuePublished( appId: string, handler: (event: CrashlyticsEvent) => any | Promise ): CloudFunction>; + +/** + * Declares a function that can handle a new fatal issue published to Crashlytics. + * @param opts - Options that can be set on the Cloud Function. + * @param handler - Event handler that is triggered when a new fatal issue is published to Crashlytics. + * @returns A Cloud Function that you can export and deploy. + */ export function onNewFatalIssuePublished( opts: CrashlyticsOptions, handler: (event: CrashlyticsEvent) => any | Promise ): CloudFunction>; + +/** + * Declares a function that can handle a new fatal issue published to Crashlytics. + * @param appIdOrOptsOrHandler - A specific application, options, or an event-handling function. + * @param handler - Event handler that is triggered when a new fatal issue is published to Crashlytics. + * @returns A Cloud Function that you can export and deploy. + */ export function onNewFatalIssuePublished( appIdOrOptsOrHandler: | string @@ -176,25 +201,48 @@ export function onNewFatalIssuePublished( } /** - * Declares a function that can handle aa new non-fatal issue published to crashlytics. + * Declares a function that can handle a new non-fatal issue published to crashlytics. + * @param handler - Event handler that is triggered when a new fatal issue is published to Crashlytics. + * @returns A Cloud Function that you can export and deploy. */ export function onNewNonfatalIssuePublished( handler: ( event: CrashlyticsEvent ) => any | Promise ): CloudFunction>; + +/** + * Declares a function that can handle a new non-fatal issue published to crashlytics. + * @param appId - A specific application the handler will trigger on. + * @param handler - Event handler that is triggered when a new non-fatal issue is published to Crashlytics. + * @returns A Cloud Function that you can export and deploy. + */ export function onNewNonfatalIssuePublished( appId: string, handler: ( event: CrashlyticsEvent ) => any | Promise ): CloudFunction>; + +/** + * Declares a function that can handle a new non-fatal issue published to crashlytics. + * @param opts - Options that can be set on the Cloud Function. + * @param handler - Event handler that is triggered when a new non-fatal issue is published to Crashlytics. + * @returns A Cloud Function that you can export and deploy. + */ export function onNewNonfatalIssuePublished( opts: CrashlyticsOptions, handler: ( event: CrashlyticsEvent ) => any | Promise ): CloudFunction>; + +/** + * Declares a function that can handle a new non-fatal issue published to crashlytics. + * @param appIdOrOptsOrHandler - A specific application, options, or an event-handling function. + * @param handler - Event handler that is triggered when a new non-fatal issue is published to Crashlytics. + * @returns A Cloud Function that you can export and deploy. + */ export function onNewNonfatalIssuePublished( appIdOrOptsOrHandler: | string @@ -215,24 +263,49 @@ export function onNewNonfatalIssuePublished( /** * Declares a function that can handle a regression alert published to crashlytics. + * @param handler - Event handler that is triggered when a regression alert is published to Crashlytics. + * @returns A Cloud Function that you can export and deploy. */ export function onRegressionAlertPublished( handler: ( event: CrashlyticsEvent ) => any | Promise ): CloudFunction>; + +/** + * Declares a function that can handle a regression alert published to crashlytics. + * @param appId - A specific application the handler will trigger on. + * @param handler - Event handler that is triggered when a regression alert is published to Crashlytics. + * @returns A Cloud Function that you can export and deploy. + + */ export function onRegressionAlertPublished( appId: string, handler: ( event: CrashlyticsEvent ) => any | Promise ): CloudFunction>; + +/** + * Declares a function that can handle a regression alert published to crashlytics. + * @param opts - Options that can be set on the Cloud Function. + * @param handler - Event handler that is triggered when a regression alert is published to Crashlytics. + * @returns A Cloud Function that you can export and deploy. + + */ export function onRegressionAlertPublished( opts: CrashlyticsOptions, handler: ( event: CrashlyticsEvent ) => any | Promise ): CloudFunction>; + +/** + * Declares a function that can handle a regression alert published to crashlytics. + * @param appIdOrOptsOrHandler - A specific application, options, or an event-handling function. + * @param handler - Event handler that is triggered when a regression alert is published to Crashlytics. + * @returns A Cloud Function that you can export and deploy. + */ export function onRegressionAlertPublished( appIdOrOptsOrHandler: | string @@ -251,24 +324,49 @@ export function onRegressionAlertPublished( /** * Declares a function that can handle a stability digest published to crashlytics. + * @param handler - Event handler that is triggered when a stability digest is published to Crashlytics. + * @returns A Cloud Function that you can export and deploy. */ export function onStabilityDigestPublished( handler: ( event: CrashlyticsEvent ) => any | Promise ): CloudFunction>; + +/** + * Declares a function that can handle a stability digest published to crashlytics. + * @param appId - A specific application the handler will trigger on. + * @param handler - Event handler that is triggered when a stability digest is published to Crashlytics. + * @returns A Cloud Function that you can export and deploy. + + */ export function onStabilityDigestPublished( appId: string, handler: ( event: CrashlyticsEvent ) => any | Promise ): CloudFunction>; + +/** + * Declares a function that can handle a stability digest published to crashlytics. + * @param opts - Options that can be set on the Cloud Function. + * @param handler - Event handler that is triggered when a stability digest is published to Crashlytics. + * @returns A Cloud Function that you can export and deploy. + + */ export function onStabilityDigestPublished( opts: CrashlyticsOptions, handler: ( event: CrashlyticsEvent ) => any | Promise ): CloudFunction>; + +/** + * Declares a function that can handle a stability digest published to crashlytics. + * @param appIdOrOptsOrHandler - A specific application, options, or an event-handling function. + * @param handler - Event handler that is triggered when a stability digest is published to Crashlytics. + * @returns A Cloud Function that you can export and deploy. + */ export function onStabilityDigestPublished( appIdOrOptsOrHandler: | string @@ -287,18 +385,41 @@ export function onStabilityDigestPublished( /** * Declares a function that can handle a velocity alert published to crashlytics. + * @param handler - Event handler that is triggered when a velocity alert is published to Crashlytics. + * @returns A Cloud Function that you can export and deploy. */ export function onVelocityAlertPublished( handler: (event: CrashlyticsEvent) => any | Promise ): CloudFunction>; + +/** + * Declares a function that can handle a velocity alert published to crashlytics. + * @param appId - A specific application the handler will trigger on. + * @param handler - Event handler that is triggered when a velocity alert is published to Crashlytics. + * @returns A Cloud Function that you can export and deploy. + */ export function onVelocityAlertPublished( appId: string, handler: (event: CrashlyticsEvent) => any | Promise ): CloudFunction>; + +/** + * Declares a function that can handle a velocity alert published to crashlytics. + * @param opts - Options that can be set on the Cloud Function. + * @param handler - Event handler that is triggered when a velocity alert is published to Crashlytics. + * @returns A Cloud Function that you can export and deploy. + */ export function onVelocityAlertPublished( opts: CrashlyticsOptions, handler: (event: CrashlyticsEvent) => any | Promise ): CloudFunction>; + +/** + * Declares a function that can handle a velocity alert published to crashlytics. + * @param appIdOrOptsOrHandler - A specific application, options, or an event-handling function. + * @param handler - Event handler that is triggered when a velocity alert is published to Crashlytics. + * @returns A Cloud Function that you can export and deploy. + */ export function onVelocityAlertPublished( appIdOrOptsOrHandler: | string @@ -317,18 +438,43 @@ export function onVelocityAlertPublished( /** * Declares a function that can handle a new Application Not Responding issue published to crashlytics. + * @param handler - Event handler that is triggered when a new Application Not Responding issue is published to Crashlytics. + * @returns A Cloud Function that you can export and deploy. */ export function onNewAnrIssuePublished( handler: (event: CrashlyticsEvent) => any | Promise ): CloudFunction>; + +/** + * Declares a function that can handle a new Application Not Responding issue published to crashlytics. + * @param appId - A specific application the handler will trigger on. + * @param handler - Event handler that is triggered when a new Application Not Responding issue is published to Crashlytics. + * @returns A Cloud Function that you can export and deploy. + + */ export function onNewAnrIssuePublished( appId: string, handler: (event: CrashlyticsEvent) => any | Promise ): CloudFunction>; + +/** + * Declares a function that can handle a new Application Not Responding issue published to crashlytics. + * @param opts - Options that can be set on the Cloud Function. + * @param handler - Event handler that is triggered when a new Application Not Responding issue is published to Crashlytics. + * @returns A Cloud Function that you can export and deploy. + + */ export function onNewAnrIssuePublished( opts: CrashlyticsOptions, handler: (event: CrashlyticsEvent) => any | Promise ): CloudFunction>; + +/** + * Declares a function that can handle a new Application Not Responding issue published to crashlytics. + * @param appIdOrOptsOrHandler - A specific application, options, or an event-handling function. + * @param handler - Event handler that is triggered when a new Application Not Responding issue is published to Crashlytics. + * @returns A Cloud Function that you can export and deploy. + */ export function onNewAnrIssuePublished( appIdOrOptsOrHandler: | string @@ -374,8 +520,8 @@ export function onOperation( } /** - * @internal * Helper function to parse the function opts and appId. + * @internal */ export function getOptsAndApp( appIdOrOpts: string | CrashlyticsOptions From 4206f0c42db4336b448a5bd49e5317caf59b1775 Mon Sep 17 00:00:00 2001 From: Cole Rogers Date: Tue, 10 May 2022 15:16:48 -0400 Subject: [PATCH 2/2] fixing comments --- src/v2/providers/alerts/alerts.ts | 8 +- src/v2/providers/alerts/appDistribution.ts | 22 ++-- src/v2/providers/alerts/billing.ts | 22 ++-- src/v2/providers/alerts/crashlytics.ts | 128 ++++++++++----------- 4 files changed, 90 insertions(+), 90 deletions(-) diff --git a/src/v2/providers/alerts/alerts.ts b/src/v2/providers/alerts/alerts.ts index 228f5cead..4b260a851 100644 --- a/src/v2/providers/alerts/alerts.ts +++ b/src/v2/providers/alerts/alerts.ts @@ -17,7 +17,7 @@ export interface FirebaseAlertData { /** * A custom CloudEvent for Firebase Alerts (with custom extension attributes). - * @typeParam T - the data type for this alert that is wrapped in a FirebaseAlertData object. + * @typeParam T - the data type for this alert that is wrapped in a `FirebaseAlertData` object. */ export interface AlertEvent extends CloudEvent> { /** The type of the alerts that got triggered. */ @@ -28,7 +28,7 @@ export interface AlertEvent extends CloudEvent> { */ appId?: string; - /** Data for an AlertEvent is a FirebaseAlertData with a given payload. */ + /** Data for an `AlertEvent` is a `FirebaseAlertData` object with a given payload. */ data: FirebaseAlertData; } @@ -60,10 +60,10 @@ export interface FirebaseAlertOptions extends options.EventHandlerOptions { /** * Declares a function that can handle Firebase Alerts from CloudEvents. - * @typeParam T - The type of FirebaseAlertData the function receives. + * @typeParam T - The data type of the `FirebaseAlertData` object the function receives. * @param alertTypeOrOpts the alert type or Firebase Alert function configuration. * @param handler a function that can handle the Firebase Alert inside a CloudEvent. - * @returns A CloudFunction with the passed in type as an AlertEvent. + * @returns A function that you can export and deploy. */ export function onAlertPublished( alertTypeOrOpts: AlertType | FirebaseAlertOptions, diff --git a/src/v2/providers/alerts/appDistribution.ts b/src/v2/providers/alerts/appDistribution.ts index c57df6a6b..fc8ec18d2 100644 --- a/src/v2/providers/alerts/appDistribution.ts +++ b/src/v2/providers/alerts/appDistribution.ts @@ -4,7 +4,7 @@ import { FirebaseAlertData, getEndpointAnnotation } from './alerts'; /** * The internal payload object for adding a new tester device to app distribution. - * Payload is wrapped inside a FirebaseAlertData object. + * Payload is wrapped inside a `FirebaseAlertData` object. */ export interface NewTesterDevicePayload { ['@type']: 'type.googleapis.com/google.events.firebase.firebasealerts.v1.AppDistroNewTesterIosDevicePayload'; @@ -20,7 +20,7 @@ export interface NewTesterDevicePayload { /** * A custom CloudEvent for Firebase Alerts (with custom extension attributes). - * @typeParam T - the data type for app distribution alerts that is wrapped in a FirebaseAlertData object. + * @typeParam T - the data type for app distribution alerts that is wrapped in a `FirebaseAlertData` object. */ export interface AppDistributionEvent extends CloudEvent> { @@ -43,8 +43,8 @@ export interface AppDistributionOptions extends options.EventHandlerOptions { /** * Declares a function that can handle adding a new tester iOS device. - * @param handler - Event handler which is run every time a new tester iOS devices is added. - * @returns A Cloud Function that you can export and deploy. + * @param handler - Event handler which is run every time a new tester iOS device is added. + * @returns A function that you can export and deploy. */ export function onNewTesterIosDevicePublished( handler: ( @@ -55,8 +55,8 @@ export function onNewTesterIosDevicePublished( /** * Declares a function that can handle adding a new tester iOS device. * @param appId - A specific application the handler will trigger on. - * @param handler - Event handler which is run every time a new tester iOS devices is added. - * @returns A Cloud Function that you can export and deploy. + * @param handler - Event handler which is run every time a new tester iOS device is added. + * @returns A function that you can export and deploy. */ export function onNewTesterIosDevicePublished( appId: string, @@ -67,9 +67,9 @@ export function onNewTesterIosDevicePublished( /** * Declares a function that can handle adding a new tester iOS device. - * @param opts - Options that can be set on the Cloud Function. - * @param handler - Event handler which is run every time a new tester iOS devices is added. - * @returns A Cloud Function that you can export and deploy. + * @param opts - Options that can be set on the function. + * @param handler - Event handler which is run every time a new tester iOS device is added. + * @returns A function that you can export and deploy. */ export function onNewTesterIosDevicePublished( opts: AppDistributionOptions, @@ -81,8 +81,8 @@ export function onNewTesterIosDevicePublished( /** * Declares a function that can handle adding a new tester iOS device. * @param appIdOrOptsOrHandler - A specific application, options, or an event-handling function. - * @param handler - Event handler which is run every time a new tester iOS devices is added. - * @returns A Cloud Function that you can export and deploy. + * @param handler - Event handler which is run every time a new tester iOS device is added. + * @returns A function that you can export and deploy. */ export function onNewTesterIosDevicePublished( appIdOrOptsOrHandler: diff --git a/src/v2/providers/alerts/billing.ts b/src/v2/providers/alerts/billing.ts index 94490091c..8990481cc 100644 --- a/src/v2/providers/alerts/billing.ts +++ b/src/v2/providers/alerts/billing.ts @@ -4,7 +4,7 @@ import * as options from '../../options'; /** * The internal payload object for billing plan updates. - * Payload is wrapped inside a FirebaseAlertData object. + * Payload is wrapped inside a `FirebaseAlertData` object. */ export interface PlanUpdatePayload { ['@type']: 'type.googleapis.com/google.events.firebase.firebasealerts.v1.BillingPlanUpdatePayload'; @@ -18,7 +18,7 @@ export interface PlanUpdatePayload { /** * The internal payload object for billing plan automated updates. - * Payload is wrapped inside a FirebaseAlertData object. + * Payload is wrapped inside a `FirebaseAlertData` object. */ export interface PlanAutomatedUpdatePayload { ['@type']: 'type.googleapis.com/google.events.firebase.firebasealerts.v1.BillingPlanAutomatedUpdatePayload'; @@ -30,7 +30,7 @@ export interface PlanAutomatedUpdatePayload { /** * A custom CloudEvent for billing Firebase Alerts (with custom extension attributes). - * @typeParam T - the data type for billing alerts that is wrapped in a FirebaseAlertData object. + * @typeParam T - the data type for billing alerts that is wrapped in a `FirebaseAlertData` object. */ export interface BillingEvent extends CloudEvent> { /** The type of the alerts that got triggered. */ @@ -45,7 +45,7 @@ export const planAutomatedUpdateAlert = 'billing.planAutomatedUpdate'; /** * Declares a function that can handle a billing plan update event. * @param handler - Event handler which is run every time a billing plan is updated. - * @returns A Cloud Function that you can export and deploy. + * @returns A function that you can export and deploy. */ export function onPlanUpdatePublished( handler: (event: BillingEvent) => any | Promise @@ -53,9 +53,9 @@ export function onPlanUpdatePublished( /** * Declares a function that can handle a billing plan update event. - * @param opts - Options that can be set on the Cloud Function. + * @param opts - Options that can be set on the function. * @param handler - Event handler which is run every time a billing plan is updated. - * @returns A Cloud Function that you can export and deploy. + * @returns A function that you can export and deploy. */ export function onPlanUpdatePublished( opts: options.EventHandlerOptions, @@ -66,7 +66,7 @@ export function onPlanUpdatePublished( * Declares a function that can handle a billing plan update event. * @param optsOrHandler - Options or an event-handling function. * @param handler - Event handler which is run every time a billing plan is updated. - * @returns A Cloud Function that you can export and deploy. + * @returns A function that you can export and deploy. */ export function onPlanUpdatePublished( optsOrHandler: @@ -84,7 +84,7 @@ export function onPlanUpdatePublished( /** * Declares a function that can handle an automated billing plan update event. * @param handler - Event handler which is run every time an automated billing plan update occurs. - * @returns A Cloud Function that you can export and deploy. + * @returns A function that you can export and deploy. */ export function onPlanAutomatedUpdatePublished( handler: ( @@ -94,9 +94,9 @@ export function onPlanAutomatedUpdatePublished( /** * Declares a function that can handle an automated billing plan update event. - * @param opts - Options that can be set on the Cloud Function. + * @param opts - Options that can be set on the function. * @param handler - Event handler which is run every time an automated billing plan update occurs. - * @returns A Cloud Function that you can export and deploy. + * @returns A function that you can export and deploy. */ export function onPlanAutomatedUpdatePublished( opts: options.EventHandlerOptions, @@ -109,7 +109,7 @@ export function onPlanAutomatedUpdatePublished( * Declares a function that can handle an automated billing plan update event. * @param optsOrHandler - Options or an event-handling function. * @param handler - Event handler which is run every time an automated billing plan update occurs. - * @returns A Cloud Function that you can export and deploy. + * @returns A function that you can export and deploy. */ export function onPlanAutomatedUpdatePublished( optsOrHandler: diff --git a/src/v2/providers/alerts/crashlytics.ts b/src/v2/providers/alerts/crashlytics.ts index 76faafaf1..1efff4f28 100644 --- a/src/v2/providers/alerts/crashlytics.ts +++ b/src/v2/providers/alerts/crashlytics.ts @@ -2,21 +2,21 @@ import { FirebaseAlertData, getEndpointAnnotation } from '.'; import { CloudEvent, CloudFunction } from '../../core'; import * as options from '../../options'; -/** Generic crashlytics issue interface */ +/** Generic Crashlytics issue interface */ export interface Issue { - /** The ID of the crashlytics issue */ + /** The ID of the Crashlytics issue */ id: string; - /** The title of the crashlytics issue */ + /** The title of the Crashlytics issue */ title: string; - /** The subtitle of the crashlytics issue */ + /** The subtitle of the Crashlytics issue */ subtitle: string; - /** The application version of the crashlytics issue */ + /** The application version of the Crashlytics issue */ appVersion: string; } /** * The internal payload object for a new fatal issue. - * Payload is wrapped inside a FirebaseAlertData object. + * Payload is wrapped inside a `FirebaseAlertData` object. */ export interface NewFatalIssuePayload { ['@type']: 'type.googleapis.com/google.events.firebase.firebasealerts.v1.CrashlyticsNewFatalIssuePayload'; @@ -26,7 +26,7 @@ export interface NewFatalIssuePayload { /** * The internal payload object for a new non-fatal issue. - * Payload is wrapped inside a FirebaseAlertData object. + * Payload is wrapped inside a `FirebaseAlertData` object. */ export interface NewNonfatalIssuePayload { ['@type']: 'type.googleapis.com/google.events.firebase.firebasealerts.v1.CrashlyticsNewNonfatalIssuePayload'; @@ -36,7 +36,7 @@ export interface NewNonfatalIssuePayload { /** * The internal payload object for a regression alert. - * Payload is wrapped inside a FirebaseAlertData object. + * Payload is wrapped inside a `FirebaseAlertData` object. */ export interface RegressionAlertPayload { ['@type']: 'type.googleapis.com/google.events.firebase.firebasealerts.v1.CrashlyticsRegressionAlertPayload'; @@ -51,7 +51,7 @@ export interface RegressionAlertPayload { resolveTime: string; } -/** Generic crashlytics trending issue interface */ +/** Generic Crashlytics trending issue interface */ export interface TrendingIssueDetails { /** The type of the Crashlytics issue, e.g. new fatal, new nonfatal, ANR */ type: string; @@ -65,7 +65,7 @@ export interface TrendingIssueDetails { /** * The internal payload object for a stability digest. - * Payload is wrapped inside a FirebaseAlertData object. + * Payload is wrapped inside a `FirebaseAlertData` object. */ export interface StabilityDigestPayload { ['@type']: 'type.googleapis.com/google.events.firebase.firebasealerts.v1.CrashlyticsStabilityDigestPayload'; @@ -80,7 +80,7 @@ export interface StabilityDigestPayload { /** * The internal payload object for a velocity alert. - * Payload is wrapped inside a FirebaseAlertData object. + * Payload is wrapped inside a `FirebaseAlertData` object. */ export interface VelocityAlertPayload { ['@type']: 'type.googleapis.com/google.events.firebase.firebasealerts.v1.CrashlyticsVelocityAlertPayload'; @@ -107,7 +107,7 @@ export interface VelocityAlertPayload { /** * The internal payload object for a new Application Not Responding issue. - * Payload is wrapped inside a FirebaseAlertData object. + * Payload is wrapped inside a `FirebaseAlertData` object. */ export interface NewAnrIssuePayload { ['@type']: 'type.googleapis.com/google.events.firebase.firebasealerts.v1.CrashlyticsNewAnrIssuePayload'; @@ -117,7 +117,7 @@ export interface NewAnrIssuePayload { /** * A custom CloudEvent for Firebase Alerts (with custom extension attributes). - * @typeParam T - the data type for crashlytics alerts that is wrapped in a FirebaseAlertData object. + * @typeParam T - the data type for Crashlytics alerts that is wrapped in a `FirebaseAlertData` object. */ export interface CrashlyticsEvent extends CloudEvent> { /** The type of the alerts that got triggered. */ @@ -140,7 +140,7 @@ export const velocityAlert = 'crashlytics.velocity'; export const newAnrIssueAlert = 'crashlytics.newAnrIssue'; /** - * Configuration for crashlytics functions. + * Configuration for Crashlytics functions. */ export interface CrashlyticsOptions extends options.EventHandlerOptions { /** Scope the function to trigger on a specific application. */ @@ -150,7 +150,7 @@ export interface CrashlyticsOptions extends options.EventHandlerOptions { /** * Declares a function that can handle a new fatal issue published to Crashlytics. * @param handler - Event handler that is triggered when a new fatal issue is published to Crashlytics. - * @returns A Cloud Function that you can export and deploy. + * @returns A function that you can export and deploy. */ export function onNewFatalIssuePublished( handler: (event: CrashlyticsEvent) => any | Promise @@ -160,7 +160,7 @@ export function onNewFatalIssuePublished( * Declares a function that can handle a new fatal issue published to Crashlytics. * @param appId - A specific application the handler will trigger on. * @param handler - Event handler that is triggered when a new fatal issue is published to Crashlytics. - * @returns A Cloud Function that you can export and deploy. + * @returns A function that you can export and deploy. */ export function onNewFatalIssuePublished( appId: string, @@ -169,9 +169,9 @@ export function onNewFatalIssuePublished( /** * Declares a function that can handle a new fatal issue published to Crashlytics. - * @param opts - Options that can be set on the Cloud Function. + * @param opts - Options that can be set on the function. * @param handler - Event handler that is triggered when a new fatal issue is published to Crashlytics. - * @returns A Cloud Function that you can export and deploy. + * @returns A function that you can export and deploy. */ export function onNewFatalIssuePublished( opts: CrashlyticsOptions, @@ -182,7 +182,7 @@ export function onNewFatalIssuePublished( * Declares a function that can handle a new fatal issue published to Crashlytics. * @param appIdOrOptsOrHandler - A specific application, options, or an event-handling function. * @param handler - Event handler that is triggered when a new fatal issue is published to Crashlytics. - * @returns A Cloud Function that you can export and deploy. + * @returns A function that you can export and deploy. */ export function onNewFatalIssuePublished( appIdOrOptsOrHandler: @@ -201,9 +201,9 @@ export function onNewFatalIssuePublished( } /** - * Declares a function that can handle a new non-fatal issue published to crashlytics. + * Declares a function that can handle a new non-fatal issue published to Crashlytics. * @param handler - Event handler that is triggered when a new fatal issue is published to Crashlytics. - * @returns A Cloud Function that you can export and deploy. + * @returns A function that you can export and deploy. */ export function onNewNonfatalIssuePublished( handler: ( @@ -212,10 +212,10 @@ export function onNewNonfatalIssuePublished( ): CloudFunction>; /** - * Declares a function that can handle a new non-fatal issue published to crashlytics. + * Declares a function that can handle a new non-fatal issue published to Crashlytics. * @param appId - A specific application the handler will trigger on. * @param handler - Event handler that is triggered when a new non-fatal issue is published to Crashlytics. - * @returns A Cloud Function that you can export and deploy. + * @returns A function that you can export and deploy. */ export function onNewNonfatalIssuePublished( appId: string, @@ -225,10 +225,10 @@ export function onNewNonfatalIssuePublished( ): CloudFunction>; /** - * Declares a function that can handle a new non-fatal issue published to crashlytics. - * @param opts - Options that can be set on the Cloud Function. + * Declares a function that can handle a new non-fatal issue published to Crashlytics. + * @param opts - Options that can be set on the function. * @param handler - Event handler that is triggered when a new non-fatal issue is published to Crashlytics. - * @returns A Cloud Function that you can export and deploy. + * @returns A function that you can export and deploy. */ export function onNewNonfatalIssuePublished( opts: CrashlyticsOptions, @@ -238,10 +238,10 @@ export function onNewNonfatalIssuePublished( ): CloudFunction>; /** - * Declares a function that can handle a new non-fatal issue published to crashlytics. + * Declares a function that can handle a new non-fatal issue published to Crashlytics. * @param appIdOrOptsOrHandler - A specific application, options, or an event-handling function. * @param handler - Event handler that is triggered when a new non-fatal issue is published to Crashlytics. - * @returns A Cloud Function that you can export and deploy. + * @returns A function that you can export and deploy. */ export function onNewNonfatalIssuePublished( appIdOrOptsOrHandler: @@ -262,9 +262,9 @@ export function onNewNonfatalIssuePublished( } /** - * Declares a function that can handle a regression alert published to crashlytics. + * Declares a function that can handle a regression alert published to Crashlytics. * @param handler - Event handler that is triggered when a regression alert is published to Crashlytics. - * @returns A Cloud Function that you can export and deploy. + * @returns A function that you can export and deploy. */ export function onRegressionAlertPublished( handler: ( @@ -273,10 +273,10 @@ export function onRegressionAlertPublished( ): CloudFunction>; /** - * Declares a function that can handle a regression alert published to crashlytics. + * Declares a function that can handle a regression alert published to Crashlytics. * @param appId - A specific application the handler will trigger on. * @param handler - Event handler that is triggered when a regression alert is published to Crashlytics. - * @returns A Cloud Function that you can export and deploy. + * @returns A function that you can export and deploy. */ export function onRegressionAlertPublished( @@ -287,10 +287,10 @@ export function onRegressionAlertPublished( ): CloudFunction>; /** - * Declares a function that can handle a regression alert published to crashlytics. - * @param opts - Options that can be set on the Cloud Function. + * Declares a function that can handle a regression alert published to Crashlytics. + * @param opts - Options that can be set on the function. * @param handler - Event handler that is triggered when a regression alert is published to Crashlytics. - * @returns A Cloud Function that you can export and deploy. + * @returns A function that you can export and deploy. */ export function onRegressionAlertPublished( @@ -301,10 +301,10 @@ export function onRegressionAlertPublished( ): CloudFunction>; /** - * Declares a function that can handle a regression alert published to crashlytics. + * Declares a function that can handle a regression alert published to Crashlytics. * @param appIdOrOptsOrHandler - A specific application, options, or an event-handling function. * @param handler - Event handler that is triggered when a regression alert is published to Crashlytics. - * @returns A Cloud Function that you can export and deploy. + * @returns A function that you can export and deploy. */ export function onRegressionAlertPublished( appIdOrOptsOrHandler: @@ -323,9 +323,9 @@ export function onRegressionAlertPublished( } /** - * Declares a function that can handle a stability digest published to crashlytics. + * Declares a function that can handle a stability digest published to Crashlytics. * @param handler - Event handler that is triggered when a stability digest is published to Crashlytics. - * @returns A Cloud Function that you can export and deploy. + * @returns A function that you can export and deploy. */ export function onStabilityDigestPublished( handler: ( @@ -334,10 +334,10 @@ export function onStabilityDigestPublished( ): CloudFunction>; /** - * Declares a function that can handle a stability digest published to crashlytics. + * Declares a function that can handle a stability digest published to Crashlytics. * @param appId - A specific application the handler will trigger on. * @param handler - Event handler that is triggered when a stability digest is published to Crashlytics. - * @returns A Cloud Function that you can export and deploy. + * @returns A function that you can export and deploy. */ export function onStabilityDigestPublished( @@ -348,10 +348,10 @@ export function onStabilityDigestPublished( ): CloudFunction>; /** - * Declares a function that can handle a stability digest published to crashlytics. - * @param opts - Options that can be set on the Cloud Function. + * Declares a function that can handle a stability digest published to Crashlytics. + * @param opts - Options that can be set on the function. * @param handler - Event handler that is triggered when a stability digest is published to Crashlytics. - * @returns A Cloud Function that you can export and deploy. + * @returns A function that you can export and deploy. */ export function onStabilityDigestPublished( @@ -362,10 +362,10 @@ export function onStabilityDigestPublished( ): CloudFunction>; /** - * Declares a function that can handle a stability digest published to crashlytics. + * Declares a function that can handle a stability digest published to Crashlytics. * @param appIdOrOptsOrHandler - A specific application, options, or an event-handling function. * @param handler - Event handler that is triggered when a stability digest is published to Crashlytics. - * @returns A Cloud Function that you can export and deploy. + * @returns A function that you can export and deploy. */ export function onStabilityDigestPublished( appIdOrOptsOrHandler: @@ -384,19 +384,19 @@ export function onStabilityDigestPublished( } /** - * Declares a function that can handle a velocity alert published to crashlytics. + * Declares a function that can handle a velocity alert published to Crashlytics. * @param handler - Event handler that is triggered when a velocity alert is published to Crashlytics. - * @returns A Cloud Function that you can export and deploy. + * @returns A function that you can export and deploy. */ export function onVelocityAlertPublished( handler: (event: CrashlyticsEvent) => any | Promise ): CloudFunction>; /** - * Declares a function that can handle a velocity alert published to crashlytics. + * Declares a function that can handle a velocity alert published to Crashlytics. * @param appId - A specific application the handler will trigger on. * @param handler - Event handler that is triggered when a velocity alert is published to Crashlytics. - * @returns A Cloud Function that you can export and deploy. + * @returns A function that you can export and deploy. */ export function onVelocityAlertPublished( appId: string, @@ -404,10 +404,10 @@ export function onVelocityAlertPublished( ): CloudFunction>; /** - * Declares a function that can handle a velocity alert published to crashlytics. - * @param opts - Options that can be set on the Cloud Function. + * Declares a function that can handle a velocity alert published to Crashlytics. + * @param opts - Options that can be set on the function. * @param handler - Event handler that is triggered when a velocity alert is published to Crashlytics. - * @returns A Cloud Function that you can export and deploy. + * @returns A function that you can export and deploy. */ export function onVelocityAlertPublished( opts: CrashlyticsOptions, @@ -415,10 +415,10 @@ export function onVelocityAlertPublished( ): CloudFunction>; /** - * Declares a function that can handle a velocity alert published to crashlytics. + * Declares a function that can handle a velocity alert published to Crashlytics. * @param appIdOrOptsOrHandler - A specific application, options, or an event-handling function. * @param handler - Event handler that is triggered when a velocity alert is published to Crashlytics. - * @returns A Cloud Function that you can export and deploy. + * @returns A function that you can export and deploy. */ export function onVelocityAlertPublished( appIdOrOptsOrHandler: @@ -437,19 +437,19 @@ export function onVelocityAlertPublished( } /** - * Declares a function that can handle a new Application Not Responding issue published to crashlytics. + * Declares a function that can handle a new Application Not Responding issue published to Crashlytics. * @param handler - Event handler that is triggered when a new Application Not Responding issue is published to Crashlytics. - * @returns A Cloud Function that you can export and deploy. + * @returns A function that you can export and deploy. */ export function onNewAnrIssuePublished( handler: (event: CrashlyticsEvent) => any | Promise ): CloudFunction>; /** - * Declares a function that can handle a new Application Not Responding issue published to crashlytics. + * Declares a function that can handle a new Application Not Responding issue published to Crashlytics. * @param appId - A specific application the handler will trigger on. * @param handler - Event handler that is triggered when a new Application Not Responding issue is published to Crashlytics. - * @returns A Cloud Function that you can export and deploy. + * @returns A function that you can export and deploy. */ export function onNewAnrIssuePublished( @@ -458,10 +458,10 @@ export function onNewAnrIssuePublished( ): CloudFunction>; /** - * Declares a function that can handle a new Application Not Responding issue published to crashlytics. - * @param opts - Options that can be set on the Cloud Function. + * Declares a function that can handle a new Application Not Responding issue published to Crashlytics. + * @param opts - Options that can be set on the function. * @param handler - Event handler that is triggered when a new Application Not Responding issue is published to Crashlytics. - * @returns A Cloud Function that you can export and deploy. + * @returns A function that you can export and deploy. */ export function onNewAnrIssuePublished( @@ -470,10 +470,10 @@ export function onNewAnrIssuePublished( ): CloudFunction>; /** - * Declares a function that can handle a new Application Not Responding issue published to crashlytics. + * Declares a function that can handle a new Application Not Responding issue published to Crashlytics. * @param appIdOrOptsOrHandler - A specific application, options, or an event-handling function. * @param handler - Event handler that is triggered when a new Application Not Responding issue is published to Crashlytics. - * @returns A Cloud Function that you can export and deploy. + * @returns A function that you can export and deploy. */ export function onNewAnrIssuePublished( appIdOrOptsOrHandler: