chat4app-client-angular 0.0.31 → 0.0.32

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.
@@ -5,581 +5,582 @@ import * as SockJS from 'sockjs-client';
5
5
  import * as i1 from '@angular/common/http';
6
6
  import { HttpHeaders, HttpClient } from '@angular/common/http';
7
7
 
8
- class Chat4appClientAngularService {
9
- constructor(http) {
10
- this.http = http;
11
- this.chatServer = "";
12
- this.chatUrl = "";
13
- this.debug = false;
14
- this.timeoutReconnect = 500;
15
- }
16
- ngOnInit() {
17
- }
18
- config(chat4AppConfig) {
19
- this.chatServer = chat4AppConfig.endpoint;
20
- this.chatUrl = chat4AppConfig.endpoint + "/api/v1/";
21
- this.debug = chat4AppConfig.debug;
22
- }
23
- init(securityChatToken, callback, chatCallback, connectionClientId) {
24
- if (!this.chatServer || this.chatServer.trim().length == 0) {
25
- throw new Error("Endpoint is empty");
26
- }
27
- if (!securityChatToken || securityChatToken.trim().length == 0) {
28
- throw new Error("SecurityChatToken is empty");
29
- }
30
- this.setTokenChat4app(securityChatToken);
31
- if (chatCallback && connectionClientId) {
32
- this.connectWebsocket(chatCallback, connectionClientId);
33
- }
34
- callback(securityChatToken);
35
- }
36
- getChatUrlDownload(messageFileId) {
37
- return this.chatUrl + "chatmessage/getFile?messageFileId=" + messageFileId + "&token=" + this.getBearerToken();
38
- }
39
- getMessageChat(chatId, fromId, toId) {
40
- let url = this.chatUrl + "chatmessage/" + chatId + "/" + fromId + "/" + toId;
41
- return this.http.get(url, {
42
- headers: new HttpHeaders().set('Authorization', this.getBearerToken())
43
- });
44
- }
45
- getMessageChatByGrop(chatId, groupId, fromId) {
46
- let url = this.chatUrl + "chatmessage/byGroup/" + chatId + "/" + groupId + "/" + fromId;
47
- return this.http.get(url, {
48
- headers: new HttpHeaders().set('Authorization', this.getBearerToken())
49
- });
50
- }
51
- addMessageChat(chatMessage4App) {
52
- let url = this.chatUrl + "chatmessage/" + chatMessage4App.chatId;
53
- return this.http.post(url, chatMessage4App, {
54
- headers: new HttpHeaders().set('Authorization', this.getBearerToken())
55
- });
56
- }
57
- props(chatFilterRequest4App) {
58
- let url = this.chatUrl + "chatmessage/props";
59
- return this.http.post(url, chatFilterRequest4App, {
60
- headers: new HttpHeaders().set('Authorization', this.getBearerToken())
61
- });
62
- }
63
- removeUsersChat(chatId, chatUsersId, chatUsersExternalId) {
64
- let params = new Array();
65
- if (chatUsersId && chatUsersId.length > 0) {
66
- chatUsersId.forEach(cui => {
67
- params.push("chatUserId=" + cui);
68
- });
69
- }
70
- else if (chatUsersExternalId && chatUsersExternalId.length > 0) {
71
- chatUsersExternalId.forEach(cuei => {
72
- params.push("chatUserExternalId=" + cuei);
73
- });
74
- }
75
- let url = this.chatUrl + "chatuser/" + chatId + "?" + params.join("&");
76
- return this.http.delete(url, {
77
- headers: new HttpHeaders().set('Authorization', this.getBearerToken())
78
- });
79
- }
80
- removeUserChat(chatId, chatUserId, chatUserExternalId) {
81
- let param = "";
82
- if (chatUserId) {
83
- param = "chatUserId=" + chatUserId;
84
- }
85
- else {
86
- param = "chatUserExternalId=" + chatUserExternalId;
87
- }
88
- let url = this.chatUrl + "chatuser/" + chatId + "?" + param;
89
- return this.http.delete(url, {
90
- headers: new HttpHeaders().set('Authorization', this.getBearerToken())
91
- });
92
- }
93
- updateUserChat(chatId, charUser4AppUpdate) {
94
- let url = this.chatUrl + "chatuser/" + chatId;
95
- return this.http.put(url, charUser4AppUpdate, {
96
- headers: new HttpHeaders().set('Authorization', this.getBearerToken())
97
- });
98
- }
99
- createUserChat(chatId, chatUser4App) {
100
- let url = this.chatUrl + "chatuser/" + chatId;
101
- return this.http.post(url, chatUser4App, {
102
- headers: new HttpHeaders().set('Authorization', this.getBearerToken())
103
- });
104
- }
105
- createUsersChat(chatId, chatUser4App) {
106
- let url = this.chatUrl + "chatuser/users/" + chatId;
107
- return this.http.post(url, chatUser4App, {
108
- headers: new HttpHeaders().set('Authorization', this.getBearerToken())
109
- });
110
- }
111
- createChat(chat4app) {
112
- let url = this.chatUrl + "chat";
113
- return this.http.post(url, chat4app, {
114
- headers: new HttpHeaders().set('Authorization', this.getBearerToken())
115
- });
116
- }
117
- createUpdateChat(chat4app) {
118
- let url = this.chatUrl + "chat";
119
- return this.http.put(url, chat4app, {
120
- headers: new HttpHeaders().set('Authorization', this.getBearerToken())
121
- });
122
- }
123
- getLastMessageGroup(chatExternalId, groupId) {
124
- let url = this.chatUrl + "chatmessage/lastMessageGroup?chatExternalId=" + chatExternalId + "&groupId=" + groupId;
125
- return this.http.get(url, {
126
- headers: new HttpHeaders().set('Authorization', this.getBearerToken())
127
- });
128
- }
129
- getLastMessage(chatExternalId, chatUserExternalId) {
130
- let url = this.chatUrl + "chatmessage/lastMessage?chatExternalId=" + chatExternalId + "&chatUserExternalId=" + chatUserExternalId;
131
- return this.http.get(url, {
132
- headers: new HttpHeaders().set('Authorization', this.getBearerToken())
133
- });
134
- }
135
- countNotReadMessages(chatUserExternalId, chatExternalId, groupId) {
136
- let url = this.chatUrl + "chatmessage/countNotReadMessages?chatUserExternalId=" + chatUserExternalId;
137
- if (chatExternalId && chatExternalId.length > 0) {
138
- url += "&chatExternalId=" + chatExternalId;
139
- }
140
- if (groupId && groupId.length > 0) {
141
- url += "&groupId=" + groupId;
142
- }
143
- return this.http.get(url, {
144
- headers: new HttpHeaders().set('Authorization', this.getBearerToken())
145
- });
146
- }
147
- getChatByExternalId(externalId) {
148
- let url = this.chatUrl + "chat?externalId=" + externalId;
149
- return this.http.get(url, {
150
- headers: new HttpHeaders().set('Authorization', this.getBearerToken())
151
- });
152
- }
153
- getChatById(id) {
154
- let url = this.chatUrl + "chat?chatId=" + id;
155
- return this.http.get(url, {
156
- headers: new HttpHeaders().set('Authorization', this.getBearerToken())
157
- });
158
- }
159
- listChatByUser(externalUserId, userId, chatStatus) {
160
- let url = this.chatUrl + "chat/listChatByUser/?externalUserId=" + externalUserId
161
- + "&userId=" + userId
162
- + "&chatStatus=" + chatStatus;
163
- return this.http.get(url, {
164
- headers: new HttpHeaders().set('Authorization', this.getBearerToken())
165
- });
166
- }
167
- closeChat(chatId, chatExternalId) {
168
- let url = this.chatUrl;
169
- if (chatId && chatId.length > 0) {
170
- url += "chat?chatId=" + chatId;
171
- }
172
- if (chatExternalId && chatExternalId.length > 0) {
173
- url += "chat?externalId=" + chatExternalId;
174
- }
175
- return this.http.delete(url, {
176
- headers: new HttpHeaders().set('Authorization', this.getBearerToken())
177
- });
178
- }
179
- readMessage(chatMessageId, toId) {
180
- let url = this.chatUrl + "chatmessage/read/" + chatMessageId;
181
- if (toId && toId.length > 0) {
182
- url += "/" + toId;
183
- }
184
- return this.http.put(url, null, {
185
- headers: new HttpHeaders().set('Authorization', this.getBearerToken())
186
- });
187
- }
188
- online(chatId) {
189
- let url = this.chatUrl + "chatmessage/online/" + chatId;
190
- return this.http.get(url, {
191
- headers: new HttpHeaders().set('Authorization', this.getBearerToken())
192
- });
193
- }
194
- sendFile(chatId, fromId, toId, fileToUpload) {
195
- const endpoint = this.chatUrl + "chatmessage/sendFile/" + chatId + "/" + fromId + "/" + toId;
196
- const formData = new FormData();
197
- formData.append('file', fileToUpload);
198
- return this.http
199
- .post(endpoint, formData, {
200
- headers: new HttpHeaders().set('Authorization', this.getBearerToken())
201
- });
202
- }
203
- sendFileGroup(chatId, fromId, groupId, fileToUpload) {
204
- const endpoint = this.chatUrl + "chatmessage/sendFileGroup/" + chatId + "/" + fromId + "/" + groupId;
205
- const formData = new FormData();
206
- formData.append('file', fileToUpload);
207
- return this.http
208
- .post(endpoint, formData, {
209
- headers: new HttpHeaders().set('Authorization', this.getBearerToken())
210
- });
211
- }
212
- translateMessage(chatMessageId, languageTarget) {
213
- let url = this.chatUrl + "chatmessage/translate/" + chatMessageId + "/" + languageTarget;
214
- return this.http.get(url, {
215
- headers: new HttpHeaders().set('Authorization', this.getBearerToken())
216
- });
217
- }
218
- startTyping(chatId, fromId, toId) {
219
- let url = this.chatUrl + "chatmessage/startTyping/" + chatId + "/" + fromId + "/" + toId;
220
- return this.http.put(url, null, {
221
- headers: new HttpHeaders().set('Authorization', this.getBearerToken())
222
- });
223
- }
224
- startTypingGroup(chatId, fromId, groupId) {
225
- let url = this.chatUrl + "chatmessage/startTypingGroup/" + chatId + "/" + fromId + "/" + groupId;
226
- return this.http.put(url, null, {
227
- headers: new HttpHeaders().set('Authorization', this.getBearerToken())
228
- });
229
- }
230
- stopTyping(chatId, fromId, toId) {
231
- let url = this.chatUrl + "chatmessage/stopTyping/" + chatId + "/" + fromId + "/" + toId;
232
- return this.http.put(url, null, {
233
- headers: new HttpHeaders().set('Authorization', this.getBearerToken())
234
- });
235
- }
236
- stopTypingGroup(chatId, fromId, groupId) {
237
- let url = this.chatUrl + "chatmessage/stopTypingGroup/" + chatId + "/" + fromId + "/" + groupId;
238
- return this.http.put(url, null, {
239
- headers: new HttpHeaders().set('Authorization', this.getBearerToken())
240
- });
241
- }
242
- /* Token */
243
- getBearerToken() {
244
- let ret = "Bearer " + window.sessionStorage.getItem("chat4AppSessionToken");
245
- return ret;
246
- }
247
- setTokenChat4app(chat4AppSessionToken) {
248
- window.sessionStorage.setItem("chat4AppSessionToken", chat4AppSessionToken);
249
- }
250
- /* Connection */
251
- onMessageFirebaseReceived(data, chatCallback) {
252
- //alert("onMessageReceived connectFirebase");
253
- if (data.type == "msg") {
254
- let chat4appMessage = new Chat4AppMessageReceive();
255
- chat4appMessage.data.chatId = data.chatId;
256
- chat4appMessage.data.chatMessageId = data.chatMessageId;
257
- chat4appMessage.data.externalId = data.externalId;
258
- chat4appMessage.data.fromId = data.fromId;
259
- chat4appMessage.data.toId = data.toId;
260
- chat4appMessage.data.groupId = data.groupId;
261
- chat4appMessage.data.dateHour = data.dateHour;
262
- chat4appMessage.data.type = data.type;
263
- chat4appMessage.notification.body = data.body;
264
- if (data.fileId && data.fileId.length > 0) {
265
- chat4appMessage.data.fileId = data.fileId;
266
- chat4appMessage.data.fileName = data.fileName;
267
- chat4appMessage.data.fileSize = data.fileSize;
268
- chat4appMessage.data.fileType = data.fileType;
269
- }
270
- let datTmp = new Map();
271
- for (let key in data) {
272
- datTmp.set(key, data[key]);
273
- }
274
- chat4appMessage.data.all = datTmp;
275
- chatCallback.onMessage(chat4appMessage);
276
- }
277
- else if ((data.type == "on" || data.type == "off")) {
278
- let chat4appMessage = new Chat4AppMessageReceive();
279
- chat4appMessage.data.chatId = data.chatId;
280
- chat4appMessage.data.chatMessageId = data.chatMessageId;
281
- chat4appMessage.data.externalId = data.externalId;
282
- chat4appMessage.data.fromId = data.fromId;
283
- chat4appMessage.data.toId = data.toId;
284
- chat4appMessage.data.groupId = data.groupId;
285
- chat4appMessage.data.dateHour = data.dateHour;
286
- chat4appMessage.data.type = data.type;
287
- let datTmp = new Map();
288
- for (let key in data) {
289
- datTmp.set(key, data[key]);
290
- }
291
- chat4appMessage.data.all = datTmp;
292
- chatCallback.onOffline(chat4appMessage);
293
- }
294
- else if (data.type == "read") {
295
- let chat4appMessage = new Chat4AppMessageReceive();
296
- chat4appMessage.data.chatId = data.chatId;
297
- chat4appMessage.data.chatMessageId = data.chatMessageId;
298
- chat4appMessage.data.externalId = data.externalId;
299
- chat4appMessage.data.fromId = data.fromId;
300
- chat4appMessage.data.toId = data.toId;
301
- chat4appMessage.data.groupId = data.groupId;
302
- chat4appMessage.data.dateHour = data.dateHour;
303
- chat4appMessage.data.type = data.type;
304
- let datTmp = new Map();
305
- for (let key in data) {
306
- datTmp.set(key, data[key]);
307
- }
308
- chat4appMessage.data.all = datTmp;
309
- chatCallback.onRead(chat4appMessage);
310
- }
311
- else if (data.type == "startTyping" || data.type == "stopTyping") {
312
- let chat4appMessage = new Chat4AppMessageReceive();
313
- chat4appMessage.data.chatId = data.chatId;
314
- chat4appMessage.data.chatMessageId = data.chatMessageId;
315
- chat4appMessage.data.externalId = data.externalId;
316
- chat4appMessage.data.fromId = data.fromId;
317
- chat4appMessage.data.toId = data.toId;
318
- chat4appMessage.data.groupId = data.groupId;
319
- chat4appMessage.data.dateHour = data.dateHour;
320
- chat4appMessage.data.type = data.type;
321
- let datTmp = new Map();
322
- for (let key in data) {
323
- datTmp.set(key, data[key]);
324
- }
325
- chat4appMessage.data.all = datTmp;
326
- chatCallback.onStartStopTyping(chat4appMessage);
327
- }
328
- else if (data.type == "new_user") {
329
- let chat4appMessage = new Chat4AppMessageReceive();
330
- chat4appMessage.data.chatId = data.chatId;
331
- chat4appMessage.data.chatMessageId = data.chatMessageId;
332
- chat4appMessage.data.externalId = data.externalId;
333
- chat4appMessage.data.fromId = data.fromId;
334
- chat4appMessage.data.toId = data.toId;
335
- chat4appMessage.data.groupId = data.groupId;
336
- chat4appMessage.data.dateHour = data.dateHour;
337
- chat4appMessage.data.type = data.type;
338
- let datTmp = new Map();
339
- for (let key in data) {
340
- datTmp.set(key, data[key]);
341
- }
342
- chat4appMessage.data.all = datTmp;
343
- chatCallback.onNewUser(chat4appMessage);
344
- }
345
- else if (data.type == "remove_user") {
346
- let chat4appMessage = new Chat4AppMessageReceive();
347
- chat4appMessage.data.chatId = data.chatId;
348
- chat4appMessage.data.chatMessageId = data.chatMessageId;
349
- chat4appMessage.data.externalId = data.externalId;
350
- chat4appMessage.data.fromId = data.fromId;
351
- chat4appMessage.data.toId = data.toId;
352
- chat4appMessage.data.groupId = data.groupId;
353
- chat4appMessage.data.dateHour = data.dateHour;
354
- chat4appMessage.data.type = data.type;
355
- let datTmp = new Map();
356
- for (let key in data) {
357
- datTmp.set(key, data[key]);
358
- }
359
- chat4appMessage.data.all = datTmp;
360
- chatCallback.onRemoveUser(chat4appMessage);
361
- }
362
- else if (data.type == "chat_closed") {
363
- let chat4appMessage = new Chat4AppMessageReceive();
364
- chat4appMessage.data.chatId = data.chatId;
365
- chat4appMessage.data.chatMessageId = data.chatMessageId;
366
- chat4appMessage.data.externalId = data.externalId;
367
- chat4appMessage.data.fromId = data.fromId;
368
- chat4appMessage.data.toId = data.toId;
369
- chat4appMessage.data.groupId = data.groupId;
370
- chat4appMessage.data.dateHour = data.dateHour;
371
- chat4appMessage.data.type = data.type;
372
- let datTmp = new Map();
373
- for (let key in data) {
374
- datTmp.set(key, data[key]);
375
- }
376
- chat4appMessage.data.all = datTmp;
377
- chatCallback.onChatClosed(chat4appMessage);
378
- }
379
- }
380
- connectWebsocket(chatCallback, token) {
381
- this.disconnect();
382
- let securityToken = this.getBearerToken();
383
- this.sock = new SockJS(this.chatServer + '/stomp/gkz-stomp-endpoint?token=' + securityToken);
384
- this.stompClient = Stomp.over(this.sock);
385
- const that = this;
386
- this.stompClient.debug = function (msg) {
387
- if (this.debug) {
388
- console.log(msg);
389
- }
390
- };
391
- let tokenAuth = "";
392
- if (securityToken && securityToken.startsWith("Bearer ")) {
393
- tokenAuth = securityToken;
394
- }
395
- else {
396
- tokenAuth = "Bearer " + securityToken;
397
- }
398
- this.stompClient.connect({ "X-Authorization": tokenAuth }, (frame) => {
399
- //console.log(frame);
400
- that.timeoutReconnect = 500;
401
- this.stompClient.subscribe('/queue/' + token, (msg) => {
402
- //console.log('mensagem', msg);
403
- if (msg.command == "MESSAGE") {
404
- //console.log(msg)
405
- if (!chatCallback.isTokenFirebaseActive()) {
406
- let msgObj = JSON.parse(msg.body);
407
- let datTmp = new Map();
408
- for (let key in msgObj.data) {
409
- datTmp.set(key, msgObj.data[key]);
410
- }
411
- msgObj.data.all = datTmp;
412
- if (msgObj.data.type == "msg") {
413
- chatCallback.onMessage(msgObj);
414
- }
415
- else if ((msgObj.data.type == "on" || msgObj.data.type == "off")) {
416
- chatCallback.onOffline(msgObj);
417
- }
418
- else if (msgObj.data.type == "read") {
419
- chatCallback.onRead(msgObj);
420
- }
421
- else if (msgObj.data.type == "startTyping" || msgObj.data.type == "stopTyping") {
422
- chatCallback.onStartStopTyping(msgObj);
423
- }
424
- else if (msgObj.data.type == "new_user") {
425
- chatCallback.onNewUser(msgObj);
426
- }
427
- else if (msgObj.data.type == "remove_user") {
428
- chatCallback.onRemoveUser(msgObj);
429
- }
430
- else if (msgObj.data.type == "chat_closed") {
431
- chatCallback.onChatClosed(msgObj);
432
- }
433
- }
434
- //callback(msg.body);
435
- // ichatcallback.forEach((iChat)=>{
436
- // iChat.onMessage(JSON.parse(msg.body) );
437
- // });
438
- }
439
- });
440
- }, (message) => {
441
- // check message for disconnect
442
- //console.log("Disconnect");
443
- setTimeout(() => {
444
- that.timeoutReconnect *= 100;
445
- this.connectWebsocket(chatCallback, token);
446
- }, that.timeoutReconnect);
447
- });
448
- }
449
- disconnect() {
450
- // console.log("disconnect")
451
- try {
452
- if (this.stompClient) {
453
- this.stompClient.disconnect();
454
- }
455
- }
456
- catch (e) {
457
- console.log(e);
458
- }
459
- }
460
- convertChat4AppMessageReceiveToChatMessage4App(msg) {
461
- var _a;
462
- let message = new ChatMessage4App();
463
- message.body = (_a = msg === null || msg === void 0 ? void 0 : msg.notification) === null || _a === void 0 ? void 0 : _a.body;
464
- message.chatId = msg.data.chatId;
465
- message.fromId = msg.data.fromId;
466
- message.toId = msg.data.toId;
467
- message.groupId = msg.data.groupId;
468
- if (msg.data.dateHour && msg.data.dateHour.length > 0) {
469
- message.dateHourIncluded = msg.data.dateHour.substring(6, 10) + "-"
470
- + msg.data.dateHour.substring(3, 5) + "-"
471
- + msg.data.dateHour.substring(0, 2)
472
- + msg.data.dateHour.substring(10);
473
- }
474
- message.id = msg.data.chatMessageId;
475
- if (msg.data.fileId && msg.data.fileId.length > 0) {
476
- let messageFile = new ChatMessageFile4App();
477
- messageFile.id = msg.data.fileId;
478
- messageFile.name = msg.data.fileName;
479
- messageFile.size = msg.data.fileSize;
480
- messageFile.type = msg.data.fileType;
481
- message.chatMessageFile = messageFile;
482
- }
483
- if (msg.data.vFileId && msg.data.vFileId.length > 0) {
484
- let messageFile = new ChatMessageFile4App();
485
- messageFile.id = msg.data.vFileId;
486
- messageFile.name = msg.data.vFileName;
487
- messageFile.size = msg.data.vFileSize;
488
- messageFile.type = msg.data.vFileType;
489
- message.chatVoiceFile = messageFile;
490
- }
491
- return message;
492
- }
493
- }
494
- Chat4appClientAngularService.ɵprov = i0.ɵɵdefineInjectable({ factory: function Chat4appClientAngularService_Factory() { return new Chat4appClientAngularService(i0.ɵɵinject(i1.HttpClient)); }, token: Chat4appClientAngularService, providedIn: "root" });
495
- Chat4appClientAngularService.decorators = [
496
- { type: Injectable, args: [{
497
- providedIn: 'root'
498
- },] }
499
- ];
500
- Chat4appClientAngularService.ctorParameters = () => [
501
- { type: HttpClient }
502
- ];
503
- class Chat4App {
504
- }
505
- class ChatUser4App {
506
- }
507
- class ChatMessage4App {
508
- }
509
- class ChatMessageFile4App {
510
- }
511
- class ChatMessageMeta4App {
512
- }
513
- class Chat4AppMessageReceive {
514
- constructor() {
515
- this.data = new Chat4AppMessageReceiveData();
516
- this.notification = new Chat4AppMessageReceiveNotification();
517
- }
518
- }
519
- class Chat4AppMessageReceiveData {
520
- }
521
- class Chat4AppMessageReceiveNotification {
522
- }
523
- class ChatUserResponse4App {
524
- }
525
- class ChatFilterRequest4App {
526
- }
527
- class Chat4AppConfig {
528
- constructor(endpoint, debug) {
529
- this.endpoint = endpoint;
530
- this.debug = debug;
531
- }
532
- }
533
- class Chat4AppTranslate {
534
- }
535
- var ChatStatus4App;
536
- (function (ChatStatus4App) {
537
- ChatStatus4App["CREATED"] = "CREATED";
538
- ChatStatus4App["CLOSED"] = "CLOSED";
539
- })(ChatStatus4App || (ChatStatus4App = {}));
540
- var ChatUserStatus4App;
541
- (function (ChatUserStatus4App) {
542
- ChatUserStatus4App["REMOVED"] = "REMOVED";
543
- })(ChatUserStatus4App || (ChatUserStatus4App = {}));
544
- var ChatFilterType;
545
- (function (ChatFilterType) {
546
- ChatFilterType[ChatFilterType["COUNT_NOT_READ"] = 1] = "COUNT_NOT_READ";
547
- ChatFilterType[ChatFilterType["LAST_MESSAGE"] = 2] = "LAST_MESSAGE";
8
+ class Chat4appClientAngularService {
9
+ constructor(http) {
10
+ this.http = http;
11
+ this.chatServer = "";
12
+ this.chatUrl = "";
13
+ this.debug = false;
14
+ this.timeoutReconnect = 500;
15
+ }
16
+ ngOnInit() {
17
+ }
18
+ config(chat4AppConfig) {
19
+ this.chatServer = chat4AppConfig.endpoint;
20
+ this.chatUrl = chat4AppConfig.endpoint + "/api/v1/";
21
+ this.debug = chat4AppConfig.debug;
22
+ }
23
+ init(securityChatToken, callback, chatCallback, connectionClientId) {
24
+ if (!this.chatServer || this.chatServer.trim().length == 0) {
25
+ throw new Error("Endpoint is empty");
26
+ }
27
+ if (!securityChatToken || securityChatToken.trim().length == 0) {
28
+ throw new Error("SecurityChatToken is empty");
29
+ }
30
+ this.setTokenChat4app(securityChatToken);
31
+ if (chatCallback && connectionClientId) {
32
+ this.connectWebsocket(chatCallback, connectionClientId);
33
+ }
34
+ callback(securityChatToken);
35
+ }
36
+ getChatUrlDownload(messageFileId) {
37
+ return this.chatUrl + "chatmessage/getFile?messageFileId=" + messageFileId + "&token=" + this.getBearerToken();
38
+ }
39
+ getMessageChat(chatId, fromId, toId) {
40
+ let url = this.chatUrl + "chatmessage/" + chatId + "/" + fromId + "/" + toId;
41
+ return this.http.get(url, {
42
+ headers: new HttpHeaders().set('Authorization', this.getBearerToken())
43
+ });
44
+ }
45
+ getMessageChatByGrop(chatId, groupId, fromId) {
46
+ let url = this.chatUrl + "chatmessage/byGroup/" + chatId + "/" + groupId + "/" + fromId;
47
+ return this.http.get(url, {
48
+ headers: new HttpHeaders().set('Authorization', this.getBearerToken())
49
+ });
50
+ }
51
+ addMessageChat(chatMessage4App) {
52
+ let url = this.chatUrl + "chatmessage/" + chatMessage4App.chatId;
53
+ return this.http.post(url, chatMessage4App, {
54
+ headers: new HttpHeaders().set('Authorization', this.getBearerToken())
55
+ });
56
+ }
57
+ props(chatFilterRequest4App) {
58
+ let url = this.chatUrl + "chatmessage/props";
59
+ return this.http.post(url, chatFilterRequest4App, {
60
+ headers: new HttpHeaders().set('Authorization', this.getBearerToken())
61
+ });
62
+ }
63
+ removeUsersChat(chatId, chatUsersId, chatUsersExternalId) {
64
+ let params = new Array();
65
+ if (chatUsersId && chatUsersId.length > 0) {
66
+ chatUsersId.forEach(cui => {
67
+ params.push("chatUserId=" + cui);
68
+ });
69
+ }
70
+ else if (chatUsersExternalId && chatUsersExternalId.length > 0) {
71
+ chatUsersExternalId.forEach(cuei => {
72
+ params.push("chatUserExternalId=" + cuei);
73
+ });
74
+ }
75
+ let url = this.chatUrl + "chatuser/" + chatId + "?" + params.join("&");
76
+ return this.http.delete(url, {
77
+ headers: new HttpHeaders().set('Authorization', this.getBearerToken())
78
+ });
79
+ }
80
+ removeUserChat(chatId, chatUserId, chatUserExternalId) {
81
+ let param = "";
82
+ if (chatUserId) {
83
+ param = "chatUserId=" + chatUserId;
84
+ }
85
+ else {
86
+ param = "chatUserExternalId=" + chatUserExternalId;
87
+ }
88
+ let url = this.chatUrl + "chatuser/" + chatId + "?" + param;
89
+ return this.http.delete(url, {
90
+ headers: new HttpHeaders().set('Authorization', this.getBearerToken())
91
+ });
92
+ }
93
+ updateUserChat(chatId, charUser4AppUpdate) {
94
+ let url = this.chatUrl + "chatuser/" + chatId;
95
+ return this.http.put(url, charUser4AppUpdate, {
96
+ headers: new HttpHeaders().set('Authorization', this.getBearerToken())
97
+ });
98
+ }
99
+ createUserChat(chatId, chatUser4App) {
100
+ let url = this.chatUrl + "chatuser/" + chatId;
101
+ return this.http.post(url, chatUser4App, {
102
+ headers: new HttpHeaders().set('Authorization', this.getBearerToken())
103
+ });
104
+ }
105
+ createUsersChat(chatId, chatUser4App) {
106
+ let url = this.chatUrl + "chatuser/users/" + chatId;
107
+ return this.http.post(url, chatUser4App, {
108
+ headers: new HttpHeaders().set('Authorization', this.getBearerToken())
109
+ });
110
+ }
111
+ createChat(chat4app) {
112
+ let url = this.chatUrl + "chat";
113
+ return this.http.post(url, chat4app, {
114
+ headers: new HttpHeaders().set('Authorization', this.getBearerToken())
115
+ });
116
+ }
117
+ createUpdateChat(chat4app) {
118
+ let url = this.chatUrl + "chat";
119
+ return this.http.put(url, chat4app, {
120
+ headers: new HttpHeaders().set('Authorization', this.getBearerToken())
121
+ });
122
+ }
123
+ getLastMessageGroup(chatExternalId, groupId) {
124
+ let url = this.chatUrl + "chatmessage/lastMessageGroup?chatExternalId=" + chatExternalId + "&groupId=" + groupId;
125
+ return this.http.get(url, {
126
+ headers: new HttpHeaders().set('Authorization', this.getBearerToken())
127
+ });
128
+ }
129
+ getLastMessage(chatExternalId, chatUserExternalId) {
130
+ let url = this.chatUrl + "chatmessage/lastMessage?chatExternalId=" + chatExternalId + "&chatUserExternalId=" + chatUserExternalId;
131
+ return this.http.get(url, {
132
+ headers: new HttpHeaders().set('Authorization', this.getBearerToken())
133
+ });
134
+ }
135
+ countNotReadMessages(chatUserExternalId, chatExternalId, groupId) {
136
+ let url = this.chatUrl + "chatmessage/countNotReadMessages?chatUserExternalId=" + chatUserExternalId;
137
+ if (chatExternalId && chatExternalId.length > 0) {
138
+ url += "&chatExternalId=" + chatExternalId;
139
+ }
140
+ if (groupId && groupId.length > 0) {
141
+ url += "&groupId=" + groupId;
142
+ }
143
+ return this.http.get(url, {
144
+ headers: new HttpHeaders().set('Authorization', this.getBearerToken())
145
+ });
146
+ }
147
+ getChatByExternalId(externalId) {
148
+ let url = this.chatUrl + "chat?externalId=" + externalId;
149
+ return this.http.get(url, {
150
+ headers: new HttpHeaders().set('Authorization', this.getBearerToken())
151
+ });
152
+ }
153
+ getChatById(id) {
154
+ let url = this.chatUrl + "chat?chatId=" + id;
155
+ return this.http.get(url, {
156
+ headers: new HttpHeaders().set('Authorization', this.getBearerToken())
157
+ });
158
+ }
159
+ listChatByUser(externalUserId, userId, chatStatus) {
160
+ let url = this.chatUrl + "chat/listChatByUser/?externalUserId=" + externalUserId
161
+ + "&userId=" + userId
162
+ + "&chatStatus=" + chatStatus;
163
+ return this.http.get(url, {
164
+ headers: new HttpHeaders().set('Authorization', this.getBearerToken())
165
+ });
166
+ }
167
+ closeChat(chatId, chatExternalId) {
168
+ let url = this.chatUrl;
169
+ if (chatId && chatId.length > 0) {
170
+ url += "chat?chatId=" + chatId;
171
+ }
172
+ if (chatExternalId && chatExternalId.length > 0) {
173
+ url += "chat?externalId=" + chatExternalId;
174
+ }
175
+ return this.http.delete(url, {
176
+ headers: new HttpHeaders().set('Authorization', this.getBearerToken())
177
+ });
178
+ }
179
+ readMessage(chatMessageId, toId) {
180
+ let url = this.chatUrl + "chatmessage/read/" + chatMessageId;
181
+ if (toId && toId.length > 0) {
182
+ url += "/" + toId;
183
+ }
184
+ return this.http.put(url, null, {
185
+ headers: new HttpHeaders().set('Authorization', this.getBearerToken())
186
+ });
187
+ }
188
+ online(chatId) {
189
+ let url = this.chatUrl + "chatmessage/online/" + chatId;
190
+ return this.http.get(url, {
191
+ headers: new HttpHeaders().set('Authorization', this.getBearerToken())
192
+ });
193
+ }
194
+ sendFile(chatId, fromId, toId, fileToUpload) {
195
+ const endpoint = this.chatUrl + "chatmessage/sendFile/" + chatId + "/" + fromId + "/" + toId;
196
+ const formData = new FormData();
197
+ formData.append('file', fileToUpload);
198
+ return this.http
199
+ .post(endpoint, formData, {
200
+ headers: new HttpHeaders().set('Authorization', this.getBearerToken())
201
+ });
202
+ }
203
+ sendFileGroup(chatId, fromId, groupId, fileToUpload) {
204
+ const endpoint = this.chatUrl + "chatmessage/sendFileGroup/" + chatId + "/" + fromId + "/" + groupId;
205
+ const formData = new FormData();
206
+ formData.append('file', fileToUpload);
207
+ return this.http
208
+ .post(endpoint, formData, {
209
+ headers: new HttpHeaders().set('Authorization', this.getBearerToken())
210
+ });
211
+ }
212
+ translateMessage(chatMessageId, languageTarget) {
213
+ let url = this.chatUrl + "chatmessage/translate/" + chatMessageId + "/" + languageTarget;
214
+ return this.http.get(url, {
215
+ headers: new HttpHeaders().set('Authorization', this.getBearerToken())
216
+ });
217
+ }
218
+ startTyping(chatId, fromId, toId) {
219
+ let url = this.chatUrl + "chatmessage/startTyping/" + chatId + "/" + fromId + "/" + toId;
220
+ return this.http.put(url, null, {
221
+ headers: new HttpHeaders().set('Authorization', this.getBearerToken())
222
+ });
223
+ }
224
+ startTypingGroup(chatId, fromId, groupId) {
225
+ let url = this.chatUrl + "chatmessage/startTypingGroup/" + chatId + "/" + fromId + "/" + groupId;
226
+ return this.http.put(url, null, {
227
+ headers: new HttpHeaders().set('Authorization', this.getBearerToken())
228
+ });
229
+ }
230
+ stopTyping(chatId, fromId, toId) {
231
+ let url = this.chatUrl + "chatmessage/stopTyping/" + chatId + "/" + fromId + "/" + toId;
232
+ return this.http.put(url, null, {
233
+ headers: new HttpHeaders().set('Authorization', this.getBearerToken())
234
+ });
235
+ }
236
+ stopTypingGroup(chatId, fromId, groupId) {
237
+ let url = this.chatUrl + "chatmessage/stopTypingGroup/" + chatId + "/" + fromId + "/" + groupId;
238
+ return this.http.put(url, null, {
239
+ headers: new HttpHeaders().set('Authorization', this.getBearerToken())
240
+ });
241
+ }
242
+ /* Token */
243
+ getBearerToken() {
244
+ let ret = "Bearer " + window.sessionStorage.getItem("chat4AppSessionToken");
245
+ return ret;
246
+ }
247
+ setTokenChat4app(chat4AppSessionToken) {
248
+ window.sessionStorage.setItem("chat4AppSessionToken", chat4AppSessionToken);
249
+ }
250
+ /* Connection */
251
+ onMessageFirebaseReceived(data, chatCallback) {
252
+ //alert("onMessageReceived connectFirebase");
253
+ if (data.type == "msg") {
254
+ let chat4appMessage = new Chat4AppMessageReceive();
255
+ chat4appMessage.data.chatId = data.chatId;
256
+ chat4appMessage.data.chatMessageId = data.chatMessageId;
257
+ chat4appMessage.data.externalId = data.externalId;
258
+ chat4appMessage.data.fromId = data.fromId;
259
+ chat4appMessage.data.toId = data.toId;
260
+ chat4appMessage.data.groupId = data.groupId;
261
+ chat4appMessage.data.dateHour = data.dateHour;
262
+ chat4appMessage.data.type = data.type;
263
+ chat4appMessage.notification.body = data.body;
264
+ if (data.fileId && data.fileId.length > 0) {
265
+ chat4appMessage.data.fileId = data.fileId;
266
+ chat4appMessage.data.fileName = data.fileName;
267
+ chat4appMessage.data.fileSize = data.fileSize;
268
+ chat4appMessage.data.fileType = data.fileType;
269
+ }
270
+ let datTmp = new Map();
271
+ for (let key in data) {
272
+ datTmp.set(key, data[key]);
273
+ }
274
+ chat4appMessage.data.all = datTmp;
275
+ chatCallback.onMessage(chat4appMessage);
276
+ }
277
+ else if ((data.type == "on" || data.type == "off")) {
278
+ let chat4appMessage = new Chat4AppMessageReceive();
279
+ chat4appMessage.data.chatId = data.chatId;
280
+ chat4appMessage.data.chatMessageId = data.chatMessageId;
281
+ chat4appMessage.data.externalId = data.externalId;
282
+ chat4appMessage.data.fromId = data.fromId;
283
+ chat4appMessage.data.toId = data.toId;
284
+ chat4appMessage.data.groupId = data.groupId;
285
+ chat4appMessage.data.dateHour = data.dateHour;
286
+ chat4appMessage.data.type = data.type;
287
+ let datTmp = new Map();
288
+ for (let key in data) {
289
+ datTmp.set(key, data[key]);
290
+ }
291
+ chat4appMessage.data.all = datTmp;
292
+ chatCallback.onOffline(chat4appMessage);
293
+ }
294
+ else if (data.type == "read") {
295
+ let chat4appMessage = new Chat4AppMessageReceive();
296
+ chat4appMessage.data.chatId = data.chatId;
297
+ chat4appMessage.data.chatMessageId = data.chatMessageId;
298
+ chat4appMessage.data.externalId = data.externalId;
299
+ chat4appMessage.data.fromId = data.fromId;
300
+ chat4appMessage.data.toId = data.toId;
301
+ chat4appMessage.data.groupId = data.groupId;
302
+ chat4appMessage.data.dateHour = data.dateHour;
303
+ chat4appMessage.data.type = data.type;
304
+ let datTmp = new Map();
305
+ for (let key in data) {
306
+ datTmp.set(key, data[key]);
307
+ }
308
+ chat4appMessage.data.all = datTmp;
309
+ chatCallback.onRead(chat4appMessage);
310
+ }
311
+ else if (data.type == "startTyping" || data.type == "stopTyping") {
312
+ let chat4appMessage = new Chat4AppMessageReceive();
313
+ chat4appMessage.data.chatId = data.chatId;
314
+ chat4appMessage.data.chatMessageId = data.chatMessageId;
315
+ chat4appMessage.data.externalId = data.externalId;
316
+ chat4appMessage.data.fromId = data.fromId;
317
+ chat4appMessage.data.toId = data.toId;
318
+ chat4appMessage.data.groupId = data.groupId;
319
+ chat4appMessage.data.dateHour = data.dateHour;
320
+ chat4appMessage.data.type = data.type;
321
+ let datTmp = new Map();
322
+ for (let key in data) {
323
+ datTmp.set(key, data[key]);
324
+ }
325
+ chat4appMessage.data.all = datTmp;
326
+ chatCallback.onStartStopTyping(chat4appMessage);
327
+ }
328
+ else if (data.type == "new_user") {
329
+ let chat4appMessage = new Chat4AppMessageReceive();
330
+ chat4appMessage.data.chatId = data.chatId;
331
+ chat4appMessage.data.chatMessageId = data.chatMessageId;
332
+ chat4appMessage.data.externalId = data.externalId;
333
+ chat4appMessage.data.fromId = data.fromId;
334
+ chat4appMessage.data.toId = data.toId;
335
+ chat4appMessage.data.groupId = data.groupId;
336
+ chat4appMessage.data.dateHour = data.dateHour;
337
+ chat4appMessage.data.type = data.type;
338
+ let datTmp = new Map();
339
+ for (let key in data) {
340
+ datTmp.set(key, data[key]);
341
+ }
342
+ chat4appMessage.data.all = datTmp;
343
+ chatCallback.onNewUser(chat4appMessage);
344
+ }
345
+ else if (data.type == "remove_user") {
346
+ let chat4appMessage = new Chat4AppMessageReceive();
347
+ chat4appMessage.data.chatId = data.chatId;
348
+ chat4appMessage.data.chatMessageId = data.chatMessageId;
349
+ chat4appMessage.data.externalId = data.externalId;
350
+ chat4appMessage.data.fromId = data.fromId;
351
+ chat4appMessage.data.toId = data.toId;
352
+ chat4appMessage.data.groupId = data.groupId;
353
+ chat4appMessage.data.dateHour = data.dateHour;
354
+ chat4appMessage.data.type = data.type;
355
+ let datTmp = new Map();
356
+ for (let key in data) {
357
+ datTmp.set(key, data[key]);
358
+ }
359
+ chat4appMessage.data.all = datTmp;
360
+ chatCallback.onRemoveUser(chat4appMessage);
361
+ }
362
+ else if (data.type == "chat_closed") {
363
+ let chat4appMessage = new Chat4AppMessageReceive();
364
+ chat4appMessage.data.chatId = data.chatId;
365
+ chat4appMessage.data.chatMessageId = data.chatMessageId;
366
+ chat4appMessage.data.externalId = data.externalId;
367
+ chat4appMessage.data.fromId = data.fromId;
368
+ chat4appMessage.data.toId = data.toId;
369
+ chat4appMessage.data.groupId = data.groupId;
370
+ chat4appMessage.data.dateHour = data.dateHour;
371
+ chat4appMessage.data.type = data.type;
372
+ let datTmp = new Map();
373
+ for (let key in data) {
374
+ datTmp.set(key, data[key]);
375
+ }
376
+ chat4appMessage.data.all = datTmp;
377
+ chatCallback.onChatClosed(chat4appMessage);
378
+ }
379
+ }
380
+ connectWebsocket(chatCallback, token) {
381
+ this.disconnect();
382
+ let securityToken = this.getBearerToken();
383
+ this.sock = new SockJS(this.chatServer + '/stomp/gkz-stomp-endpoint?token=' + securityToken);
384
+ this.stompClient = Stomp.over(this.sock);
385
+ const that = this;
386
+ this.stompClient.debug = function (msg) {
387
+ if (this.debug) {
388
+ console.log(msg);
389
+ }
390
+ };
391
+ let tokenAuth = "";
392
+ if (securityToken && securityToken.startsWith("Bearer ")) {
393
+ tokenAuth = securityToken;
394
+ }
395
+ else {
396
+ tokenAuth = "Bearer " + securityToken;
397
+ }
398
+ this.stompClient.connect({ "X-Authorization": tokenAuth }, (frame) => {
399
+ //console.log(frame);
400
+ that.timeoutReconnect = 500;
401
+ this.stompClient.subscribe('/queue/' + token, (msg) => {
402
+ //console.log('mensagem', msg);
403
+ if (msg.command == "MESSAGE") {
404
+ //console.log(msg)
405
+ if (!chatCallback.isTokenFirebaseActive()) {
406
+ let msgObj = JSON.parse(msg.body);
407
+ let datTmp = new Map();
408
+ for (let key in msgObj.data) {
409
+ datTmp.set(key, msgObj.data[key]);
410
+ }
411
+ msgObj.data.all = datTmp;
412
+ if (msgObj.data.type == "msg") {
413
+ chatCallback.onMessage(msgObj);
414
+ }
415
+ else if ((msgObj.data.type == "on" || msgObj.data.type == "off")) {
416
+ chatCallback.onOffline(msgObj);
417
+ }
418
+ else if (msgObj.data.type == "read") {
419
+ chatCallback.onRead(msgObj);
420
+ }
421
+ else if (msgObj.data.type == "startTyping" || msgObj.data.type == "stopTyping") {
422
+ chatCallback.onStartStopTyping(msgObj);
423
+ }
424
+ else if (msgObj.data.type == "new_user") {
425
+ chatCallback.onNewUser(msgObj);
426
+ }
427
+ else if (msgObj.data.type == "remove_user") {
428
+ chatCallback.onRemoveUser(msgObj);
429
+ }
430
+ else if (msgObj.data.type == "chat_closed") {
431
+ chatCallback.onChatClosed(msgObj);
432
+ }
433
+ }
434
+ //callback(msg.body);
435
+ // ichatcallback.forEach((iChat)=>{
436
+ // iChat.onMessage(JSON.parse(msg.body) );
437
+ // });
438
+ }
439
+ });
440
+ }, (message) => {
441
+ // check message for disconnect
442
+ //console.log("Disconnect");
443
+ setTimeout(() => {
444
+ that.timeoutReconnect *= 100;
445
+ this.connectWebsocket(chatCallback, token);
446
+ }, that.timeoutReconnect);
447
+ });
448
+ }
449
+ disconnect() {
450
+ // console.log("disconnect")
451
+ try {
452
+ if (this.stompClient) {
453
+ this.stompClient.disconnect();
454
+ }
455
+ }
456
+ catch (e) {
457
+ console.log(e);
458
+ }
459
+ }
460
+ convertChat4AppMessageReceiveToChatMessage4App(msg) {
461
+ var _a;
462
+ let message = new ChatMessage4App();
463
+ message.body = (_a = msg === null || msg === void 0 ? void 0 : msg.notification) === null || _a === void 0 ? void 0 : _a.body;
464
+ message.chatId = msg.data.chatId;
465
+ message.fromId = msg.data.fromId;
466
+ message.toId = msg.data.toId;
467
+ message.groupId = msg.data.groupId;
468
+ message.replyFrom = msg.data.replyFrom;
469
+ if (msg.data.dateHour && msg.data.dateHour.length > 0) {
470
+ message.dateHourIncluded = msg.data.dateHour.substring(6, 10) + "-"
471
+ + msg.data.dateHour.substring(3, 5) + "-"
472
+ + msg.data.dateHour.substring(0, 2)
473
+ + msg.data.dateHour.substring(10);
474
+ }
475
+ message.id = msg.data.chatMessageId;
476
+ if (msg.data.fileId && msg.data.fileId.length > 0) {
477
+ let messageFile = new ChatMessageFile4App();
478
+ messageFile.id = msg.data.fileId;
479
+ messageFile.name = msg.data.fileName;
480
+ messageFile.size = msg.data.fileSize;
481
+ messageFile.type = msg.data.fileType;
482
+ message.chatMessageFile = messageFile;
483
+ }
484
+ if (msg.data.vFileId && msg.data.vFileId.length > 0) {
485
+ let messageFile = new ChatMessageFile4App();
486
+ messageFile.id = msg.data.vFileId;
487
+ messageFile.name = msg.data.vFileName;
488
+ messageFile.size = msg.data.vFileSize;
489
+ messageFile.type = msg.data.vFileType;
490
+ message.chatVoiceFile = messageFile;
491
+ }
492
+ return message;
493
+ }
494
+ }
495
+ Chat4appClientAngularService.ɵprov = i0.ɵɵdefineInjectable({ factory: function Chat4appClientAngularService_Factory() { return new Chat4appClientAngularService(i0.ɵɵinject(i1.HttpClient)); }, token: Chat4appClientAngularService, providedIn: "root" });
496
+ Chat4appClientAngularService.decorators = [
497
+ { type: Injectable, args: [{
498
+ providedIn: 'root'
499
+ },] }
500
+ ];
501
+ Chat4appClientAngularService.ctorParameters = () => [
502
+ { type: HttpClient }
503
+ ];
504
+ class Chat4App {
505
+ }
506
+ class ChatUser4App {
507
+ }
508
+ class ChatMessage4App {
509
+ }
510
+ class ChatMessageFile4App {
511
+ }
512
+ class ChatMessageMeta4App {
513
+ }
514
+ class Chat4AppMessageReceive {
515
+ constructor() {
516
+ this.data = new Chat4AppMessageReceiveData();
517
+ this.notification = new Chat4AppMessageReceiveNotification();
518
+ }
519
+ }
520
+ class Chat4AppMessageReceiveData {
521
+ }
522
+ class Chat4AppMessageReceiveNotification {
523
+ }
524
+ class ChatUserResponse4App {
525
+ }
526
+ class ChatFilterRequest4App {
527
+ }
528
+ class Chat4AppConfig {
529
+ constructor(endpoint, debug) {
530
+ this.endpoint = endpoint;
531
+ this.debug = debug;
532
+ }
533
+ }
534
+ class Chat4AppTranslate {
535
+ }
536
+ var ChatStatus4App;
537
+ (function (ChatStatus4App) {
538
+ ChatStatus4App["CREATED"] = "CREATED";
539
+ ChatStatus4App["CLOSED"] = "CLOSED";
540
+ })(ChatStatus4App || (ChatStatus4App = {}));
541
+ var ChatUserStatus4App;
542
+ (function (ChatUserStatus4App) {
543
+ ChatUserStatus4App["REMOVED"] = "REMOVED";
544
+ })(ChatUserStatus4App || (ChatUserStatus4App = {}));
545
+ var ChatFilterType;
546
+ (function (ChatFilterType) {
547
+ ChatFilterType[ChatFilterType["COUNT_NOT_READ"] = 1] = "COUNT_NOT_READ";
548
+ ChatFilterType[ChatFilterType["LAST_MESSAGE"] = 2] = "LAST_MESSAGE";
548
549
  })(ChatFilterType || (ChatFilterType = {}));
549
550
 
550
- class Chat4appClientAngularComponent {
551
- constructor() { }
552
- ngOnInit() {
553
- }
554
- }
555
- Chat4appClientAngularComponent.decorators = [
556
- { type: Component, args: [{
557
- selector: 'lib-chat4app-client-angular',
558
- template: `
559
- <p>
560
- chat4app-client-angular works!
561
- </p>
562
- `
563
- },] }
564
- ];
551
+ class Chat4appClientAngularComponent {
552
+ constructor() { }
553
+ ngOnInit() {
554
+ }
555
+ }
556
+ Chat4appClientAngularComponent.decorators = [
557
+ { type: Component, args: [{
558
+ selector: 'lib-chat4app-client-angular',
559
+ template: `
560
+ <p>
561
+ chat4app-client-angular works!
562
+ </p>
563
+ `
564
+ },] }
565
+ ];
565
566
  Chat4appClientAngularComponent.ctorParameters = () => [];
566
567
 
567
- class Chat4appClientAngularModule {
568
- }
569
- Chat4appClientAngularModule.decorators = [
570
- { type: NgModule, args: [{
571
- declarations: [Chat4appClientAngularComponent],
572
- imports: [],
573
- exports: [Chat4appClientAngularComponent]
574
- },] }
568
+ class Chat4appClientAngularModule {
569
+ }
570
+ Chat4appClientAngularModule.decorators = [
571
+ { type: NgModule, args: [{
572
+ declarations: [Chat4appClientAngularComponent],
573
+ imports: [],
574
+ exports: [Chat4appClientAngularComponent]
575
+ },] }
575
576
  ];
576
577
 
577
- /*
578
- * Public API Surface of chat4app-client-angular
578
+ /*
579
+ * Public API Surface of chat4app-client-angular
579
580
  */
580
581
 
581
- /**
582
- * Generated bundle index. Do not edit.
582
+ /**
583
+ * Generated bundle index. Do not edit.
583
584
  */
584
585
 
585
586
  export { Chat4App, Chat4AppConfig, Chat4AppMessageReceive, Chat4AppMessageReceiveData, Chat4AppMessageReceiveNotification, Chat4AppTranslate, Chat4appClientAngularComponent, Chat4appClientAngularModule, Chat4appClientAngularService, ChatFilterRequest4App, ChatFilterType, ChatMessage4App, ChatMessageFile4App, ChatMessageMeta4App, ChatStatus4App, ChatUser4App, ChatUserResponse4App, ChatUserStatus4App };