podchat-browser 12.9.3 → 12.9.4
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/changelog.md +13 -1
- package/dist/node/buildConfig.json +1 -1
- package/dist/node/chat.js +130 -121
- package/dist/node/lib/sdkParams.js +19 -0
- package/dist/podchat-browser-bundle.js +3273 -3695
- package/examples/index.html +20 -0
- package/package.json +2 -2
- package/src/buildConfig.json +1 -1
- package/src/chat.js +222 -207
- package/src/lib/sdkParams.js +13 -0
package/src/chat.js
CHANGED
|
@@ -22,27 +22,32 @@ import {
|
|
|
22
22
|
|
|
23
23
|
import deviceManager from "./lib/call/deviceManager.js";
|
|
24
24
|
import {store} from "./lib/store";
|
|
25
|
+
import {sdkParams} from "./lib/sdkParams";
|
|
25
26
|
|
|
26
27
|
function Chat(params) {
|
|
27
28
|
/*******************************************************
|
|
28
29
|
* P R I V A T E V A R I A B L E S *
|
|
29
30
|
*******************************************************/
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
sdkParams.token = params.token || "111";
|
|
32
|
+
sdkParams.generalTypeCode = params.typeCode || 'default';
|
|
33
|
+
sdkParams.typeCodeOwnerId = params.typeCodeOwnerId || null;
|
|
34
|
+
sdkParams.mapApiKey = params.mapApiKey || '8b77db18704aa646ee5aaea13e7370f4f88b9e8c';
|
|
35
|
+
sdkParams.productEnv = (typeof navigator != 'undefined') ? navigator.product : 'undefined';
|
|
36
|
+
sdkParams.forceWaitQueueInMemory = (params.forceWaitQueueInMemory && typeof params.forceWaitQueueInMemory === 'boolean') ? params.forceWaitQueueInMemory : false;
|
|
37
|
+
sdkParams.grantDeviceIdFromSSO = (params.grantDeviceIdFromSSO && typeof params.grantDeviceIdFromSSO === 'boolean')
|
|
38
|
+
? params.grantDeviceIdFromSSO
|
|
39
|
+
: false;
|
|
40
|
+
sdkParams.deliveryIntervalPitch = params.deliveryIntervalPitch || 2000;
|
|
41
|
+
sdkParams.seenIntervalPitch = params.seenIntervalPitch || 2000;
|
|
42
|
+
sdkParams.systemMessageIntervalPitch = params.systemMessageIntervalPitch || 1000;
|
|
32
43
|
var asyncClient,
|
|
33
44
|
peerId,
|
|
34
45
|
oldPeerId,
|
|
35
|
-
token = params.token || "111",
|
|
36
|
-
generalTypeCode = params.typeCode || 'default',
|
|
37
|
-
typeCodeOwnerId = params.typeCodeOwnerId || null,
|
|
38
|
-
mapApiKey = params.mapApiKey || '8b77db18704aa646ee5aaea13e7370f4f88b9e8c',
|
|
39
46
|
deviceId,
|
|
40
|
-
productEnv = (typeof navigator != 'undefined') ? navigator.product : 'undefined',
|
|
41
47
|
db,
|
|
42
48
|
queueDb,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
cacheInMemory = forceWaitQueueInMemory ? true : !hasCache,
|
|
49
|
+
hasCache = sdkParams.productEnv !== 'ReactNative' && typeof Dexie != 'undefined',
|
|
50
|
+
cacheInMemory = sdkParams.forceWaitQueueInMemory ? true : !hasCache,
|
|
46
51
|
enableCache = (params.enableCache && typeof params.enableCache === 'boolean') ? params.enableCache : false,
|
|
47
52
|
canUseCache = hasCache && enableCache,
|
|
48
53
|
isCacheReady = false,
|
|
@@ -50,22 +55,16 @@ function Chat(params) {
|
|
|
50
55
|
cacheExpireTime = params.cacheExpireTime || 2 * 24 * 60 * 60 * 1000,
|
|
51
56
|
cacheSecret = 'VjaaS9YxNdVVAd3cAsRPcU5FyxRcyyV6tG6bFGjjK5RV8JJjLrXNbS5zZxnqUT6Y',
|
|
52
57
|
cacheSyncWorker,
|
|
53
|
-
grantDeviceIdFromSSO = (params.grantDeviceIdFromSSO && typeof params.grantDeviceIdFromSSO === 'boolean')
|
|
54
|
-
? params.grantDeviceIdFromSSO
|
|
55
|
-
: false,
|
|
56
58
|
messagesDelivery = {},
|
|
57
59
|
messagesSeen = {},
|
|
58
60
|
deliveryInterval,
|
|
59
|
-
deliveryIntervalPitch = params.deliveryIntervalPitch || 2000,
|
|
60
61
|
seenInterval,
|
|
61
|
-
seenIntervalPitch = params.seenIntervalPitch || 2000,
|
|
62
62
|
getImageFromLinkObjects = {},
|
|
63
63
|
locationPingTypes = {
|
|
64
64
|
'CHAT': 1,
|
|
65
65
|
'THREAD': 2,
|
|
66
66
|
'CONTACTS': 3
|
|
67
67
|
},
|
|
68
|
-
systemMessageIntervalPitch = params.systemMessageIntervalPitch || 1000,
|
|
69
68
|
isTypingInterval,
|
|
70
69
|
protocol = params.protocol || 'websocket',
|
|
71
70
|
queueHost = params.queueHost,
|
|
@@ -204,8 +203,8 @@ function Chat(params) {
|
|
|
204
203
|
asyncClient: asyncClient,
|
|
205
204
|
//Utility: Utility,
|
|
206
205
|
consoleLogging: consoleLogging,
|
|
207
|
-
generalTypeCode: generalTypeCode,
|
|
208
|
-
typeCodeOwnerId,
|
|
206
|
+
generalTypeCode: sdkParams.generalTypeCode,
|
|
207
|
+
typeCodeOwnerId: sdkParams.typeCodeOwnerId,
|
|
209
208
|
chatPingMessageInterval: chatPingMessageInterval,
|
|
210
209
|
asyncRequestTimeout: asyncRequestTimeout,
|
|
211
210
|
serverName: serverName,
|
|
@@ -229,7 +228,7 @@ function Chat(params) {
|
|
|
229
228
|
* Initialize Cache Databases
|
|
230
229
|
*/
|
|
231
230
|
startCacheDatabases(function () {
|
|
232
|
-
if (grantDeviceIdFromSSO) {
|
|
231
|
+
if (sdkParams.grantDeviceIdFromSSO) {
|
|
233
232
|
var getDeviceIdWithTokenTime = new Date().getTime();
|
|
234
233
|
getDeviceIdWithToken(function (retrievedDeviceId) {
|
|
235
234
|
if (actualTimingLog) {
|
|
@@ -305,7 +304,7 @@ function Chat(params) {
|
|
|
305
304
|
if (Object.keys(messagesDelivery).length) {
|
|
306
305
|
messagesDeliveryQueueHandler();
|
|
307
306
|
}
|
|
308
|
-
}, deliveryIntervalPitch);
|
|
307
|
+
}, sdkParams.deliveryIntervalPitch);
|
|
309
308
|
|
|
310
309
|
seenInterval && clearInterval(seenInterval);
|
|
311
310
|
|
|
@@ -313,7 +312,7 @@ function Chat(params) {
|
|
|
313
312
|
if (Object.keys(messagesSeen).length) {
|
|
314
313
|
messagesSeenQueueHandler();
|
|
315
314
|
}
|
|
316
|
-
}, seenIntervalPitch);
|
|
315
|
+
}, sdkParams.seenIntervalPitch);
|
|
317
316
|
|
|
318
317
|
//shouldReconnectCall();
|
|
319
318
|
});
|
|
@@ -424,7 +423,7 @@ function Chat(params) {
|
|
|
424
423
|
url: SERVICE_ADDRESSES.SSO_ADDRESS + SERVICES_PATH.SSO_DEVICES,
|
|
425
424
|
method: 'GET',
|
|
426
425
|
headers: {
|
|
427
|
-
'Authorization': 'Bearer ' + token
|
|
426
|
+
'Authorization': 'Bearer ' + sdkParams.token
|
|
428
427
|
}
|
|
429
428
|
};
|
|
430
429
|
|
|
@@ -503,7 +502,7 @@ function Chat(params) {
|
|
|
503
502
|
method: 'POST',
|
|
504
503
|
data: data,
|
|
505
504
|
headers: {
|
|
506
|
-
'Authorization': 'Bearer ' + token
|
|
505
|
+
'Authorization': 'Bearer ' + sdkParams.token
|
|
507
506
|
}
|
|
508
507
|
};
|
|
509
508
|
|
|
@@ -582,7 +581,7 @@ function Chat(params) {
|
|
|
582
581
|
url: SERVICE_ADDRESSES.SSO_ADDRESS + SERVICES_PATH.SSO_GET_KEY + keyId,
|
|
583
582
|
method: 'GET',
|
|
584
583
|
headers: {
|
|
585
|
-
'Authorization': 'Bearer ' + token
|
|
584
|
+
'Authorization': 'Bearer ' + sdkParams.token
|
|
586
585
|
}
|
|
587
586
|
};
|
|
588
587
|
|
|
@@ -965,7 +964,7 @@ function Chat(params) {
|
|
|
965
964
|
|
|
966
965
|
return chatMessaging.sendMessage({
|
|
967
966
|
chatMessageVOType: chatMessageVOTypes.USER_INFO,
|
|
968
|
-
typeCode: generalTypeCode//params.typeCode
|
|
967
|
+
typeCode: sdkParams.generalTypeCode//params.typeCode
|
|
969
968
|
}, {
|
|
970
969
|
onResult: function (result) {
|
|
971
970
|
var returnData = {
|
|
@@ -1236,7 +1235,7 @@ function Chat(params) {
|
|
|
1236
1235
|
* @return {undefined}
|
|
1237
1236
|
*/
|
|
1238
1237
|
chatMessageHandler = function (chatMessage) {
|
|
1239
|
-
if(chatMessage.typeCode && chatMessage.typeCode !== generalTypeCode) {
|
|
1238
|
+
if(chatMessage.typeCode && chatMessage.typeCode !== sdkParams.generalTypeCode) {
|
|
1240
1239
|
return;
|
|
1241
1240
|
}
|
|
1242
1241
|
|
|
@@ -2173,6 +2172,10 @@ function Chat(params) {
|
|
|
2173
2172
|
var threadObject = messageContent;
|
|
2174
2173
|
threadObject.unreadCount = (messageContent.unreadCount) ? messageContent.unreadCount : 0;
|
|
2175
2174
|
|
|
2175
|
+
threadObject.lastSeenMessageTime = (messageContent.lastSeenMessageNanos)
|
|
2176
|
+
? (parseInt(parseInt(messageContent.lastSeenMessageTime) / 1000) * 1000000000) + parseInt(messageContent.lastSeenMessageNanos)
|
|
2177
|
+
: (parseInt(messageContent.lastSeenMessageTime));
|
|
2178
|
+
|
|
2176
2179
|
let localThreadLastSeenUpdated = JSON.parse(JSON.stringify(messageContent));
|
|
2177
2180
|
store.threads.save(localThreadLastSeenUpdated);
|
|
2178
2181
|
store.threads.get(threadId).unreadCount.set(messageContent.unreadCount)
|
|
@@ -3340,13 +3343,6 @@ function Chat(params) {
|
|
|
3340
3343
|
}
|
|
3341
3344
|
}
|
|
3342
3345
|
|
|
3343
|
-
chatEvents.fireEvent('messageEvents', {
|
|
3344
|
-
type: 'MESSAGE_NEW',
|
|
3345
|
-
cache: false,
|
|
3346
|
-
result: {
|
|
3347
|
-
message: message
|
|
3348
|
-
}
|
|
3349
|
-
});
|
|
3350
3346
|
|
|
3351
3347
|
var threadObject = message.conversation;
|
|
3352
3348
|
var lastMessageVoCopy = Object.assign({}, message);
|
|
@@ -3357,6 +3353,16 @@ function Chat(params) {
|
|
|
3357
3353
|
threadObject.lastParticipantName = (!!message.participant && message.participant.hasOwnProperty('name')) ? message.participant.name : '';
|
|
3358
3354
|
threadObject.lastMessage = (message.hasOwnProperty('message')) ? message.message : '';
|
|
3359
3355
|
|
|
3356
|
+
let stringMsg = JSON.parse(JSON.stringify(message));
|
|
3357
|
+
stringMsg.conversation = JSON.parse(JSON.stringify(threadObject));
|
|
3358
|
+
chatEvents.fireEvent('messageEvents', {
|
|
3359
|
+
type: 'MESSAGE_NEW',
|
|
3360
|
+
cache: false,
|
|
3361
|
+
result: {
|
|
3362
|
+
message: stringMsg
|
|
3363
|
+
}
|
|
3364
|
+
});
|
|
3365
|
+
|
|
3360
3366
|
chatEvents.fireEvent('threadEvents', {
|
|
3361
3367
|
type: 'THREAD_UNREAD_COUNT_UPDATED',
|
|
3362
3368
|
result: {
|
|
@@ -3371,17 +3377,21 @@ function Chat(params) {
|
|
|
3371
3377
|
storeThread = store.threads.get(threadObject.id);
|
|
3372
3378
|
}
|
|
3373
3379
|
|
|
3374
|
-
let unreadCount = message.conversation.unreadCount;
|
|
3380
|
+
// let unreadCount = message.conversation.unreadCount;
|
|
3375
3381
|
// store.threads.get(threadObject.id).unreadCount.set();
|
|
3376
3382
|
if(message.ownerId != chatMessaging.userInfo.id) {
|
|
3377
|
-
if(unreadCount)
|
|
3378
|
-
storeThread.unreadCount.set(
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3383
|
+
if(!storeThread.unreadCount.get())
|
|
3384
|
+
storeThread.unreadCount.set(1);
|
|
3385
|
+
else
|
|
3386
|
+
storeThread.unreadCount.increase();
|
|
3387
|
+
// if(unreadCount) {
|
|
3388
|
+
// storeThread.unreadCount.set(unreadCount);
|
|
3389
|
+
// } else {
|
|
3390
|
+
// if(!storeThread.unreadCount.get())
|
|
3391
|
+
// storeThread.unreadCount.set(1);
|
|
3392
|
+
// else
|
|
3393
|
+
// storeThread.unreadCount.increase();
|
|
3394
|
+
// }
|
|
3385
3395
|
} else {
|
|
3386
3396
|
storeThread.unreadCount.set(0);
|
|
3387
3397
|
}
|
|
@@ -4285,9 +4295,14 @@ function Chat(params) {
|
|
|
4285
4295
|
* - text {string}
|
|
4286
4296
|
* - notifyAll {boolean}
|
|
4287
4297
|
*/
|
|
4298
|
+
pushMessageVO.time = (pushMessageVO.timeNanos)
|
|
4299
|
+
? (parseInt(parseInt(pushMessageVO.time) / 1000) * 1000000000) + parseInt(pushMessageVO.timeNanos)
|
|
4300
|
+
: (parseInt(pushMessageVO.time));
|
|
4301
|
+
|
|
4288
4302
|
var pinMessage = {
|
|
4289
4303
|
threadId: threadId,
|
|
4290
4304
|
time: pushMessageVO.time,
|
|
4305
|
+
timeNanos: pushMessageVO.timeNanos,
|
|
4291
4306
|
sender: pushMessageVO.sender,
|
|
4292
4307
|
messageId: pushMessageVO.messageId,
|
|
4293
4308
|
text: pushMessageVO.text,
|
|
@@ -4496,7 +4511,7 @@ function Chat(params) {
|
|
|
4496
4511
|
|
|
4497
4512
|
var sendMessageParams = {
|
|
4498
4513
|
chatMessageVOType: chatMessageVOTypes.GET_THREADS,
|
|
4499
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
4514
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
4500
4515
|
content: content
|
|
4501
4516
|
};
|
|
4502
4517
|
|
|
@@ -4638,7 +4653,7 @@ function Chat(params) {
|
|
|
4638
4653
|
* thread's last section
|
|
4639
4654
|
*/
|
|
4640
4655
|
|
|
4641
|
-
if (typeof Worker !== 'undefined' && productEnv !== 'ReactNative' && canUseCache && cacheSecret.length > 0) {
|
|
4656
|
+
if (typeof Worker !== 'undefined' && sdkParams.productEnv !== 'ReactNative' && canUseCache && cacheSecret.length > 0) {
|
|
4642
4657
|
if (typeof cacheSyncWorker === 'undefined') {
|
|
4643
4658
|
var plainWorker = function () {
|
|
4644
4659
|
self.importScripts('https://npmcdn.com/dexie@2.0.4/dist/dexie.min.js');
|
|
@@ -4782,7 +4797,7 @@ function Chat(params) {
|
|
|
4782
4797
|
getAllThreads = function (params, callback) {
|
|
4783
4798
|
var sendMessageParams = {
|
|
4784
4799
|
chatMessageVOType: chatMessageVOTypes.GET_THREADS,
|
|
4785
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
4800
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
4786
4801
|
content: {}
|
|
4787
4802
|
};
|
|
4788
4803
|
|
|
@@ -4857,7 +4872,7 @@ function Chat(params) {
|
|
|
4857
4872
|
if (parseInt(params.threadId) > 0) {
|
|
4858
4873
|
var sendMessageParams = {
|
|
4859
4874
|
chatMessageVOType: chatMessageVOTypes.GET_HISTORY,
|
|
4860
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
4875
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
4861
4876
|
content: {},
|
|
4862
4877
|
subjectId: params.threadId
|
|
4863
4878
|
},
|
|
@@ -6047,10 +6062,10 @@ function Chat(params) {
|
|
|
6047
6062
|
updateThreadInfo = function (params, callback) {
|
|
6048
6063
|
var updateThreadInfoData = {
|
|
6049
6064
|
chatMessageVOType: chatMessageVOTypes.UPDATE_THREAD_INFO,
|
|
6050
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
6065
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
6051
6066
|
content: {},
|
|
6052
6067
|
pushMsgType: 3,
|
|
6053
|
-
token: token
|
|
6068
|
+
token: sdkParams.token
|
|
6054
6069
|
},
|
|
6055
6070
|
threadInfoContent = {},
|
|
6056
6071
|
fileUploadParams = {},
|
|
@@ -6113,13 +6128,13 @@ function Chat(params) {
|
|
|
6113
6128
|
putInChatUploadQueue({
|
|
6114
6129
|
message: {
|
|
6115
6130
|
chatMessageVOType: chatMessageVOTypes.UPDATE_THREAD_INFO,
|
|
6116
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
6131
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
6117
6132
|
subjectId: threadId,
|
|
6118
6133
|
content: threadInfoContent,
|
|
6119
6134
|
metadata: threadInfoContent.metadata,
|
|
6120
6135
|
uniqueId: fileUniqueId,
|
|
6121
6136
|
pushMsgType: 3,
|
|
6122
|
-
token: token
|
|
6137
|
+
token: sdkParams.token
|
|
6123
6138
|
},
|
|
6124
6139
|
callbacks: callback
|
|
6125
6140
|
}, function () {
|
|
@@ -6164,13 +6179,13 @@ function Chat(params) {
|
|
|
6164
6179
|
|
|
6165
6180
|
return chatMessaging.sendMessage({
|
|
6166
6181
|
chatMessageVOType: chatMessageVOTypes.UPDATE_THREAD_INFO,
|
|
6167
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
6182
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
6168
6183
|
subjectId: threadId,
|
|
6169
6184
|
content: threadInfoContent,
|
|
6170
6185
|
metadata: threadInfoContent.metadata,
|
|
6171
6186
|
uniqueId: fileUniqueId,
|
|
6172
6187
|
pushMsgType: 3,
|
|
6173
|
-
token: token
|
|
6188
|
+
token: sdkParams.token
|
|
6174
6189
|
}, {
|
|
6175
6190
|
onResult: function (result) {
|
|
6176
6191
|
callback && callback(result);
|
|
@@ -6183,13 +6198,13 @@ function Chat(params) {
|
|
|
6183
6198
|
|
|
6184
6199
|
return chatMessaging.sendMessage({
|
|
6185
6200
|
chatMessageVOType: chatMessageVOTypes.UPDATE_THREAD_INFO,
|
|
6186
|
-
typeCode: generalTypeCode,//params.typeCode,
|
|
6201
|
+
typeCode: sdkParams.generalTypeCode,//params.typeCode,
|
|
6187
6202
|
subjectId: threadId,
|
|
6188
6203
|
content: threadInfoContent,
|
|
6189
6204
|
metadata: threadInfoContent.metadata,
|
|
6190
6205
|
uniqueId: fileUniqueId,
|
|
6191
6206
|
pushMsgType: 3,
|
|
6192
|
-
token: token
|
|
6207
|
+
token: sdkParams.token
|
|
6193
6208
|
}, {
|
|
6194
6209
|
onResult: function (result) {
|
|
6195
6210
|
callback && callback(result);
|
|
@@ -6220,7 +6235,7 @@ function Chat(params) {
|
|
|
6220
6235
|
chatMessageVOType: chatMessageVOTypes.UPDATE_CHAT_PROFILE,
|
|
6221
6236
|
content: {},
|
|
6222
6237
|
pushMsgType: 3,
|
|
6223
|
-
token: token
|
|
6238
|
+
token: sdkParams.token
|
|
6224
6239
|
};
|
|
6225
6240
|
if (params) {
|
|
6226
6241
|
if (typeof params.bio == 'string') {
|
|
@@ -6257,7 +6272,7 @@ function Chat(params) {
|
|
|
6257
6272
|
chatMessageVOType: chatMessageVOTypes.GET_PARTICIPANT_ROLES,
|
|
6258
6273
|
pushMsgType: 3,
|
|
6259
6274
|
subjectId: params.threadId,
|
|
6260
|
-
token: token
|
|
6275
|
+
token: sdkParams.token
|
|
6261
6276
|
};
|
|
6262
6277
|
return chatMessaging.sendMessage(updateChatProfileData, {
|
|
6263
6278
|
onResult: function (result) {
|
|
@@ -6283,7 +6298,7 @@ function Chat(params) {
|
|
|
6283
6298
|
getThreadParticipants = function (params, callback) {
|
|
6284
6299
|
var sendMessageParams = {
|
|
6285
6300
|
chatMessageVOType: chatMessageVOTypes.THREAD_PARTICIPANTS,
|
|
6286
|
-
typeCode: generalTypeCode,//params.typeCode,
|
|
6301
|
+
typeCode: sdkParams.generalTypeCode,//params.typeCode,
|
|
6287
6302
|
content: {},
|
|
6288
6303
|
subjectId: params.threadId
|
|
6289
6304
|
},
|
|
@@ -6529,7 +6544,7 @@ function Chat(params) {
|
|
|
6529
6544
|
deliver = function (params) {
|
|
6530
6545
|
return chatMessaging.sendMessage({
|
|
6531
6546
|
chatMessageVOType: chatMessageVOTypes.DELIVERY,
|
|
6532
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
6547
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
6533
6548
|
content: params.messageId,
|
|
6534
6549
|
pushMsgType: 3
|
|
6535
6550
|
});
|
|
@@ -6549,7 +6564,7 @@ function Chat(params) {
|
|
|
6549
6564
|
seen = function (params) {
|
|
6550
6565
|
return chatMessaging.sendMessage({
|
|
6551
6566
|
chatMessageVOType: chatMessageVOTypes.SEEN,
|
|
6552
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
6567
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
6553
6568
|
content: params.messageId,
|
|
6554
6569
|
pushMsgType: 3
|
|
6555
6570
|
});
|
|
@@ -6711,7 +6726,7 @@ function Chat(params) {
|
|
|
6711
6726
|
}
|
|
6712
6727
|
|
|
6713
6728
|
if (params.responseType === 'link') {
|
|
6714
|
-
var returnLink = SERVICE_ADDRESSES.PODSPACE_FILESERVER_ADDRESS + SERVICES_PATH.PODSPACE_DOWNLOAD_FILE + `?hash=${params.hashCode}&_token_=${token}&_token_issuer_=1`;
|
|
6729
|
+
var returnLink = SERVICE_ADDRESSES.PODSPACE_FILESERVER_ADDRESS + SERVICES_PATH.PODSPACE_DOWNLOAD_FILE + `?hash=${params.hashCode}&_token_=${sdkParams.token}&_token_issuer_=1`;
|
|
6715
6730
|
|
|
6716
6731
|
callback({
|
|
6717
6732
|
hasError: false,
|
|
@@ -6726,7 +6741,7 @@ function Chat(params) {
|
|
|
6726
6741
|
responseType: 'blob',
|
|
6727
6742
|
uniqueId: downloadUniqueId,
|
|
6728
6743
|
headers: {
|
|
6729
|
-
'_token_': token,
|
|
6744
|
+
'_token_': sdkParams.token,
|
|
6730
6745
|
'_token_issuer_': 1,
|
|
6731
6746
|
// 'Range': 'bytes=100-200'
|
|
6732
6747
|
},
|
|
@@ -6802,7 +6817,7 @@ function Chat(params) {
|
|
|
6802
6817
|
responseType: 'blob',
|
|
6803
6818
|
uniqueId: downloadUniqueId,
|
|
6804
6819
|
headers: {
|
|
6805
|
-
'Authorization': 'Bearer ' + token
|
|
6820
|
+
'Authorization': 'Bearer ' + sdkParams.token
|
|
6806
6821
|
},
|
|
6807
6822
|
enableDownloadProgressEvents: params.enableDownloadProgressEvents,
|
|
6808
6823
|
hashCode: params.hashCode
|
|
@@ -6869,7 +6884,7 @@ function Chat(params) {
|
|
|
6869
6884
|
}
|
|
6870
6885
|
|
|
6871
6886
|
if (params.responseType === 'link') {
|
|
6872
|
-
var returnLink = SERVICE_ADDRESSES.PODSPACE_FILESERVER_ADDRESS + SERVICES_PATH.PODSPACE_DOWNLOAD_IMAGE + `?hash=${params.hashCode}&_token_=${token}&_token_issuer_=1&size=${params.size}&quality=${params.quality}&crop=${params.crop}`;
|
|
6887
|
+
var returnLink = SERVICE_ADDRESSES.PODSPACE_FILESERVER_ADDRESS + SERVICES_PATH.PODSPACE_DOWNLOAD_IMAGE + `?hash=${params.hashCode}&_token_=${sdkParams.token}&_token_issuer_=1&size=${params.size}&quality=${params.quality}&crop=${params.crop}`;
|
|
6873
6888
|
|
|
6874
6889
|
callback({
|
|
6875
6890
|
hasError: false,
|
|
@@ -6883,7 +6898,7 @@ function Chat(params) {
|
|
|
6883
6898
|
uniqueId: downloadUniqueId,
|
|
6884
6899
|
responseType: 'blob',
|
|
6885
6900
|
headers: {
|
|
6886
|
-
'_token_': token,
|
|
6901
|
+
'_token_': sdkParams.token,
|
|
6887
6902
|
'_token_issuer_': 1
|
|
6888
6903
|
},
|
|
6889
6904
|
data: getImageData
|
|
@@ -6924,7 +6939,7 @@ function Chat(params) {
|
|
|
6924
6939
|
responseType: 'blob',
|
|
6925
6940
|
uniqueId: downloadUniqueId,
|
|
6926
6941
|
headers: {
|
|
6927
|
-
'_token_': token,
|
|
6942
|
+
'_token_': sdkParams.token,
|
|
6928
6943
|
'_token_issuer_': 1
|
|
6929
6944
|
},
|
|
6930
6945
|
data: getImageData
|
|
@@ -7005,7 +7020,7 @@ function Chat(params) {
|
|
|
7005
7020
|
uniqueId: downloadUniqueId,
|
|
7006
7021
|
responseType: 'blob',
|
|
7007
7022
|
headers: {
|
|
7008
|
-
'Authorization': 'Bearer ' + token
|
|
7023
|
+
'Authorization': 'Bearer ' + sdkParams.token
|
|
7009
7024
|
},
|
|
7010
7025
|
enableDownloadProgressEvents: params.enableDownloadProgressEvents,
|
|
7011
7026
|
hashCode: params.hashCode
|
|
@@ -7048,7 +7063,7 @@ function Chat(params) {
|
|
|
7048
7063
|
responseType: 'blob',
|
|
7049
7064
|
uniqueId: downloadUniqueId,
|
|
7050
7065
|
headers: {
|
|
7051
|
-
'Authorization': 'Bearer ' + token
|
|
7066
|
+
'Authorization': 'Bearer ' + sdkParams.token
|
|
7052
7067
|
},
|
|
7053
7068
|
enableDownloadProgressEvents: params.enableDownloadProgressEvents,
|
|
7054
7069
|
hashCode: params.hashCode
|
|
@@ -7245,7 +7260,7 @@ function Chat(params) {
|
|
|
7245
7260
|
url: SERVICE_ADDRESSES.FILESERVER_ADDRESS + SERVICES_PATH.UPLOAD_FILE,
|
|
7246
7261
|
method: 'POST',
|
|
7247
7262
|
headers: {
|
|
7248
|
-
'_token_': token,
|
|
7263
|
+
'_token_': sdkParams.token,
|
|
7249
7264
|
'_token_issuer_': 1
|
|
7250
7265
|
},
|
|
7251
7266
|
data: uploadFileData,
|
|
@@ -7369,7 +7384,7 @@ function Chat(params) {
|
|
|
7369
7384
|
url: SERVICE_ADDRESSES.PODSPACE_FILESERVER_ADDRESS + SERVICES_PATH.PODSPACE_UPLOAD_FILE_TO_USERGROUP,
|
|
7370
7385
|
method: 'POST',
|
|
7371
7386
|
headers: {
|
|
7372
|
-
'_token_': token,
|
|
7387
|
+
'_token_': sdkParams.token,
|
|
7373
7388
|
'_token_issuer_': 1
|
|
7374
7389
|
},
|
|
7375
7390
|
data: uploadFileData,
|
|
@@ -7472,7 +7487,7 @@ function Chat(params) {
|
|
|
7472
7487
|
url: SERVICE_ADDRESSES.PODSPACE_FILESERVER_ADDRESS + SERVICES_PATH.PODSPACE_UPLOAD_FILE_NEW,
|
|
7473
7488
|
method: 'POST',
|
|
7474
7489
|
headers: {
|
|
7475
|
-
'Authorization': 'Bearer ' + token
|
|
7490
|
+
'Authorization': 'Bearer ' + sdkParams.token
|
|
7476
7491
|
},
|
|
7477
7492
|
data: uploadFileData,
|
|
7478
7493
|
uniqueId: uploadUniqueId
|
|
@@ -7586,7 +7601,7 @@ function Chat(params) {
|
|
|
7586
7601
|
url: SERVICE_ADDRESSES.PODSPACE_FILESERVER_ADDRESS + SERVICES_PATH.PODSPACE_UPLOAD_FILE_TO_USERGROUP_NEW.replace('{userGroupHash}', uploadFileData.userGroupHash),
|
|
7587
7602
|
method: 'POST',
|
|
7588
7603
|
headers: {
|
|
7589
|
-
'Authorization': 'Bearer ' + token,
|
|
7604
|
+
'Authorization': 'Bearer ' + sdkParams.token,
|
|
7590
7605
|
},
|
|
7591
7606
|
data: uploadFileData,
|
|
7592
7607
|
uniqueId: uploadUniqueId
|
|
@@ -7689,7 +7704,7 @@ function Chat(params) {
|
|
|
7689
7704
|
url: SERVICE_ADDRESSES.POD_DRIVE_ADDRESS + SERVICES_PATH.DRIVE_UPLOAD_FILE_FROM_URL,
|
|
7690
7705
|
method: 'POST',
|
|
7691
7706
|
headers: {
|
|
7692
|
-
'_token_': token,
|
|
7707
|
+
'_token_': sdkParams.token,
|
|
7693
7708
|
'_token_issuer_': 1
|
|
7694
7709
|
},
|
|
7695
7710
|
data: uploadFileData,
|
|
@@ -7828,7 +7843,7 @@ function Chat(params) {
|
|
|
7828
7843
|
url: SERVICE_ADDRESSES.FILESERVER_ADDRESS + SERVICES_PATH.UPLOAD_IMAGE,
|
|
7829
7844
|
method: 'POST',
|
|
7830
7845
|
headers: {
|
|
7831
|
-
'_token_': token,
|
|
7846
|
+
'_token_': sdkParams.token,
|
|
7832
7847
|
'_token_issuer_': 1
|
|
7833
7848
|
},
|
|
7834
7849
|
data: uploadImageData,
|
|
@@ -7986,7 +8001,7 @@ function Chat(params) {
|
|
|
7986
8001
|
url: SERVICE_ADDRESSES.PODSPACE_FILESERVER_ADDRESS + SERVICES_PATH.PODSPACE_UPLOAD_IMAGE,
|
|
7987
8002
|
method: 'POST',
|
|
7988
8003
|
headers: {
|
|
7989
|
-
'_token_': token,
|
|
8004
|
+
'_token_': sdkParams.token,
|
|
7990
8005
|
'_token_issuer_': 1
|
|
7991
8006
|
},
|
|
7992
8007
|
data: uploadImageData,
|
|
@@ -8123,7 +8138,7 @@ function Chat(params) {
|
|
|
8123
8138
|
url: SERVICE_ADDRESSES.PODSPACE_FILESERVER_ADDRESS + SERVICES_PATH.PODSPACE_UPLOAD_IMAGE_NEW,
|
|
8124
8139
|
method: 'POST',
|
|
8125
8140
|
headers: {
|
|
8126
|
-
'Authorization': 'Bearer ' + token,
|
|
8141
|
+
'Authorization': 'Bearer ' + sdkParams.token,
|
|
8127
8142
|
},
|
|
8128
8143
|
data: uploadImageData,
|
|
8129
8144
|
uniqueId: uploadUniqueId
|
|
@@ -8276,7 +8291,7 @@ function Chat(params) {
|
|
|
8276
8291
|
url: SERVICE_ADDRESSES.PODSPACE_FILESERVER_ADDRESS + SERVICES_PATH.PODSPACE_UPLOAD_IMAGE_TO_USERGROUP,
|
|
8277
8292
|
method: 'POST',
|
|
8278
8293
|
headers: {
|
|
8279
|
-
'_token_': token,
|
|
8294
|
+
'_token_': sdkParams.token,
|
|
8280
8295
|
'_token_issuer_': 1
|
|
8281
8296
|
},
|
|
8282
8297
|
data: uploadImageData,
|
|
@@ -8446,7 +8461,7 @@ function Chat(params) {
|
|
|
8446
8461
|
url: SERVICE_ADDRESSES.PODSPACE_FILESERVER_ADDRESS + SERVICES_PATH.PODSPACE_UPLOAD_IMAGE_TO_USERGROUP_NEW.replace('{userGroupHash}', uploadImageData.userGroupHash),
|
|
8447
8462
|
method: 'POST',
|
|
8448
8463
|
headers: {
|
|
8449
|
-
'Authorization': 'Bearer ' + token,
|
|
8464
|
+
'Authorization': 'Bearer ' + sdkParams.token,
|
|
8450
8465
|
},
|
|
8451
8466
|
data: uploadImageData,
|
|
8452
8467
|
uniqueId: uploadUniqueId
|
|
@@ -8550,7 +8565,7 @@ function Chat(params) {
|
|
|
8550
8565
|
putInChatUploadQueue({
|
|
8551
8566
|
message: {
|
|
8552
8567
|
chatMessageVOType: chatMessageVOTypes.MESSAGE,
|
|
8553
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
8568
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
8554
8569
|
messageType: (params.messageType && typeof params.messageType.toUpperCase() !== 'undefined' && chatMessageTypes[params.messageType.toUpperCase()] > 0) ? chatMessageTypes[params.messageType.toUpperCase()] : 1,
|
|
8555
8570
|
subjectId: params.threadId,
|
|
8556
8571
|
repliedTo: params.repliedTo,
|
|
@@ -8819,7 +8834,7 @@ function Chat(params) {
|
|
|
8819
8834
|
*/
|
|
8820
8835
|
getChatWaitQueue = function (threadId, active, callback) {
|
|
8821
8836
|
if (active && threadId > 0) {
|
|
8822
|
-
if (hasCache && typeof queueDb == 'object' && !forceWaitQueueInMemory) {
|
|
8837
|
+
if (hasCache && typeof queueDb == 'object' && !sdkParams.forceWaitQueueInMemory) {
|
|
8823
8838
|
queueDb.waitQ.where('threadId')
|
|
8824
8839
|
.equals(threadId)
|
|
8825
8840
|
.and(function (item) {
|
|
@@ -8989,7 +9004,7 @@ function Chat(params) {
|
|
|
8989
9004
|
* @return {undefined}
|
|
8990
9005
|
*/
|
|
8991
9006
|
deleteFromChatWaitQueue = function (item, callback) {
|
|
8992
|
-
if (hasCache && typeof queueDb == 'object' && !forceWaitQueueInMemory) {
|
|
9007
|
+
if (hasCache && typeof queueDb == 'object' && !sdkParams.forceWaitQueueInMemory) {
|
|
8993
9008
|
queueDb.waitQ.where('uniqueId')
|
|
8994
9009
|
.equals(item.uniqueId)
|
|
8995
9010
|
.and(function (item) {
|
|
@@ -9036,7 +9051,7 @@ function Chat(params) {
|
|
|
9036
9051
|
},
|
|
9037
9052
|
|
|
9038
9053
|
deleteThreadFailedMessagesFromWaitQueue = function (threadId, callback) {
|
|
9039
|
-
if (hasCache && typeof queueDb == 'object' && !forceWaitQueueInMemory) {
|
|
9054
|
+
if (hasCache && typeof queueDb == 'object' && !sdkParams.forceWaitQueueInMemory) {
|
|
9040
9055
|
queueDb.waitQ.where('threadId')
|
|
9041
9056
|
.equals(threadId)
|
|
9042
9057
|
.and(function (item) {
|
|
@@ -9107,7 +9122,7 @@ function Chat(params) {
|
|
|
9107
9122
|
var waitQueueUniqueId = (typeof item.uniqueId == 'string') ? item.uniqueId : (Array.isArray(item.uniqueId)) ? item.uniqueId[0] : null;
|
|
9108
9123
|
|
|
9109
9124
|
if (waitQueueUniqueId != null) {
|
|
9110
|
-
if (hasCache && typeof queueDb == 'object' && !forceWaitQueueInMemory) {
|
|
9125
|
+
if (hasCache && typeof queueDb == 'object' && !sdkParams.forceWaitQueueInMemory) {
|
|
9111
9126
|
queueDb.waitQ
|
|
9112
9127
|
.put({
|
|
9113
9128
|
threadId: parseInt(item.subjectId),
|
|
@@ -9136,7 +9151,7 @@ function Chat(params) {
|
|
|
9136
9151
|
},
|
|
9137
9152
|
|
|
9138
9153
|
getItemFromChatWaitQueue = function (uniqueId, callback) {
|
|
9139
|
-
if (hasCache && typeof queueDb == 'object' && !forceWaitQueueInMemory) {
|
|
9154
|
+
if (hasCache && typeof queueDb == 'object' && !sdkParams.forceWaitQueueInMemory) {
|
|
9140
9155
|
queueDb.waitQ.where('uniqueId')
|
|
9141
9156
|
.equals(uniqueId)
|
|
9142
9157
|
.and(function (item) {
|
|
@@ -9339,10 +9354,10 @@ function Chat(params) {
|
|
|
9339
9354
|
setRoleToUser = function (params, callback) {
|
|
9340
9355
|
var setRoleData = {
|
|
9341
9356
|
chatMessageVOType: chatMessageVOTypes.SET_ROLE_TO_USER,
|
|
9342
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
9357
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
9343
9358
|
content: [],
|
|
9344
9359
|
pushMsgType: 3,
|
|
9345
|
-
token: token
|
|
9360
|
+
token: sdkParams.token
|
|
9346
9361
|
};
|
|
9347
9362
|
|
|
9348
9363
|
if (params) {
|
|
@@ -9378,10 +9393,10 @@ function Chat(params) {
|
|
|
9378
9393
|
removeRoleFromUser = function (params, callback) {
|
|
9379
9394
|
var setAdminData = {
|
|
9380
9395
|
chatMessageVOType: chatMessageVOTypes.REMOVE_ROLE_FROM_USER,
|
|
9381
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
9396
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
9382
9397
|
content: [],
|
|
9383
9398
|
pushMsgType: 3,
|
|
9384
|
-
token: token
|
|
9399
|
+
token: sdkParams.token
|
|
9385
9400
|
};
|
|
9386
9401
|
|
|
9387
9402
|
if (params) {
|
|
@@ -9417,13 +9432,13 @@ function Chat(params) {
|
|
|
9417
9432
|
unPinMessage = function (params, callback) {
|
|
9418
9433
|
return chatMessaging.sendMessage({
|
|
9419
9434
|
chatMessageVOType: chatMessageVOTypes.UNPIN_MESSAGE,
|
|
9420
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
9435
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
9421
9436
|
subjectId: params.messageId,
|
|
9422
9437
|
content: JSON.stringify({
|
|
9423
9438
|
'notifyAll': (typeof params.notifyAll === 'boolean') ? params.notifyAll : false
|
|
9424
9439
|
}),
|
|
9425
9440
|
pushMsgType: 3,
|
|
9426
|
-
token: token
|
|
9441
|
+
token: sdkParams.token
|
|
9427
9442
|
}, {
|
|
9428
9443
|
onResult: function (result) {
|
|
9429
9444
|
callback && callback(result);
|
|
@@ -9568,7 +9583,7 @@ function Chat(params) {
|
|
|
9568
9583
|
method: 'GET',
|
|
9569
9584
|
data: data,
|
|
9570
9585
|
headers: {
|
|
9571
|
-
'Api-Key': mapApiKey
|
|
9586
|
+
'Api-Key': sdkParams.mapApiKey
|
|
9572
9587
|
}
|
|
9573
9588
|
};
|
|
9574
9589
|
|
|
@@ -9620,7 +9635,7 @@ function Chat(params) {
|
|
|
9620
9635
|
method: 'GET',
|
|
9621
9636
|
data: data,
|
|
9622
9637
|
headers: {
|
|
9623
|
-
'Api-Key': mapApiKey
|
|
9638
|
+
'Api-Key': sdkParams.mapApiKey
|
|
9624
9639
|
}
|
|
9625
9640
|
};
|
|
9626
9641
|
|
|
@@ -9682,7 +9697,7 @@ function Chat(params) {
|
|
|
9682
9697
|
method: 'GET',
|
|
9683
9698
|
data: data,
|
|
9684
9699
|
headers: {
|
|
9685
|
-
'Api-Key': mapApiKey
|
|
9700
|
+
'Api-Key': sdkParams.mapApiKey
|
|
9686
9701
|
}
|
|
9687
9702
|
};
|
|
9688
9703
|
|
|
@@ -9760,7 +9775,7 @@ function Chat(params) {
|
|
|
9760
9775
|
});
|
|
9761
9776
|
}
|
|
9762
9777
|
|
|
9763
|
-
data.key = mapApiKey;
|
|
9778
|
+
data.key = sdkParams.mapApiKey;
|
|
9764
9779
|
}
|
|
9765
9780
|
|
|
9766
9781
|
var keys = Object.keys(data);
|
|
@@ -9842,7 +9857,7 @@ function Chat(params) {
|
|
|
9842
9857
|
publicized.getUserInfo = function (callback) {
|
|
9843
9858
|
return chatMessaging.sendMessage({
|
|
9844
9859
|
chatMessageVOType: chatMessageVOTypes.USER_INFO,
|
|
9845
|
-
typeCode: generalTypeCode
|
|
9860
|
+
typeCode: sdkParams.generalTypeCode
|
|
9846
9861
|
}, {
|
|
9847
9862
|
onResult: function (result) {
|
|
9848
9863
|
var returnData = {
|
|
@@ -9877,7 +9892,7 @@ function Chat(params) {
|
|
|
9877
9892
|
return getHistory({
|
|
9878
9893
|
threadId: params.threadId,
|
|
9879
9894
|
allMentioned: true,
|
|
9880
|
-
typeCode: generalTypeCode,//params.typeCode,
|
|
9895
|
+
typeCode: sdkParams.generalTypeCode,//params.typeCode,
|
|
9881
9896
|
count: params.count || 50,
|
|
9882
9897
|
offset: params.offset || 0,
|
|
9883
9898
|
cache: false,
|
|
@@ -9892,7 +9907,7 @@ function Chat(params) {
|
|
|
9892
9907
|
return getHistory({
|
|
9893
9908
|
threadId: params.threadId,
|
|
9894
9909
|
unreadMentioned: true,
|
|
9895
|
-
typeCode: generalTypeCode,//params.typeCode,
|
|
9910
|
+
typeCode: sdkParams.generalTypeCode,//params.typeCode,
|
|
9896
9911
|
count: params.count || 50,
|
|
9897
9912
|
offset: params.offset || 0,
|
|
9898
9913
|
cache: false,
|
|
@@ -9906,12 +9921,12 @@ function Chat(params) {
|
|
|
9906
9921
|
publicized.getAllUnreadMessagesCount = function (params, callback) {
|
|
9907
9922
|
return chatMessaging.sendMessage({
|
|
9908
9923
|
chatMessageVOType: chatMessageVOTypes.ALL_UNREAD_MESSAGE_COUNT,
|
|
9909
|
-
typeCode: generalTypeCode,//params.typeCode,
|
|
9924
|
+
typeCode: sdkParams.generalTypeCode,//params.typeCode,
|
|
9910
9925
|
content: JSON.stringify({
|
|
9911
9926
|
'mute': (typeof params.countMuteThreads === 'boolean') ? params.countMuteThreads : false
|
|
9912
9927
|
}),
|
|
9913
9928
|
pushMsgType: 3,
|
|
9914
|
-
token: token
|
|
9929
|
+
token: sdkParams.token
|
|
9915
9930
|
}, {
|
|
9916
9931
|
onResult: function (result) {
|
|
9917
9932
|
callback && callback(result);
|
|
@@ -9976,7 +9991,7 @@ function Chat(params) {
|
|
|
9976
9991
|
|
|
9977
9992
|
var sendMessageParams = {
|
|
9978
9993
|
chatMessageVOType: chatMessageVOTypes.GET_CONTACTS,
|
|
9979
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
9994
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
9980
9995
|
content: content
|
|
9981
9996
|
};
|
|
9982
9997
|
|
|
@@ -10216,7 +10231,7 @@ function Chat(params) {
|
|
|
10216
10231
|
*/
|
|
10217
10232
|
var sendMessageParams = {
|
|
10218
10233
|
chatMessageVOType: chatMessageVOTypes.ADD_PARTICIPANT,
|
|
10219
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
10234
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
10220
10235
|
content: []
|
|
10221
10236
|
};
|
|
10222
10237
|
if (params) {
|
|
@@ -10280,7 +10295,7 @@ function Chat(params) {
|
|
|
10280
10295
|
|
|
10281
10296
|
var sendMessageParams = {
|
|
10282
10297
|
chatMessageVOType: chatMessageVOTypes.REMOVE_PARTICIPANT,
|
|
10283
|
-
typeCode: generalTypeCode //params.typeCode
|
|
10298
|
+
typeCode: sdkParams.generalTypeCode //params.typeCode
|
|
10284
10299
|
};
|
|
10285
10300
|
|
|
10286
10301
|
if (params) {
|
|
@@ -10327,7 +10342,7 @@ function Chat(params) {
|
|
|
10327
10342
|
|
|
10328
10343
|
var sendMessageParams = {
|
|
10329
10344
|
chatMessageVOType: chatMessageVOTypes.LEAVE_THREAD,
|
|
10330
|
-
typeCode: generalTypeCode//params.typeCode
|
|
10345
|
+
typeCode: sdkParams.generalTypeCode//params.typeCode
|
|
10331
10346
|
};
|
|
10332
10347
|
|
|
10333
10348
|
if (params) {
|
|
@@ -10480,7 +10495,7 @@ function Chat(params) {
|
|
|
10480
10495
|
|
|
10481
10496
|
var sendMessageParams = {
|
|
10482
10497
|
chatMessageVOType: chatMessageVOTypes.CREATE_THREAD,
|
|
10483
|
-
typeCode: generalTypeCode,//params.typeCode,
|
|
10498
|
+
typeCode: sdkParams.generalTypeCode,//params.typeCode,
|
|
10484
10499
|
content: content
|
|
10485
10500
|
};
|
|
10486
10501
|
|
|
@@ -10571,7 +10586,7 @@ function Chat(params) {
|
|
|
10571
10586
|
|
|
10572
10587
|
var sendMessageParams = {
|
|
10573
10588
|
chatMessageVOType: chatMessageVOTypes.CREATE_THREAD,
|
|
10574
|
-
typeCode: generalTypeCode,//params.typeCode,
|
|
10589
|
+
typeCode: sdkParams.generalTypeCode,//params.typeCode,
|
|
10575
10590
|
content: content
|
|
10576
10591
|
};
|
|
10577
10592
|
|
|
@@ -10610,7 +10625,7 @@ function Chat(params) {
|
|
|
10610
10625
|
putInChatSendQueue({
|
|
10611
10626
|
message: {
|
|
10612
10627
|
chatMessageVOType: chatMessageVOTypes.MESSAGE,
|
|
10613
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
10628
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
10614
10629
|
messageType: (params.messageType && typeof params.messageType.toUpperCase() !== 'undefined' && chatMessageTypes[params.messageType.toUpperCase()] > 0) ? chatMessageTypes[params.messageType.toUpperCase()] : chatMessageTypes.TEXT,
|
|
10615
10630
|
subjectId: params.threadId,
|
|
10616
10631
|
repliedTo: params.repliedTo,
|
|
@@ -10638,7 +10653,7 @@ function Chat(params) {
|
|
|
10638
10653
|
|
|
10639
10654
|
return chatMessaging.sendMessage({
|
|
10640
10655
|
chatMessageVOType: chatMessageVOTypes.BOT_MESSAGE,
|
|
10641
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
10656
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
10642
10657
|
subjectId: params.messageId,
|
|
10643
10658
|
content: params.content,
|
|
10644
10659
|
uniqueId: params.uniqueId,
|
|
@@ -10707,7 +10722,7 @@ function Chat(params) {
|
|
|
10707
10722
|
}
|
|
10708
10723
|
var sendMessageParams = {
|
|
10709
10724
|
chatMessageVOType: chatMessageVOTypes.CREATE_THREAD,
|
|
10710
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
10725
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
10711
10726
|
content: content
|
|
10712
10727
|
};
|
|
10713
10728
|
return chatMessaging.sendMessage(sendMessageParams, {
|
|
@@ -10781,7 +10796,7 @@ function Chat(params) {
|
|
|
10781
10796
|
error: undefined
|
|
10782
10797
|
});
|
|
10783
10798
|
}
|
|
10784
|
-
data.key = mapApiKey;
|
|
10799
|
+
data.key = sdkParams.mapApiKey;
|
|
10785
10800
|
data.marker = 'red';
|
|
10786
10801
|
}
|
|
10787
10802
|
var keys = Object.keys(data);
|
|
@@ -10838,7 +10853,7 @@ function Chat(params) {
|
|
|
10838
10853
|
};
|
|
10839
10854
|
|
|
10840
10855
|
publicized.resendMessage = function (uniqueId, callbacks) {
|
|
10841
|
-
if (hasCache && typeof queueDb == 'object' && !forceWaitQueueInMemory) {
|
|
10856
|
+
if (hasCache && typeof queueDb == 'object' && !sdkParams.forceWaitQueueInMemory) {
|
|
10842
10857
|
queueDb.waitQ.where('uniqueId')
|
|
10843
10858
|
.equals(uniqueId)
|
|
10844
10859
|
.and(function (item) {
|
|
@@ -10888,7 +10903,7 @@ function Chat(params) {
|
|
|
10888
10903
|
|
|
10889
10904
|
var clearHistoryParams = {
|
|
10890
10905
|
chatMessageVOType: chatMessageVOTypes.CLEAR_HISTORY,
|
|
10891
|
-
typeCode: generalTypeCode, //params.typeCode
|
|
10906
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode
|
|
10892
10907
|
};
|
|
10893
10908
|
|
|
10894
10909
|
if (params) {
|
|
@@ -10967,7 +10982,7 @@ function Chat(params) {
|
|
|
10967
10982
|
publicized.editMessage = function (params, callback) {
|
|
10968
10983
|
return chatMessaging.sendMessage({
|
|
10969
10984
|
chatMessageVOType: chatMessageVOTypes.EDIT_MESSAGE,
|
|
10970
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
10985
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
10971
10986
|
messageType: params.messageType,
|
|
10972
10987
|
subjectId: params.messageId,
|
|
10973
10988
|
repliedTo: params.repliedTo,
|
|
@@ -11045,7 +11060,7 @@ function Chat(params) {
|
|
|
11045
11060
|
publicized.deleteMessage = function (params, callback) {
|
|
11046
11061
|
return chatMessaging.sendMessage({
|
|
11047
11062
|
chatMessageVOType: chatMessageVOTypes.DELETE_MESSAGE,
|
|
11048
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
11063
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
11049
11064
|
subjectId: params.messageId,
|
|
11050
11065
|
uniqueId: params.uniqueId,
|
|
11051
11066
|
content: JSON.stringify({
|
|
@@ -11166,7 +11181,7 @@ function Chat(params) {
|
|
|
11166
11181
|
|
|
11167
11182
|
return chatMessaging.sendMessage({
|
|
11168
11183
|
chatMessageVOType: chatMessageVOTypes.DELETE_MESSAGE,
|
|
11169
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
11184
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
11170
11185
|
content: {
|
|
11171
11186
|
uniqueIds: uniqueIdsList,
|
|
11172
11187
|
ids: messageIdsList,
|
|
@@ -11188,7 +11203,7 @@ function Chat(params) {
|
|
|
11188
11203
|
putInChatSendQueue({
|
|
11189
11204
|
message: {
|
|
11190
11205
|
chatMessageVOType: chatMessageVOTypes.MESSAGE,
|
|
11191
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
11206
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
11192
11207
|
messageType: 1,
|
|
11193
11208
|
subjectId: params.threadId,
|
|
11194
11209
|
repliedTo: params.repliedTo,
|
|
@@ -11233,7 +11248,7 @@ function Chat(params) {
|
|
|
11233
11248
|
putInChatUploadQueue({
|
|
11234
11249
|
message: {
|
|
11235
11250
|
chatMessageVOType: chatMessageVOTypes.MESSAGE,
|
|
11236
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
11251
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
11237
11252
|
messageType: (params.messageType && typeof params.messageType.toUpperCase() !== 'undefined' && chatMessageTypes[params.messageType.toUpperCase()] > 0) ? chatMessageTypes[params.messageType.toUpperCase()] : 1,
|
|
11238
11253
|
subjectId: params.threadId,
|
|
11239
11254
|
repliedTo: params.repliedTo,
|
|
@@ -11324,7 +11339,7 @@ function Chat(params) {
|
|
|
11324
11339
|
putInChatSendQueue({
|
|
11325
11340
|
message: {
|
|
11326
11341
|
chatMessageVOType: chatMessageVOTypes.FORWARD_MESSAGE,
|
|
11327
|
-
typeCode: generalTypeCode,//params.typeCode,
|
|
11342
|
+
typeCode: sdkParams.generalTypeCode,//params.typeCode,
|
|
11328
11343
|
subjectId: params.threadId,
|
|
11329
11344
|
repliedTo: params.repliedTo,
|
|
11330
11345
|
content: messageIdsList,
|
|
@@ -11362,7 +11377,7 @@ function Chat(params) {
|
|
|
11362
11377
|
threadId: threadId,
|
|
11363
11378
|
uniqueId: uniqueId
|
|
11364
11379
|
});
|
|
11365
|
-
}, systemMessageIntervalPitch);
|
|
11380
|
+
}, sdkParams.systemMessageIntervalPitch);
|
|
11366
11381
|
};
|
|
11367
11382
|
|
|
11368
11383
|
publicized.stopTyping = function () {
|
|
@@ -11373,10 +11388,10 @@ function Chat(params) {
|
|
|
11373
11388
|
|
|
11374
11389
|
var deliveryListData = {
|
|
11375
11390
|
chatMessageVOType: chatMessageVOTypes.GET_MESSAGE_DELIVERY_PARTICIPANTS,
|
|
11376
|
-
typeCode: generalTypeCode,//params.typeCode,
|
|
11391
|
+
typeCode: sdkParams.generalTypeCode,//params.typeCode,
|
|
11377
11392
|
content: {},
|
|
11378
11393
|
pushMsgType: 3,
|
|
11379
|
-
token: token,
|
|
11394
|
+
token: sdkParams.token,
|
|
11380
11395
|
timeout: params.timeout
|
|
11381
11396
|
};
|
|
11382
11397
|
|
|
@@ -11401,10 +11416,10 @@ function Chat(params) {
|
|
|
11401
11416
|
publicized.getMessageSeenList = function (params, callback) {
|
|
11402
11417
|
var seenListData = {
|
|
11403
11418
|
chatMessageVOType: chatMessageVOTypes.GET_MESSAGE_SEEN_PARTICIPANTS,
|
|
11404
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
11419
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
11405
11420
|
content: {},
|
|
11406
11421
|
pushMsgType: 3,
|
|
11407
|
-
token: token,
|
|
11422
|
+
token: sdkParams.token,
|
|
11408
11423
|
timeout: params.timeout
|
|
11409
11424
|
};
|
|
11410
11425
|
|
|
@@ -11433,11 +11448,11 @@ function Chat(params) {
|
|
|
11433
11448
|
publicized.muteThread = function (params, callback) {
|
|
11434
11449
|
return chatMessaging.sendMessage({
|
|
11435
11450
|
chatMessageVOType: chatMessageVOTypes.MUTE_THREAD,
|
|
11436
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
11451
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
11437
11452
|
subjectId: params.threadId,
|
|
11438
11453
|
content: {},
|
|
11439
11454
|
pushMsgType: 3,
|
|
11440
|
-
token: token
|
|
11455
|
+
token: sdkParams.token
|
|
11441
11456
|
}, {
|
|
11442
11457
|
onResult: function (result) {
|
|
11443
11458
|
callback && callback(result);
|
|
@@ -11448,11 +11463,11 @@ function Chat(params) {
|
|
|
11448
11463
|
publicized.unMuteThread = function (params, callback) {
|
|
11449
11464
|
return chatMessaging.sendMessage({
|
|
11450
11465
|
chatMessageVOType: chatMessageVOTypes.UNMUTE_THREAD,
|
|
11451
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
11466
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
11452
11467
|
subjectId: params.threadId,
|
|
11453
11468
|
content: {},
|
|
11454
11469
|
pushMsgType: 3,
|
|
11455
|
-
token: token
|
|
11470
|
+
token: sdkParams.token
|
|
11456
11471
|
}, {
|
|
11457
11472
|
onResult: function (result) {
|
|
11458
11473
|
callback && callback(result);
|
|
@@ -11463,11 +11478,11 @@ function Chat(params) {
|
|
|
11463
11478
|
publicized.closeThread = function (params, callback) {
|
|
11464
11479
|
return chatMessaging.sendMessage({
|
|
11465
11480
|
chatMessageVOType: chatMessageVOTypes.CLOSE_THREAD,
|
|
11466
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
11481
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
11467
11482
|
subjectId: params.threadId,
|
|
11468
11483
|
content: {},
|
|
11469
11484
|
pushMsgType: 3,
|
|
11470
|
-
token: token
|
|
11485
|
+
token: sdkParams.token
|
|
11471
11486
|
}, {
|
|
11472
11487
|
onResult: function (result) {
|
|
11473
11488
|
callback && callback(result);
|
|
@@ -11478,10 +11493,10 @@ function Chat(params) {
|
|
|
11478
11493
|
publicized.joinPublicThread = function (params, callback) {
|
|
11479
11494
|
var joinThreadData = {
|
|
11480
11495
|
chatMessageVOType: chatMessageVOTypes.JOIN_THREAD,
|
|
11481
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
11496
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
11482
11497
|
content: '',
|
|
11483
11498
|
pushMsgType: 3,
|
|
11484
|
-
token: token
|
|
11499
|
+
token: sdkParams.token
|
|
11485
11500
|
};
|
|
11486
11501
|
if (params) {
|
|
11487
11502
|
if (typeof params.uniqueName === 'string' && params.uniqueName.length > 0) {
|
|
@@ -11498,10 +11513,10 @@ function Chat(params) {
|
|
|
11498
11513
|
publicized.isPublicThreadNameAvailable = function (params, callback) {
|
|
11499
11514
|
var isNameAvailableData = {
|
|
11500
11515
|
chatMessageVOType: chatMessageVOTypes.IS_NAME_AVAILABLE,
|
|
11501
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
11516
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
11502
11517
|
content: '',
|
|
11503
11518
|
pushMsgType: 3,
|
|
11504
|
-
token: token
|
|
11519
|
+
token: sdkParams.token
|
|
11505
11520
|
};
|
|
11506
11521
|
if (params) {
|
|
11507
11522
|
if (typeof params.uniqueName === 'string' && params.uniqueName.length > 0) {
|
|
@@ -11518,10 +11533,10 @@ function Chat(params) {
|
|
|
11518
11533
|
publicized.changeThreadPrivacy = function (params, callback) {
|
|
11519
11534
|
var sendData = {
|
|
11520
11535
|
chatMessageVOType: chatMessageVOTypes.CHANGE_THREAD_PRIVACY,
|
|
11521
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
11536
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
11522
11537
|
pushMsgType: 3,
|
|
11523
11538
|
content: {},
|
|
11524
|
-
token: token,
|
|
11539
|
+
token: sdkParams.token,
|
|
11525
11540
|
timeout: params.timeout
|
|
11526
11541
|
};
|
|
11527
11542
|
|
|
@@ -11576,11 +11591,11 @@ function Chat(params) {
|
|
|
11576
11591
|
publicized.pinThread = function (params, callback) {
|
|
11577
11592
|
return chatMessaging.sendMessage({
|
|
11578
11593
|
chatMessageVOType: chatMessageVOTypes.PIN_THREAD,
|
|
11579
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
11594
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
11580
11595
|
subjectId: params.threadId,
|
|
11581
11596
|
content: {},
|
|
11582
11597
|
pushMsgType: 3,
|
|
11583
|
-
token: token
|
|
11598
|
+
token: sdkParams.token
|
|
11584
11599
|
}, {
|
|
11585
11600
|
onResult: function (result) {
|
|
11586
11601
|
callback && callback(result);
|
|
@@ -11591,11 +11606,11 @@ function Chat(params) {
|
|
|
11591
11606
|
publicized.unPinThread = function (params, callback) {
|
|
11592
11607
|
return chatMessaging.sendMessage({
|
|
11593
11608
|
chatMessageVOType: chatMessageVOTypes.UNPIN_THREAD,
|
|
11594
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
11609
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
11595
11610
|
subjectId: params.threadId,
|
|
11596
11611
|
content: {},
|
|
11597
11612
|
pushMsgType: 3,
|
|
11598
|
-
token: token
|
|
11613
|
+
token: sdkParams.token
|
|
11599
11614
|
}, {
|
|
11600
11615
|
onResult: function (result) {
|
|
11601
11616
|
callback && callback(result);
|
|
@@ -11606,7 +11621,7 @@ function Chat(params) {
|
|
|
11606
11621
|
publicized.deleteThread = function (params, callback) {
|
|
11607
11622
|
var sendData = {
|
|
11608
11623
|
chatMessageVOType: chatMessageVOTypes.DELETE_MESSAGE_THREAD,
|
|
11609
|
-
typeCode: generalTypeCode//params.typeCode
|
|
11624
|
+
typeCode: sdkParams.generalTypeCode//params.typeCode
|
|
11610
11625
|
};
|
|
11611
11626
|
|
|
11612
11627
|
if (params) {
|
|
@@ -11641,13 +11656,13 @@ function Chat(params) {
|
|
|
11641
11656
|
publicized.pinMessage = function (params, callback) {
|
|
11642
11657
|
return chatMessaging.sendMessage({
|
|
11643
11658
|
chatMessageVOType: chatMessageVOTypes.PIN_MESSAGE,
|
|
11644
|
-
typeCode: generalTypeCode,//params.typeCode,
|
|
11659
|
+
typeCode: sdkParams.generalTypeCode,//params.typeCode,
|
|
11645
11660
|
subjectId: params.messageId,
|
|
11646
11661
|
content: JSON.stringify({
|
|
11647
11662
|
'notifyAll': (typeof params.notifyAll === 'boolean') ? params.notifyAll : false
|
|
11648
11663
|
}),
|
|
11649
11664
|
pushMsgType: 3,
|
|
11650
|
-
token: token
|
|
11665
|
+
token: sdkParams.token
|
|
11651
11666
|
}, {
|
|
11652
11667
|
onResult: function (result) {
|
|
11653
11668
|
callback && callback(result);
|
|
@@ -11660,9 +11675,9 @@ function Chat(params) {
|
|
|
11660
11675
|
publicized.spamPrivateThread = function (params, callback) {
|
|
11661
11676
|
var spamData = {
|
|
11662
11677
|
chatMessageVOType: chatMessageVOTypes.SPAM_PV_THREAD,
|
|
11663
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
11678
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
11664
11679
|
pushMsgType: 3,
|
|
11665
|
-
token: token,
|
|
11680
|
+
token: sdkParams.token,
|
|
11666
11681
|
timeout: params.timeout
|
|
11667
11682
|
};
|
|
11668
11683
|
|
|
@@ -11683,10 +11698,10 @@ function Chat(params) {
|
|
|
11683
11698
|
|
|
11684
11699
|
var blockData = {
|
|
11685
11700
|
chatMessageVOType: chatMessageVOTypes.BLOCK,
|
|
11686
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
11701
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
11687
11702
|
content: {},
|
|
11688
11703
|
pushMsgType: 3,
|
|
11689
|
-
token: token,
|
|
11704
|
+
token: sdkParams.token,
|
|
11690
11705
|
timeout: params.timeout
|
|
11691
11706
|
};
|
|
11692
11707
|
|
|
@@ -11717,9 +11732,9 @@ function Chat(params) {
|
|
|
11717
11732
|
publicized.unblock = function (params, callback) {
|
|
11718
11733
|
var unblockData = {
|
|
11719
11734
|
chatMessageVOType: chatMessageVOTypes.UNBLOCK,
|
|
11720
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
11735
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
11721
11736
|
pushMsgType: 3,
|
|
11722
|
-
token: token,
|
|
11737
|
+
token: sdkParams.token,
|
|
11723
11738
|
content: {},
|
|
11724
11739
|
timeout: params.timeout
|
|
11725
11740
|
};
|
|
@@ -11773,10 +11788,10 @@ function Chat(params) {
|
|
|
11773
11788
|
|
|
11774
11789
|
var getBlockedData = {
|
|
11775
11790
|
chatMessageVOType: chatMessageVOTypes.GET_BLOCKED,
|
|
11776
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
11791
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
11777
11792
|
content: content,
|
|
11778
11793
|
pushMsgType: 3,
|
|
11779
|
-
token: token,
|
|
11794
|
+
token: sdkParams.token,
|
|
11780
11795
|
timeout: params.timeout
|
|
11781
11796
|
};
|
|
11782
11797
|
|
|
@@ -11826,10 +11841,10 @@ function Chat(params) {
|
|
|
11826
11841
|
|
|
11827
11842
|
var getNotSeenDurationData = {
|
|
11828
11843
|
chatMessageVOType: chatMessageVOTypes.GET_NOT_SEEN_DURATION,
|
|
11829
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
11844
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
11830
11845
|
content: content,
|
|
11831
11846
|
pushMsgType: 3,
|
|
11832
|
-
token: token,
|
|
11847
|
+
token: sdkParams.token,
|
|
11833
11848
|
timeout: params.timeout
|
|
11834
11849
|
};
|
|
11835
11850
|
|
|
@@ -11869,11 +11884,11 @@ function Chat(params) {
|
|
|
11869
11884
|
|
|
11870
11885
|
if (typeof params.typeCode === 'string') {
|
|
11871
11886
|
data.typeCode = params.typeCode;
|
|
11872
|
-
} else if (generalTypeCode) {
|
|
11873
|
-
data.typeCode = generalTypeCode;
|
|
11887
|
+
} else if (sdkParams.generalTypeCode) {
|
|
11888
|
+
data.typeCode = sdkParams.generalTypeCode;
|
|
11874
11889
|
}
|
|
11875
11890
|
|
|
11876
|
-
data.ownerId = typeCodeOwnerId ? typeCodeOwnerId : (params.ownerId ? params.ownerId : undefined);
|
|
11891
|
+
data.ownerId = sdkParams.typeCodeOwnerId ? sdkParams.typeCodeOwnerId : (params.ownerId ? params.ownerId : undefined);
|
|
11877
11892
|
|
|
11878
11893
|
if (typeof params.cellphoneNumber === 'string') {
|
|
11879
11894
|
data.cellphoneNumber = params.cellphoneNumber;
|
|
@@ -11899,7 +11914,7 @@ function Chat(params) {
|
|
|
11899
11914
|
method: 'POST',
|
|
11900
11915
|
data: data,
|
|
11901
11916
|
headers: {
|
|
11902
|
-
'_token_': token,
|
|
11917
|
+
'_token_': sdkParams.token,
|
|
11903
11918
|
'_token_issuer_': 1
|
|
11904
11919
|
}
|
|
11905
11920
|
};
|
|
@@ -12002,8 +12017,8 @@ function Chat(params) {
|
|
|
12002
12017
|
chatMessageVOType: chatMessageVOTypes.ADD_CONTACTS,
|
|
12003
12018
|
content: {},
|
|
12004
12019
|
pushMsgType: 3,
|
|
12005
|
-
token: token,
|
|
12006
|
-
typeCode: generalTypeCode
|
|
12020
|
+
token: sdkParams.token,
|
|
12021
|
+
typeCode: sdkParams.generalTypeCode
|
|
12007
12022
|
},
|
|
12008
12023
|
AddContactVO = {},
|
|
12009
12024
|
firstNameList = [],
|
|
@@ -12323,7 +12338,7 @@ function Chat(params) {
|
|
|
12323
12338
|
method: 'GET',
|
|
12324
12339
|
data: data,
|
|
12325
12340
|
headers: {
|
|
12326
|
-
'_token_': token,
|
|
12341
|
+
'_token_': sdkParams.token,
|
|
12327
12342
|
'_token_issuer_': 1
|
|
12328
12343
|
}
|
|
12329
12344
|
};
|
|
@@ -12436,7 +12451,7 @@ function Chat(params) {
|
|
|
12436
12451
|
}
|
|
12437
12452
|
}
|
|
12438
12453
|
|
|
12439
|
-
data.ownerId = typeCodeOwnerId ? typeCodeOwnerId : (params.ownerId ? params.ownerId : undefined);
|
|
12454
|
+
data.ownerId = sdkParams.typeCodeOwnerId ? sdkParams.typeCodeOwnerId : (params.ownerId ? params.ownerId : undefined);
|
|
12440
12455
|
|
|
12441
12456
|
|
|
12442
12457
|
var requestParams = {
|
|
@@ -12444,7 +12459,7 @@ function Chat(params) {
|
|
|
12444
12459
|
method: 'POST',
|
|
12445
12460
|
data: data,
|
|
12446
12461
|
headers: {
|
|
12447
|
-
'_token_': token,
|
|
12462
|
+
'_token_': sdkParams.token,
|
|
12448
12463
|
'_token_issuer_': 1
|
|
12449
12464
|
}
|
|
12450
12465
|
};
|
|
@@ -12558,7 +12573,7 @@ function Chat(params) {
|
|
|
12558
12573
|
method: 'POST',
|
|
12559
12574
|
data: data,
|
|
12560
12575
|
headers: {
|
|
12561
|
-
'_token_': token,
|
|
12576
|
+
'_token_': sdkParams.token,
|
|
12562
12577
|
'_token_issuer_': 1
|
|
12563
12578
|
}
|
|
12564
12579
|
};
|
|
@@ -12826,10 +12841,10 @@ function Chat(params) {
|
|
|
12826
12841
|
publicized.createBot = function (params, callback) {
|
|
12827
12842
|
var createBotData = {
|
|
12828
12843
|
chatMessageVOType: chatMessageVOTypes.CREATE_BOT,
|
|
12829
|
-
typeCode: generalTypeCode,//params.typeCode,
|
|
12844
|
+
typeCode: sdkParams.generalTypeCode,//params.typeCode,
|
|
12830
12845
|
content: '',
|
|
12831
12846
|
pushMsgType: 3,
|
|
12832
|
-
token: token
|
|
12847
|
+
token: sdkParams.token
|
|
12833
12848
|
};
|
|
12834
12849
|
if (params) {
|
|
12835
12850
|
if (typeof params.botName === 'string' && params.botName.length > 0) {
|
|
@@ -12866,10 +12881,10 @@ function Chat(params) {
|
|
|
12866
12881
|
publicized.defineBotCommand = function (params, callback) {
|
|
12867
12882
|
var defineBotCommandData = {
|
|
12868
12883
|
chatMessageVOType: chatMessageVOTypes.DEFINE_BOT_COMMAND,
|
|
12869
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
12884
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
12870
12885
|
content: {},
|
|
12871
12886
|
pushMsgType: 3,
|
|
12872
|
-
token: token
|
|
12887
|
+
token: sdkParams.token
|
|
12873
12888
|
}, commandList = [];
|
|
12874
12889
|
if (params) {
|
|
12875
12890
|
if (typeof params.botName !== 'string' || params.botName.length === 0) {
|
|
@@ -12911,10 +12926,10 @@ function Chat(params) {
|
|
|
12911
12926
|
publicized.removeBotCommand = function (params, callback) {
|
|
12912
12927
|
var defineBotCommandData = {
|
|
12913
12928
|
chatMessageVOType: chatMessageVOTypes.REMOVE_BOT_COMMANDS,
|
|
12914
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
12929
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
12915
12930
|
content: {},
|
|
12916
12931
|
pushMsgType: 3,
|
|
12917
|
-
token: token
|
|
12932
|
+
token: sdkParams.token
|
|
12918
12933
|
}, commandList = [];
|
|
12919
12934
|
|
|
12920
12935
|
if (params) {
|
|
@@ -12961,10 +12976,10 @@ function Chat(params) {
|
|
|
12961
12976
|
publicized.startBot = function (params, callback) {
|
|
12962
12977
|
var startBotData = {
|
|
12963
12978
|
chatMessageVOType: chatMessageVOTypes.START_BOT,
|
|
12964
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
12979
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
12965
12980
|
content: {},
|
|
12966
12981
|
pushMsgType: 3,
|
|
12967
|
-
token: token
|
|
12982
|
+
token: sdkParams.token
|
|
12968
12983
|
};
|
|
12969
12984
|
if (params) {
|
|
12970
12985
|
if (typeof +params.threadId !== 'number' || params.threadId < 0) {
|
|
@@ -13002,10 +13017,10 @@ function Chat(params) {
|
|
|
13002
13017
|
publicized.stopBot = function (params, callback) {
|
|
13003
13018
|
var stopBotData = {
|
|
13004
13019
|
chatMessageVOType: chatMessageVOTypes.STOP_BOT,
|
|
13005
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
13020
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
13006
13021
|
content: {},
|
|
13007
13022
|
pushMsgType: 3,
|
|
13008
|
-
token: token
|
|
13023
|
+
token: sdkParams.token
|
|
13009
13024
|
};
|
|
13010
13025
|
if (params) {
|
|
13011
13026
|
if (typeof +params.threadId !== 'number' || params.threadId < 0) {
|
|
@@ -13043,10 +13058,10 @@ function Chat(params) {
|
|
|
13043
13058
|
publicized.getBotCommandsList = function (params, callback) {
|
|
13044
13059
|
var getBotCommandsListData = {
|
|
13045
13060
|
chatMessageVOType: chatMessageVOTypes.BOT_COMMANDS,
|
|
13046
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
13061
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
13047
13062
|
content: {},
|
|
13048
13063
|
pushMsgType: 3,
|
|
13049
|
-
token: token
|
|
13064
|
+
token: sdkParams.token
|
|
13050
13065
|
};
|
|
13051
13066
|
|
|
13052
13067
|
if (params) {
|
|
@@ -13080,10 +13095,10 @@ function Chat(params) {
|
|
|
13080
13095
|
publicized.getThreadAllBots = function (params, callback) {
|
|
13081
13096
|
var getThreadBotsData = {
|
|
13082
13097
|
chatMessageVOType: chatMessageVOTypes.THREAD_ALL_BOTS,
|
|
13083
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
13098
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
13084
13099
|
content: {},
|
|
13085
13100
|
pushMsgType: 3,
|
|
13086
|
-
token: token
|
|
13101
|
+
token: sdkParams.token
|
|
13087
13102
|
};
|
|
13088
13103
|
|
|
13089
13104
|
if (params) {
|
|
@@ -13115,10 +13130,10 @@ function Chat(params) {
|
|
|
13115
13130
|
publicized.createTag = function (params, callback) {
|
|
13116
13131
|
var createTagData = {
|
|
13117
13132
|
chatMessageVOType: chatMessageVOTypes.CREATE_TAG,
|
|
13118
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
13133
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
13119
13134
|
content: {},
|
|
13120
13135
|
pushMsgType: 3,
|
|
13121
|
-
token: token
|
|
13136
|
+
token: sdkParams.token
|
|
13122
13137
|
};
|
|
13123
13138
|
|
|
13124
13139
|
if (params) {
|
|
@@ -13149,10 +13164,10 @@ function Chat(params) {
|
|
|
13149
13164
|
publicized.editTag = function (params, callback) {
|
|
13150
13165
|
var sendData = {
|
|
13151
13166
|
chatMessageVOType: chatMessageVOTypes.EDIT_TAG,
|
|
13152
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
13167
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
13153
13168
|
content: {},
|
|
13154
13169
|
pushMsgType: 3,
|
|
13155
|
-
token: token
|
|
13170
|
+
token: sdkParams.token
|
|
13156
13171
|
};
|
|
13157
13172
|
|
|
13158
13173
|
if (params) {
|
|
@@ -13193,10 +13208,10 @@ function Chat(params) {
|
|
|
13193
13208
|
publicized.deleteTag = function (params, callback) {
|
|
13194
13209
|
var sendData = {
|
|
13195
13210
|
chatMessageVOType: chatMessageVOTypes.DELETE_TAG,
|
|
13196
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
13211
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
13197
13212
|
content: {},
|
|
13198
13213
|
pushMsgType: 3,
|
|
13199
|
-
token: token
|
|
13214
|
+
token: sdkParams.token
|
|
13200
13215
|
};
|
|
13201
13216
|
|
|
13202
13217
|
if (params) {
|
|
@@ -13227,10 +13242,10 @@ function Chat(params) {
|
|
|
13227
13242
|
publicized.getTagList = function (params, callback) {
|
|
13228
13243
|
var sendData = {
|
|
13229
13244
|
chatMessageVOType: chatMessageVOTypes.GET_TAG_LIST,
|
|
13230
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
13245
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
13231
13246
|
content: {},
|
|
13232
13247
|
pushMsgType: 3,
|
|
13233
|
-
token: token
|
|
13248
|
+
token: sdkParams.token
|
|
13234
13249
|
};
|
|
13235
13250
|
|
|
13236
13251
|
return chatMessaging.sendMessage(sendData, {
|
|
@@ -13243,7 +13258,7 @@ function Chat(params) {
|
|
|
13243
13258
|
publicized.addTagParticipants = function (params, callback) {
|
|
13244
13259
|
var sendData = {
|
|
13245
13260
|
chatMessageVOType: chatMessageVOTypes.ADD_TAG_PARTICIPANT,
|
|
13246
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
13261
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
13247
13262
|
content: []
|
|
13248
13263
|
};
|
|
13249
13264
|
|
|
@@ -13283,7 +13298,7 @@ function Chat(params) {
|
|
|
13283
13298
|
publicized.removeTagParticipants = function (params, callback) {
|
|
13284
13299
|
var sendData = {
|
|
13285
13300
|
chatMessageVOType: chatMessageVOTypes.REMOVE_TAG_PARTICIPANT,
|
|
13286
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
13301
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
13287
13302
|
content: []
|
|
13288
13303
|
};
|
|
13289
13304
|
|
|
@@ -13323,7 +13338,7 @@ function Chat(params) {
|
|
|
13323
13338
|
publicized.registerAssistant = function (params, callback) {
|
|
13324
13339
|
var sendData = {
|
|
13325
13340
|
chatMessageVOType: chatMessageVOTypes.REGISTER_ASSISTANT,
|
|
13326
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
13341
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
13327
13342
|
content: []
|
|
13328
13343
|
};
|
|
13329
13344
|
|
|
@@ -13392,7 +13407,7 @@ function Chat(params) {
|
|
|
13392
13407
|
publicized.deactivateAssistant = function (params, callback) {
|
|
13393
13408
|
var sendData = {
|
|
13394
13409
|
chatMessageVOType: chatMessageVOTypes.DEACTIVATE_ASSISTANT,
|
|
13395
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
13410
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
13396
13411
|
content: []
|
|
13397
13412
|
};
|
|
13398
13413
|
|
|
@@ -13454,7 +13469,7 @@ function Chat(params) {
|
|
|
13454
13469
|
publicized.blockAssistant = function (params, callback) {
|
|
13455
13470
|
var sendData = {
|
|
13456
13471
|
chatMessageVOType: chatMessageVOTypes.BLOCK_ASSISTANT,
|
|
13457
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
13472
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
13458
13473
|
content: []
|
|
13459
13474
|
};
|
|
13460
13475
|
|
|
@@ -13516,7 +13531,7 @@ function Chat(params) {
|
|
|
13516
13531
|
publicized.unblockAssistant = function (params, callback) {
|
|
13517
13532
|
var sendData = {
|
|
13518
13533
|
chatMessageVOType: chatMessageVOTypes.UNBLOCK_ASSISTANT,
|
|
13519
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
13534
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
13520
13535
|
content: []
|
|
13521
13536
|
};
|
|
13522
13537
|
|
|
@@ -13578,10 +13593,10 @@ function Chat(params) {
|
|
|
13578
13593
|
publicized.getAssistantsList = function (params, callback) {
|
|
13579
13594
|
var sendData = {
|
|
13580
13595
|
chatMessageVOType: chatMessageVOTypes.GET_ASSISTANTS,
|
|
13581
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
13596
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
13582
13597
|
content: {},
|
|
13583
13598
|
pushMsgType: 3,
|
|
13584
|
-
token: token
|
|
13599
|
+
token: sdkParams.token
|
|
13585
13600
|
};
|
|
13586
13601
|
|
|
13587
13602
|
if (params) {
|
|
@@ -13615,10 +13630,10 @@ function Chat(params) {
|
|
|
13615
13630
|
publicized.getBlockedAssistantsList = function (params, callback) {
|
|
13616
13631
|
var sendData = {
|
|
13617
13632
|
chatMessageVOType: chatMessageVOTypes.BLOCKED_ASSISTANTS,
|
|
13618
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
13633
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
13619
13634
|
content: {},
|
|
13620
13635
|
pushMsgType: 3,
|
|
13621
|
-
token: token
|
|
13636
|
+
token: sdkParams.token
|
|
13622
13637
|
};
|
|
13623
13638
|
|
|
13624
13639
|
if (params) {
|
|
@@ -13652,7 +13667,7 @@ function Chat(params) {
|
|
|
13652
13667
|
publicized.getAssistantsHistory = function (params, callback) {
|
|
13653
13668
|
var sendData = {
|
|
13654
13669
|
chatMessageVOType: chatMessageVOTypes.ASSISTANT_HISTORY,
|
|
13655
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
13670
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
13656
13671
|
content: {
|
|
13657
13672
|
offset: +params.offset > 0 ? +params.offset : 0,
|
|
13658
13673
|
count: +params.count > 0 ? +params.count : config.getHistoryCount
|
|
@@ -13785,7 +13800,7 @@ function Chat(params) {
|
|
|
13785
13800
|
var stackArr = [], wantedCount = 10000, stepCount = 500, offset = 0;
|
|
13786
13801
|
var sendData = {
|
|
13787
13802
|
chatMessageVOType: chatMessageVOTypes.EXPORT_CHAT,
|
|
13788
|
-
typeCode: generalTypeCode,//params.typeCode,
|
|
13803
|
+
typeCode: sdkParams.generalTypeCode,//params.typeCode,
|
|
13789
13804
|
content: {
|
|
13790
13805
|
offset: +params.offset > 0 ? +params.offset : offset,
|
|
13791
13806
|
count: +params.count > 0 ? +params.count : wantedCount,//config.getHistoryCount,
|
|
@@ -13999,7 +14014,7 @@ function Chat(params) {
|
|
|
13999
14014
|
|
|
14000
14015
|
var sendData = {
|
|
14001
14016
|
chatMessageVOType: chatMessageVOTypes.MUTUAL_GROUPS,
|
|
14002
|
-
typeCode: generalTypeCode,//params.typeCode,
|
|
14017
|
+
typeCode: sdkParams.generalTypeCode,//params.typeCode,
|
|
14003
14018
|
content: {
|
|
14004
14019
|
count: count,
|
|
14005
14020
|
offset: offset
|
|
@@ -14081,9 +14096,9 @@ function Chat(params) {
|
|
|
14081
14096
|
|
|
14082
14097
|
var locationPingData = {
|
|
14083
14098
|
chatMessageVOType: chatMessageVOTypes.LOCATION_PING,
|
|
14084
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
14099
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
14085
14100
|
pushMsgType: 3,
|
|
14086
|
-
token: token
|
|
14101
|
+
token: sdkParams.token
|
|
14087
14102
|
}, content = {};
|
|
14088
14103
|
|
|
14089
14104
|
if (params) {
|
|
@@ -14141,10 +14156,10 @@ function Chat(params) {
|
|
|
14141
14156
|
|
|
14142
14157
|
publicized.setToken = function (newToken) {
|
|
14143
14158
|
if (typeof newToken !== 'undefined') {
|
|
14144
|
-
token = newToken;
|
|
14145
|
-
callModule.updateToken(token);
|
|
14146
|
-
chatMessaging.updateToken(token);
|
|
14147
|
-
chatEvents.updateToken(token);
|
|
14159
|
+
sdkParams.token = newToken;
|
|
14160
|
+
callModule.updateToken(sdkParams.token);
|
|
14161
|
+
chatMessaging.updateToken(sdkParams.token);
|
|
14162
|
+
chatEvents.updateToken(sdkParams.token);
|
|
14148
14163
|
if(!chatMessaging.userInfo || !chatMessaging.userInfo.id) {
|
|
14149
14164
|
getUserAndUpdateSDKState();
|
|
14150
14165
|
}
|
|
@@ -14225,11 +14240,11 @@ function Chat(params) {
|
|
|
14225
14240
|
let userId = params.userId || chatMessaging.userInfo.id
|
|
14226
14241
|
, sendData = {
|
|
14227
14242
|
chatMessageVOType: chatMessageVOTypes.CUSTOMER_INFO,
|
|
14228
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
14243
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
14229
14244
|
content: [
|
|
14230
14245
|
userId
|
|
14231
14246
|
],
|
|
14232
|
-
token: token
|
|
14247
|
+
token: sdkParams.token
|
|
14233
14248
|
};
|
|
14234
14249
|
|
|
14235
14250
|
return chatMessaging.sendMessage(sendData, {
|
|
@@ -14244,8 +14259,8 @@ function Chat(params) {
|
|
|
14244
14259
|
}, callback) {
|
|
14245
14260
|
var sendData = {
|
|
14246
14261
|
chatMessageVOType: chatMessageVOTypes.ARCHIVE_THREAD,
|
|
14247
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
14248
|
-
token: token,
|
|
14262
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
14263
|
+
token: sdkParams.token,
|
|
14249
14264
|
subjectId: threadId
|
|
14250
14265
|
};
|
|
14251
14266
|
|
|
@@ -14260,8 +14275,8 @@ function Chat(params) {
|
|
|
14260
14275
|
}, callback) {
|
|
14261
14276
|
var sendData = {
|
|
14262
14277
|
chatMessageVOType: chatMessageVOTypes.UNARCHIVE_THREAD,
|
|
14263
|
-
typeCode: generalTypeCode, //params.typeCode,
|
|
14264
|
-
token: token,
|
|
14278
|
+
typeCode: sdkParams.generalTypeCode, //params.typeCode,
|
|
14279
|
+
token: sdkParams.token,
|
|
14265
14280
|
subjectId: threadId
|
|
14266
14281
|
};
|
|
14267
14282
|
|