refactor: centralize delivery/path/media/version lifecycle

This commit is contained in:
Peter Steinberger
2026-03-02 04:04:02 +00:00
parent f4f094fc3b
commit c0bf42f2a8
19 changed files with 616 additions and 152 deletions

View File

@@ -14,11 +14,18 @@ export const msteamsOutbound: ChannelOutboundAdapter = {
const result = await send(to, text);
return { channel: "msteams", ...result };
},
sendMedia: async ({ cfg, to, text, mediaUrl, deps }) => {
sendMedia: async ({ cfg, to, text, mediaUrl, mediaLocalRoots, deps }) => {
const send =
deps?.sendMSTeams ??
((to, text, opts) => sendMessageMSTeams({ cfg, to, text, mediaUrl: opts?.mediaUrl }));
const result = await send(to, text, { mediaUrl });
((to, text, opts) =>
sendMessageMSTeams({
cfg,
to,
text,
mediaUrl: opts?.mediaUrl,
mediaLocalRoots: opts?.mediaLocalRoots,
}));
const result = await send(to, text, { mediaUrl, mediaLocalRoots });
return { channel: "msteams", ...result };
},
sendPoll: async ({ cfg, to, poll }) => {