File tree Expand file tree Collapse file tree 2 files changed +32
-2
lines changed Expand file tree Collapse file tree 2 files changed +32
-2
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,8 @@ export type WebhookEvent =
59
59
| AccountLinkEvent
60
60
| DeviceLinkEvent
61
61
| DeviceUnlinkEvent
62
- | LINEThingsScenarioExecutionEvent ;
62
+ | LINEThingsScenarioExecutionEvent
63
+ | DeliveryEvent ;
63
64
64
65
export type EventBase = {
65
66
/**
@@ -78,8 +79,18 @@ export type EventBase = {
78
79
* Source user, group, or room object with information about the source of the event.
79
80
*/
80
81
source : EventSource ;
82
+ /**
83
+ * Webhook event ID, an ID that uniquely identifies a Webhook event, in the form of a ULID string.
84
+ */
85
+ webhookEventId : string ;
86
+ /**
87
+ * Whether the webhook event is a resubmitted one or not
88
+ */
89
+ deliveryContext : DeliveryContext ;
81
90
} ;
82
91
92
+ export type DeliveryContext = { isRedelivery : boolean } ;
93
+
83
94
export type EventSource = User | Group | Room ;
84
95
85
96
export type User = { type : "user" ; userId : string } ;
@@ -360,6 +371,21 @@ export type LINEThingsActionResult = {
360
371
data ?: string ;
361
372
} ;
362
373
374
+ /**
375
+ * Completed Delivery Event
376
+ * @see {@link https://developers.line.biz/en/docs/partner-docs/line-notification-messages/message-sending-complete-webhook-event/#receive-delivery-event }
377
+ */
378
+ export type DeliveryEvent = {
379
+ type : "delivery" ;
380
+ /** A delivery object containing a hashed phone number string or a string specified by X-Line-Delivery-Tag. */
381
+ delivery : Delivery ;
382
+ } & EventBase ;
383
+
384
+ type Delivery = {
385
+ /** A hashed phone number string or a string specified by X-Line-Delivery-Tag. */
386
+ data : string ;
387
+ } ;
388
+
363
389
export type EventMessage =
364
390
| TextEventMessage
365
391
| ImageEventMessage
Original file line number Diff line number Diff line change @@ -26,12 +26,16 @@ describe("middleware", () => {
26
26
groupId : "test_group_id" ,
27
27
type : "group" ,
28
28
} ,
29
+ webhookEventId : "test_webhook_event_id" ,
30
+ deliveryContext : {
31
+ isRedelivery : false ,
32
+ } ,
29
33
timestamp : 0 ,
30
34
mode : "active" ,
31
35
type : "message" ,
32
36
} ;
33
37
const webhookSignature = {
34
- "X-Line-Signature" : "GzU7H3qOXDzDD6cNcS/9otLzlLFxnYYriz62rNu5BDE =" ,
38
+ "X-Line-Signature" : "Ey7AjSuSI2GfTDQHICAiRLLJ+GSMseISNYaQ6qXSjrU =" ,
35
39
} ;
36
40
37
41
const http = ( headers : any = { ...webhookSignature } ) =>
You can’t perform that action at this time.
0 commit comments