ФУНКЦИИ - МЕЖПРОЕКТНАЯ КОММУНИКАЦИЯ: ручное назначение Voice Tasker
This commit is contained in:
@@ -45,11 +45,30 @@ export class WorkspaceAIService extends APIService {
|
||||
});
|
||||
}
|
||||
|
||||
async retrieveVoiceTaskPreflight(workspaceSlug: string): Promise<TVoiceTaskPreflight> {
|
||||
return this.get(`/api/workspaces/${workspaceSlug}/voice-task/preflight/`)
|
||||
.then((response) => response?.data)
|
||||
async retrieveVoiceTaskPreflight(workspaceSlug: string, projectId?: string | null): Promise<TVoiceTaskPreflight> {
|
||||
const params = projectId ? `?project_id=${projectId}` : "";
|
||||
return this.get(
|
||||
`/api/workspaces/${workspaceSlug}/voice-task/preflight/${params}`,
|
||||
{},
|
||||
{ validateStatus: () => true }
|
||||
)
|
||||
.then((response) => {
|
||||
if (response?.status === 200) return response?.data;
|
||||
if (response?.status === 401 || response?.status === 403)
|
||||
return {
|
||||
available: false,
|
||||
reason: "scope_denied",
|
||||
max_audio_duration_seconds: 120,
|
||||
accepted_mime_types: ["audio/webm", "audio/mp4", "audio/mpeg", "audio/wav"],
|
||||
access_mode: "all_workspace_members",
|
||||
enabled_project_ids: [],
|
||||
enabled_member_ids: [],
|
||||
} satisfies TVoiceTaskPreflight;
|
||||
|
||||
throw response?.data;
|
||||
})
|
||||
.catch((error) => {
|
||||
throw error?.response?.data;
|
||||
throw error?.response?.data ?? error;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user