diff --git a/assets/linux_arm64/libopenimsdk.so b/assets/linux_arm64/libopenimsdk.so index b6178df..56950aa 100644 Binary files a/assets/linux_arm64/libopenimsdk.so and b/assets/linux_arm64/libopenimsdk.so differ diff --git a/assets/linux_x64/libopenimsdk.so b/assets/linux_x64/libopenimsdk.so index 7cc8026..7a93a91 100644 Binary files a/assets/linux_x64/libopenimsdk.so and b/assets/linux_x64/libopenimsdk.so differ diff --git a/assets/mac_arm64/libopenimsdk.dylib b/assets/mac_arm64/libopenimsdk.dylib index b1f895c..a0c314c 100644 Binary files a/assets/mac_arm64/libopenimsdk.dylib and b/assets/mac_arm64/libopenimsdk.dylib differ diff --git a/assets/mac_x64/libopenimsdk.dylib b/assets/mac_x64/libopenimsdk.dylib index 2541a0d..25d44fe 100644 Binary files a/assets/mac_x64/libopenimsdk.dylib and b/assets/mac_x64/libopenimsdk.dylib differ diff --git a/assets/win_ia32/libopenimsdk.dll b/assets/win_ia32/libopenimsdk.dll index 270180f..159c913 100644 Binary files a/assets/win_ia32/libopenimsdk.dll and b/assets/win_ia32/libopenimsdk.dll differ diff --git a/assets/win_x64/libopenimsdk.dll b/assets/win_x64/libopenimsdk.dll index 9d00b85..e0a6c6b 100644 Binary files a/assets/win_x64/libopenimsdk.dll and b/assets/win_x64/libopenimsdk.dll differ diff --git a/package-lock.json b/package-lock.json index d687263..b937a94 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@openim/electron-client-sdk", - "version": "1.1.5", + "version": "3.8.3-patch.8", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@openim/electron-client-sdk", - "version": "1.1.5", + "version": "3.8.3-patch.8", "license": "MIT", "dependencies": { "koffi": "2.8.0", @@ -15,7 +15,7 @@ "devDependencies": { "@commitlint/cli": "^16.2.4", "@commitlint/config-conventional": "^16.2.4", - "@openim/wasm-client-sdk": "^3.8.3", + "@openim/wasm-client-sdk": "^3.8.3-patch.8", "@rollup/plugin-alias": "^5.1.0", "@rollup/plugin-terser": "^0.4.4", "@types/ffi-napi": "^4.0.10", @@ -43,7 +43,7 @@ "node": ">=12.0" }, "peerDependencies": { - "@openim/wasm-client-sdk": "^3.8.3", + "@openim/wasm-client-sdk": "^3.8.3-patch.3", "electron": ">=12.0.0" } }, @@ -1882,10 +1882,11 @@ } }, "node_modules/@openim/wasm-client-sdk": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/@openim/wasm-client-sdk/-/wasm-client-sdk-3.8.3.tgz", - "integrity": "sha512-Kly5qibTdPTaIX8SClbzke46X/hl6vjYY8i0iMAqktrNak+Vn80dxMpY9QhIdwqhYA8MU2ffcdJkd9JXm+QK2Q==", + "version": "3.8.3-patch.8", + "resolved": "https://registry.npmjs.org/@openim/wasm-client-sdk/-/wasm-client-sdk-3.8.3-patch.8.tgz", + "integrity": "sha512-kv0KZo5dFwWuzqoefjVaDrS94FVpTPdf/gWO2ppnpApHIGoSVhyHyLNhRgOBqa7MlOtpxZ8T8u0cdOMuZe5uRA==", "dev": true, + "license": "MIT", "engines": { "node": ">=12.0" } diff --git a/package.json b/package.json index 17d96cd..89ab361 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openim/electron-client-sdk", - "version": "3.8.3-patch.3", + "version": "3.8.3-patch.8", "description": "open im sdk for node", "source": "src/index.ts", "main": "lib/index.js", @@ -43,7 +43,7 @@ "devDependencies": { "@commitlint/cli": "^16.2.4", "@commitlint/config-conventional": "^16.2.4", - "@openim/wasm-client-sdk": "^3.8.3-patch.3", + "@openim/wasm-client-sdk": "^3.8.3-patch.8", "@rollup/plugin-alias": "^5.1.0", "@rollup/plugin-terser": "^0.4.4", "@types/ffi-napi": "^4.0.10", diff --git a/src/core/index.ts b/src/core/index.ts index 281ae3b..ceb1d94 100644 --- a/src/core/index.ts +++ b/src/core/index.ts @@ -623,13 +623,19 @@ class OpenIMSDK '__stdcall', 'get_friend_application_list_as_recipient', 'void', - ['baseCallback *', 'str'] + ['baseCallback *', 'str', 'str'] ); this.libOpenIMSDK.get_friend_application_list_as_applicant = this.lib.func( '__stdcall', 'get_friend_application_list_as_applicant', 'void', - ['baseCallback *', 'str'] + ['baseCallback *', 'str', 'str'] + ); + this.libOpenIMSDK.get_friend_application_unhandled_count = this.lib.func( + '__stdcall', + 'get_friend_application_unhandled_count', + 'void', + ['baseCallback *', 'str', 'str'] ); this.libOpenIMSDK.accept_friend_application = this.lib.func( '__stdcall', @@ -789,13 +795,19 @@ class OpenIMSDK '__stdcall', 'get_group_application_list_as_recipient', 'void', - ['baseCallback *', 'str'] + ['baseCallback *', 'str', 'str'] ); this.libOpenIMSDK.get_group_application_list_as_applicant = this.lib.func( '__stdcall', 'get_group_application_list_as_applicant', 'void', - ['baseCallback *', 'str'] + ['baseCallback *', 'str', 'str'] + ); + this.libOpenIMSDK.get_group_application_unhandled_count = this.lib.func( + '__stdcall', + 'get_group_application_unhandled_count', + 'void', + ['baseCallback *', 'str', 'str'] ); this.libOpenIMSDK.accept_group_application = this.lib.func( '__stdcall', @@ -1295,6 +1307,7 @@ class OpenIMSDK ) => Promise>; getFriendApplicationListAsApplicant!: FriendModuleApi['getFriendApplicationListAsApplicant']; getFriendApplicationListAsRecipient!: FriendModuleApi['getFriendApplicationListAsRecipient']; + getFriendApplicationUnhandledCount!: FriendModuleApi['getFriendApplicationUnhandledCount']; getFriendList!: FriendModuleApi['getFriendList']; getFriendListPage!: FriendModuleApi['getFriendListPage']; getSpecifiedFriendsInfo!: FriendModuleApi['getSpecifiedFriendsInfo']; @@ -1315,6 +1328,7 @@ class OpenIMSDK setGroupInfo!: GroupModuleApi['setGroupInfo']; getGroupApplicationListAsRecipient!: GroupModuleApi['getGroupApplicationListAsRecipient']; getGroupApplicationListAsApplicant!: GroupModuleApi['getGroupApplicationListAsApplicant']; + getGroupApplicationUnhandledCount!: GroupModuleApi['getGroupApplicationUnhandledCount']; acceptGroupApplication!: GroupModuleApi['acceptGroupApplication']; refuseGroupApplication!: GroupModuleApi['refuseGroupApplication']; getGroupMemberList!: GroupModuleApi['getGroupMemberList']; diff --git a/src/core/modules/friend.ts b/src/core/modules/friend.ts index 978e8fd..4162f36 100644 --- a/src/core/modules/friend.ts +++ b/src/core/modules/friend.ts @@ -6,6 +6,9 @@ import { AccessFriendApplicationParams, AddBlackParams, AddFriendParams, + GetFriendApplicationListAsApplicationParams, + GetFriendApplicationListAsRecipientParams, + GetSelfUnhandledApplyCountParams, GetSpecifiedFriendsParams, OffsetParams, PinFriendParams, @@ -93,19 +96,45 @@ export function setupFriendModule(openIMSDK: OpenIMSDK) { ); }), - getFriendApplicationListAsApplicant: (opid = uuidV4()) => + getFriendApplicationListAsApplicant: ( + params: GetFriendApplicationListAsApplicationParams = { + offset: 0, + count: 0, + }, + opid = uuidV4() + ) => new Promise>((resolve, reject) => { openIMSDK.libOpenIMSDK.get_friend_application_list_as_applicant( openIMSDK.baseCallbackWrap(resolve, reject), - opid + opid, + JSON.stringify(params) ); }), - getFriendApplicationListAsRecipient: (opid = uuidV4()) => + getFriendApplicationListAsRecipient: ( + params: GetFriendApplicationListAsRecipientParams = { + handleResults: [], + offset: 0, + count: 0, + }, + opid = uuidV4() + ) => new Promise>((resolve, reject) => { openIMSDK.libOpenIMSDK.get_friend_application_list_as_recipient( openIMSDK.baseCallbackWrap(resolve, reject), - opid + opid, + JSON.stringify(params) + ); + }), + getFriendApplicationUnhandledCount: ( + params: GetSelfUnhandledApplyCountParams, + opid = uuidV4() + ) => + new Promise>((resolve, reject) => { + openIMSDK.libOpenIMSDK.get_friend_application_unhandled_count( + openIMSDK.baseCallbackWrap(resolve, reject), + opid, + JSON.stringify(params) ); }), @@ -227,11 +256,17 @@ export interface FriendModuleApi { ) => Promise>; getBlackList: (opid?: string) => Promise>; getFriendApplicationListAsApplicant: ( + params: GetFriendApplicationListAsApplicationParams, opid?: string ) => Promise>; getFriendApplicationListAsRecipient: ( + params: GetFriendApplicationListAsRecipientParams, opid?: string ) => Promise>; + getFriendApplicationUnhandledCount: ( + params: GetSelfUnhandledApplyCountParams, + opid?: string + ) => Promise>; getFriendList: ( filterBlack?: boolean, opid?: string diff --git a/src/core/modules/group.ts b/src/core/modules/group.ts index 18f2ed8..7906009 100644 --- a/src/core/modules/group.ts +++ b/src/core/modules/group.ts @@ -20,6 +20,8 @@ import { TransferGroupParams, AccessToGroupParams, OffsetParams, + GetSelfUnhandledApplyCountParams, + GetGroupApplicationListParams, } from '@openim/wasm-client-sdk/lib/types/params'; export function setupGroupModule(openIMSDK: OpenIMSDK) { @@ -101,19 +103,49 @@ export function setupGroupModule(openIMSDK: OpenIMSDK) { ); }), - getGroupApplicationListAsRecipient: (opid = uuidV4()) => + getGroupApplicationListAsRecipient: ( + params: GetGroupApplicationListParams = { + groupID: [], + handleResults: [], + offset: 0, + count: 0, + }, + opid = uuidV4() + ) => new Promise>((resolve, reject) => { openIMSDK.libOpenIMSDK.get_group_application_list_as_recipient( openIMSDK.baseCallbackWrap(resolve, reject), - opid + opid, + JSON.stringify(params) ); }), - getGroupApplicationListAsApplicant: (opid = uuidV4()) => + getGroupApplicationListAsApplicant: ( + params: GetGroupApplicationListParams = { + groupID: [], + handleResults: [], + offset: 0, + count: 0, + }, + opid = uuidV4() + ) => new Promise>((resolve, reject) => { openIMSDK.libOpenIMSDK.get_group_application_list_as_applicant( openIMSDK.baseCallbackWrap(resolve, reject), - opid + opid, + JSON.stringify(params) + ); + }), + + getGroupApplicationUnhandledCount: ( + params: GetSelfUnhandledApplyCountParams, + opid = uuidV4() + ) => + new Promise>((resolve, reject) => { + openIMSDK.libOpenIMSDK.get_group_application_unhandled_count( + openIMSDK.baseCallbackWrap(resolve, reject), + opid, + JSON.stringify(params) ); }), @@ -331,11 +363,17 @@ export interface GroupModuleApi { opid?: string ) => Promise>; getGroupApplicationListAsRecipient: ( + params: GetGroupApplicationListParams, opid?: string ) => Promise>; getGroupApplicationListAsApplicant: ( + params: GetGroupApplicationListParams, opid?: string ) => Promise>; + getGroupApplicationUnhandledCount: ( + params: GetSelfUnhandledApplyCountParams, + opid?: string + ) => Promise>; acceptGroupApplication: ( params: AccessGroupApplicationParams, opid?: string diff --git a/src/types/libOpenIMSDK.d.ts b/src/types/libOpenIMSDK.d.ts index d456c32..d80c06c 100644 --- a/src/types/libOpenIMSDK.d.ts +++ b/src/types/libOpenIMSDK.d.ts @@ -408,11 +408,18 @@ declare module 'libOpenIMSDK' { ): void; get_friend_application_list_as_recipient( cCallback: CB_S_I_S_S, - operationID: string + operationID: string, + param: string ): void; get_friend_application_list_as_applicant( cCallback: CB_S_I_S_S, - operationID: string + operationID: string, + param: string + ): void; + get_friend_application_unhandled_count( + cCallback: CB_S_I_S_S, + operationID: string, + param: string ): void; accept_friend_application( cCallback: CB_S_I_S_S, @@ -569,11 +576,18 @@ declare module 'libOpenIMSDK' { ): void; get_group_application_list_as_recipient( cCallback: CB_S_I_S_S, - operationID: string + operationID: string, + param: string ): void; get_group_application_list_as_applicant( cCallback: CB_S_I_S_S, - operationID: string + operationID: string, + param: string + ): void; + get_group_application_unhandled_count( + cCallback: CB_S_I_S_S, + operationID: string, + param: string ): void; accept_group_application( cCallback: CB_S_I_S_S,