Socket
Socket
Sign inDemoInstall

@tencentcloud/call-uikit-wechat

Package Overview
Dependencies
Maintainers
0
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tencentcloud/call-uikit-wechat - npm Package Compare versions

Comparing version 3.3.5-beta.4 to 3.3.5

4

package.json
{
"name": "@tencentcloud/call-uikit-wechat",
"version": "3.3.5-beta.4",
"version": "3.3.5",
"main": "./tuicall-uikit-vue.umd.js",

@@ -18,3 +18,3 @@ "module": "./tuicall-uikit-vue.es.js",

"@tencentcloud/tui-core": "latest",
"tuicall-engine-wx": "2.2.7-beta.4"
"tuicall-engine-wx": "^2.2.4"
},

@@ -21,0 +21,0 @@ "bugs": {

@@ -17,3 +17,3 @@ import {

} from './TUICallService/index';
const Version = '3.3.5-beta.4'; // basic-demo 原来上报使用
const Version = '3.3.5'; // basic-demo 原来上报使用

@@ -20,0 +20,0 @@ // 输出产物

import { TUICore, TUILogin, TUIConstants, ExtensionInfo } from '@tencentcloud/tui-core';
import { CallMediaType, AudioCallIcon, VideoCallIcon, LOG_LEVEL, COMPONENT, StoreName, NAME, CallStatus, CallType } from '../const/index';
import { isUndefined, formatTime, JSONToObject } from '../utils/common-utils';
import { isUndefined } from '../utils/common-utils';
import { getRemoteUserProfile } from './utils';

@@ -9,12 +9,4 @@ import { ITUIStore } from '../interface/ITUIStore';

import TencentCloudChat from '@tencentcloud/chat';
import { t } from '../locales';
const TUIStore: ITUIStore = TuiStore.getInstance();
const cmd2messageCardContentMap = {
audioCall: () => t('Voice call'),
videoCall: () => t('Video call'),
switchToAudio: () => t('Switch audio call'),
switchToVideo: () => t('Switch video call'),
hangup: ({ callDuration }) => `${t('Call duration')}:${callDuration}`,
};
export default class ChatCombine {

@@ -193,59 +185,2 @@ static instance: ChatCombine;

}
isLineBusy(message) {
const callMessage: any = JSONToObject(message.payload.data);
const objectData = JSONToObject(callMessage?.data);
return objectData?.line_busy === 'line_busy' || objectData?.line_busy === '' || objectData?.data?.message === 'lineBusy';
}
async getCallKitMessage(message: any, tim: any) {
const callMessage: any = JSONToObject(message.payload.data);
if (callMessage?.businessID !== 1) {
return {};
}
let messageCardContent = '';
const objectData = JSONToObject(callMessage?.data);
const callMediaType = objectData.call_type;
const inviteeList = callMessage.inviteeList;
const inviter = objectData?.data?.inviter;
const localUserId = TUIStore.getData(StoreName.CALL, NAME.LOCAL_USER_INFO).userId;
const isInviter = inviter === localUserId;
const cmd = objectData?.data?.cmd;
switch (callMessage?.actionType) {
case 1: {
messageCardContent = cmd2messageCardContentMap[cmd]({ callDuration: formatTime(objectData?.call_end) });
break;
}
case 2:
messageCardContent = isInviter ? t('Call Cancel') : t('Other Side Cancel');
break;
case 3:
if (['switchToAudio', 'switchToVideo'].includes(cmd)) {
messageCardContent = cmd2messageCardContentMap?.[cmd]?.();
} else {
messageCardContent = t('Answered');
}
break;
case 4:
if (this.isLineBusy(message)) {
messageCardContent = isInviter ? t('Line Busy') : t('Other Side Line Busy');
} else {
messageCardContent = isInviter ? t('Other Side Decline') : t('Decline');
}
break;
case 5:
if (['switchToAudio', 'switchToVideo'].includes(cmd)) {
messageCardContent = cmd2messageCardContentMap?.[cmd]?.();
} else {
messageCardContent = isInviter ? t('Other Side No Answer') : t('No answer');
}
break;
}
return { messageCardContent, callMediaType, inviteeList };
}
// =========================【chat: event listening】=========================

@@ -252,0 +187,0 @@ private _addListenChatEvent() {

@@ -52,4 +52,2 @@ import { ITUIStore } from '../interface/ITUIStore';

// @ts-ignore
TUICallEvent.CALL_MESSAGE && callEngine.on(TUICallEvent.CALL_MESSAGE, this._handleCallMessage, this); // call message card display event
// @ts-ignore
TUICallEvent.ON_USER_NETWORK_QUALITY_CHANGED && callEngine.on(TUICallEvent.ON_USER_NETWORK_QUALITY_CHANGED, this._handleNetworkQuality, this); // 用户网络质量

@@ -285,6 +283,2 @@ callEngine.on(TUICallEvent.CALL_END, this._handleCallingEnd, this); // 主被叫在通话结束时, 收到的通话结束事件

}
private _handleCallMessage(event: any) {
const message = analyzeEventData(event);
this._callService._chatCombine.callTUIService({ message });
}
private _handleCallTypeChange(event: any): void {

@@ -291,0 +285,0 @@ const { newCallType, type } = analyzeEventData(event);

@@ -30,3 +30,3 @@ import {

uiDesign.setTUIStore(TUIStore);
const version = '3.3.5-beta.4';
const version = '3.3.5';
export { TUIGlobal, TUIStore, uiDesign };

@@ -749,5 +749,2 @@

}
public async getCallMessage(message) {
return await this._chatCombine.getCallKitMessage(message, this.getTim());
}
}

@@ -52,4 +52,4 @@ export const en = {

'microphone disabled': 'Muted',
'speaker phone': 'Speaker',
'ear piece': 'Earpiece',
'speaker enabled': 'Speaker On',
'speaker disabled': 'Speaker Off',
'open speaker': 'Turn on speaker',

@@ -70,18 +70,2 @@ 'close speaker': 'Turn off speaker',

"TUICallKit init is not complete": "TUICallKit init is not complete. You need to use this API after the init API is finished.",
// combine chat
"Video call": "Video call",
"Voice call": "Voice call",
"Call End": "Call End",
"Switch voice call": "Switch voice call",
"Switch video call": "Switch video call",
"Call duration": "Duration",
"Call Cancel": "Canceled",
"Other Side Cancel": "Call canceled by caller",
"Decline": "Declined",
"Other Side Decline": "Call declined by user",
"No answer": "Call not answered",
"Other Side No Answer": "Call wasn't answered",
"Answered": "Answered",
"Other Side Line Busy": "Line busy",
"Line Busy": "Line busy. Call not received.",
// 待废弃文案

@@ -88,0 +72,0 @@ 'Those involved': 'Those involved in the call are',

@@ -38,18 +38,2 @@ export const ja_JP = {

'exist group call': '現在のグループには既にグループ通話が存在しています',
// combine chat
"Video call": "ビデオ通話を開始",
"Voice call": "音声通話を開始",
"Call End": "通話終了",
"Switch audio call": "音声通話に切り替える",
"Switch video call": "ビデオ通話に切り替える",
"Call duration": "通話時間",
"Call Cancel": "通話をキャンセルする",
"Other Side Cancel": "相手がキャンセルしました",
"Decline": "通話を拒否する",
"Other Side Decline": "相手が拒否しました",
"No answer": "無応答",
"Other Side No Answer": "相手からの返答はありません",
"Answered": "応答しました",
"Other Side Line Busy": "相手は現在忙しくて対応できません",
"Line Busy": "忙しいので応答できません",
// UI3.0文案

@@ -64,3 +48,4 @@ 'open camera': 'オープンカメラ',

'microphone disabled': 'マイクオフ',
'speaker phone': 'スピーカーオン',
'speaker enabled': 'スピーカーオン',
'speaker disabled': 'スピーカーオフ',
'open speaker': 'スピーカーをオンにする',

@@ -67,0 +52,0 @@ 'close speaker': 'スピーカーの電源を切ります',

@@ -52,4 +52,4 @@ export const zh = {

'microphone disabled': '麦克风已关',
'speaker phone': '扬声器已开',
'ear piece': '扬声器已关',
'speaker enabled': '扬声器已开',
'speaker disabled': '扬声器已关',
'open speaker': '开启扬声器',

@@ -70,18 +70,2 @@ 'close speaker': '关闭扬声器',

"TUICallKit init is not complete": "TUICallKit 初始化登录未完成,需要在 init 完成后使用此 API",
// combine chat
"Video call": "发起视频通话",
"Voice call": "发起语音通话",
"Call End": "通话结束",
"Switch voice call": "切换语音通话",
"Switch video call": "切换视频通话",
"Call duration": "通话时长",
"Call Cancel": "已取消",
"Other Side Cancel": "对方已取消",
"Decline": "已拒绝",
"Other Side Decline": "对方已拒绝",
"No answer": "超时无应答",
"Other Side No Answer": "对方无应答",
"Answered": "已接听",
"Other Side Line Busy": "对方忙线中",
"Line Busy": "忙线无应答",
// 待废弃文案

@@ -88,0 +72,0 @@ 'timeout': '超时',

@@ -239,2 +239,2 @@ import { NAME } from '../const/index';

return newObj;
}
}

@@ -28,12 +28,2 @@ export default class ChatCombine {

getGroupAttributes(tim: any, groupId: string): Promise<any>;
isLineBusy(message: any): boolean;
getCallKitMessage(message: any, tim: any): Promise<{
messageCardContent?: undefined;
callMediaType?: undefined;
inviteeList?: undefined;
} | {
messageCardContent: string;
callMediaType: any;
inviteeList: any;
}>;
private _addListenChatEvent;

@@ -40,0 +30,0 @@ private _removeListenChatEvent;

@@ -23,3 +23,2 @@ export default class EngineEventHandler {

private _messageSentByMe;
private _handleCallMessage;
private _handleCallTypeChange;

@@ -26,0 +25,0 @@ private _handleNetworkQuality;

@@ -100,3 +100,2 @@ import { ITUICallService, ICallParams, IGroupCallParams, ICallbackParam, ISelfInfoParams, IInviteUserParams, IJoinInGroupCallParams, IInitParams } from '../interface/ICallService';

};
getCallMessage(message: any): Promise<any>;
}

@@ -47,4 +47,4 @@ export declare const en: {

'microphone disabled': string;
'speaker phone': string;
'ear piece': string;
'speaker enabled': string;
'speaker disabled': string;
'open speaker': string;

@@ -65,17 +65,2 @@ 'close speaker': string;

"TUICallKit init is not complete": string;
"Video call": string;
"Voice call": string;
"Call End": string;
"Switch voice call": string;
"Switch video call": string;
"Call duration": string;
"Call Cancel": string;
"Other Side Cancel": string;
Decline: string;
"Other Side Decline": string;
"No answer": string;
"Other Side No Answer": string;
Answered: string;
"Other Side Line Busy": string;
"Line Busy": string;
'Those involved': string;

@@ -82,0 +67,0 @@ call: string;

@@ -34,17 +34,2 @@ export declare const ja_JP: {

'exist group call': string;
"Video call": string;
"Voice call": string;
"Call End": string;
"Switch audio call": string;
"Switch video call": string;
"Call duration": string;
"Call Cancel": string;
"Other Side Cancel": string;
Decline: string;
"Other Side Decline": string;
"No answer": string;
"Other Side No Answer": string;
Answered: string;
"Other Side Line Busy": string;
"Line Busy": string;
'open camera': string;

@@ -58,3 +43,4 @@ 'close camera': string;

'microphone disabled': string;
'speaker phone': string;
'speaker enabled': string;
'speaker disabled': string;
'open speaker': string;

@@ -61,0 +47,0 @@ 'close speaker': string;

@@ -47,4 +47,4 @@ export declare const zh: {

'microphone disabled': string;
'speaker phone': string;
'ear piece': string;
'speaker enabled': string;
'speaker disabled': string;
'open speaker': string;

@@ -65,17 +65,2 @@ 'close speaker': string;

"TUICallKit init is not complete": string;
"Video call": string;
"Voice call": string;
"Call End": string;
"Switch voice call": string;
"Switch video call": string;
"Call duration": string;
"Call Cancel": string;
"Other Side Cancel": string;
Decline: string;
"Other Side Decline": string;
"No answer": string;
"Other Side No Answer": string;
Answered: string;
"Other Side Line Busy": string;
"Line Busy": string;
timeout: string;

@@ -82,0 +67,0 @@ 'kick out': string;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc