import { createPost, requireRecord } from './client.ts'
import type { CreatePostInput } from './client.ts'
/**
* Create or dry-run a LinkedIn Posts API post with generic payload fields.
* @returns Dry-run preview or publish result when `confirm: true`.
* @example
* import createPost from 'kody:@kody/linkedin/create-post'
* const result = await createPost({ commentary: 'Draft text', dryRun: true })
* // => { dryRun: true, body: { ... } }
*/
export default async function createPostEntrypoint(params: Partial<CreatePostInput> & Record<string, unknown> = {}) {
const input = requireRecord(params, 'create-post')
return createPost(input)
}