/**
 * WS-RPC client for chat-bot transport config (Matrix / Slack / WhatsApp).
 */
import { rpcCall } from "./rpc";
import type { BotConfigPayload } from "./rpcContract";

/** Re-export of the wire-format `BotConfigPayload` as the client-facing `BotConfig` alias. */
export type BotConfig = BotConfigPayload;

export const botConfigApi = {
	getConfig(_baseUrl?: string): Promise<BotConfig> {
		return rpcCall<BotConfig>("bot_config.get");
	},

	saveConfig(config: BotConfig, _baseUrl?: string): Promise<BotConfig> {
		return rpcCall<BotConfigPayload>("bot_config.save", config);
	},
};
