isdata-customer-sdk 0.1.63 → 0.1.65
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/dist/index.common.js +28 -5
- package/dist/index.common.js.map +1 -1
- package/dist/index.umd.js +28 -5
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/index.common.js
CHANGED
|
@@ -29587,6 +29587,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
29587
29587
|
getPortalUserInfo: function() { return /* reexport */ getPortalUserInfo; },
|
|
29588
29588
|
getPortalUserMappingInfos: function() { return /* reexport */ getPortalUserMappingInfos; },
|
|
29589
29589
|
getPortalUserSig: function() { return /* reexport */ getPortalUserSig; },
|
|
29590
|
+
getRobotInfoByID: function() { return /* reexport */ getRobotInfoByID; },
|
|
29590
29591
|
getRoleIDsByUserAndGroupID: function() { return /* reexport */ getRoleIDsByUserAndGroupID; },
|
|
29591
29592
|
getThirdAppPathByKey: function() { return /* reexport */ getThirdAppPathByKey; },
|
|
29592
29593
|
getUrlParamValue: function() { return /* reexport */ getUrlParamValue; },
|
|
@@ -30835,7 +30836,9 @@ class ChatClientMgr {
|
|
|
30835
30836
|
this.userID = params.userID;
|
|
30836
30837
|
this.chatType = params.chatType || 0;
|
|
30837
30838
|
this.singleChatID = params.singleChatID || "";
|
|
30839
|
+
this.customParams = params.customParams || {};
|
|
30838
30840
|
this.chartOrigin = params.chartOrigin;
|
|
30841
|
+
console.log("ChatClientMgr init:", this.actionKey);
|
|
30839
30842
|
// this.charAIs = {};
|
|
30840
30843
|
}
|
|
30841
30844
|
makeKey(key) {
|
|
@@ -30880,10 +30883,10 @@ class ChatClientMgr {
|
|
|
30880
30883
|
}
|
|
30881
30884
|
return [];
|
|
30882
30885
|
});
|
|
30883
|
-
this.handler.addChatListener(this.makeKey(`sdata_get_test_user_sig`), data => {
|
|
30886
|
+
this.handler.addChatListener(this.makeKey(`sdata_get_test_user_sig`), async data => {
|
|
30884
30887
|
let sdkAppID = data.SDKAppID;
|
|
30885
30888
|
let userID = data.userID;
|
|
30886
|
-
let sigIDObject = this.handler.genTestUserSig({
|
|
30889
|
+
let sigIDObject = await this.handler.genTestUserSig({
|
|
30887
30890
|
SDKAppID: sdkAppID,
|
|
30888
30891
|
userID: userID
|
|
30889
30892
|
});
|
|
@@ -30905,7 +30908,8 @@ class ChatClientMgr {
|
|
|
30905
30908
|
await this.initChatAIs();
|
|
30906
30909
|
let charParams = {
|
|
30907
30910
|
type: this.getChatTypeKey(this.chatType),
|
|
30908
|
-
singleChatID: this.singleChatID
|
|
30911
|
+
singleChatID: this.singleChatID,
|
|
30912
|
+
customParams: this.customParams
|
|
30909
30913
|
};
|
|
30910
30914
|
console.log("charParams", charParams);
|
|
30911
30915
|
this.handler.fireEventToChatWindow(event, this.chartOrigin, this.makeKey("sdata_alllife_initChat"), charParams, result => {
|
|
@@ -30943,12 +30947,19 @@ class ChatClientMgr {
|
|
|
30943
30947
|
robot.chatID = robotKey;
|
|
30944
30948
|
let userSig = await this.handler.getPortalUserSig(robotKey, this.imType, this.groupID);
|
|
30945
30949
|
if (!userSig) {
|
|
30946
|
-
let sigIDObject = this.handler.genTestUserSig({
|
|
30950
|
+
let sigIDObject = await this.handler.genTestUserSig({
|
|
30947
30951
|
SDKAppID: this.appSKID,
|
|
30948
30952
|
userID: robotKey
|
|
30949
30953
|
});
|
|
30950
30954
|
userSig = sigIDObject.userSig;
|
|
30951
|
-
|
|
30955
|
+
if (userSig) {
|
|
30956
|
+
await this.chatAIClient.login({
|
|
30957
|
+
userID: robotKey,
|
|
30958
|
+
userSig: userSig
|
|
30959
|
+
});
|
|
30960
|
+
await this.chatAIClient.logout();
|
|
30961
|
+
await this.handler.addIMMapping(robotKey, this.imType, userSig, this.groupID);
|
|
30962
|
+
}
|
|
30952
30963
|
}
|
|
30953
30964
|
robot.userSig = userSig;
|
|
30954
30965
|
this.chatAIClient.charAIs[robotKey] = {
|
|
@@ -31053,6 +31064,18 @@ class ChatClientMgr {
|
|
|
31053
31064
|
|
|
31054
31065
|
|
|
31055
31066
|
|
|
31067
|
+
|
|
31068
|
+
const getRobotInfoByID = async (robotID, groupID) => {
|
|
31069
|
+
let queryData = {
|
|
31070
|
+
"param": {
|
|
31071
|
+
"id": robotID,
|
|
31072
|
+
"groupID": groupID
|
|
31073
|
+
}
|
|
31074
|
+
};
|
|
31075
|
+
let result = await request.post(`/dataservice/rest/orchestration/getRobotInfoByID`, queryData);
|
|
31076
|
+
let robotInfo = result.data.robotInfo;
|
|
31077
|
+
return robotInfo;
|
|
31078
|
+
};
|
|
31056
31079
|
const getIMHanlder = customerHanlder => {
|
|
31057
31080
|
let handler = {
|
|
31058
31081
|
genTestUserSig: async data => {
|