Files
lck-control-backend/src/types/api.ts
omigamedev a814dd3387 Add media processing, mine feed filter, and preserve ended streams as videos
- Add ffmpeg-based media asset generation (poster, thumbnail, clip) for previews and videos
- Add GET /media/thumbnails/:filename serving route
- Add filter=mine to feed endpoint for user's own published streams
- Feed response now includes posterUrl, thumbnailUrl, clipUrl
- Deleting an ENDED plan with preview preserves it as a Video record
- Add sourcePlanId to Video schema
2026-03-04 21:07:18 +01:00

174 lines
3.8 KiB
TypeScript

// ── Auth ──────────────────────────────────────────────────
export interface MetaCallbackBody {
userId: string;
nonce?: string;
deviceInfo?: string;
}
export interface RefreshBody {
refreshToken: string;
}
export interface AuthTokensResponse {
accessToken: string;
refreshToken: string;
expiresIn: number;
}
export interface UserProfileResponse {
id: string;
displayName: string;
email: string | null;
avatarUrl: string | null;
bio: string;
isPublic: boolean;
}
export interface UpdateProfileBody {
displayName?: string;
bio?: string;
isPublic?: boolean;
}
export interface PairingGenerateResponse {
code: string;
expiresAt: string;
}
export interface PairingRedeemBody {
code: string;
}
// ── Providers ────────────────────────────────────────────
export interface AuthUrlResponse {
url: string;
state: string;
}
export interface ProviderCallbackBody {
code: string;
state: string;
}
export interface LinkedAccountResponse {
id: string;
serviceId: string;
displayName: string;
accountId: string;
avatarUrl: string | null;
rtmpUrl?: string;
streamKey?: string;
}
export interface CreateCustomRtmpBody {
displayName: string;
rtmpUrl: string;
streamKey: string;
}
// ── Streams ──────────────────────────────────────────────
export interface CreateStreamPlanBody {
name: string;
executionMode?: string;
gameId?: string;
isPublic?: boolean;
destinations: CreateDestinationBody[];
}
export interface UpdateStreamPlanBody {
name?: string;
executionMode?: string;
gameId?: string;
isPublic?: boolean;
destinations?: CreateDestinationBody[];
}
export interface CreateDestinationBody {
linkedAccountId: string;
title: string;
description?: string;
privacyStatus?: string;
gameId?: string;
tags?: string;
rtmpUrl?: string;
streamKey?: string;
}
export interface StreamPlanResponse {
id: string;
name: string;
status: string;
executionMode: string;
gameId: string;
isPublic: boolean;
createdAt: string;
updatedAt: string;
destinations: StreamDestinationResponse[];
}
export interface StreamDestinationResponse {
id: string;
serviceId: string;
linkedAccountId: string;
title: string;
description: string;
privacyStatus: string;
gameId: string;
tags: string;
rtmpUrl: string;
streamKey: string;
broadcastId: string;
status: string;
}
export interface PrepareResponse {
planId: string;
destinations: PreparedDestination[];
}
export interface PreparedDestination {
id: string;
serviceId: string;
rtmpUrl: string;
streamKey: string;
broadcastId: string;
}
// ── Social ──────────────────────────────────────────────
export interface PublicUserResponse {
id: string;
displayName: string;
avatarUrl: string | null;
bio: string;
followerCount: number;
followingCount: number;
isFollowing: boolean;
streams?: StreamPlanResponse[];
}
export interface FeedItemResponse {
plan: StreamPlanResponse & { user: { id: string; displayName: string; avatarUrl: string | null } };
previewUrl: string | null;
posterUrl: string | null;
thumbnailUrl: string | null;
clipUrl: string | null;
likeCount: number;
commentCount: number;
isLiked: boolean;
}
export interface FeedResponse {
items: FeedItemResponse[];
nextCursor: string | null;
}
export interface LikeStatusResponse {
count: number;
isLiked: boolean;
}
export interface FollowListResponse {
users: PublicUserResponse[];
nextCursor: string | null;
}