import { SmrtObjectOptions, SmrtObject } from '@happyvertical/smrt-core'; /** * Post status */ export type PostStatus = 'draft' | 'pending_approval' | 'approved' | 'scheduled' | 'publishing' | 'dry_run' | 'staged' | 'published' | 'failed' | 'cancelled'; /** * Social post type */ export type SocialPostType = 'text' | 'link' | 'image' | 'video'; /** * Post analytics */ export interface PostAnalytics { /** * View/impression count */ views?: number; /** * Impression count when the platform distinguishes it from views */ impressions?: number; /** * Like/favorite count */ likes?: number; /** * Comment count */ comments?: number; /** * Share/repost count */ shares?: number; /** * Link click count */ clicks?: number; /** * Raw platform analytics payload */ raw?: unknown; /** * When analytics were last updated */ lastUpdated?: Date; } /** * Social post creation options */ export interface SocialPostOptions extends SmrtObjectOptions { /** * Social account to publish to */ socialAccountId?: string | null; /** * Video content to publish */ videoContentId?: string | null; /** * Generic content ID (for non-video content) */ contentId?: string | null; /** * High-level post type */ postType?: SocialPostType; /** * Public media URL for platforms that cannot upload buffers */ mediaUrl?: string | null; /** * Post title (for platforms that support it) */ title?: string | null; /** * Post description/caption */ description?: string; /** * Hashtags to include */ hashtags?: string[]; /** * Link URL to include */ linkUrl?: string | null; /** * Platform-specific post ID (after publishing) */ platformPostId?: string | null; /** * Public post URL (after publishing) */ platformUrl?: string | null; /** * Scheduled publish time */ scheduledAt?: Date | null; /** * Actual publish time */ publishedAt?: Date | null; /** * Post status * @default 'draft' */ status?: PostStatus; /** * Error message if status is 'failed' */ errorMessage?: string | null; /** * Engagement analytics */ analytics?: PostAnalytics; /** * When analytics were last synced */ analyticsLastSyncedAt?: Date | null; /** * Tenant ID for multi-tenant isolation */ tenantId?: string | null; } /** * Social media post for multi-platform publishing * * SocialPost represents a post published or scheduled to a social * platform. It tracks publishing status and engagement analytics, * and can reference VideoContent for video posts. * * @example * ```typescript * import { SocialPost } from '@happyvertical/smrt-social'; * * const post = new SocialPost({ * socialAccountId: 'account-123', * videoContentId: 'video-456', * title: 'Breaking News from Bentley', * description: 'Latest updates from the town council meeting.', * hashtags: ['news', 'local', 'bentley'], * linkUrl: 'https://example.com/article', * scheduledAt: new Date('2026-01-26T18:00:00Z'), * }); * await post.save(); * ``` */ export declare class SocialPost extends SmrtObject { /** * Tenant ID for multi-tenant isolation */ tenantId: string | null; /** * Social account to publish to */ socialAccountId: string | null; /** * Video content to publish * * Cross-package target (`@happyvertical/smrt-video`), so it is a * `@crossPackageRef` rather than a `@foreignKey`: no DDL FK constraint and * no value import back into this package. */ videoContentId: string | null; /** * Generic content ID (for non-video content) */ contentId: string | null; /** * High-level post type */ postType: SocialPostType; /** * Public media URL for platforms that require URL media publishing */ mediaUrl: string | null; /** * Post title (for platforms that support it) */ title: string | null; /** * Post description/caption */ description: string; /** * Hashtags to include */ hashtags: string[]; /** * Link URL to include in the post */ linkUrl: string | null; /** * Platform-specific post ID (set after publishing) */ platformPostId: string | null; /** * Public post URL (set after publishing) */ platformUrl: string | null; /** * Scheduled publish time * If set, post will be scheduled instead of published immediately */ scheduledAt: Date | null; /** * Actual publish time */ publishedAt: Date | null; /** * Post status * - draft: Not yet submitted for publishing * - pending_approval: Awaiting editorial approval * - approved: Approved and ready to publish * - scheduled: Queued for future publishing * - publishing: Currently being published * - dry_run: Payload was validated without remote write * - staged: Non-public platform object/container was created * - published: Successfully published * - failed: Publishing failed * - cancelled: Publishing was cancelled */ status: PostStatus; /** * Error message if status is 'failed' */ errorMessage: string | null; /** * Engagement analytics */ analytics: PostAnalytics; /** * When analytics were last synced */ analyticsLastSyncedAt: Date | null; constructor(options?: SocialPostOptions); /** * Check if the post is scheduled for future publishing */ get isScheduled(): boolean; /** * Check if the post has been published */ get isPublished(): boolean; /** * Check if the post can be edited (draft or failed) */ get isEditable(): boolean; /** * Check if the post is due for publishing now. */ get isDueForPublish(): boolean; /** * Get formatted hashtag string */ get hashtagString(): string; /** * Get the full post text with hashtags */ get fullText(): string; } //# sourceMappingURL=social-post.d.ts.map