← Public packages
@noah/hey-email
HEY.com email integration with Kody: search threads, read messages/attachments, create drafts, and send with explicit confirmation.
src/entries.js
19 lines · 628 B · JavaScriptimport { heyFetch } from './client.js'
/**
* List entries (messages) in a HEY topic.
* Use when reading full purchase/shipping thread bodies after search.
*
* @param {{ topicId: number|string }} input
* @returns {Promise<unknown[]>}
*
* @example
* import getEntries from 'kody:@noah/hey-email/entries'
* const entries = await getEntries({ topicId: 123456789 })
*/
export default async function getEntries(input) {
const topicId = input?.topicId
if (topicId == null) throw new Error('topicId is required')
const data = await heyFetch(`/topics/${topicId}/entries.json`)
return Array.isArray(data) ? data : []
}