@@ -263,10 +263,22 @@ export interface EventHandlerOptions extends Omit<GlobalOptions, "enforceAppChec
263
263
/** Type of the event. Valid values are TODO */
264
264
eventType ?: string ;
265
265
266
- /** TODO */
266
+ /**
267
+ * Filters events based on exact matches on the CloudEvents attributes.
268
+ *
269
+ * Each key-value pair represents an attribute name and its required value for exact matching.
270
+ * Events must match all specified filters to trigger the function.
271
+ */
267
272
eventFilters ?: Record < string , string | Expression < string > > ;
268
273
269
- /** TODO */
274
+ /**
275
+ * Filters events based on path pattern matching on the CloudEvents attributes.
276
+ *
277
+ * Similar to eventFilters, but supports wildcard patterns for flexible matching:
278
+ * - `*` matches any single path segment
279
+ * - `**` matches zero or more path segments
280
+ * - `{param}` captures a path segment as a parameter
281
+ */
270
282
eventFilterPathPatterns ?: Record < string , string | Expression < string > > ;
271
283
272
284
/** Whether failed executions should be delivered again. */
@@ -288,7 +300,7 @@ export interface EventHandlerOptions extends Omit<GlobalOptions, "enforceAppChec
288
300
* @internal
289
301
*/
290
302
export function optionsToTriggerAnnotations (
291
- opts : GlobalOptions | EventHandlerOptions | HttpsOptions
303
+ opts : GlobalOptions | EventHandlerOptions | HttpsOptions ,
292
304
) : TriggerAnnotation {
293
305
const annotation : TriggerAnnotation = { } ;
294
306
copyIfPresent (
@@ -301,7 +313,7 @@ export function optionsToTriggerAnnotations(
301
313
"labels" ,
302
314
"vpcConnector" ,
303
315
"vpcConnectorEgressSettings" ,
304
- "secrets"
316
+ "secrets" ,
305
317
) ;
306
318
convertIfPresent ( annotation , opts , "availableMemoryMb" , "memory" , ( mem : MemoryOption ) => {
307
319
return MemoryOptionToMB [ mem ] ;
@@ -317,7 +329,7 @@ export function optionsToTriggerAnnotations(
317
329
opts ,
318
330
"serviceAccountEmail" ,
319
331
"serviceAccount" ,
320
- serviceAccountFromShorthand
332
+ serviceAccountFromShorthand ,
321
333
) ;
322
334
convertIfPresent ( annotation , opts , "timeout" , "timeoutSeconds" , durationFromSeconds ) ;
323
335
convertIfPresent (
@@ -327,7 +339,7 @@ export function optionsToTriggerAnnotations(
327
339
"retry" ,
328
340
( retry : boolean ) => {
329
341
return retry ? { retry : true } : null ;
330
- }
342
+ } ,
331
343
) ;
332
344
333
345
return annotation ;
@@ -338,7 +350,7 @@ export function optionsToTriggerAnnotations(
338
350
* @internal
339
351
*/
340
352
export function optionsToEndpoint (
341
- opts : GlobalOptions | EventHandlerOptions | HttpsOptions
353
+ opts : GlobalOptions | EventHandlerOptions | HttpsOptions ,
342
354
) : ManifestEndpoint {
343
355
const endpoint : ManifestEndpoint = { } ;
344
356
copyIfPresent (
@@ -351,7 +363,7 @@ export function optionsToEndpoint(
351
363
"ingressSettings" ,
352
364
"labels" ,
353
365
"timeoutSeconds" ,
354
- "cpu"
366
+ "cpu" ,
355
367
) ;
356
368
convertIfPresent ( endpoint , opts , "serviceAccountEmail" , "serviceAccount" ) ;
357
369
if ( opts . vpcConnector !== undefined ) {
@@ -369,10 +381,10 @@ export function optionsToEndpoint(
369
381
"availableMemoryMb" ,
370
382
"memory" ,
371
383
(
372
- mem : MemoryOption | Expression < number > | ResetValue | null
384
+ mem : MemoryOption | Expression < number > | ResetValue | null ,
373
385
) : number | Expression < number > | null | ResetValue => {
374
386
return typeof mem === "object" ? mem : MemoryOptionToMB [ mem ] ;
375
- }
387
+ } ,
376
388
) ;
377
389
convertIfPresent ( endpoint , opts , "region" , "region" , ( region ) => {
378
390
if ( typeof region === "string" ) {
@@ -386,7 +398,7 @@ export function optionsToEndpoint(
386
398
"secretEnvironmentVariables" ,
387
399
"secrets" ,
388
400
( secrets : ( string | SecretParam ) [ ] ) =>
389
- secrets . map ( ( secret ) => ( { key : secret instanceof SecretParam ? secret . name : secret } ) )
401
+ secrets . map ( ( secret ) => ( { key : secret instanceof SecretParam ? secret . name : secret } ) ) ,
390
402
) ;
391
403
392
404
return endpoint ;
0 commit comments