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:
Anton Eicher
2026-03-06 23:50:34 +02:00
committed by GitHub
parent 7ce79c8972
commit 20db7afd5f
2 changed files with 2 additions and 13 deletions

View File

@@ -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({
cfg: {} as any,
to: "user:ou_target",
@@ -190,11 +190,7 @@ describe("sendMediaFeishu msg_type routing", () => {
fileName: "photo.png",
});
expect(imageCreateMock).toHaveBeenCalledWith(
expect.objectContaining({
timeout: 120_000,
}),
);
expect(imageCreateMock).toHaveBeenCalled();
expect(messageCreateMock).toHaveBeenCalledWith(
expect.objectContaining({
data: expect.objectContaining({ msg_type: "image" }),
@@ -320,7 +316,6 @@ describe("sendMediaFeishu msg_type routing", () => {
expect(imageGetMock).toHaveBeenCalledWith(
expect.objectContaining({
path: { image_key: imageKey },
timeout: 120_000,
}),
);
expect(result.buffer).toEqual(Buffer.from("image-data"));
@@ -512,7 +507,6 @@ describe("downloadMessageResourceFeishu", () => {
expect.objectContaining({
path: { message_id: "om_audio_msg", file_key: "file_key_audio" },
params: { type: "file" },
timeout: 120_000,
}),
);
expect(result.buffer).toBeInstanceOf(Buffer);
@@ -532,7 +526,6 @@ describe("downloadMessageResourceFeishu", () => {
expect.objectContaining({
path: { message_id: "om_img_msg", file_key: "img_key_1" },
params: { type: "image" },
timeout: 120_000,
}),
);
expect(result.buffer).toBeInstanceOf(Buffer);

View File

@@ -106,7 +106,6 @@ export async function downloadImageFeishu(params: {
const response = await client.im.image.get({
path: { image_key: normalizedImageKey },
timeout: FEISHU_MEDIA_HTTP_TIMEOUT_MS,
});
const buffer = await readFeishuResponseBuffer({
@@ -146,7 +145,6 @@ export async function downloadMessageResourceFeishu(params: {
const response = await client.im.messageResource.get({
path: { message_id: messageId, file_key: normalizedFileKey },
params: { type },
timeout: FEISHU_MEDIA_HTTP_TIMEOUT_MS,
});
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
image: imageData as any,
},
timeout: FEISHU_MEDIA_HTTP_TIMEOUT_MS,
});
// SDK v1.30+ returns data directly without code wrapper on success
@@ -277,7 +274,6 @@ export async function uploadFileFeishu(params: {
file: fileData as any,
...(duration !== undefined && { duration }),
},
timeout: FEISHU_MEDIA_HTTP_TIMEOUT_MS,
});
// SDK v1.30+ returns data directly without code wrapper on success