jiuyiUniapp/jiuyi/node_modules/@tencentcloud/tui-core/index.js

2 lines
11 KiB
JavaScript
Raw Normal View History

2024-12-18 15:46:27 +08:00
import e from"@tencentcloud/chat";import t from"tim-upload-plugin";import n from"tim-profanity-filter-plugin";class i{constructor(){this.serviceMap=new Map}registerService(e,t){this.serviceMap.has(e)||(console.log(`TUIServiceManager.registerService serviceName:${e}`),this.serviceMap.set(e,t))}unregisterService(e){this.serviceMap.has(e)&&(console.log(`TUIServiceManager.unregisterService serviceName:${e}`),this.serviceMap.delete(e))}getService(e){return this.serviceMap.get(e)}callService(e){const{serviceName:t,method:n,params:i,callback:s}=e,o=this.getService(t);if(console.log(`TUIServiceManager.callService serviceName:${t}, service:`,o),o)return o.onCall(n,i,s)}}class s{constructor(){this.extensionMap=new Map}registerExtension(e,t){if(console.log(`TUIExtensionManager.registerExtension extensionID:${e}`),!this.extensionMap.has(e)){const t=[];this.extensionMap.set(e,t)}const n=this.extensionMap.get(e);-1===n.indexOf(t)&&n.push(t)}unregisterExtension(e,t){if(console.log(`TUIExtensionManager.unregisterExtension extensionID:${e}`),this.extensionMap.has(e)){const n=this.extensionMap.get(e),i=n.indexOf(t);i>-1&&n.splice(i,1)}}getExtensionList(e,t){const n=t?`params:${JSON.stringify(t)}`:"";console.log(`TUIExtensionManager.getExtensionList extensionID:${e} ${n}`);let i=[],s=[];if(this.extensionMap.has(e)){i=this.extensionMap.get(e);for(let n=0;n<i.length;n++){const o=i[n].onGetExtension(e,t);s=s.concat(o)}}return s}}const o=["vue2","vue3"],E={TUILogin:{EVENT:{LOGIN_STATE_CHANGED:"loginStateChanged"},EVENT_SUB_KEY:{USER_LOGIN_SUCCESS:"userLoginSuccess",USER_LOGOUT_SUCCESS:"userLogoutSuccess",USER_KICKED_OFFLINE:"userKickedOffline",USER_SIG_EXPIRED:"userSigExpired"}},TUIConversation:{SERVICE:{NAME:"TUIConversationService",METHOD:{CREATE_CONVERSATION:"createConversation",HIDE_CONVERSATION_HEADER:"hideConversationHeader"}},EXTENSION:{CONV_POP_MENU:{EXT_ID:"conversationPopMenu"},CONV_GROUP:{EXT_ID:"conversationGroup"}}},TUIChat:{SERVICE:{NAME:"TUIChatService",METHOD:{UPDATE_MESSAGE_LIST:"updateMessageList",CLOSE_MESSAGE_POP_MENU:"closeMessagePopMenu",SEND_CUSTOM_MESSAGE:"sendCustomMessage",SEND_TEXT_MESSAGE:"sendTextMessage",SET_CHAT_TYPE:"setChatType",UPDATE_MESSAGE_INFO:"updateMessageInfo"}},EXTENSION:{INPUT_MORE:{EXT_ID:"inputToolBarMore"},MSG_POP_MENU:{EXT_ID:"messagePopMenu"},CHAT_HEADER:{EXT_ID:"chatHeader"}},TYPE:{C2C:"C2C",GROUP:"GROUP",CUSTOMER_SERVICE:"customerService",ROOM:"room"},EVENT:{CHAT_STATE_CHANGED:"chatStateChanged",CHAT_TYPE_CHANGED:"chatTypeChanged"},EVENT_SUB_KEY:{CHAT_OPENED:"chatOpened",CHANGE_SUCCESS:"changeSuccess"},FEATURE:{DownloadFile:"DownloadFile",CopyMessage:"CopyMessage",DeleteMessage:"DeleteMessage",RevokeMessage:"RevokeMessage",QuoteMessage:"QuoteMessage",ForwardMessage:"ForwardMessage",TranslateMessage:"TranslateMessage",VoiceToText:"VoiceToText",MultiSelection:"MultiSelection",EmojiReaction:"EmojiReaction",InputEmoji:"InputEmoji",InputStickers:"InputStickers",InputImage:"InputImage",InputVoice:"InputVoice",InputVideo:"InputVideo",InputFile:"InputFile",InputEvaluation:"InputEvaluation",InputQuickReplies:"InputQuickReplies",InputMention:"InputMention",MessageSearch:"MessageSearch",ReadStatus:"ReadStatus"}},TUIGroup:{SERVICE:{NAME:"TUIGroupService",METHOD:{CREATE_GROUP:"createGroup",OPEN_GROUP_MANAGEMENT:"openGroupManagement",SELECT_GROUP_MEMBER:"selectGroupMember"}}},TUIContact:{SERVICE:{NAME:"TUIContactService",METHOD:{SELECT_FRIEND:"selectFriend"}},EXTENSION:{CONTACT_LIST:{EXT_ID:"contactList"}}},TUISearch:{SERVICE:{NAME:"TUISearchService",METHOD:{SEARCH_GROUP:"searchGroup",SEARCH_USER:"searchUser",SEARCH_FRIEND:"searchFriend",SEARCH_GROUP_MEMBER:"searchGroupMember"}},EXTENSION:{SEARCH_MORE:{EXT_ID:"searchMore"}}},TUICalling:{SERVICE:{NAME:"TUICallingService",METHOD:{START_CALL:"startCall"}}},TUIRoom:{SERVICE:{NAME:"TUIRoomService"}},TUIEmojiPlugin:{SERVICE:{NAME:"TUIEmojiPluginService",METHOD:{CLOSE_EMOJI_DETAIL:"closeEmojiDetail"}}},TUITranslate:{EVENT:{LANGUAGE_CHANGED:"languageChanged"},EVENT_SUB_KEY:{CHANGE_SUCCESS:"changeSuccess"}},TUITranslatePlugin:{SERVICE:{NAME:"TUITranslatePluginServic