Skip to content

Commit

Permalink
feat: method & types update (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bloomingg authored Sep 27, 2024
1 parent 7e5fd0e commit 83ee57f
Show file tree
Hide file tree
Showing 21 changed files with 201 additions and 388 deletions.
Empty file removed assets/linux_arm64/.gitkeep
Empty file.
Binary file modified assets/linux_arm64/libopenimsdk.so
Binary file not shown.
Empty file removed assets/linux_x64/.gitkeep
Empty file.
Binary file modified assets/linux_x64/libopenimsdk.so
Binary file not shown.
Empty file removed assets/mac_arm64/.gitkeep
Empty file.
Binary file modified assets/mac_arm64/libopenimsdk.dylib
Binary file not shown.
Empty file removed assets/mac_x64/.gitkeep
Empty file.
Binary file modified assets/mac_x64/libopenimsdk.dylib
Binary file not shown.
Binary file removed assets/win_ia32/libopenimsdk.dll
Binary file not shown.
Empty file removed assets/win_x64/.gitkeep
Empty file.
Binary file modified assets/win_x64/libopenimsdk.dll
Binary file not shown.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openim/electron-client-sdk",
"version": "1.0.9",
"version": "1.1.0",
"description": "open im sdk for node",
"source": "src/index.ts",
"main": "lib/index.js",
Expand Down Expand Up @@ -43,9 +43,9 @@
"devDependencies": {
"@commitlint/cli": "^16.2.4",
"@commitlint/config-conventional": "^16.2.4",
"@openim/wasm-client-sdk": "^3.8.2-beta.4",
"@rollup/plugin-alias": "^5.1.0",
"@rollup/plugin-terser": "^0.4.4",
"@openim/wasm-client-sdk": "^3.8.0",
"@types/ffi-napi": "^4.0.10",
"@types/node": "^12.20.55",
"@types/uuid": "^8.3.4",
Expand Down Expand Up @@ -80,7 +80,7 @@
"uuid": "^9.0.0"
},
"peerDependencies": {
"@openim/wasm-client-sdk": "^3.8.0",
"@openim/wasm-client-sdk": "^3.8.2-beta.3",
"electron": ">=12.0.0"
}
}
138 changes: 20 additions & 118 deletions src/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { CbEvents, LoginStatus, LogLevel } from '@openim/wasm-client-sdk';
import { SelfUserInfo } from '@openim/wasm-client-sdk/lib/types/entity';
import {
SetConversationExParams,
SetConversationParams,
SetFriendExParams,
UploadFileParams,
} from '@openim/wasm-client-sdk/lib/types/params';
Expand Down Expand Up @@ -364,47 +365,17 @@ class OpenIMSDK
'void',
['baseCallback *', 'str', 'str']
);
this.libOpenIMSDK.get_conversation_recv_message_opt = this.lib.func(
'__stdcall',
'get_conversation_recv_message_opt',
'void',
['baseCallback *', 'str', 'str']
);
this.libOpenIMSDK.set_conversation_draft = this.lib.func(
'__stdcall',
'set_conversation_draft',
'void',
['baseCallback *', 'str', 'str', 'str']
);
this.libOpenIMSDK.reset_conversation_group_at_type = this.lib.func(
this.libOpenIMSDK.set_conversation = this.lib.func(
'__stdcall',
'reset_conversation_group_at_type',
'set_conversation',
'void',
['baseCallback *', 'str', 'str']
);
this.libOpenIMSDK.pin_conversation = this.lib.func(
'__stdcall',
'pin_conversation',
'void',
['baseCallback *', 'str', 'str', 'int']
);
this.libOpenIMSDK.set_conversation_private_chat = this.lib.func(
'__stdcall',
'set_conversation_private_chat',
'void',
['baseCallback *', 'str', 'str', 'int']
);
this.libOpenIMSDK.set_conversation_burn_duration = this.lib.func(
'__stdcall',
'set_conversation_burn_duration',
'void',
['baseCallback *', 'str', 'str', 'int']
);
this.libOpenIMSDK.set_conversation_recv_message_opt = this.lib.func(
'__stdcall',
'set_conversation_recv_message_opt',
'void',
['baseCallback *', 'str', 'str', 'int']
['baseCallback *', 'str', 'str', 'str']
);
this.libOpenIMSDK.get_total_unread_msg_count = this.lib.func(
'__stdcall',
Expand Down Expand Up @@ -544,24 +515,18 @@ class OpenIMSDK
'void',
['baseCallback *', 'str', 'str']
);
this.libOpenIMSDK.get_users_info_with_cache = this.lib.func(
this.libOpenIMSDK.get_users_info = this.lib.func(
'__stdcall',
'get_users_info_with_cache',
'get_users_info',
'void',
['baseCallback *', 'str', 'str', 'str']
['baseCallback *', 'str', 'str']
);
this.libOpenIMSDK.set_self_info = this.lib.func(
'__stdcall',
'set_self_info',
'void',
['baseCallback *', 'str', 'str']
);
this.libOpenIMSDK.set_global_recv_message_opt = this.lib.func(
'__stdcall',
'set_global_recv_message_opt',
'void',
['baseCallback *', 'str', 'int']
);
this.libOpenIMSDK.get_self_user_info = this.lib.func(
'__stdcall',
'get_self_user_info',
Expand Down Expand Up @@ -593,23 +558,29 @@ class OpenIMSDK
['baseCallback *', 'str', 'str']
);
// Friend functions
this.libOpenIMSDK.get_specified_friends_info = this.lib.func(
this.libOpenIMSDK.update_friends = this.lib.func(
'__stdcall',
'get_specified_friends_info',
'void',
['baseCallback *', 'str', 'str']
);
this.libOpenIMSDK.get_specified_friends_info = this.lib.func(
'__stdcall',
'get_specified_friends_info',
'void',
['baseCallback *', 'str', 'str', 'int']
);
this.libOpenIMSDK.get_friend_list = this.lib.func(
'__stdcall',
'get_friend_list',
'void',
['baseCallback *', 'str']
['baseCallback *', 'str', 'int']
);
this.libOpenIMSDK.get_friend_list_page = this.lib.func(
'__stdcall',
'get_friend_list_page',
'void',
['baseCallback *', 'str', 'int', 'int']
['baseCallback *', 'str', 'int', 'int', 'int']
);
this.libOpenIMSDK.search_friends = this.lib.func(
'__stdcall',
Expand All @@ -629,12 +600,6 @@ class OpenIMSDK
'void',
['baseCallback *', 'str', 'str']
);
this.libOpenIMSDK.set_friend_remark = this.lib.func(
'__stdcall',
'set_friend_remark',
'void',
['baseCallback *', 'str', 'str']
);
this.libOpenIMSDK.delete_friend = this.lib.func(
'__stdcall',
'delete_friend',
Expand Down Expand Up @@ -720,12 +685,6 @@ class OpenIMSDK
'void',
['baseCallback *', 'str', 'str', 'str', 'int']
);
this.libOpenIMSDK.set_group_member_role_level = this.lib.func(
'__stdcall',
'set_group_member_role_level',
'void',
['baseCallback *', 'str', 'str', 'str', 'int']
);
this.libOpenIMSDK.set_group_member_info = this.lib.func(
'__stdcall',
'set_group_member_info',
Expand Down Expand Up @@ -880,18 +839,6 @@ class OpenIMSDK

// advance
if (this.enterprise) {
this.libOpenIMSDK.set_conversation_msg_destruct_time = this.lib.func(
'__stdcall',
'set_conversation_msg_destruct_time',
'void',
['baseCallback *', 'str', 'str', 'long long']
);
this.libOpenIMSDK.set_conversation_is_msg_destruct = this.lib.func(
'__stdcall',
'set_conversation_is_msg_destruct',
'void',
['baseCallback *', 'str', 'str', 'int']
);
this.libOpenIMSDK.send_group_message_read_receipt = this.lib.func(
'__stdcall',
'send_group_message_read_receipt',
Expand Down Expand Up @@ -973,48 +920,6 @@ class OpenIMSDK
['baseCallback *', 'str']
);

this.libOpenIMSDK.signaling_create_meeting = this.lib.func(
'__stdcall',
'signaling_create_meeting',
'void',
['baseCallback *', 'str', 'str']
);

this.libOpenIMSDK.signaling_join_meeting = this.lib.func(
'__stdcall',
'signaling_join_meeting',
'void',
['baseCallback *', 'str', 'str']
);

this.libOpenIMSDK.signaling_update_meeting_info = this.lib.func(
'__stdcall',
'signaling_update_meeting_info',
'void',
['baseCallback *', 'str', 'str']
);

this.libOpenIMSDK.signaling_close_room = this.lib.func(
'__stdcall',
'signaling_close_room',
'void',
['baseCallback *', 'str', 'str']
);

this.libOpenIMSDK.signaling_get_meetings = this.lib.func(
'__stdcall',
'signaling_get_meetings',
'void',
['baseCallback *', 'str']
);

this.libOpenIMSDK.signaling_operate_stream = this.lib.func(
'__stdcall',
'signaling_operate_stream',
'void',
['baseCallback *', 'str', 'str', 'str', 'str', 'int', 'int']
);

this.libOpenIMSDK.signaling_send_custom_signal = this.lib.func(
'__stdcall',
'signaling_send_custom_signal',
Expand Down Expand Up @@ -1350,7 +1255,7 @@ class OpenIMSDK
// implements user api
getSelfUserInfo!: UserModuleApi['getSelfUserInfo'];
setSelfInfo!: UserModuleApi['setSelfInfo'];
getUsersInfoWithCache!: UserModuleApi['getUsersInfoWithCache'];
getUsersInfo!: UserModuleApi['getUsersInfo'];
subscribeUsersStatus!: UserModuleApi['subscribeUsersStatus'];
unsubscribeUsersStatus!: UserModuleApi['unsubscribeUsersStatus'];
getSubscribeUsersStatus!: UserModuleApi['getSubscribeUsersStatus'];
Expand All @@ -1376,6 +1281,7 @@ class OpenIMSDK
removeBlack!: FriendModuleApi['removeBlack'];
searchFriends!: FriendModuleApi['searchFriends'];
setFriendRemark!: FriendModuleApi['setFriendRemark'];
updateFriends!: FriendModuleApi['updateFriends'];

// implements group api
createGroup!: GroupModuleApi['createGroup'];
Expand Down Expand Up @@ -1409,6 +1315,7 @@ class OpenIMSDK
getAllConversationList!: ConversationModuleApi['getAllConversationList'];
getConversationListSplit!: ConversationModuleApi['getConversationListSplit'];
getOneConversation!: ConversationModuleApi['getOneConversation'];
setConversation!: ConversationModuleApi['setConversation'];
setConversationEx!: (
params: SetConversationExParams,
opid?: string | undefined
Expand Down Expand Up @@ -1480,12 +1387,7 @@ class OpenIMSDK
signalingGetRoomByGroupID!: SignalingModuleApi['signalingGetRoomByGroupID'];
signalingGetTokenByRoomID!: SignalingModuleApi['signalingGetTokenByRoomID'];
signalingSendCustomSignal!: SignalingModuleApi['signalingSendCustomSignal'];
signalingCreateMeeting!: SignalingModuleApi['signalingCreateMeeting'];
signalingJoinMeeting!: SignalingModuleApi['signalingJoinMeeting'];
signalingUpdateMeetingInfo!: SignalingModuleApi['signalingUpdateMeetingInfo'];
signalingCloseRoom!: SignalingModuleApi['signalingCloseRoom'];
signalingGetMeetings!: SignalingModuleApi['signalingGetMeetings'];
signalingOperateStream!: SignalingModuleApi['signalingOperateStream'];
getSignalingInvitationInfoStartApp!: SignalingModuleApi['getSignalingInvitationInfoStartApp'];
}

export default OpenIMSDK;
Loading

0 comments on commit 83ee57f

Please sign in to comment.