@openclaw-china/dingtalk 2026.3.8-1 → 2026.3.8-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.
- package/dist/index.d.ts +525 -69
- package/dist/index.js +510 -104
- package/dist/index.js.map +1 -1
- package/openclaw.plugin.json +55 -11
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* 钉钉账户级配置 Schema
|
|
5
5
|
*
|
|
6
6
|
* 配置字段说明:
|
|
7
7
|
* - enabled: 是否启用该渠道
|
|
@@ -19,13 +19,15 @@ import { z } from 'zod';
|
|
|
19
19
|
* - maxFileSizeMB: 媒体文件大小限制 (MB)
|
|
20
20
|
* - inboundMedia: 入站媒体归档与保留策略
|
|
21
21
|
*/
|
|
22
|
-
declare const
|
|
22
|
+
declare const DingtalkAccountSchema: z.ZodObject<{
|
|
23
|
+
/** 账户显示名 */
|
|
24
|
+
name: z.ZodOptional<z.ZodString>;
|
|
23
25
|
/** 是否启用钉钉渠道 */
|
|
24
26
|
enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
25
27
|
/** 钉钉应用 AppKey (clientId) */
|
|
26
|
-
clientId: z.ZodOptional<z.ZodString>;
|
|
28
|
+
clientId: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, unknown>;
|
|
27
29
|
/** 钉钉应用 AppSecret (clientSecret) */
|
|
28
|
-
clientSecret: z.ZodOptional<z.ZodString>;
|
|
30
|
+
clientSecret: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, unknown>;
|
|
29
31
|
/** 单聊策略: open=开放, pairing=配对, allowlist=白名单 */
|
|
30
32
|
dmPolicy: z.ZodDefault<z.ZodOptional<z.ZodEnum<["open", "pairing", "allowlist"]>>>;
|
|
31
33
|
/** 群聊策略: open=开放, allowlist=白名单, disabled=禁用 */
|
|
@@ -71,6 +73,7 @@ declare const DingtalkConfigSchema: z.ZodObject<{
|
|
|
71
73
|
longTaskNoticeDelayMs: number;
|
|
72
74
|
enableAICard: boolean;
|
|
73
75
|
maxFileSizeMB: number;
|
|
76
|
+
name?: string | undefined;
|
|
74
77
|
clientId?: string | undefined;
|
|
75
78
|
clientSecret?: string | undefined;
|
|
76
79
|
allowFrom?: string[] | undefined;
|
|
@@ -82,9 +85,10 @@ declare const DingtalkConfigSchema: z.ZodObject<{
|
|
|
82
85
|
keepDays?: number | undefined;
|
|
83
86
|
} | undefined;
|
|
84
87
|
}, {
|
|
88
|
+
name?: string | undefined;
|
|
85
89
|
enabled?: boolean | undefined;
|
|
86
|
-
clientId?:
|
|
87
|
-
clientSecret?:
|
|
90
|
+
clientId?: unknown;
|
|
91
|
+
clientSecret?: unknown;
|
|
88
92
|
dmPolicy?: "open" | "pairing" | "allowlist" | undefined;
|
|
89
93
|
groupPolicy?: "open" | "allowlist" | "disabled" | undefined;
|
|
90
94
|
requireMention?: boolean | undefined;
|
|
@@ -102,31 +106,243 @@ declare const DingtalkConfigSchema: z.ZodObject<{
|
|
|
102
106
|
keepDays?: number | undefined;
|
|
103
107
|
} | undefined;
|
|
104
108
|
}>;
|
|
105
|
-
type DingtalkConfig = z.infer<typeof DingtalkConfigSchema>;
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* 发送消息结果
|
|
109
|
-
*/
|
|
110
|
-
interface DingtalkSendResult {
|
|
111
|
-
/** 消息 ID */
|
|
112
|
-
messageId: string;
|
|
113
|
-
/** 会话 ID */
|
|
114
|
-
conversationId: string;
|
|
115
|
-
}
|
|
116
109
|
/**
|
|
117
|
-
*
|
|
118
|
-
* 用于 ChannelPlugin config 适配器
|
|
110
|
+
* 钉钉渠道配置 Schema(支持多账户)
|
|
119
111
|
*/
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
|
|
123
|
-
/**
|
|
112
|
+
declare const DingtalkConfigSchema: z.ZodObject<{
|
|
113
|
+
/** 账户显示名 */
|
|
114
|
+
name: z.ZodOptional<z.ZodString>;
|
|
115
|
+
/** 是否启用钉钉渠道 */
|
|
116
|
+
enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
117
|
+
/** 钉钉应用 AppKey (clientId) */
|
|
118
|
+
clientId: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, unknown>;
|
|
119
|
+
/** 钉钉应用 AppSecret (clientSecret) */
|
|
120
|
+
clientSecret: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, unknown>;
|
|
121
|
+
/** 单聊策略: open=开放, pairing=配对, allowlist=白名单 */
|
|
122
|
+
dmPolicy: z.ZodDefault<z.ZodOptional<z.ZodEnum<["open", "pairing", "allowlist"]>>>;
|
|
123
|
+
/** 群聊策略: open=开放, allowlist=白名单, disabled=禁用 */
|
|
124
|
+
groupPolicy: z.ZodDefault<z.ZodOptional<z.ZodEnum<["open", "allowlist", "disabled"]>>>;
|
|
125
|
+
/** 群聊是否需要 @机器人才响应 */
|
|
126
|
+
requireMention: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
127
|
+
/** 单聊白名单: 允许的用户 ID 列表 */
|
|
128
|
+
allowFrom: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
129
|
+
/** 群聊白名单: 允许的会话 ID 列表 */
|
|
130
|
+
groupAllowFrom: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
131
|
+
/** 历史消息数量限制 */
|
|
132
|
+
historyLimit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
133
|
+
/** 文本分块大小限制 (钉钉单条消息最大 4000 字符) */
|
|
134
|
+
textChunkLimit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
135
|
+
/** 长任务提醒延迟(毫秒),0 表示关闭 */
|
|
136
|
+
longTaskNoticeDelayMs: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
137
|
+
/** 是否启用 AI Card 流式响应 */
|
|
138
|
+
enableAICard: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
139
|
+
/** Gateway auth token(Bearer) */
|
|
140
|
+
gatewayToken: z.ZodOptional<z.ZodString>;
|
|
141
|
+
/** Gateway auth password(替代 gatewayToken) */
|
|
142
|
+
gatewayPassword: z.ZodOptional<z.ZodString>;
|
|
143
|
+
/** 媒体文件大小限制 (MB),默认 100MB */
|
|
144
|
+
maxFileSizeMB: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
145
|
+
/** 入站媒体归档策略 */
|
|
146
|
+
inboundMedia: z.ZodOptional<z.ZodObject<{
|
|
147
|
+
dir: z.ZodOptional<z.ZodString>;
|
|
148
|
+
keepDays: z.ZodOptional<z.ZodNumber>;
|
|
149
|
+
}, "strip", z.ZodTypeAny, {
|
|
150
|
+
dir?: string | undefined;
|
|
151
|
+
keepDays?: number | undefined;
|
|
152
|
+
}, {
|
|
153
|
+
dir?: string | undefined;
|
|
154
|
+
keepDays?: number | undefined;
|
|
155
|
+
}>>;
|
|
156
|
+
} & {
|
|
157
|
+
defaultAccount: z.ZodOptional<z.ZodString>;
|
|
158
|
+
accounts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
159
|
+
/** 账户显示名 */
|
|
160
|
+
name: z.ZodOptional<z.ZodString>;
|
|
161
|
+
/** 是否启用钉钉渠道 */
|
|
162
|
+
enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
163
|
+
/** 钉钉应用 AppKey (clientId) */
|
|
164
|
+
clientId: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, unknown>;
|
|
165
|
+
/** 钉钉应用 AppSecret (clientSecret) */
|
|
166
|
+
clientSecret: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, unknown>;
|
|
167
|
+
/** 单聊策略: open=开放, pairing=配对, allowlist=白名单 */
|
|
168
|
+
dmPolicy: z.ZodDefault<z.ZodOptional<z.ZodEnum<["open", "pairing", "allowlist"]>>>;
|
|
169
|
+
/** 群聊策略: open=开放, allowlist=白名单, disabled=禁用 */
|
|
170
|
+
groupPolicy: z.ZodDefault<z.ZodOptional<z.ZodEnum<["open", "allowlist", "disabled"]>>>;
|
|
171
|
+
/** 群聊是否需要 @机器人才响应 */
|
|
172
|
+
requireMention: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
173
|
+
/** 单聊白名单: 允许的用户 ID 列表 */
|
|
174
|
+
allowFrom: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
175
|
+
/** 群聊白名单: 允许的会话 ID 列表 */
|
|
176
|
+
groupAllowFrom: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
177
|
+
/** 历史消息数量限制 */
|
|
178
|
+
historyLimit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
179
|
+
/** 文本分块大小限制 (钉钉单条消息最大 4000 字符) */
|
|
180
|
+
textChunkLimit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
181
|
+
/** 长任务提醒延迟(毫秒),0 表示关闭 */
|
|
182
|
+
longTaskNoticeDelayMs: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
183
|
+
/** 是否启用 AI Card 流式响应 */
|
|
184
|
+
enableAICard: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
185
|
+
/** Gateway auth token(Bearer) */
|
|
186
|
+
gatewayToken: z.ZodOptional<z.ZodString>;
|
|
187
|
+
/** Gateway auth password(替代 gatewayToken) */
|
|
188
|
+
gatewayPassword: z.ZodOptional<z.ZodString>;
|
|
189
|
+
/** 媒体文件大小限制 (MB),默认 100MB */
|
|
190
|
+
maxFileSizeMB: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
191
|
+
/** 入站媒体归档策略 */
|
|
192
|
+
inboundMedia: z.ZodOptional<z.ZodObject<{
|
|
193
|
+
dir: z.ZodOptional<z.ZodString>;
|
|
194
|
+
keepDays: z.ZodOptional<z.ZodNumber>;
|
|
195
|
+
}, "strip", z.ZodTypeAny, {
|
|
196
|
+
dir?: string | undefined;
|
|
197
|
+
keepDays?: number | undefined;
|
|
198
|
+
}, {
|
|
199
|
+
dir?: string | undefined;
|
|
200
|
+
keepDays?: number | undefined;
|
|
201
|
+
}>>;
|
|
202
|
+
}, "strip", z.ZodTypeAny, {
|
|
203
|
+
enabled: boolean;
|
|
204
|
+
dmPolicy: "open" | "pairing" | "allowlist";
|
|
205
|
+
groupPolicy: "open" | "allowlist" | "disabled";
|
|
206
|
+
requireMention: boolean;
|
|
207
|
+
historyLimit: number;
|
|
208
|
+
textChunkLimit: number;
|
|
209
|
+
longTaskNoticeDelayMs: number;
|
|
210
|
+
enableAICard: boolean;
|
|
211
|
+
maxFileSizeMB: number;
|
|
212
|
+
name?: string | undefined;
|
|
213
|
+
clientId?: string | undefined;
|
|
214
|
+
clientSecret?: string | undefined;
|
|
215
|
+
allowFrom?: string[] | undefined;
|
|
216
|
+
groupAllowFrom?: string[] | undefined;
|
|
217
|
+
gatewayToken?: string | undefined;
|
|
218
|
+
gatewayPassword?: string | undefined;
|
|
219
|
+
inboundMedia?: {
|
|
220
|
+
dir?: string | undefined;
|
|
221
|
+
keepDays?: number | undefined;
|
|
222
|
+
} | undefined;
|
|
223
|
+
}, {
|
|
224
|
+
name?: string | undefined;
|
|
225
|
+
enabled?: boolean | undefined;
|
|
226
|
+
clientId?: unknown;
|
|
227
|
+
clientSecret?: unknown;
|
|
228
|
+
dmPolicy?: "open" | "pairing" | "allowlist" | undefined;
|
|
229
|
+
groupPolicy?: "open" | "allowlist" | "disabled" | undefined;
|
|
230
|
+
requireMention?: boolean | undefined;
|
|
231
|
+
allowFrom?: string[] | undefined;
|
|
232
|
+
groupAllowFrom?: string[] | undefined;
|
|
233
|
+
historyLimit?: number | undefined;
|
|
234
|
+
textChunkLimit?: number | undefined;
|
|
235
|
+
longTaskNoticeDelayMs?: number | undefined;
|
|
236
|
+
enableAICard?: boolean | undefined;
|
|
237
|
+
gatewayToken?: string | undefined;
|
|
238
|
+
gatewayPassword?: string | undefined;
|
|
239
|
+
maxFileSizeMB?: number | undefined;
|
|
240
|
+
inboundMedia?: {
|
|
241
|
+
dir?: string | undefined;
|
|
242
|
+
keepDays?: number | undefined;
|
|
243
|
+
} | undefined;
|
|
244
|
+
}>>>;
|
|
245
|
+
}, "strip", z.ZodTypeAny, {
|
|
124
246
|
enabled: boolean;
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
247
|
+
dmPolicy: "open" | "pairing" | "allowlist";
|
|
248
|
+
groupPolicy: "open" | "allowlist" | "disabled";
|
|
249
|
+
requireMention: boolean;
|
|
250
|
+
historyLimit: number;
|
|
251
|
+
textChunkLimit: number;
|
|
252
|
+
longTaskNoticeDelayMs: number;
|
|
253
|
+
enableAICard: boolean;
|
|
254
|
+
maxFileSizeMB: number;
|
|
255
|
+
name?: string | undefined;
|
|
256
|
+
clientId?: string | undefined;
|
|
257
|
+
clientSecret?: string | undefined;
|
|
258
|
+
allowFrom?: string[] | undefined;
|
|
259
|
+
groupAllowFrom?: string[] | undefined;
|
|
260
|
+
gatewayToken?: string | undefined;
|
|
261
|
+
gatewayPassword?: string | undefined;
|
|
262
|
+
inboundMedia?: {
|
|
263
|
+
dir?: string | undefined;
|
|
264
|
+
keepDays?: number | undefined;
|
|
265
|
+
} | undefined;
|
|
266
|
+
defaultAccount?: string | undefined;
|
|
267
|
+
accounts?: Record<string, {
|
|
268
|
+
enabled: boolean;
|
|
269
|
+
dmPolicy: "open" | "pairing" | "allowlist";
|
|
270
|
+
groupPolicy: "open" | "allowlist" | "disabled";
|
|
271
|
+
requireMention: boolean;
|
|
272
|
+
historyLimit: number;
|
|
273
|
+
textChunkLimit: number;
|
|
274
|
+
longTaskNoticeDelayMs: number;
|
|
275
|
+
enableAICard: boolean;
|
|
276
|
+
maxFileSizeMB: number;
|
|
277
|
+
name?: string | undefined;
|
|
278
|
+
clientId?: string | undefined;
|
|
279
|
+
clientSecret?: string | undefined;
|
|
280
|
+
allowFrom?: string[] | undefined;
|
|
281
|
+
groupAllowFrom?: string[] | undefined;
|
|
282
|
+
gatewayToken?: string | undefined;
|
|
283
|
+
gatewayPassword?: string | undefined;
|
|
284
|
+
inboundMedia?: {
|
|
285
|
+
dir?: string | undefined;
|
|
286
|
+
keepDays?: number | undefined;
|
|
287
|
+
} | undefined;
|
|
288
|
+
}> | undefined;
|
|
289
|
+
}, {
|
|
290
|
+
name?: string | undefined;
|
|
291
|
+
enabled?: boolean | undefined;
|
|
292
|
+
clientId?: unknown;
|
|
293
|
+
clientSecret?: unknown;
|
|
294
|
+
dmPolicy?: "open" | "pairing" | "allowlist" | undefined;
|
|
295
|
+
groupPolicy?: "open" | "allowlist" | "disabled" | undefined;
|
|
296
|
+
requireMention?: boolean | undefined;
|
|
297
|
+
allowFrom?: string[] | undefined;
|
|
298
|
+
groupAllowFrom?: string[] | undefined;
|
|
299
|
+
historyLimit?: number | undefined;
|
|
300
|
+
textChunkLimit?: number | undefined;
|
|
301
|
+
longTaskNoticeDelayMs?: number | undefined;
|
|
302
|
+
enableAICard?: boolean | undefined;
|
|
303
|
+
gatewayToken?: string | undefined;
|
|
304
|
+
gatewayPassword?: string | undefined;
|
|
305
|
+
maxFileSizeMB?: number | undefined;
|
|
306
|
+
inboundMedia?: {
|
|
307
|
+
dir?: string | undefined;
|
|
308
|
+
keepDays?: number | undefined;
|
|
309
|
+
} | undefined;
|
|
310
|
+
defaultAccount?: string | undefined;
|
|
311
|
+
accounts?: Record<string, {
|
|
312
|
+
name?: string | undefined;
|
|
313
|
+
enabled?: boolean | undefined;
|
|
314
|
+
clientId?: unknown;
|
|
315
|
+
clientSecret?: unknown;
|
|
316
|
+
dmPolicy?: "open" | "pairing" | "allowlist" | undefined;
|
|
317
|
+
groupPolicy?: "open" | "allowlist" | "disabled" | undefined;
|
|
318
|
+
requireMention?: boolean | undefined;
|
|
319
|
+
allowFrom?: string[] | undefined;
|
|
320
|
+
groupAllowFrom?: string[] | undefined;
|
|
321
|
+
historyLimit?: number | undefined;
|
|
322
|
+
textChunkLimit?: number | undefined;
|
|
323
|
+
longTaskNoticeDelayMs?: number | undefined;
|
|
324
|
+
enableAICard?: boolean | undefined;
|
|
325
|
+
gatewayToken?: string | undefined;
|
|
326
|
+
gatewayPassword?: string | undefined;
|
|
327
|
+
maxFileSizeMB?: number | undefined;
|
|
328
|
+
inboundMedia?: {
|
|
329
|
+
dir?: string | undefined;
|
|
330
|
+
keepDays?: number | undefined;
|
|
331
|
+
} | undefined;
|
|
332
|
+
}> | undefined;
|
|
333
|
+
}>;
|
|
334
|
+
type DingtalkConfig = z.output<typeof DingtalkConfigSchema>;
|
|
335
|
+
type DingtalkAccountConfig = z.output<typeof DingtalkAccountSchema>;
|
|
336
|
+
type PartialDingtalkAccountConfig = Partial<DingtalkAccountConfig>;
|
|
337
|
+
type PartialDingtalkConfig = Partial<Omit<DingtalkConfig, "accounts">> & {
|
|
338
|
+
accounts?: Record<string, PartialDingtalkAccountConfig>;
|
|
339
|
+
};
|
|
340
|
+
interface PluginConfig$1 {
|
|
341
|
+
channels?: {
|
|
342
|
+
dingtalk?: PartialDingtalkConfig;
|
|
343
|
+
};
|
|
129
344
|
}
|
|
345
|
+
declare const DEFAULT_ACCOUNT_ID = "default";
|
|
130
346
|
|
|
131
347
|
/**
|
|
132
348
|
* 钉钉出站适配器
|
|
@@ -142,15 +358,6 @@ interface ResolvedDingtalkAccount {
|
|
|
142
358
|
* - chunkerMode: "markdown" (使用 markdown 感知的分块模式)
|
|
143
359
|
*/
|
|
144
360
|
|
|
145
|
-
/**
|
|
146
|
-
* 出站适配器配置类型
|
|
147
|
-
* 简化版本,仅包含必要字段
|
|
148
|
-
*/
|
|
149
|
-
interface OutboundConfig {
|
|
150
|
-
channels?: {
|
|
151
|
-
dingtalk?: DingtalkConfig;
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
361
|
/**
|
|
155
362
|
* 发送结果类型
|
|
156
363
|
*/
|
|
@@ -174,7 +381,7 @@ interface SendResult {
|
|
|
174
381
|
/**
|
|
175
382
|
* 配置接口类型
|
|
176
383
|
*/
|
|
177
|
-
interface PluginConfig
|
|
384
|
+
interface PluginConfig {
|
|
178
385
|
channels?: {
|
|
179
386
|
dingtalk?: Partial<DingtalkConfig>;
|
|
180
387
|
};
|
|
@@ -204,16 +411,30 @@ interface WizardPrompter {
|
|
|
204
411
|
}) => Promise<T | symbol>;
|
|
205
412
|
}
|
|
206
413
|
|
|
207
|
-
/** 默认账户 ID */
|
|
208
|
-
declare const DEFAULT_ACCOUNT_ID = "default";
|
|
209
414
|
/**
|
|
210
|
-
*
|
|
415
|
+
* 发送消息结果
|
|
211
416
|
*/
|
|
212
|
-
interface
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
417
|
+
interface DingtalkSendResult {
|
|
418
|
+
/** 消息 ID */
|
|
419
|
+
messageId: string;
|
|
420
|
+
/** 会话 ID */
|
|
421
|
+
conversationId: string;
|
|
216
422
|
}
|
|
423
|
+
/**
|
|
424
|
+
* 解析后的钉钉账户配置
|
|
425
|
+
* 用于 ChannelPlugin config 适配器
|
|
426
|
+
*/
|
|
427
|
+
interface ResolvedDingtalkAccount {
|
|
428
|
+
/** 账户 ID */
|
|
429
|
+
accountId: string;
|
|
430
|
+
/** 是否启用 */
|
|
431
|
+
enabled: boolean;
|
|
432
|
+
/** 是否已配置(有凭证) */
|
|
433
|
+
configured: boolean;
|
|
434
|
+
/** 客户端 ID */
|
|
435
|
+
clientId?: string;
|
|
436
|
+
}
|
|
437
|
+
|
|
217
438
|
/**
|
|
218
439
|
* 钉钉渠道插件
|
|
219
440
|
*
|
|
@@ -261,12 +482,22 @@ declare const dingtalkPlugin: {
|
|
|
261
482
|
enabled: {
|
|
262
483
|
type: string;
|
|
263
484
|
};
|
|
485
|
+
name: {
|
|
486
|
+
type: string;
|
|
487
|
+
};
|
|
488
|
+
defaultAccount: {
|
|
489
|
+
type: string;
|
|
490
|
+
};
|
|
264
491
|
clientId: {
|
|
265
492
|
type: string;
|
|
266
493
|
};
|
|
267
494
|
clientSecret: {
|
|
268
495
|
type: string;
|
|
269
496
|
};
|
|
497
|
+
connectionMode: {
|
|
498
|
+
type: string;
|
|
499
|
+
enum: string[];
|
|
500
|
+
};
|
|
270
501
|
dmPolicy: {
|
|
271
502
|
type: string;
|
|
272
503
|
enum: string[];
|
|
@@ -328,6 +559,92 @@ declare const dingtalkPlugin: {
|
|
|
328
559
|
};
|
|
329
560
|
};
|
|
330
561
|
};
|
|
562
|
+
accounts: {
|
|
563
|
+
type: string;
|
|
564
|
+
additionalProperties: {
|
|
565
|
+
type: string;
|
|
566
|
+
additionalProperties: boolean;
|
|
567
|
+
properties: {
|
|
568
|
+
name: {
|
|
569
|
+
type: string;
|
|
570
|
+
};
|
|
571
|
+
enabled: {
|
|
572
|
+
type: string;
|
|
573
|
+
};
|
|
574
|
+
clientId: {
|
|
575
|
+
type: string;
|
|
576
|
+
};
|
|
577
|
+
clientSecret: {
|
|
578
|
+
type: string;
|
|
579
|
+
};
|
|
580
|
+
connectionMode: {
|
|
581
|
+
type: string;
|
|
582
|
+
enum: string[];
|
|
583
|
+
};
|
|
584
|
+
dmPolicy: {
|
|
585
|
+
type: string;
|
|
586
|
+
enum: string[];
|
|
587
|
+
};
|
|
588
|
+
groupPolicy: {
|
|
589
|
+
type: string;
|
|
590
|
+
enum: string[];
|
|
591
|
+
};
|
|
592
|
+
requireMention: {
|
|
593
|
+
type: string;
|
|
594
|
+
};
|
|
595
|
+
allowFrom: {
|
|
596
|
+
type: string;
|
|
597
|
+
items: {
|
|
598
|
+
type: string;
|
|
599
|
+
};
|
|
600
|
+
};
|
|
601
|
+
groupAllowFrom: {
|
|
602
|
+
type: string;
|
|
603
|
+
items: {
|
|
604
|
+
type: string;
|
|
605
|
+
};
|
|
606
|
+
};
|
|
607
|
+
historyLimit: {
|
|
608
|
+
type: string;
|
|
609
|
+
minimum: number;
|
|
610
|
+
};
|
|
611
|
+
textChunkLimit: {
|
|
612
|
+
type: string;
|
|
613
|
+
minimum: number;
|
|
614
|
+
};
|
|
615
|
+
longTaskNoticeDelayMs: {
|
|
616
|
+
type: string;
|
|
617
|
+
minimum: number;
|
|
618
|
+
};
|
|
619
|
+
enableAICard: {
|
|
620
|
+
type: string;
|
|
621
|
+
};
|
|
622
|
+
gatewayToken: {
|
|
623
|
+
type: string;
|
|
624
|
+
};
|
|
625
|
+
gatewayPassword: {
|
|
626
|
+
type: string;
|
|
627
|
+
};
|
|
628
|
+
maxFileSizeMB: {
|
|
629
|
+
type: string;
|
|
630
|
+
minimum: number;
|
|
631
|
+
};
|
|
632
|
+
inboundMedia: {
|
|
633
|
+
type: string;
|
|
634
|
+
additionalProperties: boolean;
|
|
635
|
+
properties: {
|
|
636
|
+
dir: {
|
|
637
|
+
type: string;
|
|
638
|
+
};
|
|
639
|
+
keepDays: {
|
|
640
|
+
type: string;
|
|
641
|
+
minimum: number;
|
|
642
|
+
};
|
|
643
|
+
};
|
|
644
|
+
};
|
|
645
|
+
};
|
|
646
|
+
};
|
|
647
|
+
};
|
|
331
648
|
};
|
|
332
649
|
};
|
|
333
650
|
};
|
|
@@ -346,34 +663,36 @@ declare const dingtalkPlugin: {
|
|
|
346
663
|
* 列出所有账户 ID
|
|
347
664
|
* Requirements: 2.1
|
|
348
665
|
*/
|
|
349
|
-
listAccountIds: (
|
|
666
|
+
listAccountIds: (cfg: PluginConfig$1) => string[];
|
|
350
667
|
/**
|
|
351
668
|
* 解析账户配置
|
|
352
669
|
* Requirements: 2.2
|
|
353
670
|
*/
|
|
354
|
-
resolveAccount: (cfg: PluginConfig, accountId?: string) => ResolvedDingtalkAccount;
|
|
671
|
+
resolveAccount: (cfg: PluginConfig$1, accountId?: string) => ResolvedDingtalkAccount;
|
|
355
672
|
/**
|
|
356
673
|
* 获取默认账户 ID
|
|
357
674
|
*/
|
|
358
|
-
defaultAccountId: () => string;
|
|
675
|
+
defaultAccountId: (cfg: PluginConfig$1) => string;
|
|
359
676
|
/**
|
|
360
677
|
* 设置账户启用状态
|
|
361
678
|
*/
|
|
362
679
|
setAccountEnabled: (params: {
|
|
363
|
-
cfg: PluginConfig;
|
|
680
|
+
cfg: PluginConfig$1;
|
|
681
|
+
accountId?: string;
|
|
364
682
|
enabled: boolean;
|
|
365
|
-
}) => PluginConfig;
|
|
683
|
+
}) => PluginConfig$1;
|
|
366
684
|
/**
|
|
367
685
|
* 删除账户配置
|
|
368
686
|
*/
|
|
369
687
|
deleteAccount: (params: {
|
|
370
|
-
cfg: PluginConfig;
|
|
371
|
-
|
|
688
|
+
cfg: PluginConfig$1;
|
|
689
|
+
accountId?: string;
|
|
690
|
+
}) => PluginConfig$1;
|
|
372
691
|
/**
|
|
373
692
|
* 检查账户是否已配置
|
|
374
693
|
* Requirements: 2.3
|
|
375
694
|
*/
|
|
376
|
-
isConfigured: (_account: ResolvedDingtalkAccount, cfg: PluginConfig) => boolean;
|
|
695
|
+
isConfigured: (_account: ResolvedDingtalkAccount, cfg: PluginConfig$1, accountId?: string) => boolean;
|
|
377
696
|
/**
|
|
378
697
|
* 描述账户信息
|
|
379
698
|
*/
|
|
@@ -386,7 +705,8 @@ declare const dingtalkPlugin: {
|
|
|
386
705
|
* 解析白名单
|
|
387
706
|
*/
|
|
388
707
|
resolveAllowFrom: (params: {
|
|
389
|
-
cfg: PluginConfig;
|
|
708
|
+
cfg: PluginConfig$1;
|
|
709
|
+
accountId?: string;
|
|
390
710
|
}) => string[];
|
|
391
711
|
/**
|
|
392
712
|
* 格式化白名单条目
|
|
@@ -400,17 +720,22 @@ declare const dingtalkPlugin: {
|
|
|
400
720
|
*/
|
|
401
721
|
security: {
|
|
402
722
|
collectWarnings: (params: {
|
|
403
|
-
cfg: PluginConfig;
|
|
723
|
+
cfg: PluginConfig$1;
|
|
404
724
|
}) => string[];
|
|
405
725
|
};
|
|
406
726
|
/**
|
|
407
727
|
* 设置向导适配器
|
|
408
728
|
*/
|
|
409
729
|
setup: {
|
|
410
|
-
resolveAccountId: (
|
|
730
|
+
resolveAccountId: (params: {
|
|
731
|
+
cfg: PluginConfig$1;
|
|
732
|
+
accountId?: string;
|
|
733
|
+
}) => string;
|
|
411
734
|
applyAccountConfig: (params: {
|
|
412
|
-
cfg: PluginConfig;
|
|
413
|
-
|
|
735
|
+
cfg: PluginConfig$1;
|
|
736
|
+
accountId?: string;
|
|
737
|
+
config?: Record<string, unknown>;
|
|
738
|
+
}) => PluginConfig$1;
|
|
414
739
|
};
|
|
415
740
|
/**
|
|
416
741
|
* Onboarding 适配器
|
|
@@ -418,7 +743,7 @@ declare const dingtalkPlugin: {
|
|
|
418
743
|
onboarding: {
|
|
419
744
|
channel: "dingtalk";
|
|
420
745
|
getStatus: (params: {
|
|
421
|
-
cfg: PluginConfig
|
|
746
|
+
cfg: PluginConfig;
|
|
422
747
|
}) => Promise<{
|
|
423
748
|
channel: "dingtalk";
|
|
424
749
|
configured: boolean;
|
|
@@ -427,10 +752,10 @@ declare const dingtalkPlugin: {
|
|
|
427
752
|
quickstartScore: number;
|
|
428
753
|
}>;
|
|
429
754
|
configure: (params: {
|
|
430
|
-
cfg: PluginConfig
|
|
755
|
+
cfg: PluginConfig;
|
|
431
756
|
prompter: WizardPrompter;
|
|
432
757
|
}) => Promise<{
|
|
433
|
-
cfg: PluginConfig
|
|
758
|
+
cfg: PluginConfig;
|
|
434
759
|
accountId: string;
|
|
435
760
|
}>;
|
|
436
761
|
dmPolicy: {
|
|
@@ -438,14 +763,14 @@ declare const dingtalkPlugin: {
|
|
|
438
763
|
channel: "dingtalk";
|
|
439
764
|
policyKey: string;
|
|
440
765
|
allowFromKey: string;
|
|
441
|
-
getCurrent: (cfg: PluginConfig
|
|
442
|
-
setPolicy: (cfg: PluginConfig
|
|
766
|
+
getCurrent: (cfg: PluginConfig) => "open" | "pairing" | "allowlist";
|
|
767
|
+
setPolicy: (cfg: PluginConfig, policy: "open" | "pairing" | "allowlist") => PluginConfig;
|
|
443
768
|
promptAllowFrom: (params: {
|
|
444
|
-
cfg: PluginConfig
|
|
769
|
+
cfg: PluginConfig;
|
|
445
770
|
prompter: WizardPrompter;
|
|
446
|
-
}) => Promise<PluginConfig
|
|
771
|
+
}) => Promise<PluginConfig>;
|
|
447
772
|
};
|
|
448
|
-
disable: (cfg: PluginConfig
|
|
773
|
+
disable: (cfg: PluginConfig) => PluginConfig;
|
|
449
774
|
};
|
|
450
775
|
/**
|
|
451
776
|
* 出站消息适配器
|
|
@@ -457,15 +782,17 @@ declare const dingtalkPlugin: {
|
|
|
457
782
|
chunkerMode: "markdown";
|
|
458
783
|
chunker: (text: string, limit: number) => string[];
|
|
459
784
|
sendText: (params: {
|
|
460
|
-
cfg:
|
|
785
|
+
cfg: PluginConfig$1;
|
|
461
786
|
to: string;
|
|
462
787
|
text: string;
|
|
788
|
+
accountId?: string;
|
|
463
789
|
}) => Promise<SendResult>;
|
|
464
790
|
sendMedia: (params: {
|
|
465
|
-
cfg:
|
|
791
|
+
cfg: PluginConfig$1;
|
|
466
792
|
to: string;
|
|
467
793
|
text?: string;
|
|
468
794
|
mediaUrl?: string;
|
|
795
|
+
accountId?: string;
|
|
469
796
|
}) => Promise<SendResult>;
|
|
470
797
|
};
|
|
471
798
|
/**
|
|
@@ -478,8 +805,9 @@ declare const dingtalkPlugin: {
|
|
|
478
805
|
* Requirements: 3.1
|
|
479
806
|
*/
|
|
480
807
|
startAccount: (ctx: {
|
|
481
|
-
cfg: PluginConfig;
|
|
808
|
+
cfg: PluginConfig$1;
|
|
482
809
|
runtime?: unknown;
|
|
810
|
+
channelRuntime?: unknown;
|
|
483
811
|
abortSignal?: AbortSignal;
|
|
484
812
|
accountId: string;
|
|
485
813
|
setStatus?: (status: Record<string, unknown>) => void;
|
|
@@ -488,6 +816,12 @@ declare const dingtalkPlugin: {
|
|
|
488
816
|
error: (msg: string) => void;
|
|
489
817
|
};
|
|
490
818
|
}) => Promise<void>;
|
|
819
|
+
stopAccount: (ctx: {
|
|
820
|
+
accountId: string;
|
|
821
|
+
}) => Promise<void>;
|
|
822
|
+
getStatus: () => {
|
|
823
|
+
connected: boolean;
|
|
824
|
+
};
|
|
491
825
|
};
|
|
492
826
|
};
|
|
493
827
|
|
|
@@ -723,6 +1057,12 @@ declare const plugin: {
|
|
|
723
1057
|
enabled: {
|
|
724
1058
|
type: string;
|
|
725
1059
|
};
|
|
1060
|
+
name: {
|
|
1061
|
+
type: string;
|
|
1062
|
+
};
|
|
1063
|
+
defaultAccount: {
|
|
1064
|
+
type: string;
|
|
1065
|
+
};
|
|
726
1066
|
clientId: {
|
|
727
1067
|
type: string;
|
|
728
1068
|
};
|
|
@@ -764,6 +1104,122 @@ declare const plugin: {
|
|
|
764
1104
|
type: string;
|
|
765
1105
|
minimum: number;
|
|
766
1106
|
};
|
|
1107
|
+
connectionMode: {
|
|
1108
|
+
type: string;
|
|
1109
|
+
enum: string[];
|
|
1110
|
+
};
|
|
1111
|
+
enableAICard: {
|
|
1112
|
+
type: string;
|
|
1113
|
+
};
|
|
1114
|
+
gatewayToken: {
|
|
1115
|
+
type: string;
|
|
1116
|
+
};
|
|
1117
|
+
gatewayPassword: {
|
|
1118
|
+
type: string;
|
|
1119
|
+
};
|
|
1120
|
+
maxFileSizeMB: {
|
|
1121
|
+
type: string;
|
|
1122
|
+
minimum: number;
|
|
1123
|
+
};
|
|
1124
|
+
inboundMedia: {
|
|
1125
|
+
type: string;
|
|
1126
|
+
additionalProperties: boolean;
|
|
1127
|
+
properties: {
|
|
1128
|
+
dir: {
|
|
1129
|
+
type: string;
|
|
1130
|
+
};
|
|
1131
|
+
keepDays: {
|
|
1132
|
+
type: string;
|
|
1133
|
+
minimum: number;
|
|
1134
|
+
};
|
|
1135
|
+
};
|
|
1136
|
+
};
|
|
1137
|
+
accounts: {
|
|
1138
|
+
type: string;
|
|
1139
|
+
additionalProperties: {
|
|
1140
|
+
type: string;
|
|
1141
|
+
additionalProperties: boolean;
|
|
1142
|
+
properties: {
|
|
1143
|
+
name: {
|
|
1144
|
+
type: string;
|
|
1145
|
+
};
|
|
1146
|
+
enabled: {
|
|
1147
|
+
type: string;
|
|
1148
|
+
};
|
|
1149
|
+
clientId: {
|
|
1150
|
+
type: string;
|
|
1151
|
+
};
|
|
1152
|
+
clientSecret: {
|
|
1153
|
+
type: string;
|
|
1154
|
+
};
|
|
1155
|
+
dmPolicy: {
|
|
1156
|
+
type: string;
|
|
1157
|
+
enum: string[];
|
|
1158
|
+
};
|
|
1159
|
+
groupPolicy: {
|
|
1160
|
+
type: string;
|
|
1161
|
+
enum: string[];
|
|
1162
|
+
};
|
|
1163
|
+
requireMention: {
|
|
1164
|
+
type: string;
|
|
1165
|
+
};
|
|
1166
|
+
allowFrom: {
|
|
1167
|
+
type: string;
|
|
1168
|
+
items: {
|
|
1169
|
+
type: string;
|
|
1170
|
+
};
|
|
1171
|
+
};
|
|
1172
|
+
groupAllowFrom: {
|
|
1173
|
+
type: string;
|
|
1174
|
+
items: {
|
|
1175
|
+
type: string;
|
|
1176
|
+
};
|
|
1177
|
+
};
|
|
1178
|
+
historyLimit: {
|
|
1179
|
+
type: string;
|
|
1180
|
+
minimum: number;
|
|
1181
|
+
};
|
|
1182
|
+
textChunkLimit: {
|
|
1183
|
+
type: string;
|
|
1184
|
+
minimum: number;
|
|
1185
|
+
};
|
|
1186
|
+
longTaskNoticeDelayMs: {
|
|
1187
|
+
type: string;
|
|
1188
|
+
minimum: number;
|
|
1189
|
+
};
|
|
1190
|
+
connectionMode: {
|
|
1191
|
+
type: string;
|
|
1192
|
+
enum: string[];
|
|
1193
|
+
};
|
|
1194
|
+
enableAICard: {
|
|
1195
|
+
type: string;
|
|
1196
|
+
};
|
|
1197
|
+
gatewayToken: {
|
|
1198
|
+
type: string;
|
|
1199
|
+
};
|
|
1200
|
+
gatewayPassword: {
|
|
1201
|
+
type: string;
|
|
1202
|
+
};
|
|
1203
|
+
maxFileSizeMB: {
|
|
1204
|
+
type: string;
|
|
1205
|
+
minimum: number;
|
|
1206
|
+
};
|
|
1207
|
+
inboundMedia: {
|
|
1208
|
+
type: string;
|
|
1209
|
+
additionalProperties: boolean;
|
|
1210
|
+
properties: {
|
|
1211
|
+
dir: {
|
|
1212
|
+
type: string;
|
|
1213
|
+
};
|
|
1214
|
+
keepDays: {
|
|
1215
|
+
type: string;
|
|
1216
|
+
minimum: number;
|
|
1217
|
+
};
|
|
1218
|
+
};
|
|
1219
|
+
};
|
|
1220
|
+
};
|
|
1221
|
+
};
|
|
1222
|
+
};
|
|
767
1223
|
};
|
|
768
1224
|
};
|
|
769
1225
|
/**
|
|
@@ -777,4 +1233,4 @@ declare const plugin: {
|
|
|
777
1233
|
register(api: MoltbotPluginApi): void;
|
|
778
1234
|
};
|
|
779
1235
|
|
|
780
|
-
export { DEFAULT_ACCOUNT_ID, type DingtalkConfig, type DingtalkSendResult, type MoltbotPluginApi, type ResolvedDingtalkAccount, plugin as default, dingtalkPlugin, getDingtalkRuntime, sendMessageDingtalk, setDingtalkRuntime };
|
|
1236
|
+
export { DEFAULT_ACCOUNT_ID, type DingtalkAccountConfig, type DingtalkConfig, type DingtalkSendResult, type MoltbotPluginApi, type ResolvedDingtalkAccount, plugin as default, dingtalkPlugin, getDingtalkRuntime, sendMessageDingtalk, setDingtalkRuntime };
|