Skip to content

Commit db25f9c

Browse files
SombreroElGringoHyunje Jun
authored andcommitted
Add DeviceLinkEvent & DeviceUnlinkEvent (#123)
1 parent 8d509ba commit db25f9c

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

lib/types.ts

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ export type WebhookEvent =
5050
| MemberLeaveEvent
5151
| PostbackEvent
5252
| BeaconEvent
53-
| AccountLinkEvent;
53+
| AccountLinkEvent
54+
| DeviceLinkEvent
55+
| DeviceUnlinkEvent;
5456

5557
export type EventBase = {
5658
/**
@@ -211,6 +213,36 @@ export type AccountLinkEvent = ReplyableEvent & {
211213
};
212214
};
213215

216+
/**
217+
* Indicates that a LINE Things-compatible device has been linked with LINE by a user operation.
218+
* For more information, see [Receiving device link events via webhook](https://developers.line.biz/en/docs/line-things/develop-bot/#link-event).
219+
*/
220+
export type DeviceLinkEvent = ReplyableEvent & {
221+
type: "things";
222+
things: {
223+
/**
224+
* Device ID of the LINE Things-compatible device that was linked with LINE
225+
*/
226+
deviceId: string;
227+
type: "link";
228+
};
229+
};
230+
231+
/**
232+
* Indicates that a LINE Things-compatible device has been unlinked from LINE by a user operation.
233+
* For more information, see [Receiving device unlink events via webhook](https://developers.line.biz/en/docs/line-things/develop-bot/#unlink-event).
234+
*/
235+
export type DeviceUnlinkEvent = ReplyableEvent & {
236+
type: "things";
237+
things: {
238+
/**
239+
* Device ID of the LINE Things-compatible device that was unlinked with LINE
240+
*/
241+
deviceId: string;
242+
type: "unlink";
243+
};
244+
};
245+
214246
export type EventMessage =
215247
| TextEventMessage
216248
| ImageEventMessage

0 commit comments

Comments
 (0)