import { parseAuthInput } from './auth.ts'
import { getViewer } from './domain.ts'
import { requireRecord } from './types.ts'
/**
* Return the connected Product Hunt hunter from `viewer.user`.
* Requires the `private` OAuth scope.
* @example
* import getViewer from 'kody:@kody/producthunt/get-viewer'
* const me = await getViewer()
*/
export default async function getViewerEntrypoint(
params: Record<string, unknown> = {},
) {
const input = requireRecord(params, 'get-viewer')
return getViewer(parseAuthInput(input))
}