Skip to content

Open-source social media scheduler built for AI agents and the teams behind them. Create, schedule and publish posts to every network through MCP or the REST API, or write them yourself in a composer your team will love.

1.9 KB
Raw Blame
import type { PinterestBoard } from '@/types';
import type { PlatformValue, PublishConfig } from '@/types/platform';
import type { VerifiedBadge } from '@/types/social-account';
import type { SocialAccountStatusValue } from '@/types/social-account-status';
import type { TikTokPrivacyLevelValue } from '@/types/tiktok-privacy';

export interface ChannelAccount {
    id: string;
    platform: PlatformValue;
    display_name: string;
    username: string;
    display_label: string;
    avatar_url: string | null;
    status?: SocialAccountStatusValue;
}

export interface ChannelTikTokCreatorInfo {
    creator_nickname: string | null;
    creator_username: string | null;
    creator_avatar_url: string | null;
    privacy_level_options: TikTokPrivacyLevelValue[];
    comment_disabled: boolean;
    duet_disabled: boolean;
    stitch_disabled: boolean;
    max_video_post_duration_sec: number | null;
}

export interface Channel {
    id: string;
    platform: PlatformValue;
    displayName: string;
    username: string | null;
    avatarUrl: string | null;
    socialAccount: ChannelAccount | null;
    contentType: string;
    meta: Record<string, any>;
    issue?: string | null;
    issueDocsUrl?: string | null;
    status?: string | null;
    contentTypeError?: string;
    publishConfig?: PublishConfig | null;
    creatorInfo?: ChannelTikTokCreatorInfo | null;
    boards?: PinterestBoard[];
    boardsTruncated?: boolean;
}

export interface SidebarChannel {
    id: string;
    platform: PlatformValue;
    network: string;
    username: string;
    display_name: string | null;
    display_label: string;
    handle_label: string;
    avatar_url: string | null;
    verified_badge?: VerifiedBadge | null;
    status: SocialAccountStatusValue | null;
    timezone: string;
    scheduled_posts_count: number;
}

export const channelName = (channel: {
    display_name: string | null;
    username: string | null;
}): string => channel.display_name || channel.username || '';