Skip to content

Commit a6569f0

Browse files
committed
chore: bump version 9.18.0
Signed-off-by: Dylan <[email protected]>
1 parent c25dea8 commit a6569f0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+14464
-13259
lines changed

.gitignore

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
.DS_Store
2-
31
# Node-gyp
42
build
53

README.md

+58-44
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ For comprehensive documentation, changelog, and technical support, please visit
3434
## System Requirements
3535

3636
| System | Requirements |
37-
| ------- | ------------- |
37+
| ------- |---------------|
3838
| Windows | >= Windows 7 |
39-
| macOS | >= 10.14.0 |
39+
| macOS | >= 10.13.0 |
4040
| Linux | glibc >= 2.23 |
4141

4242
## Supported Platforms
@@ -111,59 +111,73 @@ Build Requirements:
111111
Now you are all set to build, run following commands in the root directory of the project:
112112

113113
```cmake
114-
cmake -S . -B build
114+
cmake -Bbuild
115115
cmake --build build --config Release
116116
```
117117

118-
And voilà, you now have your own node-nim binary file in the `build` directory.
118+
Now, you have your own node-nim binary file in the `build` directory.
119119

120120
## Quick Start
121121

122-
```ts
123-
import * as node_nim from 'node-nim'
124-
```
125-
126-
### Initialize SDK
122+
First, you need to import the `node-nim` module:
127123

128124
```ts
129-
const result = node_nim.nim.client.init('appkey', '', '', {
130-
database_encrypt_key_: 'abcdefghijklmnopqrstuvwxyz012345'
131-
})
132-
if (result) {
133-
node_nim.nim.initEventHandlers() // init event handlers
134-
node_nim.nim.talk.on('receiveMsg', (result) => {
135-
console.log('receiveMsg', result)
136-
})
137-
node_nim.nim.talk.on('sendMsg', (message: node_nim.IMMessage) => {
138-
console.log('sendMsg: ', message)
139-
})
140-
// add more event handlers here
141-
// ...
142-
}
143-
return result
125+
// ES6 Module
126+
import * as NIM from 'node-nim'
127+
// CommonJS
128+
const NIM = require('node-nim')
144129
```
145130

146-
### Login
131+
After importing the module, you can directly use the three types of objects we have instantiated for you, such as IM, chatroom, and qchat. Here is an example:
147132

148-
```ts
149-
let [loginResult] = await node_nim.nim.client.login('appkey', 'account', 'password', null, '')
150-
if (loginResult.res_code_ == node_nim.NIMResCode.kNIMResSuccess) {
151-
console.log('login succeeded')
152-
} else {
153-
console.log('login failed')
154-
}
155-
```
133+
```javascript
134+
// IM related functions
135+
NIM.nim.client.init('', '', '', {})
136+
NIM.nim.client.cleanup('')
156137

157-
### Send Message
138+
// Chatroom related functions
139+
NIM.chatroom.init('', '')
140+
NIM.chatroom.cleanup()
158141

159-
```ts
160-
node_nim.nim.talk.sendMsg(
161-
{
162-
session_type_: node_nim.NIMSessionType.kNIMSessionTypeP2P,
163-
receiver_accid_: 'receiver',
164-
type_: node_nim.NIMMessageType.kNIMMessageTypeText,
165-
content_: 'Send from NIM node quick start.'
166-
},
167-
''
168-
)
142+
// QChat related functions
143+
NIM.qchat.instance.init({ appkey: 'your appkey', app_data_path: 'qchat' })
144+
NIM.qchat.instance.cleanup({})
169145
```
146+
147+
The objects that can be directly accessed through `NIM.nim` are:
148+
149+
| Object Name | Description |
150+
|--------------------|---------------------------------------------------------------------|
151+
| `client` | Client module |
152+
| `dataSync` | Data sync module |
153+
| `friend` | Friend module |
154+
| `global` | Global module |
155+
| `msglog` | Message log module |
156+
| `nos` | Object storage module |
157+
| `onlineSession` | Online session module |
158+
| `passThroughProxy` | Pass-through proxy module |
159+
| `session` | Local session module |
160+
| `subscribeEvent` | Event subscription module |
161+
| `superTeam` | Super team module |
162+
| `sysMsg` | System message module |
163+
| `talk` | Talk module |
164+
| `team` | Team module |
165+
| `tool` | Tool module |
166+
| `user` | User module |
167+
| `plugin` | Plugin module |
168+
| `talkEx` | Message extension module, PIN messages, quick comments, collections |
169+
170+
The object that can be directly accessed through `NIM.chatroom` corresponds to `ChatRoomModule`, and you can directly access the member functions under this object.
171+
172+
The objects that can be directly accessed through `NIM.qchat` are:
173+
174+
| Object Name | Description |
175+
|----------------------|----------------------------------|
176+
| `instance` | QChat instance module |
177+
| `server` | QChat server module |
178+
| `channel` | QChat channel module |
179+
| `channelCategory` | QChat channel category module |
180+
| `message` | QChat message module |
181+
| `systemNotification` | QChat system notification module |
182+
| `attachment` | QChat attachment module |
183+
| `role` | QChat role module |

README_CN.md

+55-40
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ npm install node-nim --save-dev --arch=arm64 --platform=linux
113113

114114
```cmake
115115
116-
cmake -S . -B build
116+
cmake -Bbuild
117117
118118
cmake --build build --config Release
119119
@@ -123,51 +123,66 @@ cmake --build build --config Release
123123

124124
## 快速开始
125125

126+
首先您需要导入 `node-nim` 模块:
127+
126128
```ts
127-
import * as node_nim from 'node-nim'
129+
// ES6 Module
130+
import * as NIM from 'node-nim'
131+
// CommonJS
132+
const NIM = require('node-nim')
128133
```
129134

130-
### 初始化 SDK
135+
导入模块后,您可以直接使用我们已经帮您实例化好的三类对象,如即时通讯、聊天室、圈组,示例代码如下:
131136

132-
```ts
133-
const result = node_nim.nim.client.init('appkey', '', '', {
134-
database_encrypt_key_: 'abcdefghijklmnopqrstuvwxyz012345'
135-
})
136-
if (result) {
137-
node_nim.nim.initEventHandlers() // init event handlers
138-
node_nim.nim.talk.on('receiveMsg', (result) => {
139-
console.log('receiveMsg', result)
140-
})
141-
node_nim.nim.talk.on('sendMsg', (message: node_nim.IMMessage) => {
142-
console.log('sendMsg: ', message)
143-
})
144-
// add more event handlers here
145-
// ...
146-
}
147-
return result
148-
```
137+
```javascript
138+
// IM 相关功能
139+
NIM.nim.client.init('', '', '', {})
140+
NIM.nim.client.cleanup('')
149141

150-
### 登陆
142+
// 聊天室相关功能
143+
NIM.chatroom.init('', '')
144+
NIM.chatroom.cleanup()
151145

152-
```ts
153-
let [loginResult] = await node_nim.nim.client.login('appkey', 'account', 'password', null, '')
154-
if (loginResult.res_code_ == node_nim.NIMResCode.kNIMResSuccess) {
155-
console.log('login succeeded')
156-
} else {
157-
console.log('login failed')
158-
}
146+
// 圈组相关功能
147+
NIM.qchat.instance.init({ appkey: 'your appkey', app_data_path: 'qchat' })
148+
NIM.qchat.instance.cleanup({})
159149
```
160150

161-
### 发送消息
151+
其中 `NIM.nim` 可直接访问的对象有:
152+
153+
| 对象名 | 说明 |
154+
|------------------|-----------------------|
155+
| client | 客户端模块 |
156+
| dataSync | 数据同步模块 |
157+
| friend | 好友模块 |
158+
| global | 全局模块 |
159+
| msglog | 消息记录模块 |
160+
| nos | NOS 模块 |
161+
| onlineSession | 在线会话模块 |
162+
| passThroughProxy | 透传代理模块 |
163+
| session | 会话模块 |
164+
| subscribeEvent | 事件订阅模块 |
165+
| superTeam | 超级群模块 |
166+
| sysMsg | 系统消息模块 |
167+
| talk | 会话模块 |
168+
| team | 群组模块 |
169+
| tool | 工具模块 |
170+
| user | 用户模块 |
171+
| plugin | 插件模块 |
172+
| talkEx | 消息扩展模块,PIN 消息、快捷评论、收藏 |
173+
174+
可通过 `NIM.chatroom` 直接访问的对象对应 `ChatRoomModule`,您可以直接访问该对象下的成员函数。
175+
176+
可通过 `NIM.qchat` 直接访问的对象有:
177+
178+
| 对象名 | 说明 |
179+
|--------------------|----------|
180+
| instance | 圈组实例模块 |
181+
| server | 圈组服务器模块 |
182+
| channel | 圈组频道模块 |
183+
| channelCategory | 圈组频道分类模块 |
184+
| message | 圈组消息模块 |
185+
| systemNotification | 圈组系统通知模块 |
186+
| attachment | 圈组附件模块 |
187+
| role | 圈组身份组模块 |
162188

163-
```ts
164-
node_nim.nim.talk.sendMsg(
165-
{
166-
session_type_: node_nim.NIMSessionType.kNIMSessionTypeP2P,
167-
receiver_accid_: 'receiver',
168-
type_: node_nim.NIMMessageType.kNIMMessageTypeText,
169-
content_: 'Send from NIM node quick start.'
170-
},
171-
''
172-
)
173-
```

node-nim-tester.js

100644100755
File mode changed.

package.json

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-nim",
3-
"version": "9.16.11",
3+
"version": "9.18.0",
44
"description": "NetEase IM nodejs wrapper based on NetEase IM C++ SDK",
55
"main": "dist/node-nim.js",
66
"bin": {
@@ -17,8 +17,9 @@
1717
"scripts": {
1818
"coverage": "nyc mocha test/test_all.js -slow 200 -timeout 10000",
1919
"build_ts": "rimraf ./dist && rimraf ./types && tsc",
20-
"build_wiki_doc": "typedoc --plugin typedoc-plugin-markdown --plugin typedoc-github-wiki-theme --theme github-wiki --out wiki_doc",
21-
"build_markdown_doc": "typedoc --plugin typedoc-plugin-markdown --theme markdown --out markdown_doc",
20+
"build_html_doc": "typedoc --plugin typedoc-github-theme",
21+
"build_wiki_doc": "typedoc --plugin typedoc-plugin-markdown --plugin typedoc-github-wiki-theme --out wiki_doc",
22+
"build_markdown_doc": "typedoc --plugin typedoc-plugin-markdown --out markdown_doc",
2223
"prepublishOnly": "npm run build_ts",
2324
"install": "npm run download_sdk",
2425
"download_sdk": "node -e \"require('./script/download-sdk.js').downloadSDK()\"",
@@ -54,9 +55,11 @@
5455
"mocha": "^9.2.2",
5556
"node-addon-api": "^4.3.0",
5657
"nyc": "^15.1.0",
57-
"typedoc": "^0.24.1",
58-
"typedoc-github-wiki-theme": "^1.1.0",
59-
"typedoc-plugin-markdown": "^3.15.1",
58+
"typedoc": "^0.26.6",
59+
"typedoc-github-theme": "^0.1.2",
60+
"typedoc-github-wiki-theme": "^2.0.0",
61+
"typedoc-material-theme": "^1.1.0",
62+
"typedoc-plugin-markdown": "^4.2.6",
6063
"typescript": "^4.9.5"
6164
},
6265
"keywords": [

src/reflection/qchat_role_reflection.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ ReflectionDefinition_O(QChatUpdateMemberRoleParam, cb, server_id, channel_id, ac
4343
ReflectionDefinition_O(QChatRemoveMemberRoleParam, cb, server_id, channel_id, accid);
4444
ReflectionDefinition_O(QChatGetMemberRolesParam, cb, server_id, channel_id, timestamp, limit);
4545
ReflectionDefinition_O(QChatGetRolesByAccidParam, cb, server_id, accid, timestamp, limit);
46-
ReflectionDefinition_O(QChatGetExistingServerRolesByAccidsParam, cb, server_id, accids);
46+
ReflectionDefinition_O(QChatGetExistingServerRolesByAccidsParam, cb, server_id, accids, sort_type, search_order);
4747
ReflectionDefinition_O(QChatGetExistingChannelRolesByServerRoleIdsParam, cb, server_id, channel_id, role_ids);
4848
ReflectionDefinition_O(QChatGetExistingAccidsOfMemberRolesParam, cb, server_id, channel_id, accids);
4949
ReflectionDefinition_O(QChatGetExistingAccidsInServerRoleParam, cb, server_id, role_id, accids);
@@ -58,4 +58,4 @@ ReflectionDefinition_O(QChatUpdateChannelCategoryMemberRoleParam, cb, server_id,
5858
ReflectionDefinition_O(QChatRemoveChannelCategoryMemberRoleParam, cb, server_id, category_id, accid);
5959
ReflectionDefinition_O(QChatGetChannelCategoryMemberRolesPageParam, cb, server_id, category_id, timestamp, limit);
6060

61-
#endif // __QCHAT_ROLE_HELPER_H__
61+
#endif // __QCHAT_ROLE_HELPER_H__

0 commit comments

Comments
 (0)