@imam-inter/wasm-client-sdk 3.8.4-patch-issue-pin.22 → 3.8.4-patch-star.24
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/lib/api/database/index.d.ts +1 -0
- package/lib/api/database/msgStar.d.ts +4 -0
- package/lib/constant/index.d.ts +2 -0
- package/lib/index.es.js +45 -0
- package/lib/index.js +45 -0
- package/lib/index.umd.js +45 -0
- package/lib/sdk/index.d.ts +7 -2
- package/lib/sqls/index.d.ts +1 -0
- package/lib/sqls/localMsgStar.d.ts +13 -0
- package/lib/types/entity.d.ts +30 -0
- package/lib/types/eventData.d.ts +3 -1
- package/lib/types/params.d.ts +8 -0
- package/lib/worker-legacy.js +1 -1
- package/lib/worker.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function insertMsgStar(msgStarStr: string): Promise<string>;
|
|
2
|
+
export declare function findMsgStarByConversationIDUserIDAndSeq(conversationID: string, userID: string, seq: number): Promise<string>;
|
|
3
|
+
export declare function findMsgStarByConversationIDAndUserID(conversationID: string, userID: string): Promise<string>;
|
|
4
|
+
export declare function deleteMsgStar(conversationID: string, userID: string, seq: number): Promise<string>;
|
package/lib/constant/index.d.ts
CHANGED
|
@@ -54,6 +54,8 @@ export declare enum CbEvents {
|
|
|
54
54
|
OnGroupRequestInfoChanged = "OnGroupRequestInfoChanged",
|
|
55
55
|
OnMsgPinned = "OnMsgPinned",
|
|
56
56
|
OnMsgUnpinned = "OnMsgUnpinned",
|
|
57
|
+
OnMsgStarred = "OnMsgStarred",
|
|
58
|
+
OnMsgUnstarred = "OnMsgUnstarred",
|
|
57
59
|
UploadComplete = "UploadComplete",
|
|
58
60
|
OnRecvCustomBusinessMessage = "OnRecvCustomBusinessMessage",
|
|
59
61
|
OnUserStatusChanged = "OnUserStatusChanged",
|
package/lib/index.es.js
CHANGED
|
@@ -438,6 +438,9 @@ var CbEvents;
|
|
|
438
438
|
// message pin
|
|
439
439
|
CbEvents["OnMsgPinned"] = "OnMsgPinned";
|
|
440
440
|
CbEvents["OnMsgUnpinned"] = "OnMsgUnpinned";
|
|
441
|
+
// message star
|
|
442
|
+
CbEvents["OnMsgStarred"] = "OnMsgStarred";
|
|
443
|
+
CbEvents["OnMsgUnstarred"] = "OnMsgUnstarred";
|
|
441
444
|
CbEvents["UploadComplete"] = "UploadComplete";
|
|
442
445
|
CbEvents["OnRecvCustomBusinessMessage"] = "OnRecvCustomBusinessMessage";
|
|
443
446
|
CbEvents["OnUserStatusChanged"] = "OnUserStatusChanged";
|
|
@@ -649,6 +652,15 @@ function initDatabaseAPI(isLogStandardOutput = true) {
|
|
|
649
652
|
window.findMsgPinByConversationIDAndSeq = registeMethodOnWindow('findMsgPinByConversationIDAndSeq');
|
|
650
653
|
// @ts-ignore
|
|
651
654
|
window.findMsgPinByConversationID = registeMethodOnWindow('findMsgPinByConversationID');
|
|
655
|
+
// message star
|
|
656
|
+
// @ts-ignore - window types extended in types/index.d.ts
|
|
657
|
+
window.insertMsgStar = registeMethodOnWindow('insertMsgStar');
|
|
658
|
+
// @ts-ignore
|
|
659
|
+
window.deleteMsgStar = registeMethodOnWindow('deleteMsgStar');
|
|
660
|
+
// @ts-ignore
|
|
661
|
+
window.findMsgStarByConversationIDUserIDAndSeq = registeMethodOnWindow('findMsgStarByConversationIDUserIDAndSeq');
|
|
662
|
+
// @ts-ignore
|
|
663
|
+
window.findMsgStarByConversationIDAndUserID = registeMethodOnWindow('findMsgStarByConversationIDAndUserID');
|
|
652
664
|
// conversation
|
|
653
665
|
window.getAllConversationListDB = registeMethodOnWindow('getAllConversationList');
|
|
654
666
|
window.getAllConversationListToSync = registeMethodOnWindow('getAllConversationListToSync');
|
|
@@ -1243,6 +1255,7 @@ class SDK extends Emitter {
|
|
|
1243
1255
|
platformID: params.platformID,
|
|
1244
1256
|
apiAddr: params.apiAddr,
|
|
1245
1257
|
wsAddr: params.wsAddr,
|
|
1258
|
+
chatAddr: params.chatAddr || '',
|
|
1246
1259
|
dataDir: './',
|
|
1247
1260
|
logLevel: params.logLevel || 5,
|
|
1248
1261
|
isLogStandardOutput: (_a = params.isLogStandardOutput) !== null && _a !== void 0 ? _a : this.isLogStandardOutput,
|
|
@@ -1423,6 +1436,22 @@ class SDK extends Emitter {
|
|
|
1423
1436
|
params.localEx,
|
|
1424
1437
|
]);
|
|
1425
1438
|
};
|
|
1439
|
+
this.translateMessage = (params, operationID = v4()) => {
|
|
1440
|
+
var _a;
|
|
1441
|
+
return this._invoker('translateMessage', window.translateMessage, [
|
|
1442
|
+
operationID,
|
|
1443
|
+
params.conversationID,
|
|
1444
|
+
params.clientMsgID,
|
|
1445
|
+
params.targetLang,
|
|
1446
|
+
(_a = params.sourceLang) !== null && _a !== void 0 ? _a : '',
|
|
1447
|
+
]);
|
|
1448
|
+
};
|
|
1449
|
+
this.setChatToken = (chatToken, operationID = v4()) => {
|
|
1450
|
+
return this._invoker('setChatToken', window.setChatToken, [
|
|
1451
|
+
operationID,
|
|
1452
|
+
chatToken,
|
|
1453
|
+
]);
|
|
1454
|
+
};
|
|
1426
1455
|
this.getHistoryMessageListReverse = (params, operationID = v4()) => {
|
|
1427
1456
|
return this._invoker('getHistoryMessageListReverse', window.getHistoryMessageListReverse, [operationID, JSON.stringify(params)]);
|
|
1428
1457
|
};
|
|
@@ -1498,6 +1527,17 @@ class SDK extends Emitter {
|
|
|
1498
1527
|
params.conversationID,
|
|
1499
1528
|
]);
|
|
1500
1529
|
};
|
|
1530
|
+
this.setMessageStar = (params, operationID = v4()) => {
|
|
1531
|
+
return this._invoker('setMessageStar', window.setMessageStar, [
|
|
1532
|
+
operationID,
|
|
1533
|
+
params.conversationID,
|
|
1534
|
+
params.seq,
|
|
1535
|
+
params.starred,
|
|
1536
|
+
]);
|
|
1537
|
+
};
|
|
1538
|
+
this.getMessageStar = (params, operationID = v4()) => {
|
|
1539
|
+
return this._invoker('getMessageStar', window.getMessageStar, [operationID, params.conversationID, params.userID]);
|
|
1540
|
+
};
|
|
1501
1541
|
this.getUsersInfo = (data, operationID = v4()) => {
|
|
1502
1542
|
return this._invoker('getUsersInfo', window.getUsersInfo, [operationID, JSON.stringify(data)]);
|
|
1503
1543
|
};
|
|
@@ -2143,6 +2183,11 @@ class SDK extends Emitter {
|
|
|
2143
2183
|
operationID,
|
|
2144
2184
|
]);
|
|
2145
2185
|
};
|
|
2186
|
+
this.getMsgStarInfo = (operationID = v4()) => {
|
|
2187
|
+
return this._invoker('getMsgStarInfo', window.getMsgStarInfo, [
|
|
2188
|
+
operationID,
|
|
2189
|
+
]);
|
|
2190
|
+
};
|
|
2146
2191
|
this.fileMapSet = (uuid, file) => window.fileMapSet(uuid, file);
|
|
2147
2192
|
// Reset any previous state before initializing
|
|
2148
2193
|
reset();
|
package/lib/index.js
CHANGED
|
@@ -442,6 +442,9 @@ exports.CbEvents = void 0;
|
|
|
442
442
|
// message pin
|
|
443
443
|
CbEvents["OnMsgPinned"] = "OnMsgPinned";
|
|
444
444
|
CbEvents["OnMsgUnpinned"] = "OnMsgUnpinned";
|
|
445
|
+
// message star
|
|
446
|
+
CbEvents["OnMsgStarred"] = "OnMsgStarred";
|
|
447
|
+
CbEvents["OnMsgUnstarred"] = "OnMsgUnstarred";
|
|
445
448
|
CbEvents["UploadComplete"] = "UploadComplete";
|
|
446
449
|
CbEvents["OnRecvCustomBusinessMessage"] = "OnRecvCustomBusinessMessage";
|
|
447
450
|
CbEvents["OnUserStatusChanged"] = "OnUserStatusChanged";
|
|
@@ -653,6 +656,15 @@ function initDatabaseAPI(isLogStandardOutput = true) {
|
|
|
653
656
|
window.findMsgPinByConversationIDAndSeq = registeMethodOnWindow('findMsgPinByConversationIDAndSeq');
|
|
654
657
|
// @ts-ignore
|
|
655
658
|
window.findMsgPinByConversationID = registeMethodOnWindow('findMsgPinByConversationID');
|
|
659
|
+
// message star
|
|
660
|
+
// @ts-ignore - window types extended in types/index.d.ts
|
|
661
|
+
window.insertMsgStar = registeMethodOnWindow('insertMsgStar');
|
|
662
|
+
// @ts-ignore
|
|
663
|
+
window.deleteMsgStar = registeMethodOnWindow('deleteMsgStar');
|
|
664
|
+
// @ts-ignore
|
|
665
|
+
window.findMsgStarByConversationIDUserIDAndSeq = registeMethodOnWindow('findMsgStarByConversationIDUserIDAndSeq');
|
|
666
|
+
// @ts-ignore
|
|
667
|
+
window.findMsgStarByConversationIDAndUserID = registeMethodOnWindow('findMsgStarByConversationIDAndUserID');
|
|
656
668
|
// conversation
|
|
657
669
|
window.getAllConversationListDB = registeMethodOnWindow('getAllConversationList');
|
|
658
670
|
window.getAllConversationListToSync = registeMethodOnWindow('getAllConversationListToSync');
|
|
@@ -1247,6 +1259,7 @@ class SDK extends Emitter {
|
|
|
1247
1259
|
platformID: params.platformID,
|
|
1248
1260
|
apiAddr: params.apiAddr,
|
|
1249
1261
|
wsAddr: params.wsAddr,
|
|
1262
|
+
chatAddr: params.chatAddr || '',
|
|
1250
1263
|
dataDir: './',
|
|
1251
1264
|
logLevel: params.logLevel || 5,
|
|
1252
1265
|
isLogStandardOutput: (_a = params.isLogStandardOutput) !== null && _a !== void 0 ? _a : this.isLogStandardOutput,
|
|
@@ -1427,6 +1440,22 @@ class SDK extends Emitter {
|
|
|
1427
1440
|
params.localEx,
|
|
1428
1441
|
]);
|
|
1429
1442
|
};
|
|
1443
|
+
this.translateMessage = (params, operationID = v4()) => {
|
|
1444
|
+
var _a;
|
|
1445
|
+
return this._invoker('translateMessage', window.translateMessage, [
|
|
1446
|
+
operationID,
|
|
1447
|
+
params.conversationID,
|
|
1448
|
+
params.clientMsgID,
|
|
1449
|
+
params.targetLang,
|
|
1450
|
+
(_a = params.sourceLang) !== null && _a !== void 0 ? _a : '',
|
|
1451
|
+
]);
|
|
1452
|
+
};
|
|
1453
|
+
this.setChatToken = (chatToken, operationID = v4()) => {
|
|
1454
|
+
return this._invoker('setChatToken', window.setChatToken, [
|
|
1455
|
+
operationID,
|
|
1456
|
+
chatToken,
|
|
1457
|
+
]);
|
|
1458
|
+
};
|
|
1430
1459
|
this.getHistoryMessageListReverse = (params, operationID = v4()) => {
|
|
1431
1460
|
return this._invoker('getHistoryMessageListReverse', window.getHistoryMessageListReverse, [operationID, JSON.stringify(params)]);
|
|
1432
1461
|
};
|
|
@@ -1502,6 +1531,17 @@ class SDK extends Emitter {
|
|
|
1502
1531
|
params.conversationID,
|
|
1503
1532
|
]);
|
|
1504
1533
|
};
|
|
1534
|
+
this.setMessageStar = (params, operationID = v4()) => {
|
|
1535
|
+
return this._invoker('setMessageStar', window.setMessageStar, [
|
|
1536
|
+
operationID,
|
|
1537
|
+
params.conversationID,
|
|
1538
|
+
params.seq,
|
|
1539
|
+
params.starred,
|
|
1540
|
+
]);
|
|
1541
|
+
};
|
|
1542
|
+
this.getMessageStar = (params, operationID = v4()) => {
|
|
1543
|
+
return this._invoker('getMessageStar', window.getMessageStar, [operationID, params.conversationID, params.userID]);
|
|
1544
|
+
};
|
|
1505
1545
|
this.getUsersInfo = (data, operationID = v4()) => {
|
|
1506
1546
|
return this._invoker('getUsersInfo', window.getUsersInfo, [operationID, JSON.stringify(data)]);
|
|
1507
1547
|
};
|
|
@@ -2147,6 +2187,11 @@ class SDK extends Emitter {
|
|
|
2147
2187
|
operationID,
|
|
2148
2188
|
]);
|
|
2149
2189
|
};
|
|
2190
|
+
this.getMsgStarInfo = (operationID = v4()) => {
|
|
2191
|
+
return this._invoker('getMsgStarInfo', window.getMsgStarInfo, [
|
|
2192
|
+
operationID,
|
|
2193
|
+
]);
|
|
2194
|
+
};
|
|
2150
2195
|
this.fileMapSet = (uuid, file) => window.fileMapSet(uuid, file);
|
|
2151
2196
|
// Reset any previous state before initializing
|
|
2152
2197
|
reset();
|
package/lib/index.umd.js
CHANGED
|
@@ -444,6 +444,9 @@
|
|
|
444
444
|
// message pin
|
|
445
445
|
CbEvents["OnMsgPinned"] = "OnMsgPinned";
|
|
446
446
|
CbEvents["OnMsgUnpinned"] = "OnMsgUnpinned";
|
|
447
|
+
// message star
|
|
448
|
+
CbEvents["OnMsgStarred"] = "OnMsgStarred";
|
|
449
|
+
CbEvents["OnMsgUnstarred"] = "OnMsgUnstarred";
|
|
447
450
|
CbEvents["UploadComplete"] = "UploadComplete";
|
|
448
451
|
CbEvents["OnRecvCustomBusinessMessage"] = "OnRecvCustomBusinessMessage";
|
|
449
452
|
CbEvents["OnUserStatusChanged"] = "OnUserStatusChanged";
|
|
@@ -655,6 +658,15 @@
|
|
|
655
658
|
window.findMsgPinByConversationIDAndSeq = registeMethodOnWindow('findMsgPinByConversationIDAndSeq');
|
|
656
659
|
// @ts-ignore
|
|
657
660
|
window.findMsgPinByConversationID = registeMethodOnWindow('findMsgPinByConversationID');
|
|
661
|
+
// message star
|
|
662
|
+
// @ts-ignore - window types extended in types/index.d.ts
|
|
663
|
+
window.insertMsgStar = registeMethodOnWindow('insertMsgStar');
|
|
664
|
+
// @ts-ignore
|
|
665
|
+
window.deleteMsgStar = registeMethodOnWindow('deleteMsgStar');
|
|
666
|
+
// @ts-ignore
|
|
667
|
+
window.findMsgStarByConversationIDUserIDAndSeq = registeMethodOnWindow('findMsgStarByConversationIDUserIDAndSeq');
|
|
668
|
+
// @ts-ignore
|
|
669
|
+
window.findMsgStarByConversationIDAndUserID = registeMethodOnWindow('findMsgStarByConversationIDAndUserID');
|
|
658
670
|
// conversation
|
|
659
671
|
window.getAllConversationListDB = registeMethodOnWindow('getAllConversationList');
|
|
660
672
|
window.getAllConversationListToSync = registeMethodOnWindow('getAllConversationListToSync');
|
|
@@ -1249,6 +1261,7 @@
|
|
|
1249
1261
|
platformID: params.platformID,
|
|
1250
1262
|
apiAddr: params.apiAddr,
|
|
1251
1263
|
wsAddr: params.wsAddr,
|
|
1264
|
+
chatAddr: params.chatAddr || '',
|
|
1252
1265
|
dataDir: './',
|
|
1253
1266
|
logLevel: params.logLevel || 5,
|
|
1254
1267
|
isLogStandardOutput: (_a = params.isLogStandardOutput) !== null && _a !== void 0 ? _a : this.isLogStandardOutput,
|
|
@@ -1429,6 +1442,22 @@
|
|
|
1429
1442
|
params.localEx,
|
|
1430
1443
|
]);
|
|
1431
1444
|
};
|
|
1445
|
+
this.translateMessage = (params, operationID = v4()) => {
|
|
1446
|
+
var _a;
|
|
1447
|
+
return this._invoker('translateMessage', window.translateMessage, [
|
|
1448
|
+
operationID,
|
|
1449
|
+
params.conversationID,
|
|
1450
|
+
params.clientMsgID,
|
|
1451
|
+
params.targetLang,
|
|
1452
|
+
(_a = params.sourceLang) !== null && _a !== void 0 ? _a : '',
|
|
1453
|
+
]);
|
|
1454
|
+
};
|
|
1455
|
+
this.setChatToken = (chatToken, operationID = v4()) => {
|
|
1456
|
+
return this._invoker('setChatToken', window.setChatToken, [
|
|
1457
|
+
operationID,
|
|
1458
|
+
chatToken,
|
|
1459
|
+
]);
|
|
1460
|
+
};
|
|
1432
1461
|
this.getHistoryMessageListReverse = (params, operationID = v4()) => {
|
|
1433
1462
|
return this._invoker('getHistoryMessageListReverse', window.getHistoryMessageListReverse, [operationID, JSON.stringify(params)]);
|
|
1434
1463
|
};
|
|
@@ -1504,6 +1533,17 @@
|
|
|
1504
1533
|
params.conversationID,
|
|
1505
1534
|
]);
|
|
1506
1535
|
};
|
|
1536
|
+
this.setMessageStar = (params, operationID = v4()) => {
|
|
1537
|
+
return this._invoker('setMessageStar', window.setMessageStar, [
|
|
1538
|
+
operationID,
|
|
1539
|
+
params.conversationID,
|
|
1540
|
+
params.seq,
|
|
1541
|
+
params.starred,
|
|
1542
|
+
]);
|
|
1543
|
+
};
|
|
1544
|
+
this.getMessageStar = (params, operationID = v4()) => {
|
|
1545
|
+
return this._invoker('getMessageStar', window.getMessageStar, [operationID, params.conversationID, params.userID]);
|
|
1546
|
+
};
|
|
1507
1547
|
this.getUsersInfo = (data, operationID = v4()) => {
|
|
1508
1548
|
return this._invoker('getUsersInfo', window.getUsersInfo, [operationID, JSON.stringify(data)]);
|
|
1509
1549
|
};
|
|
@@ -2149,6 +2189,11 @@
|
|
|
2149
2189
|
operationID,
|
|
2150
2190
|
]);
|
|
2151
2191
|
};
|
|
2192
|
+
this.getMsgStarInfo = (operationID = v4()) => {
|
|
2193
|
+
return this._invoker('getMsgStarInfo', window.getMsgStarInfo, [
|
|
2194
|
+
operationID,
|
|
2195
|
+
]);
|
|
2196
|
+
};
|
|
2152
2197
|
this.fileMapSet = (uuid, file) => window.fileMapSet(uuid, file);
|
|
2153
2198
|
// Reset any previous state before initializing
|
|
2154
2199
|
reset();
|
package/lib/sdk/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Emitter from '../utils/emitter';
|
|
2
|
-
import { AccessFriendApplicationParams, AccessGroupApplicationParams, AccessMessageParams, AddFriendParams, AdvancedMsgParams, AdvancedQuoteMsgParams, AtMsgParams, ChangeGroupMemberMuteParams, ChangeGroupMuteParams, CreateGroupParams, CustomMsgParams, CustomSignalParams, FaceMessageParams, FileMsgParamsByURL, FindMessageParams, GetAdvancedHistoryMsgParams, GetGroupMemberByTimeParams, GetGroupMemberParams, GetGroupMessageReaderParams, GetHistoryMsgParams, GetOneConversationParams, ImageMsgParamsByURL, InitConfig, LoginConfig, InitAndLoginConfig, InsertGroupMsgParams, InsertSingleMsgParams, AccessToGroupParams, SetConversationRecvOptParams, JoinGroupParams, LocationMsgParams, UpdateMemberInfoParams, MergerMsgParams, PartialUserItem, SetConversationPinParams, QuoteMsgParams, RemarkFriendParams, RtcActionParams, SearchFriendParams, SearchGroupMemberParams, SearchGroupParams, SearchLocalParams, SendGroupReadReceiptParams, SendMsgParams, SetBurnDurationParams, SetConversationMsgDestructParams, SetConversationMsgDestructTimeParams, SetConversationDraftParams, SetGroupRoleParams, SetGroupVerificationParams, SetMemberPermissionParams, SetMessageLocalExParams, SetConversationPrivateStateParams, SignalingInviteParams, SoundMsgParamsByURL, SplitConversationParams, TransferGroupParams, TypingUpdateParams, UploadFileParams, VideoMsgParamsByURL, SetGroupMemberNickParams, WasmPathConfig, PinFriendParams, SetFriendExParams, SetConversationExParams, AddBlackParams, OffsetParams, UpdateFriendsParams, SetConversationParams, GetSpecifiedFriendsParams, ChangeInputStatesParams, GetInputstatesParams, FetchSurroundingParams } from '../types/params';
|
|
3
|
-
import { AdvancedGetMessageResult, BlackUserItem, CallingRoomData, CardElem, ConversationItem, FriendApplicationItem, FriendshipInfo, FriendUserItem, GroupApplicationItem, GroupItem, GroupMemberItem, MessageItem, OfflinePush, PublicUserItem, RtcInvite, RtcInviteResults, SearchedFriendsInfo, SearchMessageResult, SelfUserInfo, UserOnlineState, WsResponse, type MsgPinInfo, SetMsgPinInfo, GetMsgPinInfo } from '../types/entity';
|
|
2
|
+
import { AccessFriendApplicationParams, AccessGroupApplicationParams, AccessMessageParams, AddFriendParams, AdvancedMsgParams, AdvancedQuoteMsgParams, AtMsgParams, ChangeGroupMemberMuteParams, ChangeGroupMuteParams, CreateGroupParams, CustomMsgParams, CustomSignalParams, FaceMessageParams, FileMsgParamsByURL, FindMessageParams, GetAdvancedHistoryMsgParams, GetGroupMemberByTimeParams, GetGroupMemberParams, GetGroupMessageReaderParams, GetHistoryMsgParams, GetOneConversationParams, ImageMsgParamsByURL, InitConfig, LoginConfig, InitAndLoginConfig, InsertGroupMsgParams, InsertSingleMsgParams, AccessToGroupParams, SetConversationRecvOptParams, JoinGroupParams, LocationMsgParams, UpdateMemberInfoParams, MergerMsgParams, PartialUserItem, SetConversationPinParams, QuoteMsgParams, RemarkFriendParams, RtcActionParams, SearchFriendParams, SearchGroupMemberParams, SearchGroupParams, SearchLocalParams, SendGroupReadReceiptParams, SendMsgParams, SetBurnDurationParams, SetConversationMsgDestructParams, SetConversationMsgDestructTimeParams, SetConversationDraftParams, SetGroupRoleParams, SetGroupVerificationParams, SetMemberPermissionParams, SetMessageLocalExParams, SetConversationPrivateStateParams, SignalingInviteParams, SoundMsgParamsByURL, SplitConversationParams, TransferGroupParams, TypingUpdateParams, UploadFileParams, VideoMsgParamsByURL, SetGroupMemberNickParams, WasmPathConfig, PinFriendParams, SetFriendExParams, SetConversationExParams, AddBlackParams, OffsetParams, UpdateFriendsParams, SetConversationParams, GetSpecifiedFriendsParams, ChangeInputStatesParams, GetInputstatesParams, FetchSurroundingParams, TranslateMessageParams } from '../types/params';
|
|
3
|
+
import { AdvancedGetMessageResult, BlackUserItem, CallingRoomData, CardElem, ConversationItem, FriendApplicationItem, FriendshipInfo, FriendUserItem, GroupApplicationItem, GroupItem, GroupMemberItem, MessageItem, OfflinePush, PublicUserItem, RtcInvite, RtcInviteResults, SearchedFriendsInfo, SearchMessageResult, SelfUserInfo, UserOnlineState, TranslateResult, WsResponse, type MsgPinInfo, SetMsgPinInfo, GetMsgPinInfo, type MsgStarInfo, SetMsgStarInfo, GetMsgStarInfo } from '../types/entity';
|
|
4
4
|
import { LoginStatus, MessageReceiveOptType, Platform } from '../types/enum';
|
|
5
5
|
declare class SDK extends Emitter {
|
|
6
6
|
private wasmInitializedPromise;
|
|
@@ -40,6 +40,8 @@ declare class SDK extends Emitter {
|
|
|
40
40
|
sendMessage: (params: SendMsgParams, operationID?: string) => Promise<WsResponse<MessageItem>>;
|
|
41
41
|
sendMessageNotOss: (params: SendMsgParams, operationID?: string) => Promise<WsResponse<MessageItem>>;
|
|
42
42
|
setMessageLocalEx: <T>(params: SetMessageLocalExParams, operationID?: string) => Promise<WsResponse<T>>;
|
|
43
|
+
translateMessage: (params: TranslateMessageParams, operationID?: string) => Promise<WsResponse<TranslateResult>>;
|
|
44
|
+
setChatToken: (chatToken: string, operationID?: string) => Promise<WsResponse<unknown>>;
|
|
43
45
|
exportDB(operationID?: string): Promise<WsResponse<unknown>>;
|
|
44
46
|
getHistoryMessageListReverse: (params: GetHistoryMsgParams, operationID?: string) => Promise<WsResponse<AdvancedGetMessageResult>>;
|
|
45
47
|
revokeMessage: <T>(data: AccessMessageParams, operationID?: string) => Promise<WsResponse<T>>;
|
|
@@ -59,6 +61,8 @@ declare class SDK extends Emitter {
|
|
|
59
61
|
getSelfUserInfo: (operationID?: string) => Promise<WsResponse<SelfUserInfo>>;
|
|
60
62
|
setMessagePin: <T>(params: SetMsgPinInfo, operationID?: string) => Promise<WsResponse<T>>;
|
|
61
63
|
getMessagePin: (params: GetMsgPinInfo, operationID?: string) => Promise<WsResponse<MsgPinInfo[]>>;
|
|
64
|
+
setMessageStar: <T>(params: SetMsgStarInfo, operationID?: string) => Promise<WsResponse<T>>;
|
|
65
|
+
getMessageStar: (params: GetMsgStarInfo, operationID?: string) => Promise<WsResponse<MsgStarInfo[]>>;
|
|
62
66
|
getUsersInfo: (data: string[], operationID?: string) => Promise<WsResponse<PublicUserItem[]>>;
|
|
63
67
|
/**
|
|
64
68
|
* @deprecated Use setSelfInfo instead.
|
|
@@ -229,6 +233,7 @@ declare class SDK extends Emitter {
|
|
|
229
233
|
setConversationIsMsgDestruct: <T>(data: SetConversationMsgDestructParams, operationID?: string) => Promise<WsResponse<T>>;
|
|
230
234
|
setConversationMsgDestructTime: <T>(data: SetConversationMsgDestructTimeParams, operationID?: string) => Promise<WsResponse<T>>;
|
|
231
235
|
getMsgPinInfo: (operationID?: string) => Promise<WsResponse<MsgPinInfo>>;
|
|
236
|
+
getMsgStarInfo: (operationID?: string) => Promise<WsResponse<MsgStarInfo>>;
|
|
232
237
|
fileMapSet: (uuid: string, file: File) => Promise<any>;
|
|
233
238
|
}
|
|
234
239
|
export declare function getSDK(config?: WasmPathConfig): SDK;
|
package/lib/sqls/index.d.ts
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Database, QueryExecResult } from '@jlongster/sql.js';
|
|
2
|
+
export type LocalMsgStar = {
|
|
3
|
+
conversation_id: string;
|
|
4
|
+
user_id: string;
|
|
5
|
+
seq: number;
|
|
6
|
+
created_by?: string;
|
|
7
|
+
created_at?: number;
|
|
8
|
+
};
|
|
9
|
+
export declare function localMsgStars(db: Database): QueryExecResult[];
|
|
10
|
+
export declare function insertMsgStar(db: Database, msgStar: LocalMsgStar): QueryExecResult[];
|
|
11
|
+
export declare function findMsgStarByConversationIDUserIDAndSeq(db: Database, conversationID: string, userID: string, seq: number): QueryExecResult[];
|
|
12
|
+
export declare function findMsgStarByConversationIDAndUserID(db: Database, conversationID: string, userID: string): QueryExecResult[];
|
|
13
|
+
export declare function deleteMsgStar(db: Database, conversationID: string, userID: string, seq: number): QueryExecResult[];
|
package/lib/types/entity.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export type IMConfig = {
|
|
|
18
18
|
platformID: Platform;
|
|
19
19
|
apiAddr: string;
|
|
20
20
|
wsAddr: string;
|
|
21
|
+
chatAddr: string;
|
|
21
22
|
dataDir: string;
|
|
22
23
|
logLevel: LogLevel;
|
|
23
24
|
isLogStandardOutput: boolean;
|
|
@@ -247,6 +248,19 @@ export type MsgUnpinInfo = {
|
|
|
247
248
|
conversationID: string;
|
|
248
249
|
seq: number;
|
|
249
250
|
};
|
|
251
|
+
export type MsgStarInfo = {
|
|
252
|
+
conversationID: string;
|
|
253
|
+
userID: string;
|
|
254
|
+
seq: number;
|
|
255
|
+
createdBy: string;
|
|
256
|
+
createdAt: number;
|
|
257
|
+
msg: MessageItem;
|
|
258
|
+
};
|
|
259
|
+
export type MsgUnstarInfo = {
|
|
260
|
+
conversationID: string;
|
|
261
|
+
userID: string;
|
|
262
|
+
seq: number;
|
|
263
|
+
};
|
|
250
264
|
export type TextElem = {
|
|
251
265
|
content: string;
|
|
252
266
|
};
|
|
@@ -477,3 +491,19 @@ export type SetMsgPinInfo = {
|
|
|
477
491
|
export type GetMsgPinInfo = {
|
|
478
492
|
conversationID: string;
|
|
479
493
|
};
|
|
494
|
+
export type TranslateResult = {
|
|
495
|
+
clientMsgID: string;
|
|
496
|
+
translatedText: string;
|
|
497
|
+
detectedLang: string;
|
|
498
|
+
targetLang: string;
|
|
499
|
+
};
|
|
500
|
+
export type SetMsgStarInfo = {
|
|
501
|
+
conversationID: string;
|
|
502
|
+
userID: string;
|
|
503
|
+
seq: number;
|
|
504
|
+
starred: boolean;
|
|
505
|
+
};
|
|
506
|
+
export type GetMsgStarInfo = {
|
|
507
|
+
conversationID: string;
|
|
508
|
+
userID: string;
|
|
509
|
+
};
|
package/lib/types/eventData.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CbEvents } from '../constant';
|
|
2
|
-
import { BlackUserItem, ConversationInputStatus, ConversationItem, FriendApplicationItem, FriendUserItem, GroupApplicationItem, GroupItem, GroupMemberItem, GroupMessageReceiptInfo, MessageItem, MsgPinInfo, MsgUnpinInfo, ReceiptInfo, RevokedInfo, SelfUserInfo, UserOnlineState } from './entity';
|
|
2
|
+
import { BlackUserItem, ConversationInputStatus, ConversationItem, FriendApplicationItem, FriendUserItem, GroupApplicationItem, GroupItem, GroupMemberItem, GroupMessageReceiptInfo, MessageItem, MsgPinInfo, MsgUnpinInfo, ReceiptInfo, RevokedInfo, SelfUserInfo, UserOnlineState, type MsgStarInfo, type MsgUnstarInfo } from './entity';
|
|
3
3
|
export type EventDataMap = {
|
|
4
4
|
[CbEvents.OnProgress]: {
|
|
5
5
|
progress: number;
|
|
@@ -49,5 +49,7 @@ export type EventDataMap = {
|
|
|
49
49
|
[CbEvents.OnUserTokenInvalid]: void;
|
|
50
50
|
[CbEvents.OnMsgPinned]: MsgPinInfo;
|
|
51
51
|
[CbEvents.OnMsgUnpinned]: MsgUnpinInfo;
|
|
52
|
+
[CbEvents.OnMsgStarred]: MsgStarInfo;
|
|
53
|
+
[CbEvents.OnMsgUnstarred]: MsgUnstarInfo;
|
|
52
54
|
};
|
|
53
55
|
export type DataOfEvent<E extends CbEvents> = E extends keyof EventDataMap ? EventDataMap[E] : never;
|
package/lib/types/params.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export type InitConfig = {
|
|
|
9
9
|
platformID: number;
|
|
10
10
|
apiAddr: string;
|
|
11
11
|
wsAddr: string;
|
|
12
|
+
chatAddr?: string;
|
|
12
13
|
logLevel?: LogLevel;
|
|
13
14
|
isLogStandardOutput?: boolean;
|
|
14
15
|
isExternalExtensions?: boolean;
|
|
@@ -28,6 +29,7 @@ export type InitAndLoginConfig = {
|
|
|
28
29
|
platformID: number;
|
|
29
30
|
apiAddr: string;
|
|
30
31
|
wsAddr: string;
|
|
32
|
+
chatAddr?: string;
|
|
31
33
|
logLevel?: LogLevel;
|
|
32
34
|
isLogStandardOutput?: boolean;
|
|
33
35
|
isExternalExtensions?: boolean;
|
|
@@ -89,6 +91,12 @@ export type SetMessageLocalExParams = {
|
|
|
89
91
|
clientMsgID: string;
|
|
90
92
|
localEx: string;
|
|
91
93
|
};
|
|
94
|
+
export type TranslateMessageParams = {
|
|
95
|
+
conversationID: string;
|
|
96
|
+
clientMsgID: string;
|
|
97
|
+
targetLang: string;
|
|
98
|
+
sourceLang?: string;
|
|
99
|
+
};
|
|
92
100
|
export type ImageMsgParamsByURL = {
|
|
93
101
|
sourcePicture: PicBaseInfo;
|
|
94
102
|
bigPicture: PicBaseInfo;
|