Add Facebook publishing functionality to schedule posts

Integrate Facebook Graph API for publishing scheduled posts, including media. Update storage to handle post-media relationships and add new schema types.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: ae4037a0-2a6f-4530-9bac-79b543286bda
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/397bca8c-984f-43ff-841a-10897aeb8140/ae4037a0-2a6f-4530-9bac-79b543286bda/BuArSJC
This commit is contained in:
michaelschal committed 2025-10-02 13:42:40 +00:00
1 parent 0da4744f6f
commit 52148e3896
4 files changed
+39 -4

No files matched your search

+7
View File
@@ -3,6 +3,7 @@ import {
socialPages,
media,
posts,
postMedia,
scheduledPosts,
aiGenerations,
cloudinaryConfig,
@@ -15,6 +16,7 @@ import {
type InsertMedia,
type Post,
type InsertPost,
type PostMedia,
type ScheduledPost,
type InsertScheduledPost,
type AiGeneration,
@@ -48,6 +50,7 @@ export interface IStorage {
getMediaById(id: string): Promise<Media | undefined>;
createMedia(media: InsertMedia): Promise<Media>;
deleteMedia(id: string): Promise<void>;
getPostMedia(postId: string): Promise<PostMedia[]>;
// Posts
getPosts(userId: string): Promise<Post[]>;
@@ -152,6 +155,10 @@ export class DatabaseStorage implements IStorage {
await db.delete(media).where(eq(media.id, id));
}
async getPostMedia(postId: string): Promise<PostMedia[]> {
return await db.select().from(postMedia).where(eq(postMedia.postId, postId));
}
// Posts
async getPosts(userId: string): Promise<Post[]> {
return await db.select().from(posts).where(eq(posts.userId, userId)).orderBy(desc(posts.createdAt));