@droppii-org/wasm-client-sdk 0.5.1 → 0.7.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/lib/index.es.js +20 -1
- package/lib/index.js +19 -0
- package/lib/index.umd.js +19 -0
- package/lib/sdk/index.d.ts +5 -2
- package/lib/types/entity.d.ts +4 -0
- package/lib/types/enum.d.ts +8 -1
- package/lib/types/params.d.ts +5 -0
- package/lib/worker-legacy.js +1 -1
- package/lib/worker.js +1 -1
- package/package.json +1 -1
package/lib/index.es.js
CHANGED
|
@@ -1146,7 +1146,17 @@ var GroupPermission;
|
|
|
1146
1146
|
GroupPermission["TransferOwnership"] = "TRANSFER_OWNERSHIP";
|
|
1147
1147
|
GroupPermission["ConfigGroupPermission"] = "CONFIG_GROUP_PERMISSION";
|
|
1148
1148
|
GroupPermission["ViewMemberInformation"] = "VIEW_MEMBER_INFORMATION";
|
|
1149
|
+
// Stored when a member has no permissions. An empty list means the role default.
|
|
1150
|
+
GroupPermission["NoPermission"] = "NO_PERMISSION";
|
|
1149
1151
|
})(GroupPermission || (GroupPermission = {}));
|
|
1152
|
+
// Value of the `key` field inside the detail of OnRecvCustomBusinessMessage
|
|
1153
|
+
var BusinessNotificationKey;
|
|
1154
|
+
(function (BusinessNotificationKey) {
|
|
1155
|
+
BusinessNotificationKey["SessionCreated"] = "SESSION_CREATED";
|
|
1156
|
+
BusinessNotificationKey["SessionClosed"] = "SESSION_CLOSED";
|
|
1157
|
+
BusinessNotificationKey["SessionStateUpdated"] = "SESSION_STATE_UPDATED";
|
|
1158
|
+
BusinessNotificationKey["BotUpdated"] = "BOT_UPDATED";
|
|
1159
|
+
})(BusinessNotificationKey || (BusinessNotificationKey = {}));
|
|
1150
1160
|
var GroupAtType;
|
|
1151
1161
|
(function (GroupAtType) {
|
|
1152
1162
|
GroupAtType[GroupAtType["AtNormal"] = 0] = "AtNormal";
|
|
@@ -1253,6 +1263,9 @@ class SDK extends Emitter {
|
|
|
1253
1263
|
this.getAdvancedHistoryMessageListReverse = (params, operationID = v4()) => {
|
|
1254
1264
|
return this._invoker('getAdvancedHistoryMessageListReverse', window.getAdvancedHistoryMessageListReverse, [operationID, JSON.stringify(params)]);
|
|
1255
1265
|
};
|
|
1266
|
+
this.getFirstUnreadMessage = (conversationID, operationID = v4()) => {
|
|
1267
|
+
return this._invoker('getFirstUnreadMessage', window.getFirstUnreadMessage, [operationID, conversationID]);
|
|
1268
|
+
};
|
|
1256
1269
|
this.getAdvancedHistoryMessageListApp = (params, operationID = v4()) => {
|
|
1257
1270
|
return this._invoker('getAdvancedHistoryMessageListApp', window.getAdvancedHistoryMessageListApp, [operationID, JSON.stringify(params)]);
|
|
1258
1271
|
};
|
|
@@ -1916,6 +1929,12 @@ class SDK extends Emitter {
|
|
|
1916
1929
|
JSON.stringify(data),
|
|
1917
1930
|
]);
|
|
1918
1931
|
};
|
|
1932
|
+
this.setGroupAdminPermissions = (data, operationID = v4()) => {
|
|
1933
|
+
return this._invoker('setGroupAdminPermissions ', window.setGroupAdminPermissions, [operationID, JSON.stringify(data)]);
|
|
1934
|
+
};
|
|
1935
|
+
this.setGroupMemberPermissions = (data, operationID = v4()) => {
|
|
1936
|
+
return this._invoker('setGroupMemberPermissions ', window.setGroupMemberPermissions, [operationID, JSON.stringify(data)]);
|
|
1937
|
+
};
|
|
1919
1938
|
this.joinGroup = (data, operationID = v4()) => {
|
|
1920
1939
|
var _a;
|
|
1921
1940
|
return this._invoker('joinGroup ', window.joinGroup, [
|
|
@@ -2214,4 +2233,4 @@ var indexeddbMainThreadWorkerB24e7a21 = /*#__PURE__*/Object.freeze({
|
|
|
2214
2233
|
'default': WorkerFactory
|
|
2215
2234
|
});
|
|
2216
2235
|
|
|
2217
|
-
export { AllowType, ApplicationHandleResult, CbEvents, GroupAtType, GroupJoinSource, GroupMemberFilter, GroupMemberRole, GroupMessageReaderFilter, GroupPermission, GroupStatus, GroupType, GroupVerificationType, GroupVisibility, LogLevel, LoginStatus, MessageReceiveOptType, MessageStatus, MessageType, OnlineState, Platform, PublicGroupJoinStatus, Relationship, SessionType, ViewType, getSDK };
|
|
2236
|
+
export { AllowType, ApplicationHandleResult, BusinessNotificationKey, CbEvents, GroupAtType, GroupJoinSource, GroupMemberFilter, GroupMemberRole, GroupMessageReaderFilter, GroupPermission, GroupStatus, GroupType, GroupVerificationType, GroupVisibility, LogLevel, LoginStatus, MessageReceiveOptType, MessageStatus, MessageType, OnlineState, Platform, PublicGroupJoinStatus, Relationship, SessionType, ViewType, getSDK };
|
package/lib/index.js
CHANGED
|
@@ -1150,7 +1150,17 @@ exports.GroupPermission = void 0;
|
|
|
1150
1150
|
GroupPermission["TransferOwnership"] = "TRANSFER_OWNERSHIP";
|
|
1151
1151
|
GroupPermission["ConfigGroupPermission"] = "CONFIG_GROUP_PERMISSION";
|
|
1152
1152
|
GroupPermission["ViewMemberInformation"] = "VIEW_MEMBER_INFORMATION";
|
|
1153
|
+
// Stored when a member has no permissions. An empty list means the role default.
|
|
1154
|
+
GroupPermission["NoPermission"] = "NO_PERMISSION";
|
|
1153
1155
|
})(exports.GroupPermission || (exports.GroupPermission = {}));
|
|
1156
|
+
// Value of the `key` field inside the detail of OnRecvCustomBusinessMessage
|
|
1157
|
+
exports.BusinessNotificationKey = void 0;
|
|
1158
|
+
(function (BusinessNotificationKey) {
|
|
1159
|
+
BusinessNotificationKey["SessionCreated"] = "SESSION_CREATED";
|
|
1160
|
+
BusinessNotificationKey["SessionClosed"] = "SESSION_CLOSED";
|
|
1161
|
+
BusinessNotificationKey["SessionStateUpdated"] = "SESSION_STATE_UPDATED";
|
|
1162
|
+
BusinessNotificationKey["BotUpdated"] = "BOT_UPDATED";
|
|
1163
|
+
})(exports.BusinessNotificationKey || (exports.BusinessNotificationKey = {}));
|
|
1154
1164
|
exports.GroupAtType = void 0;
|
|
1155
1165
|
(function (GroupAtType) {
|
|
1156
1166
|
GroupAtType[GroupAtType["AtNormal"] = 0] = "AtNormal";
|
|
@@ -1257,6 +1267,9 @@ class SDK extends Emitter {
|
|
|
1257
1267
|
this.getAdvancedHistoryMessageListReverse = (params, operationID = v4()) => {
|
|
1258
1268
|
return this._invoker('getAdvancedHistoryMessageListReverse', window.getAdvancedHistoryMessageListReverse, [operationID, JSON.stringify(params)]);
|
|
1259
1269
|
};
|
|
1270
|
+
this.getFirstUnreadMessage = (conversationID, operationID = v4()) => {
|
|
1271
|
+
return this._invoker('getFirstUnreadMessage', window.getFirstUnreadMessage, [operationID, conversationID]);
|
|
1272
|
+
};
|
|
1260
1273
|
this.getAdvancedHistoryMessageListApp = (params, operationID = v4()) => {
|
|
1261
1274
|
return this._invoker('getAdvancedHistoryMessageListApp', window.getAdvancedHistoryMessageListApp, [operationID, JSON.stringify(params)]);
|
|
1262
1275
|
};
|
|
@@ -1920,6 +1933,12 @@ class SDK extends Emitter {
|
|
|
1920
1933
|
JSON.stringify(data),
|
|
1921
1934
|
]);
|
|
1922
1935
|
};
|
|
1936
|
+
this.setGroupAdminPermissions = (data, operationID = v4()) => {
|
|
1937
|
+
return this._invoker('setGroupAdminPermissions ', window.setGroupAdminPermissions, [operationID, JSON.stringify(data)]);
|
|
1938
|
+
};
|
|
1939
|
+
this.setGroupMemberPermissions = (data, operationID = v4()) => {
|
|
1940
|
+
return this._invoker('setGroupMemberPermissions ', window.setGroupMemberPermissions, [operationID, JSON.stringify(data)]);
|
|
1941
|
+
};
|
|
1923
1942
|
this.joinGroup = (data, operationID = v4()) => {
|
|
1924
1943
|
var _a;
|
|
1925
1944
|
return this._invoker('joinGroup ', window.joinGroup, [
|
package/lib/index.umd.js
CHANGED
|
@@ -1152,7 +1152,17 @@
|
|
|
1152
1152
|
GroupPermission["TransferOwnership"] = "TRANSFER_OWNERSHIP";
|
|
1153
1153
|
GroupPermission["ConfigGroupPermission"] = "CONFIG_GROUP_PERMISSION";
|
|
1154
1154
|
GroupPermission["ViewMemberInformation"] = "VIEW_MEMBER_INFORMATION";
|
|
1155
|
+
// Stored when a member has no permissions. An empty list means the role default.
|
|
1156
|
+
GroupPermission["NoPermission"] = "NO_PERMISSION";
|
|
1155
1157
|
})(exports.GroupPermission || (exports.GroupPermission = {}));
|
|
1158
|
+
// Value of the `key` field inside the detail of OnRecvCustomBusinessMessage
|
|
1159
|
+
exports.BusinessNotificationKey = void 0;
|
|
1160
|
+
(function (BusinessNotificationKey) {
|
|
1161
|
+
BusinessNotificationKey["SessionCreated"] = "SESSION_CREATED";
|
|
1162
|
+
BusinessNotificationKey["SessionClosed"] = "SESSION_CLOSED";
|
|
1163
|
+
BusinessNotificationKey["SessionStateUpdated"] = "SESSION_STATE_UPDATED";
|
|
1164
|
+
BusinessNotificationKey["BotUpdated"] = "BOT_UPDATED";
|
|
1165
|
+
})(exports.BusinessNotificationKey || (exports.BusinessNotificationKey = {}));
|
|
1156
1166
|
exports.GroupAtType = void 0;
|
|
1157
1167
|
(function (GroupAtType) {
|
|
1158
1168
|
GroupAtType[GroupAtType["AtNormal"] = 0] = "AtNormal";
|
|
@@ -1259,6 +1269,9 @@
|
|
|
1259
1269
|
this.getAdvancedHistoryMessageListReverse = (params, operationID = v4()) => {
|
|
1260
1270
|
return this._invoker('getAdvancedHistoryMessageListReverse', window.getAdvancedHistoryMessageListReverse, [operationID, JSON.stringify(params)]);
|
|
1261
1271
|
};
|
|
1272
|
+
this.getFirstUnreadMessage = (conversationID, operationID = v4()) => {
|
|
1273
|
+
return this._invoker('getFirstUnreadMessage', window.getFirstUnreadMessage, [operationID, conversationID]);
|
|
1274
|
+
};
|
|
1262
1275
|
this.getAdvancedHistoryMessageListApp = (params, operationID = v4()) => {
|
|
1263
1276
|
return this._invoker('getAdvancedHistoryMessageListApp', window.getAdvancedHistoryMessageListApp, [operationID, JSON.stringify(params)]);
|
|
1264
1277
|
};
|
|
@@ -1922,6 +1935,12 @@
|
|
|
1922
1935
|
JSON.stringify(data),
|
|
1923
1936
|
]);
|
|
1924
1937
|
};
|
|
1938
|
+
this.setGroupAdminPermissions = (data, operationID = v4()) => {
|
|
1939
|
+
return this._invoker('setGroupAdminPermissions ', window.setGroupAdminPermissions, [operationID, JSON.stringify(data)]);
|
|
1940
|
+
};
|
|
1941
|
+
this.setGroupMemberPermissions = (data, operationID = v4()) => {
|
|
1942
|
+
return this._invoker('setGroupMemberPermissions ', window.setGroupMemberPermissions, [operationID, JSON.stringify(data)]);
|
|
1943
|
+
};
|
|
1925
1944
|
this.joinGroup = (data, operationID = v4()) => {
|
|
1926
1945
|
var _a;
|
|
1927
1946
|
return this._invoker('joinGroup ', window.joinGroup, [
|
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, InitAndLoginConfig, InsertGroupMsgParams, InsertSingleMsgParams, AccessToGroupParams, SetConversationRecvOptParams, JoinGroupParams, LocationMsgParams, UpdateMemberInfoParams, MergerMsgParams, PartialUserItem, SetConversationPinParams, QuoteMsgParams, RemarkFriendParams, RtcActionParams, SearchFriendParams, SearchGroupMemberParams, SearchGroupParams, SearchPublicGroupsParams, SearchLocalParams, SendGroupReadReceiptParams, SendMsgParams, SetBurnDurationParams, SetConversationMsgDestructParams, SetConversationMsgDestructTimeParams, SetConversationDraftParams, SetGroupRoleParams, SetGroupVerificationParams, SetMemberPermissionParams, SetMessageLocalExParams, SetConversationPrivateStateParams, SignalingInviteParams, SoundMsgParamsByURL, SplitConversationParams, SplitConversationAppParams, GetPinnedMessageListParams, TransferGroupParams, TypingUpdateParams, UploadFileParams, VideoMsgParamsByURL, SetGroupMemberNickParams, WasmPathConfig, PinFriendParams, SetFriendExParams, SetConversationExParams, AddBlackParams, OffsetParams, UpdateFriendsParams, SetConversationParams, GetSpecifiedFriendsParams, ChangeInputStatesParams, GetInputstatesParams } from '../types/params';
|
|
3
|
-
import { AdvancedGetMessageResult, BlackUserItem, CallingRoomData, CardElem, ConversationItem, FriendApplicationItem, FriendshipInfo, FriendUserItem, GroupApplicationItem, GroupItem, GroupMemberItem, GetPinnedMessageListResult, MessageItem, PinnedMsgInfo, PublicUserItem, RtcInviteResults, SearchedFriendsInfo, SearchMessageResult, SearchPublicGroupsResult, SelfUserInfo, UserOnlineState, WsResponse } 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, InitAndLoginConfig, InsertGroupMsgParams, InsertSingleMsgParams, AccessToGroupParams, SetConversationRecvOptParams, JoinGroupParams, LocationMsgParams, UpdateMemberInfoParams, MergerMsgParams, PartialUserItem, SetConversationPinParams, QuoteMsgParams, RemarkFriendParams, RtcActionParams, SearchFriendParams, SearchGroupMemberParams, SearchGroupParams, SearchPublicGroupsParams, SearchLocalParams, SendGroupReadReceiptParams, SendMsgParams, SetBurnDurationParams, SetConversationMsgDestructParams, SetConversationMsgDestructTimeParams, SetConversationDraftParams, SetGroupRoleParams, SetGroupRolePermissionsParams, SetGroupVerificationParams, SetMemberPermissionParams, SetMessageLocalExParams, SetConversationPrivateStateParams, SignalingInviteParams, SoundMsgParamsByURL, SplitConversationParams, SplitConversationAppParams, GetPinnedMessageListParams, TransferGroupParams, TypingUpdateParams, UploadFileParams, VideoMsgParamsByURL, SetGroupMemberNickParams, WasmPathConfig, PinFriendParams, SetFriendExParams, SetConversationExParams, AddBlackParams, OffsetParams, UpdateFriendsParams, SetConversationParams, GetSpecifiedFriendsParams, ChangeInputStatesParams, GetInputstatesParams } from '../types/params';
|
|
3
|
+
import { AdvancedGetMessageResult, BlackUserItem, CallingRoomData, CardElem, ConversationItem, FriendApplicationItem, FriendshipInfo, FriendUserItem, GroupApplicationItem, GroupItem, GroupMemberItem, GetFirstUnreadMessageResult, GetPinnedMessageListResult, MessageItem, PinnedMsgInfo, PublicUserItem, RtcInviteResults, SearchedFriendsInfo, SearchMessageResult, SearchPublicGroupsResult, SelfUserInfo, UserOnlineState, WsResponse } from '../types/entity';
|
|
4
4
|
import { LoginStatus, MessageReceiveOptType, Platform } from '../types/enum';
|
|
5
5
|
declare class SDK extends Emitter {
|
|
6
6
|
private wasmInitializedPromise;
|
|
@@ -17,6 +17,7 @@ declare class SDK extends Emitter {
|
|
|
17
17
|
getOneConversation: (params: GetOneConversationParams, operationID?: string) => Promise<WsResponse<ConversationItem>>;
|
|
18
18
|
getAdvancedHistoryMessageList: (params: GetAdvancedHistoryMsgParams, operationID?: string) => Promise<WsResponse<AdvancedGetMessageResult>>;
|
|
19
19
|
getAdvancedHistoryMessageListReverse: (params: GetAdvancedHistoryMsgParams, operationID?: string) => Promise<WsResponse<AdvancedGetMessageResult>>;
|
|
20
|
+
getFirstUnreadMessage: (conversationID: string, operationID?: string) => Promise<WsResponse<GetFirstUnreadMessageResult>>;
|
|
20
21
|
getAdvancedHistoryMessageListApp: (params: GetAdvancedHistoryMsgParams, operationID?: string) => Promise<WsResponse<AdvancedGetMessageResult>>;
|
|
21
22
|
getAdvancedHistoryMessageListReverseApp: (params: GetAdvancedHistoryMsgParams, operationID?: string) => Promise<WsResponse<AdvancedGetMessageResult>>;
|
|
22
23
|
getSpecifiedGroupsInfo: (params: string[], operationID?: string) => Promise<WsResponse<GroupItem[]>>;
|
|
@@ -140,6 +141,8 @@ declare class SDK extends Emitter {
|
|
|
140
141
|
}, operationID?: string) => Promise<WsResponse<T>>;
|
|
141
142
|
setGroupMemberNickname: <T>(data: SetGroupMemberNickParams, operationID?: string) => Promise<WsResponse<T>>;
|
|
142
143
|
setGroupMemberInfo: <T>(data: UpdateMemberInfoParams, operationID?: string) => Promise<WsResponse<T>>;
|
|
144
|
+
setGroupAdminPermissions: <T>(data: SetGroupRolePermissionsParams, operationID?: string) => Promise<WsResponse<T>>;
|
|
145
|
+
setGroupMemberPermissions: <T>(data: SetGroupRolePermissionsParams, operationID?: string) => Promise<WsResponse<T>>;
|
|
143
146
|
joinGroup: <T>(data: JoinGroupParams, operationID?: string) => Promise<WsResponse<T>>;
|
|
144
147
|
searchGroups: (data: SearchGroupParams, operationID?: string) => Promise<WsResponse<GroupItem[]>>;
|
|
145
148
|
searchPublicGroups: (data: SearchPublicGroupsParams, operationID?: string) => Promise<WsResponse<SearchPublicGroupsResult>>;
|
package/lib/types/entity.d.ts
CHANGED
|
@@ -209,6 +209,7 @@ export declare type ConversationItem = {
|
|
|
209
209
|
ex?: string;
|
|
210
210
|
peerType?: string;
|
|
211
211
|
members?: ConversationGroupMember[];
|
|
212
|
+
lastOpenTime?: number;
|
|
212
213
|
};
|
|
213
214
|
export declare type ConversationGroupMember = {
|
|
214
215
|
userID: string;
|
|
@@ -465,6 +466,9 @@ export declare type AdvancedGetMessageResult = {
|
|
|
465
466
|
errMsg: string;
|
|
466
467
|
messageList: MessageItem[];
|
|
467
468
|
};
|
|
469
|
+
export declare type GetFirstUnreadMessageResult = {
|
|
470
|
+
message: MessageItem | null;
|
|
471
|
+
};
|
|
468
472
|
export declare type GetPinnedMessageListResult = {
|
|
469
473
|
messageList: MessageItem[];
|
|
470
474
|
totalCount: number;
|
package/lib/types/enum.d.ts
CHANGED
|
@@ -126,7 +126,14 @@ export declare enum GroupPermission {
|
|
|
126
126
|
AddAdmin = "ADD_ADMIN",
|
|
127
127
|
TransferOwnership = "TRANSFER_OWNERSHIP",
|
|
128
128
|
ConfigGroupPermission = "CONFIG_GROUP_PERMISSION",
|
|
129
|
-
ViewMemberInformation = "VIEW_MEMBER_INFORMATION"
|
|
129
|
+
ViewMemberInformation = "VIEW_MEMBER_INFORMATION",
|
|
130
|
+
NoPermission = "NO_PERMISSION"
|
|
131
|
+
}
|
|
132
|
+
export declare enum BusinessNotificationKey {
|
|
133
|
+
SessionCreated = "SESSION_CREATED",
|
|
134
|
+
SessionClosed = "SESSION_CLOSED",
|
|
135
|
+
SessionStateUpdated = "SESSION_STATE_UPDATED",
|
|
136
|
+
BotUpdated = "BOT_UPDATED"
|
|
130
137
|
}
|
|
131
138
|
export declare enum GroupAtType {
|
|
132
139
|
AtNormal = 0,
|
package/lib/types/params.d.ts
CHANGED
|
@@ -346,6 +346,11 @@ export declare type SearchGroupMemberParams = {
|
|
|
346
346
|
offset: number;
|
|
347
347
|
count: number;
|
|
348
348
|
};
|
|
349
|
+
export declare type SetGroupRolePermissionsParams = {
|
|
350
|
+
groupID: string;
|
|
351
|
+
enablePermissions?: GroupPermission[];
|
|
352
|
+
disablePermissions?: GroupPermission[];
|
|
353
|
+
};
|
|
349
354
|
export declare type SetMemberPermissionParams = {
|
|
350
355
|
rule: AllowType;
|
|
351
356
|
groupID: string;
|