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.umd.js
CHANGED
|
@@ -29597,6 +29597,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
29597
29597
|
getPortalUserInfo: function() { return /* reexport */ getPortalUserInfo; },
|
|
29598
29598
|
getPortalUserMappingInfos: function() { return /* reexport */ getPortalUserMappingInfos; },
|
|
29599
29599
|
getPortalUserSig: function() { return /* reexport */ getPortalUserSig; },
|
|
29600
|
+
getRobotInfoByID: function() { return /* reexport */ getRobotInfoByID; },
|
|
29600
29601
|
getRoleIDsByUserAndGroupID: function() { return /* reexport */ getRoleIDsByUserAndGroupID; },
|
|
29601
29602
|
getThirdAppPathByKey: function() { return /* reexport */ getThirdAppPathByKey; },
|
|
29602
29603
|
getUrlParamValue: function() { return /* reexport */ getUrlParamValue; },
|
|
@@ -30845,7 +30846,9 @@ class ChatClientMgr {
|
|
|
30845
30846
|
this.userID = params.userID;
|
|
30846
30847
|
this.chatType = params.chatType || 0;
|
|
30847
30848
|
this.singleChatID = params.singleChatID || "";
|
|
30849
|
+
this.customParams = params.customParams || {};
|
|
30848
30850
|
this.chartOrigin = params.chartOrigin;
|
|
30851
|
+
console.log("ChatClientMgr init:", this.actionKey);
|
|
30849
30852
|
// this.charAIs = {};
|
|
30850
30853
|
}
|
|
30851
30854
|
makeKey(key) {
|
|
@@ -30890,10 +30893,10 @@ class ChatClientMgr {
|
|
|
30890
30893
|
}
|
|
30891
30894
|
return [];
|
|
30892
30895
|
});
|
|
30893
|
-
this.handler.addChatListener(this.makeKey(`sdata_get_test_user_sig`), data => {
|
|
30896
|
+
this.handler.addChatListener(this.makeKey(`sdata_get_test_user_sig`), async data => {
|
|
30894
30897
|
let sdkAppID = data.SDKAppID;
|
|
30895
30898
|
let userID = data.userID;
|
|
30896
|
-
let sigIDObject = this.handler.genTestUserSig({
|
|
30899
|
+
let sigIDObject = await this.handler.genTestUserSig({
|
|
30897
30900
|
SDKAppID: sdkAppID,
|
|
30898
30901
|
userID: userID
|
|
30899
30902
|
});
|
|
@@ -30915,7 +30918,8 @@ class ChatClientMgr {
|
|
|
30915
30918
|
await this.initChatAIs();
|
|
30916
30919
|
let charParams = {
|
|
30917
30920
|
type: this.getChatTypeKey(this.chatType),
|
|
30918
|
-
singleChatID: this.singleChatID
|
|
30921
|
+
singleChatID: this.singleChatID,
|
|
30922
|
+
customParams: this.customParams
|
|
30919
30923
|
};
|
|
30920
30924
|
console.log("charParams", charParams);
|
|
30921
30925
|
this.handler.fireEventToChatWindow(event, this.chartOrigin, this.makeKey("sdata_alllife_initChat"), charParams, result => {
|
|
@@ -30953,12 +30957,19 @@ class ChatClientMgr {
|
|
|
30953
30957
|
robot.chatID = robotKey;
|
|
30954
30958
|
let userSig = await this.handler.getPortalUserSig(robotKey, this.imType, this.groupID);
|
|
30955
30959
|
if (!userSig) {
|
|
30956
|
-
let sigIDObject = this.handler.genTestUserSig({
|
|
30960
|
+
let sigIDObject = await this.handler.genTestUserSig({
|
|
30957
30961
|
SDKAppID: this.appSKID,
|
|
30958
30962
|
userID: robotKey
|
|
30959
30963
|
});
|
|
30960
30964
|
userSig = sigIDObject.userSig;
|
|
30961
|
-
|
|
30965
|
+
if (userSig) {
|
|
30966
|
+
await this.chatAIClient.login({
|
|
30967
|
+
userID: robotKey,
|
|
30968
|
+
userSig: userSig
|
|
30969
|
+
});
|
|
30970
|
+
await this.chatAIClient.logout();
|
|
30971
|
+
await this.handler.addIMMapping(robotKey, this.imType, userSig, this.groupID);
|
|
30972
|
+
}
|
|
30962
30973
|
}
|
|
30963
30974
|
robot.userSig = userSig;
|
|
30964
30975
|
this.chatAIClient.charAIs[robotKey] = {
|
|
@@ -31063,6 +31074,18 @@ class ChatClientMgr {
|
|
|
31063
31074
|
|
|
31064
31075
|
|
|
31065
31076
|
|
|
31077
|
+
|
|
31078
|
+
const getRobotInfoByID = async (robotID, groupID) => {
|
|
31079
|
+
let queryData = {
|
|
31080
|
+
"param": {
|
|
31081
|
+
"id": robotID,
|
|
31082
|
+
"groupID": groupID
|
|
31083
|
+
}
|
|
31084
|
+
};
|
|
31085
|
+
let result = await request.post(`/dataservice/rest/orchestration/getRobotInfoByID`, queryData);
|
|
31086
|
+
let robotInfo = result.data.robotInfo;
|
|
31087
|
+
return robotInfo;
|
|
31088
|
+
};
|
|
31066
31089
|
const getIMHanlder = customerHanlder => {
|
|
31067
31090
|
let handler = {
|
|
31068
31091
|
genTestUserSig: async data => {
|