@im-more/dsh-line 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/LICENSE +21 -0
  2. package/cordis.patch.yml +12 -0
  3. package/lib/index.js +1701 -0
  4. package/lib/index.js.map +1 -0
  5. package/lib/types/bot.d.ts +55 -0
  6. package/lib/types/bot.d.ts.map +1 -0
  7. package/lib/types/bot.js +169 -0
  8. package/lib/types/bot.js.map +1 -0
  9. package/lib/types/config.d.ts +47 -0
  10. package/lib/types/config.d.ts.map +1 -0
  11. package/lib/types/config.js +77 -0
  12. package/lib/types/config.js.map +1 -0
  13. package/lib/types/decode.d.ts +60 -0
  14. package/lib/types/decode.d.ts.map +1 -0
  15. package/lib/types/decode.js +321 -0
  16. package/lib/types/decode.js.map +1 -0
  17. package/lib/types/errors.d.ts +47 -0
  18. package/lib/types/errors.d.ts.map +1 -0
  19. package/lib/types/errors.js +112 -0
  20. package/lib/types/errors.js.map +1 -0
  21. package/lib/types/identity.d.ts +17 -0
  22. package/lib/types/identity.d.ts.map +1 -0
  23. package/lib/types/identity.js +24 -0
  24. package/lib/types/identity.js.map +1 -0
  25. package/lib/types/index.d.ts +17 -0
  26. package/lib/types/index.d.ts.map +1 -0
  27. package/lib/types/index.js +16 -0
  28. package/lib/types/index.js.map +1 -0
  29. package/lib/types/media.d.ts +19 -0
  30. package/lib/types/media.d.ts.map +1 -0
  31. package/lib/types/media.js +55 -0
  32. package/lib/types/media.js.map +1 -0
  33. package/lib/types/modes/shared.d.ts +126 -0
  34. package/lib/types/modes/shared.d.ts.map +1 -0
  35. package/lib/types/modes/shared.js +316 -0
  36. package/lib/types/modes/shared.js.map +1 -0
  37. package/lib/types/modes/text.d.ts +13 -0
  38. package/lib/types/modes/text.d.ts.map +1 -0
  39. package/lib/types/modes/text.js +143 -0
  40. package/lib/types/modes/text.js.map +1 -0
  41. package/lib/types/request.d.ts +49 -0
  42. package/lib/types/request.d.ts.map +1 -0
  43. package/lib/types/request.js +162 -0
  44. package/lib/types/request.js.map +1 -0
  45. package/lib/types/send.d.ts +43 -0
  46. package/lib/types/send.d.ts.map +1 -0
  47. package/lib/types/send.js +74 -0
  48. package/lib/types/send.js.map +1 -0
  49. package/lib/types/signature.d.ts +19 -0
  50. package/lib/types/signature.d.ts.map +1 -0
  51. package/lib/types/signature.js +30 -0
  52. package/lib/types/signature.js.map +1 -0
  53. package/lib/types/transport/media.d.ts +62 -0
  54. package/lib/types/transport/media.d.ts.map +1 -0
  55. package/lib/types/transport/media.js +104 -0
  56. package/lib/types/transport/media.js.map +1 -0
  57. package/lib/types/transport/webhook.d.ts +62 -0
  58. package/lib/types/transport/webhook.d.ts.map +1 -0
  59. package/lib/types/transport/webhook.js +208 -0
  60. package/lib/types/transport/webhook.js.map +1 -0
  61. package/lib/types/types/definition.d.ts +1006 -0
  62. package/lib/types/types/definition.d.ts.map +1 -0
  63. package/lib/types/types/definition.js +2 -0
  64. package/lib/types/types/definition.js.map +1 -0
  65. package/lib/types/types/index.d.ts +542 -0
  66. package/lib/types/types/index.d.ts.map +1 -0
  67. package/lib/types/types/index.js +4 -0
  68. package/lib/types/types/index.js.map +1 -0
  69. package/lib/types/types/internal.d.ts +8 -0
  70. package/lib/types/types/internal.d.ts.map +1 -0
  71. package/lib/types/types/internal.js +234 -0
  72. package/lib/types/types/internal.js.map +1 -0
  73. package/lib/types/types/request.d.ts +341 -0
  74. package/lib/types/types/request.d.ts.map +1 -0
  75. package/lib/types/types/request.js +2 -0
  76. package/lib/types/types/request.js.map +1 -0
  77. package/package.json +61 -3
  78. package/src/bot.ts +229 -0
  79. package/src/config.ts +113 -0
  80. package/src/decode.ts +418 -0
  81. package/src/errors.ts +138 -0
  82. package/src/identity.ts +28 -0
  83. package/src/index.ts +60 -0
  84. package/src/media.ts +66 -0
  85. package/src/modes/shared.ts +408 -0
  86. package/src/modes/text.ts +177 -0
  87. package/src/request.ts +215 -0
  88. package/src/send.ts +104 -0
  89. package/src/signature.ts +32 -0
  90. package/src/transport/media.ts +117 -0
  91. package/src/transport/webhook.ts +266 -0
  92. package/src/types/.eslintrc.yml +2 -0
  93. package/src/types/definition.ts +1008 -0
  94. package/src/types/index.ts +593 -0
  95. package/src/types/internal.ts +233 -0
  96. package/src/types/request.ts +341 -0
  97. package/README.md +0 -3
@@ -0,0 +1,593 @@
1
+ import type {} from './request'
2
+ export * from './request'
3
+ export * from './internal'
4
+ export * from './definition'
5
+
6
+ // https://github.com/line/line-bot-sdk-nodejs/blob/next/lib/types.ts
7
+
8
+ /**
9
+ * Request body which is sent by webhook.
10
+ *
11
+ * @see [Request body](https://developers.line.biz/en/reference/messaging-api/#request-body)
12
+ */
13
+ export type WebhookRequestBody = {
14
+ /**
15
+ * User ID of a bot that should receive webhook events. The user ID value is a string that matches the regular expression, U[0-9a-f]{32}.
16
+ */
17
+ destination: string
18
+
19
+ /**
20
+ * Information about the event
21
+ */
22
+ events: WebhookEvent[]
23
+ }
24
+
25
+ /**
26
+ * JSON objects which contain events generated on the LINE Platform.
27
+ *
28
+ * @see [Webhook event objects](https://developers.line.biz/en/reference/messaging-api/#webhook-event-objects)
29
+ */
30
+ export type WebhookEvent =
31
+ | MessageEvent
32
+ | UnsendEvent
33
+ | FollowEvent
34
+ | UnfollowEvent
35
+ | JoinEvent
36
+ | LeaveEvent
37
+ | MemberJoinEvent
38
+ | MemberLeaveEvent
39
+ | PostbackEvent
40
+ | EditEvent
41
+ | BeaconEvent
42
+ | AccountLinkEvent
43
+ | VideoPlayCompleteEvent
44
+ | DeliveryEvent
45
+ | ModuleEvent
46
+ | BotSuspendedEvent
47
+ | BotResumedEvent
48
+ | PnpDeliveryEvent
49
+ | AudienceMatchEvent
50
+ | ActivatedEvent
51
+ | DeactivatedEvent
52
+
53
+ /** Whether a webhook event is the first delivery or a redelivery. */
54
+ export type DeliveryContext = {
55
+ /**
56
+ * Whether the webhook event was sent again.
57
+ *
58
+ * @see [Redelivered webhooks](https://developers.line.biz/en/docs/messaging-api/receiving-messages/#redelivered-webhooks)
59
+ */
60
+ isRedelivery?: boolean
61
+ }
62
+
63
+ export type EventBase = {
64
+ /**
65
+ * Channel state.
66
+ *
67
+ * `active`: The channel is active. You can send a reply message or push message from the bot server that received this webhook event.
68
+ *
69
+ * `standby`: The channel is waiting. The bot server that received this webhook event shouldn't send any messages.
70
+ */
71
+ mode: 'active' | 'standby'
72
+ /**
73
+ * Time of the event in milliseconds
74
+ */
75
+ timestamp: number
76
+ /**
77
+ * Source user, group, or room object with information about the source of the event.
78
+ */
79
+ source: EventSource
80
+ /**
81
+ * Unique ID of the webhook event. Redeliveries of the same event share it.
82
+ *
83
+ * @see [Common properties](https://developers.line.biz/en/reference/messaging-api/#common-properties)
84
+ */
85
+ webhookEventId: string
86
+ /**
87
+ * Whether the event is a redelivery.
88
+ *
89
+ * @see [Common properties](https://developers.line.biz/en/reference/messaging-api/#common-properties)
90
+ */
91
+ deliveryContext: DeliveryContext
92
+ }
93
+
94
+ export type EventSource = User | Group | Room
95
+
96
+ export type User = { type: 'user'; userId: string }
97
+
98
+ export type Group = {
99
+ type: 'group'
100
+ groupId: string
101
+ /**
102
+ * ID of the source user.
103
+ *
104
+ * Only included in [message events](https://developers.line.biz/en/reference/messaging-api/#message-event).
105
+ * Not included if the user has not agreed to the
106
+ * [Official Accounts Terms of Use](https://developers.line.biz/en/docs/messaging-api/user-consent/).
107
+ */
108
+ userId?: string
109
+ }
110
+
111
+ export type Room = {
112
+ type: 'room'
113
+ roomId: string
114
+ /**
115
+ * ID of the source user.
116
+ *
117
+ * Only included in [message events](https://developers.line.biz/en/reference/messaging-api/#message-event).
118
+ * Not included if the user has not agreed to the
119
+ * [Official Accounts Terms of Use](https://developers.line.biz/en/docs/messaging-api/user-consent/).
120
+ */
121
+ userId?: string
122
+ }
123
+
124
+ export type ReplyableEvent = EventBase & { replyToken: string }
125
+
126
+ /**
127
+ * Webhook event object which contains the sent message.
128
+ *
129
+ * The `message` property contains a message object which corresponds with the
130
+ * message type. You can reply to message events.
131
+ *
132
+ * @see [Message event](https://developers.line.biz/en/reference/messaging-api/#message-event)
133
+ */
134
+ export type MessageEvent = {
135
+ type: 'message'
136
+ message: EventMessage
137
+ } & ReplyableEvent
138
+
139
+ /**
140
+ * Event object for when the user unsends a message in a [group](https://developers.line.biz/en/docs/messaging-api/group-chats/#group)
141
+ * or [room](https://developers.line.biz/en/docs/messaging-api/group-chats/#room).
142
+ * [Unsend event](https://developers.line.biz/en/reference/messaging-api/#unsend-event)
143
+ */
144
+ export type UnsendEvent = {
145
+ type: 'unsend'
146
+ /**
147
+ * The message ID of the unsent message
148
+ */
149
+ unsend: { messageId: string }
150
+ } & EventBase
151
+
152
+ /**
153
+ * Event object for when your account is added as a friend (or unblocked).
154
+ */
155
+ export type FollowEvent = { type: 'follow' } & ReplyableEvent
156
+
157
+ /**
158
+ * Event object for when your account is blocked.
159
+ */
160
+ export type UnfollowEvent = { type: 'unfollow' } & EventBase
161
+
162
+ /**
163
+ * Event object for when your bot joins a group or room. You can reply to join events.
164
+ *
165
+ * A join event is triggered at different times for groups and rooms.
166
+ *
167
+ * - For groups: A join event is sent when a user invites your bot.
168
+ * - For rooms: A join event is sent when the first event (for example when a
169
+ * user sends a message or is added to the room) occurs after your bot is
170
+ * added.
171
+ */
172
+ export type JoinEvent = { type: 'join' } & ReplyableEvent
173
+
174
+ /**
175
+ * Event object for when a user removes your bot from a group or a room.
176
+ */
177
+ export type LeaveEvent = { type: 'leave' } & EventBase
178
+
179
+ /**
180
+ * Event object for when a user joins a [group](https://developers.line.biz/en/docs/messaging-api/group-chats/#group)
181
+ * or [room](https://developers.line.biz/en/docs/messaging-api/group-chats/#room) that the bot is in.
182
+ */
183
+ export type MemberJoinEvent = {
184
+ type: 'memberJoined'
185
+ /**
186
+ * User ID of users who joined
187
+ * Array of [source user](https://developers.line.biz/en/reference/messaging-api/#source-user) objects
188
+ */
189
+ joined: { members: User[] }
190
+ } & ReplyableEvent
191
+
192
+ /**
193
+ * Event object for when a user leaves a [group](https://developers.line.biz/en/docs/messaging-api/group-chats/#group)
194
+ * or [room](https://developers.line.biz/en/docs/messaging-api/group-chats/#room) that the bot is in.
195
+ */
196
+ export type MemberLeaveEvent = {
197
+ type: 'memberLeft'
198
+ /**
199
+ * User ID of users who left
200
+ * Array of [source user](https://developers.line.biz/en/reference/messaging-api/#source-user) objects
201
+ */
202
+ left: { members: User[] }
203
+ } & EventBase
204
+
205
+ /**
206
+ * Event object for when a user performs an action on a
207
+ * [template message](https://developers.line.biz/en/reference/messaging-api/#template-messages).
208
+ */
209
+ export type PostbackEvent = {
210
+ type: 'postback'
211
+ postback: Postback
212
+ } & ReplyableEvent
213
+
214
+ export type Postback = {
215
+ data: string
216
+ params?: DateTimePostback | RichMenuSwitchPostback
217
+ }
218
+
219
+ /**
220
+ * Object with the date and time selected by a user through a
221
+ * [datetime picker action](https://developers.line.biz/en/reference/messaging-api/#datetime-picker-action).
222
+ * Only returned for postback actions via a
223
+ * [datetime picker action](https://developers.line.biz/en/reference/messaging-api/#datetime-picker-action).
224
+ * The `full-date`, `time-hour`, and `time-minute` formats follow the
225
+ * [RFC3339 protocol](https://www.ietf.org/rfc/rfc3339.txt).
226
+ */
227
+ type DateTimePostback = {
228
+ /**
229
+ * Date selected by user. Only included in the `date` mode.
230
+ */
231
+ date?: string
232
+ /**
233
+ * Time selected by the user. Only included in the `time` mode.
234
+ */
235
+ time?: string
236
+ /**
237
+ * Date and time selected by the user. Only included in the `datetime` mode.
238
+ */
239
+ datetime?: string
240
+ }
241
+
242
+ /**
243
+ * Object with rich menu alias ID selected by user via rich menu switch action.
244
+ * https://developers.line.biz/en/reference/messaging-api/#postback-params-object-for-richmenu-switch-action
245
+ */
246
+ type RichMenuSwitchPostback = {
247
+ newRichMenuAliasId: string
248
+ status:
249
+ | 'SUCCESS'
250
+ | 'RICHMENU_ALIAS_ID_NOTFOUND'
251
+ | 'RICHMENU_NOTFOUND'
252
+ | 'FAILED'
253
+ }
254
+
255
+ /**
256
+ * Event object for when a user edits a message.
257
+ *
258
+ * @see [Edit event](https://developers.line.biz/en/reference/messaging-api/#edit-event)
259
+ */
260
+ export type EditEvent = {
261
+ type: 'edit'
262
+ message: EventMessage
263
+ } & EventBase
264
+
265
+ /**
266
+ * Event object for when a user enters or leaves the range of a LINE Beacon.
267
+ *
268
+ * @see [Beacon event](https://developers.line.biz/en/reference/messaging-api/#beacon-event)
269
+ */
270
+ export type BeaconEvent = {
271
+ type: 'beacon'
272
+ beacon: {
273
+ /** Hardware ID of the beacon that was detected. */
274
+ hwid: string
275
+ /**
276
+ * Type of beacon event.
277
+ *
278
+ * `enter`, `leave` or `banner`.
279
+ */
280
+ type: 'enter' | 'leave' | 'banner'
281
+ /** Device message of the beacon. Included only with `banner`. */
282
+ dm?: string
283
+ }
284
+ } & ReplyableEvent
285
+
286
+ /**
287
+ * Event object for when a user finishes linking LINE with a provider.
288
+ *
289
+ * @see [Account link event](https://developers.line.biz/en/reference/messaging-api/#account-link-event)
290
+ */
291
+ export type AccountLinkEvent = {
292
+ type: 'accountLink'
293
+ link: {
294
+ result: 'ok' | 'failed'
295
+ nonce: string
296
+ }
297
+ } & ReplyableEvent
298
+
299
+ /**
300
+ * Event object for when a user finishes watching a video message.
301
+ *
302
+ * @see [Video play complete event](https://developers.line.biz/en/reference/messaging-api/#video-play-complete-event)
303
+ */
304
+ export type VideoPlayCompleteEvent = {
305
+ type: 'videoPlayComplete'
306
+ videoPlayComplete: { trackingId: string }
307
+ } & ReplyableEvent
308
+
309
+ /**
310
+ * Event object for a message delivered to a phone number (PnP).
311
+ *
312
+ * @see [Delivery event](https://developers.line.biz/en/reference/messaging-api/#delivery-event)
313
+ */
314
+ export type DeliveryEvent = {
315
+ type: 'delivery'
316
+ delivery: { data: string }
317
+ } & EventBase
318
+
319
+ /**
320
+ * Event object for a LINE module attached to or detached from the channel.
321
+ *
322
+ * @see [Module event](https://developers.line.biz/en/reference/messaging-api/#module-event)
323
+ */
324
+ export type ModuleEvent = {
325
+ type: 'module'
326
+ module: {
327
+ type: 'attached' | 'detached'
328
+ moduleId: string
329
+ moduleHandlerId?: string
330
+ }
331
+ } & EventBase
332
+
333
+ /**
334
+ * Event object for when the bot stops receiving webhook events.
335
+ *
336
+ * @see [Bot suspended event](https://developers.line.biz/en/reference/messaging-api/#bot-suspended-event)
337
+ */
338
+ export type BotSuspendedEvent = { type: 'botSuspended' } & EventBase
339
+
340
+ /**
341
+ * Event object for when the bot starts receiving webhook events again.
342
+ *
343
+ * @see [Bot resumed event](https://developers.line.biz/en/reference/messaging-api/#bot-resumed-event)
344
+ */
345
+ export type BotResumedEvent = { type: 'botResumed' } & EventBase
346
+
347
+ /**
348
+ * Event object for a PnP message delivered to a phone number.
349
+ *
350
+ * @see [PnP delivery event](https://developers.line.biz/en/reference/messaging-api/#pnp-delivery-event)
351
+ */
352
+ export type PnpDeliveryEvent = {
353
+ type: 'pnpDelivery'
354
+ delivery: { data: string }
355
+ } & EventBase
356
+
357
+ /**
358
+ * Event object for a user whose audience membership matched.
359
+ *
360
+ * @see [Audience match event](https://developers.line.biz/en/reference/messaging-api/#audience-match-event)
361
+ */
362
+ export type AudienceMatchEvent = {
363
+ type: 'audienceMatch'
364
+ audienceMatch: { type: string }
365
+ } & EventBase
366
+
367
+ /**
368
+ * Event object for an activated channel.
369
+ *
370
+ * @see [Activated event](https://developers.line.biz/en/reference/messaging-api/#activated-event)
371
+ */
372
+ export type ActivatedEvent = { type: 'activated' } & EventBase
373
+
374
+ /**
375
+ * Event object for a deactivated channel.
376
+ *
377
+ * @see [Deactivated event](https://developers.line.biz/en/reference/messaging-api/#deactivated-event)
378
+ */
379
+ export type DeactivatedEvent = { type: 'deactivated' } & EventBase
380
+
381
+ export type EventMessage =
382
+ | TextEventMessage
383
+ | ImageEventMessage
384
+ | VideoEventMessage
385
+ | AudioEventMessage
386
+ | LocationEventMessage
387
+ | FileEventMessage
388
+ | StickerEventMessage
389
+
390
+ export type EventMessageBase = { id: string }
391
+
392
+ /**
393
+ * Message object which contains the text sent from the source.
394
+ */
395
+ export type TextEventMessage = {
396
+ type: 'text'
397
+ text: string
398
+ /**
399
+ * Sendable LINE emojis
400
+ */
401
+ emojis?: {
402
+ index: number
403
+ length: number
404
+ productId: string
405
+ emojiId: string
406
+ }[]
407
+ /**
408
+ * Object containing the contents of the mentioned user.
409
+ */
410
+ mention?: {
411
+ /**
412
+ * Mentioned user information.
413
+ * Max: 20 mentions
414
+ */
415
+ mentionees: {
416
+ /**
417
+ * Index position of the user mention for a character in `text`,
418
+ * with the first character being at position 0.
419
+ */
420
+ index: number
421
+ /**
422
+ * The length of the text of the mentioned user. For a mention `@example`,
423
+ * 8 is the length.
424
+ */
425
+ length: number
426
+ /**
427
+ * Mentioned target.
428
+ *
429
+ * - `user`: User.
430
+ * - `all`: Entire group.
431
+ */
432
+ type: 'user' | 'all'
433
+ /**
434
+ * User ID of the mentioned user. Only included if mention.mentions[].type is user
435
+ * and the user consents to the LINE Official Account obtaining their user profile information.
436
+ */
437
+ userId?: string
438
+ /**
439
+ * Whether the mention is of the bot itself.
440
+ *
441
+ * Not always included; when absent, the caller compares `type === 'user'` and `userId`.
442
+ *
443
+ * @see [Text message event](https://developers.line.biz/en/reference/messaging-api/#wh-text)
444
+ */
445
+ isSelf?: boolean
446
+ }[]
447
+ }
448
+ /** Token that quotes this message in a reply. */
449
+ quoteToken?: string
450
+ /** Token that marks this message as read. */
451
+ markAsReadToken?: string
452
+ /** ID of the message this message quotes. */
453
+ quotedMessageId?: string
454
+ } & EventMessageBase
455
+
456
+ export type ContentProvider<WithPreview extends boolean = true> =
457
+ | {
458
+ /**
459
+ * The content is provided by LINE.
460
+ *
461
+ * The data itself can be retrieved from the content API.
462
+ */
463
+ type: 'line'
464
+ }
465
+ | {
466
+ /**
467
+ * The content is provided by a provider other than LINE
468
+ */
469
+ type: 'external'
470
+ /**
471
+ * URL of the content. Only included when contentProvider.type is external.
472
+ */
473
+ originalContentUrl: string
474
+ /**
475
+ * URL of the content preview. Only included when contentProvider.type is external.
476
+ *
477
+ * For contents without preview (e.g. audio), it's undefined.
478
+ */
479
+ previewImageUrl: WithPreview extends true ? string : undefined
480
+ }
481
+
482
+ /**
483
+ * Message object which contains the image content sent from the source.
484
+ * The binary image data can be retrieved using Client#getMessageContent.
485
+ */
486
+ export type ImageEventMessage = {
487
+ type: 'image'
488
+ contentProvider: ContentProvider
489
+ /** Token that quotes this message in a reply. */
490
+ quoteToken?: string
491
+ /** Token that marks this message as read. */
492
+ markAsReadToken?: string
493
+ /**
494
+ * Object containing the number of images sent simultaneously.
495
+ */
496
+ imageSet?: {
497
+ /**
498
+ * Image set ID. Only included when multiple images are sent simultaneously.
499
+ */
500
+ id: string
501
+ /**
502
+ * An index starting from 1, indicating the image number in a set of images sent simultaneously.
503
+ * Only included when multiple images are sent simultaneously.
504
+ * However, it won't be included if the sender is using LINE 11.15 or earlier for Android.
505
+ */
506
+ index: number
507
+ /**
508
+ * The total number of images sent simultaneously.
509
+ * If two images are sent simultaneously, the number is 2.
510
+ * Only included when multiple images are sent simultaneously.
511
+ * However, it won't be included if the sender is using LINE 11.15 or earlier for Android.
512
+ */
513
+ total: number
514
+ }
515
+ } & EventMessageBase
516
+
517
+ /**
518
+ * Message object which contains the video content sent from the source.
519
+ * The binary video data can be retrieved using Client#getMessageContent.
520
+ */
521
+ export type VideoEventMessage = {
522
+ type: 'video'
523
+ /** Length of the video in milliseconds. */
524
+ duration?: number
525
+ contentProvider: ContentProvider
526
+ /** Token that quotes this message in a reply. */
527
+ quoteToken?: string
528
+ /** Token that marks this message as read. */
529
+ markAsReadToken?: string
530
+ } & EventMessageBase
531
+
532
+ /**
533
+ * Message object which contains the audio content sent from the source.
534
+ * The binary audio data can be retrieved using Client#getMessageContent.
535
+ */
536
+ export type AudioEventMessage = {
537
+ type: 'audio'
538
+ duration: number
539
+ contentProvider: ContentProvider<false>
540
+ /** Token that marks this message as read. */
541
+ markAsReadToken?: string
542
+ } & EventMessageBase
543
+
544
+ /**
545
+ * Message object which contains the file sent from the source.
546
+ * The binary data can be retrieved using Client#getMessageContent.
547
+ */
548
+ export type FileEventMessage = {
549
+ type: 'file'
550
+ fileName: string
551
+ fileSize: string
552
+ /** Token that marks this message as read. */
553
+ markAsReadToken?: string
554
+ } & EventMessageBase
555
+
556
+ /**
557
+ * Message object which contains the location data sent from the source.
558
+ */
559
+ export type LocationEventMessage = {
560
+ type: 'location'
561
+ title: string
562
+ address: string
563
+ latitude: number
564
+ longitude: number
565
+ } & EventMessageBase
566
+
567
+ /**
568
+ * Message object which contains the sticker data sent from the source.
569
+ * For a list of basic LINE stickers and sticker IDs, see
570
+ * [sticker list](https://developers.line.biz/media/messaging-api/sticker_list.pdf).
571
+ */
572
+ export type StickerEventMessage = {
573
+ type: 'sticker'
574
+ packageId: string
575
+ stickerId: string
576
+ /** Token that quotes this message in a reply. */
577
+ quoteToken?: string
578
+ stickerResourceType:
579
+ | 'STATIC'
580
+ | 'ANIMATION'
581
+ | 'SOUND'
582
+ | 'ANIMATION_SOUND'
583
+ | 'POPUP'
584
+ | 'POPUP_SOUND'
585
+ | 'CUSTOM'
586
+ | 'MESSAGE'
587
+ keywords: string[]
588
+ /**
589
+ * Any text entered by the user. This property is only included for message stickers.
590
+ * Max character limit: 100
591
+ */
592
+ text?: string
593
+ } & EventMessageBase