/** * Storage layer — thin HTTP wrappers around the Bullhorn API. * All data transforms and auth are handled server-side. */ /** Reset singleton client — only for testing. */ export declare function _resetClient(): void; export type Platform = 'twitter' | 'linkedin' | 'reddit'; export type PostStatus = 'draft' | 'scheduled' | 'ready' | 'published' | 'failed' | 'archived'; export type CampaignStatus = 'active' | 'paused' | 'completed' | 'archived'; export type GroupType = 'reddit-crosspost'; export type BlogDraftStatus = 'draft' | 'scheduled' | 'published' | 'archived'; export type LaunchPlatform = 'hacker_news_show' | 'hacker_news_ask' | 'hacker_news_link' | 'product_hunt' | 'dev_hunt' | 'beta_list' | 'indie_hackers'; export interface TwitterContent { text: string; mediaUrls?: string[]; launchedUrl?: string; } export interface LinkedInContent { text: string; visibility: 'public' | 'connections'; mediaUrl?: string; launchedUrl?: string; } export interface RedditContent { subreddit: string; title: string; body?: string; url?: string; flairId?: string; flairText?: string; launchedUrl?: string; } export interface PublishResult { success: boolean; postId?: string; postUrl?: string; error?: string; publishedAt?: string; } export type PlatformContent = TwitterContent | LinkedInContent | RedditContent; export interface Post { id: string; createdAt: string; updatedAt: string; scheduledAt: string | null; status: PostStatus; platform: Platform; notes?: string; campaignId?: string; groupId?: string; groupType?: GroupType; content: PlatformContent; publishResult?: PublishResult; } export interface Campaign { id: string; name: string; description?: string; status: CampaignStatus; projectId?: string; createdAt: string; updatedAt: string; } export interface Project { id: string; name: string; description?: string; hashtags: string[]; brandColors: { primary?: string; secondary?: string; accent?: string; }; logoUrl?: string; createdAt: string; updatedAt: string; } export interface ProjectAccount { id: string; projectId: string; accountId: string; createdAt: string; } export interface ProjectAnalytics { totalCampaigns: number; totalPosts: number; scheduledPosts: number; publishedPosts: number; draftPosts: number; failedPosts: number; } export interface BlogDraft { id: string; createdAt: string; updatedAt: string; scheduledAt: string | null; status: BlogDraftStatus; title: string; date: string | null; content: string; notes?: string; wordCount: number; campaignId?: string; images: string[]; } export interface LaunchPost { id: string; createdAt: string; updatedAt: string; platform: LaunchPlatform; status: string; scheduledAt: string | null; postedAt: string | null; title: string; url: string | null; description: string | null; platformFields: Record; campaignId: string | null; notes: string | null; } export declare function createPost(data: { platform: Platform; content: PlatformContent; scheduledAt?: string | null; status?: PostStatus; notes?: string; campaignId?: string; groupId?: string; groupType?: GroupType; }): Promise; export declare function getPost(id: string): Promise; export declare function updatePost(id: string, updates: Partial>): Promise; export declare function deletePost(id: string): Promise; export declare function archivePost(id: string): Promise; export declare function restorePost(id: string): Promise; export declare function listPosts(options?: { status?: PostStatus | 'all'; platform?: Platform; campaignId?: string; groupId?: string; limit?: number; }): Promise; export declare function searchPosts(query: string, options?: { limit?: number; }): Promise; export interface DuePost { id: string; platform: Platform; status: PostStatus; scheduledAt: string | null; preview: string; hasMedia: boolean; } export declare function listDuePosts(options?: { platform?: Platform; }): Promise; export interface UpcomingPost { id: string; platform: Platform; scheduledAt: string | null; preview: string; campaignId: string | null; } export declare function listUpcomingPosts(hours?: number): Promise; export interface PostMedia { filename: string; originalUrl: string; downloadUrl: string | null; expiresIn: number; } export declare function getPostMedia(postId: string): Promise; export declare function createCampaign(data: { name: string; description?: string; status?: CampaignStatus; }): Promise; export declare function getCampaign(id: string): Promise<{ campaign: Campaign; posts: Post[]; } | undefined>; export declare function updateCampaign(id: string, updates: Partial>): Promise; export declare function deleteCampaign(id: string): Promise; export declare function listCampaigns(options?: { status?: CampaignStatus | 'all'; limit?: number; }): Promise; export declare function addPostToCampaign(campaignId: string, postId: string): Promise; export declare function removePostFromCampaign(_campaignId: string, postId: string): Promise; export declare function createBlogDraft(data: { title: string; content?: string; date?: string | null; scheduledAt?: string | null; status?: BlogDraftStatus; notes?: string; campaignId?: string; }): Promise; export declare function getBlogDraft(id: string): Promise; export declare function updateBlogDraft(id: string, updates: Partial>): Promise; export declare function deleteBlogDraft(id: string): Promise; export declare function archiveBlogDraft(id: string): Promise; export declare function restoreBlogDraft(id: string): Promise; export declare function listBlogDrafts(options?: { status?: BlogDraftStatus | 'all'; campaignId?: string; limit?: number; }): Promise; export declare function searchBlogDrafts(query: string, options?: { limit?: number; }): Promise; export declare function uploadMedia(filePath: string): Promise<{ filename: string; url: string; }>; export interface MediaFile { filename: string; url: string; size: number | null; mimetype: string | null; createdAt: string; } export declare function listMediaFiles(): Promise; export declare function deleteMediaFile(filename: string): Promise; export declare function addImageToBlogDraft(_draftId: string, sourcePath: string): Promise<{ filename: string; size: number; mimetype: string; markdown: string; }>; export declare function getDraftImages(draftId: string): Promise; export declare function createProject(data: { name: string; description?: string; hashtags?: string[]; brandColors?: Record; logoUrl?: string; }): Promise<{ project: Project; atLimit: boolean; }>; export declare function getProject(id: string): Promise; export declare function updateProject(id: string, updates: Partial>): Promise; export declare function deleteProject(id: string): Promise<{ success: boolean; campaignsDeleted: number; }>; export declare function listProjects(options?: { limit?: number; offset?: number; }): Promise<{ projects: Project[]; total: number; softLimit: number; atLimit: boolean; }>; export declare function getProjectWithCampaigns(id: string): Promise<{ project: Project; campaigns: Campaign[]; } | undefined>; export declare function getProjectAnalytics(id: string): Promise; export declare function addAccountToProject(projectId: string, accountId: string): Promise; export declare function removeAccountFromProject(projectId: string, accountId: string): Promise; export declare function getProjectAccounts(projectId: string): Promise; export declare function moveCampaignToProject(campaignId: string, targetProjectId: string | null): Promise; export declare function listCampaignsByProject(projectId: string | null, options?: { status?: CampaignStatus | 'all'; limit?: number; }): Promise; export declare function createLaunchPost(data: { platform: LaunchPlatform; title: string; url?: string; description?: string; platformFields?: Record; campaignId?: string; scheduledAt?: string; notes?: string; status?: string; }): Promise; export declare function getLaunchPost(id: string): Promise; export declare function updateLaunchPost(id: string, updates: Partial>): Promise; export declare function deleteLaunchPost(id: string): Promise; export declare function listLaunchPosts(options?: { platform?: LaunchPlatform; status?: string; campaignId?: string; limit?: number; }): Promise;