import type { TwitterServiceConfig, TwitterCredentials } from '@bernierllc/social-media-twitter'; import type { LinkedInConfig, LinkedInCredentials } from '@bernierllc/social-media-linkedin'; import type { SupabaseClientConfig } from '@bernierllc/supabase-client'; /** * Social media platform type */ export type SocialPlatform = 'twitter' | 'linkedin' | 'facebook' | 'instagram' | 'mastodon' | 'bluesky'; /** * Platform-specific credentials */ export type PlatformCredentials = TwitterCredentials | LinkedInCredentials | Record; /** * Platform-specific configuration */ export type PlatformConfig = TwitterServiceConfig | LinkedInConfig | Record; /** * Rate limits for a platform */ export interface RateLimits { /** Maximum posts per hour */ postsPerHour?: number; /** Maximum posts per day */ postsPerDay?: number; } /** * Configuration for a specific platform */ export interface PlatformPublisherConfig { /** Platform identifier */ platform: SocialPlatform; /** Whether this platform is enabled */ enabled: boolean; /** Platform-specific credentials */ credentials: PlatformCredentials; /** Platform-specific service configuration */ serviceConfig: PlatformConfig; /** Custom rate limits (overrides platform defaults) */ rateLimits?: RateLimits; } /** * Social publisher service configuration */ export interface SocialPublisherConfig { /** Enable scheduling functionality */ enableScheduling?: boolean; /** Enable automatic retries for failed posts */ enableRetries?: boolean; /** Maximum number of retries per post */ maxRetries?: number; /** Retry delay in milliseconds */ retryDelay?: number; /** Platform configurations */ platforms: PlatformPublisherConfig[]; /** Enable persistence to database */ enablePersistence?: boolean; /** Supabase configuration for persistence */ supabaseConfig?: SupabaseClientConfig; /** Enable caching */ enableCaching?: boolean; /** Cache TTL in milliseconds */ cacheTtl?: number; } /** * Media attachment for social posts */ export interface MediaAttachment { /** Media URL or data */ url?: string; /** Media data as Buffer */ data?: Buffer; /** Media type */ type: 'image' | 'video' | 'gif' | 'document'; /** MIME type */ mimeType?: string; /** Alt text for accessibility */ altText?: string; /** File name */ fileName?: string; } /** * Social post content */ export interface SocialPost { /** Post text content */ text: string; /** Media attachments */ media?: MediaAttachment[]; /** Hashtags (will be extracted or can be provided) */ hashtags?: string[]; /** Mentions (will be extracted or can be provided) */ mentions?: string[]; /** Additional metadata */ metadata?: Record; } /** * Publish request */ export interface PublishRequest { /** Post content */ content: SocialPost; /** Target platforms */ platforms: SocialPlatform[]; /** Optional scheduled time */ scheduledFor?: Date; /** Priority level */ priority?: 'high' | 'normal' | 'low'; /** Optional request ID for tracking */ requestId?: string; } /** * Result for a single platform */ export interface PlatformResult { /** Platform identifier */ platform: SocialPlatform; /** Whether publishing was successful */ success: boolean; /** Post ID from the platform */ postId?: string; /** Post URL */ url?: string; /** Error message if failed */ error?: string; /** Rate limit information */ rateLimitRemaining?: number; /** Timestamp of publication */ publishedAt?: Date; } /** * Overall publish result */ export interface PublishResult { /** Whether at least one platform succeeded */ success: boolean; /** Results per platform */ results: PlatformResult[]; /** Overall status */ overallStatus: 'success' | 'partial' | 'failed'; /** Request ID */ requestId?: string; /** Timestamp of the publish operation */ timestamp: Date; } /** * Scheduled post record */ export interface ScheduledPost { /** Schedule ID */ id: string; /** Job ID from scheduler */ jobId?: string; /** Post content */ content: SocialPost; /** Target platforms */ platforms: SocialPlatform[]; /** Scheduled time */ scheduledFor: Date; /** Current status */ status: 'scheduled' | 'pending' | 'published' | 'failed' | 'cancelled'; /** Publish result if completed */ result?: PublishResult; /** Error if failed */ error?: string; /** Created timestamp */ createdAt: Date; /** Updated timestamp */ updatedAt: Date; } /** * Publish history record */ export interface PublishHistoryRecord { /** Record ID */ id: string; /** Post content */ content: SocialPost; /** Target platforms */ platforms: SocialPlatform[]; /** Publish results */ results: PlatformResult[]; /** Overall status */ status: 'success' | 'partial' | 'failed'; /** Published timestamp */ publishedAt: Date; /** Request ID */ requestId?: string; } /** * Social publisher statistics */ export interface SocialPublisherStats { /** Total posts published */ totalPublished: number; /** Successful posts */ successCount: number; /** Failed posts */ failureCount: number; /** Posts by platform */ postsByPlatform: Record; /** Scheduled posts count */ scheduledCount: number; /** Active scheduled posts */ activeScheduledCount: number; } //# sourceMappingURL=types.d.ts.map