@cometchat/calls-sdk-javascript 4.2.5 → 5.0.0-beta.2

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.
Files changed (41) hide show
  1. package/README.md +29 -16
  2. package/dist/index.css +1 -0
  3. package/dist/index.d.ts +2112 -0
  4. package/dist/index.es.js +39425 -0
  5. package/dist/index.umd.js +319 -0
  6. package/package.json +48 -23
  7. package/LICENSE.md +0 -3
  8. package/pack/index.js +0 -2
  9. package/pack/src/Helper.d.ts +0 -5
  10. package/pack/src/api/APIHandler.d.ts +0 -39
  11. package/pack/src/api/endpoints.d.ts +0 -7
  12. package/pack/src/api/helper.d.ts +0 -69
  13. package/pack/src/api/index.d.ts +0 -2
  14. package/pack/src/constants/CallConstants.d.ts +0 -218
  15. package/pack/src/constants/index.d.ts +0 -1
  16. package/pack/src/defaultCallsettings.d.ts +0 -2
  17. package/pack/src/index.d.ts +0 -7
  18. package/pack/src/models/CallGroup.d.ts +0 -14
  19. package/pack/src/models/CallLog.d.ts +0 -276
  20. package/pack/src/models/CallSettings.d.ts +0 -396
  21. package/pack/src/models/CallUser.d.ts +0 -14
  22. package/pack/src/models/CallsAppSettings.d.ts +0 -41
  23. package/pack/src/models/CometChatCallLogs.d.ts +0 -189
  24. package/pack/src/models/CometChatCalls.d.ts +0 -181
  25. package/pack/src/models/CometChatCallsException.d.ts +0 -8
  26. package/pack/src/models/ErrorModel.d.ts +0 -12
  27. package/pack/src/models/Listener.d.ts +0 -91
  28. package/pack/src/models/ListnerHandler.d.ts +0 -10
  29. package/pack/src/models/Participant.d.ts +0 -184
  30. package/pack/src/models/PresenterSettings.d.ts +0 -279
  31. package/pack/src/models/RTCUser.d.ts +0 -18
  32. package/pack/src/models/Recording.d.ts +0 -86
  33. package/pack/src/models/index.d.ts +0 -10
  34. package/pack/src/types/ICallSettings.d.ts +0 -62
  35. package/pack/src/types/ICallsAppSettings.d.ts +0 -6
  36. package/pack/src/types/RTCUser.d.ts +0 -6
  37. package/pack/src/types/callEvents.d.ts +0 -84
  38. package/pack/src/types/common.d.ts +0 -14
  39. package/pack/src/types/index.d.ts +0 -2
  40. package/pack/src/util/parseJwt.d.ts +0 -1
  41. package/pack/src/util/verifyCallSettings.d.ts +0 -4
@@ -1,181 +0,0 @@
1
- import { CallSettings, CallSettingsBuilder, MainVideoContainerSetting } from "./CallSettings";
2
- import { CallAppSettings, CallAppSettingsBuilder } from "./CallsAppSettings";
3
- import { OngoingCallListener } from "./Listener";
4
- import { CallConstants } from "../constants";
5
- import { PresenterSettings, PresenterSettingsBuilder } from "./PresenterSettings";
6
- import { ListenerHandlers } from "./ListnerHandler";
7
- import { CallLog } from './CallLog';
8
- import { CallLogRequestBuilder } from './CometChatCallLogs';
9
- import { CallUser } from "./CallUser";
10
- import { CallGroup } from "./CallGroup";
11
- import { Participant } from './Participant';
12
- import { Recording } from './Recording';
13
- export declare class CometChatCalls {
14
- private static appSettings;
15
- private static inProgress;
16
- private static callEventListener;
17
- private static debounceDeviceChange;
18
- private static deviceList;
19
- static CALL_MODE: {
20
- readonly DEFAULT: "DEFAULT";
21
- readonly SPOTLIGHT: "SPOTLIGHT";
22
- readonly GRID: "TILE";
23
- };
24
- /**
25
- * Alias to CometChatCalls.CALL_MODE
26
- */
27
- static MODE: {
28
- readonly DEFAULT: "DEFAULT";
29
- readonly SPOTLIGHT: "SPOTLIGHT";
30
- readonly GRID: "TILE";
31
- };
32
- static addCallEventListener: typeof ListenerHandlers.addCallEventListener;
33
- static removeCallEventListener: typeof ListenerHandlers.removeCallEventListener;
34
- static OngoingCallListener: typeof OngoingCallListener;
35
- static CallSettingsBuilder: typeof CallSettingsBuilder;
36
- static CallSettings: typeof CallSettings;
37
- static PresenterSettingsBuilder: typeof PresenterSettingsBuilder;
38
- static PresenterSettings: typeof PresenterSettings;
39
- static CallAppSettingsBuilder: typeof CallAppSettingsBuilder;
40
- static CallAppSettings: typeof CallAppSettings;
41
- static MainVideoContainerSetting: typeof MainVideoContainerSetting;
42
- static CallLogRequestBuilder: typeof CallLogRequestBuilder;
43
- static CallLog: typeof CallLog;
44
- static CallUser: typeof CallUser;
45
- static CallGroup: typeof CallGroup;
46
- static Participant: typeof Participant;
47
- static Recording: typeof Recording;
48
- private static isPresenterMode;
49
- static joinPresentation(callToken: string, presenterSettings: PresenterSettings, htmlElement: HTMLElement): Promise<void>;
50
- static startSession(callToken: string, callSettings: CallSettings, htmlElement: HTMLElement): Promise<void>;
51
- private static startSessionCore;
52
- private static startTheSession;
53
- static generateToken(sessionID: string, authToken: string): Promise<{
54
- token: string;
55
- }>;
56
- static init(appSettings: CallAppSettings): Promise<void>;
57
- private static getRef;
58
- /**
59
- * Method to pause/unpause video stream.
60
- * @param {boolean} pauseVideo Defaults to true
61
- * @returns {void}
62
- */
63
- static pauseVideo(pauseVideo?: boolean): void;
64
- /**
65
- * Method to resume video stream. Alias to resumeVideo.
66
- * @returns {void}
67
- */
68
- static unPauseVideo(): void;
69
- /**
70
- * Method to resume video stream.
71
- * @returns {void}
72
- */
73
- static resumeVideo(): void;
74
- /**
75
- * Method to set mode.
76
- * @param mode
77
- * @returns {void}
78
- */
79
- static setMode(mode: (typeof CallConstants.MODE)[keyof typeof CallConstants.MODE]): void;
80
- /**
81
- * Method to mute/unmute audio stream.
82
- * @param {boolean} muteAudio Defaults to true
83
- * @returns {void}
84
- */
85
- static muteAudio(muteAudio?: boolean): void;
86
- /**
87
- * Method to unmute audio stream.
88
- * @returns {void}
89
- */
90
- static unMuteAudio(): void;
91
- /**
92
- * Method to start screen share.
93
- * @returns {void}
94
- */
95
- static startScreenShare(): void;
96
- /**
97
- * Method to stop screen share.
98
- * @returns {void}
99
- */
100
- static stopScreenShare(): void;
101
- static endSession(): void;
102
- static switchCamera(): void;
103
- /**
104
- * Method to start call recording.
105
- * @returns {void}
106
- */
107
- static startRecording(): void;
108
- /**
109
- * Method to stop call recording.
110
- * @returns {void}
111
- */
112
- static stopRecording(): void;
113
- /**
114
- * Method to switch an audio call to video call.
115
- * @returns {void}
116
- */
117
- static switchToVideoCall(): void;
118
- /**
119
- * Method to open the virtual background settings.
120
- * @returns {void}
121
- */
122
- static openVirtualBackground(): void;
123
- /**
124
- * Method to close the virtual background settings.
125
- * @returns {void}
126
- */
127
- static closeVirtualBackground(): void;
128
- /**
129
- * Method to set the background blur. This method takes number as input which decides the blur level of the background.
130
- * @param {number} blurLevel The blur level of the background
131
- * @returns {void}
132
- */
133
- static setBackgroundBlur(blurLevel: number): void;
134
- /**
135
- * Method to set the background image. This method takes either a URL or file Object & sets that image as the background.
136
- * @param image image URL or file Object
137
- * @returns {void}
138
- */
139
- static setBackgroundImage(image: string | Blob | Object): void;
140
- /**
141
- * Method to get all the available audio input devices.
142
- * @returns {MediaDeviceInfo[]}
143
- */
144
- static getAudioInputDevices(): MediaDeviceInfo[];
145
- /**
146
- * Method to get all the available audio output devices.
147
- * @returns {MediaDeviceInfo[]}
148
- */
149
- static getAudioOutputDevices(): MediaDeviceInfo[];
150
- /**
151
- * Method to get all the available video input devices.
152
- * @returns {MediaDeviceInfo[]}
153
- */
154
- static getVideoInputDevices(): MediaDeviceInfo[];
155
- /**
156
- * Method to change the audio input device.
157
- * @param {string} deviceId
158
- * @returns {void}
159
- */
160
- static setAudioInputDevice(deviceId: string): void;
161
- /**
162
- * Method to change the audio output device.
163
- * @param {string} deviceId
164
- * @returns {void}
165
- */
166
- static setAudioOutputDevice(deviceId: string): void;
167
- /**
168
- * Method to change the video input device.
169
- * @param {string} deviceId
170
- * @returns {void}
171
- */
172
- static setVideoInputDevice(deviceId: string): void;
173
- /**
174
- * Retrieves call details for a given session ID and auth token.
175
- * @param sessionID - The session ID of the call.
176
- * @param authToken - The authentication token required to make the API call.
177
- * @returns A Promise that resolves to a CallLog object containing the call details.
178
- * @throws {CometChatCallsException} If there is an error retrieving the call details.
179
- */
180
- static getCallDetails(sessionID: string, authToken: string): Promise<Array<CallLog>>;
181
- }
@@ -1,8 +0,0 @@
1
- import { ErrorModel } from "./ErrorModel";
2
- export declare class CometChatCallsException {
3
- code?: ErrorModel["code"];
4
- name?: ErrorModel["name"];
5
- message?: ErrorModel["message"];
6
- details?: ErrorModel["details"];
7
- constructor(errorModel: ErrorModel);
8
- }
@@ -1,12 +0,0 @@
1
- /**
2
- *
3
- *
4
- * @export
5
- * @interface ErrorModel
6
- */
7
- export interface ErrorModel {
8
- code?: string | number;
9
- name?: string;
10
- message?: string;
11
- details?: string;
12
- }
@@ -1,91 +0,0 @@
1
- import { ICallEventsData } from "../types/callEvents";
2
- import { CometChatCallsException } from "./CometChatCallsException";
3
- interface IOngoingCallListener {
4
- onUserJoined: (user: Partial<ICallEventsData["onUserJoined"]>) => void;
5
- onUserLeft: (user: Partial<ICallEventsData["onUserJoined"]>) => void;
6
- onUserListUpdated: (userList: Partial<ICallEventsData["onUserListUpdated"]>) => void;
7
- onMediaDeviceListUpdated: (devices: Partial<ICallEventsData["onMediaDeviceListUpdated"]>) => void;
8
- onRecordingStarted: (event: Partial<ICallEventsData["onRecordingStarted"]>) => void;
9
- onRecordingStopped: () => void;
10
- onScreenShareStarted: () => void;
11
- onScreenShareStopped: () => void;
12
- onUserMuted: (event: Partial<ICallEventsData["onUserMuted"]>) => void;
13
- onUserUnMuted: (event: Partial<ICallEventsData["onUserUnMuted"]>) => void;
14
- onCallSwitchedToVideo: (event: Partial<ICallEventsData["onCallSwitchedToVideo"]>) => void;
15
- onCallEnded: () => void;
16
- onSessionTimeout: () => void;
17
- onCallEndButtonPressed: () => void;
18
- onError: (error: CometChatCallsException) => void;
19
- }
20
- export declare class OngoingCallListener {
21
- /**
22
- * @internal
23
- */
24
- onYouLeft?: Function;
25
- /**
26
- * @internal
27
- */
28
- onYouJoined?: Function;
29
- /**
30
- * This event is triggered when a user joins the call.
31
- */
32
- onUserJoined?: IOngoingCallListener["onUserJoined"];
33
- /**
34
- * This event is triggered when a user leaves the call.
35
- */
36
- onUserLeft?: IOngoingCallListener["onUserLeft"];
37
- /**
38
- * This event is triggered when the participant list of the call changes.
39
- */
40
- onUserListUpdated?: IOngoingCallListener["onUserListUpdated"];
41
- /**
42
- * This event is triggered when the media device list changes.
43
- */
44
- onMediaDeviceListUpdated?: IOngoingCallListener["onMediaDeviceListUpdated"];
45
- /**
46
- * This event is triggered when someone starts recording the call.
47
- */
48
- onRecordingStarted?: IOngoingCallListener["onRecordingStarted"];
49
- /**
50
- * This event is triggered when someone stops recording the call.
51
- */
52
- onRecordingStopped?: IOngoingCallListener["onRecordingStopped"];
53
- /**
54
- * This event is triggered when someone starts sharing their screen in the call.
55
- */
56
- onScreenShareStarted?: IOngoingCallListener["onScreenShareStarted"];
57
- /**
58
- * This event is triggered when someone stops sharing their screen in the call.
59
- */
60
- onScreenShareStopped?: IOngoingCallListener["onScreenShareStopped"];
61
- /**
62
- * This event is triggered when a user is muted.
63
- */
64
- onUserMuted?: IOngoingCallListener["onUserMuted"];
65
- /**
66
- * This event is triggered when a user is unmuted.
67
- */
68
- onUserUnMuted?: IOngoingCallListener["onUserUnMuted"];
69
- /**
70
- * This event is triggered when an audio call is switched to a video call.
71
- */
72
- onCallSwitchedToVideo?: IOngoingCallListener["onCallSwitchedToVideo"];
73
- /**
74
- * This event is triggered when the call is ended.
75
- */
76
- onCallEnded?: IOngoingCallListener["onCallEnded"];
77
- /**
78
- * This event is triggered when the call is ended due to session timeout.
79
- */
80
- onSessionTimeout?: IOngoingCallListener["onSessionTimeout"];
81
- /**
82
- * This event is triggered when an error occurs.
83
- */
84
- onError?: IOngoingCallListener["onError"];
85
- /**
86
- * This event is triggered when user presses end call button.
87
- */
88
- onCallEndButtonPressed?: IOngoingCallListener["onCallEndButtonPressed"];
89
- constructor(eventObj: Partial<IOngoingCallListener>);
90
- }
91
- export {};
@@ -1,10 +0,0 @@
1
- import { OngoingCallListener } from "./Listener";
2
- interface IMultiOngoingCallListener extends OngoingCallListener {
3
- _name: string;
4
- }
5
- export declare class ListenerHandlers {
6
- static callHandlers?: IMultiOngoingCallListener[];
7
- static addCallEventListener(name: string, callListener: OngoingCallListener): void;
8
- static removeCallEventListener(handler: string): void;
9
- }
10
- export {};
@@ -1,184 +0,0 @@
1
- /**
2
- * Represents a participant in a call.
3
- */
4
- export declare class Participant {
5
- /**
6
- * The unique identifier of the participant.
7
- */
8
- private uid;
9
- /**
10
- * The name of the participant.
11
- */
12
- private name;
13
- /**
14
- * The avatar of the participant.
15
- */
16
- private avatar;
17
- /**
18
- * The total audio minutes of the participant.
19
- */
20
- private totalAudioMinutes;
21
- /**
22
- * The total video minutes of the participant.
23
- */
24
- private totalVideoMinutes;
25
- /**
26
- * The total duration in minutes of the participant.
27
- */
28
- private totalDurationInMinutes;
29
- /**
30
- * The device ID of the participant.
31
- */
32
- private deviceID;
33
- /**
34
- * Whether the participant has joined the call or not.
35
- */
36
- private hasJoined;
37
- /**
38
- * The timestamp when the participant joined the call.
39
- */
40
- private joinedAt;
41
- /**
42
- * The timestamp when the participant left the call.
43
- */
44
- private leftAt;
45
- /**
46
- * The media ID of the participant.
47
- */
48
- private mid;
49
- /**
50
- * The state of the participant.
51
- */
52
- private state;
53
- /**
54
- * Creates a new instance of Participant.
55
- * @param object - The object containing the participant data.
56
- */
57
- constructor(object: any);
58
- /**
59
- * Gets the unique identifier of the participant.
60
- * @returns The unique identifier of the participant.
61
- */
62
- getUid(): string;
63
- /**
64
- * Sets the unique identifier of the participant.
65
- * @param value - The unique identifier of the participant.
66
- */
67
- setUid(value: string): void;
68
- /**
69
- * Gets the name of the participant.
70
- * @returns The name of the participant.
71
- */
72
- getName(): string;
73
- /**
74
- * Sets the name of the participant.
75
- * @param value - The name of the participant.
76
- */
77
- setName(value: string): void;
78
- /**
79
- * Gets the avatar of the participant.
80
- * @returns The avatar of the participant.
81
- */
82
- getAvatar(): string;
83
- /**
84
- * Sets the avatar of the participant.
85
- * @param value - The avatar of the participant.
86
- */
87
- setAvatar(value: string): void;
88
- /**
89
- * Gets the total audio minutes of the participant.
90
- * @returns The total audio minutes of the participant.
91
- */
92
- getTotalAudioMinutes(): number;
93
- /**
94
- * Sets the total audio minutes of the participant.
95
- * @param value - The total audio minutes of the participant.
96
- */
97
- setTotalAudioMinutes(value: number): void;
98
- /**
99
- * Gets the total video minutes of the participant.
100
- * @returns The total video minutes of the participant.
101
- */
102
- getTotalVideoMinutes(): number;
103
- /**
104
- * Sets the total video minutes of the participant.
105
- * @param value - The total video minutes of the participant.
106
- */
107
- setTotalVideoMinutes(value: number): void;
108
- /**
109
- * Gets the total duration in minutes of the participant.
110
- * @returns The total duration in minutes of the participant.
111
- */
112
- getTotalDurationInMinutes(): number;
113
- /**
114
- * Sets the total duration in minutes of the participant.
115
- * @param value - The total duration in minutes of the participant.
116
- */
117
- setTotalDurationInMinutes(value: number): void;
118
- /**
119
- * Gets the device ID of the participant.
120
- * @returns The device ID of the participant.
121
- */
122
- getDeviceID(): string;
123
- /**
124
- * Sets the device ID of the participant.
125
- * @param value - The device ID of the participant.
126
- */
127
- setDeviceID(value: string): void;
128
- /**
129
- * Gets whether the participant has joined the call or not.
130
- * @returns Whether the participant has joined the call or not.
131
- */
132
- getHasJoined(): boolean;
133
- /**
134
- * Sets whether the participant has joined the call or not.
135
- * @param value - Whether the participant has joined the call or not.
136
- */
137
- setHasJoined(value: boolean): void;
138
- /**
139
- * Gets the timestamp when the participant joined the call.
140
- * @returns The timestamp when the participant joined the call.
141
- */
142
- getJoinedAt(): number;
143
- /**
144
- * Sets the timestamp when the participant joined the call.
145
- * @param value - The timestamp when the participant joined the call.
146
- */
147
- setJoinedAt(value: number): void;
148
- /**
149
- * Gets the timestamp when the participant left the call.
150
- * @returns The timestamp when the participant left the call.
151
- */
152
- getLeftAt(): number;
153
- /**
154
- * Sets the timestamp when the participant left the call.
155
- * @param value - The timestamp when the participant left the call.
156
- */
157
- setLeftAt(value: number): void;
158
- /**
159
- * Gets the media ID of the participant.
160
- * @returns The media ID of the participant.
161
- */
162
- getMid(): string;
163
- /**
164
- * Sets the media ID of the participant.
165
- * @param value - The media ID of the participant.
166
- */
167
- setMid(value: string): void;
168
- /**
169
- * Gets the state of the participant.
170
- * @returns The state of the participant.
171
- */
172
- getState(): string;
173
- /**
174
- * Sets the state of the participant.
175
- * @param value - The state of the participant.
176
- */
177
- setState(value: string): void;
178
- /**
179
- * Creates a new instance of Participant from a JSON object.
180
- * @param object - The JSON object containing the participant data.
181
- * @returns A new instance of Participant.
182
- */
183
- static getParticipantFromJson(object: any): Participant;
184
- }