Skip to content

Commit d4f1049

Browse files
committed
chore: bump version 10.9.75
Signed-off-by: Dylan <2894220@gmail.com>
1 parent 290c791 commit d4f1049

8 files changed

Lines changed: 69 additions & 14 deletions

.cmake/PlatformSettings.cmake

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,12 @@ macro(ne_install_conan_packages)
121121
execute_process(COMMAND conan config set general.revisions_enabled=True)
122122
include(${CMAKE_SOURCE_DIR}/.cmake/conan.cmake)
123123
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
124-
set(CONAN_ENV_CFLAGS "CFLAGS=-fvisibility=hidden -fvisibility-inlines-hidden -Wno-error=deprecated-declarations -g3 -DUV_EXTERN=")
125-
set(CONAN_ENV_CXXFLAGS "CXXFLAGS=-fvisibility=hidden -fvisibility-inlines-hidden -Wno-error=deprecated-declarations -g3")
124+
set(CONAN_ENV_CFLAGS "CFLAGS=-fvisibility=hidden -fvisibility-inlines-hidden -Wno-deprecated-declarations -g3 -DUV_EXTERN=")
125+
set(CONAN_ENV_CXXFLAGS "CXXFLAGS=-fvisibility=hidden -fvisibility-inlines-hidden -Wno-deprecated-declarations -g3")
126126
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
127-
set(CONAN_ENV_CFLAGS "CFLAGS=-fvisibility=hidden -fvisibility-inlines-hidden -Wno-error=deprecated-declarations -g3 -DUV_EXTERN=")
128-
set(CONAN_ENV_CXXFLAGS "CXXFLAGS=-fvisibility=hidden -fvisibility-inlines-hidden -Wno-error=deprecated-declarations -g3")
129-
set(CONAN_ENV_OBJCFLAGS "OBJCFLAGS=-fvisibility=hidden -fvisibility-inlines-hidden -Wno-error=deprecated-declarations")
127+
set(CONAN_ENV_CFLAGS "CFLAGS=-fvisibility=hidden -fvisibility-inlines-hidden -Wno-deprecated-declarations -g3 -DUV_EXTERN=")
128+
set(CONAN_ENV_CXXFLAGS "CXXFLAGS=-fvisibility=hidden -fvisibility-inlines-hidden -Wno-deprecated-declarations -g3")
129+
set(CONAN_ENV_OBJCFLAGS "OBJCFLAGS=-fvisibility=hidden -fvisibility-inlines-hidden -Wno-deprecated-declarations")
130130
endif()
131131
if (CONAN_PROFILE_BUILD AND CONAN_PROFILE_HOST)
132132
conan_cmake_install(PATH_OR_REFERENCE .. BUILD missing

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-nim",
3-
"version": "10.9.72",
3+
"version": "10.9.75",
44
"description": "NetEase IM nodejs wrapper based on NetEase IM C++ SDK",
55
"main": "dist/node-nim.js",
66
"bin": {

script/download-sdk.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,12 @@ async function downloadSDK(customPackageUrl) {
196196
// Use custom URL if provided, otherwise fetch from official server
197197
let downloadUrl = customPackageUrl
198198
if (!downloadUrl) {
199+
let baseUrl = 'https://admin.netease.im/public-service/free/publish/list?application=message&page=1&pageSize=50'
200+
if (version && version !== '0.0.0') {
201+
baseUrl = `${baseUrl}&version=${version}`
202+
}
199203
// Fetch package list from official server
200-
const res = await axios.get('https://admin.netease.im/public-service/free/publish/list')
204+
const res = await axios.get(baseUrl)
201205
const publishData = res.data.data[channel]
202206
// Find package URL for specified version or latest
203207
downloadUrl = findPackageUrl(publishData, version, platform, arch, product)
@@ -457,7 +461,7 @@ async function findPackage(buildUrl, nodePlatform, nodeArch) {
457461
// Build package URL from branch name
458462
async function buildPackageUrlFromBranch(branch, nodePlatform, nodeArch) {
459463
// Base64 encoded internal server URL (decode when needed)
460-
const encodedBaseUrl = 'aHR0cDovLzEwLjIxOS4yNS4xMjc6ODgvSU0tTmF0aXZlL0Rlc2t0b3A='
464+
const encodedBaseUrl = 'aHR0cDovLzEwLjI0NC43Ni4wOjg4L0lNLU5hdGl2ZS9EZXNrdG9wLw=='
461465
const baseUrl = Buffer.from(encodedBaseUrl, 'base64').toString('utf-8')
462466
log(` 🌿 Resolving package URL for branch: ${branch}`)
463467

src/callback_specialization.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ using V2NIMCallbackSpecializationTempType4 = nstd::map<nstd::string, V2NIMTeamMe
229229
CallbackSpecialization(V2NIMSuccessCallback<const V2NIMCallbackSpecializationTempType4&>);
230230
CallbackSpecialization(V2NIMSuccessCallback<bool>);
231231
CallbackSpecialization(V2NIMSuccessCallback<const nstd::vector<V2NIMDatabaseInfo>&>);
232+
CallbackSpecialization(V2NIMSuccessCallback<const V2NIMTextTranslationResult&>);
232233

233234
namespace xpack {
234235
// std::function

src/v2/v2_node_nim_message_service.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ Napi::Object V2NodeNIMMessageService::Init(Napi::Env env, Napi::Object exports)
4343
RegApi("getTeamMessageReceipts", &V2NIMMessageService::getTeamMessageReceipts),
4444
RegApi("getTeamMessageReceiptDetail", &V2NIMMessageService::getTeamMessageReceiptDetail),
4545
RegApi("voiceToText", &V2NIMMessageService::voiceToText),
46+
RegApi("translateText", &V2NIMMessageService::translateText),
4647
RegApi("cancelMessageAttachmentUpload", &V2NIMMessageService::cancelMessageAttachmentUpload),
4748
RegApi("searchCloudMessages", &V2NIMMessageService::searchCloudMessages),
4849
RegApi("searchCloudMessagesEx", &V2NIMMessageService::searchCloudMessagesEx),

ts/v2/v2_nim_message_service.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ import {
2020
V2NIMTeamMessageReadReceipt,
2121
V2NIMTeamMessageReadReceiptDetail,
2222
V2NIMVoiceToTextParams,
23+
V2NIMTextTranslateParams,
24+
V2NIMTextTranslationResult,
2325
V2NIMMessageSearchParams,
2426
V2NIMClearHistoryNotification,
2527
V2NIMMessageDeletedNotification,
@@ -997,6 +999,33 @@ export class V2NIMMessageService extends EventEmitter<V2NIMMessageListener> {
997999
})
9981000
}
9991001

1002+
/**
1003+
* @brief 文本翻译
1004+
* @param params 文本翻译参数
1005+
* @returns V2NIMTextTranslationResult
1006+
* @since v10.9.75
1007+
* @example
1008+
* ```javascript
1009+
* const result = await v2.messageService.translateText({
1010+
* text: 'Hello',
1011+
* targetLanguage: 'zh'
1012+
* })
1013+
* ```
1014+
*/
1015+
translateText (params: V2NIMTextTranslateParams): Promise<V2NIMTextTranslationResult> {
1016+
return new Promise((resolve, reject) => {
1017+
this.instance.translateText(
1018+
params,
1019+
(result: V2NIMTextTranslationResult) => {
1020+
resolve(result)
1021+
},
1022+
(error: V2NIMError) => {
1023+
reject(error)
1024+
}
1025+
)
1026+
})
1027+
}
1028+
10001029
/**
10011030
* @brief 取消文件消息附件上传
10021031
* @param message 要取消上传的文件消息

ts/v2/v2_nim_team_service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ export declare interface V2NIMTeamListener {
3333
syncFailed: [V2NIMError]
3434
/** 群组创建 */
3535
teamCreated: [V2NIMTeam]
36-
/** 加入群组 */
36+
/** 群组解散 */
3737
teamDismissed: [V2NIMTeam]
38-
/** 群组创建 */
38+
/** 加入群组 */
3939
teamJoined: [V2NIMTeam]
4040
/** 离开群组 */
4141
teamLeft: [team: V2NIMTeam, isKicked: boolean]
@@ -53,7 +53,7 @@ export declare interface V2NIMTeamListener {
5353
receiveTeamJoinActionInfo: [V2NIMTeamJoinActionInfo]
5454
}
5555

56-
/** @brief 存储服务 */
56+
/** @brief 群组服务 */
5757
export class V2NIMTeamService extends EventEmitter<V2NIMTeamListener> {
5858
instance: any
5959

ts/v2_def/v2_nim_struct_def.ts

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export interface V2NIMSize {
8181
height: number
8282
}
8383

84-
/** @biref V2NIMTransportLayerSecurityOption TLS 配置 @since v10.9.0 */
84+
/** @brief V2NIMTransportLayerSecurityOption TLS 配置 @since v10.9.0 */
8585
export interface V2NIMTransportLayerSecurityOption {
8686
/** 是否启用 SSL/TLS 加密,默认启用,目前仅在使用 WebSocket 链接时使用 @since v10.9.0 */
8787
sslConnection?: boolean
@@ -292,9 +292,9 @@ export interface V2NIMMessageAudioAttachment extends V2NIMMessageFileAttachment
292292
export interface V2NIMMessageVideoAttachment extends V2NIMMessageFileAttachment {
293293
/** 视频文件播放时长 */
294294
duration?: number
295-
/** 图片宽度 */
295+
/** 视频宽度 */
296296
width?: number
297-
/** 图片高度 */
297+
/** 视频高度 */
298298
height?: number
299299
}
300300

@@ -1413,6 +1413,26 @@ export interface V2NIMVoiceToTextParams {
14131413
sceneName?: string
14141414
}
14151415

1416+
/** @brief 文本翻译参数 @since v10.9.75 */
1417+
export interface V2NIMTextTranslateParams {
1418+
/** 待翻译的文本内容,长度上限为 5000 字符 */
1419+
text: string
1420+
/** 源语言,可选,为空时由服务端自动检测 */
1421+
sourceLanguage?: string
1422+
/** 目标语言 */
1423+
targetLanguage: string
1424+
}
1425+
1426+
/** @brief 文本翻译结果 @since v10.9.75 */
1427+
export interface V2NIMTextTranslationResult {
1428+
/** 翻译后的文本 */
1429+
translatedText: string
1430+
/** 源语言 */
1431+
sourceLanguage: string
1432+
/** 目标语言 */
1433+
targetLanguage: string
1434+
}
1435+
14161436
/** @brief 群摘要 @since v10.9.50 */
14171437
export interface V2NIMTeamRefer {
14181438
/** 群组ID */

0 commit comments

Comments
 (0)