992 lines
27 KiB
TypeScript
992 lines
27 KiB
TypeScript
/**
|
|
* NoteFlow API Interface
|
|
*
|
|
* Abstraction layer for different backend implementations:
|
|
* - TauriAdapter: Desktop app using Tauri + gRPC backend
|
|
* - MockAdapter: Browser development with simulated data
|
|
*
|
|
* The interface is designed to be compatible with the gRPC service definition
|
|
* in the NoteFlow API specification.
|
|
*
|
|
* @see noteflow-api-spec-2.json for the complete gRPC API specification
|
|
*/
|
|
|
|
import type {
|
|
AddAnnotationRequest,
|
|
AddProjectMemberRequest,
|
|
AnalyticsOverview,
|
|
AnalyticsOverviewRequest,
|
|
EntityAnalytics,
|
|
EntityAnalyticsRequest,
|
|
ArchiveSummarizationTemplateRequest,
|
|
Annotation,
|
|
ASRConfiguration,
|
|
ASRConfigurationJobStatus,
|
|
StreamingConfiguration,
|
|
AudioDeviceInfo,
|
|
DualCaptureConfigInfo,
|
|
CancelDiarizationResult,
|
|
CompleteCalendarAuthResponse,
|
|
ConnectionDiagnostics,
|
|
StreamStateInfo,
|
|
CreateMeetingRequest,
|
|
CreateProjectRequest,
|
|
CreateSummarizationTemplateRequest,
|
|
DeleteOidcProviderResponse,
|
|
DeleteWebhookResponse,
|
|
DiarizationJobStatus,
|
|
DisconnectOAuthResponse,
|
|
EffectiveServerUrl,
|
|
ExportFormat,
|
|
ExportResult,
|
|
ExtractEntitiesResponse,
|
|
ExtractedEntity,
|
|
GetSummarizationTemplateRequest,
|
|
GetSummarizationTemplateResponse,
|
|
GetCalendarProvidersResponse,
|
|
CompleteAuthLoginResponse,
|
|
GetCurrentUserResponse,
|
|
GetActiveProjectRequest,
|
|
HuggingFaceTokenStatus,
|
|
InitiateAuthLoginResponse,
|
|
LogoutResponse,
|
|
GetActiveProjectResponse,
|
|
GetWorkspaceSettingsRequest,
|
|
GetWorkspaceSettingsResponse,
|
|
GetMeetingRequest,
|
|
GetOAuthClientConfigRequest,
|
|
GetOAuthClientConfigResponse,
|
|
GetOAuthConnectionStatusResponse,
|
|
GetProjectBySlugRequest,
|
|
GetProjectRequest,
|
|
GetPerformanceMetricsRequest,
|
|
GetPerformanceMetricsResponse,
|
|
GetRecentLogsRequest,
|
|
GetRecentLogsResponse,
|
|
GetSyncStatusResponse,
|
|
GetUserIntegrationsResponse,
|
|
GetWebhookDeliveriesResponse,
|
|
InitiateCalendarAuthResponse,
|
|
ListSpeakerStatsRequest,
|
|
ListSpeakerStatsResponse,
|
|
ListSummarizationTemplateVersionsRequest,
|
|
ListSummarizationTemplateVersionsResponse,
|
|
ListSummarizationTemplatesRequest,
|
|
ListSummarizationTemplatesResponse,
|
|
ListOidcPresetsResponse,
|
|
ListOidcProvidersResponse,
|
|
ListTasksRequest,
|
|
ListTasksResponse,
|
|
ListWorkspacesResponse,
|
|
ListCalendarEventsResponse,
|
|
ListMeetingsRequest,
|
|
ListMeetingsResponse,
|
|
ListProjectMembersRequest,
|
|
ListProjectMembersResponse,
|
|
ListProjectsRequest,
|
|
ListProjectsResponse,
|
|
ListSyncHistoryResponse,
|
|
ListWebhooksResponse,
|
|
ListInstalledAppsRequest,
|
|
ListInstalledAppsResponse,
|
|
Meeting,
|
|
OidcProviderApi,
|
|
PlaybackInfo,
|
|
Project,
|
|
ProjectMembership,
|
|
RefreshOidcDiscoveryResponse,
|
|
RegisteredWebhook,
|
|
RegisterOidcProviderRequest,
|
|
RegisterWebhookRequest,
|
|
RemoveProjectMemberRequest,
|
|
RemoveProjectMemberResponse,
|
|
RestoreSummarizationTemplateVersionRequest,
|
|
ServerInfo,
|
|
SetActiveProjectRequest,
|
|
SetHuggingFaceTokenRequest,
|
|
SetHuggingFaceTokenResult,
|
|
StartIntegrationSyncResponse,
|
|
SummarizationTemplate,
|
|
SummarizationTemplateMutationResponse,
|
|
SwitchWorkspaceResponse,
|
|
Summary,
|
|
SetOAuthClientConfigRequest,
|
|
SetOAuthClientConfigResponse,
|
|
Task,
|
|
TriggerStatus,
|
|
UpdateASRConfigurationRequest,
|
|
UpdateASRConfigurationResult,
|
|
UpdateStreamingConfigurationRequest,
|
|
UpdateSummarizationTemplateRequest,
|
|
UpdateTaskRequest,
|
|
UpdateWorkspaceSettingsRequest,
|
|
UpdateAnnotationRequest,
|
|
UpdateOidcProviderRequest,
|
|
UpdateProjectMemberRoleRequest,
|
|
UpdateProjectRequest,
|
|
UpdateWebhookRequest,
|
|
UserPreferences,
|
|
ValidateHuggingFaceTokenResult,
|
|
} from './types';
|
|
import type { TestAudioConfig, TestAudioResult, TestEnvironmentInfo } from './types/testing';
|
|
import type { TranscriptionStream } from './core/streams';
|
|
|
|
// Re-export TranscriptionStream from core module
|
|
export type { TranscriptionStream };
|
|
|
|
/**
|
|
* Main NoteFlow API interface
|
|
*
|
|
* All methods correspond to gRPC endpoints defined in the API specification.
|
|
* The implementation can be either:
|
|
* - TauriAdapter: Uses Tauri invoke to call Rust backend → gRPC server
|
|
* - MockAdapter: Simulates responses for browser development
|
|
*/
|
|
export interface NoteFlowAPI {
|
|
// --- Server Health & Connection ---
|
|
|
|
/**
|
|
* Get server health and capabilities information
|
|
* @see gRPC endpoint: GetServerInfo (unary)
|
|
*/
|
|
getServerInfo(): Promise<ServerInfo>;
|
|
|
|
/**
|
|
* Connect to the gRPC server.
|
|
*/
|
|
connect(serverUrl?: string): Promise<ServerInfo>;
|
|
|
|
/**
|
|
* Disconnect from the gRPC server.
|
|
*/
|
|
disconnect(): Promise<void>;
|
|
|
|
/**
|
|
* Check if connected to the gRPC server
|
|
*/
|
|
isConnected(): Promise<boolean>;
|
|
|
|
/**
|
|
* Get the effective server URL and its source (Sprint GAP-008)
|
|
* Returns the URL being used and whether it came from env, preferences, or default.
|
|
*/
|
|
getEffectiveServerUrl(): Promise<EffectiveServerUrl>;
|
|
|
|
// --- Identity (Sprint 16) ---
|
|
|
|
/**
|
|
* Get the current user identity.
|
|
* @see gRPC endpoint: GetCurrentUser (unary)
|
|
*/
|
|
getCurrentUser(): Promise<GetCurrentUserResponse>;
|
|
|
|
/**
|
|
* List available workspaces.
|
|
* @see gRPC endpoint: ListWorkspaces (unary)
|
|
*/
|
|
listWorkspaces(): Promise<ListWorkspacesResponse>;
|
|
|
|
/**
|
|
* Switch active workspace context.
|
|
* @see gRPC endpoint: SwitchWorkspace (unary)
|
|
*/
|
|
switchWorkspace(workspaceId: string): Promise<SwitchWorkspaceResponse>;
|
|
|
|
/**
|
|
* Get workspace settings (defaults).
|
|
*/
|
|
getWorkspaceSettings(request: GetWorkspaceSettingsRequest): Promise<GetWorkspaceSettingsResponse>;
|
|
|
|
/**
|
|
* Update workspace settings (defaults).
|
|
*/
|
|
updateWorkspaceSettings(
|
|
request: UpdateWorkspaceSettingsRequest
|
|
): Promise<GetWorkspaceSettingsResponse>;
|
|
|
|
// --- Authentication (Sprint 16+) ---
|
|
|
|
/**
|
|
* Initiate OAuth login flow for user authentication.
|
|
* @param provider OAuth provider ('google' or 'outlook')
|
|
* @param redirectUri Optional callback URI override
|
|
*/
|
|
initiateAuthLogin(provider: string, redirectUri?: string): Promise<InitiateAuthLoginResponse>;
|
|
|
|
/**
|
|
* Complete OAuth login after callback.
|
|
* @param provider OAuth provider
|
|
* @param code Authorization code from OAuth callback
|
|
* @param state State parameter for CSRF validation
|
|
*/
|
|
completeAuthLogin(
|
|
provider: string,
|
|
code: string,
|
|
state: string
|
|
): Promise<CompleteAuthLoginResponse>;
|
|
|
|
/**
|
|
* Logout from authentication provider.
|
|
* @param provider Optional specific provider to logout from
|
|
*/
|
|
logout(provider?: string): Promise<LogoutResponse>;
|
|
|
|
// --- Projects (Sprint 18) ---
|
|
|
|
/**
|
|
* Create a new project in a workspace.
|
|
*/
|
|
createProject(request: CreateProjectRequest): Promise<Project>;
|
|
|
|
/**
|
|
* Get a project by ID.
|
|
*/
|
|
getProject(request: GetProjectRequest): Promise<Project>;
|
|
|
|
/**
|
|
* Get a project by workspace + slug.
|
|
*/
|
|
getProjectBySlug(request: GetProjectBySlugRequest): Promise<Project>;
|
|
|
|
/**
|
|
* List projects in a workspace.
|
|
*/
|
|
listProjects(request: ListProjectsRequest): Promise<ListProjectsResponse>;
|
|
|
|
/**
|
|
* Update project attributes or settings.
|
|
*/
|
|
updateProject(request: UpdateProjectRequest): Promise<Project>;
|
|
|
|
/**
|
|
* Archive a project.
|
|
*/
|
|
archiveProject(projectId: string): Promise<Project>;
|
|
|
|
/**
|
|
* Restore a project.
|
|
*/
|
|
restoreProject(projectId: string): Promise<Project>;
|
|
|
|
/**
|
|
* Delete a project permanently.
|
|
*/
|
|
deleteProject(projectId: string): Promise<boolean>;
|
|
|
|
/**
|
|
* Set the active project for a workspace.
|
|
*/
|
|
setActiveProject(request: SetActiveProjectRequest): Promise<void>;
|
|
|
|
/**
|
|
* Get the active project for a workspace.
|
|
*/
|
|
getActiveProject(request: GetActiveProjectRequest): Promise<GetActiveProjectResponse>;
|
|
|
|
/**
|
|
* Add a member to a project.
|
|
*/
|
|
addProjectMember(request: AddProjectMemberRequest): Promise<ProjectMembership>;
|
|
|
|
/**
|
|
* Update a member role.
|
|
*/
|
|
updateProjectMemberRole(request: UpdateProjectMemberRoleRequest): Promise<ProjectMembership>;
|
|
|
|
/**
|
|
* Remove a member from a project.
|
|
*/
|
|
removeProjectMember(request: RemoveProjectMemberRequest): Promise<RemoveProjectMemberResponse>;
|
|
|
|
/**
|
|
* List project members.
|
|
*/
|
|
listProjectMembers(request: ListProjectMembersRequest): Promise<ListProjectMembersResponse>;
|
|
|
|
// --- Summarization Templates ---
|
|
|
|
listSummarizationTemplates(
|
|
request: ListSummarizationTemplatesRequest
|
|
): Promise<ListSummarizationTemplatesResponse>;
|
|
|
|
getSummarizationTemplate(
|
|
request: GetSummarizationTemplateRequest
|
|
): Promise<GetSummarizationTemplateResponse>;
|
|
|
|
createSummarizationTemplate(
|
|
request: CreateSummarizationTemplateRequest
|
|
): Promise<SummarizationTemplateMutationResponse>;
|
|
|
|
updateSummarizationTemplate(
|
|
request: UpdateSummarizationTemplateRequest
|
|
): Promise<SummarizationTemplateMutationResponse>;
|
|
|
|
archiveSummarizationTemplate(
|
|
request: ArchiveSummarizationTemplateRequest
|
|
): Promise<SummarizationTemplate>;
|
|
|
|
listSummarizationTemplateVersions(
|
|
request: ListSummarizationTemplateVersionsRequest
|
|
): Promise<ListSummarizationTemplateVersionsResponse>;
|
|
|
|
restoreSummarizationTemplateVersion(
|
|
request: RestoreSummarizationTemplateVersionRequest
|
|
): Promise<SummarizationTemplate>;
|
|
|
|
// --- Meeting CRUD Operations ---
|
|
|
|
/**
|
|
* Create a new meeting session
|
|
* @see gRPC endpoint: CreateMeeting (unary)
|
|
*/
|
|
createMeeting(request: CreateMeetingRequest): Promise<Meeting>;
|
|
|
|
/**
|
|
* List meetings with optional filtering and pagination
|
|
* @see gRPC endpoint: ListMeetings (unary)
|
|
*/
|
|
listMeetings(request: ListMeetingsRequest): Promise<ListMeetingsResponse>;
|
|
|
|
/**
|
|
* Get a specific meeting by ID with optional transcript and summary
|
|
* @see gRPC endpoint: GetMeeting (unary)
|
|
*/
|
|
getMeeting(request: GetMeetingRequest): Promise<Meeting>;
|
|
|
|
/**
|
|
* Stop an active meeting recording
|
|
* @see gRPC endpoint: StopMeeting (unary)
|
|
*/
|
|
stopMeeting(meetingId: string): Promise<Meeting>;
|
|
|
|
/**
|
|
* Delete a meeting and all associated data
|
|
* @see gRPC endpoint: DeleteMeeting (unary)
|
|
*/
|
|
deleteMeeting(meetingId: string): Promise<boolean>;
|
|
|
|
// --- Real-time Transcription ---
|
|
|
|
/**
|
|
* Start bidirectional streaming transcription for a meeting
|
|
* @see gRPC endpoint: StreamTranscription (bidirectional_streaming)
|
|
*/
|
|
startTranscription(meetingId: string): Promise<TranscriptionStream>;
|
|
|
|
/**
|
|
* Get current stream state for diagnostics
|
|
* Returns the stream manager's current state (idle, starting, active, stopping)
|
|
*/
|
|
getStreamState(): Promise<StreamStateInfo>;
|
|
|
|
/**
|
|
* Force reset the stream state to Idle
|
|
* Use to recover from stuck Starting state or other abnormal conditions
|
|
* Returns info about the previous state that was reset
|
|
*/
|
|
resetStreamState(): Promise<StreamStateInfo>;
|
|
|
|
// --- AI-Powered Summary ---
|
|
|
|
/**
|
|
* Generate an AI-powered summary for a meeting
|
|
* @see gRPC endpoint: GenerateSummary (unary)
|
|
*/
|
|
generateSummary(meetingId: string, forceRegenerate?: boolean): Promise<Summary>;
|
|
|
|
// --- Cloud Consent ---
|
|
|
|
/**
|
|
* Grant consent for cloud-based summarization
|
|
* @see gRPC endpoint: GrantCloudConsent (unary)
|
|
*/
|
|
grantCloudConsent(): Promise<void>;
|
|
|
|
/**
|
|
* Revoke consent for cloud-based summarization
|
|
* @see gRPC endpoint: RevokeCloudConsent (unary)
|
|
*/
|
|
revokeCloudConsent(): Promise<void>;
|
|
|
|
/**
|
|
* Get current cloud consent status
|
|
* @see gRPC endpoint: GetCloudConsentStatus (unary)
|
|
*/
|
|
getCloudConsentStatus(): Promise<{ consentGranted: boolean }>;
|
|
|
|
// --- ASR Configuration (Sprint 19) ---
|
|
|
|
/**
|
|
* Get current ASR configuration and capabilities
|
|
* @see gRPC endpoint: GetAsrConfiguration (unary)
|
|
*/
|
|
getAsrConfiguration(): Promise<ASRConfiguration>;
|
|
|
|
/**
|
|
* Update ASR configuration (starts background reconfiguration job)
|
|
* @see gRPC endpoint: UpdateAsrConfiguration (unary)
|
|
*/
|
|
updateAsrConfiguration(
|
|
request: UpdateASRConfigurationRequest
|
|
): Promise<UpdateASRConfigurationResult>;
|
|
|
|
/**
|
|
* Get status of an ASR reconfiguration job
|
|
* @see gRPC endpoint: GetAsrConfigurationJobStatus (unary)
|
|
*/
|
|
getAsrJobStatus(jobId: string): Promise<ASRConfigurationJobStatus>;
|
|
|
|
// --- Streaming Configuration (Sprint 20) ---
|
|
|
|
/**
|
|
* Get current streaming configuration
|
|
* @see gRPC endpoint: GetStreamingConfiguration (unary)
|
|
*/
|
|
getStreamingConfiguration(): Promise<StreamingConfiguration>;
|
|
|
|
/**
|
|
* Update streaming configuration
|
|
* @see gRPC endpoint: UpdateStreamingConfiguration (unary)
|
|
*/
|
|
updateStreamingConfiguration(
|
|
request: UpdateStreamingConfigurationRequest
|
|
): Promise<StreamingConfiguration>;
|
|
|
|
// --- HuggingFace Token (Sprint 19) ---
|
|
|
|
/**
|
|
* Set a HuggingFace token with optional validation
|
|
* @see gRPC endpoint: SetHuggingFaceToken (unary)
|
|
*/
|
|
setHuggingFaceToken(request: SetHuggingFaceTokenRequest): Promise<SetHuggingFaceTokenResult>;
|
|
|
|
/**
|
|
* Get the status of the configured HuggingFace token
|
|
* @see gRPC endpoint: GetHuggingFaceTokenStatus (unary)
|
|
*/
|
|
getHuggingFaceTokenStatus(): Promise<HuggingFaceTokenStatus>;
|
|
|
|
/**
|
|
* Delete the configured HuggingFace token
|
|
* @see gRPC endpoint: DeleteHuggingFaceToken (unary)
|
|
*/
|
|
deleteHuggingFaceToken(): Promise<boolean>;
|
|
|
|
/**
|
|
* Validate the currently configured HuggingFace token
|
|
* @see gRPC endpoint: ValidateHuggingFaceToken (unary)
|
|
*/
|
|
validateHuggingFaceToken(): Promise<ValidateHuggingFaceTokenResult>;
|
|
|
|
// --- Annotations ---
|
|
|
|
/**
|
|
* List all annotations for a meeting with optional time range filter
|
|
* @see gRPC endpoint: ListAnnotations (unary)
|
|
*/
|
|
listAnnotations(meetingId: string, startTime?: number, endTime?: number): Promise<Annotation[]>;
|
|
|
|
/**
|
|
* Add a user annotation to a meeting
|
|
* @see gRPC endpoint: AddAnnotation (unary)
|
|
*
|
|
* Annotation types: action_item, decision, note, risk
|
|
*/
|
|
addAnnotation(request: AddAnnotationRequest): Promise<Annotation>;
|
|
|
|
/**
|
|
* Get a specific annotation by ID
|
|
* @see gRPC endpoint: GetAnnotation (unary)
|
|
*/
|
|
getAnnotation(annotationId: string): Promise<Annotation>;
|
|
|
|
/**
|
|
* Update an existing annotation
|
|
* @see gRPC endpoint: UpdateAnnotation (unary)
|
|
*/
|
|
updateAnnotation(request: UpdateAnnotationRequest): Promise<Annotation>;
|
|
|
|
/**
|
|
* Delete an annotation
|
|
* @see gRPC endpoint: DeleteAnnotation (unary)
|
|
*/
|
|
deleteAnnotation(annotationId: string): Promise<boolean>;
|
|
|
|
// --- Export ---
|
|
|
|
/**
|
|
* Export meeting transcript to Markdown or HTML format
|
|
* @see gRPC endpoint: ExportTranscript (unary)
|
|
*/
|
|
exportTranscript(meetingId: string, format: ExportFormat): Promise<ExportResult>;
|
|
|
|
/**
|
|
* Save exported content to a file (desktop only).
|
|
*/
|
|
saveExportFile(content: string, defaultName: string, extension: string): Promise<boolean>;
|
|
|
|
// --- Playback (desktop only) ---
|
|
|
|
/**
|
|
* Start playback for a meeting.
|
|
*/
|
|
startPlayback(meetingId: string, startTime?: number): Promise<void>;
|
|
|
|
/**
|
|
* Pause playback.
|
|
*/
|
|
pausePlayback(): Promise<void>;
|
|
|
|
/**
|
|
* Stop playback.
|
|
*/
|
|
stopPlayback(): Promise<void>;
|
|
|
|
/**
|
|
* Seek to a playback position.
|
|
*/
|
|
seekPlayback(position: number): Promise<PlaybackInfo>;
|
|
|
|
/**
|
|
* Get current playback state.
|
|
*/
|
|
getPlaybackState(): Promise<PlaybackInfo>;
|
|
|
|
// --- Speaker Diarization ---
|
|
|
|
/**
|
|
* Run offline speaker diarization to improve speaker labels
|
|
* @see gRPC endpoint: RefineSpeakerDiarization (unary)
|
|
*
|
|
* This is a background job - use getDiarizationJobStatus to poll for completion.
|
|
*/
|
|
refineSpeakers(meetingId: string, numSpeakers?: number): Promise<DiarizationJobStatus>;
|
|
|
|
/**
|
|
* Check status of a background diarization job
|
|
* @see gRPC endpoint: GetDiarizationJobStatus (unary)
|
|
*/
|
|
getDiarizationJobStatus(jobId: string): Promise<DiarizationJobStatus>;
|
|
|
|
/**
|
|
* Rename a speaker ID to a human-readable name
|
|
* @see gRPC endpoint: RenameSpeaker (unary)
|
|
*/
|
|
renameSpeaker(meetingId: string, oldSpeakerId: string, newName: string): Promise<boolean>;
|
|
|
|
/**
|
|
* Cancel a running or queued diarization job
|
|
* @see gRPC endpoint: CancelDiarizationJob (unary)
|
|
*/
|
|
cancelDiarization(jobId: string): Promise<CancelDiarizationResult>;
|
|
|
|
/**
|
|
* Get all active (QUEUED or RUNNING) diarization jobs
|
|
* @see gRPC endpoint: GetActiveDiarizationJobs (unary)
|
|
*
|
|
* Sprint GAP-004: Used for client-side recovery after reconnection or restart.
|
|
*/
|
|
getActiveDiarizationJobs(): Promise<DiarizationJobStatus[]>;
|
|
|
|
// --- Preferences ---
|
|
|
|
/**
|
|
* Load user preferences (desktop only).
|
|
*/
|
|
getPreferences(): Promise<UserPreferences>;
|
|
|
|
/**
|
|
* Persist user preferences (desktop only).
|
|
*/
|
|
savePreferences(preferences: UserPreferences): Promise<void>;
|
|
|
|
// --- Audio Devices (desktop only) ---
|
|
|
|
/**
|
|
* List available audio devices.
|
|
*/
|
|
listAudioDevices(): Promise<AudioDeviceInfo[]>;
|
|
|
|
/**
|
|
* Get the default audio device.
|
|
*/
|
|
getDefaultAudioDevice(isInput: boolean): Promise<AudioDeviceInfo | null>;
|
|
|
|
/**
|
|
* Select the active audio device.
|
|
*/
|
|
selectAudioDevice(deviceId: string, isInput: boolean): Promise<void>;
|
|
|
|
// --- Dual Capture (System Audio) ---
|
|
|
|
/**
|
|
* List available loopback/system audio devices (e.g., Stereo Mix, Wave Link).
|
|
*/
|
|
listLoopbackDevices(): Promise<AudioDeviceInfo[]>;
|
|
|
|
/**
|
|
* Set the system audio device for dual capture.
|
|
* @param deviceId - The device ID, or null to disable system audio capture
|
|
*/
|
|
setSystemAudioDevice(deviceId: string | null): Promise<void>;
|
|
|
|
/**
|
|
* Enable or disable dual capture mode (mic + system audio).
|
|
*/
|
|
setDualCaptureEnabled(enabled: boolean): Promise<void>;
|
|
|
|
/**
|
|
* Set the audio mix levels for dual capture.
|
|
* @param micGain - Microphone gain (0.0 to 1.0)
|
|
* @param systemGain - System audio gain (0.0 to 1.0)
|
|
*/
|
|
setAudioMixLevels(micGain: number, systemGain: number): Promise<void>;
|
|
|
|
/**
|
|
* Get the current dual capture configuration.
|
|
*/
|
|
getDualCaptureConfig(): Promise<DualCaptureConfigInfo>;
|
|
|
|
// --- E2E Audio Injection (debug/test only) ---
|
|
|
|
/**
|
|
* Inspect test environment for audio injection readiness.
|
|
*/
|
|
checkTestEnvironment(): Promise<TestEnvironmentInfo>;
|
|
|
|
/**
|
|
* Inject WAV audio into the active recording stream.
|
|
*/
|
|
injectTestAudio(meetingId: string, config: TestAudioConfig): Promise<TestAudioResult>;
|
|
|
|
/**
|
|
* Inject a generated tone into the active recording stream.
|
|
*/
|
|
injectTestTone(
|
|
meetingId: string,
|
|
frequencyHz: number,
|
|
durationSeconds: number,
|
|
sampleRate?: number
|
|
): Promise<TestAudioResult>;
|
|
|
|
// --- Installed Apps (desktop only) ---
|
|
|
|
/**
|
|
* List installed applications on the desktop host with pagination.
|
|
* @param options - Pagination and filter options
|
|
* @returns Paginated response with apps and metadata
|
|
*/
|
|
listInstalledApps(options?: ListInstalledAppsRequest): Promise<ListInstalledAppsResponse>;
|
|
|
|
/**
|
|
* Invalidate the app cache to force a fresh scan on next list.
|
|
*/
|
|
invalidateAppCache(): Promise<void>;
|
|
|
|
// --- Triggers (desktop only) ---
|
|
|
|
/**
|
|
* Enable or disable trigger detection.
|
|
*/
|
|
setTriggerEnabled(enabled: boolean): Promise<void>;
|
|
|
|
/**
|
|
* Snooze trigger detection.
|
|
*/
|
|
snoozeTriggers(minutes?: number): Promise<void>;
|
|
|
|
/**
|
|
* Reset trigger snooze.
|
|
*/
|
|
resetSnooze(): Promise<void>;
|
|
|
|
/**
|
|
* Get current trigger status.
|
|
*/
|
|
getTriggerStatus(): Promise<TriggerStatus>;
|
|
|
|
/**
|
|
* Dismiss a pending trigger.
|
|
*/
|
|
dismissTrigger(): Promise<void>;
|
|
|
|
/**
|
|
* Accept a pending trigger and create a meeting.
|
|
*/
|
|
acceptTrigger(title?: string): Promise<Meeting>;
|
|
|
|
// --- Named Entity Extraction (NER) ---
|
|
|
|
/**
|
|
* Extract named entities from a meeting's transcript using NLP.
|
|
* Results are cached; use forceRefresh to re-extract.
|
|
* @see gRPC endpoint: ExtractEntities (unary)
|
|
*/
|
|
extractEntities(meetingId: string, forceRefresh?: boolean): Promise<ExtractEntitiesResponse>;
|
|
|
|
/**
|
|
* Update a named entity's text or category.
|
|
* @see gRPC endpoint: UpdateEntity (unary)
|
|
*/
|
|
updateEntity(
|
|
meetingId: string,
|
|
entityId: string,
|
|
text?: string,
|
|
category?: string
|
|
): Promise<ExtractedEntity>;
|
|
|
|
/**
|
|
* Delete a named entity.
|
|
* @see gRPC endpoint: DeleteEntity (unary)
|
|
*/
|
|
deleteEntity(meetingId: string, entityId: string): Promise<boolean>;
|
|
|
|
// --- Calendar Integration ---
|
|
|
|
/**
|
|
* List calendar events from connected providers.
|
|
* @see gRPC endpoint: ListCalendarEvents (unary)
|
|
*/
|
|
listCalendarEvents(
|
|
hoursAhead?: number,
|
|
limit?: number,
|
|
provider?: string
|
|
): Promise<ListCalendarEventsResponse>;
|
|
|
|
/**
|
|
* Get available calendar providers with authentication status.
|
|
* @see gRPC endpoint: GetCalendarProviders (unary)
|
|
*/
|
|
getCalendarProviders(): Promise<GetCalendarProvidersResponse>;
|
|
|
|
/**
|
|
* Initiate OAuth flow for a calendar provider.
|
|
* @see gRPC endpoint: InitiateOAuth (unary)
|
|
*/
|
|
initiateCalendarAuth(
|
|
provider: string,
|
|
redirectUri?: string
|
|
): Promise<InitiateCalendarAuthResponse>;
|
|
|
|
/**
|
|
* Complete OAuth flow with authorization code.
|
|
* @see gRPC endpoint: CompleteOAuth (unary)
|
|
*/
|
|
completeCalendarAuth(
|
|
provider: string,
|
|
code: string,
|
|
state: string
|
|
): Promise<CompleteCalendarAuthResponse>;
|
|
|
|
/**
|
|
* Get OAuth connection status for a provider.
|
|
* @see gRPC endpoint: GetOAuthConnectionStatus (unary)
|
|
*/
|
|
getOAuthConnectionStatus(provider: string): Promise<GetOAuthConnectionStatusResponse>;
|
|
|
|
/**
|
|
* Get OAuth client override configuration.
|
|
* @see gRPC endpoint: GetOAuthClientConfig (unary)
|
|
*/
|
|
getOAuthClientConfig(
|
|
request: GetOAuthClientConfigRequest
|
|
): Promise<GetOAuthClientConfigResponse>;
|
|
|
|
/**
|
|
* Set OAuth client override configuration.
|
|
* @see gRPC endpoint: SetOAuthClientConfig (unary)
|
|
*/
|
|
setOAuthClientConfig(
|
|
request: SetOAuthClientConfigRequest
|
|
): Promise<SetOAuthClientConfigResponse>;
|
|
|
|
/**
|
|
* Disconnect OAuth integration.
|
|
* @see gRPC endpoint: DisconnectOAuth (unary)
|
|
*/
|
|
disconnectCalendar(provider: string): Promise<DisconnectOAuthResponse>;
|
|
|
|
// --- Webhook Management ---
|
|
|
|
/**
|
|
* Register a new webhook configuration.
|
|
* @see gRPC endpoint: RegisterWebhook (unary)
|
|
*/
|
|
registerWebhook(request: RegisterWebhookRequest): Promise<RegisteredWebhook>;
|
|
|
|
/**
|
|
* List registered webhooks.
|
|
* @see gRPC endpoint: ListWebhooks (unary)
|
|
*/
|
|
listWebhooks(enabledOnly?: boolean): Promise<ListWebhooksResponse>;
|
|
|
|
/**
|
|
* Update an existing webhook configuration.
|
|
* @see gRPC endpoint: UpdateWebhook (unary)
|
|
*/
|
|
updateWebhook(request: UpdateWebhookRequest): Promise<RegisteredWebhook>;
|
|
|
|
/**
|
|
* Delete a webhook configuration.
|
|
* @see gRPC endpoint: DeleteWebhook (unary)
|
|
*/
|
|
deleteWebhook(webhookId: string): Promise<DeleteWebhookResponse>;
|
|
|
|
/**
|
|
* Get delivery history for a webhook.
|
|
* @see gRPC endpoint: GetWebhookDeliveries (unary)
|
|
*/
|
|
getWebhookDeliveries(webhookId: string, limit?: number): Promise<GetWebhookDeliveriesResponse>;
|
|
|
|
// --- Integration Sync (Sprint 9) ---
|
|
|
|
/**
|
|
* Start a sync operation for an integration.
|
|
* @see gRPC endpoint: StartIntegrationSync (unary)
|
|
*/
|
|
startIntegrationSync(integrationId: string): Promise<StartIntegrationSyncResponse>;
|
|
|
|
/**
|
|
* Get the status of a sync operation.
|
|
* @see gRPC endpoint: GetSyncStatus (unary)
|
|
*/
|
|
getSyncStatus(syncRunId: string): Promise<GetSyncStatusResponse>;
|
|
|
|
/**
|
|
* List sync history for an integration.
|
|
* @see gRPC endpoint: ListSyncHistory (unary)
|
|
*/
|
|
listSyncHistory(
|
|
integrationId: string,
|
|
limit?: number,
|
|
offset?: number
|
|
): Promise<ListSyncHistoryResponse>;
|
|
|
|
/**
|
|
* Get all integrations for the current user/workspace.
|
|
* Used for cache validation at startup to detect stale integration IDs.
|
|
* @see gRPC endpoint: GetUserIntegrations (unary)
|
|
*/
|
|
getUserIntegrations(): Promise<GetUserIntegrationsResponse>;
|
|
|
|
// --- Observability (Sprint 9) ---
|
|
|
|
/**
|
|
* Get recent application logs.
|
|
* @see gRPC endpoint: GetRecentLogs (unary)
|
|
*/
|
|
getRecentLogs(request?: GetRecentLogsRequest): Promise<GetRecentLogsResponse>;
|
|
|
|
/**
|
|
* Get system performance metrics.
|
|
* @see gRPC endpoint: GetPerformanceMetrics (unary)
|
|
*/
|
|
getPerformanceMetrics(
|
|
request?: GetPerformanceMetricsRequest
|
|
): Promise<GetPerformanceMetricsResponse>;
|
|
|
|
// --- Diagnostics ---
|
|
|
|
/**
|
|
* Run comprehensive connection diagnostics.
|
|
* Tests the full connection chain and returns step-by-step results.
|
|
*/
|
|
runConnectionDiagnostics(): Promise<ConnectionDiagnostics>;
|
|
|
|
// --- OIDC Provider Management (Sprint 17) ---
|
|
|
|
/**
|
|
* Register a new OIDC provider.
|
|
* @see gRPC endpoint: RegisterOidcProvider (unary)
|
|
*/
|
|
registerOidcProvider(request: RegisterOidcProviderRequest): Promise<OidcProviderApi>;
|
|
|
|
/**
|
|
* List registered OIDC providers.
|
|
* @see gRPC endpoint: ListOidcProviders (unary)
|
|
*/
|
|
listOidcProviders(
|
|
workspaceId?: string,
|
|
enabledOnly?: boolean
|
|
): Promise<ListOidcProvidersResponse>;
|
|
|
|
/**
|
|
* Get an OIDC provider by ID.
|
|
* @see gRPC endpoint: GetOidcProvider (unary)
|
|
*/
|
|
getOidcProvider(providerId: string): Promise<OidcProviderApi>;
|
|
|
|
/**
|
|
* Update an existing OIDC provider.
|
|
* @see gRPC endpoint: UpdateOidcProvider (unary)
|
|
*/
|
|
updateOidcProvider(request: UpdateOidcProviderRequest): Promise<OidcProviderApi>;
|
|
|
|
/**
|
|
* Delete an OIDC provider.
|
|
* @see gRPC endpoint: DeleteOidcProvider (unary)
|
|
*/
|
|
deleteOidcProvider(providerId: string): Promise<DeleteOidcProviderResponse>;
|
|
|
|
/**
|
|
* Refresh OIDC discovery for one or all providers.
|
|
* @see gRPC endpoint: RefreshOidcDiscovery (unary)
|
|
*/
|
|
refreshOidcDiscovery(
|
|
providerId?: string,
|
|
workspaceId?: string
|
|
): Promise<RefreshOidcDiscoveryResponse>;
|
|
|
|
/**
|
|
* Test OIDC provider connection by validating its discovery document.
|
|
* This is a convenience wrapper around refreshOidcDiscovery.
|
|
*/
|
|
testOidcConnection(providerId: string): Promise<RefreshOidcDiscoveryResponse>;
|
|
|
|
/**
|
|
* List available OIDC provider presets.
|
|
* @see gRPC endpoint: ListOidcPresets (unary)
|
|
*/
|
|
listOidcPresets(): Promise<ListOidcPresetsResponse>;
|
|
|
|
// --- Tasks (Strategy B) ---
|
|
|
|
listTasks(request: ListTasksRequest): Promise<ListTasksResponse>;
|
|
|
|
updateTask(request: UpdateTaskRequest): Promise<Task>;
|
|
|
|
// --- Analytics (Strategy B) ---
|
|
|
|
getAnalyticsOverview(request: AnalyticsOverviewRequest): Promise<AnalyticsOverview>;
|
|
|
|
listSpeakerStats(request: ListSpeakerStatsRequest): Promise<ListSpeakerStatsResponse>;
|
|
|
|
getEntityAnalytics(request: EntityAnalyticsRequest): Promise<EntityAnalytics>;
|
|
}
|
|
|
|
// --- API Instance Management ---
|
|
|
|
let apiInstance: NoteFlowAPI | null = null;
|
|
|
|
/**
|
|
* Set the global API instance
|
|
* Called during app initialization to configure the appropriate backend
|
|
*
|
|
* @param api - NoteFlowAPI implementation (TauriAdapter or MockAdapter)
|
|
*/
|
|
export function setAPIInstance(api: NoteFlowAPI): void {
|
|
apiInstance = api;
|
|
}
|
|
|
|
/**
|
|
* Get the global API instance
|
|
* @throws Error if API has not been initialized
|
|
*
|
|
*/
|
|
export function getAPI(): NoteFlowAPI {
|
|
if (!apiInstance) {
|
|
throw new Error('API not initialized. Call setAPIInstance() first.');
|
|
}
|
|
return apiInstance;
|
|
}
|