firebase-functions 3.21.0 → 3.21.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/lib/bin/firebase-functions.js +21 -0
  2. package/lib/cloud-functions.d.ts +53 -40
  3. package/lib/common/encoding.js +21 -1
  4. package/lib/common/providers/https.d.ts +37 -17
  5. package/lib/common/providers/https.js +3 -0
  6. package/lib/common/providers/identity.d.ts +5 -1
  7. package/lib/common/providers/tasks.d.ts +9 -0
  8. package/lib/function-builder.d.ts +1 -1
  9. package/lib/logger/common.js +21 -0
  10. package/lib/logger/compat.js +21 -0
  11. package/lib/logger/index.d.ts +14 -6
  12. package/lib/logger/index.js +33 -6
  13. package/lib/providers/auth.d.ts +26 -5
  14. package/lib/providers/auth.js +18 -4
  15. package/lib/providers/pubsub.d.ts +6 -6
  16. package/lib/providers/pubsub.js +6 -6
  17. package/lib/providers/tasks.d.ts +29 -14
  18. package/lib/providers/tasks.js +10 -3
  19. package/lib/v2/core.d.ts +23 -1
  20. package/lib/v2/index.d.ts +9 -3
  21. package/lib/v2/index.js +8 -3
  22. package/lib/v2/options.d.ts +13 -34
  23. package/lib/v2/options.js +6 -58
  24. package/lib/v2/params/index.d.ts +4 -1
  25. package/lib/v2/params/index.js +25 -1
  26. package/lib/v2/params/types.js +21 -0
  27. package/lib/v2/providers/alerts/alerts.d.ts +94 -3
  28. package/lib/v2/providers/alerts/alerts.js +23 -7
  29. package/lib/v2/providers/alerts/appDistribution.d.ts +101 -1
  30. package/lib/v2/providers/alerts/appDistribution.js +28 -1
  31. package/lib/v2/providers/alerts/billing.d.ts +23 -2
  32. package/lib/v2/providers/alerts/billing.js +37 -0
  33. package/lib/v2/providers/alerts/crashlytics.d.ts +193 -18
  34. package/lib/v2/providers/alerts/crashlytics.js +62 -1
  35. package/lib/v2/providers/alerts/index.d.ts +6 -0
  36. package/lib/v2/providers/alerts/index.js +27 -0
  37. package/lib/v2/providers/eventarc.d.ts +89 -5
  38. package/lib/v2/providers/eventarc.js +4 -0
  39. package/lib/v2/providers/https.d.ts +123 -2
  40. package/lib/v2/providers/https.js +13 -3
  41. package/lib/v2/providers/identity.d.ts +108 -4
  42. package/lib/v2/providers/identity.js +33 -2
  43. package/lib/v2/providers/pubsub.d.ts +122 -5
  44. package/lib/v2/providers/pubsub.js +58 -2
  45. package/lib/v2/providers/storage.d.ts +192 -4
  46. package/lib/v2/providers/storage.js +52 -9
  47. package/lib/v2/providers/tasks.d.ts +106 -6
  48. package/lib/v2/providers/tasks.js +4 -0
  49. package/package.json +6 -4
@@ -1,14 +1,30 @@
1
1
  "use strict";
2
+ // The MIT License (MIT)
3
+ //
4
+ // Copyright (c) 2022 Firebase
5
+ //
6
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ // of this software and associated documentation files (the "Software"), to deal
8
+ // in the Software without restriction, including without limitation the rights
9
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ // copies of the Software, and to permit persons to whom the Software is
11
+ // furnished to do so, subject to the following conditions:
12
+ //
13
+ // The above copyright notice and this permission notice shall be included in all
14
+ // copies or substantial portions of the Software.
15
+ //
16
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ // SOFTWARE.
2
23
  Object.defineProperty(exports, "__esModule", { value: true });
3
24
  exports.getOptsAndAlertTypeAndApp = exports.getEndpointAnnotation = exports.onAlertPublished = exports.eventType = void 0;
4
25
  const options = require("../../options");
5
26
  /** @internal */
6
27
  exports.eventType = 'google.firebase.firebasealerts.alerts.v1.published';
7
- /**
8
- * Declares a function that can handle Firebase Alerts from CloudEvents.
9
- * @param alertTypeOrOpts the alert type or Firebase Alert function configuration.
10
- * @param handler a function that can handle the Firebase Alert inside a CloudEvent.
11
- */
12
28
  function onAlertPublished(alertTypeOrOpts, handler) {
13
29
  const [opts, alertType, appId] = getOptsAndAlertTypeAndApp(alertTypeOrOpts);
14
30
  const func = (raw) => {
@@ -20,8 +36,8 @@ function onAlertPublished(alertTypeOrOpts, handler) {
20
36
  }
21
37
  exports.onAlertPublished = onAlertPublished;
22
38
  /**
23
- * @internal
24
39
  * Helper function for getting the endpoint annotation used in alert handling functions.
40
+ * @internal
25
41
  */
26
42
  function getEndpointAnnotation(opts, alertType, appId) {
27
43
  const baseOpts = options.optionsToEndpoint(options.getGlobalOptions());
@@ -49,8 +65,8 @@ function getEndpointAnnotation(opts, alertType, appId) {
49
65
  }
50
66
  exports.getEndpointAnnotation = getEndpointAnnotation;
51
67
  /**
52
- * @internal
53
68
  * Helper function to parse the function opts, alert type, and appId.
69
+ * @internal
54
70
  */
55
71
  function getOptsAndAlertTypeAndApp(alertTypeOrOpts) {
56
72
  let opts;
@@ -1,19 +1,28 @@
1
+ /**
2
+ * Cloud functions to handle Firebase App Distribution events from Firebase Alerts.
3
+ * @packageDocumentation
4
+ */
1
5
  import { CloudEvent, CloudFunction } from '../../core';
2
6
  import * as options from '../../options';
3
7
  import { FirebaseAlertData } from './alerts';
4
8
  /**
5
9
  * The internal payload object for adding a new tester device to app distribution.
6
- * Payload is wrapped inside a FirebaseAlertData object.
10
+ * Payload is wrapped inside a `FirebaseAlertData` object.
7
11
  */
8
12
  export interface NewTesterDevicePayload {
9
13
  ['@type']: 'type.googleapis.com/google.events.firebase.firebasealerts.v1.AppDistroNewTesterIosDevicePayload';
14
+ /** Name of the tester */
10
15
  testerName: string;
16
+ /** Email of the tester */
11
17
  testerEmail: string;
18
+ /** The device model name */
12
19
  testerDeviceModelName: string;
20
+ /** The device ID */
13
21
  testerDeviceIdentifier: string;
14
22
  }
15
23
  /**
16
24
  * A custom CloudEvent for Firebase Alerts (with custom extension attributes).
25
+ * @typeParam T - the data type for app distribution alerts that is wrapped in a `FirebaseAlertData` object.
17
26
  */
18
27
  export interface AppDistributionEvent<T> extends CloudEvent<FirebaseAlertData<T>> {
19
28
  /** The type of the alerts that got triggered. */
@@ -25,11 +34,102 @@ export interface AppDistributionEvent<T> extends CloudEvent<FirebaseAlertData<T>
25
34
  * Configuration for app distribution functions.
26
35
  */
27
36
  export interface AppDistributionOptions extends options.EventHandlerOptions {
37
+ /** Scope the function to trigger on a specific application. */
28
38
  appId?: string;
39
+ /**
40
+ * Region where functions should be deployed.
41
+ */
42
+ region?: options.SupportedRegion | string;
43
+ /**
44
+ * Amount of memory to allocate to a function.
45
+ * A value of null restores the defaults of 256MB.
46
+ */
47
+ memory?: options.MemoryOption | null;
48
+ /**
49
+ * Timeout for the function in sections, possible values are 0 to 540.
50
+ * HTTPS functions can specify a higher timeout.
51
+ * A value of null restores the default of 60s
52
+ * The minimum timeout for a gen 2 function is 1s. The maximum timeout for a
53
+ * function depends on the type of function: Event handling functions have a
54
+ * maximum timeout of 540s (9 minutes). HTTPS and callable functions have a
55
+ * maximum timeout of 36,00s (1 hour). Task queue functions have a maximum
56
+ * timeout of 1,800s (30 minutes)
57
+ */
58
+ timeoutSeconds?: number | null;
59
+ /**
60
+ * Min number of actual instances to be running at a given time.
61
+ * Instances will be billed for memory allocation and 10% of CPU allocation
62
+ * while idle.
63
+ * A value of null restores the default min instances.
64
+ */
65
+ minInstances?: number | null;
66
+ /**
67
+ * Max number of instances to be running in parallel.
68
+ * A value of null restores the default max instances.
69
+ */
70
+ maxInstances?: number | null;
71
+ /**
72
+ * Number of requests a function can serve at once.
73
+ * Can only be applied to functions running on Cloud Functions v2.
74
+ * A value of null restores the default concurrency (80 when CPU >= 1, 1 otherwise).
75
+ * Concurrency cannot be set to any value other than 1 if `cpu` is less than 1.
76
+ * The maximum value for concurrency is 1,000.
77
+ */
78
+ concurrency?: number | null;
79
+ /**
80
+ * Fractional number of CPUs to allocate to a function.
81
+ * Defaults to 1 for functions with <= 2GB RAM and increases for larger memory sizes.
82
+ * This is different from the defaults when using the gcloud utility and is different from
83
+ * the fixed amount assigned in Google Cloud Functions generation 1.
84
+ * To revert to the CPU amounts used in gcloud or in Cloud Functions generation 1, set this
85
+ * to the value "gcf_gen1"
86
+ */
87
+ cpu?: number | 'gcf_gen1';
88
+ /**
89
+ * Connect cloud function to specified VPC connector.
90
+ * A value of null removes the VPC connector
91
+ */
92
+ vpcConnector?: string | null;
93
+ /**
94
+ * Egress settings for VPC connector.
95
+ * A value of null turns off VPC connector egress settings
96
+ */
97
+ vpcConnectorEgressSettings?: options.VpcEgressSetting | null;
98
+ /**
99
+ * Specific service account for the function to run as.
100
+ * A value of null restores the default service account.
101
+ */
102
+ serviceAccount?: string | null;
103
+ /**
104
+ * Ingress settings which control where this function can be called from.
105
+ * A value of null turns off ingress settings.
106
+ */
107
+ ingressSettings?: options.IngressSetting | null;
108
+ /**
109
+ * User labels to set on the function.
110
+ */
111
+ labels?: Record<string, string>;
112
+ secrets?: string[];
113
+ /** Whether failed executions should be delivered again. */
114
+ retry?: boolean;
29
115
  }
30
116
  /**
31
117
  * Declares a function that can handle adding a new tester iOS device.
118
+ * @param handler - Event handler which is run every time a new tester iOS device is added.
119
+ * @returns A function that you can export and deploy.
32
120
  */
33
121
  export declare function onNewTesterIosDevicePublished(handler: (event: AppDistributionEvent<NewTesterDevicePayload>) => any | Promise<any>): CloudFunction<AppDistributionEvent<NewTesterDevicePayload>>;
122
+ /**
123
+ * Declares a function that can handle adding a new tester iOS device.
124
+ * @param appId - A specific application the handler will trigger on.
125
+ * @param handler - Event handler which is run every time a new tester iOS device is added.
126
+ * @returns A function that you can export and deploy.
127
+ */
34
128
  export declare function onNewTesterIosDevicePublished(appId: string, handler: (event: AppDistributionEvent<NewTesterDevicePayload>) => any | Promise<any>): CloudFunction<AppDistributionEvent<NewTesterDevicePayload>>;
129
+ /**
130
+ * Declares a function that can handle adding a new tester iOS device.
131
+ * @param opts - Options that can be set on the function.
132
+ * @param handler - Event handler which is run every time a new tester iOS device is added.
133
+ * @returns A function that you can export and deploy.
134
+ */
35
135
  export declare function onNewTesterIosDevicePublished(opts: AppDistributionOptions, handler: (event: AppDistributionEvent<NewTesterDevicePayload>) => any | Promise<any>): CloudFunction<AppDistributionEvent<NewTesterDevicePayload>>;
@@ -1,9 +1,36 @@
1
1
  "use strict";
2
+ // The MIT License (MIT)
3
+ //
4
+ // Copyright (c) 2022 Firebase
5
+ //
6
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ // of this software and associated documentation files (the "Software"), to deal
8
+ // in the Software without restriction, including without limitation the rights
9
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ // copies of the Software, and to permit persons to whom the Software is
11
+ // furnished to do so, subject to the following conditions:
12
+ //
13
+ // The above copyright notice and this permission notice shall be included in all
14
+ // copies or substantial portions of the Software.
15
+ //
16
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ // SOFTWARE.
2
23
  Object.defineProperty(exports, "__esModule", { value: true });
3
24
  exports.getOptsAndApp = exports.onNewTesterIosDevicePublished = exports.newTesterIosDeviceAlert = void 0;
4
25
  const alerts_1 = require("./alerts");
5
26
  /** @internal */
6
27
  exports.newTesterIosDeviceAlert = 'appDistribution.newTesterIosDevice';
28
+ /**
29
+ * Declares a function that can handle adding a new tester iOS device.
30
+ * @param appIdOrOptsOrHandler - A specific application, options, or an event-handling function.
31
+ * @param handler - Event handler which is run every time a new tester iOS device is added.
32
+ * @returns A function that you can export and deploy.
33
+ */
7
34
  function onNewTesterIosDevicePublished(appIdOrOptsOrHandler, handler) {
8
35
  if (typeof appIdOrOptsOrHandler === 'function') {
9
36
  handler = appIdOrOptsOrHandler;
@@ -19,8 +46,8 @@ function onNewTesterIosDevicePublished(appIdOrOptsOrHandler, handler) {
19
46
  }
20
47
  exports.onNewTesterIosDevicePublished = onNewTesterIosDevicePublished;
21
48
  /**
22
- * @internal
23
49
  * Helper function to parse the function opts and appId.
50
+ * @internal
24
51
  */
25
52
  function getOptsAndApp(appIdOrOpts) {
26
53
  let opts;
@@ -1,9 +1,13 @@
1
+ /**
2
+ * Cloud functions to handle billing events from Firebase Alerts.
3
+ * @packageDocumentation
4
+ */
1
5
  import { FirebaseAlertData } from '.';
2
6
  import { CloudEvent, CloudFunction } from '../../core';
3
7
  import * as options from '../../options';
4
8
  /**
5
9
  * The internal payload object for billing plan updates.
6
- * Payload is wrapped inside a FirebaseAlertData object.
10
+ * Payload is wrapped inside a `FirebaseAlertData` object.
7
11
  */
8
12
  export interface PlanUpdatePayload {
9
13
  ['@type']: 'type.googleapis.com/google.events.firebase.firebasealerts.v1.BillingPlanUpdatePayload';
@@ -16,7 +20,7 @@ export interface PlanUpdatePayload {
16
20
  }
17
21
  /**
18
22
  * The internal payload object for billing plan automated updates.
19
- * Payload is wrapped inside a FirebaseAlertData object.
23
+ * Payload is wrapped inside a `FirebaseAlertData` object.
20
24
  */
21
25
  export interface PlanAutomatedUpdatePayload {
22
26
  ['@type']: 'type.googleapis.com/google.events.firebase.firebasealerts.v1.BillingPlanAutomatedUpdatePayload';
@@ -27,6 +31,7 @@ export interface PlanAutomatedUpdatePayload {
27
31
  }
28
32
  /**
29
33
  * A custom CloudEvent for billing Firebase Alerts (with custom extension attributes).
34
+ * @typeParam T - the data type for billing alerts that is wrapped in a `FirebaseAlertData` object.
30
35
  */
31
36
  export interface BillingEvent<T> extends CloudEvent<FirebaseAlertData<T>> {
32
37
  /** The type of the alerts that got triggered. */
@@ -34,11 +39,27 @@ export interface BillingEvent<T> extends CloudEvent<FirebaseAlertData<T>> {
34
39
  }
35
40
  /**
36
41
  * Declares a function that can handle a billing plan update event.
42
+ * @param handler - Event handler which is run every time a billing plan is updated.
43
+ * @returns A function that you can export and deploy.
37
44
  */
38
45
  export declare function onPlanUpdatePublished(handler: (event: BillingEvent<PlanUpdatePayload>) => any | Promise<any>): CloudFunction<BillingEvent<PlanUpdatePayload>>;
46
+ /**
47
+ * Declares a function that can handle a billing plan update event.
48
+ * @param opts - Options that can be set on the function.
49
+ * @param handler - Event handler which is run every time a billing plan is updated.
50
+ * @returns A function that you can export and deploy.
51
+ */
39
52
  export declare function onPlanUpdatePublished(opts: options.EventHandlerOptions, handler: (event: BillingEvent<PlanUpdatePayload>) => any | Promise<any>): CloudFunction<BillingEvent<PlanUpdatePayload>>;
40
53
  /**
41
54
  * Declares a function that can handle an automated billing plan update event.
55
+ * @param handler - Event handler which is run every time an automated billing plan update occurs.
56
+ * @returns A function that you can export and deploy.
42
57
  */
43
58
  export declare function onPlanAutomatedUpdatePublished(handler: (event: BillingEvent<PlanAutomatedUpdatePayload>) => any | Promise<any>): CloudFunction<BillingEvent<PlanAutomatedUpdatePayload>>;
59
+ /**
60
+ * Declares a function that can handle an automated billing plan update event.
61
+ * @param opts - Options that can be set on the function.
62
+ * @param handler - Event handler which is run every time an automated billing plan update occurs.
63
+ * @returns A function that you can export and deploy.
64
+ */
44
65
  export declare function onPlanAutomatedUpdatePublished(opts: options.EventHandlerOptions, handler: (event: BillingEvent<PlanAutomatedUpdatePayload>) => any | Promise<any>): CloudFunction<BillingEvent<PlanAutomatedUpdatePayload>>;
@@ -1,15 +1,52 @@
1
1
  "use strict";
2
+ // The MIT License (MIT)
3
+ //
4
+ // Copyright (c) 2022 Firebase
5
+ //
6
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ // of this software and associated documentation files (the "Software"), to deal
8
+ // in the Software without restriction, including without limitation the rights
9
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ // copies of the Software, and to permit persons to whom the Software is
11
+ // furnished to do so, subject to the following conditions:
12
+ //
13
+ // The above copyright notice and this permission notice shall be included in all
14
+ // copies or substantial portions of the Software.
15
+ //
16
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ // SOFTWARE.
2
23
  Object.defineProperty(exports, "__esModule", { value: true });
3
24
  exports.onOperation = exports.onPlanAutomatedUpdatePublished = exports.onPlanUpdatePublished = exports.planAutomatedUpdateAlert = exports.planUpdateAlert = void 0;
25
+ /**
26
+ * Cloud functions to handle billing events from Firebase Alerts.
27
+ * @packageDocumentation
28
+ */
4
29
  const _1 = require(".");
5
30
  /** @internal */
6
31
  exports.planUpdateAlert = 'billing.planUpdate';
7
32
  /** @internal */
8
33
  exports.planAutomatedUpdateAlert = 'billing.planAutomatedUpdate';
34
+ /**
35
+ * Declares a function that can handle a billing plan update event.
36
+ * @param optsOrHandler - Options or an event-handling function.
37
+ * @param handler - Event handler which is run every time a billing plan is updated.
38
+ * @returns A function that you can export and deploy.
39
+ */
9
40
  function onPlanUpdatePublished(optsOrHandler, handler) {
10
41
  return onOperation(exports.planUpdateAlert, optsOrHandler, handler);
11
42
  }
12
43
  exports.onPlanUpdatePublished = onPlanUpdatePublished;
44
+ /**
45
+ * Declares a function that can handle an automated billing plan update event.
46
+ * @param optsOrHandler - Options or an event-handling function.
47
+ * @param handler - Event handler which is run every time an automated billing plan update occurs.
48
+ * @returns A function that you can export and deploy.
49
+ */
13
50
  function onPlanAutomatedUpdatePublished(optsOrHandler, handler) {
14
51
  return onOperation(exports.planAutomatedUpdateAlert, optsOrHandler, handler);
15
52
  }
@@ -1,16 +1,24 @@
1
+ /**
2
+ * Cloud functions to handle Crashlytics events from Firebase Alerts.
3
+ * @packageDocumentation
4
+ */
1
5
  import { FirebaseAlertData } from '.';
2
6
  import { CloudEvent, CloudFunction } from '../../core';
3
7
  import * as options from '../../options';
4
- /** Generic crashlytics issue interface */
5
- interface Issue {
8
+ /** Generic Crashlytics issue interface */
9
+ export interface Issue {
10
+ /** The ID of the Crashlytics issue */
6
11
  id: string;
12
+ /** The title of the Crashlytics issue */
7
13
  title: string;
14
+ /** The subtitle of the Crashlytics issue */
8
15
  subtitle: string;
16
+ /** The application version of the Crashlytics issue */
9
17
  appVersion: string;
10
18
  }
11
19
  /**
12
20
  * The internal payload object for a new fatal issue.
13
- * Payload is wrapped inside a FirebaseAlertData object.
21
+ * Payload is wrapped inside a `FirebaseAlertData` object.
14
22
  */
15
23
  export interface NewFatalIssuePayload {
16
24
  ['@type']: 'type.googleapis.com/google.events.firebase.firebasealerts.v1.CrashlyticsNewFatalIssuePayload';
@@ -19,7 +27,7 @@ export interface NewFatalIssuePayload {
19
27
  }
20
28
  /**
21
29
  * The internal payload object for a new non-fatal issue.
22
- * Payload is wrapped inside a FirebaseAlertData object.
30
+ * Payload is wrapped inside a `FirebaseAlertData` object.
23
31
  */
24
32
  export interface NewNonfatalIssuePayload {
25
33
  ['@type']: 'type.googleapis.com/google.events.firebase.firebasealerts.v1.CrashlyticsNewNonfatalIssuePayload';
@@ -28,7 +36,7 @@ export interface NewNonfatalIssuePayload {
28
36
  }
29
37
  /**
30
38
  * The internal payload object for a regression alert.
31
- * Payload is wrapped inside a FirebaseAlertData object.
39
+ * Payload is wrapped inside a `FirebaseAlertData` object.
32
40
  */
33
41
  export interface RegressionAlertPayload {
34
42
  ['@type']: 'type.googleapis.com/google.events.firebase.firebasealerts.v1.CrashlyticsRegressionAlertPayload';
@@ -42,8 +50,8 @@ export interface RegressionAlertPayload {
42
50
  */
43
51
  resolveTime: string;
44
52
  }
45
- /** Generic crashlytics trending issue interface */
46
- interface TrendingIssueDetails {
53
+ /** Generic Crashlytics trending issue interface */
54
+ export interface TrendingIssueDetails {
47
55
  /** The type of the Crashlytics issue, e.g. new fatal, new nonfatal, ANR */
48
56
  type: string;
49
57
  /** Basic information of the Crashlytics issue */
@@ -55,7 +63,7 @@ interface TrendingIssueDetails {
55
63
  }
56
64
  /**
57
65
  * The internal payload object for a stability digest.
58
- * Payload is wrapped inside a FirebaseAlertData object.
66
+ * Payload is wrapped inside a `FirebaseAlertData` object.
59
67
  */
60
68
  export interface StabilityDigestPayload {
61
69
  ['@type']: 'type.googleapis.com/google.events.firebase.firebasealerts.v1.CrashlyticsStabilityDigestPayload';
@@ -69,7 +77,7 @@ export interface StabilityDigestPayload {
69
77
  }
70
78
  /**
71
79
  * The internal payload object for a velocity alert.
72
- * Payload is wrapped inside a FirebaseAlertData object.
80
+ * Payload is wrapped inside a `FirebaseAlertData` object.
73
81
  */
74
82
  export interface VelocityAlertPayload {
75
83
  ['@type']: 'type.googleapis.com/google.events.firebase.firebasealerts.v1.CrashlyticsVelocityAlertPayload';
@@ -95,7 +103,7 @@ export interface VelocityAlertPayload {
95
103
  }
96
104
  /**
97
105
  * The internal payload object for a new Application Not Responding issue.
98
- * Payload is wrapped inside a FirebaseAlertData object.
106
+ * Payload is wrapped inside a `FirebaseAlertData` object.
99
107
  */
100
108
  export interface NewAnrIssuePayload {
101
109
  ['@type']: 'type.googleapis.com/google.events.firebase.firebasealerts.v1.CrashlyticsNewAnrIssuePayload';
@@ -104,6 +112,7 @@ export interface NewAnrIssuePayload {
104
112
  }
105
113
  /**
106
114
  * A custom CloudEvent for Firebase Alerts (with custom extension attributes).
115
+ * @typeParam T - the data type for Crashlytics alerts that is wrapped in a `FirebaseAlertData` object.
107
116
  */
108
117
  export interface CrashlyticsEvent<T> extends CloudEvent<FirebaseAlertData<T>> {
109
118
  /** The type of the alerts that got triggered. */
@@ -112,45 +121,211 @@ export interface CrashlyticsEvent<T> extends CloudEvent<FirebaseAlertData<T>> {
112
121
  appId: string;
113
122
  }
114
123
  /**
115
- * Configuration for crashlytics functions.
124
+ * Configuration for Crashlytics functions.
116
125
  */
117
126
  export interface CrashlyticsOptions extends options.EventHandlerOptions {
127
+ /** Scope the function to trigger on a specific application. */
118
128
  appId?: string;
129
+ /**
130
+ * Region where functions should be deployed.
131
+ */
132
+ region?: options.SupportedRegion | string;
133
+ /**
134
+ * Amount of memory to allocate to a function.
135
+ * A value of null restores the defaults of 256MB.
136
+ */
137
+ memory?: options.MemoryOption | null;
138
+ /**
139
+ * Timeout for the function in sections, possible values are 0 to 540.
140
+ * HTTPS functions can specify a higher timeout.
141
+ * A value of null restores the default of 60s
142
+ * The minimum timeout for a gen 2 function is 1s. The maximum timeout for a
143
+ * function depends on the type of function: Event handling functions have a
144
+ * maximum timeout of 540s (9 minutes). HTTPS and callable functions have a
145
+ * maximum timeout of 36,00s (1 hour). Task queue functions have a maximum
146
+ * timeout of 1,800s (30 minutes)
147
+ */
148
+ timeoutSeconds?: number | null;
149
+ /**
150
+ * Min number of actual instances to be running at a given time.
151
+ * Instances will be billed for memory allocation and 10% of CPU allocation
152
+ * while idle.
153
+ * A value of null restores the default min instances.
154
+ */
155
+ minInstances?: number | null;
156
+ /**
157
+ * Max number of instances to be running in parallel.
158
+ * A value of null restores the default max instances.
159
+ */
160
+ maxInstances?: number | null;
161
+ /**
162
+ * Number of requests a function can serve at once.
163
+ * Can only be applied to functions running on Cloud Functions v2.
164
+ * A value of null restores the default concurrency (80 when CPU >= 1, 1 otherwise).
165
+ * Concurrency cannot be set to any value other than 1 if `cpu` is less than 1.
166
+ * The maximum value for concurrency is 1,000.
167
+ */
168
+ concurrency?: number | null;
169
+ /**
170
+ * Fractional number of CPUs to allocate to a function.
171
+ * Defaults to 1 for functions with <= 2GB RAM and increases for larger memory sizes.
172
+ * This is different from the defaults when using the gcloud utility and is different from
173
+ * the fixed amount assigned in Google Cloud Functions generation 1.
174
+ * To revert to the CPU amounts used in gcloud or in Cloud Functions generation 1, set this
175
+ * to the value "gcf_gen1"
176
+ */
177
+ cpu?: number | 'gcf_gen1';
178
+ /**
179
+ * Connect cloud function to specified VPC connector.
180
+ * A value of null removes the VPC connector
181
+ */
182
+ vpcConnector?: string | null;
183
+ /**
184
+ * Egress settings for VPC connector.
185
+ * A value of null turns off VPC connector egress settings
186
+ */
187
+ vpcConnectorEgressSettings?: options.VpcEgressSetting | null;
188
+ /**
189
+ * Specific service account for the function to run as.
190
+ * A value of null restores the default service account.
191
+ */
192
+ serviceAccount?: string | null;
193
+ /**
194
+ * Ingress settings which control where this function can be called from.
195
+ * A value of null turns off ingress settings.
196
+ */
197
+ ingressSettings?: options.IngressSetting | null;
198
+ /**
199
+ * User labels to set on the function.
200
+ */
201
+ labels?: Record<string, string>;
202
+ secrets?: string[];
203
+ /** Whether failed executions should be delivered again. */
204
+ retry?: boolean;
119
205
  }
120
206
  /**
121
- * Declares a function that can handle a new fatal issue published to crashlytics.
207
+ * Declares a function that can handle a new fatal issue published to Crashlytics.
208
+ * @param handler - Event handler that is triggered when a new fatal issue is published to Crashlytics.
209
+ * @returns A function that you can export and deploy.
122
210
  */
123
211
  export declare function onNewFatalIssuePublished(handler: (event: CrashlyticsEvent<NewFatalIssuePayload>) => any | Promise<any>): CloudFunction<CrashlyticsEvent<NewFatalIssuePayload>>;
212
+ /**
213
+ * Declares a function that can handle a new fatal issue published to Crashlytics.
214
+ * @param appId - A specific application the handler will trigger on.
215
+ * @param handler - Event handler that is triggered when a new fatal issue is published to Crashlytics.
216
+ * @returns A function that you can export and deploy.
217
+ */
124
218
  export declare function onNewFatalIssuePublished(appId: string, handler: (event: CrashlyticsEvent<NewFatalIssuePayload>) => any | Promise<any>): CloudFunction<CrashlyticsEvent<NewFatalIssuePayload>>;
219
+ /**
220
+ * Declares a function that can handle a new fatal issue published to Crashlytics.
221
+ * @param opts - Options that can be set on the function.
222
+ * @param handler - Event handler that is triggered when a new fatal issue is published to Crashlytics.
223
+ * @returns A function that you can export and deploy.
224
+ */
125
225
  export declare function onNewFatalIssuePublished(opts: CrashlyticsOptions, handler: (event: CrashlyticsEvent<NewFatalIssuePayload>) => any | Promise<any>): CloudFunction<CrashlyticsEvent<NewFatalIssuePayload>>;
126
226
  /**
127
- * Declares a function that can handle aa new non-fatal issue published to crashlytics.
227
+ * Declares a function that can handle a new non-fatal issue published to Crashlytics.
228
+ * @param handler - Event handler that is triggered when a new fatal issue is published to Crashlytics.
229
+ * @returns A function that you can export and deploy.
128
230
  */
129
231
  export declare function onNewNonfatalIssuePublished(handler: (event: CrashlyticsEvent<NewNonfatalIssuePayload>) => any | Promise<any>): CloudFunction<CrashlyticsEvent<NewNonfatalIssuePayload>>;
232
+ /**
233
+ * Declares a function that can handle a new non-fatal issue published to Crashlytics.
234
+ * @param appId - A specific application the handler will trigger on.
235
+ * @param handler - Event handler that is triggered when a new non-fatal issue is published to Crashlytics.
236
+ * @returns A function that you can export and deploy.
237
+ */
130
238
  export declare function onNewNonfatalIssuePublished(appId: string, handler: (event: CrashlyticsEvent<NewNonfatalIssuePayload>) => any | Promise<any>): CloudFunction<CrashlyticsEvent<NewNonfatalIssuePayload>>;
239
+ /**
240
+ * Declares a function that can handle a new non-fatal issue published to Crashlytics.
241
+ * @param opts - Options that can be set on the function.
242
+ * @param handler - Event handler that is triggered when a new non-fatal issue is published to Crashlytics.
243
+ * @returns A function that you can export and deploy.
244
+ */
131
245
  export declare function onNewNonfatalIssuePublished(opts: CrashlyticsOptions, handler: (event: CrashlyticsEvent<NewNonfatalIssuePayload>) => any | Promise<any>): CloudFunction<CrashlyticsEvent<NewNonfatalIssuePayload>>;
132
246
  /**
133
- * Declares a function that can handle a regression alert published to crashlytics.
247
+ * Declares a function that can handle a regression alert published to Crashlytics.
248
+ * @param handler - Event handler that is triggered when a regression alert is published to Crashlytics.
249
+ * @returns A function that you can export and deploy.
134
250
  */
135
251
  export declare function onRegressionAlertPublished(handler: (event: CrashlyticsEvent<RegressionAlertPayload>) => any | Promise<any>): CloudFunction<CrashlyticsEvent<RegressionAlertPayload>>;
252
+ /**
253
+ * Declares a function that can handle a regression alert published to Crashlytics.
254
+ * @param appId - A specific application the handler will trigger on.
255
+ * @param handler - Event handler that is triggered when a regression alert is published to Crashlytics.
256
+ * @returns A function that you can export and deploy.
257
+
258
+ */
136
259
  export declare function onRegressionAlertPublished(appId: string, handler: (event: CrashlyticsEvent<RegressionAlertPayload>) => any | Promise<any>): CloudFunction<CrashlyticsEvent<RegressionAlertPayload>>;
260
+ /**
261
+ * Declares a function that can handle a regression alert published to Crashlytics.
262
+ * @param opts - Options that can be set on the function.
263
+ * @param handler - Event handler that is triggered when a regression alert is published to Crashlytics.
264
+ * @returns A function that you can export and deploy.
265
+
266
+ */
137
267
  export declare function onRegressionAlertPublished(opts: CrashlyticsOptions, handler: (event: CrashlyticsEvent<RegressionAlertPayload>) => any | Promise<any>): CloudFunction<CrashlyticsEvent<RegressionAlertPayload>>;
138
268
  /**
139
- * Declares a function that can handle a stability digest published to crashlytics.
269
+ * Declares a function that can handle a stability digest published to Crashlytics.
270
+ * @param handler - Event handler that is triggered when a stability digest is published to Crashlytics.
271
+ * @returns A function that you can export and deploy.
140
272
  */
141
273
  export declare function onStabilityDigestPublished(handler: (event: CrashlyticsEvent<StabilityDigestPayload>) => any | Promise<any>): CloudFunction<CrashlyticsEvent<StabilityDigestPayload>>;
274
+ /**
275
+ * Declares a function that can handle a stability digest published to Crashlytics.
276
+ * @param appId - A specific application the handler will trigger on.
277
+ * @param handler - Event handler that is triggered when a stability digest is published to Crashlytics.
278
+ * @returns A function that you can export and deploy.
279
+
280
+ */
142
281
  export declare function onStabilityDigestPublished(appId: string, handler: (event: CrashlyticsEvent<StabilityDigestPayload>) => any | Promise<any>): CloudFunction<CrashlyticsEvent<StabilityDigestPayload>>;
282
+ /**
283
+ * Declares a function that can handle a stability digest published to Crashlytics.
284
+ * @param opts - Options that can be set on the function.
285
+ * @param handler - Event handler that is triggered when a stability digest is published to Crashlytics.
286
+ * @returns A function that you can export and deploy.
287
+
288
+ */
143
289
  export declare function onStabilityDigestPublished(opts: CrashlyticsOptions, handler: (event: CrashlyticsEvent<StabilityDigestPayload>) => any | Promise<any>): CloudFunction<CrashlyticsEvent<StabilityDigestPayload>>;
144
290
  /**
145
- * Declares a function that can handle a velocity alert published to crashlytics.
291
+ * Declares a function that can handle a velocity alert published to Crashlytics.
292
+ * @param handler - Event handler that is triggered when a velocity alert is published to Crashlytics.
293
+ * @returns A function that you can export and deploy.
146
294
  */
147
295
  export declare function onVelocityAlertPublished(handler: (event: CrashlyticsEvent<VelocityAlertPayload>) => any | Promise<any>): CloudFunction<CrashlyticsEvent<VelocityAlertPayload>>;
296
+ /**
297
+ * Declares a function that can handle a velocity alert published to Crashlytics.
298
+ * @param appId - A specific application the handler will trigger on.
299
+ * @param handler - Event handler that is triggered when a velocity alert is published to Crashlytics.
300
+ * @returns A function that you can export and deploy.
301
+ */
148
302
  export declare function onVelocityAlertPublished(appId: string, handler: (event: CrashlyticsEvent<VelocityAlertPayload>) => any | Promise<any>): CloudFunction<CrashlyticsEvent<VelocityAlertPayload>>;
303
+ /**
304
+ * Declares a function that can handle a velocity alert published to Crashlytics.
305
+ * @param opts - Options that can be set on the function.
306
+ * @param handler - Event handler that is triggered when a velocity alert is published to Crashlytics.
307
+ * @returns A function that you can export and deploy.
308
+ */
149
309
  export declare function onVelocityAlertPublished(opts: CrashlyticsOptions, handler: (event: CrashlyticsEvent<VelocityAlertPayload>) => any | Promise<any>): CloudFunction<CrashlyticsEvent<VelocityAlertPayload>>;
150
310
  /**
151
- * Declares a function that can handle a new Application Not Responding issue published to crashlytics.
311
+ * Declares a function that can handle a new Application Not Responding issue published to Crashlytics.
312
+ * @param handler - Event handler that is triggered when a new Application Not Responding issue is published to Crashlytics.
313
+ * @returns A function that you can export and deploy.
152
314
  */
153
315
  export declare function onNewAnrIssuePublished(handler: (event: CrashlyticsEvent<NewAnrIssuePayload>) => any | Promise<any>): CloudFunction<CrashlyticsEvent<NewAnrIssuePayload>>;
316
+ /**
317
+ * Declares a function that can handle a new Application Not Responding issue published to Crashlytics.
318
+ * @param appId - A specific application the handler will trigger on.
319
+ * @param handler - Event handler that is triggered when a new Application Not Responding issue is published to Crashlytics.
320
+ * @returns A function that you can export and deploy.
321
+
322
+ */
154
323
  export declare function onNewAnrIssuePublished(appId: string, handler: (event: CrashlyticsEvent<NewAnrIssuePayload>) => any | Promise<any>): CloudFunction<CrashlyticsEvent<NewAnrIssuePayload>>;
324
+ /**
325
+ * Declares a function that can handle a new Application Not Responding issue published to Crashlytics.
326
+ * @param opts - Options that can be set on the function.
327
+ * @param handler - Event handler that is triggered when a new Application Not Responding issue is published to Crashlytics.
328
+ * @returns A function that you can export and deploy.
329
+
330
+ */
155
331
  export declare function onNewAnrIssuePublished(opts: CrashlyticsOptions, handler: (event: CrashlyticsEvent<NewAnrIssuePayload>) => any | Promise<any>): CloudFunction<CrashlyticsEvent<NewAnrIssuePayload>>;
156
- export {};