@openclaw/synology-chat 2026.5.1-beta.1 → 2026.5.2-beta.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.
- package/package.json +3 -3
- package/src/channel.test.ts +4 -0
- package/src/channel.ts +4 -2
- package/src/gateway-runtime.ts +1 -1
- package/src/setup-surface.ts +1 -1
- package/src/webhook-handler.ts +0 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/synology-chat",
|
|
3
|
-
"version": "2026.5.
|
|
3
|
+
"version": "2026.5.2-beta.1",
|
|
4
4
|
"description": "Synology Chat channel plugin for OpenClaw",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"minHostVersion": ">=2026.4.10"
|
|
34
34
|
},
|
|
35
35
|
"compat": {
|
|
36
|
-
"pluginApi": ">=2026.
|
|
36
|
+
"pluginApi": ">=2026.5.2-beta.1"
|
|
37
37
|
},
|
|
38
38
|
"build": {
|
|
39
|
-
"openclawVersion": "2026.5.
|
|
39
|
+
"openclawVersion": "2026.5.2-beta.1"
|
|
40
40
|
},
|
|
41
41
|
"release": {
|
|
42
42
|
"publishToClawHub": true,
|
package/src/channel.test.ts
CHANGED
|
@@ -345,6 +345,8 @@ describe("createSynologyChatPlugin", () => {
|
|
|
345
345
|
it("normalizeTarget strips prefix and trims", () => {
|
|
346
346
|
const plugin = createSynologyChatPlugin();
|
|
347
347
|
expect(plugin.messaging.normalizeTarget("synology-chat:123")).toBe("123");
|
|
348
|
+
expect(plugin.messaging.normalizeTarget("synology_chat:123")).toBe("123");
|
|
349
|
+
expect(plugin.messaging.normalizeTarget("synology:123")).toBe("123");
|
|
348
350
|
expect(plugin.messaging.normalizeTarget(" 456 ")).toBe("456");
|
|
349
351
|
expect(plugin.messaging.normalizeTarget("")).toBeUndefined();
|
|
350
352
|
});
|
|
@@ -353,6 +355,8 @@ describe("createSynologyChatPlugin", () => {
|
|
|
353
355
|
const plugin = createSynologyChatPlugin();
|
|
354
356
|
expect(plugin.messaging.targetResolver.looksLikeId("12345")).toBe(true);
|
|
355
357
|
expect(plugin.messaging.targetResolver.looksLikeId("synology-chat:99")).toBe(true);
|
|
358
|
+
expect(plugin.messaging.targetResolver.looksLikeId("synology_chat:99")).toBe(true);
|
|
359
|
+
expect(plugin.messaging.targetResolver.looksLikeId("synology:99")).toBe(true);
|
|
356
360
|
expect(plugin.messaging.targetResolver.looksLikeId("notanumber")).toBe(false);
|
|
357
361
|
expect(plugin.messaging.targetResolver.looksLikeId("")).toBe(false);
|
|
358
362
|
});
|
package/src/channel.ts
CHANGED
|
@@ -155,6 +155,7 @@ type SynologyChatPlugin = Omit<
|
|
|
155
155
|
}) => string[];
|
|
156
156
|
};
|
|
157
157
|
messaging: {
|
|
158
|
+
targetPrefixes?: readonly string[];
|
|
158
159
|
normalizeTarget: (target: string) => string | undefined;
|
|
159
160
|
targetResolver: {
|
|
160
161
|
looksLikeId: (id: string) => boolean;
|
|
@@ -237,13 +238,14 @@ export function createSynologyChatPlugin(): SynologyChatPlugin {
|
|
|
237
238
|
},
|
|
238
239
|
approvalCapability: synologyChatApprovalAuth,
|
|
239
240
|
messaging: {
|
|
241
|
+
targetPrefixes: ["synology-chat", "synology_chat", "synology"],
|
|
240
242
|
normalizeTarget: (target: string) => {
|
|
241
243
|
const trimmed = target.trim();
|
|
242
244
|
if (!trimmed) {
|
|
243
245
|
return undefined;
|
|
244
246
|
}
|
|
245
247
|
// Strip common prefixes
|
|
246
|
-
return trimmed.replace(/^synology[-_]?chat
|
|
248
|
+
return trimmed.replace(/^synology(?:[-_]?chat)?:/i, "").trim();
|
|
247
249
|
},
|
|
248
250
|
targetResolver: {
|
|
249
251
|
looksLikeId: (id: string) => {
|
|
@@ -252,7 +254,7 @@ export function createSynologyChatPlugin(): SynologyChatPlugin {
|
|
|
252
254
|
return false;
|
|
253
255
|
}
|
|
254
256
|
// Synology Chat user IDs are numeric
|
|
255
|
-
return /^\d+$/.test(trimmed) || /^synology[-_]?chat
|
|
257
|
+
return /^\d+$/.test(trimmed) || /^synology(?:[-_]?chat)?:/i.test(trimmed);
|
|
256
258
|
},
|
|
257
259
|
hint: "<userId>",
|
|
258
260
|
},
|
package/src/gateway-runtime.ts
CHANGED
|
@@ -68,7 +68,7 @@ function createUnknownArgsLogAdapter(
|
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
function collectSynologyGatewayStartupIssues(params: {
|
|
72
72
|
cfg: OpenClawConfig;
|
|
73
73
|
account: ResolvedSynologyChatAccount;
|
|
74
74
|
accountId: string;
|
package/src/setup-surface.ts
CHANGED
|
@@ -130,7 +130,7 @@ function validateWebhookPath(value: string): string | undefined {
|
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
function parseSynologyUserId(value: string): string | null {
|
|
133
|
-
const cleaned = value.replace(/^synology-chat
|
|
133
|
+
const cleaned = value.replace(/^synology(?:[-_]?chat)?:/i, "").trim();
|
|
134
134
|
return /^\d+$/.test(cleaned) ? cleaned : null;
|
|
135
135
|
}
|
|
136
136
|
|
package/src/webhook-handler.ts
CHANGED
|
@@ -128,10 +128,6 @@ export function clearSynologyWebhookRateLimiterStateForTest(): void {
|
|
|
128
128
|
webhookInFlightLimiter.clear();
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
export function getSynologyWebhookRateLimiterCountForTest(): number {
|
|
132
|
-
return rateLimiters.size + invalidTokenRateLimiters.size;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
131
|
function getSynologyWebhookInvalidTokenRateLimitKey(req: IncomingMessage): string {
|
|
136
132
|
return req.socket?.remoteAddress ?? "unknown";
|
|
137
133
|
}
|