import { parseAuthInput } from './auth.ts'
import { getCollection } from './domain.ts'
import { optionalString, requireRecord } from './types.ts'
/**
* Look up a published Product Hunt collection by id or slug.
* @example
* import getCollection from 'kody:@kody/producthunt/get-collection'
* const collection = await getCollection({ slug: 'ai-tools' })
*/
export default async function getCollectionEntrypoint(
params: Record<string, unknown> = {},
) {
const input = requireRecord(params, 'get-collection')
return getCollection({
...parseAuthInput(input),
id: optionalString(input.id, 'id'),
slug: optionalString(input.slug, 'slug'),
})
}