@openclaw-china/wecom 2026.3.8-2 → 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 +86 -5
- package/dist/index.js +1099 -36
- package/dist/index.js.map +1 -1
- package/openclaw.plugin.json +48 -31
- package/package.json +12 -6
package/dist/index.d.ts
CHANGED
|
@@ -2,13 +2,22 @@ import { IncomingMessage, ServerResponse } from 'http';
|
|
|
2
2
|
|
|
3
3
|
type WecomDmPolicy = "open" | "pairing" | "allowlist" | "disabled";
|
|
4
4
|
type WecomGroupPolicy = "open" | "allowlist" | "disabled";
|
|
5
|
+
type WecomTransportMode = "webhook" | "ws";
|
|
5
6
|
type WecomAccountConfig = {
|
|
6
7
|
name?: string;
|
|
7
8
|
enabled?: boolean;
|
|
9
|
+
mode?: WecomTransportMode;
|
|
8
10
|
webhookPath?: string;
|
|
9
11
|
token?: string;
|
|
10
12
|
encodingAESKey?: string;
|
|
11
13
|
receiveId?: string;
|
|
14
|
+
botId?: string;
|
|
15
|
+
secret?: string;
|
|
16
|
+
wsUrl?: string;
|
|
17
|
+
heartbeatIntervalMs?: number;
|
|
18
|
+
reconnectInitialDelayMs?: number;
|
|
19
|
+
reconnectMaxDelayMs?: number;
|
|
20
|
+
publicBaseUrl?: string;
|
|
12
21
|
welcomeText?: string;
|
|
13
22
|
dmPolicy?: WecomDmPolicy;
|
|
14
23
|
allowFrom?: string[];
|
|
@@ -25,9 +34,17 @@ type ResolvedWecomAccount = {
|
|
|
25
34
|
name?: string;
|
|
26
35
|
enabled: boolean;
|
|
27
36
|
configured: boolean;
|
|
37
|
+
mode: WecomTransportMode;
|
|
28
38
|
token?: string;
|
|
29
39
|
encodingAESKey?: string;
|
|
30
40
|
receiveId: string;
|
|
41
|
+
botId?: string;
|
|
42
|
+
secret?: string;
|
|
43
|
+
wsUrl: string;
|
|
44
|
+
heartbeatIntervalMs: number;
|
|
45
|
+
reconnectInitialDelayMs: number;
|
|
46
|
+
reconnectMaxDelayMs: number;
|
|
47
|
+
publicBaseUrl?: string;
|
|
31
48
|
config: WecomAccountConfig;
|
|
32
49
|
};
|
|
33
50
|
type WecomInboundBase = {
|
|
@@ -83,10 +100,6 @@ interface PluginConfig {
|
|
|
83
100
|
};
|
|
84
101
|
}
|
|
85
102
|
|
|
86
|
-
/**
|
|
87
|
-
* 企业微信 ChannelPlugin 实现
|
|
88
|
-
*/
|
|
89
|
-
|
|
90
103
|
declare const wecomPlugin: {
|
|
91
104
|
id: string;
|
|
92
105
|
meta: {
|
|
@@ -130,6 +143,10 @@ declare const wecomPlugin: {
|
|
|
130
143
|
enabled: {
|
|
131
144
|
type: string;
|
|
132
145
|
};
|
|
146
|
+
mode: {
|
|
147
|
+
type: string;
|
|
148
|
+
enum: string[];
|
|
149
|
+
};
|
|
133
150
|
webhookPath: {
|
|
134
151
|
type: string;
|
|
135
152
|
};
|
|
@@ -142,6 +159,30 @@ declare const wecomPlugin: {
|
|
|
142
159
|
receiveId: {
|
|
143
160
|
type: string;
|
|
144
161
|
};
|
|
162
|
+
botId: {
|
|
163
|
+
type: string;
|
|
164
|
+
};
|
|
165
|
+
secret: {
|
|
166
|
+
type: string;
|
|
167
|
+
};
|
|
168
|
+
wsUrl: {
|
|
169
|
+
type: string;
|
|
170
|
+
};
|
|
171
|
+
heartbeatIntervalMs: {
|
|
172
|
+
type: string;
|
|
173
|
+
minimum: number;
|
|
174
|
+
};
|
|
175
|
+
reconnectInitialDelayMs: {
|
|
176
|
+
type: string;
|
|
177
|
+
minimum: number;
|
|
178
|
+
};
|
|
179
|
+
reconnectMaxDelayMs: {
|
|
180
|
+
type: string;
|
|
181
|
+
minimum: number;
|
|
182
|
+
};
|
|
183
|
+
publicBaseUrl: {
|
|
184
|
+
type: string;
|
|
185
|
+
};
|
|
145
186
|
welcomeText: {
|
|
146
187
|
type: string;
|
|
147
188
|
};
|
|
@@ -183,6 +224,10 @@ declare const wecomPlugin: {
|
|
|
183
224
|
enabled: {
|
|
184
225
|
type: string;
|
|
185
226
|
};
|
|
227
|
+
mode: {
|
|
228
|
+
type: string;
|
|
229
|
+
enum: string[];
|
|
230
|
+
};
|
|
186
231
|
webhookPath: {
|
|
187
232
|
type: string;
|
|
188
233
|
};
|
|
@@ -195,6 +240,30 @@ declare const wecomPlugin: {
|
|
|
195
240
|
receiveId: {
|
|
196
241
|
type: string;
|
|
197
242
|
};
|
|
243
|
+
botId: {
|
|
244
|
+
type: string;
|
|
245
|
+
};
|
|
246
|
+
secret: {
|
|
247
|
+
type: string;
|
|
248
|
+
};
|
|
249
|
+
wsUrl: {
|
|
250
|
+
type: string;
|
|
251
|
+
};
|
|
252
|
+
heartbeatIntervalMs: {
|
|
253
|
+
type: string;
|
|
254
|
+
minimum: number;
|
|
255
|
+
};
|
|
256
|
+
reconnectInitialDelayMs: {
|
|
257
|
+
type: string;
|
|
258
|
+
minimum: number;
|
|
259
|
+
};
|
|
260
|
+
reconnectMaxDelayMs: {
|
|
261
|
+
type: string;
|
|
262
|
+
minimum: number;
|
|
263
|
+
};
|
|
264
|
+
publicBaseUrl: {
|
|
265
|
+
type: string;
|
|
266
|
+
};
|
|
198
267
|
welcomeText: {
|
|
199
268
|
type: string;
|
|
200
269
|
};
|
|
@@ -247,9 +316,11 @@ declare const wecomPlugin: {
|
|
|
247
316
|
describeAccount: (account: ResolvedWecomAccount) => {
|
|
248
317
|
accountId: string;
|
|
249
318
|
name: string | undefined;
|
|
319
|
+
mode: WecomTransportMode;
|
|
250
320
|
enabled: boolean;
|
|
251
321
|
configured: boolean;
|
|
252
|
-
webhookPath: string;
|
|
322
|
+
webhookPath: string | undefined;
|
|
323
|
+
wsUrl: string | undefined;
|
|
253
324
|
};
|
|
254
325
|
resolveAllowFrom: (params: {
|
|
255
326
|
cfg: PluginConfig;
|
|
@@ -360,6 +431,7 @@ interface PluginRuntime {
|
|
|
360
431
|
resolveAgentRoute?: (params: {
|
|
361
432
|
cfg: unknown;
|
|
362
433
|
channel: string;
|
|
434
|
+
accountId?: string;
|
|
363
435
|
peer: {
|
|
364
436
|
kind: string;
|
|
365
437
|
id: string;
|
|
@@ -423,6 +495,13 @@ interface PluginRuntime {
|
|
|
423
495
|
storePath: string;
|
|
424
496
|
sessionKey: string;
|
|
425
497
|
ctx: unknown;
|
|
498
|
+
updateLastRoute?: {
|
|
499
|
+
sessionKey: string;
|
|
500
|
+
channel: string;
|
|
501
|
+
to: string;
|
|
502
|
+
accountId?: string;
|
|
503
|
+
threadId?: string | number;
|
|
504
|
+
};
|
|
426
505
|
onRecordError?: (err: unknown) => void;
|
|
427
506
|
}) => Promise<void>;
|
|
428
507
|
};
|
|
@@ -465,8 +544,10 @@ type HttpRouteParams = {
|
|
|
465
544
|
handler: (req: IncomingMessage, res: ServerResponse) => Promise<boolean> | boolean;
|
|
466
545
|
};
|
|
467
546
|
type WecomRouteConfig = {
|
|
547
|
+
mode?: "webhook" | "ws";
|
|
468
548
|
webhookPath?: string;
|
|
469
549
|
accounts?: Record<string, {
|
|
550
|
+
mode?: "webhook" | "ws";
|
|
470
551
|
webhookPath?: string;
|
|
471
552
|
}>;
|
|
472
553
|
};
|