@@ -42,7 +42,7 @@ import * as logger from "../logger";
42
42
export { RESET_VALUE } from "../common/options" ;
43
43
44
44
/**
45
- * List of all regions supported by Cloud Functions v2
45
+ * List of all regions supported by Cloud Functions (2nd gen).
46
46
*/
47
47
export type SupportedRegion =
48
48
| "asia-east1"
@@ -98,18 +98,18 @@ const MemoryOptionToMB: Record<MemoryOption, number> = {
98
98
} ;
99
99
100
100
/**
101
- * List of available options for VpcConnectorEgressSettings.
101
+ * List of available options for ` VpcConnectorEgressSettings` .
102
102
*/
103
103
export type VpcEgressSetting = "PRIVATE_RANGES_ONLY" | "ALL_TRAFFIC" ;
104
104
105
105
/**
106
- * List of available options for IngressSettings.
106
+ * List of available options for ` IngressSettings` .
107
107
*/
108
108
export type IngressSetting = "ALLOW_ALL" | "ALLOW_INTERNAL_ONLY" | "ALLOW_INTERNAL_AND_GCLB" ;
109
109
110
110
/**
111
- * GlobalOptions are options that can be set across an entire project.
112
- * These options are common to HTTPS and Event handling functions.
111
+ * ` GlobalOptions` are options that can be set across an entire project.
112
+ * These options are common to HTTPS and event handling functions.
113
113
*/
114
114
export interface GlobalOptions {
115
115
/**
@@ -132,33 +132,33 @@ export interface GlobalOptions {
132
132
* HTTPS functions can specify a higher timeout.
133
133
*
134
134
* @remarks
135
- * The minimum timeout for a gen 2 function is 1s. The maximum timeout for a
135
+ * The minimum timeout for a 2nd gen function is 1s. The maximum timeout for a
136
136
* function depends on the type of function: Event handling functions have a
137
137
* maximum timeout of 540s (9 minutes). HTTPS and callable functions have a
138
138
* maximum timeout of 36,00s (1 hour). Task queue functions have a maximum
139
- * timeout of 1,800s (30 minutes)
139
+ * timeout of 1,800s (30 minutes).
140
140
*/
141
141
timeoutSeconds ?: number | Expression < number > | ResetValue ;
142
142
143
143
/**
144
- * Min number of actual instances to be running at a given time.
144
+ * Minimum number of actual instances to be running at a given time.
145
145
*
146
146
* @remarks
147
- * Instances will be billed for memory allocation and 10% of CPU allocation
147
+ * Instances are billed for memory allocation and 10% of CPU allocation
148
148
* while idle.
149
149
*/
150
150
minInstances ?: number | Expression < number > | ResetValue ;
151
151
152
152
/**
153
- * Max number of instances to be running in parallel.
153
+ * Max number of instances that can be running in parallel.
154
154
*/
155
155
maxInstances ?: number | Expression < number > | ResetValue ;
156
156
157
157
/**
158
158
* Number of requests a function can serve at once.
159
159
*
160
160
* @remarks
161
- * Can only be applied to functions running on Cloud Functions v2 .
161
+ * Can be applied only to functions running on Cloud Functions (2nd gen)) .
162
162
* A value of null restores the default concurrency (80 when CPU >= 1, 1 otherwise).
163
163
* Concurrency cannot be set to any value other than 1 if `cpu` is less than 1.
164
164
* The maximum value for concurrency is 1,000.
@@ -171,14 +171,14 @@ export interface GlobalOptions {
171
171
* @remarks
172
172
* Defaults to 1 for functions with <= 2GB RAM and increases for larger memory sizes.
173
173
* This is different from the defaults when using the gcloud utility and is different from
174
- * the fixed amount assigned in Google Cloud Functions generation 1 .
175
- * To revert to the CPU amounts used in gcloud or in Cloud Functions generation 1 , set this
174
+ * the fixed amount assigned in Cloud Functions (1st gen) .
175
+ * To revert to the CPU amounts used in gcloud or in Cloud Functions (1st gen) , set this
176
176
* to the value "gcf_gen1"
177
177
*/
178
178
cpu ?: number | "gcf_gen1" ;
179
179
180
180
/**
181
- * Connect cloud function to specified VPC connector.
181
+ * Connect a function to a specified VPC connector.
182
182
*/
183
183
vpcConnector ?: string | Expression < string > | ResetValue ;
184
184
@@ -198,7 +198,7 @@ export interface GlobalOptions {
198
198
ingressSettings ?: IngressSetting | ResetValue ;
199
199
200
200
/**
201
- * Invoker to set access control on https functions.
201
+ * Invoker to set access control on HTTPS functions.
202
202
*/
203
203
invoker ?: "public" | "private" | string | string [ ] ;
204
204
@@ -213,21 +213,21 @@ export interface GlobalOptions {
213
213
secrets ?: ( string | SecretParam ) [ ] ;
214
214
215
215
/**
216
- * Determines whether Firebase AppCheck is enforced. Defaults to false.
216
+ * Determines whether Firebase App Check is enforced. Defaults to false.
217
217
*
218
218
* @remarks
219
219
* When true, requests with invalid tokens autorespond with a 401
220
220
* (Unauthorized) error.
221
- * When false, requests with invalid tokens set event.app to undefined.
221
+ * When false, requests with invalid tokens set ` event.app` to ` undefined` .
222
222
*/
223
223
enforceAppCheck ?: boolean ;
224
224
225
225
/**
226
226
* Controls whether function configuration modified outside of function source is preserved. Defaults to false.
227
227
*
228
228
* @remarks
229
- * When setting configuration available in the underlying platform that is not yet available in the Firebase Functions
230
- * SDK , we highly recommend setting `preserveExternalChanges` to `true`. Otherwise, when the Firebase Functions SDK releases
229
+ * When setting configuration available in an underlying platform that is not yet available in the Firebase SDK
230
+ * for Cloud Functions , we recommend setting `preserveExternalChanges` to `true`. Otherwise, when Google releases
231
231
* a new version of the SDK with support for the missing configuration, your function's manually configured setting
232
232
* may inadvertently be wiped out.
233
233
*/
@@ -237,7 +237,7 @@ export interface GlobalOptions {
237
237
let globalOptions : GlobalOptions | undefined ;
238
238
239
239
/**
240
- * Sets default options for all functions written using the v2 SDK.
240
+ * Sets default options for all functions written using the 2nd gen SDK.
241
241
* @param options Options to set as default
242
242
*/
243
243
export function setGlobalOptions ( options : GlobalOptions ) {
@@ -257,12 +257,16 @@ export function getGlobalOptions(): GlobalOptions {
257
257
}
258
258
259
259
/**
260
- * Additional fields that can be set on any event-handling Cloud Function .
260
+ * Additional fields that can be set on any event-handling function .
261
261
*/
262
262
export interface EventHandlerOptions extends Omit < GlobalOptions , "enforceAppCheck" > {
263
+ /** Type of the event. Valid values are TODO */
263
264
eventType ?: string ;
264
265
266
+ /** TODO */
265
267
eventFilters ?: Record < string , string | Expression < string > > ;
268
+
269
+ /** TODO */
266
270
eventFilterPathPatterns ?: Record < string , string | Expression < string > > ;
267
271
268
272
/** Whether failed executions should be delivered again. */
0 commit comments