@todesktop/plugin-recall 1.0.1 → 1.0.3
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 +0 -39
- package/dist/preload.d.ts +142 -128
- package/dist/preload.d.ts.map +1 -1
- package/dist/preload.js +198 -182
- package/dist/preload.js.map +1 -1
- package/package.json +1 -1
- package/src/preload.ts +220 -211
package/README.md
CHANGED
|
@@ -230,42 +230,3 @@ The plugin uses a mock Recall SDK implementation for development. To integrate w
|
|
|
230
230
|
// Replace mock with real import
|
|
231
231
|
import RecallAiSdk from "@recallai/desktop-sdk";
|
|
232
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)
|
package/dist/preload.d.ts
CHANGED
|
@@ -1,136 +1,150 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ToDesktop Recall Desktop SDK Plugin - Preload Script
|
|
3
3
|
*
|
|
4
|
-
* This file runs in the renderer process with Node.js access
|
|
5
|
-
*
|
|
6
|
-
|
|
4
|
+
* This file runs in the renderer process with Node.js access.
|
|
5
|
+
*
|
|
6
|
+
* ToDesktop plugins should export functions; the ToDesktop runtime will
|
|
7
|
+
* attach them under `window.todesktop.recallDesktop` automatically.
|
|
8
|
+
*/
|
|
7
9
|
import { ApiResponse, PluginStatus, PermissionType, RecallSdkConfig, PrepareDesktopAudioResponse, RecallSdkEventType } from './shared';
|
|
8
10
|
/**
|
|
9
|
-
*
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
11
|
+
* Initialize the Recall SDK
|
|
12
|
+
* @returns Promise resolving to initialization result
|
|
13
|
+
*/
|
|
14
|
+
export declare function initSdk(): Promise<ApiResponse>;
|
|
15
|
+
/**
|
|
16
|
+
* Shutdown the Recall SDK
|
|
17
|
+
* @returns Promise resolving to shutdown result
|
|
18
|
+
*/
|
|
19
|
+
export declare function shutdownSdk(): Promise<ApiResponse>;
|
|
20
|
+
/**
|
|
21
|
+
* Get current plugin and SDK status
|
|
22
|
+
* @returns Promise resolving to plugin status
|
|
23
|
+
*/
|
|
24
|
+
export declare function getStatus(): Promise<PluginStatus>;
|
|
25
|
+
/**
|
|
26
|
+
* Start recording a meeting
|
|
27
|
+
* @param windowId The meeting window ID
|
|
28
|
+
* @param uploadToken Upload token from your backend
|
|
29
|
+
* @returns Promise resolving to recording start result
|
|
30
|
+
*/
|
|
31
|
+
export declare function startRecording(windowId: string, uploadToken: string): Promise<ApiResponse>;
|
|
32
|
+
/**
|
|
33
|
+
* Stop recording a meeting
|
|
34
|
+
* @param windowId The meeting window ID
|
|
35
|
+
* @returns Promise resolving to recording stop result
|
|
36
|
+
*/
|
|
37
|
+
export declare function stopRecording(windowId: string): Promise<ApiResponse>;
|
|
38
|
+
/**
|
|
39
|
+
* Pause recording a meeting
|
|
40
|
+
* @param windowId The meeting window ID
|
|
41
|
+
* @returns Promise resolving to recording pause result
|
|
42
|
+
*/
|
|
43
|
+
export declare function pauseRecording(windowId: string): Promise<ApiResponse>;
|
|
44
|
+
/**
|
|
45
|
+
* Resume recording a meeting
|
|
46
|
+
* @param windowId The meeting window ID
|
|
47
|
+
* @returns Promise resolving to recording resume result
|
|
48
|
+
*/
|
|
49
|
+
export declare function resumeRecording(windowId: string): Promise<ApiResponse>;
|
|
50
|
+
/**
|
|
51
|
+
* Upload a completed recording
|
|
52
|
+
* @param windowId The meeting window ID
|
|
53
|
+
* @returns Promise resolving to upload start result
|
|
54
|
+
*/
|
|
55
|
+
export declare function uploadRecording(windowId: string): Promise<ApiResponse>;
|
|
56
|
+
/**
|
|
57
|
+
* Prepare desktop audio recording for non-meeting audio capture
|
|
58
|
+
* @returns Promise resolving to desktop audio preparation result
|
|
59
|
+
*/
|
|
60
|
+
export declare function prepareDesktopAudioRecording(): Promise<ApiResponse<PrepareDesktopAudioResponse>>;
|
|
61
|
+
/**
|
|
62
|
+
* Request a specific permission from the user
|
|
63
|
+
* @param permission The permission to request
|
|
64
|
+
* @returns Promise resolving to permission request result
|
|
65
|
+
*/
|
|
66
|
+
export declare function requestPermission(permission: PermissionType): Promise<ApiResponse>;
|
|
67
|
+
/**
|
|
68
|
+
* Update plugin configuration
|
|
69
|
+
* @param config Configuration updates
|
|
70
|
+
* @returns Promise resolving to update result
|
|
71
|
+
*/
|
|
72
|
+
export declare function setConfig(config: Partial<RecallSdkConfig>): Promise<ApiResponse>;
|
|
73
|
+
/**
|
|
74
|
+
* Get current plugin configuration
|
|
75
|
+
* @returns Promise resolving to current configuration
|
|
76
|
+
*/
|
|
77
|
+
export declare function getConfig(): Promise<ApiResponse<RecallSdkConfig>>;
|
|
78
|
+
/**
|
|
79
|
+
* Subscribe to SDK events
|
|
80
|
+
* @param eventType The type of event to listen for
|
|
81
|
+
* @param callback Function to call when event occurs
|
|
82
|
+
* @returns Function to unsubscribe from the event
|
|
83
|
+
*/
|
|
84
|
+
export declare function addEventListener(eventType: RecallSdkEventType, callback: (data: any) => void): () => void;
|
|
85
|
+
/**
|
|
86
|
+
* Get plugin version
|
|
87
|
+
* @returns Plugin version string
|
|
88
|
+
*/
|
|
89
|
+
export declare function getVersion(): string;
|
|
90
|
+
/**
|
|
91
|
+
* Convenience method for handling meeting detection events
|
|
92
|
+
* @param callback Function to call when a meeting is detected
|
|
93
|
+
* @returns Function to unsubscribe from the event
|
|
94
|
+
*/
|
|
95
|
+
export declare function onMeetingDetected(callback: (meetingData: any) => void): () => void;
|
|
96
|
+
/**
|
|
97
|
+
* Convenience method for handling recording state changes
|
|
98
|
+
* @param callback Function to call when recording state changes
|
|
99
|
+
* @returns Function to unsubscribe from the event
|
|
100
|
+
*/
|
|
101
|
+
export declare function onRecordingStateChange(callback: (stateData: any) => void): () => void;
|
|
102
|
+
/**
|
|
103
|
+
* Convenience method for handling upload progress updates
|
|
104
|
+
* @param callback Function to call when upload progress updates
|
|
105
|
+
* @returns Function to unsubscribe from the event
|
|
106
|
+
*/
|
|
107
|
+
export declare function onUploadProgress(callback: (progressData: any) => void): () => void;
|
|
108
|
+
/**
|
|
109
|
+
* Convenience method for handling permission status updates
|
|
110
|
+
* @param callback Function to call when permission status changes
|
|
111
|
+
* @returns Function to unsubscribe from the event
|
|
112
|
+
*/
|
|
113
|
+
export declare function onPermissionStatusChange(callback: (permissionData: any) => void): () => void;
|
|
114
|
+
/**
|
|
115
|
+
* Convenience method for handling SDK errors
|
|
116
|
+
* @param callback Function to call when SDK errors occur
|
|
117
|
+
* @returns Function to unsubscribe from the event
|
|
118
|
+
*/
|
|
119
|
+
export declare function onError(callback: (errorData: any) => void): () => void;
|
|
120
|
+
/**
|
|
121
|
+
* Convenience method for handling real-time events (transcription, participants, etc.)
|
|
122
|
+
* @param callback Function to call when real-time events occur
|
|
123
|
+
* @returns Function to unsubscribe from the event
|
|
124
|
+
*/
|
|
125
|
+
export declare function onRealtimeEvent(callback: (realtimeData: any) => void): () => void;
|
|
126
|
+
type ExportedApi = {
|
|
127
|
+
initSdk: typeof initSdk;
|
|
128
|
+
shutdownSdk: typeof shutdownSdk;
|
|
129
|
+
getStatus: typeof getStatus;
|
|
130
|
+
startRecording: typeof startRecording;
|
|
131
|
+
stopRecording: typeof stopRecording;
|
|
132
|
+
pauseRecording: typeof pauseRecording;
|
|
133
|
+
resumeRecording: typeof resumeRecording;
|
|
134
|
+
uploadRecording: typeof uploadRecording;
|
|
135
|
+
prepareDesktopAudioRecording: typeof prepareDesktopAudioRecording;
|
|
136
|
+
requestPermission: typeof requestPermission;
|
|
137
|
+
setConfig: typeof setConfig;
|
|
138
|
+
getConfig: typeof getConfig;
|
|
139
|
+
addEventListener: typeof addEventListener;
|
|
140
|
+
getVersion: typeof getVersion;
|
|
141
|
+
onMeetingDetected: typeof onMeetingDetected;
|
|
142
|
+
onRecordingStateChange: typeof onRecordingStateChange;
|
|
143
|
+
onUploadProgress: typeof onUploadProgress;
|
|
144
|
+
onPermissionStatusChange: typeof onPermissionStatusChange;
|
|
145
|
+
onError: typeof onError;
|
|
146
|
+
onRealtimeEvent: typeof onRealtimeEvent;
|
|
128
147
|
};
|
|
129
|
-
export type RecallDesktopApi =
|
|
130
|
-
declare global {
|
|
131
|
-
interface Window {
|
|
132
|
-
recallDesktop: RecallDesktopApi;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
148
|
+
export type RecallDesktopApi = ExportedApi;
|
|
135
149
|
export {};
|
|
136
150
|
//# sourceMappingURL=preload.d.ts.map
|
package/dist/preload.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preload.d.ts","sourceRoot":"","sources":["../src/preload.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"preload.d.ts","sourceRoot":"","sources":["../src/preload.ts"],"names":[],"mappings":"AAAA;;;;;;;EAOE;AAGF,OAAO,EAEL,WAAW,EACX,YAAY,EAMZ,cAAc,EACd,eAAe,EACf,2BAA2B,EAC3B,kBAAkB,EACnB,MAAM,UAAU,CAAC;AAElB;;;GAGG;AACH,wBAAsB,OAAO,IAAI,OAAO,CAAC,WAAW,CAAC,CAEpD;AAED;;;GAGG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC,WAAW,CAAC,CAExD;AAED;;;GAGG;AACH,wBAAsB,SAAS,IAAI,OAAO,CAAC,YAAY,CAAC,CAEvD;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAGhG;AAED;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAG1E;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAG3E;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAG5E;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAG5E;AAED;;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AG,KAAK,IAAI,GAAG,MAAM,IAAI,CAEjF;AAGD,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,WAAW,EAAE,OAAO,WAAW,CAAC;IAChC,SAAS,EAAE,OAAO,SAAS,CAAC;IAC5B,cAAc,EAAE,OAAO,cAAc,CAAC;IACtC,aAAa,EAAE,OAAO,aAAa,CAAC;IACpC,cAAc,EAAE,OAAO,cAAc,CAAC;IACtC,eAAe,EAAE,OAAO,eAAe,CAAC;IACxC,eAAe,EAAE,OAAO,eAAe,CAAC;IACxC,4BAA4B,EAAE,OAAO,4BAA4B,CAAC;IAClE,iBAAiB,EAAE,OAAO,iBAAiB,CAAC;IAC5C,SAAS,EAAE,OAAO,SAAS,CAAC;IAC5B,SAAS,EAAE,OAAO,SAAS,CAAC;IAC5B,gBAAgB,EAAE,OAAO,gBAAgB,CAAC;IAC1C,UAAU,EAAE,OAAO,UAAU,CAAC;IAC9B,iBAAiB,EAAE,OAAO,iBAAiB,CAAC;IAC5C,sBAAsB,EAAE,OAAO,sBAAsB,CAAC;IACtD,gBAAgB,EAAE,OAAO,gBAAgB,CAAC;IAC1C,wBAAwB,EAAE,OAAO,wBAAwB,CAAC;IAC1D,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,eAAe,EAAE,OAAO,eAAe,CAAC;CACzC,CAAC;AACF,MAAM,MAAM,gBAAgB,GAAG,WAAW,CAAC"}
|
package/dist/preload.js
CHANGED
|
@@ -32,187 +32,203 @@ const IPC_CHANNELS = {
|
|
|
32
32
|
/**
|
|
33
33
|
* ToDesktop Recall Desktop SDK Plugin - Preload Script
|
|
34
34
|
*
|
|
35
|
-
* This file runs in the renderer process with Node.js access
|
|
36
|
-
*
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
return this.addEventListener('realtime-event', callback);
|
|
213
|
-
}
|
|
214
|
-
};
|
|
215
|
-
// Expose the API to the renderer process
|
|
216
|
-
electron.contextBridge.exposeInMainWorld('recallDesktop', recallDesktopApi);
|
|
35
|
+
* This file runs in the renderer process with Node.js access.
|
|
36
|
+
*
|
|
37
|
+
* ToDesktop plugins should export functions; the ToDesktop runtime will
|
|
38
|
+
* attach them under `window.todesktop.recallDesktop` automatically.
|
|
39
|
+
*/
|
|
40
|
+
/**
|
|
41
|
+
* Initialize the Recall SDK
|
|
42
|
+
* @returns Promise resolving to initialization result
|
|
43
|
+
*/
|
|
44
|
+
async function initSdk() {
|
|
45
|
+
return electron.ipcRenderer.invoke(IPC_CHANNELS.INIT_SDK);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Shutdown the Recall SDK
|
|
49
|
+
* @returns Promise resolving to shutdown result
|
|
50
|
+
*/
|
|
51
|
+
async function shutdownSdk() {
|
|
52
|
+
return electron.ipcRenderer.invoke(IPC_CHANNELS.SHUTDOWN_SDK);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Get current plugin and SDK status
|
|
56
|
+
* @returns Promise resolving to plugin status
|
|
57
|
+
*/
|
|
58
|
+
async function getStatus() {
|
|
59
|
+
return electron.ipcRenderer.invoke(IPC_CHANNELS.GET_STATUS);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Start recording a meeting
|
|
63
|
+
* @param windowId The meeting window ID
|
|
64
|
+
* @param uploadToken Upload token from your backend
|
|
65
|
+
* @returns Promise resolving to recording start result
|
|
66
|
+
*/
|
|
67
|
+
async function startRecording(windowId, uploadToken) {
|
|
68
|
+
const request = { windowId, uploadToken };
|
|
69
|
+
return electron.ipcRenderer.invoke(IPC_CHANNELS.START_RECORDING, request);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Stop recording a meeting
|
|
73
|
+
* @param windowId The meeting window ID
|
|
74
|
+
* @returns Promise resolving to recording stop result
|
|
75
|
+
*/
|
|
76
|
+
async function stopRecording(windowId) {
|
|
77
|
+
const request = { windowId };
|
|
78
|
+
return electron.ipcRenderer.invoke(IPC_CHANNELS.STOP_RECORDING, request);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Pause recording a meeting
|
|
82
|
+
* @param windowId The meeting window ID
|
|
83
|
+
* @returns Promise resolving to recording pause result
|
|
84
|
+
*/
|
|
85
|
+
async function pauseRecording(windowId) {
|
|
86
|
+
const request = { windowId };
|
|
87
|
+
return electron.ipcRenderer.invoke(IPC_CHANNELS.PAUSE_RECORDING, request);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Resume recording a meeting
|
|
91
|
+
* @param windowId The meeting window ID
|
|
92
|
+
* @returns Promise resolving to recording resume result
|
|
93
|
+
*/
|
|
94
|
+
async function resumeRecording(windowId) {
|
|
95
|
+
const request = { windowId };
|
|
96
|
+
return electron.ipcRenderer.invoke(IPC_CHANNELS.RESUME_RECORDING, request);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Upload a completed recording
|
|
100
|
+
* @param windowId The meeting window ID
|
|
101
|
+
* @returns Promise resolving to upload start result
|
|
102
|
+
*/
|
|
103
|
+
async function uploadRecording(windowId) {
|
|
104
|
+
const request = { windowId };
|
|
105
|
+
return electron.ipcRenderer.invoke(IPC_CHANNELS.UPLOAD_RECORDING, request);
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Prepare desktop audio recording for non-meeting audio capture
|
|
109
|
+
* @returns Promise resolving to desktop audio preparation result
|
|
110
|
+
*/
|
|
111
|
+
async function prepareDesktopAudioRecording() {
|
|
112
|
+
return electron.ipcRenderer.invoke(IPC_CHANNELS.PREPARE_DESKTOP_AUDIO);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Request a specific permission from the user
|
|
116
|
+
* @param permission The permission to request
|
|
117
|
+
* @returns Promise resolving to permission request result
|
|
118
|
+
*/
|
|
119
|
+
async function requestPermission(permission) {
|
|
120
|
+
return electron.ipcRenderer.invoke(IPC_CHANNELS.REQUEST_PERMISSION, permission);
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Update plugin configuration
|
|
124
|
+
* @param config Configuration updates
|
|
125
|
+
* @returns Promise resolving to update result
|
|
126
|
+
*/
|
|
127
|
+
async function setConfig(config) {
|
|
128
|
+
return electron.ipcRenderer.invoke(IPC_CHANNELS.SET_CONFIG, config);
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Get current plugin configuration
|
|
132
|
+
* @returns Promise resolving to current configuration
|
|
133
|
+
*/
|
|
134
|
+
async function getConfig() {
|
|
135
|
+
return electron.ipcRenderer.invoke(IPC_CHANNELS.GET_CONFIG);
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Subscribe to SDK events
|
|
139
|
+
* @param eventType The type of event to listen for
|
|
140
|
+
* @param callback Function to call when event occurs
|
|
141
|
+
* @returns Function to unsubscribe from the event
|
|
142
|
+
*/
|
|
143
|
+
function addEventListener(eventType, callback) {
|
|
144
|
+
const channel = `recall-desktop:event:${eventType}`;
|
|
145
|
+
// Fire-and-forget subscribe to main
|
|
146
|
+
electron.ipcRenderer.invoke(IPC_CHANNELS.SUBSCRIBE_EVENTS, eventType).catch(console.error);
|
|
147
|
+
const listener = (_event, data) => {
|
|
148
|
+
callback(data);
|
|
149
|
+
};
|
|
150
|
+
electron.ipcRenderer.on(channel, listener);
|
|
151
|
+
// Return unsubscribe function
|
|
152
|
+
return () => {
|
|
153
|
+
electron.ipcRenderer.removeListener(channel, listener);
|
|
154
|
+
electron.ipcRenderer.invoke(IPC_CHANNELS.UNSUBSCRIBE_EVENTS, eventType).catch(console.error);
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Get plugin version
|
|
159
|
+
* @returns Plugin version string
|
|
160
|
+
*/
|
|
161
|
+
function getVersion() {
|
|
162
|
+
return '1.0.0';
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Convenience method for handling meeting detection events
|
|
166
|
+
* @param callback Function to call when a meeting is detected
|
|
167
|
+
* @returns Function to unsubscribe from the event
|
|
168
|
+
*/
|
|
169
|
+
function onMeetingDetected(callback) {
|
|
170
|
+
return addEventListener('meeting-detected', callback);
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Convenience method for handling recording state changes
|
|
174
|
+
* @param callback Function to call when recording state changes
|
|
175
|
+
* @returns Function to unsubscribe from the event
|
|
176
|
+
*/
|
|
177
|
+
function onRecordingStateChange(callback) {
|
|
178
|
+
return addEventListener('sdk-state-change', callback);
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Convenience method for handling upload progress updates
|
|
182
|
+
* @param callback Function to call when upload progress updates
|
|
183
|
+
* @returns Function to unsubscribe from the event
|
|
184
|
+
*/
|
|
185
|
+
function onUploadProgress(callback) {
|
|
186
|
+
return addEventListener('upload-progress', callback);
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Convenience method for handling permission status updates
|
|
190
|
+
* @param callback Function to call when permission status changes
|
|
191
|
+
* @returns Function to unsubscribe from the event
|
|
192
|
+
*/
|
|
193
|
+
function onPermissionStatusChange(callback) {
|
|
194
|
+
return addEventListener('permission-status', callback);
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Convenience method for handling SDK errors
|
|
198
|
+
* @param callback Function to call when SDK errors occur
|
|
199
|
+
* @returns Function to unsubscribe from the event
|
|
200
|
+
*/
|
|
201
|
+
function onError(callback) {
|
|
202
|
+
return addEventListener('error', callback);
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Convenience method for handling real-time events (transcription, participants, etc.)
|
|
206
|
+
* @param callback Function to call when real-time events occur
|
|
207
|
+
* @returns Function to unsubscribe from the event
|
|
208
|
+
*/
|
|
209
|
+
function onRealtimeEvent(callback) {
|
|
210
|
+
return addEventListener('realtime-event', callback);
|
|
211
|
+
}
|
|
217
212
|
console.log('RecallDesktop: Preload script loaded successfully');
|
|
213
|
+
|
|
214
|
+
exports.addEventListener = addEventListener;
|
|
215
|
+
exports.getConfig = getConfig;
|
|
216
|
+
exports.getStatus = getStatus;
|
|
217
|
+
exports.getVersion = getVersion;
|
|
218
|
+
exports.initSdk = initSdk;
|
|
219
|
+
exports.onError = onError;
|
|
220
|
+
exports.onMeetingDetected = onMeetingDetected;
|
|
221
|
+
exports.onPermissionStatusChange = onPermissionStatusChange;
|
|
222
|
+
exports.onRealtimeEvent = onRealtimeEvent;
|
|
223
|
+
exports.onRecordingStateChange = onRecordingStateChange;
|
|
224
|
+
exports.onUploadProgress = onUploadProgress;
|
|
225
|
+
exports.pauseRecording = pauseRecording;
|
|
226
|
+
exports.prepareDesktopAudioRecording = prepareDesktopAudioRecording;
|
|
227
|
+
exports.requestPermission = requestPermission;
|
|
228
|
+
exports.resumeRecording = resumeRecording;
|
|
229
|
+
exports.setConfig = setConfig;
|
|
230
|
+
exports.shutdownSdk = shutdownSdk;
|
|
231
|
+
exports.startRecording = startRecording;
|
|
232
|
+
exports.stopRecording = stopRecording;
|
|
233
|
+
exports.uploadRecording = uploadRecording;
|
|
218
234
|
//# sourceMappingURL=preload.js.map
|
package/dist/preload.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preload.js","sources":["../src/shared.ts","../src/preload.ts"],"sourcesContent":[null,null],"names":["ipcRenderer"
|
|
1
|
+
{"version":3,"file":"preload.js","sources":["../src/shared.ts","../src/preload.ts"],"sourcesContent":[null,null],"names":["ipcRenderer"],"mappings":";;;;AAAA;;AAEG;AAEH;AACO,MAAM,YAAY,GAAG;;AAE1B,IAAA,QAAQ,EAAE,yBAAyB;AACnC,IAAA,YAAY,EAAE,6BAA6B;AAC3C,IAAA,UAAU,EAAE,2BAA2B;;AAGvC,IAAA,eAAe,EAAE,gCAAgC;AACjD,IAAA,cAAc,EAAE,+BAA+B;AAC/C,IAAA,eAAe,EAAE,gCAAgC;AACjD,IAAA,gBAAgB,EAAE,iCAAiC;AACnD,IAAA,gBAAgB,EAAE,iCAAiC;;AAGnD,IAAA,qBAAqB,EAAE,sCAAsC;;AAG7D,IAAA,kBAAkB,EAAE,mCAAmC;;AAGvD,IAAA,UAAU,EAAE,2BAA2B;AACvC,IAAA,UAAU,EAAE,2BAA2B;;AAGvC,IAAA,gBAAgB,EAAE,iCAAiC;AACnD,IAAA,kBAAkB,EAAE,mCAAmC;CAC/C;;AC/BV;;;;;;;AAOE;AAkBF;;;AAGG;AACI,eAAe,OAAO,GAAA;IAC3B,OAAOA,oBAAW,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC;AAClD;AAEA;;;AAGG;AACI,eAAe,WAAW,GAAA;IAC/B,OAAOA,oBAAW,C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AAkC,EAAA;AACvE,IAAA,OAAO,gBAAgB,CAAC,kBAAkB,EAAE,QAAQ,CAAC;AACvD;AAEA;;;;AAIG;AACG,SAAU,gBAAgB,CAAC,QAAqC,EAAA;AACpE,IAAA,OAAO,gBAAgB,CAAC,iBAAiB,EAAE,QAAQ,CAAC;AACtD;AAEA;;;;AAIG;AACG,SAAU,wBAAwB,CAAC,QAAuC,EAAA;AAC9E,IAAA,OAAO,gBAAgB,CAAC,mBAAmB,EAAE,QAAQ,CAAC;AACxD;AAEA;;;;AAIG;AACG,SAAU,OAAO,CAAC,QAAkC,EAAA;AACxD,IAAA,OAAO,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC;AAC5C;AAEA;;;;AAIG;AACG,SAAU,eAAe,CAAC,QAAqC,EAAA;AACnE,IAAA,OAAO,gBAAgB,CAAC,gBAAgB,EAAE,QAAQ,CAAC;AACrD;AA2BA,OAAO,CAAC,GAAG,CAAC,mDAAmD,CAAC;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
package/src/preload.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ToDesktop Recall Desktop SDK Plugin - Preload Script
|
|
3
3
|
*
|
|
4
|
-
* This file runs in the renderer process with Node.js access
|
|
5
|
-
*
|
|
6
|
-
|
|
4
|
+
* This file runs in the renderer process with Node.js access.
|
|
5
|
+
*
|
|
6
|
+
* ToDesktop plugins should export functions; the ToDesktop runtime will
|
|
7
|
+
* attach them under `window.todesktop.recallDesktop` automatically.
|
|
8
|
+
*/
|
|
7
9
|
|
|
8
|
-
import {
|
|
10
|
+
import { ipcRenderer } from 'electron';
|
|
9
11
|
import {
|
|
10
12
|
IPC_CHANNELS,
|
|
11
13
|
ApiResponse,
|
|
@@ -22,216 +24,223 @@ import {
|
|
|
22
24
|
} from './shared';
|
|
23
25
|
|
|
24
26
|
/**
|
|
25
|
-
*
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
*/
|
|
125
|
-
async setConfig(config: Partial<RecallSdkConfig>): Promise<ApiResponse> {
|
|
126
|
-
return ipcRenderer.invoke(IPC_CHANNELS.SET_CONFIG, config);
|
|
127
|
-
},
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Get current plugin configuration
|
|
131
|
-
* @returns Promise resolving to current configuration
|
|
132
|
-
*/
|
|
133
|
-
async getConfig(): Promise<ApiResponse<RecallSdkConfig>> {
|
|
134
|
-
return ipcRenderer.invoke(IPC_CHANNELS.GET_CONFIG);
|
|
135
|
-
},
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Subscribe to SDK events
|
|
139
|
-
* @param eventType The type of event to listen for
|
|
140
|
-
* @param callback Function to call when event occurs
|
|
141
|
-
* @returns Function to unsubscribe from the event
|
|
142
|
-
*/
|
|
143
|
-
addEventListener(eventType: RecallSdkEventType, callback: (data: any) => void): () => void {
|
|
144
|
-
const channel = `recall-desktop:event:${eventType}`;
|
|
145
|
-
|
|
146
|
-
// Fire-and-forget subscribe to main
|
|
147
|
-
ipcRenderer.invoke(IPC_CHANNELS.SUBSCRIBE_EVENTS, eventType).catch(console.error);
|
|
148
|
-
|
|
149
|
-
const listener = (_event: any, data: any) => {
|
|
150
|
-
callback(data);
|
|
151
|
-
};
|
|
152
|
-
ipcRenderer.on(channel, listener);
|
|
153
|
-
|
|
154
|
-
// Return unsubscribe function
|
|
155
|
-
return () => {
|
|
156
|
-
ipcRenderer.removeListener(channel, listener);
|
|
157
|
-
ipcRenderer.invoke(IPC_CHANNELS.UNSUBSCRIBE_EVENTS, eventType).catch(console.error);
|
|
158
|
-
};
|
|
159
|
-
},
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Get plugin version
|
|
163
|
-
* @returns Plugin version string
|
|
164
|
-
*/
|
|
165
|
-
getVersion(): string {
|
|
166
|
-
return '1.0.0';
|
|
167
|
-
},
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* Convenience method for handling meeting detection events
|
|
171
|
-
* @param callback Function to call when a meeting is detected
|
|
172
|
-
* @returns Function to unsubscribe from the event
|
|
173
|
-
*/
|
|
174
|
-
onMeetingDetected(callback: (meetingData: any) => void): () => void {
|
|
175
|
-
return this.addEventListener('meeting-detected', callback);
|
|
176
|
-
},
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* Convenience method for handling recording state changes
|
|
180
|
-
* @param callback Function to call when recording state changes
|
|
181
|
-
* @returns Function to unsubscribe from the event
|
|
182
|
-
*/
|
|
183
|
-
onRecordingStateChange(callback: (stateData: any) => void): () => void {
|
|
184
|
-
return this.addEventListener('sdk-state-change', callback);
|
|
185
|
-
},
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* Convenience method for handling upload progress updates
|
|
189
|
-
* @param callback Function to call when upload progress updates
|
|
190
|
-
* @returns Function to unsubscribe from the event
|
|
191
|
-
*/
|
|
192
|
-
onUploadProgress(callback: (progressData: any) => void): () => void {
|
|
193
|
-
return this.addEventListener('upload-progress', callback);
|
|
194
|
-
},
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* Convenience method for handling permission status updates
|
|
198
|
-
* @param callback Function to call when permission status changes
|
|
199
|
-
* @returns Function to unsubscribe from the event
|
|
200
|
-
*/
|
|
201
|
-
onPermissionStatusChange(callback: (permissionData: any) => void): () => void {
|
|
202
|
-
return this.addEventListener('permission-status', callback);
|
|
203
|
-
},
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* Convenience method for handling SDK errors
|
|
207
|
-
* @param callback Function to call when SDK errors occur
|
|
208
|
-
* @returns Function to unsubscribe from the event
|
|
209
|
-
*/
|
|
210
|
-
onError(callback: (errorData: any) => void): () => void {
|
|
211
|
-
return this.addEventListener('error', callback);
|
|
212
|
-
},
|
|
213
|
-
|
|
214
|
-
/**
|
|
215
|
-
* Convenience method for handling real-time events (transcription, participants, etc.)
|
|
216
|
-
* @param callback Function to call when real-time events occur
|
|
217
|
-
* @returns Function to unsubscribe from the event
|
|
218
|
-
*/
|
|
219
|
-
onRealtimeEvent(callback: (realtimeData: any) => void): () => void {
|
|
220
|
-
return this.addEventListener('realtime-event', callback);
|
|
221
|
-
}
|
|
222
|
-
};
|
|
27
|
+
* Initialize the Recall SDK
|
|
28
|
+
* @returns Promise resolving to initialization result
|
|
29
|
+
*/
|
|
30
|
+
export async function initSdk(): Promise<ApiResponse> {
|
|
31
|
+
return ipcRenderer.invoke(IPC_CHANNELS.INIT_SDK);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Shutdown the Recall SDK
|
|
36
|
+
* @returns Promise resolving to shutdown result
|
|
37
|
+
*/
|
|
38
|
+
export async function shutdownSdk(): Promise<ApiResponse> {
|
|
39
|
+
return ipcRenderer.invoke(IPC_CHANNELS.SHUTDOWN_SDK);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Get current plugin and SDK status
|
|
44
|
+
* @returns Promise resolving to plugin status
|
|
45
|
+
*/
|
|
46
|
+
export async function getStatus(): Promise<PluginStatus> {
|
|
47
|
+
return ipcRenderer.invoke(IPC_CHANNELS.GET_STATUS);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Start recording a meeting
|
|
52
|
+
* @param windowId The meeting window ID
|
|
53
|
+
* @param uploadToken Upload token from your backend
|
|
54
|
+
* @returns Promise resolving to recording start result
|
|
55
|
+
*/
|
|
56
|
+
export async function startRecording(windowId: string, uploadToken: string): Promise<ApiResponse> {
|
|
57
|
+
const request: StartRecordingRequest = { windowId, uploadToken };
|
|
58
|
+
return ipcRenderer.invoke(IPC_CHANNELS.START_RECORDING, request);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Stop recording a meeting
|
|
63
|
+
* @param windowId The meeting window ID
|
|
64
|
+
* @returns Promise resolving to recording stop result
|
|
65
|
+
*/
|
|
66
|
+
export async function stopRecording(windowId: string): Promise<ApiResponse> {
|
|
67
|
+
const request: StopRecordingRequest = { windowId };
|
|
68
|
+
return ipcRenderer.invoke(IPC_CHANNELS.STOP_RECORDING, request);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Pause recording a meeting
|
|
73
|
+
* @param windowId The meeting window ID
|
|
74
|
+
* @returns Promise resolving to recording pause result
|
|
75
|
+
*/
|
|
76
|
+
export async function pauseRecording(windowId: string): Promise<ApiResponse> {
|
|
77
|
+
const request: PauseRecordingRequest = { windowId };
|
|
78
|
+
return ipcRenderer.invoke(IPC_CHANNELS.PAUSE_RECORDING, request);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Resume recording a meeting
|
|
83
|
+
* @param windowId The meeting window ID
|
|
84
|
+
* @returns Promise resolving to recording resume result
|
|
85
|
+
*/
|
|
86
|
+
export async function resumeRecording(windowId: string): Promise<ApiResponse> {
|
|
87
|
+
const request: ResumeRecordingRequest = { windowId };
|
|
88
|
+
return ipcRenderer.invoke(IPC_CHANNELS.RESUME_RECORDING, request);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Upload a completed recording
|
|
93
|
+
* @param windowId The meeting window ID
|
|
94
|
+
* @returns Promise resolving to upload start result
|
|
95
|
+
*/
|
|
96
|
+
export async function uploadRecording(windowId: string): Promise<ApiResponse> {
|
|
97
|
+
const request: UploadRecordingRequest = { windowId };
|
|
98
|
+
return ipcRenderer.invoke(IPC_CHANNELS.UPLOAD_RECORDING, request);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Prepare desktop audio recording for non-meeting audio capture
|
|
103
|
+
* @returns Promise resolving to desktop audio preparation result
|
|
104
|
+
*/
|
|
105
|
+
export async function prepareDesktopAudioRecording(): Promise<ApiResponse<PrepareDesktopAudioResponse>> {
|
|
106
|
+
return ipcRenderer.invoke(IPC_CHANNELS.PREPARE_DESKTOP_AUDIO);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Request a specific permission from the user
|
|
111
|
+
* @param permission The permission to request
|
|
112
|
+
* @returns Promise resolving to permission request result
|
|
113
|
+
*/
|
|
114
|
+
export async function requestPermission(permission: PermissionType): Promise<ApiResponse> {
|
|
115
|
+
return ipcRenderer.invoke(IPC_CHANNELS.REQUEST_PERMISSION, permission);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Update plugin configuration
|
|
120
|
+
* @param config Configuration updates
|
|
121
|
+
* @returns Promise resolving to update result
|
|
122
|
+
*/
|
|
123
|
+
export async function setConfig(config: Partial<RecallSdkConfig>): Promise<ApiResponse> {
|
|
124
|
+
return ipcRenderer.invoke(IPC_CHANNELS.SET_CONFIG, config);
|
|
125
|
+
}
|
|
223
126
|
|
|
224
|
-
|
|
225
|
-
|
|
127
|
+
/**
|
|
128
|
+
* Get current plugin configuration
|
|
129
|
+
* @returns Promise resolving to current configuration
|
|
130
|
+
*/
|
|
131
|
+
export async function getConfig(): Promise<ApiResponse<RecallSdkConfig>> {
|
|
132
|
+
return ipcRenderer.invoke(IPC_CHANNELS.GET_CONFIG);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Subscribe to SDK events
|
|
137
|
+
* @param eventType The type of event to listen for
|
|
138
|
+
* @param callback Function to call when event occurs
|
|
139
|
+
* @returns Function to unsubscribe from the event
|
|
140
|
+
*/
|
|
141
|
+
export function addEventListener(eventType: RecallSdkEventType, callback: (data: any) => void): () => void {
|
|
142
|
+
const channel = `recall-desktop:event:${eventType}`;
|
|
143
|
+
|
|
144
|
+
// Fire-and-forget subscribe to main
|
|
145
|
+
ipcRenderer.invoke(IPC_CHANNELS.SUBSCRIBE_EVENTS, eventType).catch(console.error);
|
|
146
|
+
|
|
147
|
+
const listener = (_event: any, data: any) => {
|
|
148
|
+
callback(data);
|
|
149
|
+
};
|
|
150
|
+
ipcRenderer.on(channel, listener);
|
|
151
|
+
|
|
152
|
+
// Return unsubscribe function
|
|
153
|
+
return () => {
|
|
154
|
+
ipcRenderer.removeListener(channel, listener);
|
|
155
|
+
ipcRenderer.invoke(IPC_CHANNELS.UNSUBSCRIBE_EVENTS, eventType).catch(console.error);
|
|
156
|
+
};
|
|
157
|
+
}
|
|
226
158
|
|
|
227
|
-
|
|
228
|
-
|
|
159
|
+
/**
|
|
160
|
+
* Get plugin version
|
|
161
|
+
* @returns Plugin version string
|
|
162
|
+
*/
|
|
163
|
+
export function getVersion(): string {
|
|
164
|
+
return '1.0.0';
|
|
165
|
+
}
|
|
229
166
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
167
|
+
/**
|
|
168
|
+
* Convenience method for handling meeting detection events
|
|
169
|
+
* @param callback Function to call when a meeting is detected
|
|
170
|
+
* @returns Function to unsubscribe from the event
|
|
171
|
+
*/
|
|
172
|
+
export function onMeetingDetected(callback: (meetingData: any) => void): () => void {
|
|
173
|
+
return addEventListener('meeting-detected', callback);
|
|
235
174
|
}
|
|
236
175
|
|
|
176
|
+
/**
|
|
177
|
+
* Convenience method for handling recording state changes
|
|
178
|
+
* @param callback Function to call when recording state changes
|
|
179
|
+
* @returns Function to unsubscribe from the event
|
|
180
|
+
*/
|
|
181
|
+
export function onRecordingStateChange(callback: (stateData: any) => void): () => void {
|
|
182
|
+
return addEventListener('sdk-state-change', callback);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Convenience method for handling upload progress updates
|
|
187
|
+
* @param callback Function to call when upload progress updates
|
|
188
|
+
* @returns Function to unsubscribe from the event
|
|
189
|
+
*/
|
|
190
|
+
export function onUploadProgress(callback: (progressData: any) => void): () => void {
|
|
191
|
+
return addEventListener('upload-progress', callback);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Convenience method for handling permission status updates
|
|
196
|
+
* @param callback Function to call when permission status changes
|
|
197
|
+
* @returns Function to unsubscribe from the event
|
|
198
|
+
*/
|
|
199
|
+
export function onPermissionStatusChange(callback: (permissionData: any) => void): () => void {
|
|
200
|
+
return addEventListener('permission-status', callback);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Convenience method for handling SDK errors
|
|
205
|
+
* @param callback Function to call when SDK errors occur
|
|
206
|
+
* @returns Function to unsubscribe from the event
|
|
207
|
+
*/
|
|
208
|
+
export function onError(callback: (errorData: any) => void): () => void {
|
|
209
|
+
return addEventListener('error', callback);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Convenience method for handling real-time events (transcription, participants, etc.)
|
|
214
|
+
* @param callback Function to call when real-time events occur
|
|
215
|
+
* @returns Function to unsubscribe from the event
|
|
216
|
+
*/
|
|
217
|
+
export function onRealtimeEvent(callback: (realtimeData: any) => void): () => void {
|
|
218
|
+
return addEventListener('realtime-event', callback);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// Export the API type for TypeScript support (shape of the exported functions)
|
|
222
|
+
type ExportedApi = {
|
|
223
|
+
initSdk: typeof initSdk;
|
|
224
|
+
shutdownSdk: typeof shutdownSdk;
|
|
225
|
+
getStatus: typeof getStatus;
|
|
226
|
+
startRecording: typeof startRecording;
|
|
227
|
+
stopRecording: typeof stopRecording;
|
|
228
|
+
pauseRecording: typeof pauseRecording;
|
|
229
|
+
resumeRecording: typeof resumeRecording;
|
|
230
|
+
uploadRecording: typeof uploadRecording;
|
|
231
|
+
prepareDesktopAudioRecording: typeof prepareDesktopAudioRecording;
|
|
232
|
+
requestPermission: typeof requestPermission;
|
|
233
|
+
setConfig: typeof setConfig;
|
|
234
|
+
getConfig: typeof getConfig;
|
|
235
|
+
addEventListener: typeof addEventListener;
|
|
236
|
+
getVersion: typeof getVersion;
|
|
237
|
+
onMeetingDetected: typeof onMeetingDetected;
|
|
238
|
+
onRecordingStateChange: typeof onRecordingStateChange;
|
|
239
|
+
onUploadProgress: typeof onUploadProgress;
|
|
240
|
+
onPermissionStatusChange: typeof onPermissionStatusChange;
|
|
241
|
+
onError: typeof onError;
|
|
242
|
+
onRealtimeEvent: typeof onRealtimeEvent;
|
|
243
|
+
};
|
|
244
|
+
export type RecallDesktopApi = ExportedApi;
|
|
245
|
+
|
|
237
246
|
console.log('RecallDesktop: Preload script loaded successfully');
|