4
4
import { FunctionOptions , FunctionOutput , FunctionResult , FunctionTrigger } from './index' ;
5
5
import { InvocationContext } from './InvocationContext' ;
6
6
7
- export type ServiceBusQueueHandler = ( message : unknown , context : InvocationContext ) => FunctionResult ;
7
+ export type ServiceBusQueueHandler = ( messages : unknown , context : InvocationContext ) => FunctionResult ;
8
8
9
9
export interface ServiceBusQueueFunctionOptions extends ServiceBusQueueTriggerOptions , Partial < FunctionOptions > {
10
10
handler : ServiceBusQueueHandler ;
@@ -27,6 +27,11 @@ export interface ServiceBusQueueTriggerOptions {
27
27
* `true` if connecting to a [session-aware](https://docs.microsoft.com/azure/service-bus-messaging/message-sessions) queue. Default is `false`
28
28
*/
29
29
isSessionsEnabled ?: boolean ;
30
+
31
+ /**
32
+ * Set to `many` in order to enable batching. If omitted or set to `one`, a single message is passed to the function.
33
+ */
34
+ cardinality ?: 'many' | 'one' ;
30
35
}
31
36
export type ServiceBusQueueTrigger = FunctionTrigger & ServiceBusQueueTriggerOptions ;
32
37
@@ -71,6 +76,11 @@ export interface ServiceBusTopicTriggerOptions {
71
76
* `true` if connecting to a [session-aware](https://docs.microsoft.com/azure/service-bus-messaging/message-sessions) subscription. Default is `false`
72
77
*/
73
78
isSessionsEnabled ?: boolean ;
79
+
80
+ /**
81
+ * Set to `many` in order to enable batching. If omitted or set to `one`, a single message is passed to the function.
82
+ */
83
+ cardinality ?: 'many' | 'one' ;
74
84
}
75
85
export type ServiceBusTopicTrigger = FunctionTrigger & ServiceBusTopicTriggerOptions ;
76
86
0 commit comments