@satorijs/adapter-lark 3.10.6 → 3.11.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 (119) hide show
  1. package/lib/content.d.ts +211 -93
  2. package/lib/index.cjs +2954 -2474
  3. package/lib/internal.d.ts +4 -4
  4. package/lib/message.d.ts +2 -3
  5. package/lib/types/acs.d.ts +212 -172
  6. package/lib/types/admin.d.ts +331 -291
  7. package/lib/types/aily.d.ts +331 -216
  8. package/lib/types/apaas.d.ts +646 -494
  9. package/lib/types/application.d.ts +559 -458
  10. package/lib/types/approval.d.ts +826 -791
  11. package/lib/types/attendance.d.ts +1094 -994
  12. package/lib/types/auth.d.ts +66 -61
  13. package/lib/types/authen.d.ts +221 -186
  14. package/lib/types/baike.d.ts +258 -233
  15. package/lib/types/base.d.ts +74 -0
  16. package/lib/types/bitable.d.ts +830 -770
  17. package/lib/types/board.d.ts +29 -14
  18. package/lib/types/calendar.d.ts +660 -605
  19. package/lib/types/cardkit.d.ts +149 -134
  20. package/lib/types/compensation.d.ts +84 -49
  21. package/lib/types/contact.d.ts +1279 -1204
  22. package/lib/types/corehr.d.ts +4982 -4526
  23. package/lib/types/directory.d.ts +447 -0
  24. package/lib/types/docs.d.ts +28 -18
  25. package/lib/types/document_ai.d.ts +347 -252
  26. package/lib/types/docx.d.ts +428 -383
  27. package/lib/types/drive.d.ts +1093 -1048
  28. package/lib/types/ehr.d.ts +66 -51
  29. package/lib/types/event.d.ts +16 -6
  30. package/lib/types/helpdesk.d.ts +816 -741
  31. package/lib/types/hire.d.ts +3955 -3589
  32. package/lib/types/human_authentication.d.ts +32 -22
  33. package/lib/types/im.d.ts +1420 -1295
  34. package/lib/types/index.d.ts +1422 -330
  35. package/lib/types/lingo.d.ts +279 -249
  36. package/lib/types/mail.d.ts +1032 -675
  37. package/lib/types/mdm.d.ts +105 -37
  38. package/lib/types/minutes.d.ts +73 -26
  39. package/lib/types/moments.d.ts +23 -13
  40. package/lib/types/okr.d.ts +266 -225
  41. package/lib/types/optical_char_recognition.d.ts +22 -12
  42. package/lib/types/passport.d.ts +58 -48
  43. package/lib/types/payroll.d.ts +210 -53
  44. package/lib/types/performance.d.ts +463 -414
  45. package/lib/types/personal_settings.d.ts +93 -82
  46. package/lib/types/report.d.ts +79 -58
  47. package/lib/types/search.d.ts +265 -235
  48. package/lib/types/security_and_compliance.d.ts +30 -19
  49. package/lib/types/sheets.d.ts +356 -321
  50. package/lib/types/speech_to_text.d.ts +44 -34
  51. package/lib/types/task.d.ts +998 -1087
  52. package/lib/types/tenant.d.ts +25 -15
  53. package/lib/types/translation.d.ts +42 -32
  54. package/lib/types/trust_party.d.ts +81 -0
  55. package/lib/types/vc.d.ts +1218 -1123
  56. package/lib/types/verification.d.ts +11 -6
  57. package/lib/types/wiki.d.ts +270 -235
  58. package/lib/types/workplace.d.ts +58 -38
  59. package/lib/utils.d.ts +2 -2
  60. package/package.json +4 -4
  61. package/src/bot.ts +15 -15
  62. package/src/content.ts +230 -107
  63. package/src/internal.ts +29 -12
  64. package/src/message.ts +82 -111
  65. package/src/types/acs.ts +234 -186
  66. package/src/types/admin.ts +353 -305
  67. package/src/types/aily.ts +375 -233
  68. package/src/types/apaas.ts +754 -568
  69. package/src/types/application.ts +633 -507
  70. package/src/types/approval.ts +914 -872
  71. package/src/types/attendance.ts +1226 -1104
  72. package/src/types/auth.ts +72 -66
  73. package/src/types/authen.ts +233 -191
  74. package/src/types/baike.ts +276 -246
  75. package/src/types/base.ts +93 -0
  76. package/src/types/bitable.ts +966 -894
  77. package/src/types/board.ts +34 -16
  78. package/src/types/calendar.ts +751 -685
  79. package/src/types/cardkit.ts +164 -146
  80. package/src/types/compensation.ts +97 -55
  81. package/src/types/contact.ts +1465 -1375
  82. package/src/types/corehr.ts +5664 -5077
  83. package/src/types/directory.ts +569 -0
  84. package/src/types/docs.ts +31 -19
  85. package/src/types/document_ai.ts +401 -287
  86. package/src/types/docx.ts +492 -438
  87. package/src/types/drive.ts +1266 -1213
  88. package/src/types/ehr.ts +71 -53
  89. package/src/types/event.ts +19 -7
  90. package/src/types/helpdesk.ts +930 -840
  91. package/src/types/hire.ts +4453 -4019
  92. package/src/types/human_authentication.ts +35 -23
  93. package/src/types/im.ts +1626 -1476
  94. package/src/types/index.ts +1532 -346
  95. package/src/types/lingo.ts +299 -263
  96. package/src/types/mail.ts +1231 -779
  97. package/src/types/mdm.ts +122 -39
  98. package/src/types/minutes.ts +88 -28
  99. package/src/types/moments.ts +26 -14
  100. package/src/types/okr.ts +286 -238
  101. package/src/types/optical_char_recognition.ts +25 -13
  102. package/src/types/passport.ts +62 -50
  103. package/src/types/payroll.ts +254 -57
  104. package/src/types/performance.ts +528 -467
  105. package/src/types/personal_settings.ts +101 -89
  106. package/src/types/report.ts +86 -62
  107. package/src/types/search.ts +285 -249
  108. package/src/types/security_and_compliance.ts +33 -21
  109. package/src/types/sheets.ts +421 -379
  110. package/src/types/speech_to_text.ts +48 -36
  111. package/src/types/task.ts +1152 -1260
  112. package/src/types/tenant.ts +29 -17
  113. package/src/types/translation.ts +46 -34
  114. package/src/types/trust_party.ts +110 -0
  115. package/src/types/vc.ts +1397 -1283
  116. package/src/types/verification.ts +13 -7
  117. package/src/types/wiki.ts +293 -251
  118. package/src/types/workplace.ts +65 -41
  119. package/src/utils.ts +3 -3
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 HRElement extends BaseElement<'hr'> {}
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
- | HRElement
147
+ | HrElement
150
148
 
151
149
  export type Paragraph =
152
150
  | InlineElement[]
@@ -154,43 +152,159 @@ 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.URLs
157
+ card_link?: Card.Urls
159
158
  header?: Card.Header
160
- elements: Card.Element[]
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 URLs {
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.larksuite.com/document/common-capabilities/message-card/message-cards-content/card-header */
200
+ /** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/content-components/title */
178
201
  export interface Header {
179
- title: I18nPlainTextElement
180
- subtitle?: I18nPlainTextElement
202
+ title: I18nTextElement
203
+ subtitle?: I18nTextElement
181
204
  template?: Header.Template
182
205
  icon?: CustomIconElement
183
206
  ud_icon?: StandardIconElement
184
207
  text_tag_list?: TextTagElement[]
185
208
  i18n_text_tag_list?: Record<string, TextTagElement[]>
209
+ padding?: string
186
210
  }
187
211
 
188
212
  export namespace Header {
189
213
  export type Template = 'blue' | 'wathet' | 'turquoise' | 'green' | 'yellow' | 'orange' | 'red' | 'carmine' | 'violet' | 'purple' | 'indigo' | 'grey' | 'default'
190
214
  }
191
215
 
216
+ export interface Body {
217
+ direction?: 'vertical' | 'horizontal'
218
+ padding?: string
219
+ horizontal_spacing?: string
220
+ horizontal_align?: 'left' | 'center' | 'right'
221
+ vertical_spacing?: string
222
+ vertical_align?: 'top' | 'center' | 'bottom'
223
+ elements: Element[]
224
+ }
225
+
192
226
  export interface BaseElement<T extends string = string> {
193
227
  tag: T
228
+ margin?: string
229
+ element_id?: string
230
+ }
231
+
232
+ export interface BaseContainerElement<T extends string = string> extends BaseElement<T> {
233
+ vertical_align?: 'top' | 'center' | 'bottom'
234
+ vertical_spacing?: string
235
+ horizontal_align?: 'left' | 'center' | 'right'
236
+ horizontal_spacing?: string
237
+ direction?: 'vertical' | 'horizontal'
238
+ padding?: string
239
+ elements: Element[]
240
+ }
241
+
242
+ /** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/containers/column-set */
243
+ export interface ColumnSetElement extends BaseElement<'column_set'> {
244
+ horizontal_spacing?: string
245
+ horizontal_align?: 'left' | 'center' | 'right'
246
+ vertical_align?: 'center'
247
+ flex_mode?: 'none' | 'stretch' | 'flow' | 'bisect' | 'trisect'
248
+ background_style?: string
249
+ columns: ColumnElement[]
250
+ action?: {
251
+ multi_url: Urls
252
+ }
253
+ }
254
+
255
+ export interface ColumnElement extends BaseContainerElement<'column'> {
256
+ background_style?: string
257
+ width?: 'auto' | 'weighted' | string
258
+ weight?: number
259
+ action?: {
260
+ multi_url: Urls
261
+ }
262
+ }
263
+
264
+ /** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/containers/form-container */
265
+ export interface FormElement extends BaseContainerElement<'form'> {
266
+ name: string
267
+ confirm?: ConfirmElement
268
+ }
269
+
270
+ /** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/containers/interactive-container */
271
+ export interface InteractiveContainerElement extends BaseContainerElement<'interactive_container'> {
272
+ width?: string
273
+ height?: string
274
+ background_style?: string
275
+ has_border?: boolean
276
+ border_color?: string
277
+ corner_radius?: string
278
+ behaviors: ActionBehavior[]
279
+ disabled?: boolean
280
+ disabled_tips?: TextElement
281
+ confirm?: ConfirmElement
282
+ hover_tips?: TextElement
283
+ }
284
+
285
+ /** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/containers/collapsible-panel */
286
+ export interface CollapsiblePanelElement extends BaseContainerElement<'collapsible_panel'> {
287
+ expanded?: boolean
288
+ background_color?: string
289
+ header: CollapsiblePanelElement.Header
290
+ border?: {
291
+ color?: string
292
+ corner_radius?: string
293
+ }
294
+ }
295
+
296
+ export namespace CollapsiblePanelElement {
297
+ export interface Header {
298
+ title: TextElement | MarkdownElement
299
+ background_color?: string
300
+ vertical_align?: 'center' | 'top' | 'bottom'
301
+ padding?: string
302
+ position?: 'top' | 'bottom'
303
+ width?: string
304
+ icon?: IconElement & { size?: string }
305
+ icon_position?: 'left' | 'right' | 'follow_text'
306
+ icon_expanded_angle?: number
307
+ }
194
308
  }
195
309
 
196
310
  export type TextSize =
@@ -199,20 +313,19 @@ export namespace MessageContent {
199
313
 
200
314
  export type TextAlign = 'left' | 'center' | 'right'
201
315
 
202
- export interface PlainTextElement extends BaseElement<'plain_text'> {
316
+ export interface TextElement<T extends string = 'plain_text'> extends BaseElement<T> {
203
317
  content: string
204
318
  }
205
319
 
206
- export interface I18nPlainTextElement extends PlainTextElement {
207
- i18n?: Record<string, string>
320
+ export interface I18nTextElement extends TextElement<'plain_text' | 'lark_md'> {
321
+ i18n_content?: Record<string, string>
208
322
  }
209
323
 
210
- export interface DivPlainTextElement extends PlainTextElement {
324
+ export interface DivTextElement extends TextElement<'plain_text' | 'lark_md'> {
211
325
  text_size?: TextSize
212
326
  text_color?: string
213
327
  text_align?: TextAlign
214
328
  lines?: number
215
- icon?: IconElement
216
329
  }
217
330
 
218
331
  export type IconElement = StandardIconElement | CustomIconElement
@@ -227,7 +340,7 @@ export namespace MessageContent {
227
340
  }
228
341
 
229
342
  export interface TextTagElement extends BaseElement<'text_tag'> {
230
- text: PlainTextElement
343
+ text: TextElement
231
344
  color: TextTagElement.Color
232
345
  }
233
346
 
@@ -235,51 +348,72 @@ export namespace MessageContent {
235
348
  export type Color = 'neutral' | 'blue' | 'torqoise' | 'lime' | 'orange' | 'violet' | 'indigo' | 'wathet' | 'green' | 'yellow' | 'red' | 'purple' | 'carmine'
236
349
  }
237
350
 
238
- export interface BaseImageElement extends BaseElement<'image'> {
351
+ export interface BaseImageElement extends BaseElement<'img'> {
239
352
  img_key: string
240
- alt?: PlainTextElement
353
+ alt?: TextElement
241
354
  }
242
355
 
356
+ /** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/content-components/image */
243
357
  export interface ImageElement extends BaseImageElement {
244
- title?: PlainTextElement
358
+ title?: TextElement
245
359
  transparent?: string
246
360
  preview?: boolean
247
361
  corner_radius?: string
248
362
  scale_type?: 'crop_center' | 'fit_horizontal' | 'crop_top'
249
363
  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
364
  mode?: 'crop_center' | 'fit_horizontal' | 'large' | 'medium' | 'small' | 'tiny'
256
365
  }
257
366
 
258
- export interface HRElement extends BaseElement<'hr'> {}
367
+ /** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/content-components/multi-image-laylout */
368
+ export interface ImageCombinationElement extends BaseElement<'img_combination'> {
369
+ combination_mode?: 'double' | 'triple' | 'bisect' | 'trisect'
370
+ combination_transparent?: boolean
371
+ corner_radius?: string
372
+ img_list?: {
373
+ img_key: string
374
+ }[]
375
+ }
376
+
377
+ /** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/content-components/divider */
378
+ export interface HrElement extends BaseElement<'hr'> {}
259
379
 
380
+ /** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/content-components/plain-text */
260
381
  export interface DivElement extends BaseElement<'div'> {
261
- text?: DivPlainTextElement
382
+ text?: DivTextElement
383
+ width?: string
384
+ icon?: IconElement
262
385
  }
263
386
 
387
+ /** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/content-components/rich-text */
264
388
  export interface MarkdownElement extends BaseElement<'markdown'> {
265
389
  content: string
266
390
  text_size?: TextSize
267
391
  text_align?: TextAlign
268
- href?: Record<string, URLs>
392
+ icon?: IconElement
269
393
  }
270
394
 
395
+ /** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/content-components/user-profile */
271
396
  export interface PersonElement extends BaseElement<'person'> {
272
397
  user_id: string
273
398
  size?: 'large' | 'medium' | 'small' | 'extra_small'
399
+ show_avatar?: boolean
400
+ show_name?: boolean
401
+ style?: 'normal' | 'capsule'
274
402
  }
275
403
 
404
+ /** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/content-components/user-list */
276
405
  export interface PersonListElement extends BaseElement<'person_list'> {
277
406
  persons: { id: string }[]
278
407
  size?: 'large' | 'medium' | 'small' | 'extra_small'
279
408
  show_name?: boolean
280
409
  show_avatar?: boolean
410
+ lines?: number
411
+ drop_invalid_user_id?: string
412
+ icon?: IconElement
413
+ // ud_icon?: StandardIconElement
281
414
  }
282
415
 
416
+ /** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/content-components/chart */
283
417
  export interface ChartElement extends BaseElement<'chart'> {
284
418
  chart_spec: {} // TODO
285
419
  aspect_ratio?: '1:1' | '2:1' | '4:3' | '16:9'
@@ -288,9 +422,12 @@ export namespace MessageContent {
288
422
  height?: 'auto' | string
289
423
  }
290
424
 
425
+ /** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/content-components/table */
291
426
  export interface TableElement extends BaseElement<'table'> {
292
427
  page_size?: number
293
428
  row_height?: 'low' | 'medium' | 'high' | string
429
+ row_max_height?: string
430
+ freeze_first_column?: boolean
294
431
  header_style?: TableElement.HeaderStyle
295
432
  columns: TableElement.Column[]
296
433
  rows: object[]
@@ -310,6 +447,7 @@ export namespace MessageContent {
310
447
  name: string
311
448
  display_name?: string
312
449
  width?: 'auto' | string
450
+ vertical_align?: 'top' | 'center' | 'bottom'
313
451
  horizontal_align?: 'left' | 'center' | 'right'
314
452
  data_type?: 'text' | 'lark_md' | 'options' | 'number' | 'persons' | 'date' | 'markdown'
315
453
  format?: {
@@ -321,30 +459,11 @@ export namespace MessageContent {
321
459
  }
322
460
  }
323
461
 
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
462
  export type ActionBehavior =
344
- | OpenURLBehavior
463
+ | OpenUrlBehavior
345
464
  | CallbackBehavior
346
465
 
347
- export interface OpenURLBehavior {
466
+ export interface OpenUrlBehavior {
348
467
  type: 'open_url'
349
468
  default_url: string
350
469
  pc_url?: string
@@ -358,43 +477,39 @@ export namespace MessageContent {
358
477
  }
359
478
 
360
479
  export interface BaseButtonElement extends BaseElement<'button'> {
361
- text: PlainTextElement
480
+ text: TextElement
362
481
  size?: ButtonElement.Size
363
482
  icon?: IconElement
364
483
  disabled?: boolean
365
484
  behaviors?: ActionBehavior[]
366
485
  }
367
486
 
487
+ /** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/interactive-components/button */
368
488
  export interface ButtonElement extends BaseButtonElement {
369
489
  type?: ButtonElement.Type
370
490
  width?: ButtonElement.Width
371
- hover_tips?: PlainTextElement
372
- disabled_tips?: PlainTextElement
373
- confirm?: {
374
- title: PlainTextElement
375
- text: PlainTextElement
376
- }
491
+ hover_tips?: TextElement
492
+ disabled_tips?: TextElement
493
+ confirm?: ConfirmElement
377
494
  // form-related fields
378
495
  name?: string
379
496
  required?: boolean
380
- action_type?: 'link' | 'request' | 'multi' | 'form_submit' | 'form_reset'
381
- // legacy fields
382
- value?: Record<string, string>
383
- url?: string
384
- multi_url?: Omit<URLs, 'url'>
497
+ form_action_type?: 'submit' | 'reset'
385
498
  }
386
499
 
387
500
  export interface ConfirmElement {
388
- title: PlainTextElement
389
- text: PlainTextElement
501
+ title: TextElement
502
+ text: TextElement
390
503
  }
391
504
 
505
+ /** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/interactive-components/input */
392
506
  export interface InputElement extends BaseElement<'input'> {
393
- name: string
507
+ name?: string
394
508
  required?: boolean
395
- placeholder?: PlainTextElement
509
+ placeholder?: TextElement
396
510
  default_value?: string
397
511
  disabled?: boolean
512
+ disabled_tips?: TextElement
398
513
  width?: 'default' | 'fill' | string
399
514
  max_length?: number
400
515
  input_type?: 'text' | 'multiline_text' | 'password'
@@ -402,17 +517,14 @@ export namespace MessageContent {
402
517
  rows?: number
403
518
  auto_resize?: boolean
404
519
  max_rows?: number
405
- label?: PlainTextElement
520
+ label?: TextElement
406
521
  label_position?: 'top' | 'left'
407
522
  value?: string | object
408
523
  behaviors?: ActionBehavior[]
409
524
  confirm?: ConfirmElement
410
- fallback?: {
411
- tag?: string
412
- text?: PlainTextElement
413
- }
414
525
  }
415
526
 
527
+ /** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/interactive-components/overflow */
416
528
  export interface OverflowElement extends BaseElement<'overflow'> {
417
529
  width?: 'default' | 'fill' | string
418
530
  options: OverflowElement.Option[]
@@ -422,8 +534,8 @@ export namespace MessageContent {
422
534
 
423
535
  export namespace OverflowElement {
424
536
  export interface Option {
425
- text?: PlainTextElement
426
- multi_url?: URLs
537
+ text?: TextElement
538
+ multi_url?: Urls
427
539
  value?: string
428
540
  }
429
541
  }
@@ -433,107 +545,111 @@ export namespace MessageContent {
433
545
  name?: string
434
546
  required?: boolean
435
547
  disabled?: boolean
436
- placeholder?: PlainTextElement
548
+ placeholder?: TextElement
437
549
  width?: 'default' | 'fill' | string
438
550
  confirm?: ConfirmElement
551
+ behaviors?: ActionBehavior[]
439
552
  }
440
553
 
441
554
  export interface OptionElement {
442
- text: PlainTextElement
555
+ text: TextElement
443
556
  icon?: IconElement
444
557
  value: string
445
558
  }
446
559
 
560
+ /** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/interactive-components/single-select-dropdown-menu */
447
561
  export interface SelectElement extends BaseSelectElement<'select_static'> {
448
562
  options: OptionElement[]
449
563
  initial_option?: string
450
564
  behaviors?: ActionBehavior[]
451
565
  }
452
566
 
567
+ /** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/interactive-components/multi-select-dropdown-menu */
453
568
  export interface MultiSelectElement extends BaseSelectElement<'multi_select_static'> {
454
569
  options: OptionElement[]
455
570
  selected_values?: string[]
456
571
  }
457
572
 
573
+ /** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/interactive-components/single-select-user-picker */
458
574
  export interface SelectPersonElement extends BaseSelectElement<'select_person'> {
459
- options?: { value: string }[]
575
+ options: { value: string }[]
460
576
  }
461
577
 
578
+ /** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/interactive-components/multi-select-user-picker */
462
579
  export interface MultiSelectPersonElement extends BaseSelectElement<'multi_select_person'> {
463
- options?: { value: string }[]
580
+ options: { value: string }[]
464
581
  selected_values?: string[]
465
582
  }
466
583
 
584
+ /** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/interactive-components/date-picker */
467
585
  export interface DatePickerElement extends BaseSelectElement<'date_picker'> {
468
586
  initial_date?: string
469
587
  value?: object
470
588
  }
471
589
 
590
+ /** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/interactive-components/time-selector */
472
591
  export interface TimePickerElement extends BaseSelectElement<'picker_time'> {
473
592
  initial_time?: string
474
593
  value?: object
475
594
  }
476
595
 
596
+ /** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/interactive-components/date-time-picker */
477
597
  export interface DateTimePickerElement extends BaseSelectElement<'picker_datetime'> {
478
598
  initial_datetime?: string
479
599
  value?: object
480
600
  }
481
601
 
602
+ /** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/interactive-components/image-picker */
603
+ export interface SelectImageElement extends BaseSelectElement<'select_img'> {
604
+ multi_select?: boolean
605
+ layout?: 'stretch' | 'bisect' | 'trisect'
606
+ can_preview?: boolean
607
+ aspect_ratio?: '1:1' | '4:3' | '16:9'
608
+ disabled_tips?: TextElement
609
+ value?: string | object
610
+ options?: {
611
+ img_key: string
612
+ value?: string
613
+ disabled?: boolean
614
+ disabled_tips?: TextElement
615
+ hover_tips?: TextElement
616
+ }[]
617
+ }
618
+
619
+ /** @see https://open.feishu.cn/document/feishu-cards/card-json-v2-components/interactive-components/checker */
482
620
  export interface CheckerElement extends BaseElement<'checker'> {
483
621
  name?: string
484
622
  checked?: boolean
485
623
  disabled?: boolean
486
- text?: CheckerElement.TextElement
624
+ text?: CheckerElement.Text
487
625
  overall_checkable?: boolean
488
626
  button_area?: {
489
627
  pc_display_rule?: 'always' | 'on_hover'
490
- buttons?: CheckerElement.ButtonElement[]
628
+ buttons?: CheckerElement.Button[]
491
629
  }
492
630
  checked_style?: {
493
631
  show_strikethrough?: boolean
494
632
  opacity?: number
495
633
  }
496
- margin?: string
497
634
  padding?: string
498
635
  confirm?: ConfirmElement
499
636
  behaviors?: ActionBehavior[]
500
- hover_tips?: PlainTextElement
501
- disable_tips?: PlainTextElement
637
+ hover_tips?: TextElement
638
+ disable_tips?: TextElement
502
639
  }
503
640
 
504
641
  export namespace CheckerElement {
505
- export interface TextElement extends PlainTextElement {
642
+ export interface Text extends Card.TextElement<'plain_text' | 'lark_md'> {
506
643
  text_size?: 'normal' | 'heading' | 'notation'
507
644
  text_color?: string
508
645
  text_align?: TextAlign
509
646
  }
510
647
 
511
- export interface ButtonElement extends BaseButtonElement {
648
+ export interface Button extends BaseButtonElement {
512
649
  type: 'text' | 'primary_text' | 'danger_text'
513
650
  }
514
651
  }
515
652
 
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
653
  export namespace ButtonElement {
538
654
  export type Size = 'tiny' | 'small' | 'medium' | 'large'
539
655
  export type Width = 'default' | 'fill' | string
@@ -543,9 +659,7 @@ export namespace MessageContent {
543
659
  export type Element =
544
660
  | DivElement
545
661
  | MarkdownElement
546
- | HRElement
547
- | ActionElement
548
- | NoteElement
662
+ | HrElement
549
663
  | ChartElement
550
664
  | TableElement
551
665
  | ImageElement
@@ -555,6 +669,15 @@ export namespace MessageContent {
555
669
  | CheckerElement
556
670
  | ColumnSetElement
557
671
  | SelectElement
672
+ | MultiSelectElement
673
+ | SelectPersonElement
674
+ | MultiSelectPersonElement
675
+ | DatePickerElement
676
+ | TimePickerElement
677
+ | DateTimePickerElement
678
+ | InteractiveContainerElement
679
+ | CollapsiblePanelElement
680
+ | OverflowElement
558
681
  }
559
682
 
560
683
  export interface Template {