Skip to content

Built for people who want to own their automations. Join the waitlist for an invite.

Package listing

@kody/linkedin

src/delete-post.ts

22 lines · 810 B · TypeScript
import { deletePost, requireRecord, requireStringField } from './client.ts'
import type { DeletePostInput } from './client.ts'

/**
 * Delete a personal-profile LinkedIn post by share or UGC post URN.
 * @param params.postUrn - Post identifier such as `urn:li:share:123`.
 * @returns Deletion status or a dry-run preview.
 * @example
 * import deletePost from 'kody:@kody/linkedin/delete-post'
 * const result = await deletePost({
 *   postUrn: 'urn:li:share:123',
 *   dryRun: true,
 * })
 * // => { dryRun: true, method: 'DELETE', endpoint: '...' }
 */
export default async function deletePostEntrypoint(
	params: Partial<DeletePostInput> & Record<string, unknown> = {},
) {
	const input = requireRecord(params, 'delete-post')
	requireStringField(input, 'postUrn', 'delete-post')
	return deletePost(input)
}