@kodelyth/line 2026.5.42 → 2026.6.1

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 (90) hide show
  1. package/klaw.plugin.json +329 -2
  2. package/package.json +16 -4
  3. package/api.ts +0 -11
  4. package/channel-plugin-api.ts +0 -1
  5. package/contract-api.ts +0 -5
  6. package/index.ts +0 -53
  7. package/runtime-api.ts +0 -179
  8. package/secret-contract-api.ts +0 -4
  9. package/setup-api.ts +0 -2
  10. package/setup-entry.ts +0 -9
  11. package/src/account-helpers.ts +0 -16
  12. package/src/accounts.test.ts +0 -288
  13. package/src/accounts.ts +0 -187
  14. package/src/actions.ts +0 -61
  15. package/src/auto-reply-delivery.test.ts +0 -253
  16. package/src/auto-reply-delivery.ts +0 -200
  17. package/src/bindings.ts +0 -65
  18. package/src/bot-access.ts +0 -30
  19. package/src/bot-handlers.test.ts +0 -1094
  20. package/src/bot-handlers.ts +0 -620
  21. package/src/bot-message-context.test.ts +0 -420
  22. package/src/bot-message-context.ts +0 -586
  23. package/src/bot.ts +0 -66
  24. package/src/card-command.ts +0 -347
  25. package/src/channel-access-token.ts +0 -14
  26. package/src/channel-api.ts +0 -17
  27. package/src/channel-setup-status.contract.test.ts +0 -70
  28. package/src/channel-shared.ts +0 -48
  29. package/src/channel.logout.test.ts +0 -145
  30. package/src/channel.runtime.ts +0 -3
  31. package/src/channel.sendPayload.test.ts +0 -659
  32. package/src/channel.setup.ts +0 -11
  33. package/src/channel.status.test.ts +0 -63
  34. package/src/channel.ts +0 -155
  35. package/src/config-adapter.ts +0 -29
  36. package/src/config-schema.test.ts +0 -53
  37. package/src/config-schema.ts +0 -81
  38. package/src/download.test.ts +0 -164
  39. package/src/download.ts +0 -34
  40. package/src/flex-templates/basic-cards.ts +0 -395
  41. package/src/flex-templates/common.ts +0 -20
  42. package/src/flex-templates/media-control-cards.ts +0 -555
  43. package/src/flex-templates/message.ts +0 -13
  44. package/src/flex-templates/schedule-cards.ts +0 -467
  45. package/src/flex-templates/types.ts +0 -22
  46. package/src/flex-templates.ts +0 -32
  47. package/src/gateway.ts +0 -129
  48. package/src/group-keys.test.ts +0 -123
  49. package/src/group-keys.ts +0 -65
  50. package/src/group-policy.ts +0 -22
  51. package/src/markdown-to-line.test.ts +0 -348
  52. package/src/markdown-to-line.ts +0 -416
  53. package/src/message-cards.test.ts +0 -204
  54. package/src/monitor-durable.test.ts +0 -57
  55. package/src/monitor-durable.ts +0 -37
  56. package/src/monitor.lifecycle.test.ts +0 -499
  57. package/src/monitor.runtime.ts +0 -1
  58. package/src/monitor.ts +0 -507
  59. package/src/outbound-media.test.ts +0 -194
  60. package/src/outbound-media.ts +0 -120
  61. package/src/outbound.runtime.ts +0 -12
  62. package/src/outbound.ts +0 -427
  63. package/src/probe.contract.test.ts +0 -9
  64. package/src/probe.runtime.ts +0 -1
  65. package/src/probe.ts +0 -34
  66. package/src/quick-reply-fallback.ts +0 -10
  67. package/src/reply-chunks.test.ts +0 -180
  68. package/src/reply-chunks.ts +0 -110
  69. package/src/reply-payload-transform.test.ts +0 -392
  70. package/src/reply-payload-transform.ts +0 -317
  71. package/src/rich-menu.test.ts +0 -315
  72. package/src/rich-menu.ts +0 -326
  73. package/src/runtime.ts +0 -32
  74. package/src/send-receipt.ts +0 -32
  75. package/src/send.test.ts +0 -453
  76. package/src/send.ts +0 -531
  77. package/src/setup-core.ts +0 -149
  78. package/src/setup-runtime-api.ts +0 -9
  79. package/src/setup-surface.test.ts +0 -481
  80. package/src/setup-surface.ts +0 -229
  81. package/src/signature.test.ts +0 -34
  82. package/src/signature.ts +0 -24
  83. package/src/status.ts +0 -37
  84. package/src/template-messages.ts +0 -333
  85. package/src/types.ts +0 -130
  86. package/src/webhook-node.test.ts +0 -598
  87. package/src/webhook-node.ts +0 -155
  88. package/src/webhook-utils.ts +0 -10
  89. package/src/webhook.ts +0 -135
  90. package/tsconfig.json +0 -16
@@ -1,395 +0,0 @@
1
- import { attachFooterText } from "./common.js";
2
- import type {
3
- Action,
4
- CardAction,
5
- FlexBox,
6
- FlexBubble,
7
- FlexButton,
8
- FlexCarousel,
9
- FlexComponent,
10
- FlexImage,
11
- FlexText,
12
- ListItem,
13
- } from "./types.js";
14
-
15
- /**
16
- * Create an info card with title, body, and optional footer
17
- *
18
- * Editorial design: Clean hierarchy with accent bar, generous spacing,
19
- * and subtle background zones for visual separation.
20
- */
21
- export function createInfoCard(title: string, body: string, footer?: string): FlexBubble {
22
- const bubble: FlexBubble = {
23
- type: "bubble",
24
- size: "mega",
25
- body: {
26
- type: "box",
27
- layout: "vertical",
28
- contents: [
29
- // Title with accent bar
30
- {
31
- type: "box",
32
- layout: "horizontal",
33
- contents: [
34
- {
35
- type: "box",
36
- layout: "vertical",
37
- contents: [],
38
- width: "4px",
39
- backgroundColor: "#06C755",
40
- cornerRadius: "2px",
41
- } as FlexBox,
42
- {
43
- type: "text",
44
- text: title,
45
- weight: "bold",
46
- size: "xl",
47
- color: "#111111",
48
- wrap: true,
49
- flex: 1,
50
- margin: "lg",
51
- } as FlexText,
52
- ],
53
- } as FlexBox,
54
- // Body text in subtle container
55
- {
56
- type: "box",
57
- layout: "vertical",
58
- contents: [
59
- {
60
- type: "text",
61
- text: body,
62
- size: "md",
63
- color: "#444444",
64
- wrap: true,
65
- lineSpacing: "6px",
66
- } as FlexText,
67
- ],
68
- margin: "xl",
69
- paddingAll: "lg",
70
- backgroundColor: "#F8F9FA",
71
- cornerRadius: "lg",
72
- } as FlexBox,
73
- ],
74
- paddingAll: "xl",
75
- backgroundColor: "#FFFFFF",
76
- },
77
- };
78
-
79
- if (footer) {
80
- attachFooterText(bubble, footer);
81
- }
82
-
83
- return bubble;
84
- }
85
-
86
- /**
87
- * Create a list card with title and multiple items
88
- *
89
- * Editorial design: Numbered/bulleted list with clear visual hierarchy,
90
- * accent dots for each item, and generous spacing.
91
- */
92
- export function createListCard(title: string, items: ListItem[]): FlexBubble {
93
- const itemContents: FlexComponent[] = items.slice(0, 8).map((item, index) => {
94
- const itemContents: FlexComponent[] = [
95
- {
96
- type: "text",
97
- text: item.title,
98
- size: "md",
99
- weight: "bold",
100
- color: "#1a1a1a",
101
- wrap: true,
102
- } as FlexText,
103
- ];
104
-
105
- if (item.subtitle) {
106
- itemContents.push({
107
- type: "text",
108
- text: item.subtitle,
109
- size: "sm",
110
- color: "#888888",
111
- wrap: true,
112
- margin: "xs",
113
- } as FlexText);
114
- }
115
-
116
- const itemBox: FlexBox = {
117
- type: "box",
118
- layout: "horizontal",
119
- contents: [
120
- // Accent dot
121
- {
122
- type: "box",
123
- layout: "vertical",
124
- contents: [
125
- {
126
- type: "box",
127
- layout: "vertical",
128
- contents: [],
129
- width: "8px",
130
- height: "8px",
131
- backgroundColor: index === 0 ? "#06C755" : "#DDDDDD",
132
- cornerRadius: "4px",
133
- } as FlexBox,
134
- ],
135
- width: "20px",
136
- alignItems: "center",
137
- paddingTop: "sm",
138
- } as FlexBox,
139
- // Item content
140
- {
141
- type: "box",
142
- layout: "vertical",
143
- contents: itemContents,
144
- flex: 1,
145
- } as FlexBox,
146
- ],
147
- margin: index > 0 ? "lg" : undefined,
148
- };
149
-
150
- if (item.action) {
151
- itemBox.action = item.action;
152
- }
153
-
154
- return itemBox;
155
- });
156
-
157
- return {
158
- type: "bubble",
159
- size: "mega",
160
- body: {
161
- type: "box",
162
- layout: "vertical",
163
- contents: [
164
- {
165
- type: "text",
166
- text: title,
167
- weight: "bold",
168
- size: "xl",
169
- color: "#111111",
170
- wrap: true,
171
- } as FlexText,
172
- {
173
- type: "separator",
174
- margin: "lg",
175
- color: "#EEEEEE",
176
- },
177
- {
178
- type: "box",
179
- layout: "vertical",
180
- contents: itemContents,
181
- margin: "lg",
182
- } as FlexBox,
183
- ],
184
- paddingAll: "xl",
185
- backgroundColor: "#FFFFFF",
186
- },
187
- };
188
- }
189
-
190
- /**
191
- * Create an image card with image, title, and optional body text
192
- */
193
- export function createImageCard(
194
- imageUrl: string,
195
- title: string,
196
- body?: string,
197
- options?: {
198
- aspectRatio?: "1:1" | "1.51:1" | "1.91:1" | "4:3" | "16:9" | "20:13" | "2:1" | "3:1";
199
- aspectMode?: "cover" | "fit";
200
- action?: Action;
201
- },
202
- ): FlexBubble {
203
- const bubble: FlexBubble = {
204
- type: "bubble",
205
- hero: {
206
- type: "image",
207
- url: imageUrl,
208
- size: "full",
209
- aspectRatio: options?.aspectRatio ?? "20:13",
210
- aspectMode: options?.aspectMode ?? "cover",
211
- action: options?.action,
212
- } as FlexImage,
213
- body: {
214
- type: "box",
215
- layout: "vertical",
216
- contents: [
217
- {
218
- type: "text",
219
- text: title,
220
- weight: "bold",
221
- size: "xl",
222
- wrap: true,
223
- } as FlexText,
224
- ],
225
- paddingAll: "lg",
226
- },
227
- };
228
-
229
- if (body && bubble.body) {
230
- bubble.body.contents.push({
231
- type: "text",
232
- text: body,
233
- size: "md",
234
- wrap: true,
235
- margin: "md",
236
- color: "#666666",
237
- } as FlexText);
238
- }
239
-
240
- return bubble;
241
- }
242
-
243
- /**
244
- * Create an action card with title, body, and action buttons
245
- */
246
- export function createActionCard(
247
- title: string,
248
- body: string,
249
- actions: CardAction[],
250
- options?: {
251
- imageUrl?: string;
252
- aspectRatio?: "1:1" | "1.51:1" | "1.91:1" | "4:3" | "16:9" | "20:13" | "2:1" | "3:1";
253
- },
254
- ): FlexBubble {
255
- const bubble: FlexBubble = {
256
- type: "bubble",
257
- body: {
258
- type: "box",
259
- layout: "vertical",
260
- contents: [
261
- {
262
- type: "text",
263
- text: title,
264
- weight: "bold",
265
- size: "xl",
266
- wrap: true,
267
- } as FlexText,
268
- {
269
- type: "text",
270
- text: body,
271
- size: "md",
272
- wrap: true,
273
- margin: "md",
274
- color: "#666666",
275
- } as FlexText,
276
- ],
277
- paddingAll: "lg",
278
- },
279
- footer: {
280
- type: "box",
281
- layout: "vertical",
282
- contents: actions.slice(0, 4).map(
283
- (action, index) =>
284
- ({
285
- type: "button",
286
- action: action.action,
287
- style: index === 0 ? "primary" : "secondary",
288
- margin: index > 0 ? "sm" : undefined,
289
- }) as FlexButton,
290
- ),
291
- paddingAll: "md",
292
- },
293
- };
294
-
295
- if (options?.imageUrl) {
296
- bubble.hero = {
297
- type: "image",
298
- url: options.imageUrl,
299
- size: "full",
300
- aspectRatio: options.aspectRatio ?? "20:13",
301
- aspectMode: "cover",
302
- } as FlexImage;
303
- }
304
-
305
- return bubble;
306
- }
307
-
308
- /**
309
- * Create a carousel container from multiple bubbles
310
- * LINE allows max 12 bubbles in a carousel
311
- */
312
- export function createCarousel(bubbles: FlexBubble[]): FlexCarousel {
313
- return {
314
- type: "carousel",
315
- contents: bubbles.slice(0, 12),
316
- };
317
- }
318
-
319
- /**
320
- * Create a notification bubble (for alerts, status updates)
321
- *
322
- * Editorial design: Bold status indicator with accent color,
323
- * clear typography, optional icon for context.
324
- */
325
- export function createNotificationBubble(
326
- text: string,
327
- options?: {
328
- icon?: string;
329
- type?: "info" | "success" | "warning" | "error";
330
- title?: string;
331
- },
332
- ): FlexBubble {
333
- // Color based on notification type
334
- const colors = {
335
- info: { accent: "#3B82F6", bg: "#EFF6FF" },
336
- success: { accent: "#06C755", bg: "#F0FDF4" },
337
- warning: { accent: "#F59E0B", bg: "#FFFBEB" },
338
- error: { accent: "#EF4444", bg: "#FEF2F2" },
339
- };
340
- const typeColors = colors[options?.type ?? "info"];
341
-
342
- const contents: FlexComponent[] = [];
343
-
344
- // Accent bar
345
- contents.push({
346
- type: "box",
347
- layout: "vertical",
348
- contents: [],
349
- width: "4px",
350
- backgroundColor: typeColors.accent,
351
- cornerRadius: "2px",
352
- } as FlexBox);
353
-
354
- // Content section
355
- const textContents: FlexComponent[] = [];
356
-
357
- if (options?.title) {
358
- textContents.push({
359
- type: "text",
360
- text: options.title,
361
- size: "md",
362
- weight: "bold",
363
- color: "#111111",
364
- wrap: true,
365
- } as FlexText);
366
- }
367
-
368
- textContents.push({
369
- type: "text",
370
- text,
371
- size: options?.title ? "sm" : "md",
372
- color: options?.title ? "#666666" : "#333333",
373
- wrap: true,
374
- margin: options?.title ? "sm" : undefined,
375
- } as FlexText);
376
-
377
- contents.push({
378
- type: "box",
379
- layout: "vertical",
380
- contents: textContents,
381
- flex: 1,
382
- paddingStart: "lg",
383
- } as FlexBox);
384
-
385
- return {
386
- type: "bubble",
387
- body: {
388
- type: "box",
389
- layout: "horizontal",
390
- contents,
391
- paddingAll: "xl",
392
- backgroundColor: typeColors.bg,
393
- },
394
- };
395
- }
@@ -1,20 +0,0 @@
1
- import type { FlexBox, FlexBubble, FlexText } from "./types.js";
2
-
3
- export function attachFooterText(bubble: FlexBubble, footer: string) {
4
- bubble.footer = {
5
- type: "box",
6
- layout: "vertical",
7
- contents: [
8
- {
9
- type: "text",
10
- text: footer,
11
- size: "xs",
12
- color: "#AAAAAA",
13
- wrap: true,
14
- align: "center",
15
- } as FlexText,
16
- ],
17
- paddingAll: "lg",
18
- backgroundColor: "#FAFAFA",
19
- } as FlexBox;
20
- }