podchat 12.3.0 → 12.4.0
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 +3 -1
- package/{config.js → examples/config.js} +0 -0
- package/package.json +2 -2
- package/src/chat.js +84 -1
package/changelog.md
CHANGED
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
All notable changes to this project will be documented here.
|
|
4
4
|
to see complete list of changelog please visit [ChangeLog](https://github.com/masoudmanson/pod-chat/blob/master/changelog.md)
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
## [12.3.0] - 26-4-2022
|
|
7
|
+
### Added
|
|
8
|
+
- callNoAnswerTimeout to SDK configs
|
|
7
9
|
|
|
8
10
|
## [12.2.0] - 23-1-2022
|
|
9
11
|
### Added
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "podchat",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.4.0",
|
|
4
4
|
"description": "Javascript SDK to use POD's Chat Service",
|
|
5
5
|
"main": "./src/chat.js",
|
|
6
6
|
"scripts": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"publish:snapshot": "npm run version:snapshot && npm publish --tag snapshot",
|
|
9
9
|
"version:snapshot": "npm version prerelease --preid snapshot",
|
|
10
10
|
"publish:release": "npm run version:release && npm publish",
|
|
11
|
-
"version:release": "npm version 12.
|
|
11
|
+
"version:release": "npm version 12.4.0"
|
|
12
12
|
},
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
package/src/chat.js
CHANGED
|
@@ -196,6 +196,7 @@
|
|
|
196
196
|
DESTINATED_RECORD_CALL: 126,
|
|
197
197
|
ASSISTANT_CALL_STARTED: 127,
|
|
198
198
|
ASSISTANT_CALL_ENDED: 128,
|
|
199
|
+
GET_CALLS_TO_JOIN: 129,
|
|
199
200
|
EXPORT_CHAT: 152,
|
|
200
201
|
|
|
201
202
|
ERROR: 999
|
|
@@ -8213,7 +8214,8 @@
|
|
|
8213
8214
|
}
|
|
8214
8215
|
}
|
|
8215
8216
|
for (var id in eventCallbacks[eventName]) {
|
|
8216
|
-
eventCallbacks[eventName][id]
|
|
8217
|
+
if(eventCallbacks[eventName] && eventCallbacks[eventName][id])
|
|
8218
|
+
eventCallbacks[eventName][id](param);
|
|
8217
8219
|
}
|
|
8218
8220
|
},
|
|
8219
8221
|
|
|
@@ -12471,6 +12473,13 @@
|
|
|
12471
12473
|
}
|
|
12472
12474
|
}
|
|
12473
12475
|
|
|
12476
|
+
if(params.threadInfo
|
|
12477
|
+
&& (params.threadInfo.metadata
|
|
12478
|
+
|| params.threadInfo.uniqueName)
|
|
12479
|
+
) {
|
|
12480
|
+
content.createCallThreadRequest = params.threadInfo
|
|
12481
|
+
}
|
|
12482
|
+
|
|
12474
12483
|
startCallData.content = JSON.stringify(content);
|
|
12475
12484
|
} else {
|
|
12476
12485
|
fireEvent('error', {
|
|
@@ -12556,6 +12565,15 @@
|
|
|
12556
12565
|
}
|
|
12557
12566
|
}
|
|
12558
12567
|
|
|
12568
|
+
if(params.threadInfo
|
|
12569
|
+
&& (params.threadInfo.title
|
|
12570
|
+
|| params.threadInfo.description
|
|
12571
|
+
|| params.threadInfo.metadata
|
|
12572
|
+
|| params.threadInfo.uniqueName)
|
|
12573
|
+
) {
|
|
12574
|
+
content.createCallThreadRequest = params.threadInfo
|
|
12575
|
+
}
|
|
12576
|
+
|
|
12559
12577
|
startCallData.content = JSON.stringify(content);
|
|
12560
12578
|
} else {
|
|
12561
12579
|
fireEvent('error', {
|
|
@@ -12644,6 +12662,11 @@
|
|
|
12644
12662
|
}
|
|
12645
12663
|
|
|
12646
12664
|
acceptCallData.content = JSON.stringify(content);
|
|
12665
|
+
|
|
12666
|
+
if(params.joinCall) {
|
|
12667
|
+
callRequestController.callRequestReceived = true;
|
|
12668
|
+
currentCallId = params.callId;
|
|
12669
|
+
}
|
|
12647
12670
|
} else {
|
|
12648
12671
|
fireEvent('error', {
|
|
12649
12672
|
code: 999,
|
|
@@ -12735,6 +12758,10 @@
|
|
|
12735
12758
|
content.callIds = params.callIds;
|
|
12736
12759
|
}
|
|
12737
12760
|
|
|
12761
|
+
if (typeof params.threadId === 'number' && +params.threadId > 0) {
|
|
12762
|
+
content.threadId = +params.threadId;
|
|
12763
|
+
}
|
|
12764
|
+
|
|
12738
12765
|
if (typeof params.contactType === 'string') {
|
|
12739
12766
|
content.contactType = params.contactType;
|
|
12740
12767
|
}
|
|
@@ -12759,6 +12786,62 @@
|
|
|
12759
12786
|
});
|
|
12760
12787
|
};
|
|
12761
12788
|
|
|
12789
|
+
this.getCallsToJoin = function (params, callback) {
|
|
12790
|
+
var getCallListData = {
|
|
12791
|
+
chatMessageVOType: chatMessageVOTypes.GET_CALLS_TO_JOIN,
|
|
12792
|
+
pushMsgType: 3,
|
|
12793
|
+
token: token
|
|
12794
|
+
}, content = {};
|
|
12795
|
+
|
|
12796
|
+
if (params) {
|
|
12797
|
+
if (typeof params.count === 'number' && params.count >= 0) {
|
|
12798
|
+
content.count = +params.count;
|
|
12799
|
+
} else {
|
|
12800
|
+
content.count = 50;
|
|
12801
|
+
}
|
|
12802
|
+
|
|
12803
|
+
if (typeof params.offset === 'number' && params.offset >= 0) {
|
|
12804
|
+
content.offset = +params.offset;
|
|
12805
|
+
} else {
|
|
12806
|
+
content.offset = 0;
|
|
12807
|
+
}
|
|
12808
|
+
|
|
12809
|
+
if (typeof params.creatorSsoId === 'number' && params.creatorSsoId > 0) {
|
|
12810
|
+
content.creatorSsoId = +params.creatorSsoId;
|
|
12811
|
+
}
|
|
12812
|
+
|
|
12813
|
+
if (typeof params.name === 'string') {
|
|
12814
|
+
content.name = params.name;
|
|
12815
|
+
}
|
|
12816
|
+
|
|
12817
|
+
if (typeof params.type === 'string' && callTypes.hasOwnProperty(params.type.toUpperCase())) {
|
|
12818
|
+
content.type = callTypes[params.type.toUpperCase()];
|
|
12819
|
+
}
|
|
12820
|
+
|
|
12821
|
+
if (Array.isArray(params.threadIds)) {
|
|
12822
|
+
content.threadIds = params.threadIds;
|
|
12823
|
+
}
|
|
12824
|
+
|
|
12825
|
+
if (typeof params.uniqueId === 'string') {
|
|
12826
|
+
content.uniqueId = params.uniqueId;
|
|
12827
|
+
}
|
|
12828
|
+
|
|
12829
|
+
getCallListData.content = JSON.stringify(content);
|
|
12830
|
+
} else {
|
|
12831
|
+
fireEvent('error', {
|
|
12832
|
+
code: 999,
|
|
12833
|
+
message: 'Invalid params'
|
|
12834
|
+
});
|
|
12835
|
+
return;
|
|
12836
|
+
}
|
|
12837
|
+
|
|
12838
|
+
return sendMessage(getCallListData, {
|
|
12839
|
+
onResult: function (result) {
|
|
12840
|
+
callback && callback(result);
|
|
12841
|
+
}
|
|
12842
|
+
});
|
|
12843
|
+
};
|
|
12844
|
+
|
|
12762
12845
|
this.getCallParticipants = function (params, callback) {
|
|
12763
12846
|
var sendMessageParams = {
|
|
12764
12847
|
chatMessageVOType: chatMessageVOTypes.ACTIVE_CALL_PARTICIPANTS,
|