Multi-account support and streaming fixes

- Change LinkedAccount unique constraint to (userId, serviceId, accountId)
- Add linkedAccountId to StreamDestination for per-account targeting
- OAuth callbacks upsert by accountId so different accounts create new rows
- Delete endpoint changed to /providers/accounts/:id
- getDecryptedToken resolves tokens by linkedAccountId instead of serviceId
- /start transition wrapped in try-catch (enableAutoStart compatibility)
- /end always attempts YouTube complete transition regardless of plan status
- autoDetectEndedPlans loads tokens per-destination
This commit is contained in:
2026-02-26 19:06:05 +01:00
parent 7351003c6b
commit cff7cdc58a
7 changed files with 208 additions and 71 deletions

View File

@@ -48,7 +48,7 @@ export interface CreateStreamPlanBody {
}
export interface CreateDestinationBody {
serviceId: string;
linkedAccountId: string;
title: string;
description?: string;
privacyStatus?: string;
@@ -68,6 +68,7 @@ export interface StreamPlanResponse {
export interface StreamDestinationResponse {
id: string;
serviceId: string;
linkedAccountId: string;
title: string;
description: string;
privacyStatus: string;
@@ -85,6 +86,7 @@ export interface PrepareResponse {
}
export interface PreparedDestination {
id: string;
serviceId: string;
rtmpUrl: string;
streamKey: string;