@recallai/desktop-sdk 2024.11.7-b8bfb205192b78bb57c94b50f7a17b17ff9134c5 → 2024.11.14-f00240668b62d8e0ced5b996ccbbe6373937224a

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.
Binary file
package/index.d.ts CHANGED
@@ -1,14 +1,71 @@
1
1
  declare module '@recallai/desktop-sdk' {
2
2
  export function init(config: RecallAiSdkConfig): void;
3
- export function addEventListener(enabled: boolean): void;
4
- export function callback(callback: (event: RecallAiSdkEvent) => void): void;
3
+ export function addEventListener(
4
+ type: RecallAiSdkEvent['type'],
5
+ listener: (event: RecallAiSdkEvent) => void
6
+ ): void;
7
+ export function startRecording(config: StartRecordingConfig): void;
8
+ export function stopRecording(config: StopRecordingConfig): void;
9
+ export function uploadRecording(config: UploadRecordingConfig): void;
5
10
 
6
11
  interface RecallAiSdkConfig {
7
- api_key: string
8
- recording_config: RecordingConfig
12
+ api_url: string;
9
13
  }
10
14
 
11
- interface RecallAiSdkEvent {
12
- type: "recording_start" | "recording_stop"
15
+ interface StartRecordingConfig {
16
+ windowId: string;
17
+ uploadToken: string;
18
+ }
19
+
20
+ interface StopRecordingConfig {
21
+ windowId: string;
22
+ }
23
+
24
+ interface UploadRecordingConfig {
25
+ windowId: string;
26
+ }
27
+
28
+ type RecallAiSdkEvent =
29
+ | RecordingStartEvent
30
+ | RecordingStopEvent
31
+ | UploadProgressEvent
32
+ | RecordingEndedEvent
33
+ | MeetingDetectedEvent
34
+ | MeetingClosedEvent
35
+ | SdkStateChangeEvent;
36
+
37
+ interface UploadProgressEvent {
38
+ type: 'upload-progress';
39
+ window: { id: string };
40
+ progress: number;
41
+ }
42
+
43
+ interface RecordingEndedEvent {
44
+ type: 'recording-started';
45
+ window: { id: string };
46
+ }
47
+
48
+ interface RecordingEndedEvent {
49
+ type: 'recording-ended';
50
+ window: { id: string };
51
+ }
52
+
53
+ interface MeetingDetectedEvent {
54
+ type: 'meeting-detected';
55
+ window: { id: string; url: string; title: string };
56
+ }
57
+
58
+ interface MeetingClosedEvent {
59
+ type: 'meeting-closed';
60
+ window: { id: string };
61
+ }
62
+
63
+ interface SdkStateChangeEvent {
64
+ type: 'sdk-state-change';
65
+ sdk: {
66
+ state: {
67
+ code: 'recording' | 'idle' | 'paused';
68
+ };
69
+ };
13
70
  }
14
71
  }
package/index.js CHANGED
@@ -32,10 +32,6 @@ function init(options) {
32
32
  addon.init(JSON.stringify(options));
33
33
  }
34
34
 
35
- function toggle(enabled) {
36
- addon.toggle(enabled);
37
- }
38
-
39
35
  function startRecording({ windowId, uploadToken }) {
40
36
  addon.start_recording(windowId, uploadToken);
41
37
  }
@@ -44,6 +40,10 @@ function stopRecording({ windowId }) {
44
40
  addon.stop_recording(windowId);
45
41
  }
46
42
 
43
+ function uploadRecording({ windowId }) {
44
+ addon.upload_recording(windowId);
45
+ }
46
+
47
47
  function addEventListener(type, callback) {
48
48
  addon.callback((eventJson) => {
49
49
  let obj = JSON.parse(eventJson);
@@ -54,8 +54,8 @@ function addEventListener(type, callback) {
54
54
 
55
55
  module.exports = {
56
56
  init,
57
- toggle,
58
57
  addEventListener,
59
58
  startRecording,
60
- stopRecording
59
+ stopRecording,
60
+ uploadRecording
61
61
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@recallai/desktop-sdk",
3
- "version": "2024.11.07-b8bfb205192b78bb57c94b50f7a17b17ff9134c5",
3
+ "version": "2024.11.14-f00240668b62d8e0ced5b996ccbbe6373937224a",
4
4
  "description": "Recall Desktop SDK (Alpha)",
5
5
  "gypfile": true,
6
6
  "main": "./index.js",