



























@@ -6,6 +6,7 @@ import {
66isUrlAllowed,
77type MSTeamsAttachmentDownloadLogger,
88type MSTeamsAttachmentFetchPolicy,
9+type MSTeamsAttachmentResolveFn,
910resolveAttachmentFetchPolicy,
1011safeFetchWithPolicy,
1112} from "./shared.js";
@@ -59,6 +60,7 @@ async function fetchBotFrameworkAttachmentInfo(params: {
5960accessToken: string;
6061policy: MSTeamsAttachmentFetchPolicy;
6162fetchFn?: typeof fetch;
63+resolveFn?: MSTeamsAttachmentResolveFn;
6264logger?: MSTeamsAttachmentDownloadLogger;
6365}): Promise<BotFrameworkAttachmentInfo | undefined> {
6466const url = `${normalizeServiceUrl(params.serviceUrl)}/v3/attachments/${encodeURIComponent(params.attachmentId)}`;
@@ -75,6 +77,7 @@ async function fetchBotFrameworkAttachmentInfo(params: {
7577 url,
7678policy: params.policy,
7779fetchFn: params.fetchFn,
80+resolveFn: params.resolveFn,
7881requestInit: {
7982headers: ensureUserAgentHeader({ Authorization: `Bearer ${params.accessToken}` }),
8083},
@@ -109,6 +112,7 @@ async function fetchBotFrameworkAttachmentView(params: {
109112maxBytes: number;
110113policy: MSTeamsAttachmentFetchPolicy;
111114fetchFn?: typeof fetch;
115+resolveFn?: MSTeamsAttachmentResolveFn;
112116logger?: MSTeamsAttachmentDownloadLogger;
113117}): Promise<Buffer | undefined> {
114118const url = `${normalizeServiceUrl(params.serviceUrl)}/v3/attachments/${encodeURIComponent(params.attachmentId)}/views/${encodeURIComponent(params.viewId)}`;
@@ -120,6 +124,7 @@ async function fetchBotFrameworkAttachmentView(params: {
120124 url,
121125policy: params.policy,
122126fetchFn: params.fetchFn,
127+resolveFn: params.resolveFn,
123128requestInit: {
124129headers: ensureUserAgentHeader({ Authorization: `Bearer ${params.accessToken}` }),
125130},
@@ -169,6 +174,7 @@ export async function downloadMSTeamsBotFrameworkAttachment(params: {
169174allowHosts?: string[];
170175authAllowHosts?: string[];
171176fetchFn?: typeof fetch;
177+resolveFn?: MSTeamsAttachmentResolveFn;
172178fileNameHint?: string | null;
173179contentTypeHint?: string | null;
174180preserveFilenames?: boolean;
@@ -205,6 +211,7 @@ export async function downloadMSTeamsBotFrameworkAttachment(params: {
205211 accessToken,
206212 policy,
207213fetchFn: params.fetchFn,
214+resolveFn: params.resolveFn,
208215logger: params.logger,
209216});
210217if (!info) {
@@ -239,6 +246,7 @@ export async function downloadMSTeamsBotFrameworkAttachment(params: {
239246maxBytes: params.maxBytes,
240247 policy,
241248fetchFn: params.fetchFn,
249+resolveFn: params.resolveFn,
242250logger: params.logger,
243251});
244252if (!buffer) {
@@ -296,6 +304,7 @@ export async function downloadMSTeamsBotFrameworkAttachments(params: {
296304allowHosts?: string[];
297305authAllowHosts?: string[];
298306fetchFn?: typeof fetch;
307+resolveFn?: MSTeamsAttachmentResolveFn;
299308fileNameHint?: string | null;
300309contentTypeHint?: string | null;
301310preserveFilenames?: boolean;
@@ -329,6 +338,7 @@ export async function downloadMSTeamsBotFrameworkAttachments(params: {
329338allowHosts: params.allowHosts,
330339authAllowHosts: params.authAllowHosts,
331340fetchFn: params.fetchFn,
341+resolveFn: params.resolveFn,
332342fileNameHint: params.fileNameHint,
333343contentTypeHint: params.contentTypeHint,
334344preserveFilenames: params.preserveFilenames,
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。