@satorijs/adapter-lark 3.11.8 → 3.12.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 (68) hide show
  1. package/lib/bot.d.ts +5 -5
  2. package/lib/http.d.ts +6 -3
  3. package/lib/index.cjs +634 -261
  4. package/lib/types/acs.d.ts +4 -1
  5. package/lib/types/aily.d.ts +3 -3
  6. package/lib/types/apaas.d.ts +190 -28
  7. package/lib/types/application.d.ts +20 -4
  8. package/lib/types/approval.d.ts +0 -13
  9. package/lib/types/attendance.d.ts +11 -5
  10. package/lib/types/authen.d.ts +8 -2
  11. package/lib/types/bitable.d.ts +25 -4
  12. package/lib/types/board.d.ts +56 -0
  13. package/lib/types/calendar.d.ts +71 -5
  14. package/lib/types/cardkit.d.ts +2 -2
  15. package/lib/types/compensation.d.ts +400 -0
  16. package/lib/types/contact.d.ts +55 -12
  17. package/lib/types/corehr.d.ts +1287 -79
  18. package/lib/types/directory.d.ts +3 -41
  19. package/lib/types/docx.d.ts +23 -0
  20. package/lib/types/drive.d.ts +107 -90
  21. package/lib/types/ehr.d.ts +11 -2
  22. package/lib/types/helpdesk.d.ts +15 -6
  23. package/lib/types/hire.d.ts +52 -3
  24. package/lib/types/human_authentication.d.ts +1 -1
  25. package/lib/types/im.d.ts +77 -21
  26. package/lib/types/index.d.ts +1670 -105
  27. package/lib/types/mail.d.ts +106 -16
  28. package/lib/types/payroll.d.ts +117 -81
  29. package/lib/types/performance.d.ts +1 -1
  30. package/lib/types/search.d.ts +4 -1
  31. package/lib/types/security_and_compliance.d.ts +254 -1
  32. package/lib/ws.d.ts +30 -0
  33. package/package.json +6 -3
  34. package/src/bot.ts +28 -15
  35. package/src/http.ts +10 -4
  36. package/src/types/acs.ts +4 -1
  37. package/src/types/aily.ts +3 -3
  38. package/src/types/apaas.ts +237 -38
  39. package/src/types/application.ts +20 -4
  40. package/src/types/approval.ts +0 -15
  41. package/src/types/attendance.ts +11 -5
  42. package/src/types/authen.ts +8 -2
  43. package/src/types/bitable.ts +25 -4
  44. package/src/types/board.ts +75 -2
  45. package/src/types/calendar.ts +88 -5
  46. package/src/types/cardkit.ts +2 -2
  47. package/src/types/compensation.ts +485 -0
  48. package/src/types/contact.ts +55 -12
  49. package/src/types/corehr.ts +1480 -123
  50. package/src/types/directory.ts +3 -53
  51. package/src/types/docx.ts +29 -0
  52. package/src/types/drive.ts +129 -112
  53. package/src/types/ehr.ts +11 -2
  54. package/src/types/helpdesk.ts +15 -6
  55. package/src/types/hire.ts +66 -3
  56. package/src/types/human_authentication.ts +1 -1
  57. package/src/types/im.ts +77 -21
  58. package/src/types/index.ts +1751 -107
  59. package/src/types/mail.ts +106 -16
  60. package/src/types/payroll.ts +146 -103
  61. package/src/types/performance.ts +1 -1
  62. package/src/types/search.ts +4 -1
  63. package/src/types/security_and_compliance.ts +292 -1
  64. package/src/ws.ts +183 -0
  65. package/lib/types/api.d.ts +0 -28510
  66. package/lib/types/internal.d.ts +0 -21
  67. package/lib/types/message/content.d.ts +0 -433
  68. package/lib/types/message/index.d.ts +0 -95
@@ -1,21 +0,0 @@
1
- import { Dict, HTTP } from '@satorijs/core';
2
- import { LarkBot } from '../bot';
3
- export interface Internal {
4
- }
5
- export interface BaseResponse {
6
- /** error code. would be 0 if success, and non-0 if failed. */
7
- code: number;
8
- /** error message. would be 'success' if success. */
9
- msg: string;
10
- }
11
- export interface InternalConfig {
12
- multipart?: boolean;
13
- type?: 'json-body' | 'binary';
14
- }
15
- export declare class Internal {
16
- private bot;
17
- constructor(bot: LarkBot);
18
- private _assertResponse;
19
- private _buildData;
20
- static define(routes: Dict<Partial<Record<HTTP.Method, string | string[]>>>, options?: InternalConfig): void;
21
- }
@@ -1,433 +0,0 @@
1
- declare global {
2
- namespace JSX {
3
- interface IntrinsicElements {
4
- 'lark:share-chat': {
5
- 'chat-id': string;
6
- };
7
- 'lark:share-user': {
8
- 'user-id': string;
9
- };
10
- 'lark:system': {
11
- 'need-rollup'?: boolean;
12
- };
13
- }
14
- }
15
- }
16
- export interface MessageContent {
17
- text: MessageContent.Text;
18
- post: MessageContent.RichText;
19
- image: MessageContent.Image;
20
- file: MessageContent.File;
21
- audio: MessageContent.Audio;
22
- media: MessageContent.Media;
23
- sticker: MessageContent.Sticker;
24
- share_chat: MessageContent.ShareChat;
25
- share_user: MessageContent.ShareUser;
26
- system: MessageContent.System;
27
- }
28
- export declare namespace MessageContent {
29
- interface Text {
30
- text: string;
31
- }
32
- interface Image {
33
- image_key: string;
34
- }
35
- interface ShareChat {
36
- chat_id: string;
37
- }
38
- interface ShareUser {
39
- user_id: string;
40
- }
41
- interface Audio {
42
- file_key: string;
43
- }
44
- interface Media {
45
- file_key: string;
46
- image_key?: string;
47
- }
48
- interface File {
49
- file_key: string;
50
- }
51
- interface Sticker {
52
- file_key: string;
53
- }
54
- interface System {
55
- type: 'divider';
56
- params: {
57
- divider_text: {
58
- text: string;
59
- i18n_text?: Record<string, string>;
60
- };
61
- };
62
- options?: {
63
- need_rollup?: boolean;
64
- };
65
- }
66
- interface RichText {
67
- [locale: string]: {
68
- title?: string;
69
- content: RichText.Paragraph[];
70
- };
71
- }
72
- namespace RichText {
73
- type Style = 'bold' | 'italic' | 'underline' | 'lineThrough';
74
- interface BaseElement<T extends string = string> {
75
- tag: T;
76
- }
77
- interface TextElement extends BaseElement<'text'> {
78
- text: string;
79
- un_escape?: boolean;
80
- style?: Style[];
81
- }
82
- interface LinkElement extends BaseElement<'a'> {
83
- text: string;
84
- href: string;
85
- style?: Style[];
86
- }
87
- interface AtElement extends BaseElement<'at'> {
88
- user_id: string;
89
- style?: Style[];
90
- }
91
- interface ImageElement extends BaseElement<'img'> {
92
- image_key: string;
93
- }
94
- interface MediaElement extends BaseElement<'media'> {
95
- file_key: string;
96
- image_key?: string;
97
- }
98
- interface EmotionElement extends BaseElement<'emoji'> {
99
- emoji_type: string;
100
- }
101
- interface CodeBlockElement extends BaseElement<'code_block'> {
102
- language?: string;
103
- text: string;
104
- }
105
- interface HRElement extends BaseElement<'hr'> {
106
- }
107
- interface MarkdownElement extends BaseElement<'md'> {
108
- text: string;
109
- }
110
- type InlineElement = TextElement | LinkElement | AtElement | EmotionElement | MarkdownElement;
111
- type BlockElement = ImageElement | MediaElement | CodeBlockElement | HRElement;
112
- type Paragraph = InlineElement[] | [BlockElement];
113
- }
114
- interface Card {
115
- config?: Card.Config;
116
- card_link?: Card.URLs;
117
- header?: Card.Header;
118
- elements: Card.Element[];
119
- }
120
- namespace Card {
121
- /** @see https://open.larksuite.com/document/common-capabilities/message-card/getting-started/card-structure/card-configuration */
122
- interface Config {
123
- enable_forward?: boolean;
124
- update_multi?: boolean;
125
- }
126
- interface URLs {
127
- url: string;
128
- pc_url?: string;
129
- ios_url?: string;
130
- android_url?: string;
131
- }
132
- /** @see https://open.larksuite.com/document/common-capabilities/message-card/message-cards-content/card-header */
133
- interface Header {
134
- title: I18nPlainTextElement;
135
- subtitle?: I18nPlainTextElement;
136
- template?: Header.Template;
137
- icon?: CustomIconElement;
138
- ud_icon?: StandardIconElement;
139
- text_tag_list?: TextTagElement[];
140
- i18n_text_tag_list?: Record<string, TextTagElement[]>;
141
- }
142
- namespace Header {
143
- type Template = 'blue' | 'wathet' | 'turquoise' | 'green' | 'yellow' | 'orange' | 'red' | 'carmine' | 'violet' | 'purple' | 'indigo' | 'grey' | 'default';
144
- }
145
- interface BaseElement<T extends string = string> {
146
- tag: T;
147
- }
148
- type TextSize = 'heading-0' | 'heading-1' | 'heading-2' | 'heading-3' | 'heading-4' | 'heading' | 'normal' | 'notation' | 'xxxx-large' | 'xxx-large' | 'xx-large' | 'x-large' | 'large' | 'medium' | 'small' | 'x-small';
149
- type TextAlign = 'left' | 'center' | 'right';
150
- interface PlainTextElement extends BaseElement<'plain_text'> {
151
- content: string;
152
- }
153
- interface I18nPlainTextElement extends PlainTextElement {
154
- i18n?: Record<string, string>;
155
- }
156
- interface DivPlainTextElement extends PlainTextElement {
157
- text_size?: TextSize;
158
- text_color?: string;
159
- text_align?: TextAlign;
160
- lines?: number;
161
- icon?: IconElement;
162
- }
163
- type IconElement = StandardIconElement | CustomIconElement;
164
- interface CustomIconElement extends BaseElement<'custom_icon'> {
165
- img_key: string;
166
- }
167
- interface StandardIconElement extends BaseElement<'standard_icon'> {
168
- token: string;
169
- color?: string;
170
- }
171
- interface TextTagElement extends BaseElement<'text_tag'> {
172
- text: PlainTextElement;
173
- color: TextTagElement.Color;
174
- }
175
- namespace TextTagElement {
176
- type Color = 'neutral' | 'blue' | 'torqoise' | 'lime' | 'orange' | 'violet' | 'indigo' | 'wathet' | 'green' | 'yellow' | 'red' | 'purple' | 'carmine';
177
- }
178
- interface BaseImageElement extends BaseElement<'image'> {
179
- img_key: string;
180
- alt?: PlainTextElement;
181
- }
182
- interface ImageElement extends BaseImageElement {
183
- title?: PlainTextElement;
184
- transparent?: string;
185
- preview?: boolean;
186
- corner_radius?: string;
187
- scale_type?: 'crop_center' | 'fit_horizontal' | 'crop_top';
188
- size?: 'large' | 'medium' | 'small' | 'tiny' | 'stretch_without_padding' | 'stretch' | string;
189
- /** @deprecated */
190
- custom_width?: number;
191
- /** @deprecated */
192
- compact_width?: boolean;
193
- /** @deprecated */
194
- mode?: 'crop_center' | 'fit_horizontal' | 'large' | 'medium' | 'small' | 'tiny';
195
- }
196
- interface HRElement extends BaseElement<'hr'> {
197
- }
198
- interface DivElement extends BaseElement<'div'> {
199
- text?: DivPlainTextElement;
200
- }
201
- interface MarkdownElement extends BaseElement<'markdown'> {
202
- content: string;
203
- text_size?: TextSize;
204
- text_align?: TextAlign;
205
- href?: Record<string, URLs>;
206
- }
207
- interface PersonElement extends BaseElement<'person'> {
208
- user_id: string;
209
- size?: 'large' | 'medium' | 'small' | 'extra_small';
210
- }
211
- interface PersonListElement extends BaseElement<'person_list'> {
212
- persons: {
213
- id: string;
214
- }[];
215
- size?: 'large' | 'medium' | 'small' | 'extra_small';
216
- show_name?: boolean;
217
- show_avatar?: boolean;
218
- }
219
- interface ChartElement extends BaseElement<'chart'> {
220
- chart_spec: {};
221
- aspect_ratio?: '1:1' | '2:1' | '4:3' | '16:9';
222
- color_theme?: 'brand' | 'rainbow' | 'complementary' | 'converse' | 'primary';
223
- preview?: boolean;
224
- height?: 'auto' | string;
225
- }
226
- interface TableElement extends BaseElement<'table'> {
227
- page_size?: number;
228
- row_height?: 'low' | 'medium' | 'high' | string;
229
- header_style?: TableElement.HeaderStyle;
230
- columns: TableElement.Column[];
231
- rows: object[];
232
- }
233
- namespace TableElement {
234
- interface HeaderStyle {
235
- text_align?: TextAlign;
236
- text_size?: TextSize;
237
- background_style?: 'grey' | 'none';
238
- text_color?: 'default' | 'grey';
239
- bold?: boolean;
240
- lines?: number;
241
- }
242
- interface Column {
243
- name: string;
244
- display_name?: string;
245
- width?: 'auto' | string;
246
- horizontal_align?: 'left' | 'center' | 'right';
247
- data_type?: 'text' | 'lark_md' | 'options' | 'number' | 'persons' | 'date' | 'markdown';
248
- format?: {
249
- percision?: number;
250
- symbol?: string;
251
- separator?: string;
252
- };
253
- date_format?: string;
254
- }
255
- }
256
- interface NoteElement extends BaseElement<'note'> {
257
- elements: NoteElement.InnerElement[];
258
- }
259
- namespace NoteElement {
260
- type InnerElement = IconElement | PlainTextElement | BaseImageElement;
261
- }
262
- interface FormElement extends BaseElement<'form'> {
263
- name: string;
264
- elements: Element[];
265
- confirm?: ConfirmElement;
266
- }
267
- interface ActionElement extends BaseElement<'action'> {
268
- actions: Element[];
269
- layout?: 'bisected' | 'trisection' | 'flow';
270
- }
271
- type ActionBehavior = OpenURLBehavior | CallbackBehavior;
272
- interface OpenURLBehavior {
273
- type: 'open_url';
274
- default_url: string;
275
- pc_url?: string;
276
- ios_url?: string;
277
- android_url?: string;
278
- }
279
- interface CallbackBehavior {
280
- type: 'callback';
281
- value: Record<string, string>;
282
- }
283
- interface BaseButtonElement extends BaseElement<'button'> {
284
- text: PlainTextElement;
285
- size?: ButtonElement.Size;
286
- icon?: IconElement;
287
- disabled?: boolean;
288
- behaviors?: ActionBehavior[];
289
- }
290
- interface ButtonElement extends BaseButtonElement {
291
- type?: ButtonElement.Type;
292
- width?: ButtonElement.Width;
293
- hover_tips?: PlainTextElement;
294
- disabled_tips?: PlainTextElement;
295
- confirm?: {
296
- title: PlainTextElement;
297
- text: PlainTextElement;
298
- };
299
- name?: string;
300
- required?: boolean;
301
- action_type?: 'link' | 'request' | 'multi' | 'form_submit' | 'form_reset';
302
- }
303
- interface ConfirmElement {
304
- title: PlainTextElement;
305
- text: PlainTextElement;
306
- }
307
- interface InputElement extends BaseElement<'input'> {
308
- name: string;
309
- required?: boolean;
310
- placeholder?: PlainTextElement;
311
- default_value?: string;
312
- disabled?: boolean;
313
- width?: 'default' | 'fill' | string;
314
- max_length?: number;
315
- input_type?: 'text' | 'multiline_text' | 'password';
316
- show_icon?: boolean;
317
- rows?: number;
318
- auto_resize?: boolean;
319
- max_rows?: number;
320
- label?: PlainTextElement;
321
- label_position?: 'top' | 'left';
322
- value?: string | object;
323
- behaviors?: ActionBehavior[];
324
- confirm?: ConfirmElement;
325
- fallback?: {
326
- tag?: string;
327
- text?: PlainTextElement;
328
- };
329
- }
330
- interface OverflowElement extends BaseElement<'overflow'> {
331
- width?: 'default' | 'fill' | string;
332
- options: OverflowElement.Option[];
333
- value?: object;
334
- confirm?: ConfirmElement;
335
- }
336
- namespace OverflowElement {
337
- interface Option {
338
- text?: PlainTextElement;
339
- multi_url?: URLs;
340
- value?: string;
341
- }
342
- }
343
- interface BaseSelectElement<T extends string = string> extends BaseElement<T> {
344
- type?: 'default' | 'text';
345
- name?: string;
346
- required?: boolean;
347
- disabled?: boolean;
348
- placeholder?: PlainTextElement;
349
- width?: 'default' | 'fill' | string;
350
- confirm?: ConfirmElement;
351
- }
352
- interface OptionElement {
353
- text: PlainTextElement;
354
- icon?: IconElement;
355
- value: string;
356
- }
357
- interface SelectElement extends BaseSelectElement<'select_static'> {
358
- options: OptionElement[];
359
- initial_option?: string;
360
- }
361
- interface MultiSelectElement extends BaseSelectElement<'multi_select_static'> {
362
- options: OptionElement[];
363
- selected_values?: string[];
364
- }
365
- interface SelectPersonElement extends BaseSelectElement<'select_person'> {
366
- options?: {
367
- value: string;
368
- }[];
369
- }
370
- interface MultiSelectPersonElement extends BaseSelectElement<'multi_select_person'> {
371
- options?: {
372
- value: string;
373
- }[];
374
- selected_values?: string[];
375
- }
376
- interface DatePickerElement extends BaseSelectElement<'date_picker'> {
377
- initial_date?: string;
378
- value?: object;
379
- }
380
- interface TimePickerElement extends BaseSelectElement<'picker_time'> {
381
- initial_time?: string;
382
- value?: object;
383
- }
384
- interface DateTimePickerElement extends BaseSelectElement<'picker_datetime'> {
385
- initial_datetime?: string;
386
- value?: object;
387
- }
388
- interface CheckerElement extends BaseElement<'checker'> {
389
- name?: string;
390
- checked?: boolean;
391
- disabled?: boolean;
392
- text?: CheckerElement.TextElement;
393
- overall_checkable?: boolean;
394
- button_area?: {
395
- pc_display_rule?: 'always' | 'on_hover';
396
- buttons?: CheckerElement.ButtonElement[];
397
- };
398
- checked_style?: {
399
- show_strikethrough?: boolean;
400
- opacity?: number;
401
- };
402
- margin?: string;
403
- padding?: string;
404
- confirm?: ConfirmElement;
405
- behaviors?: ActionBehavior[];
406
- hover_tips?: PlainTextElement;
407
- disable_tips?: PlainTextElement;
408
- }
409
- namespace CheckerElement {
410
- interface TextElement extends PlainTextElement {
411
- text_size?: 'normal' | 'heading' | 'notation';
412
- text_color?: string;
413
- text_align?: TextAlign;
414
- }
415
- interface ButtonElement extends BaseButtonElement {
416
- type: 'text' | 'primary_text' | 'danger_text';
417
- }
418
- }
419
- namespace ButtonElement {
420
- type Size = 'tiny' | 'small' | 'medium' | 'large';
421
- type Width = 'default' | 'fill' | string;
422
- type Type = 'default' | 'primary' | 'danger' | 'text' | 'primary_text' | 'danger_text' | 'primary_filled' | 'danger_filled' | 'laser';
423
- }
424
- type Element = DivElement | MarkdownElement | HRElement | ActionElement | NoteElement | ChartElement | TableElement | ImageElement | FormElement | InputElement | ButtonElement;
425
- }
426
- interface Template {
427
- type: 'template';
428
- data: {
429
- template_id: string;
430
- template_variable: object;
431
- };
432
- }
433
- }
@@ -1,95 +0,0 @@
1
- import { Lark, MessageContent } from '..';
2
- export * from './content';
3
- declare module '../event' {
4
- interface Events {
5
- /**
6
- * Receive message event.
7
- * @see https://open.larksuite.com/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/events/receive
8
- */
9
- 'im.message.receive_v1': {
10
- sender: {
11
- sender_id: Lark.UserIds;
12
- sender_type?: string;
13
- tenant_key: string;
14
- };
15
- message: {
16
- message_id: string;
17
- root_id: string;
18
- parent_id: string;
19
- thread_id: string;
20
- create_time: string;
21
- chat_id: string;
22
- chat_type: string;
23
- message_type: keyof MessageContent;
24
- content: string;
25
- mentions: {
26
- key: string;
27
- id: Lark.UserIds;
28
- name: string;
29
- tenant_key: string;
30
- }[];
31
- };
32
- };
33
- /**
34
- * Message read event.
35
- * @see https://open.larksuite.com/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/events/message_read
36
- */
37
- 'im.message.message_read_v1': {
38
- reader: {
39
- reader_id: Lark.UserIds;
40
- read_time: string;
41
- tenant_key: string;
42
- };
43
- message_id_list: string[];
44
- };
45
- /**
46
- * Message card callback event.
47
- * @see https://open.feishu.cn/document/uAjLw4CM/ukzMukzMukzM/feishu-cards/card-callback-communication
48
- */
49
- 'card.action.trigger': {
50
- operator: {
51
- tenant_key: string;
52
- user_id: string;
53
- union_id: string;
54
- open_id: string;
55
- };
56
- token: string;
57
- action: {
58
- value: any;
59
- tag: string;
60
- timezone?: string;
61
- name?: string;
62
- form_value?: any;
63
- input_value?: string;
64
- option?: string;
65
- options?: string[];
66
- checked?: boolean;
67
- };
68
- host: string;
69
- /** 卡片分发类型,固定取值为 url_preview,表示链接预览卡片。仅链接预览卡片有此字段。 */
70
- delivery_type?: 'url_preview';
71
- context: {
72
- url?: string;
73
- preview_token?: string;
74
- open_message_id: string;
75
- open_chat_id: string;
76
- };
77
- };
78
- /**
79
- * 机器人自定义菜单事件
80
- * @see https://open.feishu.cn/document/client-docs/bot-v3/events/menu
81
- */
82
- 'application.bot.menu_v6': {
83
- operator: {
84
- operator_name: string;
85
- operator_id: {
86
- union_id: string;
87
- user_id: string;
88
- open_id: string;
89
- };
90
- };
91
- event_key: string;
92
- timestamp: number;
93
- };
94
- }
95
- }