feat: Implement user profile management, add multi-language interactive transcripts, and lay groundwork for SSO.

This commit is contained in:
2026-01-17 00:26:42 -03:00
parent ffbef17396
commit b166387a48
26 changed files with 2646 additions and 469 deletions
+22 -1
View File
@@ -107,6 +107,19 @@ export interface User {
full_name: string;
role: string;
organization_id?: string;
avatar_url?: string;
bio?: string;
language?: string;
}
export interface OrganizationSSOConfig {
organization_id: string;
issuer_url: string;
client_id: string;
client_secret: string;
enabled: boolean;
created_at: string;
updated_at: string;
}
export interface AuthResponse {
@@ -231,6 +244,7 @@ export const cmsApi = {
// Auth
register: (payload: AuthPayload): Promise<AuthResponse> => apiFetch('/auth/register', { method: 'POST', body: JSON.stringify(payload) }),
login: (payload: AuthPayload): Promise<AuthResponse> => apiFetch('/auth/login', { method: 'POST', body: JSON.stringify(payload) }),
getMe: (): Promise<User> => apiFetch('/auth/me'),
// Courses
getCourses: (): Promise<Course[]> => apiFetch('/courses'),
@@ -266,7 +280,7 @@ export const cmsApi = {
// Users
getAllUsers: (): Promise<User[]> => apiFetch('/users'),
updateUser: (id: string, payload: { role?: string, organization_id?: string, full_name?: string }): Promise<void> => apiFetch(`/users/${id}`, { method: 'PUT', body: JSON.stringify(payload) }),
updateUser: (id: string, payload: { role?: string, organization_id?: string, full_name?: string, avatar_url?: string, bio?: string, language?: string }): Promise<void> => apiFetch(`/users/${id}`, { method: 'PUT', body: JSON.stringify(payload) }),
// Webhooks
getWebhooks: (): Promise<Webhook[]> => apiFetch('/webhooks'),
@@ -332,6 +346,13 @@ export const cmsApi = {
});
},
// SSO
getSSOConfig: (): Promise<OrganizationSSOConfig | null> => apiFetch('/organization/sso'),
updateSSOConfig: (payload: Partial<OrganizationSSOConfig>): Promise<OrganizationSSOConfig> => apiFetch('/organization/sso', { method: 'PUT', body: JSON.stringify(payload) }),
initSSOLogin: (orgId: string): void => {
window.location.href = `${API_BASE_URL}/auth/sso/login/${orgId}`;
},
// Background Tasks
getBackgroundTasks: (): Promise<BackgroundTask[]> => apiFetch('/tasks'),
retryTask: (id: string): Promise<void> => apiFetch(`/tasks/${id}/retry`, { method: 'POST' }),