refactor!: rename chat providers to channels

This commit is contained in:
Peter Steinberger
2026-01-13 06:16:43 +00:00
parent 0cd632ba84
commit 90342a4f3a
393 changed files with 8004 additions and 6737 deletions

View File

@@ -0,0 +1,23 @@
import { listChannelPlugins } from "../channels/plugins/index.js";
import type {
ChannelAccountSnapshot,
ChannelStatusIssue,
} from "../channels/plugins/types.js";
export function collectChannelStatusIssues(
payload: Record<string, unknown>,
): ChannelStatusIssue[] {
const issues: ChannelStatusIssue[] = [];
const accountsByChannel = payload.channelAccounts as
| Record<string, unknown>
| undefined;
for (const plugin of listChannelPlugins()) {
const collect = plugin.status?.collectStatusIssues;
if (!collect) continue;
const raw = accountsByChannel?.[plugin.id];
if (!Array.isArray(raw)) continue;
issues.push(...collect(raw as ChannelAccountSnapshot[]));
}
return issues;
}