feat: HLS streaming, transcripts, agent course generation & landing-page course previews (#663)
New features: - HLS video encoding/streaming (hls routes, hls-encoder) and a media transcripts pipeline (transcripts route + media-transcript queries) - AI assistant chat vs. run model: agent-course-generation worker/queue, run-monitor pane, chat-changes card, content ask-ai bar - Per-theme course-page previews across org landing-page themes (bold, classic, corporate, editorial, etc.) with a shared course token/component set - View-as-student mode and login-link / link-invite invite flows Refactor: - Extract packages/core consolidating config (env, storage, dashboard-url), services and utils previously duplicated under apps/api/src/config - Remove legacy agent service modules (chat-tools, chat-context, context-window, document, fetch-url, lesson-content) - Relax Cross-Origin-Resource-Policy to allow cross-origin media embedding - Add format script to tenant-router so turbo run format covers it
This commit is contained in:
@@ -54,6 +54,38 @@ export async function upsertMediaTranscript(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update only the editable content (segments + derived text) of an asset's
|
||||
* transcript. Scoped by asset + organization. Returns the updated row or
|
||||
* `null` when no transcript exists for the asset.
|
||||
*/
|
||||
export async function updateMediaTranscriptContent(
|
||||
assetId: string,
|
||||
organizationId: string,
|
||||
patch: { segments: TMediaTranscript['segments']; text: string },
|
||||
dbClient: DbOrTxClient = db
|
||||
): Promise<TMediaTranscript | null> {
|
||||
try {
|
||||
const now = new Date().toISOString();
|
||||
const [row] = await dbClient
|
||||
.update(schema.mediaTranscript)
|
||||
.set({
|
||||
segments: patch.segments,
|
||||
text: patch.text,
|
||||
updatedAt: now
|
||||
})
|
||||
.where(
|
||||
and(eq(schema.mediaTranscript.assetId, assetId), eq(schema.mediaTranscript.organizationId, organizationId))
|
||||
)
|
||||
.returning();
|
||||
|
||||
return row ?? null;
|
||||
} catch (error) {
|
||||
console.error('updateMediaTranscriptContent error:', error);
|
||||
throw new Error('Failed to update media transcript content');
|
||||
}
|
||||
}
|
||||
|
||||
export async function getMediaTranscriptByAsset(
|
||||
assetId: string,
|
||||
organizationId: string,
|
||||
|
||||
Reference in New Issue
Block a user