@max1874/feishu 0.3.2 → 0.4.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@max1874/feishu",
3
- "version": "0.3.2",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "description": "OpenClaw Feishu/Lark channel plugin",
6
6
  "license": "MIT",
package/src/bot.ts CHANGED
@@ -594,6 +594,11 @@ export async function handleFeishuMessage(params: {
594
594
  const dmPolicy = feishuCfg?.dmPolicy ?? "pairing";
595
595
  const allowFrom = feishuCfg?.allowFrom ?? [];
596
596
 
597
+ if (dmPolicy === "disabled") {
598
+ log(`feishu: DMs disabled, ignoring message from ${ctx.senderOpenId}`);
599
+ return;
600
+ }
601
+
597
602
  if (dmPolicy === "allowlist") {
598
603
  const match = resolveFeishuAllowlistMatch({
599
604
  allowFrom,
package/src/channel.ts CHANGED
@@ -76,7 +76,7 @@ export const feishuPlugin: ChannelPlugin<ResolvedFeishuAccount> = {
76
76
  connectionMode: { type: "string", enum: ["websocket", "webhook"] },
77
77
  webhookPath: { type: "string" },
78
78
  webhookPort: { type: "integer", minimum: 1 },
79
- dmPolicy: { type: "string", enum: ["open", "pairing", "allowlist"] },
79
+ dmPolicy: { type: "string", enum: ["open", "pairing", "allowlist", "disabled"] },
80
80
  allowFrom: { type: "array", items: { oneOf: [{ type: "string" }, { type: "number" }] } },
81
81
  groupPolicy: { type: "string", enum: ["open", "allowlist", "disabled"] },
82
82
  groupAllowFrom: { type: "array", items: { oneOf: [{ type: "string" }, { type: "number" }] } },
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod";
2
2
  export { z };
3
3
 
4
- const DmPolicySchema = z.enum(["open", "pairing", "allowlist"]);
4
+ const DmPolicySchema = z.enum(["open", "pairing", "allowlist", "disabled"]);
5
5
  const GroupPolicySchema = z.enum(["open", "allowlist", "disabled"]);
6
6
  const FeishuDomainSchema = z.enum(["feishu", "lark"]);
7
7
  const FeishuConnectionModeSchema = z.enum(["websocket", "webhook"]);