@todesktop/client-recall 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,271 @@
1
+ # ToDesktop Recall Desktop SDK Plugin
2
+
3
+ A ToDesktop plugin that integrates with [Recall.ai's Desktop Recording SDK](https://docs.recall.ai/docs/desktop-sdk) to enable automatic meeting recording for Zoom, Google Meet, and Microsoft Teams.
4
+
5
+ ## Overview
6
+
7
+ This plugin provides a complete integration between ToDesktop and the Recall.ai Desktop Recording SDK, offering:
8
+
9
+ - **Automatic meeting detection** for Zoom, Google Meet, Microsoft Teams, and Slack
10
+ - **Recording management** with start, stop, pause, and resume functionality
11
+ - **Desktop audio recording** for non-meeting scenarios
12
+ - **Real-time events** including transcription and participant data
13
+ - **Permission management** for accessibility, screen capture, and microphone access
14
+ - **Upload progress tracking** and webhook integration
15
+ - **Type-safe client library** for web applications
16
+
17
+ ## Installation &s Setup
18
+
19
+ ### Prerequisites
20
+
21
+ 1. **Recall.ai Account**: Sign up at [recall.ai](https://recall.ai) and get your API key
22
+ 2. **ToDesktop Builder App**: Create a ToDesktop application
23
+ 3. **Backend Integration**: Set up webhook endpoints and upload token generation
24
+
25
+ ### 1. Install Dependencies
26
+
27
+ ```bash
28
+ npm install @todesktop/client-recall
29
+ ```
30
+
31
+ ### 3. Add Plugin to ToDesktop Builder
32
+
33
+ 1. Open ToDesktop Builder
34
+ 2. Install the recall desktop sdk plugin
35
+
36
+ ### 4. Configure Plugin Preferences
37
+
38
+ In ToDesktop Builder, configure the following preferences:
39
+
40
+ - **API URL**: Your Recall.ai region URL (e.g., `https://us-east-1.recall.ai`)
41
+ - **Enable Plugin**: Toggle to enable/disable recording functionality
42
+ - **Request permissions on startup**: Automatically request required permissions
43
+
44
+ ## Usage
45
+
46
+ ### Basic Recording Workflow
47
+
48
+ ```typescript
49
+ import { recallDesktop } from "@todesktop/client-recall";
50
+
51
+ // Initialize the SDK
52
+ await recallDesktop.initSdk();
53
+
54
+ // Listen for meeting detection
55
+ recallDesktop.onMeetingDetected(async ({ window }) => {
56
+ console.log("Meeting detected:", window);
57
+
58
+ // Get upload token from your backend
59
+ const uploadToken = await getUploadTokenFromBackend();
60
+
61
+ // Start recording
62
+ const result = await recallDesktop.startRecording(window.id, uploadToken);
63
+ if (result.success) {
64
+ console.log("Recording started successfully");
65
+ }
66
+ });
67
+
68
+ // Listen for recording events
69
+ recallDesktop.onRecordingStateChange(({ sdk }) => {
70
+ console.log("Recording state:", sdk.state.code);
71
+ });
72
+
73
+ recallDesktop.onUploadProgress(({ progress }) => {
74
+ console.log(`Upload progress: ${progress}%`);
75
+ });
76
+
77
+ // Handle recording completion
78
+ recallDesktop.onRecordingEnded(async ({ window }) => {
79
+ console.log("Recording ended for window:", window.id);
80
+
81
+ // Upload the recording
82
+ await recallDesktop.uploadRecording(window.id);
83
+ });
84
+ ```
85
+
86
+ ### Desktop Audio Recording
87
+
88
+ For capturing audio from applications other than supported meeting platforms:
89
+
90
+ ```typescript
91
+ // Prepare desktop audio recording
92
+ const { data } = await recallDesktop.prepareDesktopAudioRecording();
93
+ const { windowId } = data;
94
+
95
+ // Get upload token and start recording
96
+ const uploadToken = await getUploadTokenFromBackend();
97
+ await recallDesktop.startRecording(windowId, uploadToken);
98
+
99
+ // Stop when done
100
+ await recallDesktop.stopRecording(windowId);
101
+ await recallDesktop.uploadRecording(windowId);
102
+ ```
103
+
104
+ ### Permission Management
105
+
106
+ ```typescript
107
+ // Check permission status
108
+ const status = await recallDesktop.getStatus();
109
+ console.log("Permissions:", status.permissions);
110
+
111
+ // Request specific permission
112
+ await recallDesktop.requestPermission("screen-capture");
113
+
114
+ // Listen for permission changes
115
+ recallDesktop.onPermissionStatusChange(({ permission, status }) => {
116
+ console.log(`Permission ${permission}: ${status}`);
117
+ });
118
+ ```
119
+
120
+ ## Backend Integration
121
+
122
+ ### Creating Upload Tokens
123
+
124
+ Your backend needs to create upload tokens using the Recall.ai API:
125
+
126
+ ```javascript
127
+ // Example backend endpoint
128
+ app.post("/api/create-upload-token", async (req, res) => {
129
+ const response = await fetch(`${RECALL_API_URL}/api/v1/sdk-upload/`, {
130
+ method: "POST",
131
+ headers: {
132
+ Authorization: `Token ${RECALL_API_KEY}`,
133
+ "Content-Type": "application/json",
134
+ },
135
+ body: JSON.stringify({
136
+ transcript: {
137
+ provider: {
138
+ assembly_ai_streaming: {},
139
+ },
140
+ },
141
+ }),
142
+ });
143
+
144
+ const data = await response.json();
145
+ res.json({ uploadToken: data.upload_token });
146
+ });
147
+ ```
148
+
149
+ ### Webhook Handling
150
+
151
+ Set up webhooks to handle recording completion:
152
+
153
+ ```javascript
154
+ app.post("/webhooks/recall", (req, res) => {
155
+ const { event, data } = req.body;
156
+
157
+ switch (event) {
158
+ case "sdk_upload.complete":
159
+ console.log("Recording completed:", data.recording.id);
160
+ // Process completed recording
161
+ break;
162
+
163
+ case "sdk_upload.failed":
164
+ console.log("Recording failed:", data);
165
+ // Handle failure
166
+ break;
167
+
168
+ case "sdk_upload.uploading":
169
+ console.log("Recording uploading:", data);
170
+ // Track upload progress
171
+ break;
172
+ }
173
+
174
+ res.status(200).send("OK");
175
+ });
176
+ ```
177
+
178
+ ## API Reference
179
+
180
+ ### Main Methods
181
+
182
+ - `initSdk()` - Initialize the Recall SDK
183
+ - `shutdownSdk()` - Shutdown the SDK and cleanup
184
+ - `getStatus()` - Get plugin and SDK status
185
+ - `startRecording(windowId, uploadToken)` - Start recording a meeting
186
+ - `stopRecording(windowId)` - Stop recording
187
+ - `pauseRecording(windowId)` - Pause recording
188
+ - `resumeRecording(windowId)` - Resume recording
189
+ - `uploadRecording(windowId)` - Upload completed recording
190
+ - `prepareDesktopAudioRecording()` - Prepare desktop audio capture
191
+
192
+ ### Event Listeners
193
+
194
+ - `onMeetingDetected(callback)` - Meeting window detected
195
+ - `onRecordingStateChange(callback)` - Recording state changes
196
+ - `onRecordingStarted(callback)` - Recording started
197
+ - `onRecordingEnded(callback)` - Recording completed
198
+ - `onUploadProgress(callback)` - Upload progress updates
199
+ - `onError(callback)` - SDK errors
200
+ - `onPermissionStatusChange(callback)` - Permission changes
201
+
202
+ ### Configuration
203
+
204
+ - `setConfig(config)` - Update plugin configuration
205
+ - `getConfig()` - Get current configuration
206
+ - `requestPermission(permission)` - Request specific permission
207
+
208
+ ## Development
209
+
210
+ ### Available Scripts
211
+
212
+ - `npm run build` - Build all packages
213
+ - `npm run dev` - Development mode with watch
214
+ - `npm run test` - Run tests
215
+ - `npm run typecheck` - TypeScript type checking
216
+ - `npm run clean` - Clean build artifacts
217
+
218
+ ### Plugin Development
219
+
220
+ The plugin uses a mock Recall SDK implementation for development. To integrate with the real SDK:
221
+
222
+ 1. Install the actual Recall SDK:
223
+
224
+ ```bash
225
+ npm install @recallai/desktop-sdk --workspace=packages/plugin
226
+ ```
227
+
228
+ 2. Replace the mock in `packages/plugin/src/main.ts`:
229
+ ```typescript
230
+ // Replace mock with real import
231
+ import RecallAiSdk from "@recallai/desktop-sdk";
232
+ ```
233
+
234
+ ## Supported Platforms
235
+
236
+ - **Zoom**: Full meeting detection and recording
237
+ - **Google Meet**: Full meeting detection and recording
238
+ - **Microsoft Teams**: Full meeting detection and recording
239
+ - **Slack Huddles**: Audio capture (limited metadata)
240
+ - **Desktop Audio**: General audio capture for other applications
241
+
242
+ ## Security & Privacy
243
+
244
+ - All recording operations require explicit user consent
245
+ - Plugin preferences control recording behavior
246
+ - Recordings are encrypted during upload
247
+ - Only authorized applications can access the recording APIs
248
+ - Meeting participants should be notified of recording as required by law
249
+
250
+ ## Troubleshooting
251
+
252
+ ### Common Issues
253
+
254
+ 1. **Plugin not loading**: Verify plugin is properly configured in ToDesktop Builder
255
+ 2. **Permissions denied**: Ensure all required permissions are granted in System Preferences
256
+ 3. **SDK initialization fails**: Check API URL and network connectivity
257
+ 4. **Recording fails**: Verify upload token is valid and backend is accessible
258
+
259
+ ### Debug Mode
260
+
261
+ Enable debug logging by setting preferences or environment variables in your ToDesktop app.
262
+
263
+ ## License
264
+
265
+ MIT License - see LICENSE file for details.
266
+
267
+ ## Support
268
+
269
+ - [Recall.ai Documentation](https://docs.recall.ai/docs/desktop-sdk-beta)
270
+ - [ToDesktop Plugin Documentation](https://docs.todesktop.com/plugins)
271
+ - [GitHub Issues](https://github.com/your-org/todesktop-recall/issues)
@@ -0,0 +1,273 @@
1
+ /**
2
+ * ToDesktop Recall Desktop SDK Plugin - Client Library
3
+ *
4
+ * This library provides a clean API for web applications to interact
5
+ * with the ToDesktop Recall Desktop SDK plugin through the exposed window APIs.
6
+ */
7
+ import type { RecallDesktopApi } from './generated/preload';
8
+ declare global {
9
+ interface Window {
10
+ recallDesktop?: RecallDesktopApi;
11
+ }
12
+ }
13
+ /**
14
+ * Meeting window information
15
+ */
16
+ export interface MeetingWindow {
17
+ id: string;
18
+ title?: string;
19
+ url?: string;
20
+ platform: string;
21
+ }
22
+ /**
23
+ * Plugin configuration options
24
+ */
25
+ export interface RecallSdkConfig {
26
+ enabled: boolean;
27
+ apiUrl: string;
28
+ requestPermissionsOnStartup: boolean;
29
+ }
30
+ /**
31
+ * Plugin status information
32
+ */
33
+ export interface PluginStatus {
34
+ initialized: boolean;
35
+ sdkInitialized: boolean;
36
+ version: string;
37
+ config: RecallSdkConfig;
38
+ sdkState?: 'recording' | 'idle' | 'paused';
39
+ permissions?: {
40
+ accessibility: boolean;
41
+ screenCapture: boolean;
42
+ microphone: boolean;
43
+ systemAudio: boolean;
44
+ };
45
+ }
46
+ /**
47
+ * API response wrapper
48
+ */
49
+ export interface ApiResponse<T = any> {
50
+ success: boolean;
51
+ message: string;
52
+ data?: T;
53
+ }
54
+ /**
55
+ * Permission types
56
+ */
57
+ export type PermissionType = 'accessibility' | 'screen-capture' | 'microphone' | 'system-audio';
58
+ /**
59
+ * SDK event types
60
+ */
61
+ export type RecallSdkEventType = 'recording-started' | 'recording-ended' | 'upload-progress' | 'meeting-detected' | 'meeting-updated' | 'meeting-closed' | 'sdk-state-change' | 'error' | 'media-capture-status' | 'participant-capture-status' | 'permissions-granted' | 'permission-status' | 'realtime-event' | 'shutdown';
62
+ /**
63
+ * Event handler function type
64
+ */
65
+ export type EventHandler<T = any> = (data: T) => void;
66
+ /**
67
+ * Recall Desktop SDK Client API
68
+ * Provides a safe wrapper around the window.recallDesktop API
69
+ */
70
+ export declare class RecallDesktopClient {
71
+ private api;
72
+ private eventUnsubscribers;
73
+ constructor();
74
+ /**
75
+ * Check if the plugin is available
76
+ * @returns true if plugin is available, false otherwise
77
+ */
78
+ isAvailable(): boolean;
79
+ /**
80
+ * Initialize the Recall SDK
81
+ * @returns Promise resolving to initialization result
82
+ * @throws Error if plugin is not available
83
+ */
84
+ initSdk(): Promise<ApiResponse>;
85
+ /**
86
+ * Shutdown the Recall SDK
87
+ * @returns Promise resolving to shutdown result
88
+ * @throws Error if plugin is not available
89
+ */
90
+ shutdownSdk(): Promise<ApiResponse>;
91
+ /**
92
+ * Get current plugin and SDK status
93
+ * @returns Promise resolving to plugin status
94
+ * @throws Error if plugin is not available
95
+ */
96
+ getStatus(): Promise<PluginStatus>;
97
+ /**
98
+ * Start recording a meeting
99
+ * @param windowId The meeting window ID
100
+ * @param uploadToken Upload token from your backend
101
+ * @returns Promise resolving to recording start result
102
+ * @throws Error if plugin is not available
103
+ */
104
+ startRecording(windowId: string, uploadToken: string): Promise<ApiResponse>;
105
+ /**
106
+ * Stop recording a meeting
107
+ * @param windowId The meeting window ID
108
+ * @returns Promise resolving to recording stop result
109
+ * @throws Error if plugin is not available
110
+ */
111
+ stopRecording(windowId: string): Promise<ApiResponse>;
112
+ /**
113
+ * Pause recording a meeting
114
+ * @param windowId The meeting window ID
115
+ * @returns Promise resolving to recording pause result
116
+ * @throws Error if plugin is not available
117
+ */
118
+ pauseRecording(windowId: string): Promise<ApiResponse>;
119
+ /**
120
+ * Resume recording a meeting
121
+ * @param windowId The meeting window ID
122
+ * @returns Promise resolving to recording resume result
123
+ * @throws Error if plugin is not available
124
+ */
125
+ resumeRecording(windowId: string): Promise<ApiResponse>;
126
+ /**
127
+ * Upload a completed recording
128
+ * @param windowId The meeting window ID
129
+ * @returns Promise resolving to upload start result
130
+ * @throws Error if plugin is not available
131
+ */
132
+ uploadRecording(windowId: string): Promise<ApiResponse>;
133
+ /**
134
+ * Prepare desktop audio recording for non-meeting audio capture
135
+ * @returns Promise resolving to desktop audio preparation result with windowId
136
+ * @throws Error if plugin is not available
137
+ */
138
+ prepareDesktopAudioRecording(): Promise<ApiResponse<{
139
+ windowId: string;
140
+ }>>;
141
+ /**
142
+ * Request a specific permission from the user
143
+ * @param permission The permission to request
144
+ * @returns Promise resolving to permission request result
145
+ * @throws Error if plugin is not available
146
+ */
147
+ requestPermission(permission: PermissionType): Promise<ApiResponse>;
148
+ /**
149
+ * Update plugin configuration
150
+ * @param config Configuration updates
151
+ * @returns Promise resolving to update result
152
+ * @throws Error if plugin is not available
153
+ */
154
+ setConfig(config: Partial<RecallSdkConfig>): Promise<ApiResponse>;
155
+ /**
156
+ * Get current plugin configuration
157
+ * @returns Promise resolving to current configuration
158
+ * @throws Error if plugin is not available
159
+ */
160
+ getConfig(): Promise<ApiResponse<RecallSdkConfig>>;
161
+ /**
162
+ * Subscribe to SDK events
163
+ * @param eventType The type of event to listen for
164
+ * @param callback Function to call when event occurs
165
+ * @returns Function to unsubscribe from the event
166
+ * @throws Error if plugin is not available
167
+ */
168
+ addEventListener<T = any>(eventType: RecallSdkEventType, callback: EventHandler<T>): () => void;
169
+ /**
170
+ * Remove all event listeners managed by this client instance
171
+ */
172
+ removeAllEventListeners(): void;
173
+ /**
174
+ * Get plugin version
175
+ * @returns Plugin version string
176
+ * @throws Error if plugin is not available
177
+ */
178
+ getVersion(): string;
179
+ /**
180
+ * Subscribe to meeting detection events
181
+ * @param callback Function to call when a meeting is detected
182
+ * @returns Function to unsubscribe from the event
183
+ */
184
+ onMeetingDetected(callback: EventHandler<{
185
+ window: MeetingWindow;
186
+ }>): () => void;
187
+ /**
188
+ * Subscribe to recording state changes
189
+ * @param callback Function to call when recording state changes
190
+ * @returns Function to unsubscribe from the event
191
+ */
192
+ onRecordingStateChange(callback: EventHandler<{
193
+ sdk: {
194
+ state: {
195
+ code: 'recording' | 'idle' | 'paused';
196
+ };
197
+ };
198
+ }>): () => void;
199
+ /**
200
+ * Subscribe to upload progress updates
201
+ * @param callback Function to call when upload progress updates
202
+ * @returns Function to unsubscribe from the event
203
+ */
204
+ onUploadProgress(callback: EventHandler<{
205
+ window: {
206
+ id: string;
207
+ };
208
+ progress: number;
209
+ }>): () => void;
210
+ /**
211
+ * Subscribe to permission status updates
212
+ * @param callback Function to call when permission status changes
213
+ * @returns Function to unsubscribe from the event
214
+ */
215
+ onPermissionStatusChange(callback: EventHandler<{
216
+ permission: PermissionType;
217
+ status: string;
218
+ }>): () => void;
219
+ /**
220
+ * Subscribe to SDK errors
221
+ * @param callback Function to call when SDK errors occur
222
+ * @returns Function to unsubscribe from the event
223
+ */
224
+ onError(callback: EventHandler<{
225
+ window?: MeetingWindow;
226
+ type: string;
227
+ message: string;
228
+ }>): () => void;
229
+ /**
230
+ * Subscribe to real-time events (transcription, participants, etc.)
231
+ * @param callback Function to call when real-time events occur
232
+ * @returns Function to unsubscribe from the event
233
+ */
234
+ onRealtimeEvent(callback: EventHandler<{
235
+ window: MeetingWindow;
236
+ event: string;
237
+ data: any;
238
+ }>): () => void;
239
+ /**
240
+ * Subscribe to recording started events
241
+ * @param callback Function to call when recording starts
242
+ * @returns Function to unsubscribe from the event
243
+ */
244
+ onRecordingStarted(callback: EventHandler<{
245
+ window: MeetingWindow;
246
+ }>): () => void;
247
+ /**
248
+ * Subscribe to recording ended events
249
+ * @param callback Function to call when recording ends
250
+ * @returns Function to unsubscribe from the event
251
+ */
252
+ onRecordingEnded(callback: EventHandler<{
253
+ window: MeetingWindow;
254
+ }>): () => void;
255
+ /**
256
+ * Subscribe to meeting closed events
257
+ * @param callback Function to call when meeting closes
258
+ * @returns Function to unsubscribe from the event
259
+ */
260
+ onMeetingClosed(callback: EventHandler<{
261
+ window: MeetingWindow;
262
+ }>): () => void;
263
+ /**
264
+ * Subscribe to permissions granted events
265
+ * @param callback Function to call when permissions are granted
266
+ * @returns Function to unsubscribe from the event
267
+ */
268
+ onPermissionsGranted(callback: EventHandler<any>): () => void;
269
+ }
270
+ export declare const recallDesktop: RecallDesktopClient;
271
+ export default RecallDesktopClient;
272
+ export type { RecallDesktopApi } from './generated/preload';
273
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,aAAa,CAAC,EAAE,gBAAgB,CAAC;KAClC;CACF;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,2BAA2B,EAAE,OAAO,CAAC;CACtC;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,eAAe,CAAC;IACxB,QAAQ,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ,CAAC;IAC3C,WAAW,CAAC,EAAE;QACZ,aAAa,EAAE,OAAO,CAAC;QACvB,aAAa,EAAE,OAAO,CAAC;QACvB,UAAU,EAAE,OAAO,CAAC;QACpB,WAAW,EAAE,OAAO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+ * with the ToDesktop Recall Desktop SDK plugin through the exposed window APIs.
6
+ */
7
+ /**
8
+ * Recall Desktop SDK Client API
9
+ * Provides a safe wrapper around the window.recallDesktop API
10
+ */
11
+ class RecallDesktopClient {
12
+ constructor() {
13
+ this.api = null;
14
+ this.eventUnsubscribers = new Map();
15
+ // Check if running in ToDesktop environment
16
+ if (typeof window !== 'undefined' && window.recallDesktop) {
17
+ this.api = window.recallDesktop;
18
+ }
19
+ }
20
+ /**
21
+ * Check if the plugin is available
22
+ * @returns true if plugin is available, false otherwise
23
+ */
24
+ isAvailable() {
25
+ return this.api !== null;
26
+ }
27
+ /**
28
+ * Initialize the Recall SDK
29
+ * @returns Promise resolving to initialization result
30
+ * @throws Error if plugin is not available
31
+ */
32
+ async initSdk() {
33
+ if (!this.api) {
34
+ throw new Error('Recall Desktop SDK plugin is not available. Make sure you are running in ToDesktop.');
35
+ }
36
+ return this.api.initSdk();
37
+ }
38
+ /**
39
+ * Shutdown the Recall SDK
40
+ * @returns Promise resolving to shutdown result
41
+ * @throws Error if plugin is not available
42
+ */
43
+ async shutdownSdk() {
44
+ if (!this.api) {
45
+ throw new Error('Recall Desktop SDK plugin is not available. Make sure you are running in ToDesktop.');
46
+ }
47
+ // Clean up event listeners
48
+ this.removeAllEventListeners();
49
+ return this.api.shutdownSdk();
50
+ }
51
+ /**
52
+ * Get current plugin and SDK status
53
+ * @returns Promise resolving to plugin status
54
+ * @throws Error if plugin is not available
55
+ */
56
+ async getStatus() {
57
+ if (!this.api) {
58
+ throw new Error('Recall Desktop SDK plugin is not available. Make sure you are running in ToDesktop.');
59
+ }
60
+ return this.api.getStatus();
61
+ }
62
+ /**
63
+ * Start recording a meeting
64
+ * @param windowId The meeting window ID
65
+ * @param uploadToken Upload token from your backend
66
+ * @returns Promise resolving to recording start result
67
+ * @throws Error if plugin is not available
68
+ */
69
+ async startRecording(windowId, uploadToken) {
70
+ if (!this.api) {
71
+ throw new Error('Recall Desktop SDK plugin is not available. Make sure you are running in ToDesktop.');
72
+ }
73
+ return this.api.startRecording(windowId, uploadToken);
74
+ }
75
+ /**
76
+ * Stop recording a meeting
77
+ * @param windowId The meeting window ID
78
+ * @returns Promise resolving to recording stop result
79
+ * @throws Error if plugin is not available
80
+ */
81
+ async stopRecording(windowId) {
82
+ if (!this.api) {
83
+ throw new Error('Recall Desktop SDK plugin is not available. Make sure you are running in ToDesktop.');
84
+ }
85
+ return this.api.stopRecording(windowId);
86
+ }
87
+ /**
88
+ * Pause recording a meeting
89
+ * @param windowId The meeting window ID
90
+ * @returns Promise resolving to recording pause result
91
+ * @throws Error if plugin is not available
92
+ */
93
+ async pauseRecording(windowId) {
94
+ if (!this.api) {
95
+ throw new Error('Recall Desktop SDK plugin is not available. Make sure you are running in ToDesktop.');
96
+ }
97
+ return this.api.pauseRecording(windowId);
98
+ }
99
+ /**
100
+ * Resume recording a meeting
101
+ * @param windowId The meeting window ID
102
+ * @returns Promise resolving to recording resume result
103
+ * @throws Error if plugin is not available
104
+ */
105
+ async resumeRecording(windowId) {
106
+ if (!this.api) {
107
+ throw new Error('Recall Desktop SDK plugin is not available. Make sure you are running in ToDesktop.');
108
+ }
109
+ return this.api.resumeRecording(windowId);
110
+ }
111
+ /**
112
+ * Upload a completed recording
113
+ * @param windowId The meeting window ID
114
+ * @returns Promise resolving to upload start result
115
+ * @throws Error if plugin is not available
116
+ */
117
+ async uploadRecording(windowId) {
118
+ if (!this.api) {
119
+ throw new Error('Recall Desktop SDK plugin is not available. Make sure you are running in ToDesktop.');
120
+ }
121
+ return this.api.uploadRecording(windowId);
122
+ }
123
+ /**
124
+ * Prepare desktop audio recording for non-meeting audio capture
125
+ * @returns Promise resolving to desktop audio preparation result with windowId
126
+ * @throws Error if plugin is not available
127
+ */
128
+ async prepareDesktopAudioRecording() {
129
+ if (!this.api) {
130
+ throw new Error('Recall Desktop SDK plugin is not available. Make sure you are running in ToDesktop.');
131
+ }
132
+ return this.api.prepareDesktopAudioRecording();
133
+ }
134
+ /**
135
+ * Request a specific permission from the user
136
+ * @param permission The permission to request
137
+ * @returns Promise resolving to permission request result
138
+ * @throws Error if plugin is not available
139
+ */
140
+ async requestPermission(permission) {
141
+ if (!this.api) {
142
+ throw new Error('Recall Desktop SDK plugin is not available. Make sure you are running in ToDesktop.');
143
+ }
144
+ return this.api.requestPermission(permission);
145
+ }
146
+ /**
147
+ * Update plugin configuration
148
+ * @param config Configuration updates
149
+ * @returns Promise resolving to update result
150
+ * @throws Error if plugin is not available
151
+ */
152
+ async setConfig(config) {
153
+ if (!this.api) {
154
+ throw new Error('Recall Desktop SDK plugin is not available. Make sure you are running in ToDesktop.');
155
+ }
156
+ return this.api.setConfig(config);
157
+ }
158
+ /**
159
+ * Get current plugin configuration
160
+ * @returns Promise resolving to current configuration
161
+ * @throws Error if plugin is not available
162
+ */
163
+ async getConfig() {
164
+ if (!this.api) {
165
+ throw new Error('Recall Desktop SDK plugin is not available. Make sure you are running in ToDesktop.');
166
+ }
167
+ return this.api.getConfig();
168
+ }
169
+ /**
170
+ * Subscribe to SDK events
171
+ * @param eventType The type of event to listen for
172
+ * @param callback Function to call when event occurs
173
+ * @returns Function to unsubscribe from the event
174
+ * @throws Error if plugin is not available
175
+ */
176
+ addEventListener(eventType, callback) {
177
+ if (!this.api) {
178
+ throw new Error('Recall Desktop SDK plugin is not available. Make sure you are running in ToDesktop.');
179
+ }
180
+ const unsubscribe = this.api.addEventListener(eventType, callback);
181
+ const key = `${eventType}-${Date.now()}-${Math.random()}`;
182
+ this.eventUnsubscribers.set(key, unsubscribe);
183
+ // Return enhanced unsubscribe function that also cleans up our tracking
184
+ return () => {
185
+ unsubscribe();
186
+ this.eventUnsubscribers.delete(key);
187
+ };
188
+ }
189
+ /**
190
+ * Remove all event listeners managed by this client instance
191
+ */
192
+ removeAllEventListeners() {
193
+ this.eventUnsubscribers.forEach(unsubscribe => unsubscribe());
194
+ this.eventUnsubscribers.clear();
195
+ }
196
+ /**
197
+ * Get plugin version
198
+ * @returns Plugin version string
199
+ * @throws Error if plugin is not available
200
+ */
201
+ getVersion() {
202
+ if (!this.api) {
203
+ throw new Error('Recall Desktop SDK plugin is not available. Make sure you are running in ToDesktop.');
204
+ }
205
+ return this.api.getVersion();
206
+ }
207
+ // Convenience methods for common event types
208
+ /**
209
+ * Subscribe to meeting detection events
210
+ * @param callback Function to call when a meeting is detected
211
+ * @returns Function to unsubscribe from the event
212
+ */
213
+ onMeetingDetected(callback) {
214
+ return this.addEventListener('meeting-detected', callback);
215
+ }
216
+ /**
217
+ * Subscribe to recording state changes
218
+ * @param callback Function to call when recording state changes
219
+ * @returns Function to unsubscribe from the event
220
+ */
221
+ onRecordingStateChange(callback) {
222
+ return this.addEventListener('sdk-state-change', callback);
223
+ }
224
+ /**
225
+ * Subscribe to upload progress updates
226
+ * @param callback Function to call when upload progress updates
227
+ * @returns Function to unsubscribe from the event
228
+ */
229
+ onUploadProgress(callback) {
230
+ return this.addEventListener('upload-progress', callback);
231
+ }
232
+ /**
233
+ * Subscribe to permission status updates
234
+ * @param callback Function to call when permission status changes
235
+ * @returns Function to unsubscribe from the event
236
+ */
237
+ onPermissionStatusChange(callback) {
238
+ return this.addEventListener('permission-status', callback);
239
+ }
240
+ /**
241
+ * Subscribe to SDK errors
242
+ * @param callback Function to call when SDK errors occur
243
+ * @returns Function to unsubscribe from the event
244
+ */
245
+ onError(callback) {
246
+ return this.addEventListener('error', callback);
247
+ }
248
+ /**
249
+ * Subscribe to real-time events (transcription, participants, etc.)
250
+ * @param callback Function to call when real-time events occur
251
+ * @returns Function to unsubscribe from the event
252
+ */
253
+ onRealtimeEvent(callback) {
254
+ return this.addEventListener('realtime-event', callback);
255
+ }
256
+ /**
257
+ * Subscribe to recording started events
258
+ * @param callback Function to call when recording starts
259
+ * @returns Function to unsubscribe from the event
260
+ */
261
+ onRecordingStarted(callback) {
262
+ return this.addEventListener('recording-started', callback);
263
+ }
264
+ /**
265
+ * Subscribe to recording ended events
266
+ * @param callback Function to call when recording ends
267
+ * @returns Function to unsubscribe from the event
268
+ */
269
+ onRecordingEnded(callback) {
270
+ return this.addEventListener('recording-ended', callback);
271
+ }
272
+ /**
273
+ * Subscribe to meeting closed events
274
+ * @param callback Function to call when meeting closes
275
+ * @returns Function to unsubscribe from the event
276
+ */
277
+ onMeetingClosed(callback) {
278
+ return this.addEventListener('meeting-closed', callback);
279
+ }
280
+ /**
281
+ * Subscribe to permissions granted events
282
+ * @param callback Function to call when permissions are granted
283
+ * @returns Function to unsubscribe from the event
284
+ */
285
+ onPermissionsGranted(callback) {
286
+ return this.addEventListener('permissions-granted', callback);
287
+ }
288
+ }
289
+ // Create and export a default instance
290
+ const recallDesktop = new RecallDesktopClient();
291
+
292
+ export { RecallDesktopClient, RecallDesktopClient as default, recallDesktop };
293
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":["../src/index.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;;;;AAKG;AAsFH;;;AAGG;MACU,mBAAmB,CAAA;AAI9B,IAAA,WAAA,GAAA;QAHQ,IAAA,CAAA,GAAG,GAA4B,IAAI;AACnC,QAAA,IAAA,CAAA,kBAAkB,GAAG,IAAI,GAAG,EAAsB;;QAIxD,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,aAAa,EAAE;AACzD,YAAA,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,aAAa;;;AAInC;;;AAGG;IACH,WAAW,GAAA;AACT,QAAA,OAAO,IAAI,CAAC,GAAG,KAAK,IAAI;;AAG1B;;;;AAIG;AACH,IAAA,MAAM,OAAO,GAAA;AACX,QAAA,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;AACb,YAAA,MAAM,IAAI,KAAK,CAAC,qFAAqF,CAAC;;AAExG,QAAA,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE;;AAG3B;;;;AAIG;AACH,IAAA,MAAM,WAAW,GAAA;AACf,QAAA,IAAI,CAAC,IAAI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B,EAAE,QAAQ,CAAC;;AAG7D;;;;AAIG;AACH,IAAA,OAAO,CAAC,QAAiF,EAAA;QACvF,OAAO,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC;;AAGjD;;;;AAIG;AACH,IAAA,eAAe,CAAC,QAA2E,EAAA;QACzF,OAAO,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,QAAQ,CAAC;;AAG1D;;;;AAIG;AACH,IAAA,kBAAkB,CAAC,QAAiD,EAAA;QAClE,OAAO,IAAI,CAAC,gBAAgB,CAAC,mBAAmB,EAAE,QAAQ,CAAC;;AAG7D;;;;AAIG;AACH,IAAA,gBAAgB,CAAC,QAAiD,EAAA;QAChE,OAAO,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,QAAQ,CAAC;;AAG3D;;;;AAIG;AACH,IAAA,eAAe,CAAC,QAAiD,EAAA;QAC/D,OAAO,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,QAAQ,CAAC;;AAG1D;;;;AAIG;AACH,IAAA,oBAAoB,CAAC,QAA2B,EAAA;QAC9C,OAAO,IAAI,CAAC,gBAAgB,CAAC,qBAAqB,EAAE,QAAQ,CAAC;;AAEhE;AAED;AACO,MAAM,aAAa,GAAG,IAAI,mBAAmB;;;;"}
package/dist/index.js ADDED
@@ -0,0 +1,299 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ /**
6
+ * ToDesktop Recall Desktop SDK Plugin - Client Library
7
+ *
8
+ * This library provides a clean API for web applications to interact
9
+ * with the ToDesktop Recall Desktop SDK plugin through the exposed window APIs.
10
+ */
11
+ /**
12
+ * Recall Desktop SDK Client API
13
+ * Provides a safe wrapper around the window.recallDesktop API
14
+ */
15
+ class RecallDesktopClient {
16
+ constructor() {
17
+ this.api = null;
18
+ this.eventUnsubscribers = new Map();
19
+ // Check if running in ToDesktop environment
20
+ if (typeof window !== 'undefined' && window.recallDesktop) {
21
+ this.api = window.recallDesktop;
22
+ }
23
+ }
24
+ /**
25
+ * Check if the plugin is available
26
+ * @returns true if plugin is available, false otherwise
27
+ */
28
+ isAvailable() {
29
+ return this.api !== null;
30
+ }
31
+ /**
32
+ * Initialize the Recall SDK
33
+ * @returns Promise resolving to initialization result
34
+ * @throws Error if plugin is not available
35
+ */
36
+ async initSdk() {
37
+ if (!this.api) {
38
+ throw new Error('Recall Desktop SDK plugin is not available. Make sure you are running in ToDesktop.');
39
+ }
40
+ return this.api.initSdk();
41
+ }
42
+ /**
43
+ * Shutdown the Recall SDK
44
+ * @returns Promise resolving to shutdown result
45
+ * @throws Error if plugin is not available
46
+ */
47
+ async shutdownSdk() {
48
+ if (!this.api) {
49
+ throw new Error('Recall Desktop SDK plugin is not available. Make sure you are running in ToDesktop.');
50
+ }
51
+ // Clean up event listeners
52
+ this.removeAllEventListeners();
53
+ return this.api.shutdownSdk();
54
+ }
55
+ /**
56
+ * Get current plugin and SDK status
57
+ * @returns Promise resolving to plugin status
58
+ * @throws Error if plugin is not available
59
+ */
60
+ async getStatus() {
61
+ if (!this.api) {
62
+ throw new Error('Recall Desktop SDK plugin is not available. Make sure you are running in ToDesktop.');
63
+ }
64
+ return this.api.getStatus();
65
+ }
66
+ /**
67
+ * Start recording a meeting
68
+ * @param windowId The meeting window ID
69
+ * @param uploadToken Upload token from your backend
70
+ * @returns Promise resolving to recording start result
71
+ * @throws Error if plugin is not available
72
+ */
73
+ async startRecording(windowId, uploadToken) {
74
+ if (!this.api) {
75
+ throw new Error('Recall Desktop SDK plugin is not available. Make sure you are running in ToDesktop.');
76
+ }
77
+ return this.api.startRecording(windowId, uploadToken);
78
+ }
79
+ /**
80
+ * Stop recording a meeting
81
+ * @param windowId The meeting window ID
82
+ * @returns Promise resolving to recording stop result
83
+ * @throws Error if plugin is not available
84
+ */
85
+ async stopRecording(windowId) {
86
+ if (!this.api) {
87
+ throw new Error('Recall Desktop SDK plugin is not available. Make sure you are running in ToDesktop.');
88
+ }
89
+ return this.api.stopRecording(windowId);
90
+ }
91
+ /**
92
+ * Pause recording a meeting
93
+ * @param windowId The meeting window ID
94
+ * @returns Promise resolving to recording pause result
95
+ * @throws Error if plugin is not available
96
+ */
97
+ async pauseRecording(windowId) {
98
+ if (!this.api) {
99
+ throw new Error('Recall Desktop SDK plugin is not available. Make sure you are running in ToDesktop.');
100
+ }
101
+ return this.api.pauseRecording(windowId);
102
+ }
103
+ /**
104
+ * Resume recording a meeting
105
+ * @param windowId The meeting window ID
106
+ * @returns Promise resolving to recording resume result
107
+ * @throws Error if plugin is not available
108
+ */
109
+ async resumeRecording(windowId) {
110
+ if (!this.api) {
111
+ throw new Error('Recall Desktop SDK plugin is not available. Make sure you are running in ToDesktop.');
112
+ }
113
+ return this.api.resumeRecording(windowId);
114
+ }
115
+ /**
116
+ * Upload a completed recording
117
+ * @param windowId The meeting window ID
118
+ * @returns Promise resolving to upload start result
119
+ * @throws Error if plugin is not available
120
+ */
121
+ async uploadRecording(windowId) {
122
+ if (!this.api) {
123
+ throw new Error('Recall Desktop SDK plugin is not available. Make sure you are running in ToDesktop.');
124
+ }
125
+ return this.api.uploadRecording(windowId);
126
+ }
127
+ /**
128
+ * Prepare desktop audio recording for non-meeting audio capture
129
+ * @returns Promise resolving to desktop audio preparation result with windowId
130
+ * @throws Error if plugin is not available
131
+ */
132
+ async prepareDesktopAudioRecording() {
133
+ if (!this.api) {
134
+ throw new Error('Recall Desktop SDK plugin is not available. Make sure you are running in ToDesktop.');
135
+ }
136
+ return this.api.prepareDesktopAudioRecording();
137
+ }
138
+ /**
139
+ * Request a specific permission from the user
140
+ * @param permission The permission to request
141
+ * @returns Promise resolving to permission request result
142
+ * @throws Error if plugin is not available
143
+ */
144
+ async requestPermission(permission) {
145
+ if (!this.api) {
146
+ throw new Error('Recall Desktop SDK plugin is not available. Make sure you are running in ToDesktop.');
147
+ }
148
+ return this.api.requestPermission(permission);
149
+ }
150
+ /**
151
+ * Update plugin configuration
152
+ * @param config Configuration updates
153
+ * @returns Promise resolving to update result
154
+ * @throws Error if plugin is not available
155
+ */
156
+ async setConfig(config) {
157
+ if (!this.api) {
158
+ throw new Error('Recall Desktop SDK plugin is not available. Make sure you are running in ToDesktop.');
159
+ }
160
+ return this.api.setConfig(config);
161
+ }
162
+ /**
163
+ * Get current plugin configuration
164
+ * @returns Promise resolving to current configuration
165
+ * @throws Error if plugin is not available
166
+ */
167
+ async getConfig() {
168
+ if (!this.api) {
169
+ throw new Error('Recall Desktop SDK plugin is not available. Make sure you are running in ToDesktop.');
170
+ }
171
+ return this.api.getConfig();
172
+ }
173
+ /**
174
+ * Subscribe to SDK events
175
+ * @param eventType The type of event to listen for
176
+ * @param callback Function to call when event occurs
177
+ * @returns Function to unsubscribe from the event
178
+ * @throws Error if plugin is not available
179
+ */
180
+ addEventListener(eventType, callback) {
181
+ if (!this.api) {
182
+ throw new Error('Recall Desktop SDK plugin is not available. Make sure you are running in ToDesktop.');
183
+ }
184
+ const unsubscribe = this.api.addEventListener(eventType, callback);
185
+ const key = `${eventType}-${Date.now()}-${Math.random()}`;
186
+ this.eventUnsubscribers.set(key, unsubscribe);
187
+ // Return enhanced unsubscribe function that also cleans up our tracking
188
+ return () => {
189
+ unsubscribe();
190
+ this.eventUnsubscribers.delete(key);
191
+ };
192
+ }
193
+ /**
194
+ * Remove all event listeners managed by this client instance
195
+ */
196
+ removeAllEventListeners() {
197
+ this.eventUnsubscribers.forEach(unsubscribe => unsubscribe());
198
+ this.eventUnsubscribers.clear();
199
+ }
200
+ /**
201
+ * Get plugin version
202
+ * @returns Plugin version string
203
+ * @throws Error if plugin is not available
204
+ */
205
+ getVersion() {
206
+ if (!this.api) {
207
+ throw new Error('Recall Desktop SDK plugin is not available. Make sure you are running in ToDesktop.');
208
+ }
209
+ return this.api.getVersion();
210
+ }
211
+ // Convenience methods for common event types
212
+ /**
213
+ * Subscribe to meeting detection events
214
+ * @param callback Function to call when a meeting is detected
215
+ * @returns Function to unsubscribe from the event
216
+ */
217
+ onMeetingDetected(callback) {
218
+ return this.addEventListener('meeting-detected', callback);
219
+ }
220
+ /**
221
+ * Subscribe to recording state changes
222
+ * @param callback Function to call when recording state changes
223
+ * @returns Function to unsubscribe from the event
224
+ */
225
+ onRecordingStateChange(callback) {
226
+ return this.addEventListener('sdk-state-change', callback);
227
+ }
228
+ /**
229
+ * Subscribe to upload progress updates
230
+ * @param callback Function to call when upload progress updates
231
+ * @returns Function to unsubscribe from the event
232
+ */
233
+ onUploadProgress(callback) {
234
+ return this.addEventListener('upload-progress', callback);
235
+ }
236
+ /**
237
+ * Subscribe to permission status updates
238
+ * @param callback Function to call when permission status changes
239
+ * @returns Function to unsubscribe from the event
240
+ */
241
+ onPermissionStatusChange(callback) {
242
+ return this.addEventListener('permission-status', callback);
243
+ }
244
+ /**
245
+ * Subscribe to SDK errors
246
+ * @param callback Function to call when SDK errors occur
247
+ * @returns Function to unsubscribe from the event
248
+ */
249
+ onError(callback) {
250
+ return this.addEventListener('error', callback);
251
+ }
252
+ /**
253
+ * Subscribe to real-time events (transcription, participants, etc.)
254
+ * @param callback Function to call when real-time events occur
255
+ * @returns Function to unsubscribe from the event
256
+ */
257
+ onRealtimeEvent(callback) {
258
+ return this.addEventListener('realtime-event', callback);
259
+ }
260
+ /**
261
+ * Subscribe to recording started events
262
+ * @param callback Function to call when recording starts
263
+ * @returns Function to unsubscribe from the event
264
+ */
265
+ onRecordingStarted(callback) {
266
+ return this.addEventListener('recording-started', callback);
267
+ }
268
+ /**
269
+ * Subscribe to recording ended events
270
+ * @param callback Function to call when recording ends
271
+ * @returns Function to unsubscribe from the event
272
+ */
273
+ onRecordingEnded(callback) {
274
+ return this.addEventListener('recording-ended', callback);
275
+ }
276
+ /**
277
+ * Subscribe to meeting closed events
278
+ * @param callback Function to call when meeting closes
279
+ * @returns Function to unsubscribe from the event
280
+ */
281
+ onMeetingClosed(callback) {
282
+ return this.addEventListener('meeting-closed', callback);
283
+ }
284
+ /**
285
+ * Subscribe to permissions granted events
286
+ * @param callback Function to call when permissions are granted
287
+ * @returns Function to unsubscribe from the event
288
+ */
289
+ onPermissionsGranted(callback) {
290
+ return this.addEventListener('permissions-granted', callback);
291
+ }
292
+ }
293
+ // Create and export a default instance
294
+ const recallDesktop = new RecallDesktopClient();
295
+
296
+ exports.RecallDesktopClient = RecallDesktopClient;
297
+ exports.default = RecallDesktopClient;
298
+ exports.recallDesktop = recallDesktop;
299
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAAA;;;;;AAKG;AAsFH;;;AAGG;MACU,mBAAmB,CAAA;AAI9B,IAAA,WAAA,GAAA;QAHQ,IAAA,CAAA,GAAG,GAA4B,IAAI;AACnC,QAAA,IAAA,CAAA,kBAAkB,GAAG,IAAI,GAAG,EAAsB;;QAIxD,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,aAAa,EAAE;AACzD,YAAA,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,aAAa;;;AAInC;;;AAGG;IACH,WAAW,GAAA;AACT,QAAA,OAAO,IAAI,CAAC,GAAG,KAAK,IAAI;;AAG1B;;;;AAIG;AACH,IAAA,MAAM,OAAO,GAAA;AACX,QAAA,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;AACb,YAAA,MAAM,IAAI,KAAK,CAAC,qFAAqF,CAAC;;AAExG,QAAA,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE;;AAG3B;;;;AAIG;AACH,IAAA,MAAM,WAAW,GAAA;AACf,QAAA,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;AACb,YAAA,MAAM,IAAI,KAAK,CAAC,qFAAqF,CAAC;;;QAIxG,IAAI,CAAC,uBAAuB,EAAE;AAE9B,QAAA,OAAO,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE;;AAG/B;;;;AAIG;AACH,IAAA,MAAM,SAAS,GAAA;AACb,QA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AC,gBAAgB,CAAC,gBAAgB,EAAE,QAAQ,CAAC;;AAG1D;;;;AAIG;AACH,IAAA,kBAAkB,CAAC,QAAiD,EAAA;QAClE,OAAO,IAAI,CAAC,gBAAgB,CAAC,mBAAmB,EAAE,QAAQ,CAAC;;AAG7D;;;;AAIG;AACH,IAAA,gBAAgB,CAAC,QAAiD,EAAA;QAChE,OAAO,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,QAAQ,CAAC;;AAG3D;;;;AAIG;AACH,IAAA,eAAe,CAAC,QAAiD,EAAA;QAC/D,OAAO,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,QAAQ,CAAC;;AAG1D;;;;AAIG;AACH,IAAA,oBAAoB,CAAC,QAA2B,EAAA;QAC9C,OAAO,IAAI,CAAC,gBAAgB,CAAC,qBAAqB,EAAE,QAAQ,CAAC;;AAEhE;AAED;AACO,MAAM,aAAa,GAAG,IAAI,mBAAmB;;;;;;"}
@@ -0,0 +1,151 @@
1
+ // Generated by dts-bundle-generator v8.1.2
2
+
3
+ export interface RecallSdkConfig {
4
+ enabled: boolean;
5
+ apiUrl: string;
6
+ requestPermissionsOnStartup: boolean;
7
+ }
8
+ export type RecallSdkEventType = "recording-started" | "recording-ended" | "upload-progress" | "meeting-detected" | "meeting-updated" | "meeting-closed" | "sdk-state-change" | "error" | "media-capture-status" | "participant-capture-status" | "permissions-granted" | "permission-status" | "realtime-event" | "shutdown";
9
+ export type PermissionType = "accessibility" | "screen-capture" | "microphone" | "system-audio";
10
+ export interface ApiResponse<T = any> {
11
+ success: boolean;
12
+ message: string;
13
+ data?: T;
14
+ }
15
+ export interface PluginStatus {
16
+ initialized: boolean;
17
+ sdkInitialized: boolean;
18
+ version: string;
19
+ config: RecallSdkConfig;
20
+ sdkState?: "recording" | "idle" | "paused";
21
+ permissions?: {
22
+ accessibility: boolean;
23
+ screenCapture: boolean;
24
+ microphone: boolean;
25
+ systemAudio: boolean;
26
+ };
27
+ }
28
+ export interface PrepareDesktopAudioResponse {
29
+ windowId: string;
30
+ }
31
+ declare const recallDesktopApi: {
32
+ /**
33
+ * Initialize the Recall SDK
34
+ * @returns Promise resolving to initialization result
35
+ */
36
+ initSdk(): Promise<ApiResponse>;
37
+ /**
38
+ * Shutdown the Recall SDK
39
+ * @returns Promise resolving to shutdown result
40
+ */
41
+ shutdownSdk(): Promise<ApiResponse>;
42
+ /**
43
+ * Get current plugin and SDK status
44
+ * @returns Promise resolving to plugin status
45
+ */
46
+ getStatus(): Promise<PluginStatus>;
47
+ /**
48
+ * Start recording a meeting
49
+ * @param windowId The meeting window ID
50
+ * @param uploadToken Upload token from your backend
51
+ * @returns Promise resolving to recording start result
52
+ */
53
+ startRecording(windowId: string, uploadToken: string): Promise<ApiResponse>;
54
+ /**
55
+ * Stop recording a meeting
56
+ * @param windowId The meeting window ID
57
+ * @returns Promise resolving to recording stop result
58
+ */
59
+ stopRecording(windowId: string): Promise<ApiResponse>;
60
+ /**
61
+ * Pause recording a meeting
62
+ * @param windowId The meeting window ID
63
+ * @returns Promise resolving to recording pause result
64
+ */
65
+ pauseRecording(windowId: string): Promise<ApiResponse>;
66
+ /**
67
+ * Resume recording a meeting
68
+ * @param windowId The meeting window ID
69
+ * @returns Promise resolving to recording resume result
70
+ */
71
+ resumeRecording(windowId: string): Promise<ApiResponse>;
72
+ /**
73
+ * Upload a completed recording
74
+ * @param windowId The meeting window ID
75
+ * @returns Promise resolving to upload start result
76
+ */
77
+ uploadRecording(windowId: string): Promise<ApiResponse>;
78
+ /**
79
+ * Prepare desktop audio recording for non-meeting audio capture
80
+ * @returns Promise resolving to desktop audio preparation result
81
+ */
82
+ prepareDesktopAudioRecording(): Promise<ApiResponse<PrepareDesktopAudioResponse>>;
83
+ /**
84
+ * Request a specific permission from the user
85
+ * @param permission The permission to request
86
+ * @returns Promise resolving to permission request result
87
+ */
88
+ requestPermission(permission: PermissionType): Promise<ApiResponse>;
89
+ /**
90
+ * Update plugin configuration
91
+ * @param config Configuration updates
92
+ * @returns Promise resolving to update result
93
+ */
94
+ setConfig(config: Partial<RecallSdkConfig>): Promise<ApiResponse>;
95
+ /**
96
+ * Get current plugin configuration
97
+ * @returns Promise resolving to current configuration
98
+ */
99
+ getConfig(): Promise<ApiResponse<RecallSdkConfig>>;
100
+ /**
101
+ * Subscribe to SDK events
102
+ * @param eventType The type of event to listen for
103
+ * @param callback Function to call when event occurs
104
+ * @returns Function to unsubscribe from the event
105
+ */
106
+ addEventListener(eventType: RecallSdkEventType, callback: (data: any) => void): () => void;
107
+ /**
108
+ * Get plugin version
109
+ * @returns Plugin version string
110
+ */
111
+ getVersion(): string;
112
+ /**
113
+ * Convenience method for handling meeting detection events
114
+ * @param callback Function to call when a meeting is detected
115
+ * @returns Function to unsubscribe from the event
116
+ */
117
+ onMeetingDetected(callback: (meetingData: any) => void): () => void;
118
+ /**
119
+ * Convenience method for handling recording state changes
120
+ * @param callback Function to call when recording state changes
121
+ * @returns Function to unsubscribe from the event
122
+ */
123
+ onRecordingStateChange(callback: (stateData: any) => void): () => void;
124
+ /**
125
+ * Convenience method for handling upload progress updates
126
+ * @param callback Function to call when upload progress updates
127
+ * @returns Function to unsubscribe from the event
128
+ */
129
+ onUploadProgress(callback: (progressData: any) => void): () => void;
130
+ /**
131
+ * Convenience method for handling permission status updates
132
+ * @param callback Function to call when permission status changes
133
+ * @returns Function to unsubscribe from the event
134
+ */
135
+ onPermissionStatusChange(callback: (permissionData: any) => void): () => void;
136
+ /**
137
+ * Convenience method for handling SDK errors
138
+ * @param callback Function to call when SDK errors occur
139
+ * @returns Function to unsubscribe from the event
140
+ */
141
+ onError(callback: (errorData: any) => void): () => void;
142
+ /**
143
+ * Convenience method for handling real-time events (transcription, participants, etc.)
144
+ * @param callback Function to call when real-time events occur
145
+ * @returns Function to unsubscribe from the event
146
+ */
147
+ onRealtimeEvent(callback: (realtimeData: any) => void): () => void;
148
+ };
149
+ export type RecallDesktopApi = typeof recallDesktopApi;
150
+
151
+ export {};
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@todesktop/client-recall",
3
+ "version": "1.0.1",
4
+ "description": "ToDesktop plugin for Recall.ai Desktop Recording SDK - Client library",
5
+ "private": false,
6
+ "main": "dist/index.js",
7
+ "module": "dist/index.esm.js",
8
+ "types": "dist/index.d.ts",
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "scripts": {
13
+ "build": "tsc --outDir dist --declaration && npm run copy-types",
14
+ "dev": "tsc --outDir dist --declaration --watch",
15
+ "clean": "rimraf dist",
16
+ "typecheck": "tsc --noEmit",
17
+ "lint": "eslint src --ext .ts",
18
+ "copy-types": "copyfiles -f src/generated/*.d.ts dist/",
19
+ "release:patch": "npm version patch && npm publish",
20
+ "release:minor": "npm version minor && npm publish",
21
+ "release:major": "npm version major && npm publish"
22
+ },
23
+ "keywords": [
24
+ "todesktop",
25
+ "plugin",
26
+ "client",
27
+ "web",
28
+ "recall",
29
+ "recording",
30
+ "meetings",
31
+ "sdk"
32
+ ],
33
+ "author": "ToDesktop",
34
+ "license": "MIT",
35
+ "publishConfig": {
36
+ "access": "public"
37
+ },
38
+ "devDependencies": {
39
+ "rimraf": "^5.0.0"
40
+ },
41
+ "peerDependencies": {
42
+ "typescript": "^5.0.0"
43
+ },
44
+ "dependencies": {
45
+ "@types/node": "20.19.2"
46
+ }
47
+ }