@@ -102,6 +102,13 @@ export interface Event {
102
102
* that are useful only to properly configured Workers.
103
103
*/
104
104
payload ?: string
105
+ /**
106
+ * A counterpart to payload. If payload is free-form Worker input,
107
+ * then Summary is free-form Worker output. It can optionally be set by a
108
+ * Worker to provide a summary of the work completed by the Worker and its
109
+ * Jobs.
110
+ */
111
+ summary ?: string
105
112
/**
106
113
* Contains details of the Worker assigned to handle the Event
107
114
*/
@@ -119,6 +126,16 @@ export interface SourceState {
119
126
state ?: { [ key : string ] : string }
120
127
}
121
128
129
+ /**
130
+ * Encapsulates an opaque, Worker-specific summary of an Event.
131
+ */
132
+ export interface EventSummary {
133
+ /**
134
+ * The Event summary as (optionally) provided by a Worker.
135
+ */
136
+ text : string
137
+ }
138
+
122
139
/**
123
140
* Useful filter criteria when selecting multiple Events for API group
124
141
* operations like list, cancel, or delete.
@@ -281,6 +298,19 @@ export class EventsClient {
281
298
return this . rmClient . executeRequest ( req ) as Promise < Event >
282
299
}
283
300
301
+ /**
302
+ * Updates a Worker-specific Event summary.
303
+ *
304
+ * @param id Identifier of the Event to update
305
+ * @throws An error if the specified Event is not found
306
+ */
307
+ public async updateSummary ( id : string , summary : EventSummary ) : Promise < void > {
308
+ const req = new rm . Request ( "PUT" , `v2/events/${ id } /summary` )
309
+ req . bodyObj = summary
310
+ req . successCode = 200
311
+ return this . rmClient . executeRequest ( req ) as Promise < void >
312
+ }
313
+
284
314
/**
285
315
* Copies an Event in a terminal state, including Worker configuration and
286
316
* creates a new Event from this information. Where possible, job results are
0 commit comments