@satorijs/adapter-lark 3.9.1 → 3.9.3

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 (82) hide show
  1. package/lib/index.cjs +1078 -14
  2. package/lib/types/acs.d.ts +19 -19
  3. package/lib/types/admin.d.ts +58 -32
  4. package/lib/types/aily.d.ts +52 -52
  5. package/lib/types/apaas.d.ts +96 -96
  6. package/lib/types/application.d.ts +151 -67
  7. package/lib/types/approval.d.ts +182 -150
  8. package/lib/types/attendance.d.ts +395 -353
  9. package/lib/types/auth.d.ts +18 -18
  10. package/lib/types/authen.d.ts +24 -24
  11. package/lib/types/baike.d.ts +42 -42
  12. package/lib/types/bitable.d.ts +268 -184
  13. package/lib/types/calendar.d.ts +144 -144
  14. package/lib/types/cardkit.d.ts +8 -8
  15. package/lib/types/contact.d.ts +209 -137
  16. package/lib/types/corehr.d.ts +760 -620
  17. package/lib/types/document_ai.d.ts +68 -68
  18. package/lib/types/docx.d.ts +103 -95
  19. package/lib/types/drive.d.ts +236 -236
  20. package/lib/types/ehr.d.ts +26 -2
  21. package/lib/types/helpdesk.d.ts +155 -155
  22. package/lib/types/hire.d.ts +954 -510
  23. package/lib/types/im.d.ts +446 -446
  24. package/lib/types/index.d.ts +72 -30
  25. package/lib/types/lingo.d.ts +28 -28
  26. package/lib/types/mail.d.ts +192 -192
  27. package/lib/types/minutes.d.ts +4 -4
  28. package/lib/types/okr.d.ts +86 -58
  29. package/lib/types/passport.d.ts +13 -5
  30. package/lib/types/payroll.d.ts +13 -5
  31. package/lib/types/performance.d.ts +85 -79
  32. package/lib/types/personal_settings.d.ts +12 -12
  33. package/lib/types/report.d.ts +11 -5
  34. package/lib/types/search.d.ts +48 -24
  35. package/lib/types/sheets.d.ts +64 -64
  36. package/lib/types/speech_to_text.d.ts +4 -4
  37. package/lib/types/task.d.ts +191 -185
  38. package/lib/types/translation.d.ts +4 -4
  39. package/lib/types/vc.d.ts +335 -155
  40. package/lib/types/wiki.d.ts +48 -48
  41. package/package.json +1 -1
  42. package/src/internal.ts +1 -1
  43. package/src/types/acs.ts +24 -24
  44. package/src/types/admin.ts +69 -39
  45. package/src/types/aily.ts +61 -61
  46. package/src/types/apaas.ts +113 -113
  47. package/src/types/application.ts +173 -79
  48. package/src/types/approval.ts +202 -166
  49. package/src/types/attendance.ts +466 -421
  50. package/src/types/auth.ts +20 -20
  51. package/src/types/authen.ts +28 -28
  52. package/src/types/baike.ts +55 -55
  53. package/src/types/bitable.ts +305 -219
  54. package/src/types/calendar.ts +167 -167
  55. package/src/types/cardkit.ts +10 -10
  56. package/src/types/contact.ts +251 -169
  57. package/src/types/corehr.ts +903 -743
  58. package/src/types/document_ai.ts +85 -85
  59. package/src/types/docx.ts +117 -108
  60. package/src/types/drive.ts +298 -298
  61. package/src/types/ehr.ts +28 -2
  62. package/src/types/helpdesk.ts +181 -181
  63. package/src/types/hire.ts +1081 -591
  64. package/src/types/im.ts +521 -521
  65. package/src/types/index.ts +73 -30
  66. package/src/types/lingo.ts +36 -36
  67. package/src/types/mail.ts +215 -215
  68. package/src/types/minutes.ts +5 -5
  69. package/src/types/okr.ts +98 -66
  70. package/src/types/passport.ts +15 -6
  71. package/src/types/payroll.ts +15 -6
  72. package/src/types/performance.ts +98 -91
  73. package/src/types/personal_settings.ts +15 -15
  74. package/src/types/report.ts +13 -6
  75. package/src/types/search.ts +57 -29
  76. package/src/types/sheets.ts +80 -80
  77. package/src/types/speech_to_text.ts +5 -5
  78. package/src/types/task.ts +238 -231
  79. package/src/types/translation.ts +5 -5
  80. package/src/types/vc.ts +386 -186
  81. package/src/types/wiki.ts +59 -59
  82. package/src/utils.ts +12 -7
package/src/types/wiki.ts CHANGED
@@ -96,6 +96,11 @@ export interface GetWikiSpaceQuery {
96
96
  lang?: 'zh' | 'id' | 'de' | 'en' | 'es' | 'fr' | 'it' | 'pt' | 'vi' | 'ru' | 'hi' | 'th' | 'ko' | 'ja' | 'zh-HK' | 'zh-TW'
97
97
  }
98
98
 
99
+ export interface GetWikiSpaceResponse {
100
+ /** 知识空间 */
101
+ space?: Space
102
+ }
103
+
99
104
  export interface CreateWikiSpaceRequest {
100
105
  /** 知识空间名称 */
101
106
  name?: string
@@ -105,6 +110,11 @@ export interface CreateWikiSpaceRequest {
105
110
  open_sharing?: 'open' | 'closed'
106
111
  }
107
112
 
113
+ export interface CreateWikiSpaceResponse {
114
+ /** 知识空间信息 */
115
+ space?: Space
116
+ }
117
+
108
118
  export interface CreateWikiSpaceMemberRequest {
109
119
  /** 知识库协作者 ID 类型 */
110
120
  member_type: string
@@ -119,6 +129,11 @@ export interface CreateWikiSpaceMemberQuery {
119
129
  need_notification?: boolean
120
130
  }
121
131
 
132
+ export interface CreateWikiSpaceMemberResponse {
133
+ /** 知识库协作者 */
134
+ member?: Member
135
+ }
136
+
122
137
  export interface DeleteWikiSpaceMemberRequest {
123
138
  /** 知识库协作者 ID 类型 */
124
139
  member_type: string
@@ -128,6 +143,11 @@ export interface DeleteWikiSpaceMemberRequest {
128
143
  type?: 'user' | 'chat' | 'department'
129
144
  }
130
145
 
146
+ export interface DeleteWikiSpaceMemberResponse {
147
+ /** 成员信息 */
148
+ member: Member
149
+ }
150
+
131
151
  export interface UpdateWikiSpaceSettingRequest {
132
152
  /** 谁可以创建空间的一级页面: "admin_and_member" = 管理员和成员 "admin" - 仅管理员 */
133
153
  create_setting?: string
@@ -137,6 +157,11 @@ export interface UpdateWikiSpaceSettingRequest {
137
157
  comment_setting?: string
138
158
  }
139
159
 
160
+ export interface UpdateWikiSpaceSettingResponse {
161
+ /** 空间设置 */
162
+ setting?: Setting
163
+ }
164
+
140
165
  export interface CreateWikiSpaceNodeRequest {
141
166
  /** 文档类型,对于快捷方式,该字段是对应的实体的obj_type。 */
142
167
  obj_type: 'doc' | 'sheet' | 'mindnote' | 'bitable' | 'file' | 'docx' | 'slides'
@@ -150,6 +175,11 @@ export interface CreateWikiSpaceNodeRequest {
150
175
  title?: string
151
176
  }
152
177
 
178
+ export interface CreateWikiSpaceNodeResponse {
179
+ /** 节点 */
180
+ node?: Node
181
+ }
182
+
153
183
  export interface GetNodeWikiSpaceQuery {
154
184
  /** 文档的wiki token */
155
185
  token: string
@@ -157,6 +187,11 @@ export interface GetNodeWikiSpaceQuery {
157
187
  obj_type?: 'doc' | 'docx' | 'sheet' | 'mindnote' | 'bitable' | 'file' | 'slides' | 'wiki'
158
188
  }
159
189
 
190
+ export interface GetNodeWikiSpaceResponse {
191
+ /** 节点信息 */
192
+ node?: Node
193
+ }
194
+
160
195
  export interface ListWikiSpaceNodeQuery extends Pagination {
161
196
  /** 父节点token */
162
197
  parent_node_token?: string
@@ -169,6 +204,11 @@ export interface MoveWikiSpaceNodeRequest {
169
204
  target_space_id?: string
170
205
  }
171
206
 
207
+ export interface MoveWikiSpaceNodeResponse {
208
+ /** 移动后的节点信息 */
209
+ node?: Node
210
+ }
211
+
172
212
  export interface UpdateTitleWikiSpaceNodeRequest {
173
213
  /** 节点新标题 */
174
214
  title: string
@@ -183,6 +223,11 @@ export interface CopyWikiSpaceNodeRequest {
183
223
  title?: string
184
224
  }
185
225
 
226
+ export interface CopyWikiSpaceNodeResponse {
227
+ /** copy后的节点 */
228
+ node: Node
229
+ }
230
+
186
231
  export interface MoveDocsToWikiWikiSpaceNodeRequest {
187
232
  /** 节点的父亲token */
188
233
  parent_wiki_token?: string
@@ -194,65 +239,6 @@ export interface MoveDocsToWikiWikiSpaceNodeRequest {
194
239
  apply?: boolean
195
240
  }
196
241
 
197
- export interface GetWikiTaskQuery {
198
- /** 任务类型 */
199
- task_type: 'move'
200
- }
201
-
202
- export interface SearchWikiNodeRequest {
203
- /** 搜索关键词 */
204
- query: string
205
- /** 文档所属的知识空间ID,为空搜索所有 wiki */
206
- space_id?: string
207
- /** wiki token,不为空搜索该节点及其所有子节点,为空搜索所有 wiki(根据 space_id 选择 space) */
208
- node_id?: string
209
- }
210
-
211
- export interface GetWikiSpaceResponse {
212
- /** 知识空间 */
213
- space?: Space
214
- }
215
-
216
- export interface CreateWikiSpaceResponse {
217
- /** 知识空间信息 */
218
- space?: Space
219
- }
220
-
221
- export interface CreateWikiSpaceMemberResponse {
222
- /** 知识库协作者 */
223
- member?: Member
224
- }
225
-
226
- export interface DeleteWikiSpaceMemberResponse {
227
- /** 成员信息 */
228
- member: Member
229
- }
230
-
231
- export interface UpdateWikiSpaceSettingResponse {
232
- /** 空间设置 */
233
- setting?: Setting
234
- }
235
-
236
- export interface CreateWikiSpaceNodeResponse {
237
- /** 节点 */
238
- node?: Node
239
- }
240
-
241
- export interface GetNodeWikiSpaceResponse {
242
- /** 节点信息 */
243
- node?: Node
244
- }
245
-
246
- export interface MoveWikiSpaceNodeResponse {
247
- /** 移动后的节点信息 */
248
- node?: Node
249
- }
250
-
251
- export interface CopyWikiSpaceNodeResponse {
252
- /** copy后的节点 */
253
- node: Node
254
- }
255
-
256
242
  export interface MoveDocsToWikiWikiSpaceNodeResponse {
257
243
  /** 移动后的知识库token */
258
244
  wiki_token?: string
@@ -262,11 +248,25 @@ export interface MoveDocsToWikiWikiSpaceNodeResponse {
262
248
  applied?: boolean
263
249
  }
264
250
 
251
+ export interface GetWikiTaskQuery {
252
+ /** 任务类型 */
253
+ task_type: 'move'
254
+ }
255
+
265
256
  export interface GetWikiTaskResponse {
266
257
  /** 任务结果 */
267
258
  task: TaskResult
268
259
  }
269
260
 
261
+ export interface SearchWikiNodeRequest {
262
+ /** 搜索关键词 */
263
+ query: string
264
+ /** 文档所属的知识空间ID,为空搜索所有 wiki */
265
+ space_id?: string
266
+ /** wiki token,不为空搜索该节点及其所有子节点,为空搜索所有 wiki(根据 space_id 选择 space) */
267
+ node_id?: string
268
+ }
269
+
270
270
  Internal.define({
271
271
  '/wiki/v2/spaces': {
272
272
  GET: { name: 'listWikiSpace', pagination: { argIndex: 0 } },
package/src/utils.ts CHANGED
@@ -250,7 +250,7 @@ export async function adaptSession<C extends Context>(bot: LarkBot<C>, body: Eve
250
250
  if (body.event.action.value?._satori_type === 'command') {
251
251
  session.type = 'interaction/command'
252
252
  let content = body.event.action.value.content
253
- const args = [], options = Object.create(null)
253
+ const args: any[] = [], options = Object.create(null)
254
254
  for (const [key, value] of Object.entries(body.event.action.form_value ?? {})) {
255
255
  if (+key * 0 === 0) {
256
256
  args[+key] = value
@@ -258,18 +258,23 @@ export async function adaptSession<C extends Context>(bot: LarkBot<C>, body: Eve
258
258
  options[key] = value
259
259
  }
260
260
  }
261
- for (let i = 0; i < args.length; ++i) {
262
- if (i in args) {
263
- content += ` ${args[i]}`
261
+ const toArg = (value: any) => {
262
+ if (typeof value === 'string') {
263
+ return `'${value}'`
264
+ } else if (typeof value === 'number') {
265
+ return value
264
266
  } else {
265
- content += ` ''`
267
+ return `''`
266
268
  }
267
269
  }
270
+ for (let i = 0; i < args.length; ++i) {
271
+ content += ` ${toArg(args[i])}`
272
+ }
268
273
  for (const [key, value] of Object.entries(options)) {
269
- content += ` --${key} ${value}`
274
+ content += ` --${key} ${toArg(value)}`
270
275
  }
271
276
  if (body.event.action.input_value) {
272
- content += ` ${body.event.action.input_value}`
277
+ content += ` ${toArg(body.event.action.input_value)}`
273
278
  }
274
279
  session.content = content
275
280
  session.messageId = body.event.context.open_message_id