mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 19:10:58 +00:00
fix(feishu): remove invalid timeout properties from SDK method calls (#38267)
The `timeout` property is not part of the Lark SDK method signatures, causing TS2353 errors. The client-level `httpTimeoutMs` already applies the timeout to all requests. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -182,7 +182,7 @@ describe("sendMediaFeishu msg_type routing", () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("uses image upload timeout override for image media", async () => {
|
it("uploads image for image media", async () => {
|
||||||
await sendMediaFeishu({
|
await sendMediaFeishu({
|
||||||
cfg: {} as any,
|
cfg: {} as any,
|
||||||
to: "user:ou_target",
|
to: "user:ou_target",
|
||||||
@@ -190,11 +190,7 @@ describe("sendMediaFeishu msg_type routing", () => {
|
|||||||
fileName: "photo.png",
|
fileName: "photo.png",
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(imageCreateMock).toHaveBeenCalledWith(
|
expect(imageCreateMock).toHaveBeenCalled();
|
||||||
expect.objectContaining({
|
|
||||||
timeout: 120_000,
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
expect(messageCreateMock).toHaveBeenCalledWith(
|
expect(messageCreateMock).toHaveBeenCalledWith(
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
data: expect.objectContaining({ msg_type: "image" }),
|
data: expect.objectContaining({ msg_type: "image" }),
|
||||||
@@ -320,7 +316,6 @@ describe("sendMediaFeishu msg_type routing", () => {
|
|||||||
expect(imageGetMock).toHaveBeenCalledWith(
|
expect(imageGetMock).toHaveBeenCalledWith(
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
path: { image_key: imageKey },
|
path: { image_key: imageKey },
|
||||||
timeout: 120_000,
|
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
expect(result.buffer).toEqual(Buffer.from("image-data"));
|
expect(result.buffer).toEqual(Buffer.from("image-data"));
|
||||||
@@ -512,7 +507,6 @@ describe("downloadMessageResourceFeishu", () => {
|
|||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
path: { message_id: "om_audio_msg", file_key: "file_key_audio" },
|
path: { message_id: "om_audio_msg", file_key: "file_key_audio" },
|
||||||
params: { type: "file" },
|
params: { type: "file" },
|
||||||
timeout: 120_000,
|
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
expect(result.buffer).toBeInstanceOf(Buffer);
|
expect(result.buffer).toBeInstanceOf(Buffer);
|
||||||
@@ -532,7 +526,6 @@ describe("downloadMessageResourceFeishu", () => {
|
|||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
path: { message_id: "om_img_msg", file_key: "img_key_1" },
|
path: { message_id: "om_img_msg", file_key: "img_key_1" },
|
||||||
params: { type: "image" },
|
params: { type: "image" },
|
||||||
timeout: 120_000,
|
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
expect(result.buffer).toBeInstanceOf(Buffer);
|
expect(result.buffer).toBeInstanceOf(Buffer);
|
||||||
|
|||||||
@@ -106,7 +106,6 @@ export async function downloadImageFeishu(params: {
|
|||||||
|
|
||||||
const response = await client.im.image.get({
|
const response = await client.im.image.get({
|
||||||
path: { image_key: normalizedImageKey },
|
path: { image_key: normalizedImageKey },
|
||||||
timeout: FEISHU_MEDIA_HTTP_TIMEOUT_MS,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const buffer = await readFeishuResponseBuffer({
|
const buffer = await readFeishuResponseBuffer({
|
||||||
@@ -146,7 +145,6 @@ export async function downloadMessageResourceFeishu(params: {
|
|||||||
const response = await client.im.messageResource.get({
|
const response = await client.im.messageResource.get({
|
||||||
path: { message_id: messageId, file_key: normalizedFileKey },
|
path: { message_id: messageId, file_key: normalizedFileKey },
|
||||||
params: { type },
|
params: { type },
|
||||||
timeout: FEISHU_MEDIA_HTTP_TIMEOUT_MS,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const buffer = await readFeishuResponseBuffer({
|
const buffer = await readFeishuResponseBuffer({
|
||||||
@@ -202,7 +200,6 @@ export async function uploadImageFeishu(params: {
|
|||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- SDK accepts Buffer or ReadStream
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- SDK accepts Buffer or ReadStream
|
||||||
image: imageData as any,
|
image: imageData as any,
|
||||||
},
|
},
|
||||||
timeout: FEISHU_MEDIA_HTTP_TIMEOUT_MS,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// SDK v1.30+ returns data directly without code wrapper on success
|
// SDK v1.30+ returns data directly without code wrapper on success
|
||||||
@@ -277,7 +274,6 @@ export async function uploadFileFeishu(params: {
|
|||||||
file: fileData as any,
|
file: fileData as any,
|
||||||
...(duration !== undefined && { duration }),
|
...(duration !== undefined && { duration }),
|
||||||
},
|
},
|
||||||
timeout: FEISHU_MEDIA_HTTP_TIMEOUT_MS,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// SDK v1.30+ returns data directly without code wrapper on success
|
// SDK v1.30+ returns data directly without code wrapper on success
|
||||||
|
|||||||
Reference in New Issue
Block a user