/**
* Type definitions for Postiz Media Manager MCP Server
*/
/**
* Postiz Post object
* IMPORTANT: The actual fields depend on your Postiz API implementation.
* Adjust mediaIds field name based on actual API response (e.g., files, attachments, media)
*/
export interface PostizPost {
id: string;
status: string;
/** Media IDs attached to this post. Field name may vary - adjust as needed */
mediaIds?: string[];
/** Alternative field names for media references */
files?: string[];
attachments?: string[];
media?: Array<{ id: string }>;
[key: string]: any;
}
/**
* Postiz Media object
*/
export interface PostizMedia {
id: string;
url: string;
/** Indicates if the media has been deleted */
deleted?: boolean;
/** Timestamp when media was deleted */
deletedAt?: string | null;
/** Creation timestamp */
createdAt?: string;
/** File name */
name?: string;
/** File size in bytes */
size?: number;
/** MIME type */
mimeType?: string;
[key: string]: any;
}
/**
* Pagination parameters for API requests
*/
export interface PaginationParams {
page?: number;
perPage?: number;
limit?: number;
offset?: number;
}
/**
* Parameters for listing posts
*/
export interface ListPostsParams extends PaginationParams {
/** Filter by post statuses */
statuses?: string[];
}
/**
* Parameters for listing media
*/
export interface ListMediaParams extends PaginationParams {
/** Filter by deleted status */
includeDeleted?: boolean;
}
/**
* Cleanup report from orphan media cleanup operation
*/
export interface CleanupReport {
/** Total number of orphan media candidates found */
totalCandidates: number;
/** Number of media successfully deleted */
deletedCount: number;
/** Number of media that failed to delete */
failedCount: number;
/** IDs of successfully deleted media */
deletedIds: string[];
/** Details of failed deletions */
failedIds: Array<{
id: string;
reason: string;
}>;
}
/**
* Options for cleanup operation
*/
export interface CleanupOptions {
/** If true, only simulate deletion without actually deleting */
dryRun?: boolean;
/** Maximum number of media to clean up */
limit?: number;
}
/**
* Post statuses that indicate "future posts" that protect media from deletion
*/
export const FUTURE_POST_STATUSES = ['draft', 'scheduled', 'queued'] as const;
export type FuturePostStatus = typeof FUTURE_POST_STATUSES[number];