@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
@@ -1,306 +1,336 @@
1
- import { Classification, ClassificationFilter, Draft, Entity, EntityWord, MatchInfo, OuterInfo, Phrase, RelatedMeta, Term } from '.'
1
+ import * as Lark from '.'
2
2
  import { Internal, Pagination } from '../internal'
3
3
 
4
4
  declare module '../internal' {
5
5
  interface Internal {
6
- /**
7
- * 创建草稿
8
- * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/draft/create
9
- */
10
- createBaikeDraft(body: CreateBaikeDraftRequest, query?: CreateBaikeDraftQuery): Promise<CreateBaikeDraftResponse>
11
- /**
12
- * 更新草稿
13
- * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/draft/update
14
- */
15
- updateBaikeDraft(draft_id: string, body: UpdateBaikeDraftRequest, query?: UpdateBaikeDraftQuery): Promise<UpdateBaikeDraftResponse>
16
- /**
17
- * 创建免审词条
18
- * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/create
19
- */
20
- createBaikeEntity(body: CreateBaikeEntityRequest, query?: CreateBaikeEntityQuery): Promise<CreateBaikeEntityResponse>
21
- /**
22
- * 更新免审词条
23
- * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/update
24
- */
25
- updateBaikeEntity(entity_id: string, body: UpdateBaikeEntityRequest, query?: UpdateBaikeEntityQuery): Promise<UpdateBaikeEntityResponse>
26
- /**
27
- * 获取词条详情
28
- * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/get
29
- */
30
- getBaikeEntity(entity_id: string, query?: GetBaikeEntityQuery): Promise<GetBaikeEntityResponse>
31
- /**
32
- * 获取词条列表
33
- * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/list
34
- */
35
- listBaikeEntity(query?: ListBaikeEntityQuery): Promise<ListBaikeEntityResponse> & AsyncIterableIterator<Entity>
36
- /**
37
- * 精准搜索词条
38
- * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/match
39
- */
40
- matchBaikeEntity(body: MatchBaikeEntityRequest): Promise<MatchBaikeEntityResponse>
41
- /**
42
- * 模糊搜索词条
43
- * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/search
44
- */
45
- searchBaikeEntity(body: SearchBaikeEntityRequest, query?: SearchBaikeEntityQuery): Promise<SearchBaikeEntityResponse> & AsyncIterableIterator<Entity>
46
- /**
47
- * 词条高亮
48
- * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/highlight
49
- */
50
- highlightBaikeEntity(body: HighlightBaikeEntityRequest): Promise<HighlightBaikeEntityResponse>
51
- /**
52
- * 提取潜在的词条
53
- * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/extract
54
- */
55
- extractBaikeEntity(body: ExtractBaikeEntityRequest): Promise<ExtractBaikeEntityResponse>
56
- /**
57
- * 获取词典分类
58
- * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/classification/list
59
- */
60
- listBaikeClassification(query?: Pagination): Promise<ListBaikeClassificationResponse> & AsyncIterableIterator<Classification>
61
- /**
62
- * 上传图片
63
- * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/file/upload
64
- */
65
- uploadBaikeFile(form: UploadBaikeFileForm): Promise<UploadBaikeFileResponse>
66
- /**
67
- * 下载图片
68
- * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/file/download
69
- */
70
- downloadBaikeFile(file_token: string): Promise<ArrayBuffer>
6
+ baike: Baike.Methods
71
7
  }
72
8
  }
73
9
 
74
- export interface CreateBaikeDraftRequest {
75
- /** 实体词 Id */
76
- id?: string
77
- /** 词条名 */
78
- main_keys: Term[]
79
- /** 别名 */
80
- aliases?: Term[]
81
- /** 详情描述 */
82
- description?: string
83
- /** 相关数据 */
84
- related_meta?: RelatedMeta
85
- /** 外部 id 关联数据 */
86
- outer_info?: OuterInfo
87
- /** 富文本格式(当填写富文本内容时,description字段将会失效可不填写),支持的格式参考[企业百科指南](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/overview)中的释义部分 */
88
- rich_text?: string
89
- }
10
+ export namespace Baike {
11
+ export interface Methods {
12
+ draft: Draft.Methods
13
+ entity: Entity.Methods
14
+ classification: Classification.Methods
15
+ file: File.Methods
16
+ }
90
17
 
91
- export interface CreateBaikeDraftQuery {
92
- /** 此次调用中使用的用户ID的类型 */
93
- user_id_type?: 'user_id' | 'union_id' | 'open_id'
94
- }
18
+ export namespace Draft {
19
+ export interface Methods {
20
+ /**
21
+ * 创建草稿
22
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/draft/create
23
+ */
24
+ create(body: CreateRequest, query?: CreateQuery): Promise<CreateResponse>
25
+ /**
26
+ * 更新草稿
27
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/draft/update
28
+ */
29
+ update(draft_id: string, body: UpdateRequest, query?: UpdateQuery): Promise<UpdateResponse>
30
+ }
95
31
 
96
- export interface CreateBaikeDraftResponse {
97
- draft?: Draft
98
- }
32
+ export interface CreateRequest {
33
+ /** 实体词 Id */
34
+ id?: string
35
+ /** 词条名 */
36
+ main_keys: Lark.Term[]
37
+ /** 别名 */
38
+ aliases?: Lark.Term[]
39
+ /** 详情描述 */
40
+ description?: string
41
+ /** 相关数据 */
42
+ related_meta?: Lark.RelatedMeta
43
+ /** 外部 id 关联数据 */
44
+ outer_info?: Lark.OuterInfo
45
+ /** 富文本格式(当填写富文本内容时,description字段将会失效可不填写),支持的格式参考[企业百科指南](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/overview)中的释义部分 */
46
+ rich_text?: string
47
+ }
99
48
 
100
- export interface UpdateBaikeDraftRequest {
101
- /** 实体词 Id */
102
- id?: string
103
- /** 词条名 */
104
- main_keys: Term[]
105
- /** 别名 */
106
- aliases?: Term[]
107
- /** 详情描述 */
108
- description?: string
109
- /** 相关数据 */
110
- related_meta?: RelatedMeta
111
- /** 富文本格式(当填写富文本内容时,description字段将会失效可不填写),支持的格式参考[企业百科指南](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/overview)中的释义部分 */
112
- rich_text?: string
113
- }
49
+ export interface CreateQuery {
50
+ /** 此次调用中使用的用户ID的类型 */
51
+ user_id_type?: 'user_id' | 'union_id' | 'open_id'
52
+ }
114
53
 
115
- export interface UpdateBaikeDraftQuery {
116
- /** 此次调用中使用的用户ID的类型 */
117
- user_id_type?: 'user_id' | 'union_id' | 'open_id'
118
- }
54
+ export interface CreateResponse {
55
+ draft?: Lark.Draft
56
+ }
119
57
 
120
- export interface UpdateBaikeDraftResponse {
121
- draft?: Draft
122
- }
58
+ export interface UpdateRequest {
59
+ /** 实体词 Id */
60
+ id?: string
61
+ /** 词条名 */
62
+ main_keys: Lark.Term[]
63
+ /** 别名 */
64
+ aliases?: Lark.Term[]
65
+ /** 详情描述 */
66
+ description?: string
67
+ /** 相关数据 */
68
+ related_meta?: Lark.RelatedMeta
69
+ /** 富文本格式(当填写富文本内容时,description字段将会失效可不填写),支持的格式参考[企业百科指南](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/overview)中的释义部分 */
70
+ rich_text?: string
71
+ }
123
72
 
124
- export interface CreateBaikeEntityRequest {
125
- /** 词条名 */
126
- main_keys: Term[]
127
- /** 别名 */
128
- aliases?: Term[]
129
- /** 详情描述 */
130
- description?: string
131
- /** 相关数据 */
132
- related_meta?: RelatedMeta
133
- /** 外部 id 关联数据 */
134
- outer_info?: OuterInfo
135
- /** 富文本格式(当填写富文本内容时,description字段将会失效可不填写),支持的格式参考[企业百科指南](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/overview)中的释义部分 */
136
- rich_text?: string
137
- }
73
+ export interface UpdateQuery {
74
+ /** 此次调用中使用的用户ID的类型 */
75
+ user_id_type?: 'user_id' | 'union_id' | 'open_id'
76
+ }
138
77
 
139
- export interface CreateBaikeEntityQuery {
140
- /** 此次调用中使用的用户ID的类型 */
141
- user_id_type?: 'user_id' | 'union_id' | 'open_id'
142
- }
78
+ export interface UpdateResponse {
79
+ draft?: Lark.Draft
80
+ }
81
+ }
143
82
 
144
- export interface CreateBaikeEntityResponse {
145
- entity?: Entity
146
- }
83
+ export namespace Entity {
84
+ export interface Methods {
85
+ /**
86
+ * 创建免审词条
87
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/create
88
+ */
89
+ create(body: CreateRequest, query?: CreateQuery): Promise<CreateResponse>
90
+ /**
91
+ * 更新免审词条
92
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/update
93
+ */
94
+ update(entity_id: string, body: UpdateRequest, query?: UpdateQuery): Promise<UpdateResponse>
95
+ /**
96
+ * 获取词条详情
97
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/get
98
+ */
99
+ get(entity_id: string, query?: GetQuery): Promise<GetResponse>
100
+ /**
101
+ * 获取词条列表
102
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/list
103
+ */
104
+ list(query?: ListQuery): Promise<ListResponse> & AsyncIterableIterator<Lark.Entity>
105
+ /**
106
+ * 精准搜索词条
107
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/match
108
+ */
109
+ match(body: MatchRequest): Promise<MatchResponse>
110
+ /**
111
+ * 模糊搜索词条
112
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/search
113
+ */
114
+ search(body: SearchRequest, query?: SearchQuery): Promise<SearchResponse> & AsyncIterableIterator<Lark.Entity>
115
+ /**
116
+ * 词条高亮
117
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/highlight
118
+ */
119
+ highlight(body: HighlightRequest): Promise<HighlightResponse>
120
+ /**
121
+ * 提取潜在的词条
122
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/entity/extract
123
+ */
124
+ extract(body: ExtractRequest): Promise<ExtractResponse>
125
+ }
147
126
 
148
- export interface UpdateBaikeEntityRequest {
149
- /** 词条名 */
150
- main_keys: Term[]
151
- /** 别名 */
152
- aliases?: Term[]
153
- /** 详情描述 */
154
- description?: string
155
- /** 相关数据 */
156
- related_meta?: RelatedMeta
157
- /** 外部 id 关联数据 */
158
- outer_info?: OuterInfo
159
- /** 富文本格式(当填写富文本内容时,description字段将会失效可不填写),支持的格式参考[企业百科指南](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/overview)中的释义部分 */
160
- rich_text?: string
161
- }
127
+ export interface CreateRequest {
128
+ /** 词条名 */
129
+ main_keys: Lark.Term[]
130
+ /** 别名 */
131
+ aliases?: Lark.Term[]
132
+ /** 详情描述 */
133
+ description?: string
134
+ /** 相关数据 */
135
+ related_meta?: Lark.RelatedMeta
136
+ /** 外部 id 关联数据 */
137
+ outer_info?: Lark.OuterInfo
138
+ /** 富文本格式(当填写富文本内容时,description字段将会失效可不填写),支持的格式参考[企业百科指南](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/overview)中的释义部分 */
139
+ rich_text?: string
140
+ }
162
141
 
163
- export interface UpdateBaikeEntityQuery {
164
- /** 此次调用中使用的用户ID的类型 */
165
- user_id_type?: 'user_id' | 'union_id' | 'open_id'
166
- }
142
+ export interface CreateQuery {
143
+ /** 此次调用中使用的用户ID的类型 */
144
+ user_id_type?: 'user_id' | 'union_id' | 'open_id'
145
+ }
167
146
 
168
- export interface UpdateBaikeEntityResponse {
169
- entity?: Entity
170
- }
147
+ export interface CreateResponse {
148
+ entity?: Lark.Entity
149
+ }
171
150
 
172
- export interface GetBaikeEntityQuery {
173
- /** 外部系统 */
174
- provider?: string
175
- /** 词条在外部系统中对应的唯一 ID */
176
- outer_id?: string
177
- /** 此次调用中使用的用户ID的类型 */
178
- user_id_type?: 'user_id' | 'union_id' | 'open_id'
179
- }
151
+ export interface UpdateRequest {
152
+ /** 词条名 */
153
+ main_keys: Lark.Term[]
154
+ /** 别名 */
155
+ aliases?: Lark.Term[]
156
+ /** 详情描述 */
157
+ description?: string
158
+ /** 相关数据 */
159
+ related_meta?: Lark.RelatedMeta
160
+ /** 外部 id 关联数据 */
161
+ outer_info?: Lark.OuterInfo
162
+ /** 富文本格式(当填写富文本内容时,description字段将会失效可不填写),支持的格式参考[企业百科指南](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/overview)中的释义部分 */
163
+ rich_text?: string
164
+ }
180
165
 
181
- export interface GetBaikeEntityResponse {
182
- /** 实体词 */
183
- entity?: Entity
184
- }
166
+ export interface UpdateQuery {
167
+ /** 此次调用中使用的用户ID的类型 */
168
+ user_id_type?: 'user_id' | 'union_id' | 'open_id'
169
+ }
185
170
 
186
- export interface ListBaikeEntityQuery extends Pagination {
187
- /** 相关外部系统【可用来过滤词条数据】 */
188
- provider?: string
189
- /** 此次调用中使用的用户ID的类型 */
190
- user_id_type?: 'user_id' | 'union_id' | 'open_id'
191
- }
171
+ export interface UpdateResponse {
172
+ entity?: Lark.Entity
173
+ }
192
174
 
193
- export interface ListBaikeEntityResponse {
194
- entities?: Entity[]
195
- /** 分页标记,当还有下一页时会返回新的 page_token,否则 page_token 为空 */
196
- page_token?: string
197
- }
175
+ export interface GetQuery {
176
+ /** 外部系统 */
177
+ provider?: string
178
+ /** 词条在外部系统中对应的唯一 ID */
179
+ outer_id?: string
180
+ /** 此次调用中使用的用户ID的类型 */
181
+ user_id_type?: 'user_id' | 'union_id' | 'open_id'
182
+ }
198
183
 
199
- export interface MatchBaikeEntityRequest {
200
- /** 搜索关键词,将与词条名、别名进行精准匹配 */
201
- word: string
202
- }
184
+ export interface GetResponse {
185
+ /** 实体词 */
186
+ entity?: Lark.Entity
187
+ }
203
188
 
204
- export interface MatchBaikeEntityResponse {
205
- /** 匹配结果 */
206
- results?: MatchInfo[]
207
- }
189
+ export interface ListQuery extends Pagination {
190
+ /** 相关外部系统【可用来过滤词条数据】 */
191
+ provider?: string
192
+ /** 此次调用中使用的用户ID的类型 */
193
+ user_id_type?: 'user_id' | 'union_id' | 'open_id'
194
+ }
208
195
 
209
- export interface SearchBaikeEntityRequest {
210
- /** 搜索关键词 */
211
- query?: string
212
- /** 分类筛选 */
213
- classification_filter?: ClassificationFilter
214
- /** 词条的创建来源,1:用户主动创建,2:批量导入,3:官方词,4:OpenAPI 创建 */
215
- sources?: number[]
216
- /** 创建者 */
217
- creators?: string[]
218
- }
196
+ export interface ListResponse {
197
+ entities?: Lark.Entity[]
198
+ /** 分页标记,当还有下一页时会返回新的 page_token,否则 page_token 为空 */
199
+ page_token?: string
200
+ }
219
201
 
220
- export interface SearchBaikeEntityQuery extends Pagination {
221
- /** 此次调用中使用的用户ID的类型 */
222
- user_id_type?: 'user_id' | 'union_id' | 'open_id'
223
- }
202
+ export interface MatchRequest {
203
+ /** 搜索关键词,将与词条名、别名进行精准匹配 */
204
+ word: string
205
+ }
224
206
 
225
- export interface SearchBaikeEntityResponse {
226
- /** 数据数组 */
227
- entities?: Entity[]
228
- /** 分页标记,当还有下一页时会返回新的 page_token,否则 page_token 为空 */
229
- page_token?: string
230
- }
207
+ export interface MatchResponse {
208
+ /** 匹配结果 */
209
+ results?: Lark.MatchInfo[]
210
+ }
231
211
 
232
- export interface HighlightBaikeEntityRequest {
233
- /** 需要识别百科词条的内容(不超过1000字) */
234
- text: string
235
- }
212
+ export interface SearchRequest {
213
+ /** 搜索关键词 */
214
+ query?: string
215
+ /** 分类筛选 */
216
+ classification_filter?: Lark.ClassificationFilter
217
+ /** 词条的创建来源,1:用户主动创建,2:批量导入,3:官方词,4:OpenAPI 创建 */
218
+ sources?: number[]
219
+ /** 创建者 */
220
+ creators?: string[]
221
+ }
236
222
 
237
- export interface HighlightBaikeEntityResponse {
238
- /** 返回识别到的实体词信息 */
239
- phrases?: Phrase[]
240
- }
223
+ export interface SearchQuery extends Pagination {
224
+ /** 此次调用中使用的用户ID的类型 */
225
+ user_id_type?: 'user_id' | 'union_id' | 'open_id'
226
+ }
241
227
 
242
- export interface ExtractBaikeEntityRequest {
243
- /** 需要被提取百科实体词的文本(不会过滤租户已成为百科词条的内容) */
244
- text?: string
245
- }
228
+ export interface SearchResponse {
229
+ /** 数据数组 */
230
+ entities?: Lark.Entity[]
231
+ /** 分页标记,当还有下一页时会返回新的 page_token,否则 page_token 为空 */
232
+ page_token?: string
233
+ }
246
234
 
247
- export interface ExtractBaikeEntityResponse {
248
- /** 文本中可能的成为百科词条的实体词 */
249
- entity_word: EntityWord[]
250
- }
235
+ export interface HighlightRequest {
236
+ /** 需要识别百科词条的内容(不超过1000字) */
237
+ text: string
238
+ }
251
239
 
252
- export interface ListBaikeClassificationResponse {
253
- items?: Classification[]
254
- /** 分页标记,当还有下一页时会返回新的 page_token,否则 page_token 为空 */
255
- page_token?: string
256
- }
240
+ export interface HighlightResponse {
241
+ /** 返回识别到的实体词信息 */
242
+ phrases?: Lark.Phrase[]
243
+ }
257
244
 
258
- export interface UploadBaikeFileForm {
259
- /** 文件名称,当前仅支持上传图片且图片格式为以下六种:icon、bmp、gif、png、jpeg、webp */
260
- name: string
261
- /** 二进制文件内容,高宽像素在 320-4096 像素之间,大小在 3KB-10MB 的图片 */
262
- file: Blob
263
- }
245
+ export interface ExtractRequest {
246
+ /** 需要被提取百科实体词的文本(不会过滤租户已成为百科词条的内容) */
247
+ text?: string
248
+ }
249
+
250
+ export interface ExtractResponse {
251
+ /** 文本中可能的成为百科词条的实体词 */
252
+ entity_word: Lark.EntityWord[]
253
+ }
254
+ }
264
255
 
265
- export interface UploadBaikeFileResponse {
266
- /** 文件 token */
267
- file_token?: string
256
+ export namespace Classification {
257
+ export interface Methods {
258
+ /**
259
+ * 获取词典分类
260
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/classification/list
261
+ */
262
+ list(query?: Pagination): Promise<ListResponse> & AsyncIterableIterator<Lark.Classification>
263
+ }
264
+
265
+ export interface ListResponse {
266
+ items?: Lark.Classification[]
267
+ /** 分页标记,当还有下一页时会返回新的 page_token,否则 page_token 为空 */
268
+ page_token?: string
269
+ }
270
+ }
271
+
272
+ export namespace File {
273
+ export interface Methods {
274
+ /**
275
+ * 上传图片
276
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/file/upload
277
+ */
278
+ upload(form: UploadForm): Promise<UploadResponse>
279
+ /**
280
+ * 下载图片
281
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/file/download
282
+ */
283
+ download(file_token: string): Promise<ArrayBuffer>
284
+ }
285
+
286
+ export interface UploadForm {
287
+ /** 文件名称,当前仅支持上传图片且图片格式为以下六种:icon、bmp、gif、png、jpeg、webp */
288
+ name: string
289
+ /** 二进制文件内容,高宽像素在 320-4096 像素之间,大小在 3KB-10MB 的图片 */
290
+ file: Blob
291
+ }
292
+
293
+ export interface UploadResponse {
294
+ /** 文件 token */
295
+ file_token?: string
296
+ }
297
+ }
268
298
  }
269
299
 
270
300
  Internal.define({
271
301
  '/baike/v1/drafts': {
272
- POST: 'createBaikeDraft',
302
+ POST: 'baike.draft.create',
273
303
  },
274
304
  '/baike/v1/drafts/{draft_id}': {
275
- PUT: 'updateBaikeDraft',
305
+ PUT: 'baike.draft.update',
276
306
  },
277
307
  '/baike/v1/entities': {
278
- POST: 'createBaikeEntity',
279
- GET: { name: 'listBaikeEntity', pagination: { argIndex: 0, itemsKey: 'entities' } },
308
+ POST: 'baike.entity.create',
309
+ GET: { name: 'baike.entity.list', pagination: { argIndex: 0, itemsKey: 'entities' } },
280
310
  },
281
311
  '/baike/v1/entities/{entity_id}': {
282
- PUT: 'updateBaikeEntity',
283
- GET: 'getBaikeEntity',
312
+ PUT: 'baike.entity.update',
313
+ GET: 'baike.entity.get',
284
314
  },
285
315
  '/baike/v1/entities/match': {
286
- POST: 'matchBaikeEntity',
316
+ POST: 'baike.entity.match',
287
317
  },
288
318
  '/baike/v1/entities/search': {
289
- POST: { name: 'searchBaikeEntity', pagination: { argIndex: 1, itemsKey: 'entities' } },
319
+ POST: { name: 'baike.entity.search', pagination: { argIndex: 1, itemsKey: 'entities' } },
290
320
  },
291
321
  '/baike/v1/entities/highlight': {
292
- POST: 'highlightBaikeEntity',
322
+ POST: 'baike.entity.highlight',
293
323
  },
294
324
  '/baike/v1/entities/extract': {
295
- POST: 'extractBaikeEntity',
325
+ POST: 'baike.entity.extract',
296
326
  },
297
327
  '/baike/v1/classifications': {
298
- GET: { name: 'listBaikeClassification', pagination: { argIndex: 0 } },
328
+ GET: { name: 'baike.classification.list', pagination: { argIndex: 0 } },
299
329
  },
300
330
  '/baike/v1/files/upload': {
301
- POST: { name: 'uploadBaikeFile', multipart: true },
331
+ POST: { name: 'baike.file.upload', multipart: true },
302
332
  },
303
333
  '/baike/v1/files/{file_token}/download': {
304
- GET: { name: 'downloadBaikeFile', type: 'binary' },
334
+ GET: { name: 'baike.file.download', type: 'binary' },
305
335
  },
306
336
  })