node-nim 10.5.2 → 10.6.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/dist/nim/msglog.js +8 -0
- package/dist/nim/msglog.js.map +1 -1
- package/dist/v2/v2_nim_ai_service.js.map +1 -1
- package/dist/v2/v2_nim_chatroom_client.js +153 -40
- package/dist/v2/v2_nim_chatroom_client.js.map +1 -1
- package/dist/v2/v2_nim_chatroom_queue_service.js +148 -0
- package/dist/v2/v2_nim_chatroom_queue_service.js.map +1 -0
- package/dist/v2/v2_nim_chatroom_service.js +201 -65
- package/dist/v2/v2_nim_chatroom_service.js.map +1 -1
- package/dist/v2/v2_nim_client.js +116 -25
- package/dist/v2/v2_nim_client.js.map +1 -1
- package/dist/v2/v2_nim_conversation_group_service.js +57 -9
- package/dist/v2/v2_nim_conversation_group_service.js.map +1 -1
- package/dist/v2/v2_nim_conversation_service.js +149 -27
- package/dist/v2/v2_nim_conversation_service.js.map +1 -1
- package/dist/v2/v2_nim_friend_service.js +152 -36
- package/dist/v2/v2_nim_friend_service.js.map +1 -1
- package/dist/v2/v2_nim_login_service.js +66 -14
- package/dist/v2/v2_nim_login_service.js.map +1 -1
- package/dist/v2/v2_nim_message_service.js +335 -93
- package/dist/v2/v2_nim_message_service.js.map +1 -1
- package/dist/v2/v2_nim_notification_service.js +11 -4
- package/dist/v2/v2_nim_notification_service.js.map +1 -1
- package/dist/v2/v2_nim_passthrough_service.js +39 -0
- package/dist/v2/v2_nim_passthrough_service.js.map +1 -0
- package/dist/v2/v2_nim_setting_service.js +81 -29
- package/dist/v2/v2_nim_setting_service.js.map +1 -1
- package/dist/v2/v2_nim_signalling_service.js +172 -44
- package/dist/v2/v2_nim_signalling_service.js.map +1 -1
- package/dist/v2/v2_nim_storage_service.js +116 -37
- package/dist/v2/v2_nim_storage_service.js.map +1 -1
- package/dist/v2/v2_nim_subscription_service.js +42 -12
- package/dist/v2/v2_nim_subscription_service.js.map +1 -1
- package/dist/v2/v2_nim_team_service.js +349 -140
- package/dist/v2/v2_nim_team_service.js.map +1 -1
- package/dist/v2/v2_nim_user_service.js +62 -19
- package/dist/v2/v2_nim_user_service.js.map +1 -1
- package/dist/v2/v2_nim_utilities.js +306 -129
- package/dist/v2/v2_nim_utilities.js.map +1 -1
- package/dist/v2_def/v2_nim_enum_def.js +14 -3
- package/dist/v2_def/v2_nim_enum_def.js.map +1 -1
- package/dist/v2_def/v2_nim_struct_def.js +0 -2
- package/dist/v2_def/v2_nim_struct_def.js.map +1 -1
- package/package.json +1 -1
- package/types/nim/msglog.d.ts +7 -1
- package/types/nim_def/msglog_def.d.ts +2 -0
- package/types/v2/v2_nim_ai_service.d.ts +3 -3
- package/types/v2/v2_nim_chatroom_client.d.ts +153 -42
- package/types/v2/v2_nim_chatroom_queue_service.d.ts +96 -0
- package/types/v2/v2_nim_chatroom_service.d.ts +203 -67
- package/types/v2/v2_nim_client.d.ts +117 -30
- package/types/v2/v2_nim_conversation_group_service.d.ts +59 -11
- package/types/v2/v2_nim_conversation_service.d.ts +151 -29
- package/types/v2/v2_nim_friend_service.d.ts +139 -39
- package/types/v2/v2_nim_login_service.d.ts +70 -15
- package/types/v2/v2_nim_message_service.d.ts +337 -95
- package/types/v2/v2_nim_notification_service.d.ts +13 -6
- package/types/v2/v2_nim_passthrough_service.d.ts +25 -0
- package/types/v2/v2_nim_setting_service.d.ts +83 -31
- package/types/v2/v2_nim_signalling_service.d.ts +174 -46
- package/types/v2/v2_nim_storage_service.d.ts +119 -40
- package/types/v2/v2_nim_subscription_service.d.ts +44 -14
- package/types/v2/v2_nim_team_service.d.ts +335 -142
- package/types/v2/v2_nim_user_service.d.ts +64 -21
- package/types/v2/v2_nim_utilities.d.ts +306 -129
- package/types/v2_def/v2_nim_enum_def.d.ts +10 -0
- package/types/v2_def/v2_nim_struct_def.d.ts +48 -8
|
@@ -3,74 +3,135 @@ import { EventEmitter } from 'eventemitter3';
|
|
|
3
3
|
import { V2NIMConversationType } from 'ts/v2_def/v2_nim_enum_def';
|
|
4
4
|
/** @brief 消息创建器 */
|
|
5
5
|
export declare class V2NIMMessageCreator {
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
/**
|
|
7
|
+
* @brief 创建文本消息
|
|
8
|
+
* @param text 文本内容
|
|
9
|
+
* @returns V2NIMMessage
|
|
10
|
+
* @example
|
|
11
|
+
* ```javascript
|
|
12
|
+
* const message = v2.messageCreator.createTextMessage('Hello, world!')
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
9
15
|
static createTextMessage(text: string): V2NIMMessage | null;
|
|
10
16
|
createTextMessage(text: string): V2NIMMessage | null;
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
|
+
* @brief 创建图片消息
|
|
19
|
+
* @param imagePath 图片路径
|
|
20
|
+
* @param name 文件显示名称, 为空则使用文件名
|
|
21
|
+
* @param sceneName 文件存储场景
|
|
22
|
+
* @param width 图片宽度
|
|
23
|
+
* @param height 图片高度
|
|
24
|
+
* @returns V2NIMMessage
|
|
25
|
+
* @example
|
|
26
|
+
* ```javascript
|
|
27
|
+
* const message = v2.messageCreator.createImageMessage(imagePath, name, sceneName, width, height)
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
18
30
|
static createImageMessage(imagePath: string, name: string, sceneName: string, width: number, height: number): V2NIMMessage | null;
|
|
19
31
|
createImageMessage(imagePath: string, name: string, sceneName: string, width: number, height: number): V2NIMMessage | null;
|
|
20
|
-
/**
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
32
|
+
/**
|
|
33
|
+
* @brief 创建音频消息
|
|
34
|
+
* @param audioPath 音频路径
|
|
35
|
+
* @param name 文件显示名称, 为空则使用文件名
|
|
36
|
+
* @param sceneName 文件存储场景
|
|
37
|
+
* @param duration 音频时长
|
|
38
|
+
* @returns V2NIMMessage
|
|
39
|
+
* @example
|
|
40
|
+
* ```javascript
|
|
41
|
+
* const message = v2.messageCreator.createAudioMessage(audioPath, name, sceneName, duration)
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
26
44
|
static createAudioMessage(audioPath: string, name: string, sceneName: string, duration: number): V2NIMMessage | null;
|
|
27
45
|
createAudioMessage(audioPath: string, name: string, sceneName: string, duration: number): V2NIMMessage | null;
|
|
28
|
-
/**
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
46
|
+
/**
|
|
47
|
+
* @brief 创建视频消息
|
|
48
|
+
* @param videoPath 视频路径
|
|
49
|
+
* @param name 文件显示名称, 为空则使用文件名
|
|
50
|
+
* @param sceneName 文件存储场景
|
|
51
|
+
* @param duration 视频时长
|
|
52
|
+
* @param width 视频宽度
|
|
53
|
+
* @param height 视频高度
|
|
54
|
+
* @returns V2NIMMessage
|
|
55
|
+
* @example
|
|
56
|
+
* ```javascript
|
|
57
|
+
* const message = v2.messageCreator.createVideoMessage(videoPath, name, sceneName, duration, width, height)
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
36
60
|
static createVideoMessage(videoPath: string, name: string, sceneName: string, duration: number, width: number, height: number): V2NIMMessage | null;
|
|
37
61
|
createVideoMessage(videoPath: string, name: string, sceneName: string, duration: number, width: number, height: number): V2NIMMessage | null;
|
|
38
|
-
/**
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
62
|
+
/**
|
|
63
|
+
* @brief 创建文件消息
|
|
64
|
+
* @param filePath 文件路径
|
|
65
|
+
* @param name 文件显示名称, 为空则使用文件名
|
|
66
|
+
* @param sceneName 文件存储场景
|
|
67
|
+
* @returns V2NIMMessage
|
|
68
|
+
* @example
|
|
69
|
+
* ```javascript
|
|
70
|
+
* const message = v2.messageCreator.createFileMessage(filePath, name, sceneName)
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
43
73
|
static createFileMessage(filePath: string, name: string, sceneName: string): V2NIMMessage | null;
|
|
44
74
|
createFileMessage(filePath: string, name: string, sceneName: string): V2NIMMessage | null;
|
|
45
|
-
/**
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
75
|
+
/**
|
|
76
|
+
* @brief 创建位置消息
|
|
77
|
+
* @param latitude 纬度
|
|
78
|
+
* @param longitude 经度
|
|
79
|
+
* @param address 详细位置信息
|
|
80
|
+
* @returns V2NIMMessage
|
|
81
|
+
* @example
|
|
82
|
+
* ```javascript
|
|
83
|
+
* const message = v2.messageCreator.createLocationMessage(latitude, longitude, address)
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
50
86
|
static createLocationMessage(latitude: number, longitude: number, address: string): V2NIMMessage | null;
|
|
51
87
|
createLocationMessage(latitude: number, longitude: number, address: string): V2NIMMessage | null;
|
|
52
|
-
/**
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
88
|
+
/**
|
|
89
|
+
* @brief 创建自定义消息
|
|
90
|
+
* @param text 文本内容
|
|
91
|
+
* @param rawAttachment 附件
|
|
92
|
+
* @returns V2NIMMessage
|
|
93
|
+
* @example
|
|
94
|
+
* ```javascript
|
|
95
|
+
* const message = v2.messageCreator.createCustomMessage(text, rawAttachment)
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
56
98
|
static createCustomMessage(text: string, rawAttachment: string): V2NIMMessage | null;
|
|
57
99
|
createCustomMessage(text: string, rawAttachment: string): V2NIMMessage | null;
|
|
58
|
-
/**
|
|
59
|
-
|
|
60
|
-
|
|
100
|
+
/**
|
|
101
|
+
* @brief 创建提示消息
|
|
102
|
+
* @param text 文本内容
|
|
103
|
+
* @returns V2NIMMessage
|
|
104
|
+
* @example
|
|
105
|
+
* ```javascript
|
|
106
|
+
* const message = v2.messageCreator.createTipsMessage(text)
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
61
109
|
static createTipsMessage(text: string): V2NIMMessage | null;
|
|
62
110
|
createTipsMessage(text: string): V2NIMMessage | null;
|
|
63
|
-
/**
|
|
64
|
-
|
|
65
|
-
|
|
111
|
+
/**
|
|
112
|
+
* @brief 创建转发消息
|
|
113
|
+
* @param message 原消息
|
|
114
|
+
* @returns V2NIMMessage
|
|
115
|
+
* @example
|
|
116
|
+
* ```javascript
|
|
117
|
+
* const message = v2.messageCreator.createForwardMessage(message)
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
66
120
|
static createForwardMessage(message: V2NIMMessage): V2NIMMessage | null;
|
|
67
121
|
createForwardMessage(message: V2NIMMessage): V2NIMMessage | null;
|
|
68
|
-
/**
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
122
|
+
/**
|
|
123
|
+
* @brief 创建话单类消息
|
|
124
|
+
* @param callType 话单类型,业务自定义,内容不校验
|
|
125
|
+
* @param channelId 话单频道 ID,内容不校验
|
|
126
|
+
* @param status 通话状态,业务自定义状态,内容不校验
|
|
127
|
+
* @param durations 通话成员时长列表,内容不校验
|
|
128
|
+
* @param text 话单描述
|
|
129
|
+
* @returns V2NIMMessage
|
|
130
|
+
* @example
|
|
131
|
+
* ```javascript
|
|
132
|
+
* const message = v2.messageCreator.createCallMessage(callType, channelId, status, durations, text)
|
|
133
|
+
* ```
|
|
134
|
+
*/
|
|
74
135
|
static createCallMessage(callType: number, channelId: string, status: number, durations: Array<V2NIMMessageCallDuration>, text: string): V2NIMMessage | null;
|
|
75
136
|
createCallMessage(callType: number, channelId: string, status: number, durations: Array<V2NIMMessageCallDuration>, text: string): V2NIMMessage;
|
|
76
137
|
}
|
|
@@ -79,136 +140,252 @@ export declare class V2NIMMessageConverter {
|
|
|
79
140
|
/**
|
|
80
141
|
* @brief 将消息序列化为 Json 字符串
|
|
81
142
|
* @param message V2NIMMessage 消息对象
|
|
82
|
-
* @
|
|
143
|
+
* @returns string
|
|
144
|
+
* @example
|
|
145
|
+
* ```javascript
|
|
146
|
+
* const jsonString = v2.messageConverter.messageSerialization(message)
|
|
147
|
+
* ```
|
|
83
148
|
*/
|
|
84
149
|
messageSerialization(message: V2NIMMessage): string | null;
|
|
85
150
|
/**
|
|
86
151
|
* @brief 将 Json 字符串反序列化为消息对象
|
|
87
152
|
* @param message Json 字符串
|
|
88
|
-
* @
|
|
153
|
+
* @returns V2NIMMessage
|
|
154
|
+
* @example
|
|
155
|
+
* ```javascript
|
|
156
|
+
* const message = v2.messageConverter.messageDeserialization(jsonString)
|
|
157
|
+
* ```
|
|
89
158
|
*/
|
|
90
159
|
messageDeserialization(message: string): V2NIMMessage | null;
|
|
91
160
|
}
|
|
92
161
|
/** @brief 会话ID工具 */
|
|
93
162
|
export declare class V2NIMConversationIdUtil {
|
|
94
|
-
/**
|
|
95
|
-
|
|
96
|
-
|
|
163
|
+
/**
|
|
164
|
+
* @brief 获取点对点会话ID
|
|
165
|
+
* @param accountId 账号ID
|
|
166
|
+
* @returns string
|
|
167
|
+
* @example
|
|
168
|
+
* ```javascript
|
|
169
|
+
* const conversationId = v2.conversationIdUtil.p2pConversationId(accountId)
|
|
170
|
+
* ```
|
|
171
|
+
*/
|
|
97
172
|
static p2pConversationId(accountId: string): string;
|
|
98
173
|
p2pConversationId(accountId: string): string;
|
|
99
|
-
/**
|
|
100
|
-
|
|
101
|
-
|
|
174
|
+
/**
|
|
175
|
+
* @brief 获取群组会话ID
|
|
176
|
+
* @param teamId 群组ID
|
|
177
|
+
* @returns string
|
|
178
|
+
* @example
|
|
179
|
+
* ```javascript
|
|
180
|
+
* const conversationId = v2.conversationIdUtil.teamConversationId(teamId)
|
|
181
|
+
* ```
|
|
182
|
+
*/
|
|
102
183
|
static teamConversationId(teamId: string): string;
|
|
103
184
|
teamConversationId(teamId: string): string;
|
|
104
|
-
/**
|
|
105
|
-
|
|
106
|
-
|
|
185
|
+
/**
|
|
186
|
+
* @brief 获取超级群会话ID
|
|
187
|
+
* @param superTeamId 超级群ID
|
|
188
|
+
* @returns string
|
|
189
|
+
* @example
|
|
190
|
+
* ```javascript
|
|
191
|
+
* const conversationId = v2.conversationIdUtil.superTeamConversationId(superTeamId)
|
|
192
|
+
* ```
|
|
193
|
+
*/
|
|
107
194
|
static superTeamConversationId(superTeamId: string): string;
|
|
108
195
|
superTeamConversationId(superTeamId: string): string;
|
|
109
|
-
/**
|
|
110
|
-
|
|
111
|
-
|
|
196
|
+
/**
|
|
197
|
+
* @brief 获取会话ID对应的会话类型
|
|
198
|
+
* @param conversationId 会话ID
|
|
199
|
+
* @returns V2NIMConversationType
|
|
200
|
+
* @example
|
|
201
|
+
* ```javascript
|
|
202
|
+
* const conversationType = v2.conversationIdUtil.parseConversationType(conversationId)
|
|
203
|
+
* ```
|
|
204
|
+
*/
|
|
112
205
|
static parseConversationType(conversationId: string): V2NIMConversationType;
|
|
113
206
|
parseConversationType(conversationId: string): V2NIMConversationType;
|
|
114
|
-
/**
|
|
115
|
-
|
|
116
|
-
|
|
207
|
+
/**
|
|
208
|
+
* @brief 获取会话ID对应的目标ID
|
|
209
|
+
* @param conversationId 会话ID
|
|
210
|
+
* @returns string
|
|
211
|
+
* @example
|
|
212
|
+
* ```javascript
|
|
213
|
+
* const targetId = v2.conversationIdUtil.parseConversationTargetId(conversationId)
|
|
214
|
+
* ```
|
|
215
|
+
*/
|
|
117
216
|
static parseConversationTargetId(conversationId: string): string;
|
|
118
217
|
parseConversationTargetId(conversationId: string): string;
|
|
119
218
|
}
|
|
120
219
|
/** @brief 本地反垃圾工具 */
|
|
121
220
|
export declare class V2NIMClientAntispamUtil {
|
|
122
|
-
/**
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
221
|
+
/**
|
|
222
|
+
* @brief 文本本地反垃圾
|
|
223
|
+
* @param text 需要本地反垃圾check的文本
|
|
224
|
+
* @param replace 敏感内容替换词
|
|
225
|
+
* @returns V2NIMClientAntispamResult
|
|
226
|
+
* @example
|
|
227
|
+
* ```javascript
|
|
228
|
+
* const result = v2.clientAntispamUtil.checkTextAntispam(text, replace)
|
|
229
|
+
* ```
|
|
230
|
+
*/
|
|
126
231
|
static checkTextAntispam(text: string, replace: string): V2NIMClientAntispamResult;
|
|
127
232
|
checkTextAntispam(text: string, replace: string): V2NIMClientAntispamResult;
|
|
128
233
|
}
|
|
129
234
|
/** @brief 聊天室消息创建器 */
|
|
130
235
|
export declare class V2NIMChatroomMessageCreator extends EventEmitter {
|
|
131
|
-
/**
|
|
132
|
-
|
|
133
|
-
|
|
236
|
+
/**
|
|
237
|
+
* @brief 创建文本消息
|
|
238
|
+
* @param text 文本内容
|
|
239
|
+
* @returns V2NIMChatroomMessage
|
|
240
|
+
* @example
|
|
241
|
+
* ```javascript
|
|
242
|
+
* const message = v2.chatroomMessageCreator.createTextMessage(text)
|
|
243
|
+
* ```
|
|
244
|
+
*/
|
|
134
245
|
static createTextMessage(text: string): V2NIMChatroomMessage | null;
|
|
135
246
|
createTextMessage(text: string): V2NIMChatroomMessage | null;
|
|
136
|
-
/**
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
247
|
+
/**
|
|
248
|
+
* @brief 创建图片消息
|
|
249
|
+
* @param imagePath 图片路径
|
|
250
|
+
* @param name 文件显示名称, 为空则使用文件名
|
|
251
|
+
* @param sceneName 文件存储场景
|
|
252
|
+
* @param width 图片宽度
|
|
253
|
+
* @param height 图片高度
|
|
254
|
+
* @returns V2NIMChatroomMessage
|
|
255
|
+
* @example
|
|
256
|
+
* ```javascript
|
|
257
|
+
* const message = v2.chatroomMessageCreator.createImageMessage(imagePath, name, sceneName, width, height)
|
|
258
|
+
* ```
|
|
259
|
+
*/
|
|
143
260
|
static createImageMessage(imagePath: string, name: string, sceneName: string, width: number, height: number): V2NIMChatroomMessage | null;
|
|
144
261
|
createImageMessage(imagePath: string, name: string, sceneName: string, width: number, height: number): V2NIMChatroomMessage | null;
|
|
145
|
-
/**
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
262
|
+
/**
|
|
263
|
+
* @brief 创建音频消息
|
|
264
|
+
* @param audioPath 音频路径
|
|
265
|
+
* @param name 文件显示名称, 为空则使用文件名
|
|
266
|
+
* @param sceneName 文件存储场景
|
|
267
|
+
* @param duration 音频时长
|
|
268
|
+
* @returns V2NIMChatroomMessage
|
|
269
|
+
* @example
|
|
270
|
+
* ```javascript
|
|
271
|
+
* const message = v2.chatroomMessageCreator.createAudioMessage(audioPath, name, sceneName, duration)
|
|
272
|
+
* ```
|
|
273
|
+
*/
|
|
151
274
|
static createAudioMessage(audioPath: string, name: string, sceneName: string, duration: number): V2NIMChatroomMessage | null;
|
|
152
275
|
createAudioMessage(audioPath: string, name: string, sceneName: string, duration: number): V2NIMChatroomMessage | null;
|
|
153
|
-
/**
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
276
|
+
/**
|
|
277
|
+
* @brief 创建视频消息
|
|
278
|
+
* @param videoPath 视频路径
|
|
279
|
+
* @param name 文件显示名称, 为空则使用文件名
|
|
280
|
+
* @param sceneName 文件存储场景
|
|
281
|
+
* @param duration 视频时长
|
|
282
|
+
* @param width 视频宽度
|
|
283
|
+
* @param height 视频高度
|
|
284
|
+
* @returns V2NIMChatroomMessage
|
|
285
|
+
* @example
|
|
286
|
+
* ```javascript
|
|
287
|
+
* const message = v2.chatroomMessageCreator.createVideoMessage(videoPath, name, sceneName, duration, width, height)
|
|
288
|
+
* ```
|
|
289
|
+
*/
|
|
161
290
|
static createVideoMessage(videoPath: string, name: string, sceneName: string, duration: number, width: number, height: number): V2NIMChatroomMessage | null;
|
|
162
291
|
createVideoMessage(videoPath: string, name: string, sceneName: string, duration: number, width: number, height: number): V2NIMChatroomMessage | null;
|
|
163
|
-
/**
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
292
|
+
/**
|
|
293
|
+
* @brief 创建文件消息
|
|
294
|
+
* @param filePath 文件路径
|
|
295
|
+
* @param name 文件显示名称, 为空则使用文件名
|
|
296
|
+
* @param sceneName 文件存储场景
|
|
297
|
+
* @returns V2NIMChatroomMessage
|
|
298
|
+
* @example
|
|
299
|
+
* ```javascript
|
|
300
|
+
* const message = v2.chatroomMessageCreator.createFileMessage(filePath, name, sceneName)
|
|
301
|
+
* ```
|
|
302
|
+
*/
|
|
168
303
|
static createFileMessage(filePath: string, name: string, sceneName: string): V2NIMChatroomMessage | null;
|
|
169
304
|
createFileMessage(filePath: string, name: string, sceneName: string): V2NIMChatroomMessage | null;
|
|
170
|
-
/**
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
305
|
+
/**
|
|
306
|
+
* @brief 创建位置消息
|
|
307
|
+
* @param latitude 纬度
|
|
308
|
+
* @param longitude 经度
|
|
309
|
+
* @param address 详细位置信息
|
|
310
|
+
* @returns V2NIMChatroomMessage
|
|
311
|
+
* @example
|
|
312
|
+
* ```javascript
|
|
313
|
+
* const message = v2.chatroomMessageCreator.createLocationMessage(latitude, longitude, address)
|
|
314
|
+
* ```
|
|
315
|
+
*/
|
|
175
316
|
static createLocationMessage(latitude: number, longitude: number, address: string): V2NIMChatroomMessage | null;
|
|
176
317
|
createLocationMessage(latitude: number, longitude: number, address: string): V2NIMChatroomMessage | null;
|
|
177
|
-
/**
|
|
178
|
-
|
|
179
|
-
|
|
318
|
+
/**
|
|
319
|
+
* @brief 创建自定义消息
|
|
320
|
+
* @param rawAttachment 自定义附件
|
|
321
|
+
* @returns V2NIMChatroomMessage
|
|
322
|
+
* @example
|
|
323
|
+
* ```javascript
|
|
324
|
+
* const message = v2.chatroomMessageCreator.createCustomMessage(rawAttachment)
|
|
325
|
+
* ```
|
|
326
|
+
*/
|
|
180
327
|
static createCustomMessage(rawAttachment: string): V2NIMChatroomMessage | null;
|
|
181
328
|
createCustomMessage(rawAttachment: string): V2NIMChatroomMessage | null;
|
|
182
|
-
/**
|
|
183
|
-
|
|
184
|
-
|
|
329
|
+
/**
|
|
330
|
+
* @brief 创建提示消息
|
|
331
|
+
* @param text 文本内容
|
|
332
|
+
* @returns V2NIMChatroomMessage
|
|
333
|
+
* @example
|
|
334
|
+
* ```javascript
|
|
335
|
+
* const message = v2.chatroomMessageCreator.createTipsMessage(text)
|
|
336
|
+
* ```
|
|
337
|
+
*/
|
|
185
338
|
static createTipsMessage(text: string): V2NIMChatroomMessage | null;
|
|
186
339
|
createTipsMessage(text: string): V2NIMChatroomMessage | null;
|
|
187
|
-
/**
|
|
188
|
-
|
|
189
|
-
|
|
340
|
+
/**
|
|
341
|
+
* @brief 创建转发消息
|
|
342
|
+
* @param message 原消息
|
|
343
|
+
* @returns V2NIMChatroomMessage
|
|
344
|
+
* @example
|
|
345
|
+
* ```javascript
|
|
346
|
+
* const message = v2.chatroomMessageCreator.createForwardMessage(message)
|
|
347
|
+
* ```
|
|
348
|
+
*/
|
|
190
349
|
static createForwardMessage(message: V2NIMChatroomMessage): V2NIMChatroomMessage | null;
|
|
191
350
|
createForwardMessage(message: V2NIMChatroomMessage): V2NIMChatroomMessage | null;
|
|
192
351
|
}
|
|
193
352
|
export declare class V2NIMStorageUtil {
|
|
194
|
-
/**
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
353
|
+
/**
|
|
354
|
+
* @brief 生成图片缩略图链接
|
|
355
|
+
* @param uri 图片原始链接
|
|
356
|
+
* @param thumbSize 缩放的尺寸,如指定为 150,则取 150*150
|
|
357
|
+
* @returns string 图片缩略图链接
|
|
358
|
+
* @example
|
|
359
|
+
* ```javascript
|
|
360
|
+
* const url = v2.storageUtil.imageThumbUrl(uri, thumbSize)
|
|
361
|
+
* ```
|
|
362
|
+
*/
|
|
198
363
|
imageThumbUrl(uri: string, thumbSize: Number): string;
|
|
199
|
-
/**
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
364
|
+
/**
|
|
365
|
+
* @brief 生成视频封面链接
|
|
366
|
+
* @param uri 视频原始链接
|
|
367
|
+
* @param offset 截图时间点,单位:秒
|
|
368
|
+
* @param thumbSize 缩放的尺寸,如指定为 150,则取 150*150
|
|
369
|
+
* @param type 截图类型,如:png、jpeg
|
|
370
|
+
* @returns string 视频封面链接
|
|
371
|
+
* @example
|
|
372
|
+
* ```javascript
|
|
373
|
+
* const url = v2.storageUtil.videoCoverUrl(uri, offset, thumbSize, type)
|
|
374
|
+
* ```
|
|
375
|
+
*/
|
|
205
376
|
videoCoverUrl(uri: string, offset: Number, thumbSize: Number, type: string): string;
|
|
206
377
|
}
|
|
207
378
|
export declare class V2NIMMessageAttachmentCreator {
|
|
208
|
-
/**
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
379
|
+
/**
|
|
380
|
+
* @brief 构造地理位置消息附件
|
|
381
|
+
* @param latitude 纬度
|
|
382
|
+
* @param longitude 经度
|
|
383
|
+
* @param address 详细位置信息
|
|
384
|
+
* @returns V2NIMMessageLocationAttachment
|
|
385
|
+
* @example
|
|
386
|
+
* ```javascript
|
|
387
|
+
* const attachment = v2.messageAttachmentCreator.createLocationMessageAttachment(latitude, longitude, address)
|
|
388
|
+
* ```
|
|
389
|
+
*/
|
|
213
390
|
createLocationMessageAttachment(latitude: number | null, longitude: number | null, address: string): V2NIMMessageLocationAttachment;
|
|
214
391
|
}
|
|
@@ -1128,3 +1128,13 @@ export declare enum V2NIMUserStatusType {
|
|
|
1128
1128
|
/** 断开连接 */
|
|
1129
1129
|
V2NIM_USER_STATUS_TYPE_DISCONNECT = 3
|
|
1130
1130
|
}
|
|
1131
|
+
export declare enum V2NIMProxyRequestMethod {
|
|
1132
|
+
/** GET 请求 */
|
|
1133
|
+
V2NIM_PROXY_REQUEST_METHOD_GET = 1,
|
|
1134
|
+
/** POST 请求 */
|
|
1135
|
+
V2NIM_PROXY_REQUEST_METHOD_POST = 2,
|
|
1136
|
+
/** PUT 请求 */
|
|
1137
|
+
V2NIM_PROXY_REQUEST_METHOD_PUT = 3,
|
|
1138
|
+
/** DELETE 请求 */
|
|
1139
|
+
V2NIM_PROXY_REQUEST_METHOD_DELETE = 4
|
|
1140
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { V2NIMAIModelType, V2NIMAsymmetricEncryptionAlgorithm, V2NIMChatroomKickedReason, V2NIMChatroomMemberRole, V2NIMChatroomMessageNotificationType, V2NIMChatroomQueueChangeType, V2NIMChatroomQueueLevelMode, V2NIMClientAntispamOperateType, V2NIMClientAntispamThesaurusMatchType, V2NIMConversationType,
|
|
1
|
+
import { V2NIMAIModelType, V2NIMAsymmetricEncryptionAlgorithm, V2NIMChatroomKickedReason, V2NIMChatroomMemberRole, V2NIMChatroomMessageNotificationType, V2NIMChatroomQueueChangeType, V2NIMChatroomQueueLevelMode, V2NIMClientAntispamOperateType, V2NIMClientAntispamThesaurusMatchType, V2NIMConversationType, V2NIMDataSyncType, V2NIMDownloadAttachmentType, V2NIMFCSAuthType, V2NIMFriendAddApplicationStatus, V2NIMFriendAddMode, V2NIMIPProtocolVersion, V2NIMLoginAuthType, V2NIMLoginClientType, V2NIMMessageAttachmentUploadState, V2NIMMessageClientAntispamOperatorType, V2NIMMessageNotificationType, V2NIMMessagePinState, V2NIMMessageRevokeType, V2NIMMessageSendingState, V2NIMMessageType, V2NIMProxyRequestMethod, V2NIMQueryDirection, V2NIMSDKLogLevel, V2NIMSignallingChannelType, V2NIMSignallingEventType, V2NIMSortOrder, V2NIMSQLCipherVersion, V2NIMSymmetricEncryptionAlgorithm, V2NIMTeamAgreeMode, V2NIMTeamChatBannedMode, V2NIMTeamInviteMode, V2NIMTeamJoinActionStatus, V2NIMTeamJoinActionType, V2NIMTeamJoinMode, V2NIMTeamMemberRole, V2NIMTeamMemberRoleQueryType, V2NIMTeamType, V2NIMTeamUpdateExtensionMode, V2NIMTeamUpdateInfoMode } from './v2_nim_enum_def';
|
|
2
2
|
export interface V2NIMError {
|
|
3
3
|
/** 错误码, 详见 V2NIMErrorCode */
|
|
4
4
|
code?: number;
|
|
@@ -760,7 +760,7 @@ export interface V2NIMMessageQuickComment {
|
|
|
760
760
|
}
|
|
761
761
|
export interface V2NIMMessageQuickCommentNotification {
|
|
762
762
|
/** 快捷评论操作类型 */
|
|
763
|
-
operationType?:
|
|
763
|
+
operationType?: V2NIMMessageQuickComment;
|
|
764
764
|
/** 快捷评论 */
|
|
765
765
|
quickComment?: V2NIMMessageQuickComment;
|
|
766
766
|
}
|
|
@@ -859,11 +859,11 @@ export interface V2NIMLoginOption {
|
|
|
859
859
|
/** 登陆扩展信息获取回调 */
|
|
860
860
|
loginExtensionProvider?: V2NIMLoginExtensionProvider;
|
|
861
861
|
/** 数据同步等级 */
|
|
862
|
-
syncLevel?:
|
|
862
|
+
syncLevel?: V2NIMDataSyncDetail;
|
|
863
863
|
}
|
|
864
864
|
export interface V2NIMLoginClient {
|
|
865
865
|
/** 客户端类型 */
|
|
866
|
-
type?:
|
|
866
|
+
type?: V2NIMLoginClient;
|
|
867
867
|
/** 操作系统 */
|
|
868
868
|
os?: string;
|
|
869
869
|
/** 登录时间 */
|
|
@@ -879,11 +879,11 @@ export interface V2NIMLoginClient {
|
|
|
879
879
|
}
|
|
880
880
|
export interface V2NIMKickedOfflineDetail {
|
|
881
881
|
/** 原因 */
|
|
882
|
-
reason?:
|
|
882
|
+
reason?: V2NIMKickedOfflineDetail;
|
|
883
883
|
/** 说明 */
|
|
884
884
|
reasonDesc?: string;
|
|
885
885
|
/** 客户端类型 */
|
|
886
|
-
clientType?:
|
|
886
|
+
clientType?: V2NIMLoginClient;
|
|
887
887
|
/** 自定义客户端类型 */
|
|
888
888
|
customClientType?: number;
|
|
889
889
|
}
|
|
@@ -891,11 +891,11 @@ export interface V2NIMDataSyncDetail {
|
|
|
891
891
|
/** 数据同步类型 */
|
|
892
892
|
type?: V2NIMDataSyncType;
|
|
893
893
|
/** 数据同步状态 */
|
|
894
|
-
state?:
|
|
894
|
+
state?: V2NIMDataSyncDetail;
|
|
895
895
|
}
|
|
896
896
|
export interface V2NIMLastMessage {
|
|
897
897
|
/** 最后一条消息状态 */
|
|
898
|
-
lastMessageState?:
|
|
898
|
+
lastMessageState?: V2NIMMessagePinState;
|
|
899
899
|
/** 最后一条消息引用 */
|
|
900
900
|
messageRefer?: V2NIMMessageRefer;
|
|
901
901
|
/** 最后一条消息类型 */
|
|
@@ -1735,6 +1735,18 @@ export interface V2NIMChatroomQueueOfferParams {
|
|
|
1735
1735
|
/** 元素属于的账号 */
|
|
1736
1736
|
elementOwnerAccountId?: string;
|
|
1737
1737
|
}
|
|
1738
|
+
export interface V2NIMChatroomQueueElement {
|
|
1739
|
+
/** 元素的唯一 key */
|
|
1740
|
+
key: string;
|
|
1741
|
+
/** 元素的值 */
|
|
1742
|
+
value: string;
|
|
1743
|
+
/** 该元素所属于的账号 */
|
|
1744
|
+
accountId?: string;
|
|
1745
|
+
/** 该元素所属于的账号的昵称 */
|
|
1746
|
+
nick?: string;
|
|
1747
|
+
/** 其他的扩展字段 JSON String */
|
|
1748
|
+
extension?: string;
|
|
1749
|
+
}
|
|
1738
1750
|
export interface V2NIMUploadFileParams {
|
|
1739
1751
|
/** 文件地址 */
|
|
1740
1752
|
filePath?: string;
|
|
@@ -2039,3 +2051,31 @@ export interface V2NIMUserStatus {
|
|
|
2039
2051
|
/** 获取预留状态中的配置信息,由服务端填入 JSON array 格式 */
|
|
2040
2052
|
serverExtension?: string;
|
|
2041
2053
|
}
|
|
2054
|
+
/** @brief HTTP 代理请求参数 */
|
|
2055
|
+
export interface V2NIMProxyRequest {
|
|
2056
|
+
/** 请求路径 */
|
|
2057
|
+
path: string;
|
|
2058
|
+
/** 请求方法 */
|
|
2059
|
+
method: V2NIMProxyRequestMethod;
|
|
2060
|
+
/** 映射一个请求地址,不传使用服务器默认的配置 */
|
|
2061
|
+
zone?: string;
|
|
2062
|
+
/** 请求头 */
|
|
2063
|
+
header?: string;
|
|
2064
|
+
/** 请求体 */
|
|
2065
|
+
body?: string;
|
|
2066
|
+
}
|
|
2067
|
+
/** @brief HTTP 代理响应 */
|
|
2068
|
+
export interface V2NIMProxyResponse {
|
|
2069
|
+
/** 响应头 */
|
|
2070
|
+
header: string;
|
|
2071
|
+
/** 响应体 */
|
|
2072
|
+
body: string;
|
|
2073
|
+
}
|
|
2074
|
+
export interface V2NIMProxyNotify {
|
|
2075
|
+
/** 发送方账号 */
|
|
2076
|
+
fromAccountId: string;
|
|
2077
|
+
/** 通知体 */
|
|
2078
|
+
body: string;
|
|
2079
|
+
/** 发送时间,毫秒 */
|
|
2080
|
+
time: number;
|
|
2081
|
+
}
|