fix(ci): align strict nullable typing across channels and ui

This commit is contained in:
Peter Steinberger
2026-03-02 09:56:07 +00:00
parent fc692d82fd
commit c1a46301b6
7 changed files with 25 additions and 18 deletions

View File

@@ -182,13 +182,14 @@ export const imessagePlugin: ChannelPlugin<ResolvedIMessageAccount> = {
accountId,
name: input.name,
});
const next =
const next = (
accountId !== DEFAULT_ACCOUNT_ID
? migrateBaseNameToDefaultAccount({
cfg: namedConfig,
channelKey: "imessage",
})
: namedConfig;
: namedConfig
) as typeof cfg;
if (accountId === DEFAULT_ACCOUNT_ID) {
return {
...next,
@@ -200,7 +201,7 @@ export const imessagePlugin: ChannelPlugin<ResolvedIMessageAccount> = {
...buildIMessageSetupPatch(input),
},
},
};
} as typeof cfg;
}
return {
...next,
@@ -219,7 +220,7 @@ export const imessagePlugin: ChannelPlugin<ResolvedIMessageAccount> = {
},
},
},
};
} as typeof cfg;
},
},
outbound: {
@@ -232,9 +233,9 @@ export const imessagePlugin: ChannelPlugin<ResolvedIMessageAccount> = {
cfg,
to,
text,
accountId,
accountId: accountId ?? undefined,
deps,
replyToId,
replyToId: replyToId ?? undefined,
});
return { channel: "imessage", ...result };
},
@@ -244,9 +245,9 @@ export const imessagePlugin: ChannelPlugin<ResolvedIMessageAccount> = {
to,
text,
mediaUrl,
accountId,
accountId: accountId ?? undefined,
deps,
replyToId,
replyToId: replyToId ?? undefined,
});
return { channel: "imessage", ...result };
},

View File

@@ -265,7 +265,7 @@ export const signalPlugin: ChannelPlugin<ResolvedSignalAccount> = {
cfg,
to,
text,
accountId,
accountId: accountId ?? undefined,
deps,
});
return { channel: "signal", ...result };
@@ -276,7 +276,7 @@ export const signalPlugin: ChannelPlugin<ResolvedSignalAccount> = {
to,
text,
mediaUrl,
accountId,
accountId: accountId ?? undefined,
deps,
});
return { channel: "signal", ...result };

View File

@@ -69,8 +69,8 @@ function resolveSlackSendContext(params: {
cfg: Parameters<typeof resolveSlackAccount>[0]["cfg"];
accountId?: string;
deps?: { sendSlack?: SlackSendFn };
replyToId?: string | null;
threadId?: string | null;
replyToId?: string | number | null;
threadId?: string | number | null;
}) {
const send = params.deps?.sendSlack ?? getSlackRuntime().channel.slack.sendMessageSlack;
const account = resolveSlackAccount({ cfg: params.cfg, accountId: params.accountId });
@@ -359,7 +359,7 @@ export const slackPlugin: ChannelPlugin<ResolvedSlackAccount> = {
sendText: async ({ to, text, accountId, deps, replyToId, threadId, cfg }) => {
const { send, threadTsValue, tokenOverride } = resolveSlackSendContext({
cfg,
accountId,
accountId: accountId ?? undefined,
deps,
replyToId,
threadId,
@@ -374,7 +374,7 @@ export const slackPlugin: ChannelPlugin<ResolvedSlackAccount> = {
sendMedia: async ({ to, text, mediaUrl, accountId, deps, replyToId, threadId, cfg }) => {
const { send, threadTsValue, tokenOverride } = resolveSlackSendContext({
cfg,
accountId,
accountId: accountId ?? undefined,
deps,
replyToId,
threadId,

View File

@@ -1,3 +1,4 @@
import type { IncomingMessage, ServerResponse } from "node:http";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { makeFormBody, makeReq, makeRes } from "./test-http-utils.js";