@cometchat/calls-sdk-react-native 4.0.1 → 4.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.
@@ -0,0 +1,14 @@
1
+ export declare class CallGroup {
2
+ protected guid: string;
3
+ protected name: string;
4
+ protected icon: string;
5
+ constructor(object: any);
6
+ getGuid(): string;
7
+ setGuid(guid: string): void;
8
+ getName(): string;
9
+ setName(name: string): void;
10
+ getIcon(): string;
11
+ setIcon(icon: string): void;
12
+ toString(): string;
13
+ static getGroupFromJson(object: any): CallGroup;
14
+ }
@@ -0,0 +1,276 @@
1
+ import { CallGroup } from "./CallGroup";
2
+ import { CallUser } from "./CallUser";
3
+ import { Participant } from "./Participant";
4
+ import { Recording } from "./Recording";
5
+ /**
6
+ * Represents a call log.
7
+ */
8
+ export declare class CallLog {
9
+ /**
10
+ * The session ID of the call log.
11
+ */
12
+ private sessionId;
13
+ /**
14
+ * The total audio minutes of the call log.
15
+ */
16
+ private totalAudioMinutes;
17
+ /**
18
+ * The total video minutes of the call log.
19
+ */
20
+ private totalVideoMinutes;
21
+ /**
22
+ * The total duration of the call log.
23
+ */
24
+ private totalDuration;
25
+ /**
26
+ * Whether the call log has a recording.
27
+ */
28
+ private hasRecording;
29
+ /**
30
+ * The time the call was initiated at.
31
+ */
32
+ private initiatedAt;
33
+ /**
34
+ * The call category of the call log.
35
+ */
36
+ private callCategory;
37
+ /**
38
+ * @type {CallUser}
39
+ * The initiator of the call log.
40
+ */
41
+ private initiator;
42
+ /**
43
+ * @type {CallUser | CallGroup}
44
+ * The receiver of the call log.
45
+ */
46
+ private receiver;
47
+ /**
48
+ * The receiver type of the call log.
49
+ */
50
+ private receiverType;
51
+ /**
52
+ * The status of the call log.
53
+ */
54
+ private status;
55
+ /**
56
+ * The total duration in minutes of the call log.
57
+ */
58
+ private totalDurationInMinutes;
59
+ /**
60
+ * The total number of participants in the call log.
61
+ */
62
+ private totalParticipants;
63
+ /**
64
+ * The type of the call log.
65
+ */
66
+ private type;
67
+ /**
68
+ * The message ID of the call log.
69
+ */
70
+ private mid;
71
+ /**
72
+ * The time the call ended at.
73
+ */
74
+ private endedAt;
75
+ /**
76
+ * @type {Participant[]}
77
+ * The participants of the call log.
78
+ */
79
+ private participants;
80
+ /**
81
+ * @type {Recording[]}
82
+ * The recordings of the call log.
83
+ */
84
+ private recordings;
85
+ /**
86
+ * Creates a new instance of CallLog.
87
+ * @param data - The data to initialize the call log with.
88
+ */
89
+ constructor(data: any);
90
+ /**
91
+ * Gets the session ID of the call log.
92
+ * @returns The session ID of the call log.
93
+ */
94
+ getSessionID(): string;
95
+ /**
96
+ * Sets the session ID of the call log.
97
+ * @param value - The session ID to set.
98
+ */
99
+ setSessionID(value: string): void;
100
+ /**
101
+ * Gets the total audio minutes of the call log.
102
+ * @returns The total audio minutes of the call log.
103
+ */
104
+ getTotalAudioMinutes(): number;
105
+ /**
106
+ * Sets the total audio minutes of the call log.
107
+ * @param value - The total audio minutes to set.
108
+ */
109
+ setTotalAudioMinutes(value: number): void;
110
+ /**
111
+ * Gets the total video minutes of the call log.
112
+ * @returns The total video minutes of the call log.
113
+ */
114
+ getTotalVideoMinutes(): number;
115
+ /**
116
+ * Sets the total video minutes of the call log.
117
+ * @param value - The total video minutes to set.
118
+ */
119
+ setTotalVideoMinutes(value: number): void;
120
+ /**
121
+ * Gets the total duration of the call log.
122
+ * @returns The total duration of the call log.
123
+ */
124
+ getTotalDuration(): string;
125
+ /**
126
+ * Sets the total duration of the call log.
127
+ * @param value - The total duration to set.
128
+ */
129
+ setTotalDuration(value: string): void;
130
+ /**
131
+ * Gets whether the call log has a recording.
132
+ * @returns Whether the call log has a recording.
133
+ */
134
+ getHasRecording(): boolean;
135
+ /**
136
+ * Sets whether the call log has a recording.
137
+ * @param value - Whether the call log has a recording.
138
+ */
139
+ setHasRecording(value: boolean): void;
140
+ /**
141
+ * Gets the time the call was initiated at.
142
+ * @returns The time the call was initiated at.
143
+ */
144
+ getInitiatedAt(): number;
145
+ /**
146
+ * Sets the time the call was initiated at.
147
+ * @param value - The time the call was initiated at.
148
+ */
149
+ setInitiatedAt(value: number): void;
150
+ /**
151
+ * Gets the call category of the call log.
152
+ * @returns The call category of the call log.
153
+ */
154
+ getCallCategory(): string;
155
+ /**
156
+ * Sets the call category of the call log.
157
+ * @param value - The call category to set.
158
+ */
159
+ setCallCategory(value: string): void;
160
+ /**
161
+ * Gets the initiator of the call log.
162
+ * @returns The initiator of the call log.
163
+ */
164
+ getInitiator(): CallUser;
165
+ /**
166
+ * Sets the initiator of the call log.
167
+ * @param value - The initiator to set.
168
+ */
169
+ setInitiator(value: CallUser): void;
170
+ /**
171
+ * Gets the receiver of the call log.
172
+ * @returns The receiver of the call log.
173
+ */
174
+ getReceiver(): CallUser | CallGroup;
175
+ /**
176
+ * Sets the receiver of the call log.
177
+ * @param value - The receiver to set.
178
+ */
179
+ setReceiver(value: CallUser | CallGroup): void;
180
+ /**
181
+ * Gets the receiver type of the call log.
182
+ * @returns The receiver type of the call log.
183
+ */
184
+ getReceiverType(): string;
185
+ /**
186
+ * Sets the receiver type of the call log.
187
+ * @param value - The receiver type to set.
188
+ */
189
+ setReceiverType(value: string): void;
190
+ /**
191
+ * Gets the status of the call log.
192
+ * @returns The status of the call log.
193
+ */
194
+ getStatus(): string;
195
+ /**
196
+ * Sets the status of the call log.
197
+ * @param value - The status to set.
198
+ */
199
+ setStatus(value: string): void;
200
+ /**
201
+ * Gets the total duration in minutes of the call log.
202
+ * @returns The total duration in minutes of the call log.
203
+ */
204
+ getTotalDurationInMinutes(): number;
205
+ /**
206
+ * Sets the total duration in minutes of the call log.
207
+ * @param value - The total duration in minutes to set.
208
+ */
209
+ setTotalDurationInMinutes(value: number): void;
210
+ /**
211
+ * Gets the total number of participants in the call log.
212
+ * @returns The total number of participants in the call log.
213
+ */
214
+ getTotalParticipants(): number;
215
+ /**
216
+ * Sets the total number of participants in the call log.
217
+ * @param value - The total number of participants to set.
218
+ */
219
+ setTotalParticipants(value: number): void;
220
+ /**
221
+ * Gets the type of the call log.
222
+ * @returns The type of the call log.
223
+ */
224
+ getType(): string;
225
+ /**
226
+ * Sets the type of the call log.
227
+ * @param value - The type to set.
228
+ */
229
+ setType(value: string): void;
230
+ /**
231
+ * Gets the message ID of the call log.
232
+ * @returns The message ID of the call log.
233
+ */
234
+ getMid(): string;
235
+ /**
236
+ * Sets the message ID of the call log.
237
+ * @param value - The message ID to set.
238
+ */
239
+ setMid(value: string): void;
240
+ /**
241
+ * Gets the time the call ended at.
242
+ * @returns The time the call ended at.
243
+ */
244
+ getEndedAt(): number;
245
+ /**
246
+ * Sets the time the call ended at.
247
+ * @param value - The time the call ended at.
248
+ */
249
+ setEndedAt(value: number): void;
250
+ /**
251
+ * Gets the participants of the call log.
252
+ * @returns The participants of the call log.
253
+ */
254
+ getParticipants(): Participant[];
255
+ /**
256
+ * Sets the participants of the call log.
257
+ * @param value - The participants to set.
258
+ */
259
+ setParticipants(value: Participant[]): void;
260
+ /**
261
+ * Gets the recordings of the call log.
262
+ * @returns The recordings of the call log.
263
+ */
264
+ getRecordings(): Recording[];
265
+ /**
266
+ * Sets the recordings of the call log.
267
+ * @param value - The recordings to set.
268
+ */
269
+ setRecordings(value: Recording[]): void;
270
+ /**
271
+ * Creates a new instance of CallLog from JSON data.
272
+ * @param data - The JSON data to create the call log from.
273
+ * @returns A new instance of CallLog created from the JSON data.
274
+ */
275
+ static callLogFromJson(data: any): CallLog;
276
+ }
@@ -0,0 +1,97 @@
1
+ /**
2
+ * Represents the parameters used to filter call logs.
3
+ */
4
+ export declare class CallLogFilterParams {
5
+ /**
6
+ * The number of items to display per page.
7
+ */
8
+ private perPage;
9
+ /**
10
+ * The page number to display.
11
+ */
12
+ private page;
13
+ /**
14
+ * The mode of the call.
15
+ */
16
+ private mode;
17
+ /**
18
+ * The type of the call.
19
+ */
20
+ private type;
21
+ /**
22
+ * The status of the call.
23
+ */
24
+ private status;
25
+ /**
26
+ * The direction of the call.
27
+ */
28
+ private direction;
29
+ /**
30
+ * Whether the call has recordings.
31
+ */
32
+ private hasRecording;
33
+ /**
34
+ * The user ID.
35
+ */
36
+ private uid;
37
+ /**
38
+ * The group ID.
39
+ */
40
+ private guid;
41
+ /**
42
+ * Creates a new instance of the CallLogFilterParams class.
43
+ * @param data - The data to initialize the call log filter parameters object.
44
+ */
45
+ /**
46
+ * Sets the direction of the call.
47
+ * @param value - The direction of the call.
48
+ */
49
+ setDirection(value: string): void;
50
+ /**
51
+ * Sets the status of the call.
52
+ * @param value - The status of the call.
53
+ */
54
+ setStatus(value: string): void;
55
+ /**
56
+ * Sets the type of the call.
57
+ * @param value - The type of the call.
58
+ */
59
+ setType(value: string): void;
60
+ /**
61
+ * Sets the number of items to display per page.
62
+ * @param value - The number of items to display per page.
63
+ */
64
+ setPerPage(value: number): void;
65
+ /**
66
+ * Sets the page number to display.
67
+ * @param value - The page number to display.
68
+ */
69
+ setPage(value: number): void;
70
+ /**
71
+ * Sets the mode of the call.
72
+ * @param value - The mode of the call.
73
+ */
74
+ setMode(value: string): void;
75
+ /**
76
+ * Sets whether the call has recordings.
77
+ * @param value - Whether the call has recordings.
78
+ */
79
+ setHasRecordings(value: boolean): void;
80
+ /**
81
+ * Sets the user ID.
82
+ * @param value - The user ID.
83
+ */
84
+ setUid(value: string): void;
85
+ /**
86
+ * Sets the group ID.
87
+ * @param value - The group ID.
88
+ */
89
+ setGuid(value: string): void;
90
+ /**
91
+ * Converts the filter parameters to a map of key-value pairs.
92
+ * @returns A map of key-value pairs representing the filter parameters.
93
+ */
94
+ toMap(): {
95
+ [key: string]: string;
96
+ };
97
+ }
@@ -0,0 +1,14 @@
1
+ export declare class CallUser {
2
+ protected uid: string;
3
+ protected name: string;
4
+ protected avatar: string;
5
+ constructor(object: any);
6
+ getUid(): string;
7
+ setUid(uid: string): void;
8
+ getName(): string;
9
+ setName(name: string): void;
10
+ getAvatar(): string;
11
+ setAvatar(avatar: string): void;
12
+ toString(): string;
13
+ static getUserFromJson(object: any): CallUser;
14
+ }
@@ -0,0 +1,193 @@
1
+ import { CallLog } from "./CallLog";
2
+ /**
3
+ * Represents a request to fetch call logs.
4
+ */
5
+ declare class CallLogRequest {
6
+ /**
7
+ * The maximum number of call logs to fetch.
8
+ */
9
+ private limit;
10
+ /**
11
+ * The total number of pages of call logs.
12
+ */
13
+ private totalPages;
14
+ /**
15
+ * The current page of call logs.
16
+ */
17
+ private currentPage;
18
+ /**
19
+ * The type of call to filter by.
20
+ */
21
+ private callType;
22
+ /**
23
+ * The status of call to filter by.
24
+ */
25
+ private callStatus;
26
+ /**
27
+ * Whether the call has a recording or not.
28
+ */
29
+ private hasRecording;
30
+ /**
31
+ * The category of call to filter by.
32
+ */
33
+ private callCategory;
34
+ /**
35
+ * The direction of call to filter by.
36
+ */
37
+ private callDirection;
38
+ /**
39
+ * The user ID to filter by.
40
+ */
41
+ private uid;
42
+ /**
43
+ * The group ID to filter by.
44
+ */
45
+ private guid;
46
+ /**
47
+ * The authentication token to use for the API call.
48
+ */
49
+ private authToken;
50
+ /**
51
+ * Whether an API call is currently in progress.
52
+ */
53
+ private inProgress;
54
+ /**
55
+ * The timestamp of the last update.
56
+ */
57
+ private updatedAt;
58
+ /**
59
+ * Whether to only fetch updates.
60
+ */
61
+ private onlyUpdates;
62
+ /**
63
+ * The timestamp of the call log.
64
+ */
65
+ private timestamp?;
66
+ /**
67
+ * The ID of the call log.
68
+ */
69
+ private id?;
70
+ /**
71
+ * The affix of the call log.
72
+ */
73
+ private affix;
74
+ /**
75
+ * The last affix of the call log.
76
+ */
77
+ private lastAffix;
78
+ /**
79
+ * The current method of the call log.
80
+ */
81
+ private currentMethod;
82
+ /**
83
+ * The pagination metadata of the call log.
84
+ */
85
+ private paginationMeta;
86
+ /**
87
+ * Creates a new CallLogRequest instance.
88
+ * @param builder The builder object to use for constructing the request.
89
+ */
90
+ constructor(builder: CallLogRequestBuilder);
91
+ /**
92
+ * Fetches the next page of call logs.
93
+ * @returns A promise that resolves to an array of CallLog objects, or rejects with a CometChatCallsException if there was an error.
94
+ */
95
+ fetchNext(): Promise<CallLog[]>;
96
+ /**
97
+ * Fetches the previous page of call logs.
98
+ * @returns A promise that resolves to an array of CallLog objects, or an empty array if there are no previous pages, or rejects with a CometChatCallsException if there was an error..
99
+ */
100
+ fetchPrevious(): Promise<CallLog[] | []>;
101
+ /**
102
+ * Makes an API call to fetch call logs.
103
+ * @param isFetchNext Whether to fetch the next page of call logs.
104
+ * @returns A promise that resolves to an array of CallLog objects, or rejects with a CometChatCallsException if there was an error.
105
+ */
106
+ private makeAPICall;
107
+ /**
108
+ * Gets the filter parameters for the API call.
109
+ * @param isNext Whether to fetch the next page of call logs.
110
+ * @returns The filter parameters object.
111
+ */
112
+ private getParams;
113
+ /**
114
+ * Parses the API response and returns an array of CallLog objects.
115
+ * @param response The API response string.
116
+ * @returns An array of CallLog objects.
117
+ */
118
+ private getCallLogList;
119
+ }
120
+ /**
121
+ * A builder class for creating a request to fetch call logs.
122
+ */
123
+ export declare class CallLogRequestBuilder {
124
+ limit: number;
125
+ callType: string;
126
+ callStatus: string;
127
+ hasRecording: boolean;
128
+ callCategory: string;
129
+ callDirection: string;
130
+ uid: string;
131
+ guid: string;
132
+ authToken: string;
133
+ /**
134
+ * Sets the limit of call logs to be fetched.
135
+ * @param limit - The number of call logs to be fetched.
136
+ * @returns The CallLogRequestBuilder object.
137
+ */
138
+ setLimit(limit: number): this;
139
+ /**
140
+ * Sets the type of call to be fetched.
141
+ * @param callType - The type of call to be fetched. Can be either 'video' or 'audio'.
142
+ * @returns The CallLogRequestBuilder object.
143
+ */
144
+ setCallType(callType: 'video' | 'audio'): this;
145
+ /**
146
+ * Sets the status of call to be fetched.
147
+ * @param callStatus - The status of call to be fetched. Can be either 'ongoing', 'busy', 'rejected', 'cancelled', 'ended' or 'missed'.
148
+ * @returns The CallLogRequestBuilder object.
149
+ */
150
+ setCallStatus(callStatus: 'ongoing' | 'busy' | 'rejected' | 'cancelled' | 'ended' | 'missed'): this;
151
+ /**
152
+ * Sets whether the call has recording or not.
153
+ * @param hasRecording - Whether the call has recording or not.
154
+ * @returns The CallLogRequestBuilder object.
155
+ */
156
+ setHasRecording(hasRecording: boolean): this;
157
+ /**
158
+ * Sets the category of call to be fetched.
159
+ * @param callCategory - The category of call to be fetched. Can be either 'call' or 'meet'.
160
+ * @returns The CallLogRequestBuilder object.
161
+ */
162
+ setCallCategory(callCategory: 'call' | 'meet'): this;
163
+ /**
164
+ * Sets the direction of call to be fetched.
165
+ * @param callDirection - The direction of call to be fetched. Can be either 'incoming' or 'outgoing'.
166
+ * @returns The CallLogRequestBuilder object.
167
+ */
168
+ setCallDirection(callDirection: 'incoming' | 'outgoing'): this;
169
+ /**
170
+ * Sets the user ID of the call logs to be fetched.
171
+ * @param uid - The user ID of the call logs to be fetched.
172
+ * @returns The CallLogRequestBuilder object.
173
+ */
174
+ setUid(uid: string): this;
175
+ /**
176
+ * Sets the group ID of the call logs to be fetched.
177
+ * @param guid - The group ID of the call logs to be fetched.
178
+ * @returns The CallLogRequestBuilder object.
179
+ */
180
+ setGuid(guid: string): this;
181
+ /**
182
+ * Sets the authorization token for the request.
183
+ * @param authToken - The authorization token for the request.
184
+ * @returns The CallLogRequestBuilder object.
185
+ */
186
+ setAuthToken(authToken: string): this;
187
+ /**
188
+ * Builds and returns the CallLogRequest object.
189
+ * @returns The CallLogRequest object.
190
+ */
191
+ build(): CallLogRequest;
192
+ }
193
+ export {};
@@ -6,8 +6,11 @@ import { CometChatCallsComponentCore as CometChatCallsComponent } from './CometC
6
6
  import { CometChatPresenterComponent } from './CometChatPresenterComponent';
7
7
  import { OngoingCallListener } from './Listner';
8
8
  import { PresenterSettings, PresenterSettingsBuilder } from './PresenterSettings';
9
+ import { CallLog } from './CallLog';
10
+ import { CallLogRequestBuilder } from './CometChatCallLogs';
9
11
  export declare class CometChatCalls {
10
12
  private static appSettings;
13
+ private static inProgress;
11
14
  static CALL_MODE: {
12
15
  readonly DEFAULT: "DEFAULT";
13
16
  readonly SPOTLIGHT: "SPOTLIGHT";
@@ -29,6 +32,8 @@ export declare class CometChatCalls {
29
32
  static CallAppSettings: typeof CallAppSettings;
30
33
  static Component: typeof CometChatCallsComponent;
31
34
  static PresenterComponent: typeof CometChatPresenterComponent;
35
+ static CallLogRequestBuilder: typeof CallLogRequestBuilder;
36
+ static CallLog: typeof CallLog;
32
37
  static generateToken(sessionID: string, authToken: string): Promise<{
33
38
  token: string;
34
39
  }>;
@@ -86,4 +91,12 @@ export declare class CometChatCalls {
86
91
  * @returns {void}
87
92
  */
88
93
  static stopRecording(): void;
94
+ /**
95
+ * Retrieves call details for a given session ID and auth token.
96
+ * @param sessionID - The session ID of the call.
97
+ * @param authToken - The authentication token required to make the API call.
98
+ * @returns A Promise that resolves to a CallLog object containing the call details.
99
+ * @throws {CometChatCallsException} If there is an error retrieving the call details.
100
+ */
101
+ static getCallDetails(sessionID: string, authToken: string): Promise<CallLog>;
89
102
  }
@@ -7,5 +7,5 @@
7
7
  export interface ErrorModel {
8
8
  code: string | number;
9
9
  message?: string;
10
- details?: string;
10
+ details?: object | string;
11
11
  }