@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,1008 @@
1
+ export type GetWebhookEndpointResponse = {
2
+ /** Webhook URL */
3
+ endpoint: string
4
+ /** Webhook usage status. Send a webhook event from the LINE Platform to the webhook URL only if enabled.
5
+
6
+ `true`: Webhook usage is enabled.
7
+ `false`: Webhook usage is disabled. */
8
+ active: boolean
9
+ }
10
+ export type SetWebhookEndpointRequest = {
11
+ /** A valid webhook URL. */
12
+ endpoint: string
13
+ }
14
+ export type TestWebhookEndpointRequest = {
15
+ /** A webhook URL to be validated. */
16
+ endpoint?: string
17
+ }
18
+ export type TestWebhookEndpointResponse = {
19
+ /** Result of the communication from the LINE platform to the webhook URL. */
20
+ success?: boolean
21
+ /** Time of the event in milliseconds. Even in the case of a redelivered webhook, it represents the time the event occurred, not the time it was redelivered. */
22
+ timestamp: string
23
+ /** The HTTP status code. If the webhook response isn't received, the status code is set to zero or a negative number. */
24
+ statusCode: number
25
+ /** Reason for the response. */
26
+ reason: string
27
+ /** Details of the response. */
28
+ detail: string
29
+ }
30
+ /** Transcoding response */
31
+ export type GetMessageContentTranscodingResponse = {
32
+ /** The preparation status. One of:
33
+
34
+ `processing`: Preparing to get content.
35
+ `succeeded`: Ready to get the content. You can get the content sent by users.
36
+ `failed`: Failed to prepare to get the content. */
37
+ status: string
38
+ }
39
+ export type ReplyMessageRequest = {
40
+ /** replyToken received via webhook. */
41
+ replyToken: string
42
+ /** List of messages. */
43
+ messages: Message[]
44
+ notificationDisabled?: NotificationDisabled
45
+ }
46
+ export type ReplyMessageResponse = {
47
+ /** Array of sent messages. */
48
+ sentMessages: SentMessage[]
49
+ }
50
+ export type SentMessage = {
51
+ /** ID of the sent message. */
52
+ id: string
53
+ /** Quote token of the message. Only included when a message object that can be specified as a quote target was sent as a push or reply message. */
54
+ quoteToken?: string
55
+ }
56
+ export type PushMessageRequest = {
57
+ /** ID of the receiver. */
58
+ to: string
59
+ /** List of Message objects. */
60
+ messages: Message[]
61
+ notificationDisabled?: NotificationDisabled
62
+ /** List of aggregation unit name. Case-sensitive.
63
+ This functions can only be used by corporate users who have submitted the required applications. */
64
+ customAggregationUnits?: string[]
65
+ }
66
+ /** `true`: The user doesn’t receive a push notification when a message is sent.
67
+ `false`: The user receives a push notification when the message is sent (unless they have disabled push notifications in LINE and/or their device).
68
+ The default value is false. */
69
+ export type NotificationDisabled = boolean
70
+ export type PushMessageResponse = {
71
+ /** Array of sent messages. */
72
+ sentMessages: SentMessage[]
73
+ }
74
+ export type MulticastRequest = {
75
+ /** Messages to send */
76
+ messages: Message[]
77
+ /** Array of user IDs. Use userId values which are returned in webhook event objects. Do not use LINE IDs found on LINE. */
78
+ to: string[]
79
+ notificationDisabled?: NotificationDisabled
80
+ /** Name of aggregation unit. Case-sensitive. */
81
+ customAggregationUnits?: string[]
82
+ }
83
+ export type MulticastResponse = {
84
+ }
85
+ export type NarrowcastRequest = {
86
+ /** List of Message objects. */
87
+ messages: Message[]
88
+ recipient?: Recipient
89
+ filter?: Filter
90
+ limit?: Limit
91
+ notificationDisabled?: NotificationDisabled
92
+ }
93
+ export type NarrowcastResponse = {
94
+ }
95
+ /** Recipient */
96
+ export type BaseRecipient = {
97
+ /** Type of recipient */
98
+ type?: string
99
+ }
100
+ export type Recipient = OperatorRecipient | AudienceRecipient | RedeliveryRecipient
101
+ export type OperatorRecipient = (BaseRecipient & {
102
+ type: 'operator'
103
+ } & ({
104
+ and?: Recipient[]
105
+ or?: Recipient[]
106
+ not?: Recipient
107
+ }))
108
+ export type AudienceRecipient = (BaseRecipient & {
109
+ type: 'audience'
110
+ } & ({
111
+ audienceGroupId?: number
112
+ }))
113
+ export type RedeliveryRecipient = (BaseRecipient & {
114
+ type: 'redelivery'
115
+ } & ({
116
+ requestId?: string
117
+ }))
118
+ /** Filter for narrowcast */
119
+ export type Filter = {
120
+ demographic?: DemographicFilter
121
+ }
122
+ /** Demographic filter */
123
+ export type BaseDemographicFilter = {
124
+ /** Type of demographic filter */
125
+ type?: string
126
+ }
127
+ export type DemographicFilter = AgeDemographicFilter | AppTypeDemographicFilter | AreaDemographicFilter | GenderDemographicFilter | OperatorDemographicFilter | SubscriptionPeriodDemographicFilter
128
+ export type AgeDemographicFilter = (BaseDemographicFilter & {
129
+ type: 'age'
130
+ } & ({
131
+ gte?: AgeDemographic
132
+ lt?: AgeDemographic
133
+ }))
134
+ export type AgeDemographic = string
135
+ export type AppTypeDemographicFilter = (BaseDemographicFilter & {
136
+ type: 'appType'
137
+ } & ({
138
+ oneOf?: AppTypeDemographic[]
139
+ }))
140
+ export type AppTypeDemographic = string
141
+ export type AreaDemographicFilter = (BaseDemographicFilter & {
142
+ type: 'area'
143
+ } & ({
144
+ oneOf?: AreaDemographic[]
145
+ }))
146
+ export type AreaDemographic = string
147
+ export type GenderDemographicFilter = (BaseDemographicFilter & {
148
+ type: 'gender'
149
+ } & ({
150
+ oneOf?: GenderDemographic[]
151
+ }))
152
+ export type GenderDemographic = string
153
+ export type OperatorDemographicFilter = (BaseDemographicFilter & {
154
+ type: 'operator'
155
+ } & ({
156
+ and?: DemographicFilter[]
157
+ or?: DemographicFilter[]
158
+ not?: DemographicFilter
159
+ }))
160
+ export type SubscriptionPeriodDemographicFilter = (BaseDemographicFilter & {
161
+ type: 'subscriptionPeriod'
162
+ } & ({
163
+ gte?: SubscriptionPeriodDemographic
164
+ lt?: SubscriptionPeriodDemographic
165
+ }))
166
+ export type SubscriptionPeriodDemographic = string
167
+ /** Limit of the Narrowcast */
168
+ export type Limit = {
169
+ /** The maximum number of narrowcast messages to send.
170
+ Use this parameter to limit the number of narrowcast messages sent.
171
+ The recipients will be chosen at random. */
172
+ max?: number
173
+ /** If true, the message will be sent within the maximum number of deliverable messages. The default value is `false`.
174
+
175
+ Targets will be selected at random. */
176
+ upToRemainingQuota?: boolean
177
+ }
178
+ export type NarrowcastProgressResponse = {
179
+ /** The current status. One of:
180
+
181
+ `waiting`: Messages are not yet ready to be sent. They are currently being filtered or processed in some way.
182
+ `sending`: Messages are currently being sent.
183
+ `succeeded`: Messages were sent successfully. This may not mean the messages were successfully received.
184
+ `failed`: Messages failed to be sent. Use the failedDescription property to find the cause of the failure. */
185
+ phase: string
186
+ /** The number of users who successfully received the message. */
187
+ successCount?: number
188
+ /** The number of users who failed to send the message. */
189
+ failureCount?: number
190
+ /** The number of intended recipients of the message. */
191
+ targetCount?: number
192
+ /** The reason the message failed to be sent. This is only included with a `phase` property value of `failed`. */
193
+ failedDescription?: string
194
+ /** Error summary. This is only included with a phase property value of failed.
195
+ One of:
196
+
197
+ `1`: An internal error occurred.
198
+ `2`: An error occurred because there weren't enough recipients.
199
+ `3`: A conflict error of requests occurs because a request that has already been accepted is retried. */
200
+ errorCode?: number
201
+ /** Narrowcast message request accepted time in milliseconds.
202
+
203
+ Format: ISO 8601 (e.g. 2020-12-03T10:15:30.121Z)
204
+ Timezone: UTC */
205
+ acceptedTime: string
206
+ /** Processing of narrowcast message request completion time in milliseconds. Returned when the phase property is succeeded or failed.
207
+
208
+ Format: ISO 8601 (e.g. 2020-12-03T10:15:30.121Z)
209
+ Timezone: UTC */
210
+ completedTime?: string
211
+ }
212
+ export type BroadcastRequest = {
213
+ /** List of Message objects. */
214
+ messages: Message[]
215
+ notificationDisabled?: NotificationDisabled
216
+ }
217
+ export type BroadcastResponse = {
218
+ }
219
+ export type MessageQuotaResponse = {
220
+ type: QuotaType
221
+ /** The target limit for sending messages in the current month. This property is returned when the `type` property has a value of `limited`. */
222
+ value?: number
223
+ }
224
+ /** One of the following values to indicate whether a target limit is set or not. */
225
+ export type QuotaType = string
226
+ export type QuotaConsumptionResponse = {
227
+ /** The number of sent messages in the current month */
228
+ totalUsage: number
229
+ }
230
+ export type NumberOfMessagesResponse = {
231
+ /** Aggregation process status. One of:
232
+
233
+ `ready`: The number of messages can be obtained.
234
+ `unready`: We haven't finished calculating the number of sent messages for the specified in date. For example, this property is returned when the delivery date or a future date is specified. Calculation usually takes about a day.
235
+ `unavailable_for_privacy`: The total number of messages on the specified day is less than 20.
236
+ `out_of_service`: The specified date is earlier than the date on which we first started calculating sent messages (March 31, 2018). */
237
+ status: string
238
+ /** The number of messages delivered using the phone number on the date specified in `date`.
239
+ The response has this property only when the value of `status` is `ready`. */
240
+ success?: number
241
+ }
242
+ export type ValidateMessageRequest = {
243
+ /** Array of message objects to validate */
244
+ messages: Message[]
245
+ }
246
+ export type GetAggregationUnitUsageResponse = {
247
+ /** Number of aggregation units used this month. */
248
+ numOfCustomAggregationUnits: number
249
+ }
250
+ export type GetAggregationUnitNameListResponse = {
251
+ /** An array of strings indicating the names of aggregation units used this month. */
252
+ customAggregationUnits: string[]
253
+ /** A continuation token to get the next array of unit names.
254
+ Returned only when there are remaining aggregation units that weren't returned in customAggregationUnits in the original request. */
255
+ next?: string
256
+ }
257
+ export type UserProfileResponse = {
258
+ /** User's display name */
259
+ displayName: string
260
+ /** User ID */
261
+ userId: string
262
+ /** Profile image URL. `https` image URL. Not included in the response if the user doesn't have a profile image. */
263
+ pictureUrl?: string
264
+ /** User's status message. Not included in the response if the user doesn't have a status message. */
265
+ statusMessage?: string
266
+ /** User's language, as a BCP 47 language tag. Not included in the response if the user hasn't yet consented to the LINE Privacy Policy. */
267
+ language?: string
268
+ }
269
+ export type GetFollowersResponse = {
270
+ /** An array of strings indicating user IDs of users that have added the LINE Official Account as a friend.
271
+ Only users of LINE for iOS and LINE for Android are included in `userIds`. */
272
+ userIds: string[]
273
+ /** A continuation token to get the next array of user IDs.
274
+ Returned only when there are remaining user IDs that weren't returned in `userIds` in the original request.
275
+ The number of user IDs in the `userIds` element doesn't have to reach the maximum number specified by `limit` for the `next` property to be included in the response. */
276
+ next?: string
277
+ }
278
+ export type BotInfoResponse = {
279
+ /** Bot's user ID */
280
+ userId: string
281
+ /** Bot's basic ID */
282
+ basicId: string
283
+ /** Bot's premium ID. Not included in the response if the premium ID isn't set. */
284
+ premiumId?: string
285
+ /** Bot's display name */
286
+ displayName: string
287
+ /** Profile image URL. `https` image URL. Not included in the response if the bot doesn't have a profile image. */
288
+ pictureUrl?: string
289
+ /** Chat settings set in the LINE Official Account Manager. One of:
290
+
291
+ `chat`: Chat is set to "On".
292
+ `bot`: Chat is set to "Off". */
293
+ chatMode: string
294
+ /** Automatic read setting for messages. If the chat is set to "Off", auto is returned. If the chat is set to "On", manual is returned.
295
+
296
+ `auto`: Auto read setting is enabled.
297
+ `manual`: Auto read setting is disabled. */
298
+ markAsReadMode: string
299
+ }
300
+ export type GroupUserProfileResponse = {
301
+ /** User's display name */
302
+ displayName: string
303
+ /** User ID */
304
+ userId: string
305
+ /** Profile image URL. `https` image URL. Not included in the response if the user doesn't have a profile image. */
306
+ pictureUrl?: string
307
+ }
308
+ export type RoomUserProfileResponse = {
309
+ /** User's display name */
310
+ displayName: string
311
+ /** User ID */
312
+ userId: string
313
+ /** Profile image URL. `https` image URL. Not included in the response if the user doesn't have a profile image. */
314
+ pictureUrl?: string
315
+ }
316
+ export type MembersIdsResponse = {
317
+ /** List of user IDs of members in the group chat. Only users of LINE for iOS and LINE for Android are included in `memberIds`. */
318
+ memberIds: string[]
319
+ /** A continuation token to get the next array of user IDs of the members in the group chat.
320
+ Returned only when there are remaining user IDs that were not returned in `memberIds` in the original request. */
321
+ next?: string
322
+ }
323
+ export type GroupSummaryResponse = {
324
+ /** Group ID */
325
+ groupId: string
326
+ /** Group name */
327
+ groupName: string
328
+ /** Group icon URL. Not included in the response if the user doesn't set a group profile icon. */
329
+ pictureUrl?: string
330
+ }
331
+ export type GroupMemberCountResponse = {
332
+ /** The count of members in the group chat. The number returned excludes the LINE Official Account. */
333
+ count: number
334
+ }
335
+ export type RoomMemberCountResponse = {
336
+ /** The count of members in the multi-person chat. The number returned excludes the LINE Official Account. */
337
+ count: number
338
+ }
339
+ export type RichMenuRequest = {
340
+ size?: RichMenuSize
341
+ /** `true` to display the rich menu by default. Otherwise, `false`. */
342
+ selected?: boolean
343
+ /** Name of the rich menu. This value can be used to help manage your rich menus and is not displayed to users. */
344
+ name?: string
345
+ /** Text displayed in the chat bar */
346
+ chatBarText?: string
347
+ /** Array of area objects which define the coordinates and size of tappable areas */
348
+ areas?: RichMenuArea[]
349
+ }
350
+ /** Rich menu size */
351
+ export type RichMenuSize = {
352
+ /** width */
353
+ width?: number
354
+ /** height */
355
+ height?: number
356
+ }
357
+ /** Rich menu area */
358
+ export type RichMenuArea = {
359
+ bounds?: RichMenuBounds
360
+ action?: Action
361
+ }
362
+ /** Rich menu bounds */
363
+ export type RichMenuBounds = {
364
+ /** Horizontal position relative to the top-left corner of the area. */
365
+ x?: number
366
+ /** Vertical position relative to the top-left corner of the area. */
367
+ y?: number
368
+ /** Width of the area. */
369
+ width?: number
370
+ /** Height of the area. */
371
+ height?: number
372
+ }
373
+ export type RichMenuIdResponse = {
374
+ /** Rich menu ID */
375
+ richMenuId: string
376
+ }
377
+ export type RichMenuResponse = {
378
+ /** ID of a rich menu */
379
+ richMenuId: string
380
+ size: RichMenuSize
381
+ /** `true` to display the rich menu by default. Otherwise, `false`. */
382
+ selected: boolean
383
+ /** Name of the rich menu. This value can be used to help manage your rich menus and is not displayed to users. */
384
+ name: string
385
+ /** Text displayed in the chat bar */
386
+ chatBarText: string
387
+ /** Array of area objects which define the coordinates and size of tappable areas */
388
+ areas: RichMenuArea[]
389
+ }
390
+ export type RichMenuListResponse = {
391
+ /** Rich menus */
392
+ richmenus: RichMenuResponse[]
393
+ }
394
+ export type CreateRichMenuAliasRequest = {
395
+ /** Rich menu alias ID, which can be any ID, unique for each channel. */
396
+ richMenuAliasId: string
397
+ /** The rich menu ID to be associated with the rich menu alias. */
398
+ richMenuId: string
399
+ }
400
+ export type RichMenuAliasResponse = {
401
+ /** Rich menu alias ID. */
402
+ richMenuAliasId: string
403
+ /** The rich menu ID associated with the rich menu alias. */
404
+ richMenuId: string
405
+ }
406
+ export type UpdateRichMenuAliasRequest = {
407
+ /** The rich menu ID to be associated with the rich menu alias. */
408
+ richMenuId: string
409
+ }
410
+ export type RichMenuAliasListResponse = {
411
+ /** Rich menu aliases. */
412
+ aliases: RichMenuAliasResponse[]
413
+ }
414
+ export type RichMenuBulkLinkRequest = {
415
+ /** ID of a rich menu */
416
+ richMenuId: string
417
+ /** Array of user IDs. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. */
418
+ userIds: string[]
419
+ }
420
+ export type RichMenuBulkUnlinkRequest = {
421
+ /** Array of user IDs. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. */
422
+ userIds: string[]
423
+ }
424
+ export type RichMenuBatchRequest = {
425
+ /** Array of Rich menu operation object... */
426
+ operations: RichMenuBatchOperation[]
427
+ /** Key for retry. Key value is a string matching the regular expression pattern */
428
+ resumeRequestKey?: string
429
+ }
430
+ /** Rich menu operation object represents the batch operation to the rich menu linked to the user. */
431
+ export type BaseRichMenuBatchOperation = {
432
+ /** The type of operation to the rich menu linked to the user. One of link, unlink, or unlinkAll. */
433
+ type: string
434
+ }
435
+ export type RichMenuBatchOperation = RichMenuBatchLinkOperation | RichMenuBatchUnlinkOperation | RichMenuBatchUnlinkAllOperation
436
+ /** Replace the rich menu with the rich menu specified in the `to` property for all users linked to the rich menu specified in the `from` property. */
437
+ export type RichMenuBatchLinkOperation = (BaseRichMenuBatchOperation & {
438
+ type: 'link'
439
+ } & ({
440
+ from?: string
441
+ to?: string
442
+ }))
443
+ /** Unlink the rich menu for all users linked to the rich menu specified in the `from` property. */
444
+ export type RichMenuBatchUnlinkOperation = (BaseRichMenuBatchOperation & {
445
+ type: 'unlink'
446
+ } & ({
447
+ from?: string
448
+ }))
449
+ /** Unlink the rich menu from all users linked to the rich menu. */
450
+ export type RichMenuBatchUnlinkAllOperation = (BaseRichMenuBatchOperation & {
451
+ type: 'unlinkAll'
452
+ })
453
+ export type RichMenuBatchProgressResponse = {
454
+ phase: RichMenuBatchProgressPhase
455
+ /** The accepted time in milliseconds of the request of batch control the rich menu.
456
+
457
+ Format: ISO 8601 (e.g. 2023-06-08T10:15:30.121Z)
458
+ Timezone: UTC */
459
+ acceptedTime: string
460
+ /** The completed time in milliseconds of rich menu batch control. Returned when the phase property is succeeded or failed.
461
+
462
+ Format: ISO 8601 (e.g. 2023-06-08T10:15:30.121Z)
463
+ Timezone: UTC */
464
+ completedTime?: string
465
+ }
466
+ /** The current status. One of:
467
+
468
+ `ongoing`: Rich menu batch control is in progress.
469
+ `succeeded`: Rich menu batch control is complete.
470
+ `failed`: Rich menu batch control failed.
471
+ This means that the rich menu for one or more users couldn't be controlled.
472
+ There may also be users whose operations have been successfully completed. */
473
+ export type RichMenuBatchProgressPhase = string
474
+ export type IssueLinkTokenResponse = {
475
+ /** Link token.
476
+ Link tokens are valid for 10 minutes and can only be used once. */
477
+ linkToken: string
478
+ }
479
+ export type MarkMessagesAsReadRequest = {
480
+ chat: ChatReference
481
+ }
482
+ /** Chat reference */
483
+ export type ChatReference = {
484
+ /** The target user ID */
485
+ userId: string
486
+ }
487
+ export type PnpMessagesRequest = {
488
+ /** Message to be sent. */
489
+ messages: Message[]
490
+ /** Message destination. Specify a phone number that has been normalized to E.164 format and hashed with SHA256. */
491
+ to: string
492
+ notificationDisabled?: NotificationDisabled
493
+ }
494
+ export type AudienceMatchMessagesRequest = {
495
+ /** Destination of the message (A value obtained by hashing the telephone number, which is another value normalized to E.164 format, with SHA256). */
496
+ messages: Message[]
497
+ /** Message to send. */
498
+ to: string[]
499
+ notificationDisabled?: NotificationDisabled
500
+ }
501
+ export type BaseMessage = {
502
+ /** Type of message */
503
+ type: string
504
+ quickReply?: QuickReply
505
+ sender?: Sender
506
+ }
507
+ export type Message = TextMessage | StickerMessage | ImageMessage | VideoMessage | AudioMessage | LocationMessage | ImagemapMessage | TemplateMessage | FlexMessage
508
+ /** Quick reply */
509
+ export type QuickReply = {
510
+ /** Quick reply button objects. */
511
+ items?: QuickReplyItem[]
512
+ }
513
+ export type QuickReplyItem = {
514
+ /** URL of the icon that is displayed at the beginning of the button */
515
+ imageUrl?: string
516
+ action?: Action
517
+ /** `action` */
518
+ type?: string
519
+ }
520
+ /** Change icon and display name */
521
+ export type Sender = {
522
+ /** Display name. Certain words such as `LINE` may not be used. */
523
+ name?: string
524
+ /** URL of the image to display as an icon when sending a message */
525
+ iconUrl?: string
526
+ }
527
+ export type TextMessage = (BaseMessage & {
528
+ type: 'text'
529
+ } & ({
530
+ text?: string
531
+ emojis?: Emoji[]
532
+ quoteToken?: string
533
+ }))
534
+ export type Emoji = {
535
+ index?: number
536
+ productId?: string
537
+ emojiId?: string
538
+ }
539
+ export type StickerMessage = (BaseMessage & {
540
+ type: 'sticker'
541
+ } & ({
542
+ packageId?: string
543
+ stickerId?: string
544
+ quoteToken?: string
545
+ }))
546
+ export type ImageMessage = (BaseMessage & {
547
+ type: 'image'
548
+ } & ({
549
+ originalContentUrl?: string
550
+ previewImageUrl?: string
551
+ }))
552
+ export type VideoMessage = (BaseMessage & {
553
+ type: 'video'
554
+ } & ({
555
+ originalContentUrl?: string
556
+ previewImageUrl?: string
557
+ trackingId?: string
558
+ }))
559
+ export type AudioMessage = (BaseMessage & {
560
+ type: 'audio'
561
+ } & ({
562
+ originalContentUrl?: string
563
+ duration?: number
564
+ }))
565
+ export type LocationMessage = (BaseMessage & {
566
+ type: 'location'
567
+ } & ({
568
+ title?: string
569
+ address?: string
570
+ latitude?: unknown
571
+ longitude?: unknown
572
+ }))
573
+ export type ImagemapMessage = (BaseMessage & {
574
+ type: 'imagemap'
575
+ } & ({
576
+ baseUrl?: string
577
+ altText?: string
578
+ baseSize?: ImagemapBaseSize
579
+ actions?: ImagemapAction[]
580
+ video?: ImagemapVideo
581
+ }))
582
+ export type ImagemapBaseSize = {
583
+ height?: number
584
+ width?: number
585
+ }
586
+ export type BaseImagemapAction = {
587
+ type: string
588
+ area?: ImagemapArea
589
+ }
590
+ export type ImagemapAction = MessageImagemapAction | URIImagemapAction
591
+ export type MessageImagemapAction = (BaseImagemapAction & {
592
+ type: 'message'
593
+ } & ({
594
+ text?: string
595
+ label?: string
596
+ }))
597
+ export type URIImagemapAction = (BaseImagemapAction & {
598
+ type: 'uri'
599
+ } & ({
600
+ linkUri?: string
601
+ label?: string
602
+ }))
603
+ export type ImagemapArea = {
604
+ x?: number
605
+ y?: number
606
+ width?: number
607
+ height?: number
608
+ }
609
+ export type ImagemapVideo = {
610
+ originalContentUrl?: string
611
+ previewImageUrl?: string
612
+ area?: ImagemapArea
613
+ externalLink?: ImagemapExternalLink
614
+ }
615
+ export type ImagemapExternalLink = {
616
+ linkUri?: string
617
+ label?: string
618
+ }
619
+ export type TemplateMessage = (BaseMessage & {
620
+ type: 'template'
621
+ } & ({
622
+ altText?: string
623
+ template?: Template
624
+ }))
625
+ export type BaseTemplate = {
626
+ type: string
627
+ }
628
+ export type Template = ButtonsTemplate | ConfirmTemplate | CarouselTemplate | ImageCarouselTemplate
629
+ export type ButtonsTemplate = (BaseTemplate & {
630
+ type: 'buttons'
631
+ } & ({
632
+ thumbnailImageUrl?: string
633
+ imageAspectRatio?: string
634
+ imageSize?: string
635
+ imageBackgroundColor?: string
636
+ title?: string
637
+ text?: string
638
+ defaultAction?: Action
639
+ actions?: Action[]
640
+ }))
641
+ export type ConfirmTemplate = (BaseTemplate & {
642
+ type: 'confirm'
643
+ } & ({
644
+ text?: string
645
+ actions?: Action[]
646
+ }))
647
+ export type CarouselTemplate = (BaseTemplate & {
648
+ type: 'carousel'
649
+ } & ({
650
+ columns?: CarouselColumn[]
651
+ imageAspectRatio?: string
652
+ imageSize?: string
653
+ }))
654
+ /** Column object for carousel template. */
655
+ export type CarouselColumn = {
656
+ thumbnailImageUrl?: string
657
+ imageBackgroundColor?: string
658
+ title?: string
659
+ text?: string
660
+ defaultAction?: Action
661
+ actions?: Action[]
662
+ }
663
+ export type ImageCarouselTemplate = (BaseTemplate & {
664
+ type: 'image_carousel'
665
+ } & ({
666
+ columns?: ImageCarouselColumn[]
667
+ }))
668
+ export type ImageCarouselColumn = {
669
+ imageUrl?: string
670
+ action?: Action
671
+ }
672
+ export type FlexMessage = (BaseMessage & {
673
+ type: 'flex'
674
+ } & ({
675
+ altText?: string
676
+ contents?: FlexContainer
677
+ }))
678
+ export type BaseFlexContainer = {
679
+ type: string
680
+ }
681
+ export type FlexContainer = FlexBubble | FlexCarousel
682
+ export type FlexBubble = (BaseFlexContainer & {
683
+ type: 'bubble'
684
+ } & ({
685
+ direction?: string
686
+ styles?: FlexBubbleStyles
687
+ header?: FlexBox
688
+ hero?: FlexComponent
689
+ body?: FlexBox
690
+ footer?: FlexBox
691
+ size?: string
692
+ action?: Action
693
+ }))
694
+ export type FlexCarousel = (BaseFlexContainer & {
695
+ type: 'carousel'
696
+ } & ({
697
+ contents?: FlexBubble[]
698
+ }))
699
+ export type FlexBubbleStyles = {
700
+ header?: FlexBlockStyle
701
+ hero?: FlexBlockStyle
702
+ body?: FlexBlockStyle
703
+ footer?: FlexBlockStyle
704
+ }
705
+ export type FlexBlockStyle = {
706
+ backgroundColor?: string
707
+ separator?: boolean
708
+ separatorColor?: string
709
+ }
710
+ export type BaseFlexComponent = {
711
+ type: string
712
+ }
713
+ export type FlexComponent = FlexBox | FlexButton | FlexImage | FlexVideo | FlexIcon | FlexText | FlexSpan | FlexSeparator | FlexFiller
714
+ export type FlexBox = (BaseFlexComponent & {
715
+ type: 'box'
716
+ } & ({
717
+ layout?: string
718
+ flex?: number
719
+ contents?: FlexComponent[]
720
+ spacing?: string
721
+ margin?: string
722
+ position?: string
723
+ offsetTop?: string
724
+ offsetBottom?: string
725
+ offsetStart?: string
726
+ offsetEnd?: string
727
+ backgroundColor?: string
728
+ borderColor?: string
729
+ borderWidth?: string
730
+ cornerRadius?: string
731
+ width?: string
732
+ maxWidth?: string
733
+ height?: string
734
+ maxHeight?: string
735
+ paddingAll?: string
736
+ paddingTop?: string
737
+ paddingBottom?: string
738
+ paddingStart?: string
739
+ paddingEnd?: string
740
+ action?: Action
741
+ justifyContent?: string
742
+ alignItems?: string
743
+ background?: FlexBoxBackground
744
+ }))
745
+ export type FlexButton = (BaseFlexComponent & {
746
+ type: 'button'
747
+ } & ({
748
+ flex?: number
749
+ color?: string
750
+ style?: string
751
+ action?: Action
752
+ gravity?: string
753
+ margin?: string
754
+ position?: string
755
+ offsetTop?: string
756
+ offsetBottom?: string
757
+ offsetStart?: string
758
+ offsetEnd?: string
759
+ height?: string
760
+ adjustMode?: string
761
+ scaling?: boolean
762
+ }))
763
+ export type FlexImage = (BaseFlexComponent & {
764
+ type: 'image'
765
+ } & ({
766
+ url?: string
767
+ flex?: number
768
+ margin?: string
769
+ position?: string
770
+ offsetTop?: string
771
+ offsetBottom?: string
772
+ offsetStart?: string
773
+ offsetEnd?: string
774
+ align?: string
775
+ gravity?: string
776
+ size?: string
777
+ aspectRatio?: string
778
+ aspectMode?: string
779
+ backgroundColor?: string
780
+ action?: Action
781
+ animated?: boolean
782
+ }))
783
+ export type FlexVideo = (BaseFlexComponent & {
784
+ type: 'video'
785
+ } & ({
786
+ url?: string
787
+ previewUrl?: string
788
+ altContent?: FlexComponent
789
+ aspectRatio?: string
790
+ action?: Action
791
+ }))
792
+ export type FlexIcon = (BaseFlexComponent & {
793
+ type: 'icon'
794
+ } & ({
795
+ url?: string
796
+ size?: string
797
+ aspectRatio?: string
798
+ margin?: string
799
+ position?: string
800
+ offsetTop?: string
801
+ offsetBottom?: string
802
+ offsetStart?: string
803
+ offsetEnd?: string
804
+ scaling?: boolean
805
+ }))
806
+ export type FlexText = (BaseFlexComponent & {
807
+ type: 'text'
808
+ } & ({
809
+ flex?: number
810
+ text?: string
811
+ size?: string
812
+ align?: string
813
+ gravity?: string
814
+ color?: string
815
+ weight?: string
816
+ style?: string
817
+ decoration?: string
818
+ wrap?: boolean
819
+ lineSpacing?: string
820
+ margin?: string
821
+ position?: string
822
+ offsetTop?: string
823
+ offsetBottom?: string
824
+ offsetStart?: string
825
+ offsetEnd?: string
826
+ action?: Action
827
+ maxLines?: number
828
+ contents?: FlexSpan[]
829
+ adjustMode?: string
830
+ scaling?: boolean
831
+ }))
832
+ export type FlexSpan = (BaseFlexComponent & {
833
+ type: 'span'
834
+ } & ({
835
+ text?: string
836
+ size?: string
837
+ color?: string
838
+ weight?: string
839
+ style?: string
840
+ decoration?: string
841
+ }))
842
+ export type FlexSeparator = (BaseFlexComponent & {
843
+ type: 'separator'
844
+ } & ({
845
+ margin?: string
846
+ color?: string
847
+ }))
848
+ export type FlexFiller = (BaseFlexComponent & {
849
+ type: 'filler'
850
+ } & ({
851
+ flex?: number
852
+ }))
853
+ export type BaseFlexBoxBackground = {
854
+ type: string
855
+ }
856
+ export type FlexBoxBackground = FlexBoxLinearGradient
857
+ export type FlexBoxLinearGradient = (BaseFlexBoxBackground & {
858
+ type: 'linearGradient'
859
+ } & ({
860
+ angle?: string
861
+ startColor?: string
862
+ endColor?: string
863
+ centerColor?: string
864
+ centerPosition?: string
865
+ }))
866
+ /** Action */
867
+ export type BaseAction = {
868
+ /** Type of action */
869
+ type?: string
870
+ /** Label for the action. */
871
+ label?: string
872
+ }
873
+ export type Action = CameraAction | CameraRollAction | DatetimePickerAction | LocationAction | MessageAction | PostbackAction | RichMenuSwitchAction | URIAction
874
+ export type CameraAction = (BaseAction & {
875
+ type: 'camera'
876
+ })
877
+ export type CameraRollAction = (BaseAction & {
878
+ type: 'cameraRoll'
879
+ })
880
+ export type DatetimePickerAction = (BaseAction & {
881
+ type: 'datetimepicker'
882
+ } & ({
883
+ data?: string
884
+ mode?: string
885
+ initial?: string
886
+ max?: string
887
+ min?: string
888
+ }))
889
+ export type LocationAction = (BaseAction & {
890
+ type: 'location'
891
+ })
892
+ export type MessageAction = (BaseAction & {
893
+ type: 'message'
894
+ } & ({
895
+ text?: string
896
+ }))
897
+ export type PostbackAction = (BaseAction & {
898
+ type: 'postback'
899
+ } & ({
900
+ data?: string
901
+ displayText?: string
902
+ text?: string
903
+ inputOption?: string
904
+ fillInText?: string
905
+ }))
906
+ export type RichMenuSwitchAction = (BaseAction & {
907
+ type: 'richmenuswitch'
908
+ } & ({
909
+ data?: string
910
+ richMenuAliasId?: string
911
+ }))
912
+ export type URIAction = (BaseAction & {
913
+ type: 'uri'
914
+ } & ({
915
+ uri?: string
916
+ altUri?: AltUri
917
+ }))
918
+ export type AltUri = {
919
+ desktop?: string
920
+ }
921
+ export type ErrorResponse = {
922
+ /** Message containing information about the error. */
923
+ message: string
924
+ /** An array of error details. If the array is empty, this property will not be included in the response. */
925
+ details?: ErrorDetail[]
926
+ /** Array of sent messages. */
927
+ sentMessages?: SentMessage[]
928
+ }
929
+ export type ErrorDetail = {
930
+ /** Details of the error. Not included in the response under certain situations. */
931
+ message?: string
932
+ /** Location of where the error occurred. Returns the JSON field name or query parameter name of the request. Not included in the response under certain situations. */
933
+ property?: string
934
+ }
935
+ export interface GetNarrowcastProgressQuery {
936
+ /** The narrowcast message's request ID. Each Messaging API request has a request ID. */
937
+ requestId: string
938
+ }
939
+ export interface GetNumberOfSentReplyMessagesQuery {
940
+ /** Date the messages were sent
941
+
942
+ Format: `yyyyMMdd` (e.g. `20191231`)
943
+ Timezone: UTC+9 */
944
+ date: string
945
+ }
946
+ export interface GetNumberOfSentPushMessagesQuery {
947
+ /** Date the messages were sent
948
+
949
+ Format: `yyyyMMdd` (e.g. `20191231`)
950
+ Timezone: UTC+9 */
951
+ date: string
952
+ }
953
+ export interface GetNumberOfSentMulticastMessagesQuery {
954
+ /** Date the messages were sent
955
+
956
+ Format: `yyyyMMdd` (e.g. `20191231`)
957
+ Timezone: UTC+9 */
958
+ date: string
959
+ }
960
+ export interface GetNumberOfSentBroadcastMessagesQuery {
961
+ /** Date the messages were sent
962
+
963
+ Format: yyyyMMdd (e.g. 20191231)
964
+ Timezone: UTC+9 */
965
+ date: string
966
+ }
967
+ export interface GetAggregationUnitNameListQuery {
968
+ /** The maximum number of aggregation units you can get per request. */
969
+ limit?: string
970
+ /** Value of the continuation token found in the next property of the JSON object returned in the response.
971
+ If you can't get all the aggregation units in one request, include this parameter to get the remaining array. */
972
+ start?: string
973
+ }
974
+ export interface GetFollowersQuery {
975
+ /** Value of the continuation token found in the next property of the JSON object returned in the response.
976
+ Include this parameter to get the next array of user IDs. */
977
+ start?: string
978
+ /** The maximum number of user IDs to retrieve in a single request. */
979
+ limit?: number
980
+ }
981
+ export interface GetGroupMembersIdsQuery {
982
+ /** Value of the continuation token found in the `next` property of the JSON object returned in the response.
983
+ Include this parameter to get the next array of user IDs for the members of the group. */
984
+ start?: string
985
+ }
986
+ export interface GetRoomMembersIdsQuery {
987
+ /** Value of the continuation token found in the `next` property of the JSON object returned in the response.
988
+ Include this parameter to get the next array of user IDs for the members of the group. */
989
+ start?: string
990
+ }
991
+ export interface GetRichMenuBatchProgressQuery {
992
+ /** A request ID used to batch control the rich menu linked to the user. Each Messaging API request has a request ID. */
993
+ requestId: string
994
+ }
995
+ export interface GetPNPMessageStatisticsQuery {
996
+ /** Date the message was sent
997
+
998
+ Format: `yyyyMMdd` (Example:`20211231`)
999
+ Time zone: UTC+9 */
1000
+ date: string
1001
+ }
1002
+ export interface GetAdPhoneMessageStatisticsQuery {
1003
+ /** Date the message was sent
1004
+
1005
+ Format: `yyyyMMdd` (e.g. `20190831`)
1006
+ Time Zone: UTC+9 */
1007
+ date: string
1008
+ }