chat4app-client-angular 0.0.34 → 0.0.35
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 +24 -24
- package/bundles/chat4app-client-angular.umd.js +649 -649
- package/bundles/chat4app-client-angular.umd.js.map +1 -1
- package/bundles/chat4app-client-angular.umd.min.js.map +1 -1
- package/chat4app-client-angular.d.ts +4 -4
- package/esm2015/chat4app-client-angular.js +4 -4
- package/esm2015/lib/chat4app-client-angular.component.js +18 -18
- package/esm2015/lib/chat4app-client-angular.module.js +12 -12
- package/esm2015/lib/chat4app-client-angular.service.js +592 -592
- package/esm2015/public-api.js +7 -7
- package/fesm2015/chat4app-client-angular.js +611 -611
- package/fesm2015/chat4app-client-angular.js.map +1 -1
- package/lib/chat4app-client-angular.component.d.ts +5 -5
- package/lib/chat4app-client-angular.module.d.ts +2 -2
- package/lib/chat4app-client-angular.service.d.ts +192 -191
- package/lib/chat4app-client-angular.service.d.ts.map +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +3 -3
|
@@ -5,625 +5,625 @@ 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, fromId) {
|
|
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
|
-
if (fromId && fromId.length > 0) {
|
|
144
|
-
url += "&fromId=" + groupId;
|
|
145
|
-
}
|
|
146
|
-
return this.http.get(url, {
|
|
147
|
-
headers: new HttpHeaders().set('Authorization', this.getBearerToken())
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
getChatByExternalId(externalId) {
|
|
151
|
-
let url = this.chatUrl + "chat?externalId=" + externalId;
|
|
152
|
-
return this.http.get(url, {
|
|
153
|
-
headers: new HttpHeaders().set('Authorization', this.getBearerToken())
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
getChatById(id) {
|
|
157
|
-
let url = this.chatUrl + "chat?chatId=" + id;
|
|
158
|
-
return this.http.get(url, {
|
|
159
|
-
headers: new HttpHeaders().set('Authorization', this.getBearerToken())
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
listChatByUser(externalUserId, userId, chatStatus) {
|
|
163
|
-
let url = this.chatUrl + "chat/listChatByUser/?externalUserId=" + externalUserId
|
|
164
|
-
+ "&userId=" + userId
|
|
165
|
-
+ "&chatStatus=" + chatStatus;
|
|
166
|
-
return this.http.get(url, {
|
|
167
|
-
headers: new HttpHeaders().set('Authorization', this.getBearerToken())
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
closeChat(chatId, chatExternalId) {
|
|
171
|
-
let url = this.chatUrl;
|
|
172
|
-
if (chatId && chatId.length > 0) {
|
|
173
|
-
url += "chat?chatId=" + chatId;
|
|
174
|
-
}
|
|
175
|
-
if (chatExternalId && chatExternalId.length > 0) {
|
|
176
|
-
url += "chat?externalId=" + chatExternalId;
|
|
177
|
-
}
|
|
178
|
-
return this.http.delete(url, {
|
|
179
|
-
headers: new HttpHeaders().set('Authorization', this.getBearerToken())
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
readMessage(chatMessageId, toId) {
|
|
183
|
-
let url = this.chatUrl + "chatmessage/read/" + chatMessageId;
|
|
184
|
-
if (toId && toId.length > 0) {
|
|
185
|
-
url += "/" + toId;
|
|
186
|
-
}
|
|
187
|
-
return this.http.put(url, null, {
|
|
188
|
-
headers: new HttpHeaders().set('Authorization', this.getBearerToken())
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
online(chatId) {
|
|
192
|
-
let url = this.chatUrl + "chatmessage/online/" + chatId;
|
|
193
|
-
return this.http.get(url, {
|
|
194
|
-
headers: new HttpHeaders().set('Authorization', this.getBearerToken())
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
sendFile(chatId, fromId, toId, fileToUpload) {
|
|
198
|
-
const endpoint = this.chatUrl + "chatmessage/sendFile/" + chatId + "/" + fromId + "/" + toId;
|
|
199
|
-
const formData = new FormData();
|
|
200
|
-
formData.append('file', fileToUpload);
|
|
201
|
-
return this.http
|
|
202
|
-
.post(endpoint, formData, {
|
|
203
|
-
headers: new HttpHeaders().set('Authorization', this.getBearerToken())
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
sendFileGroup(chatId, fromId, groupId, fileToUpload) {
|
|
207
|
-
const endpoint = this.chatUrl + "chatmessage/sendFileGroup/" + chatId + "/" + fromId + "/" + groupId;
|
|
208
|
-
const formData = new FormData();
|
|
209
|
-
formData.append('file', fileToUpload);
|
|
210
|
-
return this.http
|
|
211
|
-
.post(endpoint, formData, {
|
|
212
|
-
headers: new HttpHeaders().set('Authorization', this.getBearerToken())
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
translateMessage(chatMessageId, languageTarget) {
|
|
216
|
-
let url = this.chatUrl + "chatmessage/translate/" + chatMessageId + "/" + languageTarget;
|
|
217
|
-
return this.http.get(url, {
|
|
218
|
-
headers: new HttpHeaders().set('Authorization', this.getBearerToken())
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
startTyping(chatId, fromId, toId) {
|
|
222
|
-
let url = this.chatUrl + "chatmessage/startTyping/" + chatId + "/" + fromId + "/" + toId;
|
|
223
|
-
return this.http.put(url, null, {
|
|
224
|
-
headers: new HttpHeaders().set('Authorization', this.getBearerToken())
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
startTypingGroup(chatId, fromId, groupId) {
|
|
228
|
-
let url = this.chatUrl + "chatmessage/startTypingGroup/" + chatId + "/" + fromId + "/" + groupId;
|
|
229
|
-
return this.http.put(url, null, {
|
|
230
|
-
headers: new HttpHeaders().set('Authorization', this.getBearerToken())
|
|
231
|
-
});
|
|
232
|
-
}
|
|
233
|
-
stopTyping(chatId, fromId, toId) {
|
|
234
|
-
let url = this.chatUrl + "chatmessage/stopTyping/" + chatId + "/" + fromId + "/" + toId;
|
|
235
|
-
return this.http.put(url, null, {
|
|
236
|
-
headers: new HttpHeaders().set('Authorization', this.getBearerToken())
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
stopTypingGroup(chatId, fromId, groupId) {
|
|
240
|
-
let url = this.chatUrl + "chatmessage/stopTypingGroup/" + chatId + "/" + fromId + "/" + groupId;
|
|
241
|
-
return this.http.put(url, null, {
|
|
242
|
-
headers: new HttpHeaders().set('Authorization', this.getBearerToken())
|
|
243
|
-
});
|
|
244
|
-
}
|
|
245
|
-
createGroup(group) {
|
|
246
|
-
let url = this.chatUrl + "/group";
|
|
247
|
-
return this.http.post(url, group, {
|
|
248
|
-
headers: new HttpHeaders().set('Authorization', this.getBearerToken())
|
|
249
|
-
});
|
|
250
|
-
}
|
|
251
|
-
getGroup(chatId, groupId) {
|
|
252
|
-
let url = this.chatUrl + "/group/" + groupId + "/" + chatId;
|
|
253
|
-
return this.http.get(url, {
|
|
254
|
-
headers: new HttpHeaders().set('Authorization', this.getBearerToken())
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
listGroups(chatId, externalId) {
|
|
258
|
-
let url = this.chatUrl + "/group/";
|
|
259
|
-
if (chatId && chatId.length > 0) {
|
|
260
|
-
url += "&chatId=" + chatId;
|
|
261
|
-
}
|
|
262
|
-
if (externalId && externalId.length > 0) {
|
|
263
|
-
url += "&externalId=" + externalId;
|
|
264
|
-
}
|
|
265
|
-
return this.http.get(url, {
|
|
266
|
-
headers: new HttpHeaders().set('Authorization', this.getBearerToken())
|
|
267
|
-
});
|
|
268
|
-
}
|
|
269
|
-
listFilesGroup(chatId, groupId) {
|
|
270
|
-
let url = this.chatUrl + "/group/" + chatId;
|
|
271
|
-
if (groupId && groupId.length > 0) {
|
|
272
|
-
url += "&groupId=" + chatId;
|
|
273
|
-
}
|
|
274
|
-
return this.http.get(url, {
|
|
275
|
-
headers: new HttpHeaders().set('Authorization', this.getBearerToken())
|
|
276
|
-
});
|
|
277
|
-
}
|
|
278
|
-
/* Token */
|
|
279
|
-
getBearerToken() {
|
|
280
|
-
let ret = "Bearer " + window.sessionStorage.getItem("chat4AppSessionToken");
|
|
281
|
-
return ret;
|
|
282
|
-
}
|
|
283
|
-
setTokenChat4app(chat4AppSessionToken) {
|
|
284
|
-
window.sessionStorage.setItem("chat4AppSessionToken", chat4AppSessionToken);
|
|
285
|
-
}
|
|
286
|
-
/* Connection */
|
|
287
|
-
onMessageFirebaseReceived(data, chatCallback) {
|
|
288
|
-
//alert("onMessageReceived connectFirebase");
|
|
289
|
-
if (data.type == "msg") {
|
|
290
|
-
let chat4appMessage = new Chat4AppMessageReceive();
|
|
291
|
-
chat4appMessage.data.chatId = data.chatId;
|
|
292
|
-
chat4appMessage.data.chatMessageId = data.chatMessageId;
|
|
293
|
-
chat4appMessage.data.externalId = data.externalId;
|
|
294
|
-
chat4appMessage.data.fromId = data.fromId;
|
|
295
|
-
chat4appMessage.data.toId = data.toId;
|
|
296
|
-
chat4appMessage.data.groupId = data.groupId;
|
|
297
|
-
chat4appMessage.data.dateHour = data.dateHour;
|
|
298
|
-
chat4appMessage.data.type = data.type;
|
|
299
|
-
chat4appMessage.notification.body = data.body;
|
|
300
|
-
if (data.fileId && data.fileId.length > 0) {
|
|
301
|
-
chat4appMessage.data.fileId = data.fileId;
|
|
302
|
-
chat4appMessage.data.fileName = data.fileName;
|
|
303
|
-
chat4appMessage.data.fileSize = data.fileSize;
|
|
304
|
-
chat4appMessage.data.fileType = data.fileType;
|
|
305
|
-
}
|
|
306
|
-
let datTmp = new Map();
|
|
307
|
-
for (let key in data) {
|
|
308
|
-
datTmp.set(key, data[key]);
|
|
309
|
-
}
|
|
310
|
-
chat4appMessage.data.all = datTmp;
|
|
311
|
-
chatCallback.onMessage(chat4appMessage);
|
|
312
|
-
}
|
|
313
|
-
else if ((data.type == "on" || data.type == "off")) {
|
|
314
|
-
let chat4appMessage = new Chat4AppMessageReceive();
|
|
315
|
-
chat4appMessage.data.chatId = data.chatId;
|
|
316
|
-
chat4appMessage.data.chatMessageId = data.chatMessageId;
|
|
317
|
-
chat4appMessage.data.externalId = data.externalId;
|
|
318
|
-
chat4appMessage.data.fromId = data.fromId;
|
|
319
|
-
chat4appMessage.data.toId = data.toId;
|
|
320
|
-
chat4appMessage.data.groupId = data.groupId;
|
|
321
|
-
chat4appMessage.data.dateHour = data.dateHour;
|
|
322
|
-
chat4appMessage.data.type = data.type;
|
|
323
|
-
let datTmp = new Map();
|
|
324
|
-
for (let key in data) {
|
|
325
|
-
datTmp.set(key, data[key]);
|
|
326
|
-
}
|
|
327
|
-
chat4appMessage.data.all = datTmp;
|
|
328
|
-
chatCallback.onOffline(chat4appMessage);
|
|
329
|
-
}
|
|
330
|
-
else if (data.type == "read") {
|
|
331
|
-
let chat4appMessage = new Chat4AppMessageReceive();
|
|
332
|
-
chat4appMessage.data.chatId = data.chatId;
|
|
333
|
-
chat4appMessage.data.chatMessageId = data.chatMessageId;
|
|
334
|
-
chat4appMessage.data.externalId = data.externalId;
|
|
335
|
-
chat4appMessage.data.fromId = data.fromId;
|
|
336
|
-
chat4appMessage.data.toId = data.toId;
|
|
337
|
-
chat4appMessage.data.groupId = data.groupId;
|
|
338
|
-
chat4appMessage.data.dateHour = data.dateHour;
|
|
339
|
-
chat4appMessage.data.type = data.type;
|
|
340
|
-
let datTmp = new Map();
|
|
341
|
-
for (let key in data) {
|
|
342
|
-
datTmp.set(key, data[key]);
|
|
343
|
-
}
|
|
344
|
-
chat4appMessage.data.all = datTmp;
|
|
345
|
-
chatCallback.onRead(chat4appMessage);
|
|
346
|
-
}
|
|
347
|
-
else if (data.type == "startTyping" || data.type == "stopTyping") {
|
|
348
|
-
let chat4appMessage = new Chat4AppMessageReceive();
|
|
349
|
-
chat4appMessage.data.chatId = data.chatId;
|
|
350
|
-
chat4appMessage.data.chatMessageId = data.chatMessageId;
|
|
351
|
-
chat4appMessage.data.externalId = data.externalId;
|
|
352
|
-
chat4appMessage.data.fromId = data.fromId;
|
|
353
|
-
chat4appMessage.data.toId = data.toId;
|
|
354
|
-
chat4appMessage.data.groupId = data.groupId;
|
|
355
|
-
chat4appMessage.data.dateHour = data.dateHour;
|
|
356
|
-
chat4appMessage.data.type = data.type;
|
|
357
|
-
let datTmp = new Map();
|
|
358
|
-
for (let key in data) {
|
|
359
|
-
datTmp.set(key, data[key]);
|
|
360
|
-
}
|
|
361
|
-
chat4appMessage.data.all = datTmp;
|
|
362
|
-
chatCallback.onStartStopTyping(chat4appMessage);
|
|
363
|
-
}
|
|
364
|
-
else if (data.type == "new_user") {
|
|
365
|
-
let chat4appMessage = new Chat4AppMessageReceive();
|
|
366
|
-
chat4appMessage.data.chatId = data.chatId;
|
|
367
|
-
chat4appMessage.data.chatMessageId = data.chatMessageId;
|
|
368
|
-
chat4appMessage.data.externalId = data.externalId;
|
|
369
|
-
chat4appMessage.data.fromId = data.fromId;
|
|
370
|
-
chat4appMessage.data.toId = data.toId;
|
|
371
|
-
chat4appMessage.data.groupId = data.groupId;
|
|
372
|
-
chat4appMessage.data.dateHour = data.dateHour;
|
|
373
|
-
chat4appMessage.data.type = data.type;
|
|
374
|
-
let datTmp = new Map();
|
|
375
|
-
for (let key in data) {
|
|
376
|
-
datTmp.set(key, data[key]);
|
|
377
|
-
}
|
|
378
|
-
chat4appMessage.data.all = datTmp;
|
|
379
|
-
chatCallback.onNewUser(chat4appMessage);
|
|
380
|
-
}
|
|
381
|
-
else if (data.type == "remove_user") {
|
|
382
|
-
let chat4appMessage = new Chat4AppMessageReceive();
|
|
383
|
-
chat4appMessage.data.chatId = data.chatId;
|
|
384
|
-
chat4appMessage.data.chatMessageId = data.chatMessageId;
|
|
385
|
-
chat4appMessage.data.externalId = data.externalId;
|
|
386
|
-
chat4appMessage.data.fromId = data.fromId;
|
|
387
|
-
chat4appMessage.data.toId = data.toId;
|
|
388
|
-
chat4appMessage.data.groupId = data.groupId;
|
|
389
|
-
chat4appMessage.data.dateHour = data.dateHour;
|
|
390
|
-
chat4appMessage.data.type = data.type;
|
|
391
|
-
let datTmp = new Map();
|
|
392
|
-
for (let key in data) {
|
|
393
|
-
datTmp.set(key, data[key]);
|
|
394
|
-
}
|
|
395
|
-
chat4appMessage.data.all = datTmp;
|
|
396
|
-
chatCallback.onRemoveUser(chat4appMessage);
|
|
397
|
-
}
|
|
398
|
-
else if (data.type == "chat_closed") {
|
|
399
|
-
let chat4appMessage = new Chat4AppMessageReceive();
|
|
400
|
-
chat4appMessage.data.chatId = data.chatId;
|
|
401
|
-
chat4appMessage.data.chatMessageId = data.chatMessageId;
|
|
402
|
-
chat4appMessage.data.externalId = data.externalId;
|
|
403
|
-
chat4appMessage.data.fromId = data.fromId;
|
|
404
|
-
chat4appMessage.data.toId = data.toId;
|
|
405
|
-
chat4appMessage.data.groupId = data.groupId;
|
|
406
|
-
chat4appMessage.data.dateHour = data.dateHour;
|
|
407
|
-
chat4appMessage.data.type = data.type;
|
|
408
|
-
let datTmp = new Map();
|
|
409
|
-
for (let key in data) {
|
|
410
|
-
datTmp.set(key, data[key]);
|
|
411
|
-
}
|
|
412
|
-
chat4appMessage.data.all = datTmp;
|
|
413
|
-
chatCallback.onChatClosed(chat4appMessage);
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
connectWebsocket(chatCallback, token) {
|
|
417
|
-
this.disconnect();
|
|
418
|
-
let securityToken = this.getBearerToken();
|
|
419
|
-
this.sock = new SockJS(this.chatServer + '/stomp/gkz-stomp-endpoint?token=' + securityToken);
|
|
420
|
-
this.stompClient = Stomp.over(this.sock);
|
|
421
|
-
const that = this;
|
|
422
|
-
this.stompClient.debug = function (msg) {
|
|
423
|
-
if (this.debug) {
|
|
424
|
-
console.log(msg);
|
|
425
|
-
}
|
|
426
|
-
};
|
|
427
|
-
let tokenAuth = "";
|
|
428
|
-
if (securityToken && securityToken.startsWith("Bearer ")) {
|
|
429
|
-
tokenAuth = securityToken;
|
|
430
|
-
}
|
|
431
|
-
else {
|
|
432
|
-
tokenAuth = "Bearer " + securityToken;
|
|
433
|
-
}
|
|
434
|
-
this.stompClient.connect({ "X-Authorization": tokenAuth }, (frame) => {
|
|
435
|
-
//console.log(frame);
|
|
436
|
-
that.timeoutReconnect = 500;
|
|
437
|
-
this.stompClient.subscribe('/queue/' + token, (msg) => {
|
|
438
|
-
//console.log('mensagem', msg);
|
|
439
|
-
if (msg.command == "MESSAGE") {
|
|
440
|
-
//console.log(msg)
|
|
441
|
-
if (!chatCallback.isTokenFirebaseActive()) {
|
|
442
|
-
let msgObj = JSON.parse(msg.body);
|
|
443
|
-
let datTmp = new Map();
|
|
444
|
-
for (let key in msgObj.data) {
|
|
445
|
-
datTmp.set(key, msgObj.data[key]);
|
|
446
|
-
}
|
|
447
|
-
msgObj.data.all = datTmp;
|
|
448
|
-
if (msgObj.data.type == "msg") {
|
|
449
|
-
chatCallback.onMessage(msgObj);
|
|
450
|
-
}
|
|
451
|
-
else if ((msgObj.data.type == "on" || msgObj.data.type == "off")) {
|
|
452
|
-
chatCallback.onOffline(msgObj);
|
|
453
|
-
}
|
|
454
|
-
else if (msgObj.data.type == "read") {
|
|
455
|
-
chatCallback.onRead(msgObj);
|
|
456
|
-
}
|
|
457
|
-
else if (msgObj.data.type == "startTyping" || msgObj.data.type == "stopTyping") {
|
|
458
|
-
chatCallback.onStartStopTyping(msgObj);
|
|
459
|
-
}
|
|
460
|
-
else if (msgObj.data.type == "new_user") {
|
|
461
|
-
chatCallback.onNewUser(msgObj);
|
|
462
|
-
}
|
|
463
|
-
else if (msgObj.data.type == "remove_user") {
|
|
464
|
-
chatCallback.onRemoveUser(msgObj);
|
|
465
|
-
}
|
|
466
|
-
else if (msgObj.data.type == "chat_closed") {
|
|
467
|
-
chatCallback.onChatClosed(msgObj);
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
//callback(msg.body);
|
|
471
|
-
// ichatcallback.forEach((iChat)=>{
|
|
472
|
-
// iChat.onMessage(JSON.parse(msg.body) );
|
|
473
|
-
// });
|
|
474
|
-
}
|
|
475
|
-
});
|
|
476
|
-
}, (message) => {
|
|
477
|
-
// check message for disconnect
|
|
478
|
-
//console.log("Disconnect");
|
|
479
|
-
setTimeout(() => {
|
|
480
|
-
that.timeoutReconnect *= 100;
|
|
481
|
-
this.connectWebsocket(chatCallback, token);
|
|
482
|
-
}, that.timeoutReconnect);
|
|
483
|
-
});
|
|
484
|
-
}
|
|
485
|
-
disconnect() {
|
|
486
|
-
// console.log("disconnect")
|
|
487
|
-
try {
|
|
488
|
-
if (this.stompClient) {
|
|
489
|
-
this.stompClient.disconnect();
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
catch (e) {
|
|
493
|
-
console.log(e);
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
convertChat4AppMessageReceiveToChatMessage4App(msg) {
|
|
497
|
-
var _a;
|
|
498
|
-
let message = new ChatMessage4App();
|
|
499
|
-
message.body = (_a = msg === null || msg === void 0 ? void 0 : msg.notification) === null || _a === void 0 ? void 0 : _a.body;
|
|
500
|
-
message.chatId = msg.data.chatId;
|
|
501
|
-
message.fromId = msg.data.fromId;
|
|
502
|
-
message.toId = msg.data.toId;
|
|
503
|
-
message.groupId = msg.data.groupId;
|
|
504
|
-
message.replyFrom = msg.data.replyFrom;
|
|
505
|
-
if (msg.data.dateHour && msg.data.dateHour.length > 0) {
|
|
506
|
-
message.dateHourIncluded = msg.data.dateHour.substring(6, 10) + "-"
|
|
507
|
-
+ msg.data.dateHour.substring(3, 5) + "-"
|
|
508
|
-
+ msg.data.dateHour.substring(0, 2)
|
|
509
|
-
+ msg.data.dateHour.substring(10);
|
|
510
|
-
}
|
|
511
|
-
message.id = msg.data.chatMessageId;
|
|
512
|
-
if (msg.data.fileId && msg.data.fileId.length > 0) {
|
|
513
|
-
let messageFile = new ChatMessageFile4App();
|
|
514
|
-
messageFile.id = msg.data.fileId;
|
|
515
|
-
messageFile.name = msg.data.fileName;
|
|
516
|
-
messageFile.size = msg.data.fileSize;
|
|
517
|
-
messageFile.type = msg.data.fileType;
|
|
518
|
-
message.chatMessageFile = messageFile;
|
|
519
|
-
}
|
|
520
|
-
if (msg.data.vFileId && msg.data.vFileId.length > 0) {
|
|
521
|
-
let messageFile = new ChatMessageFile4App();
|
|
522
|
-
messageFile.id = msg.data.vFileId;
|
|
523
|
-
messageFile.name = msg.data.vFileName;
|
|
524
|
-
messageFile.size = msg.data.vFileSize;
|
|
525
|
-
messageFile.type = msg.data.vFileType;
|
|
526
|
-
message.chatVoiceFile = messageFile;
|
|
527
|
-
}
|
|
528
|
-
return message;
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
Chat4appClientAngularService.ɵprov = i0.ɵɵdefineInjectable({ factory: function Chat4appClientAngularService_Factory() { return new Chat4appClientAngularService(i0.ɵɵinject(i1.HttpClient)); }, token: Chat4appClientAngularService, providedIn: "root" });
|
|
532
|
-
Chat4appClientAngularService.decorators = [
|
|
533
|
-
{ type: Injectable, args: [{
|
|
534
|
-
providedIn: 'root'
|
|
535
|
-
},] }
|
|
536
|
-
];
|
|
537
|
-
Chat4appClientAngularService.ctorParameters = () => [
|
|
538
|
-
{ type: HttpClient }
|
|
539
|
-
];
|
|
540
|
-
class Chat4App {
|
|
541
|
-
}
|
|
542
|
-
class ChatUser4App {
|
|
543
|
-
}
|
|
544
|
-
class ChatMessage4App {
|
|
545
|
-
}
|
|
546
|
-
class ChatMessageFile4App {
|
|
547
|
-
}
|
|
548
|
-
class ChatMessageMeta4App {
|
|
549
|
-
}
|
|
550
|
-
class Chat4AppMessageReceive {
|
|
551
|
-
constructor() {
|
|
552
|
-
this.data = new Chat4AppMessageReceiveData();
|
|
553
|
-
this.notification = new Chat4AppMessageReceiveNotification();
|
|
554
|
-
}
|
|
555
|
-
}
|
|
556
|
-
class Chat4AppMessageReceiveData {
|
|
557
|
-
}
|
|
558
|
-
class Chat4AppMessageReceiveNotification {
|
|
559
|
-
}
|
|
560
|
-
class ChatUserResponse4App {
|
|
561
|
-
}
|
|
562
|
-
class ChatFilterRequest4App {
|
|
563
|
-
}
|
|
564
|
-
class Chat4AppConfig {
|
|
565
|
-
constructor(endpoint, debug) {
|
|
566
|
-
this.endpoint = endpoint;
|
|
567
|
-
this.debug = debug;
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
class Chat4AppTranslate {
|
|
571
|
-
}
|
|
572
|
-
class ChatGroupApp {
|
|
573
|
-
}
|
|
574
|
-
var ChatStatus4App;
|
|
575
|
-
(function (ChatStatus4App) {
|
|
576
|
-
ChatStatus4App["CREATED"] = "CREATED";
|
|
577
|
-
ChatStatus4App["CLOSED"] = "CLOSED";
|
|
578
|
-
})(ChatStatus4App || (ChatStatus4App = {}));
|
|
579
|
-
var ChatUserStatus4App;
|
|
580
|
-
(function (ChatUserStatus4App) {
|
|
581
|
-
ChatUserStatus4App["REMOVED"] = "REMOVED";
|
|
582
|
-
})(ChatUserStatus4App || (ChatUserStatus4App = {}));
|
|
583
|
-
var ChatFilterType;
|
|
584
|
-
(function (ChatFilterType) {
|
|
585
|
-
ChatFilterType[ChatFilterType["COUNT_NOT_READ"] = 1] = "COUNT_NOT_READ";
|
|
586
|
-
ChatFilterType[ChatFilterType["LAST_MESSAGE"] = 2] = "LAST_MESSAGE";
|
|
587
|
-
})(ChatFilterType || (ChatFilterType = {}));
|
|
588
|
-
var GroupStatus4App;
|
|
589
|
-
(function (GroupStatus4App) {
|
|
590
|
-
GroupStatus4App["CREATED"] = "CREATED";
|
|
591
|
-
GroupStatus4App["CLOSED"] = "REMOVED";
|
|
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, fromId) {
|
|
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
|
+
if (fromId && fromId.length > 0) {
|
|
144
|
+
url += "&fromId=" + groupId;
|
|
145
|
+
}
|
|
146
|
+
return this.http.get(url, {
|
|
147
|
+
headers: new HttpHeaders().set('Authorization', this.getBearerToken())
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
getChatByExternalId(externalId) {
|
|
151
|
+
let url = this.chatUrl + "chat?externalId=" + externalId;
|
|
152
|
+
return this.http.get(url, {
|
|
153
|
+
headers: new HttpHeaders().set('Authorization', this.getBearerToken())
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
getChatById(id) {
|
|
157
|
+
let url = this.chatUrl + "chat?chatId=" + id;
|
|
158
|
+
return this.http.get(url, {
|
|
159
|
+
headers: new HttpHeaders().set('Authorization', this.getBearerToken())
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
listChatByUser(externalUserId, userId, chatStatus) {
|
|
163
|
+
let url = this.chatUrl + "chat/listChatByUser/?externalUserId=" + externalUserId
|
|
164
|
+
+ "&userId=" + userId
|
|
165
|
+
+ "&chatStatus=" + chatStatus;
|
|
166
|
+
return this.http.get(url, {
|
|
167
|
+
headers: new HttpHeaders().set('Authorization', this.getBearerToken())
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
closeChat(chatId, chatExternalId) {
|
|
171
|
+
let url = this.chatUrl;
|
|
172
|
+
if (chatId && chatId.length > 0) {
|
|
173
|
+
url += "chat?chatId=" + chatId;
|
|
174
|
+
}
|
|
175
|
+
if (chatExternalId && chatExternalId.length > 0) {
|
|
176
|
+
url += "chat?externalId=" + chatExternalId;
|
|
177
|
+
}
|
|
178
|
+
return this.http.delete(url, {
|
|
179
|
+
headers: new HttpHeaders().set('Authorization', this.getBearerToken())
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
readMessage(chatMessageId, toId) {
|
|
183
|
+
let url = this.chatUrl + "chatmessage/read/" + chatMessageId;
|
|
184
|
+
if (toId && toId.length > 0) {
|
|
185
|
+
url += "/" + toId;
|
|
186
|
+
}
|
|
187
|
+
return this.http.put(url, null, {
|
|
188
|
+
headers: new HttpHeaders().set('Authorization', this.getBearerToken())
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
online(chatId) {
|
|
192
|
+
let url = this.chatUrl + "chatmessage/online/" + chatId;
|
|
193
|
+
return this.http.get(url, {
|
|
194
|
+
headers: new HttpHeaders().set('Authorization', this.getBearerToken())
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
sendFile(chatId, fromId, toId, fileToUpload) {
|
|
198
|
+
const endpoint = this.chatUrl + "chatmessage/sendFile/" + chatId + "/" + fromId + "/" + toId;
|
|
199
|
+
const formData = new FormData();
|
|
200
|
+
formData.append('file', fileToUpload);
|
|
201
|
+
return this.http
|
|
202
|
+
.post(endpoint, formData, {
|
|
203
|
+
headers: new HttpHeaders().set('Authorization', this.getBearerToken())
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
sendFileGroup(chatId, fromId, groupId, fileToUpload) {
|
|
207
|
+
const endpoint = this.chatUrl + "chatmessage/sendFileGroup/" + chatId + "/" + fromId + "/" + groupId;
|
|
208
|
+
const formData = new FormData();
|
|
209
|
+
formData.append('file', fileToUpload);
|
|
210
|
+
return this.http
|
|
211
|
+
.post(endpoint, formData, {
|
|
212
|
+
headers: new HttpHeaders().set('Authorization', this.getBearerToken())
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
translateMessage(chatMessageId, languageTarget) {
|
|
216
|
+
let url = this.chatUrl + "chatmessage/translate/" + chatMessageId + "/" + languageTarget;
|
|
217
|
+
return this.http.get(url, {
|
|
218
|
+
headers: new HttpHeaders().set('Authorization', this.getBearerToken())
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
startTyping(chatId, fromId, toId) {
|
|
222
|
+
let url = this.chatUrl + "chatmessage/startTyping/" + chatId + "/" + fromId + "/" + toId;
|
|
223
|
+
return this.http.put(url, null, {
|
|
224
|
+
headers: new HttpHeaders().set('Authorization', this.getBearerToken())
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
startTypingGroup(chatId, fromId, groupId) {
|
|
228
|
+
let url = this.chatUrl + "chatmessage/startTypingGroup/" + chatId + "/" + fromId + "/" + groupId;
|
|
229
|
+
return this.http.put(url, null, {
|
|
230
|
+
headers: new HttpHeaders().set('Authorization', this.getBearerToken())
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
stopTyping(chatId, fromId, toId) {
|
|
234
|
+
let url = this.chatUrl + "chatmessage/stopTyping/" + chatId + "/" + fromId + "/" + toId;
|
|
235
|
+
return this.http.put(url, null, {
|
|
236
|
+
headers: new HttpHeaders().set('Authorization', this.getBearerToken())
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
stopTypingGroup(chatId, fromId, groupId) {
|
|
240
|
+
let url = this.chatUrl + "chatmessage/stopTypingGroup/" + chatId + "/" + fromId + "/" + groupId;
|
|
241
|
+
return this.http.put(url, null, {
|
|
242
|
+
headers: new HttpHeaders().set('Authorization', this.getBearerToken())
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
createGroup(group) {
|
|
246
|
+
let url = this.chatUrl + "/group";
|
|
247
|
+
return this.http.post(url, group, {
|
|
248
|
+
headers: new HttpHeaders().set('Authorization', this.getBearerToken())
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
getGroup(chatId, groupId) {
|
|
252
|
+
let url = this.chatUrl + "/group/" + groupId + "/" + chatId;
|
|
253
|
+
return this.http.get(url, {
|
|
254
|
+
headers: new HttpHeaders().set('Authorization', this.getBearerToken())
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
listGroups(chatId, externalId) {
|
|
258
|
+
let url = this.chatUrl + "/group/";
|
|
259
|
+
if (chatId && chatId.length > 0) {
|
|
260
|
+
url += "&chatId=" + chatId;
|
|
261
|
+
}
|
|
262
|
+
if (externalId && externalId.length > 0) {
|
|
263
|
+
url += "&externalId=" + externalId;
|
|
264
|
+
}
|
|
265
|
+
return this.http.get(url, {
|
|
266
|
+
headers: new HttpHeaders().set('Authorization', this.getBearerToken())
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
listFilesGroup(chatId, groupId) {
|
|
270
|
+
let url = this.chatUrl + "/group/" + chatId;
|
|
271
|
+
if (groupId && groupId.length > 0) {
|
|
272
|
+
url += "&groupId=" + chatId;
|
|
273
|
+
}
|
|
274
|
+
return this.http.get(url, {
|
|
275
|
+
headers: new HttpHeaders().set('Authorization', this.getBearerToken())
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
/* Token */
|
|
279
|
+
getBearerToken() {
|
|
280
|
+
let ret = "Bearer " + window.sessionStorage.getItem("chat4AppSessionToken");
|
|
281
|
+
return ret;
|
|
282
|
+
}
|
|
283
|
+
setTokenChat4app(chat4AppSessionToken) {
|
|
284
|
+
window.sessionStorage.setItem("chat4AppSessionToken", chat4AppSessionToken);
|
|
285
|
+
}
|
|
286
|
+
/* Connection */
|
|
287
|
+
onMessageFirebaseReceived(data, chatCallback) {
|
|
288
|
+
//alert("onMessageReceived connectFirebase");
|
|
289
|
+
if (data.type == "msg") {
|
|
290
|
+
let chat4appMessage = new Chat4AppMessageReceive();
|
|
291
|
+
chat4appMessage.data.chatId = data.chatId;
|
|
292
|
+
chat4appMessage.data.chatMessageId = data.chatMessageId;
|
|
293
|
+
chat4appMessage.data.externalId = data.externalId;
|
|
294
|
+
chat4appMessage.data.fromId = data.fromId;
|
|
295
|
+
chat4appMessage.data.toId = data.toId;
|
|
296
|
+
chat4appMessage.data.groupId = data.groupId;
|
|
297
|
+
chat4appMessage.data.dateHour = data.dateHour;
|
|
298
|
+
chat4appMessage.data.type = data.type;
|
|
299
|
+
chat4appMessage.notification.body = data.body;
|
|
300
|
+
if (data.fileId && data.fileId.length > 0) {
|
|
301
|
+
chat4appMessage.data.fileId = data.fileId;
|
|
302
|
+
chat4appMessage.data.fileName = data.fileName;
|
|
303
|
+
chat4appMessage.data.fileSize = data.fileSize;
|
|
304
|
+
chat4appMessage.data.fileType = data.fileType;
|
|
305
|
+
}
|
|
306
|
+
let datTmp = new Map();
|
|
307
|
+
for (let key in data) {
|
|
308
|
+
datTmp.set(key, data[key]);
|
|
309
|
+
}
|
|
310
|
+
chat4appMessage.data.all = datTmp;
|
|
311
|
+
chatCallback.onMessage(chat4appMessage);
|
|
312
|
+
}
|
|
313
|
+
else if ((data.type == "on" || data.type == "off")) {
|
|
314
|
+
let chat4appMessage = new Chat4AppMessageReceive();
|
|
315
|
+
chat4appMessage.data.chatId = data.chatId;
|
|
316
|
+
chat4appMessage.data.chatMessageId = data.chatMessageId;
|
|
317
|
+
chat4appMessage.data.externalId = data.externalId;
|
|
318
|
+
chat4appMessage.data.fromId = data.fromId;
|
|
319
|
+
chat4appMessage.data.toId = data.toId;
|
|
320
|
+
chat4appMessage.data.groupId = data.groupId;
|
|
321
|
+
chat4appMessage.data.dateHour = data.dateHour;
|
|
322
|
+
chat4appMessage.data.type = data.type;
|
|
323
|
+
let datTmp = new Map();
|
|
324
|
+
for (let key in data) {
|
|
325
|
+
datTmp.set(key, data[key]);
|
|
326
|
+
}
|
|
327
|
+
chat4appMessage.data.all = datTmp;
|
|
328
|
+
chatCallback.onOffline(chat4appMessage);
|
|
329
|
+
}
|
|
330
|
+
else if (data.type == "read") {
|
|
331
|
+
let chat4appMessage = new Chat4AppMessageReceive();
|
|
332
|
+
chat4appMessage.data.chatId = data.chatId;
|
|
333
|
+
chat4appMessage.data.chatMessageId = data.chatMessageId;
|
|
334
|
+
chat4appMessage.data.externalId = data.externalId;
|
|
335
|
+
chat4appMessage.data.fromId = data.fromId;
|
|
336
|
+
chat4appMessage.data.toId = data.toId;
|
|
337
|
+
chat4appMessage.data.groupId = data.groupId;
|
|
338
|
+
chat4appMessage.data.dateHour = data.dateHour;
|
|
339
|
+
chat4appMessage.data.type = data.type;
|
|
340
|
+
let datTmp = new Map();
|
|
341
|
+
for (let key in data) {
|
|
342
|
+
datTmp.set(key, data[key]);
|
|
343
|
+
}
|
|
344
|
+
chat4appMessage.data.all = datTmp;
|
|
345
|
+
chatCallback.onRead(chat4appMessage);
|
|
346
|
+
}
|
|
347
|
+
else if (data.type == "startTyping" || data.type == "stopTyping") {
|
|
348
|
+
let chat4appMessage = new Chat4AppMessageReceive();
|
|
349
|
+
chat4appMessage.data.chatId = data.chatId;
|
|
350
|
+
chat4appMessage.data.chatMessageId = data.chatMessageId;
|
|
351
|
+
chat4appMessage.data.externalId = data.externalId;
|
|
352
|
+
chat4appMessage.data.fromId = data.fromId;
|
|
353
|
+
chat4appMessage.data.toId = data.toId;
|
|
354
|
+
chat4appMessage.data.groupId = data.groupId;
|
|
355
|
+
chat4appMessage.data.dateHour = data.dateHour;
|
|
356
|
+
chat4appMessage.data.type = data.type;
|
|
357
|
+
let datTmp = new Map();
|
|
358
|
+
for (let key in data) {
|
|
359
|
+
datTmp.set(key, data[key]);
|
|
360
|
+
}
|
|
361
|
+
chat4appMessage.data.all = datTmp;
|
|
362
|
+
chatCallback.onStartStopTyping(chat4appMessage);
|
|
363
|
+
}
|
|
364
|
+
else if (data.type == "new_user") {
|
|
365
|
+
let chat4appMessage = new Chat4AppMessageReceive();
|
|
366
|
+
chat4appMessage.data.chatId = data.chatId;
|
|
367
|
+
chat4appMessage.data.chatMessageId = data.chatMessageId;
|
|
368
|
+
chat4appMessage.data.externalId = data.externalId;
|
|
369
|
+
chat4appMessage.data.fromId = data.fromId;
|
|
370
|
+
chat4appMessage.data.toId = data.toId;
|
|
371
|
+
chat4appMessage.data.groupId = data.groupId;
|
|
372
|
+
chat4appMessage.data.dateHour = data.dateHour;
|
|
373
|
+
chat4appMessage.data.type = data.type;
|
|
374
|
+
let datTmp = new Map();
|
|
375
|
+
for (let key in data) {
|
|
376
|
+
datTmp.set(key, data[key]);
|
|
377
|
+
}
|
|
378
|
+
chat4appMessage.data.all = datTmp;
|
|
379
|
+
chatCallback.onNewUser(chat4appMessage);
|
|
380
|
+
}
|
|
381
|
+
else if (data.type == "remove_user") {
|
|
382
|
+
let chat4appMessage = new Chat4AppMessageReceive();
|
|
383
|
+
chat4appMessage.data.chatId = data.chatId;
|
|
384
|
+
chat4appMessage.data.chatMessageId = data.chatMessageId;
|
|
385
|
+
chat4appMessage.data.externalId = data.externalId;
|
|
386
|
+
chat4appMessage.data.fromId = data.fromId;
|
|
387
|
+
chat4appMessage.data.toId = data.toId;
|
|
388
|
+
chat4appMessage.data.groupId = data.groupId;
|
|
389
|
+
chat4appMessage.data.dateHour = data.dateHour;
|
|
390
|
+
chat4appMessage.data.type = data.type;
|
|
391
|
+
let datTmp = new Map();
|
|
392
|
+
for (let key in data) {
|
|
393
|
+
datTmp.set(key, data[key]);
|
|
394
|
+
}
|
|
395
|
+
chat4appMessage.data.all = datTmp;
|
|
396
|
+
chatCallback.onRemoveUser(chat4appMessage);
|
|
397
|
+
}
|
|
398
|
+
else if (data.type == "chat_closed") {
|
|
399
|
+
let chat4appMessage = new Chat4AppMessageReceive();
|
|
400
|
+
chat4appMessage.data.chatId = data.chatId;
|
|
401
|
+
chat4appMessage.data.chatMessageId = data.chatMessageId;
|
|
402
|
+
chat4appMessage.data.externalId = data.externalId;
|
|
403
|
+
chat4appMessage.data.fromId = data.fromId;
|
|
404
|
+
chat4appMessage.data.toId = data.toId;
|
|
405
|
+
chat4appMessage.data.groupId = data.groupId;
|
|
406
|
+
chat4appMessage.data.dateHour = data.dateHour;
|
|
407
|
+
chat4appMessage.data.type = data.type;
|
|
408
|
+
let datTmp = new Map();
|
|
409
|
+
for (let key in data) {
|
|
410
|
+
datTmp.set(key, data[key]);
|
|
411
|
+
}
|
|
412
|
+
chat4appMessage.data.all = datTmp;
|
|
413
|
+
chatCallback.onChatClosed(chat4appMessage);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
connectWebsocket(chatCallback, token) {
|
|
417
|
+
this.disconnect();
|
|
418
|
+
let securityToken = this.getBearerToken();
|
|
419
|
+
this.sock = new SockJS(this.chatServer + '/stomp/gkz-stomp-endpoint?token=' + securityToken);
|
|
420
|
+
this.stompClient = Stomp.over(this.sock);
|
|
421
|
+
const that = this;
|
|
422
|
+
this.stompClient.debug = function (msg) {
|
|
423
|
+
if (this.debug) {
|
|
424
|
+
console.log(msg);
|
|
425
|
+
}
|
|
426
|
+
};
|
|
427
|
+
let tokenAuth = "";
|
|
428
|
+
if (securityToken && securityToken.startsWith("Bearer ")) {
|
|
429
|
+
tokenAuth = securityToken;
|
|
430
|
+
}
|
|
431
|
+
else {
|
|
432
|
+
tokenAuth = "Bearer " + securityToken;
|
|
433
|
+
}
|
|
434
|
+
this.stompClient.connect({ "X-Authorization": tokenAuth }, (frame) => {
|
|
435
|
+
//console.log(frame);
|
|
436
|
+
that.timeoutReconnect = 500;
|
|
437
|
+
this.stompClient.subscribe('/queue/' + token, (msg) => {
|
|
438
|
+
//console.log('mensagem', msg);
|
|
439
|
+
if (msg.command == "MESSAGE") {
|
|
440
|
+
//console.log(msg)
|
|
441
|
+
if (!chatCallback.isTokenFirebaseActive()) {
|
|
442
|
+
let msgObj = JSON.parse(msg.body);
|
|
443
|
+
let datTmp = new Map();
|
|
444
|
+
for (let key in msgObj.data) {
|
|
445
|
+
datTmp.set(key, msgObj.data[key]);
|
|
446
|
+
}
|
|
447
|
+
msgObj.data.all = datTmp;
|
|
448
|
+
if (msgObj.data.type == "msg") {
|
|
449
|
+
chatCallback.onMessage(msgObj);
|
|
450
|
+
}
|
|
451
|
+
else if ((msgObj.data.type == "on" || msgObj.data.type == "off")) {
|
|
452
|
+
chatCallback.onOffline(msgObj);
|
|
453
|
+
}
|
|
454
|
+
else if (msgObj.data.type == "read") {
|
|
455
|
+
chatCallback.onRead(msgObj);
|
|
456
|
+
}
|
|
457
|
+
else if (msgObj.data.type == "startTyping" || msgObj.data.type == "stopTyping") {
|
|
458
|
+
chatCallback.onStartStopTyping(msgObj);
|
|
459
|
+
}
|
|
460
|
+
else if (msgObj.data.type == "new_user") {
|
|
461
|
+
chatCallback.onNewUser(msgObj);
|
|
462
|
+
}
|
|
463
|
+
else if (msgObj.data.type == "remove_user") {
|
|
464
|
+
chatCallback.onRemoveUser(msgObj);
|
|
465
|
+
}
|
|
466
|
+
else if (msgObj.data.type == "chat_closed") {
|
|
467
|
+
chatCallback.onChatClosed(msgObj);
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
//callback(msg.body);
|
|
471
|
+
// ichatcallback.forEach((iChat)=>{
|
|
472
|
+
// iChat.onMessage(JSON.parse(msg.body) );
|
|
473
|
+
// });
|
|
474
|
+
}
|
|
475
|
+
});
|
|
476
|
+
}, (message) => {
|
|
477
|
+
// check message for disconnect
|
|
478
|
+
//console.log("Disconnect");
|
|
479
|
+
setTimeout(() => {
|
|
480
|
+
that.timeoutReconnect *= 100;
|
|
481
|
+
this.connectWebsocket(chatCallback, token);
|
|
482
|
+
}, that.timeoutReconnect);
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
disconnect() {
|
|
486
|
+
// console.log("disconnect")
|
|
487
|
+
try {
|
|
488
|
+
if (this.stompClient) {
|
|
489
|
+
this.stompClient.disconnect();
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
catch (e) {
|
|
493
|
+
console.log(e);
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
convertChat4AppMessageReceiveToChatMessage4App(msg) {
|
|
497
|
+
var _a;
|
|
498
|
+
let message = new ChatMessage4App();
|
|
499
|
+
message.body = (_a = msg === null || msg === void 0 ? void 0 : msg.notification) === null || _a === void 0 ? void 0 : _a.body;
|
|
500
|
+
message.chatId = msg.data.chatId;
|
|
501
|
+
message.fromId = msg.data.fromId;
|
|
502
|
+
message.toId = msg.data.toId;
|
|
503
|
+
message.groupId = msg.data.groupId;
|
|
504
|
+
message.replyFrom = msg.data.replyFrom;
|
|
505
|
+
if (msg.data.dateHour && msg.data.dateHour.length > 0) {
|
|
506
|
+
message.dateHourIncluded = msg.data.dateHour.substring(6, 10) + "-"
|
|
507
|
+
+ msg.data.dateHour.substring(3, 5) + "-"
|
|
508
|
+
+ msg.data.dateHour.substring(0, 2)
|
|
509
|
+
+ msg.data.dateHour.substring(10);
|
|
510
|
+
}
|
|
511
|
+
message.id = msg.data.chatMessageId;
|
|
512
|
+
if (msg.data.fileId && msg.data.fileId.length > 0) {
|
|
513
|
+
let messageFile = new ChatMessageFile4App();
|
|
514
|
+
messageFile.id = msg.data.fileId;
|
|
515
|
+
messageFile.name = msg.data.fileName;
|
|
516
|
+
messageFile.size = msg.data.fileSize;
|
|
517
|
+
messageFile.type = msg.data.fileType;
|
|
518
|
+
message.chatMessageFile = messageFile;
|
|
519
|
+
}
|
|
520
|
+
if (msg.data.vFileId && msg.data.vFileId.length > 0) {
|
|
521
|
+
let messageFile = new ChatMessageFile4App();
|
|
522
|
+
messageFile.id = msg.data.vFileId;
|
|
523
|
+
messageFile.name = msg.data.vFileName;
|
|
524
|
+
messageFile.size = msg.data.vFileSize;
|
|
525
|
+
messageFile.type = msg.data.vFileType;
|
|
526
|
+
message.chatVoiceFile = messageFile;
|
|
527
|
+
}
|
|
528
|
+
return message;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
Chat4appClientAngularService.ɵprov = i0.ɵɵdefineInjectable({ factory: function Chat4appClientAngularService_Factory() { return new Chat4appClientAngularService(i0.ɵɵinject(i1.HttpClient)); }, token: Chat4appClientAngularService, providedIn: "root" });
|
|
532
|
+
Chat4appClientAngularService.decorators = [
|
|
533
|
+
{ type: Injectable, args: [{
|
|
534
|
+
providedIn: 'root'
|
|
535
|
+
},] }
|
|
536
|
+
];
|
|
537
|
+
Chat4appClientAngularService.ctorParameters = () => [
|
|
538
|
+
{ type: HttpClient }
|
|
539
|
+
];
|
|
540
|
+
class Chat4App {
|
|
541
|
+
}
|
|
542
|
+
class ChatUser4App {
|
|
543
|
+
}
|
|
544
|
+
class ChatMessage4App {
|
|
545
|
+
}
|
|
546
|
+
class ChatMessageFile4App {
|
|
547
|
+
}
|
|
548
|
+
class ChatMessageMeta4App {
|
|
549
|
+
}
|
|
550
|
+
class Chat4AppMessageReceive {
|
|
551
|
+
constructor() {
|
|
552
|
+
this.data = new Chat4AppMessageReceiveData();
|
|
553
|
+
this.notification = new Chat4AppMessageReceiveNotification();
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
class Chat4AppMessageReceiveData {
|
|
557
|
+
}
|
|
558
|
+
class Chat4AppMessageReceiveNotification {
|
|
559
|
+
}
|
|
560
|
+
class ChatUserResponse4App {
|
|
561
|
+
}
|
|
562
|
+
class ChatFilterRequest4App {
|
|
563
|
+
}
|
|
564
|
+
class Chat4AppConfig {
|
|
565
|
+
constructor(endpoint, debug) {
|
|
566
|
+
this.endpoint = endpoint;
|
|
567
|
+
this.debug = debug;
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
class Chat4AppTranslate {
|
|
571
|
+
}
|
|
572
|
+
class ChatGroupApp {
|
|
573
|
+
}
|
|
574
|
+
var ChatStatus4App;
|
|
575
|
+
(function (ChatStatus4App) {
|
|
576
|
+
ChatStatus4App["CREATED"] = "CREATED";
|
|
577
|
+
ChatStatus4App["CLOSED"] = "CLOSED";
|
|
578
|
+
})(ChatStatus4App || (ChatStatus4App = {}));
|
|
579
|
+
var ChatUserStatus4App;
|
|
580
|
+
(function (ChatUserStatus4App) {
|
|
581
|
+
ChatUserStatus4App["REMOVED"] = "REMOVED";
|
|
582
|
+
})(ChatUserStatus4App || (ChatUserStatus4App = {}));
|
|
583
|
+
var ChatFilterType;
|
|
584
|
+
(function (ChatFilterType) {
|
|
585
|
+
ChatFilterType[ChatFilterType["COUNT_NOT_READ"] = 1] = "COUNT_NOT_READ";
|
|
586
|
+
ChatFilterType[ChatFilterType["LAST_MESSAGE"] = 2] = "LAST_MESSAGE";
|
|
587
|
+
})(ChatFilterType || (ChatFilterType = {}));
|
|
588
|
+
var GroupStatus4App;
|
|
589
|
+
(function (GroupStatus4App) {
|
|
590
|
+
GroupStatus4App["CREATED"] = "CREATED";
|
|
591
|
+
GroupStatus4App["CLOSED"] = "REMOVED";
|
|
592
592
|
})(GroupStatus4App || (GroupStatus4App = {}));
|
|
593
593
|
|
|
594
|
-
class Chat4appClientAngularComponent {
|
|
595
|
-
constructor() { }
|
|
596
|
-
ngOnInit() {
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
Chat4appClientAngularComponent.decorators = [
|
|
600
|
-
{ type: Component, args: [{
|
|
601
|
-
selector: 'lib-chat4app-client-angular',
|
|
602
|
-
template: `
|
|
603
|
-
<p>
|
|
604
|
-
chat4app-client-angular works!
|
|
605
|
-
</p>
|
|
606
|
-
`
|
|
607
|
-
},] }
|
|
608
|
-
];
|
|
594
|
+
class Chat4appClientAngularComponent {
|
|
595
|
+
constructor() { }
|
|
596
|
+
ngOnInit() {
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
Chat4appClientAngularComponent.decorators = [
|
|
600
|
+
{ type: Component, args: [{
|
|
601
|
+
selector: 'lib-chat4app-client-angular',
|
|
602
|
+
template: `
|
|
603
|
+
<p>
|
|
604
|
+
chat4app-client-angular works!
|
|
605
|
+
</p>
|
|
606
|
+
`
|
|
607
|
+
},] }
|
|
608
|
+
];
|
|
609
609
|
Chat4appClientAngularComponent.ctorParameters = () => [];
|
|
610
610
|
|
|
611
|
-
class Chat4appClientAngularModule {
|
|
612
|
-
}
|
|
613
|
-
Chat4appClientAngularModule.decorators = [
|
|
614
|
-
{ type: NgModule, args: [{
|
|
615
|
-
declarations: [Chat4appClientAngularComponent],
|
|
616
|
-
imports: [],
|
|
617
|
-
exports: [Chat4appClientAngularComponent]
|
|
618
|
-
},] }
|
|
611
|
+
class Chat4appClientAngularModule {
|
|
612
|
+
}
|
|
613
|
+
Chat4appClientAngularModule.decorators = [
|
|
614
|
+
{ type: NgModule, args: [{
|
|
615
|
+
declarations: [Chat4appClientAngularComponent],
|
|
616
|
+
imports: [],
|
|
617
|
+
exports: [Chat4appClientAngularComponent]
|
|
618
|
+
},] }
|
|
619
619
|
];
|
|
620
620
|
|
|
621
|
-
/*
|
|
622
|
-
* Public API Surface of chat4app-client-angular
|
|
621
|
+
/*
|
|
622
|
+
* Public API Surface of chat4app-client-angular
|
|
623
623
|
*/
|
|
624
624
|
|
|
625
|
-
/**
|
|
626
|
-
* Generated bundle index. Do not edit.
|
|
625
|
+
/**
|
|
626
|
+
* Generated bundle index. Do not edit.
|
|
627
627
|
*/
|
|
628
628
|
|
|
629
629
|
export { Chat4App, Chat4AppConfig, Chat4AppMessageReceive, Chat4AppMessageReceiveData, Chat4AppMessageReceiveNotification, Chat4AppTranslate, Chat4appClientAngularComponent, Chat4appClientAngularModule, Chat4appClientAngularService, ChatFilterRequest4App, ChatFilterType, ChatGroupApp, ChatMessage4App, ChatMessageFile4App, ChatMessageMeta4App, ChatStatus4App, ChatUser4App, ChatUserResponse4App, ChatUserStatus4App, GroupStatus4App };
|