@satorijs/adapter-lark 3.10.6 → 3.11.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 (116) hide show
  1. package/lib/index.cjs +2880 -2370
  2. package/lib/internal.d.ts +4 -4
  3. package/lib/types/acs.d.ts +212 -172
  4. package/lib/types/admin.d.ts +331 -291
  5. package/lib/types/aily.d.ts +331 -216
  6. package/lib/types/apaas.d.ts +646 -494
  7. package/lib/types/application.d.ts +559 -458
  8. package/lib/types/approval.d.ts +826 -791
  9. package/lib/types/attendance.d.ts +1094 -994
  10. package/lib/types/auth.d.ts +66 -61
  11. package/lib/types/authen.d.ts +221 -186
  12. package/lib/types/baike.d.ts +258 -233
  13. package/lib/types/base.d.ts +74 -0
  14. package/lib/types/bitable.d.ts +830 -770
  15. package/lib/types/board.d.ts +29 -14
  16. package/lib/types/calendar.d.ts +660 -605
  17. package/lib/types/cardkit.d.ts +149 -134
  18. package/lib/types/compensation.d.ts +84 -49
  19. package/lib/types/contact.d.ts +1279 -1204
  20. package/lib/types/corehr.d.ts +4982 -4526
  21. package/lib/types/directory.d.ts +447 -0
  22. package/lib/types/docs.d.ts +28 -18
  23. package/lib/types/document_ai.d.ts +347 -252
  24. package/lib/types/docx.d.ts +428 -383
  25. package/lib/types/drive.d.ts +1093 -1048
  26. package/lib/types/ehr.d.ts +66 -51
  27. package/lib/types/event.d.ts +16 -6
  28. package/lib/types/helpdesk.d.ts +816 -741
  29. package/lib/types/hire.d.ts +3955 -3589
  30. package/lib/types/human_authentication.d.ts +32 -22
  31. package/lib/types/im.d.ts +1420 -1295
  32. package/lib/types/index.d.ts +1422 -330
  33. package/lib/types/lingo.d.ts +279 -249
  34. package/lib/types/mail.d.ts +1032 -675
  35. package/lib/types/mdm.d.ts +105 -37
  36. package/lib/types/minutes.d.ts +73 -26
  37. package/lib/types/moments.d.ts +23 -13
  38. package/lib/types/okr.d.ts +266 -225
  39. package/lib/types/optical_char_recognition.d.ts +22 -12
  40. package/lib/types/passport.d.ts +58 -48
  41. package/lib/types/payroll.d.ts +210 -53
  42. package/lib/types/performance.d.ts +463 -414
  43. package/lib/types/personal_settings.d.ts +93 -82
  44. package/lib/types/report.d.ts +79 -58
  45. package/lib/types/search.d.ts +265 -235
  46. package/lib/types/security_and_compliance.d.ts +30 -19
  47. package/lib/types/sheets.d.ts +356 -321
  48. package/lib/types/speech_to_text.d.ts +44 -34
  49. package/lib/types/task.d.ts +998 -1087
  50. package/lib/types/tenant.d.ts +25 -15
  51. package/lib/types/translation.d.ts +42 -32
  52. package/lib/types/trust_party.d.ts +81 -0
  53. package/lib/types/vc.d.ts +1218 -1123
  54. package/lib/types/verification.d.ts +11 -6
  55. package/lib/types/wiki.d.ts +270 -235
  56. package/lib/types/workplace.d.ts +58 -38
  57. package/lib/utils.d.ts +2 -2
  58. package/package.json +4 -4
  59. package/src/bot.ts +15 -15
  60. package/src/internal.ts +29 -12
  61. package/src/message.ts +10 -10
  62. package/src/types/acs.ts +234 -186
  63. package/src/types/admin.ts +353 -305
  64. package/src/types/aily.ts +375 -233
  65. package/src/types/apaas.ts +754 -568
  66. package/src/types/application.ts +633 -507
  67. package/src/types/approval.ts +914 -872
  68. package/src/types/attendance.ts +1226 -1104
  69. package/src/types/auth.ts +72 -66
  70. package/src/types/authen.ts +233 -191
  71. package/src/types/baike.ts +276 -246
  72. package/src/types/base.ts +93 -0
  73. package/src/types/bitable.ts +966 -894
  74. package/src/types/board.ts +34 -16
  75. package/src/types/calendar.ts +751 -685
  76. package/src/types/cardkit.ts +164 -146
  77. package/src/types/compensation.ts +97 -55
  78. package/src/types/contact.ts +1465 -1375
  79. package/src/types/corehr.ts +5664 -5077
  80. package/src/types/directory.ts +569 -0
  81. package/src/types/docs.ts +31 -19
  82. package/src/types/document_ai.ts +401 -287
  83. package/src/types/docx.ts +492 -438
  84. package/src/types/drive.ts +1266 -1213
  85. package/src/types/ehr.ts +71 -53
  86. package/src/types/event.ts +19 -7
  87. package/src/types/helpdesk.ts +930 -840
  88. package/src/types/hire.ts +4453 -4019
  89. package/src/types/human_authentication.ts +35 -23
  90. package/src/types/im.ts +1626 -1476
  91. package/src/types/index.ts +1532 -346
  92. package/src/types/lingo.ts +299 -263
  93. package/src/types/mail.ts +1231 -779
  94. package/src/types/mdm.ts +122 -39
  95. package/src/types/minutes.ts +88 -28
  96. package/src/types/moments.ts +26 -14
  97. package/src/types/okr.ts +286 -238
  98. package/src/types/optical_char_recognition.ts +25 -13
  99. package/src/types/passport.ts +62 -50
  100. package/src/types/payroll.ts +254 -57
  101. package/src/types/performance.ts +528 -467
  102. package/src/types/personal_settings.ts +101 -89
  103. package/src/types/report.ts +86 -62
  104. package/src/types/search.ts +285 -249
  105. package/src/types/security_and_compliance.ts +33 -21
  106. package/src/types/sheets.ts +421 -379
  107. package/src/types/speech_to_text.ts +48 -36
  108. package/src/types/task.ts +1152 -1260
  109. package/src/types/tenant.ts +29 -17
  110. package/src/types/translation.ts +46 -34
  111. package/src/types/trust_party.ts +110 -0
  112. package/src/types/vc.ts +1397 -1283
  113. package/src/types/verification.ts +13 -7
  114. package/src/types/wiki.ts +293 -251
  115. package/src/types/workplace.ts +65 -41
  116. package/src/utils.ts +3 -3
@@ -1,321 +1,357 @@
1
- import { Classification, ClassificationFilter, Draft, Entity, I18nEntryDesc, MatchInfo, OuterInfo, Phrase, RelatedMeta, Repo, Term } from '.'
2
- import { Internal, Pagination } from '../internal'
1
+ import * as Lark from '.'
2
+ import { Internal, Paginated, 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/lingo-v1/draft/create
9
- */
10
- createLingoDraft(body: CreateLingoDraftRequest, query?: CreateLingoDraftQuery): Promise<CreateLingoDraftResponse>
11
- /**
12
- * 更新草稿
13
- * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/lingo-v1/draft/update
14
- */
15
- updateLingoDraft(draft_id: string, body: UpdateLingoDraftRequest, query?: UpdateLingoDraftQuery): Promise<UpdateLingoDraftResponse>
16
- /**
17
- * 创建免审词条
18
- * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/lingo-v1/entity/create
19
- */
20
- createLingoEntity(body: CreateLingoEntityRequest, query?: CreateLingoEntityQuery): Promise<CreateLingoEntityResponse>
21
- /**
22
- * 更新免审词条
23
- * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/lingo-v1/entity/update
24
- */
25
- updateLingoEntity(entity_id: string, body: UpdateLingoEntityRequest, query?: UpdateLingoEntityQuery): Promise<UpdateLingoEntityResponse>
26
- /**
27
- * 删除免审词条
28
- * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/lingo-v1/entity/delete
29
- */
30
- deleteLingoEntity(entity_id: string, query?: DeleteLingoEntityQuery): Promise<void>
31
- /**
32
- * 获取词条详情
33
- * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/lingo-v1/entity/get
34
- */
35
- getLingoEntity(entity_id: string, query?: GetLingoEntityQuery): Promise<GetLingoEntityResponse>
36
- /**
37
- * 获取词条列表
38
- * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/lingo-v1/entity/list
39
- */
40
- listLingoEntity(query?: ListLingoEntityQuery): Paginated<Entity, 'entities'>
41
- /**
42
- * 精准搜索词条
43
- * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/lingo-v1/entity/match
44
- */
45
- matchLingoEntity(body: MatchLingoEntityRequest, query?: MatchLingoEntityQuery): Promise<MatchLingoEntityResponse>
46
- /**
47
- * 模糊搜索词条
48
- * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/lingo-v1/entity/search
49
- */
50
- searchLingoEntity(body: SearchLingoEntityRequest, query?: SearchLingoEntityQuery): Paginated<Entity, 'entities'>
51
- /**
52
- * 词条高亮
53
- * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/lingo-v1/entity/highlight
54
- */
55
- highlightLingoEntity(body: HighlightLingoEntityRequest): Promise<HighlightLingoEntityResponse>
56
- /**
57
- * 获取词典分类
58
- * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/lingo-v1/classification/list
59
- */
60
- listLingoClassification(query?: ListLingoClassificationQuery): Paginated<Classification>
61
- /**
62
- * 获取词库列表
63
- * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/lingo-v1/repo/list
64
- */
65
- listLingoRepo(): Promise<ListLingoRepoResponse>
66
- /**
67
- * 上传图片
68
- * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/lingo-v1/file/upload
69
- */
70
- uploadLingoFile(form: UploadLingoFileForm): Promise<UploadLingoFileResponse>
71
- /**
72
- * 下载图片
73
- * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/lingo-v1/file/download
74
- */
75
- downloadLingoFile(file_token: string): Promise<ArrayBuffer>
6
+ lingo: Lingo.Methods
76
7
  }
77
8
  }
78
9
 
79
- export interface CreateLingoDraftRequest {
80
- /** 实体词 Id */
81
- id?: string
82
- /** 词条名 */
83
- main_keys: Term[]
84
- /** 别名 */
85
- aliases?: Term[]
86
- /** 详情描述 */
87
- description?: string
88
- /** 相关数据 */
89
- related_meta?: RelatedMeta
90
- /** 外部 id 关联数据 */
91
- outer_info?: OuterInfo
92
- /** 富文本格式(当填写富文本内容时,description字段将会失效可不填写),支持的格式参考[企业百科指南](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/overview)中的释义部分 */
93
- rich_text?: string
94
- /** 国际化的词条释义 */
95
- i18n_descs?: I18nEntryDesc[]
96
- }
10
+ export namespace Lingo {
11
+ export interface Methods {
12
+ draft: Draft.Methods
13
+ entity: Entity.Methods
14
+ classification: Classification.Methods
15
+ repo: Repo.Methods
16
+ file: File.Methods
17
+ }
97
18
 
98
- export interface CreateLingoDraftQuery {
99
- /** 词库ID */
100
- repo_id?: string
101
- /** 此次调用中使用的用户ID的类型 */
102
- user_id_type?: 'user_id' | 'union_id' | 'open_id'
103
- }
19
+ export namespace Draft {
20
+ export interface Methods {
21
+ /**
22
+ * 创建草稿
23
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/lingo-v1/draft/create
24
+ */
25
+ create(body: CreateRequest, query?: CreateQuery): Promise<CreateResponse>
26
+ /**
27
+ * 更新草稿
28
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/lingo-v1/draft/update
29
+ */
30
+ update(draft_id: string, body: UpdateRequest, query?: UpdateQuery): Promise<UpdateResponse>
31
+ }
104
32
 
105
- export interface CreateLingoDraftResponse {
106
- draft?: Draft
107
- }
33
+ export interface CreateRequest {
34
+ /** 实体词 Id */
35
+ id?: string
36
+ /** 词条名 */
37
+ main_keys: Lark.Term[]
38
+ /** 别名 */
39
+ aliases?: Lark.Term[]
40
+ /** 详情描述 */
41
+ description?: string
42
+ /** 相关数据 */
43
+ related_meta?: Lark.RelatedMeta
44
+ /** 外部 id 关联数据 */
45
+ outer_info?: Lark.OuterInfo
46
+ /** 富文本格式(当填写富文本内容时,description字段将会失效可不填写),支持的格式参考[企业百科指南](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/overview)中的释义部分 */
47
+ rich_text?: string
48
+ /** 国际化的词条释义 */
49
+ i18n_descs?: Lark.I18nEntryDesc[]
50
+ }
108
51
 
109
- export interface UpdateLingoDraftRequest {
110
- /** 实体词 Id */
111
- id?: string
112
- /** 词条名 */
113
- main_keys: Term[]
114
- /** 别名 */
115
- aliases?: Term[]
116
- /** 详情描述 */
117
- description?: string
118
- /** 相关数据 */
119
- related_meta?: RelatedMeta
120
- /** 富文本格式(当填写富文本内容时,description字段将会失效可不填写),支持的格式参考[企业百科指南](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/overview)中的释义部分 */
121
- rich_text?: string
122
- /** 国际化的词条释义 */
123
- i18n_descs?: I18nEntryDesc[]
124
- }
52
+ export interface CreateQuery {
53
+ /** 词库ID */
54
+ repo_id?: string
55
+ /** 此次调用中使用的用户ID的类型 */
56
+ user_id_type?: 'user_id' | 'union_id' | 'open_id'
57
+ }
125
58
 
126
- export interface UpdateLingoDraftQuery {
127
- /** 此次调用中使用的用户ID的类型 */
128
- user_id_type?: 'user_id' | 'union_id' | 'open_id'
129
- }
59
+ export interface CreateResponse {
60
+ draft?: Lark.Draft
61
+ }
130
62
 
131
- export interface UpdateLingoDraftResponse {
132
- draft?: Draft
133
- }
63
+ export interface UpdateRequest {
64
+ /** 实体词 Id */
65
+ id?: string
66
+ /** 词条名 */
67
+ main_keys: Lark.Term[]
68
+ /** 别名 */
69
+ aliases?: Lark.Term[]
70
+ /** 详情描述 */
71
+ description?: string
72
+ /** 相关数据 */
73
+ related_meta?: Lark.RelatedMeta
74
+ /** 富文本格式(当填写富文本内容时,description字段将会失效可不填写),支持的格式参考[企业百科指南](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/overview)中的释义部分 */
75
+ rich_text?: string
76
+ /** 国际化的词条释义 */
77
+ i18n_descs?: Lark.I18nEntryDesc[]
78
+ }
134
79
 
135
- export interface CreateLingoEntityRequest {
136
- /** 词条名 */
137
- main_keys: Term[]
138
- /** 别名 */
139
- aliases?: Term[]
140
- /** 详情描述 */
141
- description?: string
142
- /** 相关数据 */
143
- related_meta?: RelatedMeta
144
- /** 外部 id 关联数据 */
145
- outer_info?: OuterInfo
146
- /** 富文本格式(当填写富文本内容时,description字段将会失效可不填写),支持的格式参考[企业百科指南](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/overview)中的释义部分 */
147
- rich_text?: string
148
- /** 国际化的词条释义 */
149
- i18n_descs?: I18nEntryDesc[]
150
- }
80
+ export interface UpdateQuery {
81
+ /** 此次调用中使用的用户ID的类型 */
82
+ user_id_type?: 'user_id' | 'union_id' | 'open_id'
83
+ }
151
84
 
152
- export interface CreateLingoEntityQuery {
153
- /** 词库 ID */
154
- repo_id?: string
155
- /** 此次调用中使用的用户ID的类型 */
156
- user_id_type?: 'user_id' | 'union_id' | 'open_id'
157
- }
85
+ export interface UpdateResponse {
86
+ draft?: Lark.Draft
87
+ }
88
+ }
158
89
 
159
- export interface CreateLingoEntityResponse {
160
- entity?: Entity
161
- }
90
+ export namespace Entity {
91
+ export interface Methods {
92
+ /**
93
+ * 创建免审词条
94
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/lingo-v1/entity/create
95
+ */
96
+ create(body: CreateRequest, query?: CreateQuery): Promise<CreateResponse>
97
+ /**
98
+ * 更新免审词条
99
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/lingo-v1/entity/update
100
+ */
101
+ update(entity_id: string, body: UpdateRequest, query?: UpdateQuery): Promise<UpdateResponse>
102
+ /**
103
+ * 删除免审词条
104
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/lingo-v1/entity/delete
105
+ */
106
+ delete(entity_id: string, query?: DeleteQuery): Promise<void>
107
+ /**
108
+ * 获取词条详情
109
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/lingo-v1/entity/get
110
+ */
111
+ get(entity_id: string, query?: GetQuery): Promise<GetResponse>
112
+ /**
113
+ * 获取词条列表
114
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/lingo-v1/entity/list
115
+ */
116
+ list(query?: ListQuery): Paginated<Lark.Entity, 'entities'>
117
+ /**
118
+ * 精准搜索词条
119
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/lingo-v1/entity/match
120
+ */
121
+ match(body: MatchRequest, query?: MatchQuery): Promise<MatchResponse>
122
+ /**
123
+ * 模糊搜索词条
124
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/lingo-v1/entity/search
125
+ */
126
+ search(body: SearchRequest, query?: SearchQuery): Paginated<Lark.Entity, 'entities'>
127
+ /**
128
+ * 词条高亮
129
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/lingo-v1/entity/highlight
130
+ */
131
+ highlight(body: HighlightRequest): Promise<HighlightResponse>
132
+ }
162
133
 
163
- export interface UpdateLingoEntityRequest {
164
- /** 词条名 */
165
- main_keys: Term[]
166
- /** 别名 */
167
- aliases?: Term[]
168
- /** 详情描述 */
169
- description?: string
170
- /** 相关数据 */
171
- related_meta?: RelatedMeta
172
- /** 外部 id 关联数据 */
173
- outer_info?: OuterInfo
174
- /** 富文本格式(当填写富文本内容时,description字段将会失效可不填写),支持的格式参考[企业百科指南](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/overview)中的释义部分 */
175
- rich_text?: string
176
- /** 国际化的词条释义 */
177
- i18n_descs?: I18nEntryDesc[]
178
- }
134
+ export interface CreateRequest {
135
+ /** 词条名 */
136
+ main_keys: Lark.Term[]
137
+ /** 别名 */
138
+ aliases?: Lark.Term[]
139
+ /** 详情描述 */
140
+ description?: string
141
+ /** 相关数据 */
142
+ related_meta?: Lark.RelatedMeta
143
+ /** 外部 id 关联数据 */
144
+ outer_info?: Lark.OuterInfo
145
+ /** 富文本格式(当填写富文本内容时,description字段将会失效可不填写),支持的格式参考[企业百科指南](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/overview)中的释义部分 */
146
+ rich_text?: string
147
+ /** 国际化的词条释义 */
148
+ i18n_descs?: Lark.I18nEntryDesc[]
149
+ }
179
150
 
180
- export interface UpdateLingoEntityQuery {
181
- /** 此次调用中使用的用户ID的类型 */
182
- user_id_type?: 'user_id' | 'union_id' | 'open_id'
183
- }
151
+ export interface CreateQuery {
152
+ /** 词库 ID */
153
+ repo_id?: string
154
+ /** 此次调用中使用的用户ID的类型 */
155
+ user_id_type?: 'user_id' | 'union_id' | 'open_id'
156
+ }
184
157
 
185
- export interface UpdateLingoEntityResponse {
186
- entity?: Entity
187
- }
158
+ export interface CreateResponse {
159
+ entity?: Lark.Entity
160
+ }
188
161
 
189
- export interface DeleteLingoEntityQuery {
190
- /** 数据提供方(使用时需要将路径中的词条 ID 固定为:enterprise_0,且提供 provider 和 outer_id) */
191
- provider?: string
192
- /** 外部唯一 id(使用时需要将路径中的词条 ID 固定为:enterprise_0,且提供 provider 和 outer_id) */
193
- outer_id?: string
194
- }
162
+ export interface UpdateRequest {
163
+ /** 词条名 */
164
+ main_keys: Lark.Term[]
165
+ /** 别名 */
166
+ aliases?: Lark.Term[]
167
+ /** 详情描述 */
168
+ description?: string
169
+ /** 相关数据 */
170
+ related_meta?: Lark.RelatedMeta
171
+ /** 外部 id 关联数据 */
172
+ outer_info?: Lark.OuterInfo
173
+ /** 富文本格式(当填写富文本内容时,description字段将会失效可不填写),支持的格式参考[企业百科指南](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/baike-v1/overview)中的释义部分 */
174
+ rich_text?: string
175
+ /** 国际化的词条释义 */
176
+ i18n_descs?: Lark.I18nEntryDesc[]
177
+ }
195
178
 
196
- export interface GetLingoEntityQuery {
197
- /** 数据提供方(使用时需要将路径中的实体词 ID 固定为:enterprise_0,且提供 provider 和 outer_id) */
198
- provider?: string
199
- /** 外部唯一 id(使用时需要将路径中的实体词 ID 固定为:enterprise_0,且提供 provider 和 outer_id) */
200
- outer_id?: string
201
- /** 此次调用中使用的用户ID的类型 */
202
- user_id_type?: 'user_id' | 'union_id' | 'open_id'
203
- }
179
+ export interface UpdateQuery {
180
+ /** 此次调用中使用的用户ID的类型 */
181
+ user_id_type?: 'user_id' | 'union_id' | 'open_id'
182
+ }
204
183
 
205
- export interface GetLingoEntityResponse {
206
- /** 实体词 */
207
- entity?: Entity
208
- }
184
+ export interface UpdateResponse {
185
+ entity?: Lark.Entity
186
+ }
209
187
 
210
- export interface ListLingoEntityQuery extends Pagination {
211
- /** 数据提供方【可用来过滤数据】 */
212
- provider?: string
213
- /** 词库 id */
214
- repo_id?: string
215
- /** 此次调用中使用的用户ID的类型 */
216
- user_id_type?: 'user_id' | 'union_id' | 'open_id'
217
- }
188
+ export interface DeleteQuery {
189
+ /** 数据提供方(使用时需要将路径中的词条 ID 固定为:enterprise_0,且提供 provider 和 outer_id) */
190
+ provider?: string
191
+ /** 外部唯一 id(使用时需要将路径中的词条 ID 固定为:enterprise_0,且提供 provider 和 outer_id) */
192
+ outer_id?: string
193
+ }
218
194
 
219
- export interface MatchLingoEntityRequest {
220
- /** 实体词主关键词、全称、别名全匹配 */
221
- word: string
222
- }
195
+ export interface GetQuery {
196
+ /** 数据提供方(使用时需要将路径中的实体词 ID 固定为:enterprise_0,且提供 provider 和 outer_id) */
197
+ provider?: string
198
+ /** 外部唯一 id(使用时需要将路径中的实体词 ID 固定为:enterprise_0,且提供 provider 和 outer_id) */
199
+ outer_id?: string
200
+ /** 此次调用中使用的用户ID的类型 */
201
+ user_id_type?: 'user_id' | 'union_id' | 'open_id'
202
+ }
223
203
 
224
- export interface MatchLingoEntityQuery {
225
- /** 词库ID */
226
- repo_id?: string
227
- }
204
+ export interface GetResponse {
205
+ /** 实体词 */
206
+ entity?: Lark.Entity
207
+ }
228
208
 
229
- export interface MatchLingoEntityResponse {
230
- /** 匹配结果 */
231
- results?: MatchInfo[]
232
- }
209
+ export interface ListQuery extends Pagination {
210
+ /** 数据提供方【可用来过滤数据】 */
211
+ provider?: string
212
+ /** 词库 id */
213
+ repo_id?: string
214
+ /** 此次调用中使用的用户ID的类型 */
215
+ user_id_type?: 'user_id' | 'union_id' | 'open_id'
216
+ }
233
217
 
234
- export interface SearchLingoEntityRequest {
235
- /** 搜索关键词 */
236
- query?: string
237
- /** 分类筛选 */
238
- classification_filter?: ClassificationFilter
239
- /** 词条的创建来源,1:用户主动创建,2:批量导入,3:官方词,4:OpenAPI 创建 */
240
- sources?: number[]
241
- /** 创建者 */
242
- creators?: string[]
243
- }
218
+ export interface MatchRequest {
219
+ /** 实体词主关键词、全称、别名全匹配 */
220
+ word: string
221
+ }
244
222
 
245
- export interface SearchLingoEntityQuery extends Pagination {
246
- /** 词库ID */
247
- repo_id?: string
248
- /** 此次调用中使用的用户ID的类型 */
249
- user_id_type?: 'user_id' | 'union_id' | 'open_id'
250
- }
223
+ export interface MatchQuery {
224
+ /** 词库ID */
225
+ repo_id?: string
226
+ }
251
227
 
252
- export interface HighlightLingoEntityRequest {
253
- /** 需要被识别实体词内容的一句话(不要超过1000字) */
254
- text: string
255
- }
228
+ export interface MatchResponse {
229
+ /** 匹配结果 */
230
+ results?: Lark.MatchInfo[]
231
+ }
256
232
 
257
- export interface HighlightLingoEntityResponse {
258
- /** 返回识别到的实体词信息 */
259
- phrases?: Phrase[]
260
- }
233
+ export interface SearchRequest {
234
+ /** 搜索关键词 */
235
+ query?: string
236
+ /** 分类筛选 */
237
+ classification_filter?: Lark.ClassificationFilter
238
+ /** 词条的创建来源,1:用户主动创建,2:批量导入,3:官方词,4:OpenAPI 创建 */
239
+ sources?: number[]
240
+ /** 创建者 */
241
+ creators?: string[]
242
+ }
261
243
 
262
- export interface ListLingoClassificationQuery extends Pagination {
263
- /** 词库ID */
264
- repo_id?: string
265
- }
244
+ export interface SearchQuery extends Pagination {
245
+ /** 词库ID */
246
+ repo_id?: string
247
+ /** 此次调用中使用的用户ID的类型 */
248
+ user_id_type?: 'user_id' | 'union_id' | 'open_id'
249
+ }
266
250
 
267
- export interface ListLingoRepoResponse {
268
- /** 词库列表 */
269
- items?: Repo[]
270
- }
251
+ export interface HighlightRequest {
252
+ /** 需要被识别实体词内容的一句话(不要超过1000字) */
253
+ text: string
254
+ }
271
255
 
272
- export interface UploadLingoFileForm {
273
- /** 文件名称,当前仅支持上传图片且图片格式为以下六种:icon、bmp、gif、png、jpeg、webp */
274
- name: string
275
- /** 二进制文件内容,高宽像素在 320-4096 像素之间,大小在 3KB-10MB 的图片 */
276
- file: Blob
277
- }
256
+ export interface HighlightResponse {
257
+ /** 返回识别到的实体词信息 */
258
+ phrases?: Lark.Phrase[]
259
+ }
260
+ }
278
261
 
279
- export interface UploadLingoFileResponse {
280
- /** 文件 token */
281
- file_token?: string
262
+ export namespace Classification {
263
+ export interface Methods {
264
+ /**
265
+ * 获取词典分类
266
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/lingo-v1/classification/list
267
+ */
268
+ list(query?: ListQuery): Paginated<Lark.Classification>
269
+ }
270
+
271
+ export interface ListQuery extends Pagination {
272
+ /** 词库ID */
273
+ repo_id?: string
274
+ }
275
+ }
276
+
277
+ export namespace Repo {
278
+ export interface Methods {
279
+ /**
280
+ * 获取词库列表
281
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/lingo-v1/repo/list
282
+ */
283
+ list(): Promise<ListResponse>
284
+ }
285
+
286
+ export interface ListResponse {
287
+ /** 词库列表 */
288
+ items?: Lark.Repo[]
289
+ }
290
+ }
291
+
292
+ export namespace File {
293
+ export interface Methods {
294
+ /**
295
+ * 上传图片
296
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/lingo-v1/file/upload
297
+ */
298
+ upload(form: UploadForm): Promise<UploadResponse>
299
+ /**
300
+ * 下载图片
301
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/lingo-v1/file/download
302
+ */
303
+ download(file_token: string): Promise<ArrayBuffer>
304
+ }
305
+
306
+ export interface UploadForm {
307
+ /** 文件名称,当前仅支持上传图片且图片格式为以下六种:icon、bmp、gif、png、jpeg、webp */
308
+ name: string
309
+ /** 二进制文件内容,高宽像素在 320-4096 像素之间,大小在 3KB-10MB 的图片 */
310
+ file: Blob
311
+ }
312
+
313
+ export interface UploadResponse {
314
+ /** 文件 token */
315
+ file_token?: string
316
+ }
317
+ }
282
318
  }
283
319
 
284
320
  Internal.define({
285
321
  '/lingo/v1/drafts': {
286
- POST: 'createLingoDraft',
322
+ POST: 'lingo.draft.create',
287
323
  },
288
324
  '/lingo/v1/drafts/{draft_id}': {
289
- PUT: 'updateLingoDraft',
325
+ PUT: 'lingo.draft.update',
290
326
  },
291
327
  '/lingo/v1/entities': {
292
- POST: 'createLingoEntity',
293
- GET: { name: 'listLingoEntity', pagination: { argIndex: 0, itemsKey: 'entities' } },
328
+ POST: 'lingo.entity.create',
329
+ GET: { name: 'lingo.entity.list', pagination: { argIndex: 0, itemsKey: 'entities' } },
294
330
  },
295
331
  '/lingo/v1/entities/{entity_id}': {
296
- PUT: 'updateLingoEntity',
297
- DELETE: 'deleteLingoEntity',
298
- GET: 'getLingoEntity',
332
+ PUT: 'lingo.entity.update',
333
+ DELETE: 'lingo.entity.delete',
334
+ GET: 'lingo.entity.get',
299
335
  },
300
336
  '/lingo/v1/entities/match': {
301
- POST: 'matchLingoEntity',
337
+ POST: 'lingo.entity.match',
302
338
  },
303
339
  '/lingo/v1/entities/search': {
304
- POST: { name: 'searchLingoEntity', pagination: { argIndex: 1, itemsKey: 'entities' } },
340
+ POST: { name: 'lingo.entity.search', pagination: { argIndex: 1, itemsKey: 'entities' } },
305
341
  },
306
342
  '/lingo/v1/entities/highlight': {
307
- POST: 'highlightLingoEntity',
343
+ POST: 'lingo.entity.highlight',
308
344
  },
309
345
  '/lingo/v1/classifications': {
310
- GET: { name: 'listLingoClassification', pagination: { argIndex: 0 } },
346
+ GET: { name: 'lingo.classification.list', pagination: { argIndex: 0 } },
311
347
  },
312
348
  '/lingo/v1/repos': {
313
- GET: 'listLingoRepo',
349
+ GET: 'lingo.repo.list',
314
350
  },
315
351
  '/lingo/v1/files/upload': {
316
- POST: { name: 'uploadLingoFile', multipart: true },
352
+ POST: { name: 'lingo.file.upload', multipart: true },
317
353
  },
318
354
  '/lingo/v1/files/{file_token}/download': {
319
- GET: { name: 'downloadLingoFile', type: 'binary' },
355
+ GET: { name: 'lingo.file.download', type: 'binary' },
320
356
  },
321
357
  })