import { heyFetch } from './client.js' /** * Get one HEY topic (thread) by id. * * @param {{ topicId: number|string }} input * @returns {Promise} * * @example * import getTopic from 'kody:@danj/hey-email/topic' * const topic = await getTopic({ topicId: 123456789 }) */ export default async function getTopic(input) { const topicId = input?.topicId if (topicId == null) throw new Error('topicId is required') return await heyFetch(`/topics/${topicId}.json`) }