@satorijs/adapter-lark 3.11.0 → 3.11.2
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.
- package/lib/content.d.ts +212 -95
- package/lib/index.cjs +75 -105
- package/lib/message.d.ts +2 -3
- package/package.json +1 -1
- package/src/content.ts +230 -109
- package/src/message.ts +73 -102
package/src/content.ts
CHANGED
|
@@ -25,6 +25,7 @@ export interface MessageContent {
|
|
|
25
25
|
audio: MessageContent.Audio
|
|
26
26
|
media: MessageContent.Media
|
|
27
27
|
sticker: MessageContent.Sticker
|
|
28
|
+
interactive: MessageContent.Card
|
|
28
29
|
share_chat: MessageContent.ShareChat
|
|
29
30
|
share_user: MessageContent.ShareUser
|
|
30
31
|
system: MessageContent.System
|
|
@@ -106,13 +107,10 @@ export namespace MessageContent {
|
|
|
106
107
|
export interface AtElement extends BaseElement<'at'> {
|
|
107
108
|
user_id: string
|
|
108
109
|
style?: Style[]
|
|
109
|
-
// user_name?: string
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
export interface ImageElement extends BaseElement<'img'> {
|
|
113
113
|
image_key: string
|
|
114
|
-
// height?: number
|
|
115
|
-
// width?: number
|
|
116
114
|
}
|
|
117
115
|
|
|
118
116
|
export interface MediaElement extends BaseElement<'media'> {
|
|
@@ -129,7 +127,7 @@ export namespace MessageContent {
|
|
|
129
127
|
text: string
|
|
130
128
|
}
|
|
131
129
|
|
|
132
|
-
export interface
|
|
130
|
+
export interface HrElement extends BaseElement<'hr'> {}
|
|
133
131
|
|
|
134
132
|
export interface MarkdownElement extends BaseElement<'md'> {
|
|
135
133
|
text: string
|
|
@@ -146,7 +144,7 @@ export namespace MessageContent {
|
|
|
146
144
|
| ImageElement
|
|
147
145
|
| MediaElement
|
|
148
146
|
| CodeBlockElement
|
|
149
|
-
|
|
|
147
|
+
| HrElement
|
|
150
148
|
|
|
151
149
|
export type Paragraph =
|
|
152
150
|
| InlineElement[]
|
|
@@ -154,43 +152,158 @@ export namespace MessageContent {
|
|
|
154
152
|
}
|
|
155
153
|
|
|
156
154
|
export interface Card {
|
|
155
|
+
schema: '2.0'
|
|
157
156
|
config?: Card.Config
|
|
158
|
-
card_link?: Card.
|
|
157
|
+
card_link?: Card.Urls
|
|
159
158
|
header?: Card.Header
|
|
160
|
-
|
|
159
|
+
body: Card.Body
|
|
161
160
|
}
|
|
162
161
|
|
|
163
162
|
export namespace Card {
|
|
164
163
|
/** @see https://open.larksuite.com/document/common-capabilities/message-card/getting-started/card-structure/card-configuration */
|
|
165
164
|
export interface Config {
|
|
165
|
+
streaming_mode?: boolean
|
|
166
|
+
streaming_config?: StreamingConfig
|
|
167
|
+
summary: {
|
|
168
|
+
content: string
|
|
169
|
+
i18n_content?: Record<string, string>
|
|
170
|
+
}
|
|
171
|
+
locales: string[]
|
|
166
172
|
enable_forward?: boolean
|
|
167
173
|
update_multi?: boolean
|
|
174
|
+
width_mode?: 'compact' | 'fill'
|
|
175
|
+
use_custom_translation?: boolean
|
|
176
|
+
enable_forward_interaction?: boolean
|
|
177
|
+
style?: {
|
|
178
|
+
text_size?: {
|
|
179
|
+
'cus-0': Record<'default' | 'android' | 'ios' | 'pc', 'medium' | 'large'>
|
|
180
|
+
}
|
|
181
|
+
color?: {
|
|
182
|
+
'cus-0': Record<'light_mode' | 'dark_mode', string>
|
|
183
|
+
}
|
|
184
|
+
}
|
|
168
185
|
}
|
|
169
186
|
|
|
170
|
-
export interface
|
|
187
|
+
export interface StreamingConfig {
|
|
188
|
+
print_frequency_ms?: Record<'default' | 'android' | 'ios' | 'pc', number>
|
|
189
|
+
print_step?: Record<'default' | 'android' | 'ios' | 'pc', number>
|
|
190
|
+
print_strategy?: 'fast' | 'delay'
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export interface Urls {
|
|
171
194
|
url: string
|
|
172
195
|
pc_url?: string
|
|
173
196
|
ios_url?: string
|
|
174
197
|
android_url?: string
|
|
175
198
|
}
|
|
176
199
|
|
|
177
|
-
/** @see https://open.
|
|
200
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/content-components/title */
|
|
178
201
|
export interface Header {
|
|
179
|
-
title:
|
|
180
|
-
subtitle?:
|
|
202
|
+
title: I18nTextElement
|
|
203
|
+
subtitle?: I18nTextElement
|
|
181
204
|
template?: Header.Template
|
|
182
|
-
icon?:
|
|
183
|
-
ud_icon?: StandardIconElement
|
|
205
|
+
icon?: IconElement
|
|
184
206
|
text_tag_list?: TextTagElement[]
|
|
185
207
|
i18n_text_tag_list?: Record<string, TextTagElement[]>
|
|
208
|
+
padding?: string
|
|
186
209
|
}
|
|
187
210
|
|
|
188
211
|
export namespace Header {
|
|
189
212
|
export type Template = 'blue' | 'wathet' | 'turquoise' | 'green' | 'yellow' | 'orange' | 'red' | 'carmine' | 'violet' | 'purple' | 'indigo' | 'grey' | 'default'
|
|
190
213
|
}
|
|
191
214
|
|
|
215
|
+
export interface Body {
|
|
216
|
+
direction?: 'vertical' | 'horizontal'
|
|
217
|
+
padding?: string
|
|
218
|
+
horizontal_spacing?: string
|
|
219
|
+
horizontal_align?: 'left' | 'center' | 'right'
|
|
220
|
+
vertical_spacing?: string
|
|
221
|
+
vertical_align?: 'top' | 'center' | 'bottom'
|
|
222
|
+
elements: Element[]
|
|
223
|
+
}
|
|
224
|
+
|
|
192
225
|
export interface BaseElement<T extends string = string> {
|
|
193
226
|
tag: T
|
|
227
|
+
margin?: string
|
|
228
|
+
element_id?: string
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export interface BaseContainerElement<T extends string = string> extends BaseElement<T> {
|
|
232
|
+
vertical_align?: 'top' | 'center' | 'bottom'
|
|
233
|
+
vertical_spacing?: string
|
|
234
|
+
horizontal_align?: 'left' | 'center' | 'right'
|
|
235
|
+
horizontal_spacing?: string
|
|
236
|
+
direction?: 'vertical' | 'horizontal'
|
|
237
|
+
padding?: string
|
|
238
|
+
elements: Element[]
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/containers/column-set */
|
|
242
|
+
export interface ColumnSetElement extends BaseElement<'column_set'> {
|
|
243
|
+
horizontal_spacing?: string
|
|
244
|
+
horizontal_align?: 'left' | 'center' | 'right'
|
|
245
|
+
vertical_align?: 'center'
|
|
246
|
+
flex_mode?: 'none' | 'stretch' | 'flow' | 'bisect' | 'trisect'
|
|
247
|
+
background_style?: string
|
|
248
|
+
columns: ColumnElement[]
|
|
249
|
+
action?: {
|
|
250
|
+
multi_url: Urls
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export interface ColumnElement extends BaseContainerElement<'column'> {
|
|
255
|
+
background_style?: string
|
|
256
|
+
width?: 'auto' | 'weighted' | string
|
|
257
|
+
weight?: number
|
|
258
|
+
action?: {
|
|
259
|
+
multi_url: Urls
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/containers/form-container */
|
|
264
|
+
export interface FormElement extends BaseContainerElement<'form'> {
|
|
265
|
+
name: string
|
|
266
|
+
confirm?: ConfirmElement
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/containers/interactive-container */
|
|
270
|
+
export interface InteractiveContainerElement extends BaseContainerElement<'interactive_container'> {
|
|
271
|
+
width?: string
|
|
272
|
+
height?: string
|
|
273
|
+
background_style?: string
|
|
274
|
+
has_border?: boolean
|
|
275
|
+
border_color?: string
|
|
276
|
+
corner_radius?: string
|
|
277
|
+
behaviors: ActionBehavior[]
|
|
278
|
+
disabled?: boolean
|
|
279
|
+
disabled_tips?: TextElement
|
|
280
|
+
confirm?: ConfirmElement
|
|
281
|
+
hover_tips?: TextElement
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/containers/collapsible-panel */
|
|
285
|
+
export interface CollapsiblePanelElement extends BaseContainerElement<'collapsible_panel'> {
|
|
286
|
+
expanded?: boolean
|
|
287
|
+
background_color?: string
|
|
288
|
+
header: CollapsiblePanelElement.Header
|
|
289
|
+
border?: {
|
|
290
|
+
color?: string
|
|
291
|
+
corner_radius?: string
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
export namespace CollapsiblePanelElement {
|
|
296
|
+
export interface Header {
|
|
297
|
+
title: TextElement | MarkdownElement
|
|
298
|
+
background_color?: string
|
|
299
|
+
vertical_align?: 'center' | 'top' | 'bottom'
|
|
300
|
+
padding?: string
|
|
301
|
+
position?: 'top' | 'bottom'
|
|
302
|
+
width?: string
|
|
303
|
+
icon?: IconElement & { size?: string }
|
|
304
|
+
icon_position?: 'left' | 'right' | 'follow_text'
|
|
305
|
+
icon_expanded_angle?: number
|
|
306
|
+
}
|
|
194
307
|
}
|
|
195
308
|
|
|
196
309
|
export type TextSize =
|
|
@@ -199,20 +312,19 @@ export namespace MessageContent {
|
|
|
199
312
|
|
|
200
313
|
export type TextAlign = 'left' | 'center' | 'right'
|
|
201
314
|
|
|
202
|
-
export interface
|
|
315
|
+
export interface TextElement<T extends string = 'plain_text'> extends BaseElement<T> {
|
|
203
316
|
content: string
|
|
204
317
|
}
|
|
205
318
|
|
|
206
|
-
export interface
|
|
207
|
-
|
|
319
|
+
export interface I18nTextElement extends TextElement<'plain_text' | 'lark_md'> {
|
|
320
|
+
i18n_content?: Record<string, string>
|
|
208
321
|
}
|
|
209
322
|
|
|
210
|
-
export interface
|
|
323
|
+
export interface DivTextElement extends TextElement<'plain_text' | 'lark_md'> {
|
|
211
324
|
text_size?: TextSize
|
|
212
325
|
text_color?: string
|
|
213
326
|
text_align?: TextAlign
|
|
214
327
|
lines?: number
|
|
215
|
-
icon?: IconElement
|
|
216
328
|
}
|
|
217
329
|
|
|
218
330
|
export type IconElement = StandardIconElement | CustomIconElement
|
|
@@ -227,7 +339,7 @@ export namespace MessageContent {
|
|
|
227
339
|
}
|
|
228
340
|
|
|
229
341
|
export interface TextTagElement extends BaseElement<'text_tag'> {
|
|
230
|
-
text:
|
|
342
|
+
text: TextElement
|
|
231
343
|
color: TextTagElement.Color
|
|
232
344
|
}
|
|
233
345
|
|
|
@@ -235,51 +347,71 @@ export namespace MessageContent {
|
|
|
235
347
|
export type Color = 'neutral' | 'blue' | 'torqoise' | 'lime' | 'orange' | 'violet' | 'indigo' | 'wathet' | 'green' | 'yellow' | 'red' | 'purple' | 'carmine'
|
|
236
348
|
}
|
|
237
349
|
|
|
238
|
-
export interface BaseImageElement extends BaseElement<'
|
|
350
|
+
export interface BaseImageElement extends BaseElement<'img'> {
|
|
239
351
|
img_key: string
|
|
240
|
-
alt?:
|
|
352
|
+
alt?: TextElement
|
|
241
353
|
}
|
|
242
354
|
|
|
355
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/content-components/image */
|
|
243
356
|
export interface ImageElement extends BaseImageElement {
|
|
244
|
-
title?:
|
|
357
|
+
title?: TextElement
|
|
245
358
|
transparent?: string
|
|
246
359
|
preview?: boolean
|
|
247
360
|
corner_radius?: string
|
|
248
361
|
scale_type?: 'crop_center' | 'fit_horizontal' | 'crop_top'
|
|
249
362
|
size?: 'large' | 'medium' | 'small' | 'tiny' | 'stretch_without_padding' | 'stretch' | string
|
|
250
|
-
/** @deprecated */
|
|
251
|
-
custom_width?: number
|
|
252
|
-
/** @deprecated */
|
|
253
|
-
compact_width?: boolean
|
|
254
|
-
/** @deprecated */
|
|
255
363
|
mode?: 'crop_center' | 'fit_horizontal' | 'large' | 'medium' | 'small' | 'tiny'
|
|
256
364
|
}
|
|
257
365
|
|
|
258
|
-
|
|
366
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/content-components/multi-image-laylout */
|
|
367
|
+
export interface ImageCombinationElement extends BaseElement<'img_combination'> {
|
|
368
|
+
combination_mode?: 'double' | 'triple' | 'bisect' | 'trisect'
|
|
369
|
+
combination_transparent?: boolean
|
|
370
|
+
corner_radius?: string
|
|
371
|
+
img_list?: {
|
|
372
|
+
img_key: string
|
|
373
|
+
}[]
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/content-components/divider */
|
|
377
|
+
export interface HrElement extends BaseElement<'hr'> {}
|
|
259
378
|
|
|
379
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/content-components/plain-text */
|
|
260
380
|
export interface DivElement extends BaseElement<'div'> {
|
|
261
|
-
text?:
|
|
381
|
+
text?: DivTextElement
|
|
382
|
+
width?: string
|
|
383
|
+
icon?: IconElement
|
|
262
384
|
}
|
|
263
385
|
|
|
386
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/content-components/rich-text */
|
|
264
387
|
export interface MarkdownElement extends BaseElement<'markdown'> {
|
|
265
388
|
content: string
|
|
266
389
|
text_size?: TextSize
|
|
267
390
|
text_align?: TextAlign
|
|
268
|
-
|
|
391
|
+
icon?: IconElement
|
|
269
392
|
}
|
|
270
393
|
|
|
394
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/content-components/user-profile */
|
|
271
395
|
export interface PersonElement extends BaseElement<'person'> {
|
|
272
396
|
user_id: string
|
|
273
397
|
size?: 'large' | 'medium' | 'small' | 'extra_small'
|
|
398
|
+
show_avatar?: boolean
|
|
399
|
+
show_name?: boolean
|
|
400
|
+
style?: 'normal' | 'capsule'
|
|
274
401
|
}
|
|
275
402
|
|
|
403
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/content-components/user-list */
|
|
276
404
|
export interface PersonListElement extends BaseElement<'person_list'> {
|
|
277
405
|
persons: { id: string }[]
|
|
278
406
|
size?: 'large' | 'medium' | 'small' | 'extra_small'
|
|
279
407
|
show_name?: boolean
|
|
280
408
|
show_avatar?: boolean
|
|
409
|
+
lines?: number
|
|
410
|
+
drop_invalid_user_id?: string
|
|
411
|
+
icon?: IconElement
|
|
281
412
|
}
|
|
282
413
|
|
|
414
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/content-components/chart */
|
|
283
415
|
export interface ChartElement extends BaseElement<'chart'> {
|
|
284
416
|
chart_spec: {} // TODO
|
|
285
417
|
aspect_ratio?: '1:1' | '2:1' | '4:3' | '16:9'
|
|
@@ -288,9 +420,12 @@ export namespace MessageContent {
|
|
|
288
420
|
height?: 'auto' | string
|
|
289
421
|
}
|
|
290
422
|
|
|
423
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/content-components/table */
|
|
291
424
|
export interface TableElement extends BaseElement<'table'> {
|
|
292
425
|
page_size?: number
|
|
293
426
|
row_height?: 'low' | 'medium' | 'high' | string
|
|
427
|
+
row_max_height?: string
|
|
428
|
+
freeze_first_column?: boolean
|
|
294
429
|
header_style?: TableElement.HeaderStyle
|
|
295
430
|
columns: TableElement.Column[]
|
|
296
431
|
rows: object[]
|
|
@@ -310,6 +445,7 @@ export namespace MessageContent {
|
|
|
310
445
|
name: string
|
|
311
446
|
display_name?: string
|
|
312
447
|
width?: 'auto' | string
|
|
448
|
+
vertical_align?: 'top' | 'center' | 'bottom'
|
|
313
449
|
horizontal_align?: 'left' | 'center' | 'right'
|
|
314
450
|
data_type?: 'text' | 'lark_md' | 'options' | 'number' | 'persons' | 'date' | 'markdown'
|
|
315
451
|
format?: {
|
|
@@ -321,30 +457,11 @@ export namespace MessageContent {
|
|
|
321
457
|
}
|
|
322
458
|
}
|
|
323
459
|
|
|
324
|
-
export interface NoteElement extends BaseElement<'note'> {
|
|
325
|
-
elements: NoteElement.InnerElement[]
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
export namespace NoteElement {
|
|
329
|
-
export type InnerElement = IconElement | PlainTextElement | BaseImageElement
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
export interface FormElement extends BaseElement<'form'> {
|
|
333
|
-
name: string
|
|
334
|
-
elements: Element[]
|
|
335
|
-
confirm?: ConfirmElement
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
export interface ActionElement extends BaseElement<'action'> {
|
|
339
|
-
actions: Element[]
|
|
340
|
-
layout?: 'bisected' | 'trisection' | 'flow'
|
|
341
|
-
}
|
|
342
|
-
|
|
343
460
|
export type ActionBehavior =
|
|
344
|
-
|
|
|
461
|
+
| OpenUrlBehavior
|
|
345
462
|
| CallbackBehavior
|
|
346
463
|
|
|
347
|
-
export interface
|
|
464
|
+
export interface OpenUrlBehavior {
|
|
348
465
|
type: 'open_url'
|
|
349
466
|
default_url: string
|
|
350
467
|
pc_url?: string
|
|
@@ -358,43 +475,39 @@ export namespace MessageContent {
|
|
|
358
475
|
}
|
|
359
476
|
|
|
360
477
|
export interface BaseButtonElement extends BaseElement<'button'> {
|
|
361
|
-
text:
|
|
478
|
+
text: TextElement
|
|
362
479
|
size?: ButtonElement.Size
|
|
363
480
|
icon?: IconElement
|
|
364
481
|
disabled?: boolean
|
|
365
482
|
behaviors?: ActionBehavior[]
|
|
366
483
|
}
|
|
367
484
|
|
|
485
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/interactive-components/button */
|
|
368
486
|
export interface ButtonElement extends BaseButtonElement {
|
|
369
487
|
type?: ButtonElement.Type
|
|
370
488
|
width?: ButtonElement.Width
|
|
371
|
-
hover_tips?:
|
|
372
|
-
disabled_tips?:
|
|
373
|
-
confirm?:
|
|
374
|
-
title: PlainTextElement
|
|
375
|
-
text: PlainTextElement
|
|
376
|
-
}
|
|
489
|
+
hover_tips?: TextElement
|
|
490
|
+
disabled_tips?: TextElement
|
|
491
|
+
confirm?: ConfirmElement
|
|
377
492
|
// form-related fields
|
|
378
493
|
name?: string
|
|
379
494
|
required?: boolean
|
|
380
|
-
|
|
381
|
-
// legacy fields
|
|
382
|
-
value?: Record<string, string>
|
|
383
|
-
url?: string
|
|
384
|
-
multi_url?: Omit<URLs, 'url'>
|
|
495
|
+
form_action_type?: 'submit' | 'reset'
|
|
385
496
|
}
|
|
386
497
|
|
|
387
498
|
export interface ConfirmElement {
|
|
388
|
-
title:
|
|
389
|
-
text:
|
|
499
|
+
title: TextElement
|
|
500
|
+
text: TextElement
|
|
390
501
|
}
|
|
391
502
|
|
|
503
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/interactive-components/input */
|
|
392
504
|
export interface InputElement extends BaseElement<'input'> {
|
|
393
|
-
name
|
|
505
|
+
name?: string
|
|
394
506
|
required?: boolean
|
|
395
|
-
placeholder?:
|
|
507
|
+
placeholder?: TextElement
|
|
396
508
|
default_value?: string
|
|
397
509
|
disabled?: boolean
|
|
510
|
+
disabled_tips?: TextElement
|
|
398
511
|
width?: 'default' | 'fill' | string
|
|
399
512
|
max_length?: number
|
|
400
513
|
input_type?: 'text' | 'multiline_text' | 'password'
|
|
@@ -402,17 +515,14 @@ export namespace MessageContent {
|
|
|
402
515
|
rows?: number
|
|
403
516
|
auto_resize?: boolean
|
|
404
517
|
max_rows?: number
|
|
405
|
-
label?:
|
|
518
|
+
label?: TextElement
|
|
406
519
|
label_position?: 'top' | 'left'
|
|
407
520
|
value?: string | object
|
|
408
521
|
behaviors?: ActionBehavior[]
|
|
409
522
|
confirm?: ConfirmElement
|
|
410
|
-
fallback?: {
|
|
411
|
-
tag?: string
|
|
412
|
-
text?: PlainTextElement
|
|
413
|
-
}
|
|
414
523
|
}
|
|
415
524
|
|
|
525
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/interactive-components/overflow */
|
|
416
526
|
export interface OverflowElement extends BaseElement<'overflow'> {
|
|
417
527
|
width?: 'default' | 'fill' | string
|
|
418
528
|
options: OverflowElement.Option[]
|
|
@@ -422,8 +532,8 @@ export namespace MessageContent {
|
|
|
422
532
|
|
|
423
533
|
export namespace OverflowElement {
|
|
424
534
|
export interface Option {
|
|
425
|
-
text?:
|
|
426
|
-
multi_url?:
|
|
535
|
+
text?: TextElement
|
|
536
|
+
multi_url?: Urls
|
|
427
537
|
value?: string
|
|
428
538
|
}
|
|
429
539
|
}
|
|
@@ -433,107 +543,111 @@ export namespace MessageContent {
|
|
|
433
543
|
name?: string
|
|
434
544
|
required?: boolean
|
|
435
545
|
disabled?: boolean
|
|
436
|
-
placeholder?:
|
|
546
|
+
placeholder?: TextElement
|
|
437
547
|
width?: 'default' | 'fill' | string
|
|
438
548
|
confirm?: ConfirmElement
|
|
549
|
+
behaviors?: ActionBehavior[]
|
|
439
550
|
}
|
|
440
551
|
|
|
441
552
|
export interface OptionElement {
|
|
442
|
-
text:
|
|
553
|
+
text: TextElement
|
|
443
554
|
icon?: IconElement
|
|
444
555
|
value: string
|
|
445
556
|
}
|
|
446
557
|
|
|
558
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/interactive-components/single-select-dropdown-menu */
|
|
447
559
|
export interface SelectElement extends BaseSelectElement<'select_static'> {
|
|
448
560
|
options: OptionElement[]
|
|
449
561
|
initial_option?: string
|
|
450
562
|
behaviors?: ActionBehavior[]
|
|
451
563
|
}
|
|
452
564
|
|
|
565
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/interactive-components/multi-select-dropdown-menu */
|
|
453
566
|
export interface MultiSelectElement extends BaseSelectElement<'multi_select_static'> {
|
|
454
567
|
options: OptionElement[]
|
|
455
568
|
selected_values?: string[]
|
|
456
569
|
}
|
|
457
570
|
|
|
571
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/interactive-components/single-select-user-picker */
|
|
458
572
|
export interface SelectPersonElement extends BaseSelectElement<'select_person'> {
|
|
459
|
-
options
|
|
573
|
+
options: { value: string }[]
|
|
460
574
|
}
|
|
461
575
|
|
|
576
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/interactive-components/multi-select-user-picker */
|
|
462
577
|
export interface MultiSelectPersonElement extends BaseSelectElement<'multi_select_person'> {
|
|
463
|
-
options
|
|
578
|
+
options: { value: string }[]
|
|
464
579
|
selected_values?: string[]
|
|
465
580
|
}
|
|
466
581
|
|
|
582
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/interactive-components/date-picker */
|
|
467
583
|
export interface DatePickerElement extends BaseSelectElement<'date_picker'> {
|
|
468
584
|
initial_date?: string
|
|
469
585
|
value?: object
|
|
470
586
|
}
|
|
471
587
|
|
|
588
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/interactive-components/time-selector */
|
|
472
589
|
export interface TimePickerElement extends BaseSelectElement<'picker_time'> {
|
|
473
590
|
initial_time?: string
|
|
474
591
|
value?: object
|
|
475
592
|
}
|
|
476
593
|
|
|
594
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/interactive-components/date-time-picker */
|
|
477
595
|
export interface DateTimePickerElement extends BaseSelectElement<'picker_datetime'> {
|
|
478
596
|
initial_datetime?: string
|
|
479
597
|
value?: object
|
|
480
598
|
}
|
|
481
599
|
|
|
600
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/interactive-components/image-picker */
|
|
601
|
+
export interface SelectImageElement extends BaseSelectElement<'select_img'> {
|
|
602
|
+
multi_select?: boolean
|
|
603
|
+
layout?: 'stretch' | 'bisect' | 'trisect'
|
|
604
|
+
can_preview?: boolean
|
|
605
|
+
aspect_ratio?: '1:1' | '4:3' | '16:9'
|
|
606
|
+
disabled_tips?: TextElement
|
|
607
|
+
value?: string | object
|
|
608
|
+
options?: {
|
|
609
|
+
img_key: string
|
|
610
|
+
value?: string
|
|
611
|
+
disabled?: boolean
|
|
612
|
+
disabled_tips?: TextElement
|
|
613
|
+
hover_tips?: TextElement
|
|
614
|
+
}[]
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
/** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/interactive-components/checker */
|
|
482
618
|
export interface CheckerElement extends BaseElement<'checker'> {
|
|
483
619
|
name?: string
|
|
484
620
|
checked?: boolean
|
|
485
621
|
disabled?: boolean
|
|
486
|
-
text?: CheckerElement.
|
|
622
|
+
text?: CheckerElement.Text
|
|
487
623
|
overall_checkable?: boolean
|
|
488
624
|
button_area?: {
|
|
489
625
|
pc_display_rule?: 'always' | 'on_hover'
|
|
490
|
-
buttons?: CheckerElement.
|
|
626
|
+
buttons?: CheckerElement.Button[]
|
|
491
627
|
}
|
|
492
628
|
checked_style?: {
|
|
493
629
|
show_strikethrough?: boolean
|
|
494
630
|
opacity?: number
|
|
495
631
|
}
|
|
496
|
-
margin?: string
|
|
497
632
|
padding?: string
|
|
498
633
|
confirm?: ConfirmElement
|
|
499
634
|
behaviors?: ActionBehavior[]
|
|
500
|
-
hover_tips?:
|
|
501
|
-
disable_tips?:
|
|
635
|
+
hover_tips?: TextElement
|
|
636
|
+
disable_tips?: TextElement
|
|
502
637
|
}
|
|
503
638
|
|
|
504
639
|
export namespace CheckerElement {
|
|
505
|
-
export interface
|
|
640
|
+
export interface Text extends Card.TextElement<'plain_text' | 'lark_md'> {
|
|
506
641
|
text_size?: 'normal' | 'heading' | 'notation'
|
|
507
642
|
text_color?: string
|
|
508
643
|
text_align?: TextAlign
|
|
509
644
|
}
|
|
510
645
|
|
|
511
|
-
export interface
|
|
646
|
+
export interface Button extends BaseButtonElement {
|
|
512
647
|
type: 'text' | 'primary_text' | 'danger_text'
|
|
513
648
|
}
|
|
514
649
|
}
|
|
515
650
|
|
|
516
|
-
export interface ColumnSetElement extends BaseElement<'column_set'> {
|
|
517
|
-
horizontal_spacing?: string
|
|
518
|
-
horizontal_align?: 'left' | 'center' | 'right'
|
|
519
|
-
margin?: string
|
|
520
|
-
flex_mode?: 'none' | 'stretch' | 'flow' | 'bisect' | 'trisect'
|
|
521
|
-
background_style?: string
|
|
522
|
-
columns: ColumnElement[]
|
|
523
|
-
// action?: Action
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
export interface ColumnElement extends BaseElement<'column'> {
|
|
527
|
-
background_style?: string
|
|
528
|
-
width?: 'auto' | 'weighted' | string
|
|
529
|
-
weight?: number
|
|
530
|
-
vertical_align?: 'top' | 'center' | 'bottom'
|
|
531
|
-
vertical_spacing?: 'default' | 'medium' | 'large' | string
|
|
532
|
-
padding?: string
|
|
533
|
-
elements: Element[]
|
|
534
|
-
// action?: Action
|
|
535
|
-
}
|
|
536
|
-
|
|
537
651
|
export namespace ButtonElement {
|
|
538
652
|
export type Size = 'tiny' | 'small' | 'medium' | 'large'
|
|
539
653
|
export type Width = 'default' | 'fill' | string
|
|
@@ -543,9 +657,7 @@ export namespace MessageContent {
|
|
|
543
657
|
export type Element =
|
|
544
658
|
| DivElement
|
|
545
659
|
| MarkdownElement
|
|
546
|
-
|
|
|
547
|
-
| ActionElement
|
|
548
|
-
| NoteElement
|
|
660
|
+
| HrElement
|
|
549
661
|
| ChartElement
|
|
550
662
|
| TableElement
|
|
551
663
|
| ImageElement
|
|
@@ -555,6 +667,15 @@ export namespace MessageContent {
|
|
|
555
667
|
| CheckerElement
|
|
556
668
|
| ColumnSetElement
|
|
557
669
|
| SelectElement
|
|
670
|
+
| MultiSelectElement
|
|
671
|
+
| SelectPersonElement
|
|
672
|
+
| MultiSelectPersonElement
|
|
673
|
+
| DatePickerElement
|
|
674
|
+
| TimePickerElement
|
|
675
|
+
| DateTimePickerElement
|
|
676
|
+
| InteractiveContainerElement
|
|
677
|
+
| CollapsiblePanelElement
|
|
678
|
+
| OverflowElement
|
|
558
679
|
}
|
|
559
680
|
|
|
560
681
|
export interface Template {
|