From 7242777d63efc4849b0ef9dc95701cd40717781f Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 7 Mar 2026 19:44:56 +0000 Subject: [PATCH] refactor: unify account list/default scaffolding --- extensions/bluebubbles/src/accounts.ts | 43 ++-------- extensions/googlechat/src/accounts.ts | 44 ++--------- extensions/irc/src/accounts.test.ts | 78 +++++++++++++++++++ extensions/irc/src/accounts.ts | 48 ++---------- extensions/matrix/src/matrix/accounts.ts | 50 ++---------- .../mattermost/src/mattermost/accounts.ts | 43 ++-------- extensions/nextcloud-talk/src/accounts.ts | 42 +++------- extensions/zalo/src/accounts.ts | 42 ++-------- extensions/zalouser/src/accounts.ts | 44 ++--------- src/plugin-sdk/bluebubbles.ts | 1 + src/plugin-sdk/googlechat.ts | 1 + src/plugin-sdk/irc.ts | 1 + src/plugin-sdk/matrix.ts | 1 + src/plugin-sdk/mattermost.ts | 1 + src/plugin-sdk/nextcloud-talk.ts | 1 + src/plugin-sdk/zalo.ts | 1 + src/plugin-sdk/zalouser.ts | 1 + 17 files changed, 143 insertions(+), 299 deletions(-) create mode 100644 extensions/irc/src/accounts.test.ts diff --git a/extensions/bluebubbles/src/accounts.ts b/extensions/bluebubbles/src/accounts.ts index 4b86c6d0364..d7c5a281473 100644 --- a/extensions/bluebubbles/src/accounts.ts +++ b/extensions/bluebubbles/src/accounts.ts @@ -1,9 +1,5 @@ -import { - DEFAULT_ACCOUNT_ID, - normalizeAccountId, - normalizeOptionalAccountId, -} from "openclaw/plugin-sdk/account-id"; -import type { OpenClawConfig } from "openclaw/plugin-sdk/bluebubbles"; +import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id"; +import { createAccountListHelpers, type OpenClawConfig } from "openclaw/plugin-sdk/bluebubbles"; import { hasConfiguredSecretInput, normalizeSecretInputString } from "./secret-input.js"; import { normalizeBlueBubblesServerUrl, type BlueBubblesAccountConfig } from "./types.js"; @@ -16,36 +12,11 @@ export type ResolvedBlueBubblesAccount = { baseUrl?: string; }; -function listConfiguredAccountIds(cfg: OpenClawConfig): string[] { - const accounts = cfg.channels?.bluebubbles?.accounts; - if (!accounts || typeof accounts !== "object") { - return []; - } - return Object.keys(accounts).filter(Boolean); -} - -export function listBlueBubblesAccountIds(cfg: OpenClawConfig): string[] { - const ids = listConfiguredAccountIds(cfg); - if (ids.length === 0) { - return [DEFAULT_ACCOUNT_ID]; - } - return ids.toSorted((a, b) => a.localeCompare(b)); -} - -export function resolveDefaultBlueBubblesAccountId(cfg: OpenClawConfig): string { - const preferred = normalizeOptionalAccountId(cfg.channels?.bluebubbles?.defaultAccount); - if ( - preferred && - listBlueBubblesAccountIds(cfg).some((accountId) => normalizeAccountId(accountId) === preferred) - ) { - return preferred; - } - const ids = listBlueBubblesAccountIds(cfg); - if (ids.includes(DEFAULT_ACCOUNT_ID)) { - return DEFAULT_ACCOUNT_ID; - } - return ids[0] ?? DEFAULT_ACCOUNT_ID; -} +const { + listAccountIds: listBlueBubblesAccountIds, + resolveDefaultAccountId: resolveDefaultBlueBubblesAccountId, +} = createAccountListHelpers("bluebubbles"); +export { listBlueBubblesAccountIds, resolveDefaultBlueBubblesAccountId }; function resolveAccountConfig( cfg: OpenClawConfig, diff --git a/extensions/googlechat/src/accounts.ts b/extensions/googlechat/src/accounts.ts index f597efbece4..d864eb3ff37 100644 --- a/extensions/googlechat/src/accounts.ts +++ b/extensions/googlechat/src/accounts.ts @@ -1,10 +1,6 @@ -import { - DEFAULT_ACCOUNT_ID, - normalizeAccountId, - normalizeOptionalAccountId, -} from "openclaw/plugin-sdk/account-id"; +import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id"; import { isSecretRef } from "openclaw/plugin-sdk/googlechat"; -import type { OpenClawConfig } from "openclaw/plugin-sdk/googlechat"; +import { createAccountListHelpers, type OpenClawConfig } from "openclaw/plugin-sdk/googlechat"; import type { GoogleChatAccountConfig } from "./types.config.js"; export type GoogleChatCredentialSource = "file" | "inline" | "env" | "none"; @@ -22,37 +18,11 @@ export type ResolvedGoogleChatAccount = { const ENV_SERVICE_ACCOUNT = "GOOGLE_CHAT_SERVICE_ACCOUNT"; const ENV_SERVICE_ACCOUNT_FILE = "GOOGLE_CHAT_SERVICE_ACCOUNT_FILE"; -function listConfiguredAccountIds(cfg: OpenClawConfig): string[] { - const accounts = cfg.channels?.["googlechat"]?.accounts; - if (!accounts || typeof accounts !== "object") { - return []; - } - return Object.keys(accounts).filter(Boolean); -} - -export function listGoogleChatAccountIds(cfg: OpenClawConfig): string[] { - const ids = listConfiguredAccountIds(cfg); - if (ids.length === 0) { - return [DEFAULT_ACCOUNT_ID]; - } - return ids.toSorted((a, b) => a.localeCompare(b)); -} - -export function resolveDefaultGoogleChatAccountId(cfg: OpenClawConfig): string { - const channel = cfg.channels?.["googlechat"]; - const preferred = normalizeOptionalAccountId(channel?.defaultAccount); - if ( - preferred && - listGoogleChatAccountIds(cfg).some((accountId) => normalizeAccountId(accountId) === preferred) - ) { - return preferred; - } - const ids = listGoogleChatAccountIds(cfg); - if (ids.includes(DEFAULT_ACCOUNT_ID)) { - return DEFAULT_ACCOUNT_ID; - } - return ids[0] ?? DEFAULT_ACCOUNT_ID; -} +const { + listAccountIds: listGoogleChatAccountIds, + resolveDefaultAccountId: resolveDefaultGoogleChatAccountId, +} = createAccountListHelpers("googlechat"); +export { listGoogleChatAccountIds, resolveDefaultGoogleChatAccountId }; function resolveAccountConfig( cfg: OpenClawConfig, diff --git a/extensions/irc/src/accounts.test.ts b/extensions/irc/src/accounts.test.ts new file mode 100644 index 00000000000..59a72d7cbcb --- /dev/null +++ b/extensions/irc/src/accounts.test.ts @@ -0,0 +1,78 @@ +import { describe, expect, it } from "vitest"; +import { listIrcAccountIds, resolveDefaultIrcAccountId } from "./accounts.js"; +import type { CoreConfig } from "./types.js"; + +function asConfig(value: unknown): CoreConfig { + return value as CoreConfig; +} + +describe("listIrcAccountIds", () => { + it("returns default when no accounts are configured", () => { + expect(listIrcAccountIds(asConfig({}))).toEqual(["default"]); + }); + + it("normalizes, deduplicates, and sorts configured account ids", () => { + const cfg = asConfig({ + channels: { + irc: { + accounts: { + "Ops Team": {}, + "ops-team": {}, + Work: {}, + }, + }, + }, + }); + + expect(listIrcAccountIds(cfg)).toEqual(["ops-team", "work"]); + }); +}); + +describe("resolveDefaultIrcAccountId", () => { + it("prefers configured defaultAccount when it matches", () => { + const cfg = asConfig({ + channels: { + irc: { + defaultAccount: "Ops Team", + accounts: { + default: {}, + "ops-team": {}, + }, + }, + }, + }); + + expect(resolveDefaultIrcAccountId(cfg)).toBe("ops-team"); + }); + + it("falls back to default when configured defaultAccount is missing", () => { + const cfg = asConfig({ + channels: { + irc: { + defaultAccount: "missing", + accounts: { + default: {}, + work: {}, + }, + }, + }, + }); + + expect(resolveDefaultIrcAccountId(cfg)).toBe("default"); + }); + + it("falls back to first sorted account when default is absent", () => { + const cfg = asConfig({ + channels: { + irc: { + accounts: { + zzz: {}, + aaa: {}, + }, + }, + }, + }); + + expect(resolveDefaultIrcAccountId(cfg)).toBe("aaa"); + }); +}); diff --git a/extensions/irc/src/accounts.ts b/extensions/irc/src/accounts.ts index 3f9640925c8..d61499c4d39 100644 --- a/extensions/irc/src/accounts.ts +++ b/extensions/irc/src/accounts.ts @@ -1,10 +1,9 @@ import { readFileSync } from "node:fs"; +import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id"; import { - DEFAULT_ACCOUNT_ID, - normalizeAccountId, - normalizeOptionalAccountId, -} from "openclaw/plugin-sdk/account-id"; -import { normalizeResolvedSecretInputString } from "openclaw/plugin-sdk/irc"; + createAccountListHelpers, + normalizeResolvedSecretInputString, +} from "openclaw/plugin-sdk/irc"; import type { CoreConfig, IrcAccountConfig, IrcNickServConfig } from "./types.js"; const TRUTHY_ENV = new Set(["true", "1", "yes", "on"]); @@ -54,19 +53,9 @@ function parseListEnv(value?: string): string[] | undefined { return parsed.length > 0 ? parsed : undefined; } -function listConfiguredAccountIds(cfg: CoreConfig): string[] { - const accounts = cfg.channels?.irc?.accounts; - if (!accounts || typeof accounts !== "object") { - return []; - } - const ids = new Set(); - for (const key of Object.keys(accounts)) { - if (key.trim()) { - ids.add(normalizeAccountId(key)); - } - } - return [...ids]; -} +const { listAccountIds: listIrcAccountIds, resolveDefaultAccountId: resolveDefaultIrcAccountId } = + createAccountListHelpers("irc", { normalizeAccountId }); +export { listIrcAccountIds, resolveDefaultIrcAccountId }; function resolveAccountConfig(cfg: CoreConfig, accountId: string): IrcAccountConfig | undefined { const accounts = cfg.channels?.irc?.accounts; @@ -165,29 +154,6 @@ function resolveNickServConfig(accountId: string, nickserv?: IrcNickServConfig): return merged; } -export function listIrcAccountIds(cfg: CoreConfig): string[] { - const ids = listConfiguredAccountIds(cfg); - if (ids.length === 0) { - return [DEFAULT_ACCOUNT_ID]; - } - return ids.toSorted((a, b) => a.localeCompare(b)); -} - -export function resolveDefaultIrcAccountId(cfg: CoreConfig): string { - const preferred = normalizeOptionalAccountId(cfg.channels?.irc?.defaultAccount); - if ( - preferred && - listIrcAccountIds(cfg).some((accountId) => normalizeAccountId(accountId) === preferred) - ) { - return preferred; - } - const ids = listIrcAccountIds(cfg); - if (ids.includes(DEFAULT_ACCOUNT_ID)) { - return DEFAULT_ACCOUNT_ID; - } - return ids[0] ?? DEFAULT_ACCOUNT_ID; -} - export function resolveIrcAccount(params: { cfg: CoreConfig; accountId?: string | null; diff --git a/extensions/matrix/src/matrix/accounts.ts b/extensions/matrix/src/matrix/accounts.ts index bdb6d90cf13..52fba376200 100644 --- a/extensions/matrix/src/matrix/accounts.ts +++ b/extensions/matrix/src/matrix/accounts.ts @@ -1,8 +1,5 @@ -import { - DEFAULT_ACCOUNT_ID, - normalizeAccountId, - normalizeOptionalAccountId, -} from "openclaw/plugin-sdk/account-id"; +import { normalizeAccountId } from "openclaw/plugin-sdk/account-id"; +import { createAccountListHelpers } from "openclaw/plugin-sdk/matrix"; import { hasConfiguredSecretInput } from "../secret-input.js"; import type { CoreConfig, MatrixConfig } from "../types.js"; import { resolveMatrixConfigForAccount } from "./client.js"; @@ -35,44 +32,11 @@ export type ResolvedMatrixAccount = { config: MatrixConfig; }; -function listConfiguredAccountIds(cfg: CoreConfig): string[] { - const accounts = cfg.channels?.matrix?.accounts; - if (!accounts || typeof accounts !== "object") { - return []; - } - // Normalize and de-duplicate keys so listing and resolution use the same semantics - return [ - ...new Set( - Object.keys(accounts) - .filter(Boolean) - .map((id) => normalizeAccountId(id)), - ), - ]; -} - -export function listMatrixAccountIds(cfg: CoreConfig): string[] { - const ids = listConfiguredAccountIds(cfg); - if (ids.length === 0) { - // Fall back to default if no accounts configured (legacy top-level config) - return [DEFAULT_ACCOUNT_ID]; - } - return ids.toSorted((a, b) => a.localeCompare(b)); -} - -export function resolveDefaultMatrixAccountId(cfg: CoreConfig): string { - const preferred = normalizeOptionalAccountId(cfg.channels?.matrix?.defaultAccount); - if ( - preferred && - listMatrixAccountIds(cfg).some((accountId) => normalizeAccountId(accountId) === preferred) - ) { - return preferred; - } - const ids = listMatrixAccountIds(cfg); - if (ids.includes(DEFAULT_ACCOUNT_ID)) { - return DEFAULT_ACCOUNT_ID; - } - return ids[0] ?? DEFAULT_ACCOUNT_ID; -} +const { + listAccountIds: listMatrixAccountIds, + resolveDefaultAccountId: resolveDefaultMatrixAccountId, +} = createAccountListHelpers("matrix", { normalizeAccountId }); +export { listMatrixAccountIds, resolveDefaultMatrixAccountId }; function resolveAccountConfig(cfg: CoreConfig, accountId: string): MatrixConfig | undefined { const accounts = cfg.channels?.matrix?.accounts; diff --git a/extensions/mattermost/src/mattermost/accounts.ts b/extensions/mattermost/src/mattermost/accounts.ts index e8a3f5d9572..1de9a09bca8 100644 --- a/extensions/mattermost/src/mattermost/accounts.ts +++ b/extensions/mattermost/src/mattermost/accounts.ts @@ -1,9 +1,5 @@ -import { - DEFAULT_ACCOUNT_ID, - normalizeAccountId, - normalizeOptionalAccountId, -} from "openclaw/plugin-sdk/account-id"; -import type { OpenClawConfig } from "openclaw/plugin-sdk/mattermost"; +import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id"; +import { createAccountListHelpers, type OpenClawConfig } from "openclaw/plugin-sdk/mattermost"; import { normalizeResolvedSecretInputString, normalizeSecretInputString } from "../secret-input.js"; import type { MattermostAccountConfig, MattermostChatMode } from "../types.js"; import { normalizeMattermostBaseUrl } from "./client.js"; @@ -28,36 +24,11 @@ export type ResolvedMattermostAccount = { blockStreamingCoalesce?: MattermostAccountConfig["blockStreamingCoalesce"]; }; -function listConfiguredAccountIds(cfg: OpenClawConfig): string[] { - const accounts = cfg.channels?.mattermost?.accounts; - if (!accounts || typeof accounts !== "object") { - return []; - } - return Object.keys(accounts).filter(Boolean); -} - -export function listMattermostAccountIds(cfg: OpenClawConfig): string[] { - const ids = listConfiguredAccountIds(cfg); - if (ids.length === 0) { - return [DEFAULT_ACCOUNT_ID]; - } - return ids.toSorted((a, b) => a.localeCompare(b)); -} - -export function resolveDefaultMattermostAccountId(cfg: OpenClawConfig): string { - const preferred = normalizeOptionalAccountId(cfg.channels?.mattermost?.defaultAccount); - if ( - preferred && - listMattermostAccountIds(cfg).some((accountId) => normalizeAccountId(accountId) === preferred) - ) { - return preferred; - } - const ids = listMattermostAccountIds(cfg); - if (ids.includes(DEFAULT_ACCOUNT_ID)) { - return DEFAULT_ACCOUNT_ID; - } - return ids[0] ?? DEFAULT_ACCOUNT_ID; -} +const { + listAccountIds: listMattermostAccountIds, + resolveDefaultAccountId: resolveDefaultMattermostAccountId, +} = createAccountListHelpers("mattermost"); +export { listMattermostAccountIds, resolveDefaultMattermostAccountId }; function resolveAccountConfig( cfg: OpenClawConfig, diff --git a/extensions/nextcloud-talk/src/accounts.ts b/extensions/nextcloud-talk/src/accounts.ts index c2d9d8f40f0..74bb45cfd8b 100644 --- a/extensions/nextcloud-talk/src/accounts.ts +++ b/extensions/nextcloud-talk/src/accounts.ts @@ -1,11 +1,8 @@ import { readFileSync } from "node:fs"; import { + createAccountListHelpers, DEFAULT_ACCOUNT_ID, normalizeAccountId, - normalizeOptionalAccountId, -} from "openclaw/plugin-sdk/account-id"; -import { - listConfiguredAccountIds as listConfiguredAccountIdsFromSection, resolveAccountWithDefaultFallback, } from "openclaw/plugin-sdk/nextcloud-talk"; import { normalizeResolvedSecretInputString } from "./secret-input.js"; @@ -32,37 +29,18 @@ export type ResolvedNextcloudTalkAccount = { config: NextcloudTalkAccountConfig; }; -function listConfiguredAccountIds(cfg: CoreConfig): string[] { - return listConfiguredAccountIdsFromSection({ - accounts: cfg.channels?.["nextcloud-talk"]?.accounts as Record | undefined, - normalizeAccountId, - }); -} +const { + listAccountIds: listNextcloudTalkAccountIdsInternal, + resolveDefaultAccountId: resolveDefaultNextcloudTalkAccountId, +} = createAccountListHelpers("nextcloud-talk", { + normalizeAccountId, +}); +export { resolveDefaultNextcloudTalkAccountId }; export function listNextcloudTalkAccountIds(cfg: CoreConfig): string[] { - const ids = listConfiguredAccountIds(cfg); + const ids = listNextcloudTalkAccountIdsInternal(cfg); debugAccounts("listNextcloudTalkAccountIds", ids); - if (ids.length === 0) { - return [DEFAULT_ACCOUNT_ID]; - } - return ids.toSorted((a, b) => a.localeCompare(b)); -} - -export function resolveDefaultNextcloudTalkAccountId(cfg: CoreConfig): string { - const preferred = normalizeOptionalAccountId(cfg.channels?.["nextcloud-talk"]?.defaultAccount); - if ( - preferred && - listNextcloudTalkAccountIds(cfg).some( - (accountId) => normalizeAccountId(accountId) === preferred, - ) - ) { - return preferred; - } - const ids = listNextcloudTalkAccountIds(cfg); - if (ids.includes(DEFAULT_ACCOUNT_ID)) { - return DEFAULT_ACCOUNT_ID; - } - return ids[0] ?? DEFAULT_ACCOUNT_ID; + return ids; } function resolveAccountConfig( diff --git a/extensions/zalo/src/accounts.ts b/extensions/zalo/src/accounts.ts index c4cb8930cca..205a6b94474 100644 --- a/extensions/zalo/src/accounts.ts +++ b/extensions/zalo/src/accounts.ts @@ -1,45 +1,13 @@ -import { - DEFAULT_ACCOUNT_ID, - normalizeAccountId, - normalizeOptionalAccountId, -} from "openclaw/plugin-sdk/account-id"; -import type { OpenClawConfig } from "openclaw/plugin-sdk/zalo"; +import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id"; +import { createAccountListHelpers, type OpenClawConfig } from "openclaw/plugin-sdk/zalo"; import { resolveZaloToken } from "./token.js"; import type { ResolvedZaloAccount, ZaloAccountConfig, ZaloConfig } from "./types.js"; export type { ResolvedZaloAccount }; -function listConfiguredAccountIds(cfg: OpenClawConfig): string[] { - const accounts = (cfg.channels?.zalo as ZaloConfig | undefined)?.accounts; - if (!accounts || typeof accounts !== "object") { - return []; - } - return Object.keys(accounts).filter(Boolean); -} - -export function listZaloAccountIds(cfg: OpenClawConfig): string[] { - const ids = listConfiguredAccountIds(cfg); - if (ids.length === 0) { - return [DEFAULT_ACCOUNT_ID]; - } - return ids.toSorted((a, b) => a.localeCompare(b)); -} - -export function resolveDefaultZaloAccountId(cfg: OpenClawConfig): string { - const zaloConfig = cfg.channels?.zalo as ZaloConfig | undefined; - const preferred = normalizeOptionalAccountId(zaloConfig?.defaultAccount); - if ( - preferred && - listZaloAccountIds(cfg).some((accountId) => normalizeAccountId(accountId) === preferred) - ) { - return preferred; - } - const ids = listZaloAccountIds(cfg); - if (ids.includes(DEFAULT_ACCOUNT_ID)) { - return DEFAULT_ACCOUNT_ID; - } - return ids[0] ?? DEFAULT_ACCOUNT_ID; -} +const { listAccountIds: listZaloAccountIds, resolveDefaultAccountId: resolveDefaultZaloAccountId } = + createAccountListHelpers("zalo"); +export { listZaloAccountIds, resolveDefaultZaloAccountId }; function resolveAccountConfig( cfg: OpenClawConfig, diff --git a/extensions/zalouser/src/accounts.ts b/extensions/zalouser/src/accounts.ts index ebf4182f15e..5ebec2d2c93 100644 --- a/extensions/zalouser/src/accounts.ts +++ b/extensions/zalouser/src/accounts.ts @@ -1,43 +1,13 @@ -import { - DEFAULT_ACCOUNT_ID, - normalizeAccountId, - normalizeOptionalAccountId, -} from "openclaw/plugin-sdk/account-id"; -import type { OpenClawConfig } from "openclaw/plugin-sdk/zalouser"; +import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id"; +import { createAccountListHelpers, type OpenClawConfig } from "openclaw/plugin-sdk/zalouser"; import type { ResolvedZalouserAccount, ZalouserAccountConfig, ZalouserConfig } from "./types.js"; import { checkZaloAuthenticated, getZaloUserInfo } from "./zalo-js.js"; -function listConfiguredAccountIds(cfg: OpenClawConfig): string[] { - const accounts = (cfg.channels?.zalouser as ZalouserConfig | undefined)?.accounts; - if (!accounts || typeof accounts !== "object") { - return []; - } - return Object.keys(accounts).filter(Boolean); -} - -export function listZalouserAccountIds(cfg: OpenClawConfig): string[] { - const ids = listConfiguredAccountIds(cfg); - if (ids.length === 0) { - return [DEFAULT_ACCOUNT_ID]; - } - return ids.toSorted((a, b) => a.localeCompare(b)); -} - -export function resolveDefaultZalouserAccountId(cfg: OpenClawConfig): string { - const zalouserConfig = cfg.channels?.zalouser as ZalouserConfig | undefined; - const preferred = normalizeOptionalAccountId(zalouserConfig?.defaultAccount); - if ( - preferred && - listZalouserAccountIds(cfg).some((accountId) => normalizeAccountId(accountId) === preferred) - ) { - return preferred; - } - const ids = listZalouserAccountIds(cfg); - if (ids.includes(DEFAULT_ACCOUNT_ID)) { - return DEFAULT_ACCOUNT_ID; - } - return ids[0] ?? DEFAULT_ACCOUNT_ID; -} +const { + listAccountIds: listZalouserAccountIds, + resolveDefaultAccountId: resolveDefaultZalouserAccountId, +} = createAccountListHelpers("zalouser"); +export { listZalouserAccountIds, resolveDefaultZalouserAccountId }; function resolveAccountConfig( cfg: OpenClawConfig, diff --git a/src/plugin-sdk/bluebubbles.ts b/src/plugin-sdk/bluebubbles.ts index 8cf9b38b916..bbe87260f86 100644 --- a/src/plugin-sdk/bluebubbles.ts +++ b/src/plugin-sdk/bluebubbles.ts @@ -45,6 +45,7 @@ export { applyAccountNameToChannelSection, migrateBaseNameToDefaultAccount, } from "../channels/plugins/setup-helpers.js"; +export { createAccountListHelpers } from "../channels/plugins/account-helpers.js"; export { collectBlueBubblesStatusIssues } from "../channels/plugins/status-issues/bluebubbles.js"; export type { BaseProbeResult, diff --git a/src/plugin-sdk/googlechat.ts b/src/plugin-sdk/googlechat.ts index 204e0affd3c..40ebe2db47b 100644 --- a/src/plugin-sdk/googlechat.ts +++ b/src/plugin-sdk/googlechat.ts @@ -32,6 +32,7 @@ export { applyAccountNameToChannelSection, migrateBaseNameToDefaultAccount, } from "../channels/plugins/setup-helpers.js"; +export { createAccountListHelpers } from "../channels/plugins/account-helpers.js"; export type { ChannelAccountSnapshot, ChannelMessageActionAdapter, diff --git a/src/plugin-sdk/irc.ts b/src/plugin-sdk/irc.ts index 1983130d193..31321801522 100644 --- a/src/plugin-sdk/irc.ts +++ b/src/plugin-sdk/irc.ts @@ -7,6 +7,7 @@ export { deleteAccountFromConfigSection, setAccountEnabledInConfigSection, } from "../channels/plugins/config-helpers.js"; +export { createAccountListHelpers } from "../channels/plugins/account-helpers.js"; export { buildChannelConfigSchema } from "../channels/plugins/config-schema.js"; export { formatPairingApproveHint } from "../channels/plugins/helpers.js"; export type { diff --git a/src/plugin-sdk/matrix.ts b/src/plugin-sdk/matrix.ts index b029062e28a..5cb039af0c2 100644 --- a/src/plugin-sdk/matrix.ts +++ b/src/plugin-sdk/matrix.ts @@ -39,6 +39,7 @@ export { } from "../channels/plugins/onboarding/helpers.js"; export { PAIRING_APPROVED_MESSAGE } from "../channels/plugins/pairing-message.js"; export { applyAccountNameToChannelSection } from "../channels/plugins/setup-helpers.js"; +export { createAccountListHelpers } from "../channels/plugins/account-helpers.js"; export type { BaseProbeResult, ChannelDirectoryEntry, diff --git a/src/plugin-sdk/mattermost.ts b/src/plugin-sdk/mattermost.ts index 9ad22e60284..ca4af538a78 100644 --- a/src/plugin-sdk/mattermost.ts +++ b/src/plugin-sdk/mattermost.ts @@ -37,6 +37,7 @@ export { applyAccountNameToChannelSection, migrateBaseNameToDefaultAccount, } from "../channels/plugins/setup-helpers.js"; +export { createAccountListHelpers } from "../channels/plugins/account-helpers.js"; export type { BaseProbeResult, ChannelAccountSnapshot, diff --git a/src/plugin-sdk/nextcloud-talk.ts b/src/plugin-sdk/nextcloud-talk.ts index e6f1f3a9bcd..a7b86724a4f 100644 --- a/src/plugin-sdk/nextcloud-talk.ts +++ b/src/plugin-sdk/nextcloud-talk.ts @@ -28,6 +28,7 @@ export { promptSingleChannelSecretInput, } from "../channels/plugins/onboarding/helpers.js"; export { applyAccountNameToChannelSection } from "../channels/plugins/setup-helpers.js"; +export { createAccountListHelpers } from "../channels/plugins/account-helpers.js"; export type { ChannelGroupContext, ChannelSetupInput } from "../channels/plugins/types.js"; export type { ChannelPlugin } from "../channels/plugins/types.plugin.js"; export { createReplyPrefixOptions } from "../channels/reply-prefix.js"; diff --git a/src/plugin-sdk/zalo.ts b/src/plugin-sdk/zalo.ts index a498e050034..c11739dfd4a 100644 --- a/src/plugin-sdk/zalo.ts +++ b/src/plugin-sdk/zalo.ts @@ -25,6 +25,7 @@ export { applyAccountNameToChannelSection, migrateBaseNameToDefaultAccount, } from "../channels/plugins/setup-helpers.js"; +export { createAccountListHelpers } from "../channels/plugins/account-helpers.js"; export type { BaseProbeResult, BaseTokenResolution, diff --git a/src/plugin-sdk/zalouser.ts b/src/plugin-sdk/zalouser.ts index 7558c7f750c..a9d32b3010d 100644 --- a/src/plugin-sdk/zalouser.ts +++ b/src/plugin-sdk/zalouser.ts @@ -25,6 +25,7 @@ export { applyAccountNameToChannelSection, migrateBaseNameToDefaultAccount, } from "../channels/plugins/setup-helpers.js"; +export { createAccountListHelpers } from "../channels/plugins/account-helpers.js"; export type { BaseProbeResult, ChannelAccountSnapshot,