isdata-customer-sdk 0.1.62 → 0.1.64
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 +22 -5
- package/dist/index.common.js.map +1 -1
- package/dist/index.umd.js +22 -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
|
@@ -30836,6 +30836,7 @@ class ChatClientMgr {
|
|
|
30836
30836
|
this.chatType = params.chatType || 0;
|
|
30837
30837
|
this.singleChatID = params.singleChatID || "";
|
|
30838
30838
|
this.chartOrigin = params.chartOrigin;
|
|
30839
|
+
console.log("ChatClientMgr init:", this.actionKey);
|
|
30839
30840
|
// this.charAIs = {};
|
|
30840
30841
|
}
|
|
30841
30842
|
makeKey(key) {
|
|
@@ -30880,10 +30881,10 @@ class ChatClientMgr {
|
|
|
30880
30881
|
}
|
|
30881
30882
|
return [];
|
|
30882
30883
|
});
|
|
30883
|
-
this.handler.addChatListener(this.makeKey(`sdata_get_test_user_sig`), data => {
|
|
30884
|
+
this.handler.addChatListener(this.makeKey(`sdata_get_test_user_sig`), async data => {
|
|
30884
30885
|
let sdkAppID = data.SDKAppID;
|
|
30885
30886
|
let userID = data.userID;
|
|
30886
|
-
let sigIDObject = this.handler.genTestUserSig({
|
|
30887
|
+
let sigIDObject = await this.handler.genTestUserSig({
|
|
30887
30888
|
SDKAppID: sdkAppID,
|
|
30888
30889
|
userID: userID
|
|
30889
30890
|
});
|
|
@@ -30916,7 +30917,16 @@ class ChatClientMgr {
|
|
|
30916
30917
|
});
|
|
30917
30918
|
}
|
|
30918
30919
|
getChatTypeKey(type) {
|
|
30919
|
-
|
|
30920
|
+
switch (type) {
|
|
30921
|
+
case 0:
|
|
30922
|
+
return "IM_MULTIPLE_MODE";
|
|
30923
|
+
case 1:
|
|
30924
|
+
return "IM_SINGLE_MODE";
|
|
30925
|
+
case 2:
|
|
30926
|
+
return "IM_EMBED_MODE";
|
|
30927
|
+
default:
|
|
30928
|
+
return "IM_MULTIPLE_MODE";
|
|
30929
|
+
}
|
|
30920
30930
|
}
|
|
30921
30931
|
async initChatAIs() {
|
|
30922
30932
|
this.chatAIClient = await this.handler.getChatClient({
|
|
@@ -30934,12 +30944,19 @@ class ChatClientMgr {
|
|
|
30934
30944
|
robot.chatID = robotKey;
|
|
30935
30945
|
let userSig = await this.handler.getPortalUserSig(robotKey, this.imType, this.groupID);
|
|
30936
30946
|
if (!userSig) {
|
|
30937
|
-
let sigIDObject = this.handler.genTestUserSig({
|
|
30947
|
+
let sigIDObject = await this.handler.genTestUserSig({
|
|
30938
30948
|
SDKAppID: this.appSKID,
|
|
30939
30949
|
userID: robotKey
|
|
30940
30950
|
});
|
|
30941
30951
|
userSig = sigIDObject.userSig;
|
|
30942
|
-
|
|
30952
|
+
if (userSig) {
|
|
30953
|
+
await this.chatAIClient.login({
|
|
30954
|
+
userID: robotKey,
|
|
30955
|
+
userSig: userSig
|
|
30956
|
+
});
|
|
30957
|
+
await this.chatAIClient.logout();
|
|
30958
|
+
await this.handler.addIMMapping(robotKey, this.imType, userSig, this.groupID);
|
|
30959
|
+
}
|
|
30943
30960
|
}
|
|
30944
30961
|
robot.userSig = userSig;
|
|
30945
30962
|
this.chatAIClient.charAIs[robotKey] = {
|