k2-im 0.2.1 → 0.2.2
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/chat-kit-pinia.d.ts +41 -0
- package/dist/chat-kit.d.ts +41 -0
- package/dist/index.d.ts +42 -1
- package/dist/modules/im-core/src/connection/client-activity.js +1 -0
- package/dist/modules/im-core/src/connection/connection-manager.js +1 -1
- package/dist/modules/im-core/src/message-flow/receive/channel-receive-handlers.js +1 -1
- package/dist/modules/im-protocol/src/protobuf/gen/im.login_pb.js +1 -1
- package/dist/modules/im-protocol/src/protobuf/gen/im.pub_pb.js +1 -1
- package/dist/modules/im-protocol/src/protobuf/registry.js +1 -1
- package/dist/modules/im-sdk/src/create-im-client.js +1 -1
- package/dist/modules/im-sdk/src/runtime/session-runtime.js +1 -1
- package/dist/sdk.d.ts +42 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{create as _,fromBinary as E,toBinary as A}from"@bufbuild/protobuf";import{PullChnnMessageReqSchema as C,PullChnnMessageRspSchema as I,PullChnnMsgByIdReqSchema as S,PullChnnMsgByIdRspSchema as R,PullChnnSessionReqSchema as L,PullChnnSessionRspSchema as D,UpdateReadIndexReqSchema as O,UpdateReadIndexRspSchema as G}from"./gen/channel_pb.js";import{GroupReadAllMsgReqSchema as N,GroupReadAllMsgRespSchema as T,GetGroupMsgByIdReqSchema as P,GetGroupMsgByIdRespSchema as M,OfflineGroupSessionReqSchema as H,OfflineGroupSessionRespSchema as K,GetGroupHistoryMsgReqSchema as V,GetGroupHistoryMsgRespSchema as U,OfflineGroupMsgReqSchema as o,OfflineGroupMsgRespSchema as m}from"./gen/group_pb.js";import{BContentSchema as r,BMessageSchema as e}from"./gen/im.app.msg_pb.js";import{RadioChatAckSchema as Y,RadioChatSchema as n,RadioJoinSchema as F,RadioJoinAckSchema as p,RadioChatDeliveredAckSchema as t,RadioCancelChatSchema as i,MESRadioEditMsgC2CSchema as s,MESRadioSyncReadMsgC2CSchema as g}from"./gen/im.channel_pb.js";import{GroupChatAckSchema as c,MESGrpChatSchema as f,MESGroupSyncReadMsgC2CSchema as b,MESGrpNotifySchema as a,MESGrpNotifyDeliverAckSchema as u,MESJoinGrpSchema as j,MESJoinGrpDeliverAckSchema as B,MESExchangeKeyDeliverSchema as d,MESExchangeKeyDeliverAckSchema as l,MESExchangeKeyDeliverNotifyAckSchema as X,GroupChatCancelAckSchema as h,MESGrpChatDeliveredAckSchema as J,MesGrpMsgEditSchema as W,GroupChatCancelSchema as w}from"./gen/im.group_pb.js";import{CMPushTokenSyncSchema as x,CMLoginSchema as k,CMKickoutNotificationSchema as q,CCMPushTokenSyncAckSchema as v,CMLoginAckSchema as y}from"./gen/im.login_pb.js";import{MESSyncReadMsgC2CACKSchema as z,MESChatDeliveredAckSchema as Q,MESRobotDeleteNotifySchema as Z,MESUserFavoriteListChangedNotifySchema as $,MESFriendActionNotifySchema as __,MESFriendActionNotifyAckSchema as E_,MsgWalletNotifySchema as A_,TransferReturnNotifySchema as C_,MESChatCancelAckSchema as I_,MesMsgEditAckSchema as S_,MESChatSchema as R_,MESReactionContentSchema as L_,MsgWalletNotifyDeliverAckSchema as D_,MESChatReadSchema as O_,MESChatCancelSchema as G_,MESSyncReadMsgC2CSchema as N_,MesMsgEditSchema as T_,MESChatAckSchema as P_,MESChatReadAckSchema as M_,MESChatDeliveredNotificationAckSchema as H_,MESChatReadDelivereAckSchema as K_,MESAddFriendSchema as V_,MESAddFriendDeliverAckSchema as U_,MESAddFriendAnsSchema as o_,MESAddFriendAnsDeliverACKSchema as m_}from"./gen/im.msg_pb.js";import{RobotMsgAckSchema as r_,RobotReplyUserMsgSchema as e_,RobotMsgSchema as Y_}from"./gen/im.robot_pb.js";import{SIGSponsorCallSchema as n_,SIGSponsorCallAckSchema as F_,SIGSponsorCallAnsSchema as p_,SIGHangUpSchema as t_,SIGP2PCallStateNotifySchema as i_,SIGP2PCallExchangeNatInfoSchema as s_,SIGSPonsorGroupCallSchema as g_,SIGGroupCallAckSchema as c_,SIGGroupCallAnsSchema as f_,SIGGroupCallJoinSchema as b_,SIGGroupCallFinishSchema as a_,SIGGroupCallBusySchema as u_,SIGGroupCallDisconnectedSchema as j_,SIGGroupCallStatusSchema as B_,SIGSponsorCallDeliverAckSchema as d_,SIGSponsorCallAnsDeliverACKSchema as l_,SIGHangUpDeliverAckSchema as X_,SIGP2PCallStateNotifyDeliverAckSchema as h_,SIGP2PCallExchangeNatInfoDeliverAckSchema as J_,SIGGroupCallDeliverAckSchema as W_,SIGSponsorCallAnsAckSchema as w_,SIGHangUpAckSchema as x_,SIGP2PCallStateNotifyACKSchema as k_}from"./gen/im.sig_pb.js";import{GetChatMsgByIdReqSchema as q_,GetChatMsgByIdRespSchema as v_,OfflineChatMsgReqSchema as y_,OfflineChatMsgRespSchema as z_}from"./gen/msg_pb.js";import{CmdId as Q_}from"./gen/im.pub_pb.js";function Z_(C,I){return{command:C,schema:I,encode:_=>A(I,_),decode:_=>E(I,_),create:E=>_(I,E)}}function $_(C){return{schema:C,encode:_=>A(C,_),decode:_=>E(C,_),create:E=>_(C,E)}}function _E(_=[]){const E=/* @__PURE__ */new Map,A=_=>{E.set(_.command,_)};for(const E of _)A(E);return{register:A,get:_=>E.get(_),has:_=>E.has(_)}}const EE=Z_(Q_.CM_LOGIN,k),AE=Z_(Q_.CM_PUSHTOKENSYNC,x),CE=Z_(Q_.CM_PUSHTOKENSYNC_ACK,v),IE=Z_(Q_.CM_LOGIN_ACK,y),SE=Z_(Q_.CM_KICKOUT_NOTIFICATION,q),RE=Z_(Q_.MES_CHAT,R_),LE=Z_(Q_.MES_CHAT_ACK,P_),DE=Z_(Q_.MES_CHAT_DELIVER,R_),OE=Z_(Q_.MES_CHAT_DELIVER_ACK,Q),GE=Z_(Q_.MES_CHAT_MES_ROBOT,Y_),NE=Z_(Q_.MES_CHAT_MES_ROBOT_ACK,r_),TE=Z_(Q_.MES_CHAT_MES_ROBOT_REPLY,e_),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xA,kA,qA,vA,yA,zA,QA,ZA,$A,_C,EC,AC,CC,IC,SC,RC,LC,DC,OC,GC,NC,TC,PC,MC,HC,KC,VC,UC,oC,mC,rC,eC,YC,nC,FC,pC,tC,iC,sC,gC,cC,fC,bC]);export{uC as bContentCodec,aC as bMessageCodec,SE as cmKickoutNotificationCodec,IE as cmLoginAckCodec,EE as cmLoginCodec,CE as cmPushTokenSyncAckCodec,AE as cmPushTokenSyncCodec,tE as contactApplicationAnswerDeliverAckCodec,pE as contactApplicationAnswerDeliverCodec,FE as contactApplicationDeliverAckCodec,nE as contactApplicationDeliverCodec,_E as createImMessageRegistry,Z_ as defineMessageCodec,$_ as defineNestedCodec,oE as friendActionNotifyAckCodec,UE as friendActionNotifyCodec,lC as getChatMsgByIdReqCodec,XC as getChatMsgByIdRespCodec,xC as getGroupHistoryMsgReqCodec,kC as getGroupHistoryMsgRespCodec,qC as getGroupMsgByIdReqCodec,vC as getGroupMsgByIdRespCodec,vE as groupChatAckCodec,bE as groupChatCancelAckCodec,fE as groupChatCancelCodec,yC as groupReadAllMsgReqCodec,zC as groupReadAllMsgRespCodec,LE as mesChatAckCodec,sE as mesChatCancelAckCodec,iE as mesChatCancelCodec,cE as mesChatCancelDeliverAckCodec,gE as mesChatCancelDeliverCodec,RE as mesChatCodec,OE as mesChatDeliverAckCodec,DE as mesChatDeliverCodec,lE as mesChatDeliveredNotificationAckCodec,dE as mesChatDeliveredNotificationCodec,KE as mesChatReactionAckCodec,ME as mesChatReactionCodec,VE as mesChatReactionDeliverCodec,HE as mesChatReactionOppositeEndCodec,hE as mesChatReadAckCodec,XE as mesChatReadCodec,WE as mesChatReadDeliverAckCodec,JE as mesChatReadDeliverCodec,xE as mesChatSyncReadMsgC2cAckCodec,wE as mesChatSyncReadMsgC2cCodec,kE as mesChatSyncReadMsgDeliverC2cCodec,DA as mesExchangeKeyDeliverAckCodec,LA as mesExchangeKeyDeliverCodec,GA as mesExchangeKeyDeliverNotifyAckCodec,OA as mesExchangeKeyDeliverNotifyCodec,EA as mesGroupSyncReadMsgC2cAckCodec,_A as mesGroupSyncReadMsgC2cCodec,AA as mesGroupSyncReadMsgDeliverC2cCodec,qE as mesGrpChatCodec,zE as mesGrpChatDeliverAckCodec,yE as mesGrpChatDeliverCodec,ZE as mesGrpChatReactionAckCodec,QE as mesGrpChatReactionCodec,$E as mesGrpChatReactionDeliverCodec,BE as mesGrpMsgEditAckCodec,jE as mesGrpMsgEditCodec,IA as mesGrpNotifyDeliverAckCodec,CA as mesGrpNotifyDeliverCodec,RA as mesJoinGrpDeliverAckCodec,SA as mesJoinGrpDeliverCodec,uE as mesMsgEditAckCodec,aE as mesMsgEditCodec,BA as mesRadioEditMsgAckCodec,jA as mesRadioEditMsgCodec,aA as mesRadioSyncReadAckCodec,uA as mesRadioSyncReadDeliverCodec,bA as mesRadioSyncReadMsgCodec,jC as mesReactionContentCodec,PE as mesRobotDeleteNotifyCodec,BC as offlineChatMsgReqCodec,dC as offlineChatMsgRespCodec,WC as offlineGroupMsgReqCodec,wC as offlineGroupMsgRespCodec,hC as offlineGroupSessionReqCodec,JC as offlineGroupSessionRespCodec,CI as pullChannelMessagesByIdReqCodec,II as pullChannelMessagesByIdRespCodec,$C as pullChannelMessagesReqCodec,_I as pullChannelMessagesRespCodec,QC as pullChannelSessionsReqCodec,ZC as pullChannelSessionsRespCodec,mA as radioAdminCancelChatAckCodec,oA as radioAdminCancelChatCodec,rA as radioAdminCancelChatDeliverAckCodec,eA as radioAdminCancelChatDeliverCodec,tA as radioApplyDeliverAckCodec,iA as radioApplyDeliverCodec,nA as radioCancelChatAckCodec,YA as radioCancelChatCodec,FA as radioCancelChatDeliverAckCodec,pA as radioCancelChatDeliverCodec,TA as radioChatAckCodec,NA as radioChatCodec,PA as radioChatDeliverAckCodec,MA as radioChatDeliverCodec,VA as radioChatReactionAckCodec,KA as radioChatReactionCodec,UA as radioChatReactionDeliverCodec,sA as radioInviteDeliverAckCodec,gA as radioInviteDeliverCodec,cA as radioNotifyDeliverAckCodec,fA as radioNotifyDeliverCodec,HA as radioRedPacketGrabbedCodec,NE as robotMsgAckCodec,GE as robotMsgCodec,TE as robotReplyUserMsgCodec,LC as sigGroupCallAnsAckCodec,RC as sigGroupCallAnsCodec,DC as sigGroupCallAnsDeliverAckCodec,OC as sigGroupCallAnsDeliverCodec,cC as sigGroupCallBusyAckCodec,gC as sigGroupCallBusyCodec,fC as sigGroupCallBusyDeliverAckCodec,bC as sigGroupCallBusyDeliverCodec,tC as sigGroupCallDisconnectedAckCodec,pC as sigGroupCallDisconnectedCodec,iC as sigGroupCallDisconnectedDeliverAckCodec,sC as sigGroupCallDisconnectedDeliverCodec,oC as sigGroupCallFinishAckCodec,UC as sigGroupCallFinishCodec,mC as sigGroupCallFinishDeliverAckCodec,rC as sigGroupCallFinishDeliverCodec,HC as sigGroupCallHangupAckCodec,MC as sigGroupCallHangupCodec,KC as sigGroupCallHangupDeliverAckCodec,VC as sigGroupCallHangupDeliverCodec,NC as sigGroupCallJoinAckCodec,GC as sigGroupCallJoinCodec,TC as sigGroupCallJoinDeliverAckCodec,PC as sigGroupCallJoinDeliverCodec,YC as sigGroupCallStatusAckCodec,eC as sigGroupCallStatusCodec,nC as sigGroupCallStatusDeliverAckCodec,FC as sigGroupCallStatusDeliverCodec,yA as sigHangUpAckCodec,vA as sigHangUpCodec,zA as sigHangUpDeliverAckCodec,QA as sigHangUpDeliverCodec,kA as sigP2pCallExchangeNatInfoDeliverAckCodec,qA as sigP2pCallExchangeNatInfoDeliverCodec,$A as sigP2pCallStateNotifyAckCodec,ZA as sigP2pCallStateNotifyCodec,_C as sigP2pCallStateNotifyDeliverAckCodec,EC as sigP2pCallStateNotifyDeliverCodec,lA as sigSponsorCallAckCodec,WA as sigSponsorCallAnsAckCodec,JA as sigSponsorCallAnsCodec,wA as sigSponsorCallAnsDeliverAckCodec,xA as sigSponsorCallAnsDeliverCodec,dA as sigSponsorCallCodec,XA as sigSponsorCallDeliverAckCodec,hA as sigSponsorCallDeliverCodec,CC as sigSponsorGroupCallAckCodec,AC as sigSponsorGroupCallCodec,IC as sigSponsorGroupCallDeliverAckCodec,SC as sigSponsorGroupCallDeliverCodec,YE as transferReturnNotifyCodec,EI as updateChannelReadIndexReqCodec,AI as updateChannelReadIndexRespCodec,mE as userFavoriteListChangedNotifyCodec,eE as walletNotifyDeliverAckCodec,rE as walletNotifyDeliverCodec};
|
|
1
|
+
import{create as _,fromBinary as E,toBinary as A}from"@bufbuild/protobuf";import{PullChnnMessageReqSchema as C,PullChnnMessageRspSchema as I,PullChnnMsgByIdReqSchema as S,PullChnnMsgByIdRspSchema as R,PullChnnSessionReqSchema as L,PullChnnSessionRspSchema as D,UpdateReadIndexReqSchema as O,UpdateReadIndexRspSchema as G}from"./gen/channel_pb.js";import{GroupReadAllMsgReqSchema as N,GroupReadAllMsgRespSchema as T,GetGroupMsgByIdReqSchema as P,GetGroupMsgByIdRespSchema as M,OfflineGroupSessionReqSchema as H,OfflineGroupSessionRespSchema as K,GetGroupHistoryMsgReqSchema as V,GetGroupHistoryMsgRespSchema as U,OfflineGroupMsgReqSchema as o,OfflineGroupMsgRespSchema as m}from"./gen/group_pb.js";import{BContentSchema as r,BMessageSchema as e}from"./gen/im.app.msg_pb.js";import{RadioChatAckSchema as Y,RadioChatSchema as n,RadioJoinSchema as F,RadioJoinAckSchema as p,RadioChatDeliveredAckSchema as t,RadioCancelChatSchema as i,MESRadioEditMsgC2CSchema as s,MESRadioSyncReadMsgC2CSchema as g}from"./gen/im.channel_pb.js";import{GroupChatAckSchema as c,MESGrpChatSchema as f,MESGroupSyncReadMsgC2CSchema as b,MESGrpNotifySchema as a,MESGrpNotifyDeliverAckSchema as u,MESJoinGrpSchema as j,MESJoinGrpDeliverAckSchema as B,MESExchangeKeyDeliverSchema as d,MESExchangeKeyDeliverAckSchema as l,MESExchangeKeyDeliverNotifyAckSchema as X,GroupChatCancelAckSchema as h,MESGrpChatDeliveredAckSchema as J,MesGrpMsgEditSchema as W,GroupChatCancelSchema as w}from"./gen/im.group_pb.js";import{CMPushTokenSyncSchema as x,CMClientStateSchema as k,CMLoginSchema as q,CMKickoutNotificationSchema as v,CCMPushTokenSyncAckSchema as y,CMClientStateAckSchema as z,CMLoginAckSchema as Q}from"./gen/im.login_pb.js";import{MESSyncReadMsgC2CACKSchema as Z,MESChatDeliveredAckSchema as $,MESRobotDeleteNotifySchema as __,MESUserFavoriteListChangedNotifySchema as E_,MESFriendActionNotifySchema as A_,MESFriendActionNotifyAckSchema as C_,MsgWalletNotifySchema as I_,TransferReturnNotifySchema as S_,MESChatCancelAckSchema as R_,MesMsgEditAckSchema as L_,MESChatSchema as D_,MESReactionContentSchema as O_,MsgWalletNotifyDeliverAckSchema as G_,MESChatReadSchema as N_,MESChatCancelSchema as T_,MESSyncReadMsgC2CSchema as P_,MesMsgEditSchema as M_,MESChatAckSchema as H_,MESChatReadAckSchema as K_,MESChatDeliveredNotificationAckSchema as V_,MESChatReadDelivereAckSchema as U_,MESAddFriendSchema as o_,MESAddFriendDeliverAckSchema as m_,MESAddFriendAnsSchema as r_,MESAddFriendAnsDeliverACKSchema as e_}from"./gen/im.msg_pb.js";import{RobotMsgAckSchema as Y_,RobotReplyUserMsgSchema as n_,RobotMsgSchema as F_}from"./gen/im.robot_pb.js";import{SIGSponsorCallSchema as p_,SIGSponsorCallAckSchema as t_,SIGSponsorCallAnsSchema as i_,SIGHangUpSchema as s_,SIGP2PCallStateNotifySchema as g_,SIGP2PCallExchangeNatInfoSchema as c_,SIGSPonsorGroupCallSchema as f_,SIGGroupCallAckSchema as b_,SIGGroupCallAnsSchema as a_,SIGGroupCallJoinSchema as u_,SIGGroupCallFinishSchema as j_,SIGGroupCallBusySchema as B_,SIGGroupCallDisconnectedSchema as d_,SIGGroupCallStatusSchema as l_,SIGSponsorCallDeliverAckSchema as X_,SIGSponsorCallAnsDeliverACKSchema as h_,SIGHangUpDeliverAckSchema as J_,SIGP2PCallStateNotifyDeliverAckSchema as W_,SIGP2PCallExchangeNatInfoDeliverAckSchema as w_,SIGGroupCallDeliverAckSchema as x_,SIGSponsorCallAnsAckSchema as k_,SIGHangUpAckSchema as q_,SIGP2PCallStateNotifyACKSchema as v_}from"./gen/im.sig_pb.js";import{GetChatMsgByIdReqSchema as y_,GetChatMsgByIdRespSchema as z_,OfflineChatMsgReqSchema as Q_,OfflineChatMsgRespSchema as Z_}from"./gen/msg_pb.js";import{CmdId as $_}from"./gen/im.pub_pb.js";function _E(C,I){return{command:C,schema:I,encode:_=>A(I,_),decode:_=>E(I,_),create:E=>_(I,E)}}function EE(C){return{schema:C,encode:_=>A(C,_),decode:_=>E(C,_),create:E=>_(C,E)}}function AE(_=[]){const E=/* @__PURE__ */new Map,A=_=>{E.set(_.command,_)};for(const E of _)A(E);return{register:A,get:_=>E.get(_),has:_=>E.has(_)}}const CE=_E($_.CM_LOGIN,q),IE=_E($_.CM_PUSHTOKENSYNC,x),SE=_E($_.CM_PUSHTOKENSYNC_ACK,y),RE=_E($_.CM_CLIENT_STATE,k),LE=_E($_.CM_CLIENT_STATE_ACK,z),DE=_E($_.CM_LOGIN_ACK,Q),OE=_E($_.CM_KICKOUT_NOTIFICATION,v),GE=_E($_.MES_CHAT,D_),NE=_E($_.MES_CHAT_ACK,H_),TE=_E($_.MES_CHAT_DELIVER,D_),PE=_E($_.MES_CHAT_DELIVER_ACK,$),ME=_E($_.MES_CHAT_MES_ROBOT,F_),HE=_E($_.MES_CHAT_MES_ROBOT_ACK,Y_),KE=_E($_.MES_CHAT_MES_ROBOT_REPLY,n_),VE=_E($_.BOT_MSG_ROBOT_DELETE_SEND,__),UE=_E($_.MES_CHAT_REACTION_MSG_C2C,D_),oE=_E($_.MES_CHAT_REACTION_OPPOSITE_END,D_),mE=_E($_.MES_CHAT_REACTION_MSG_ACK,H_),rE=_E($_.MES_CHAT_REACTION_DELIVER,D_),eE=_E($_.MES_FRIEND_NOTIFY,A_),YE=_E($_.MES_FRIEND_NOTIFY_ACK,C_),nE=_E($_.MES_USER_FAVORITE_LIST_CHANGED_NOTIFY,E_),FE=_E($_.MS_WALLETNOTIFY_DELIVER,I_),pE=_E($_.MS_WALLETNOTIFY_DELIVER_ACK,G_),tE=EE(S_),iE=_E($_.MES_ADDFRIEND_DELIVER,o_),sE=_E($_.MES_ADDFRIEND_DELIVER_ACK,m_),gE=_E($_.MES_ADDFRIEND_ANS_DELIVER,r_),cE=_E($_.MES_ADDFRIEND_ANS_DELIVER_ACK,e_),fE=_E($_.MES_CHATCANCEL,T_),bE=_E($_.MES_CHATCANCEL_ACK,R_),aE=_E($_.MES_CHATCANCEL_DELIVER,T_),uE=_E($_.MES_CHATCANCEL_DELIVER_ACK,R_),jE=_E($_.GROUP_CHATCANCEL,w),BE=_E($_.GROUP_CHATCANCEL_ACK,h),dE=_E($_.MES_CHAT_EDIT_MSG_C2C,M_),lE=_E($_.MES_CHAT_MSG_EDIT_ACK,L_),XE=_E($_.MES_GRPCHAT_EDIT_MSG_C2C,W),hE=_E($_.MES_GRPCHAT_EDIT_MSG_C2C_ACK,c),JE=_E($_.MES_CHAT_DELIVERED_NOTIFICATION,$),WE=_E($_.MES_CHAT_DELIVERED_NOTIFICATION_ACK,V_),wE=_E($_.MES_CHAT_READ,N_),xE=_E($_.MES_CHAT_READ_ACK,K_),kE=_E($_.MES_CHAT_READ_DELIVER,N_),qE=_E($_.MES_CHAT_READ_DELIVER_ACK,U_),vE=_E($_.MES_CHAT_SYNC_READ_MSG_C2C,P_),yE=_E($_.MES_CHAT_SYNC_READ_MSG_C2C_ACK,Z),zE=_E($_.MES_CHAT_SYNC_READ_MSG_DELIVER_C2C,P_),QE=_E($_.GROUP_CHAT,f),ZE=_E($_.GROUP_CHAT_ACK,c),$E=_E($_.MES_GRPCHAT_DELIVER,f),_A=_E($_.MES_GRPCHAT_DELIVER_ACK,J),EA=_E($_.MES_GRPCHAT_REACTION_MSG_C2C,f),AA=_E($_.MES_GRPCHAT_REACTION_MSG_C2C_ACK,c),CA=_E($_.MES_GRPCHAT_REACTION_DELIVER,f),IA=_E($_.MES_GRPCHAT_SYNC_READ_MSG_C2C,b),SA=_E($_.MES_GRPCHAT_SYNC_READ_MSG_C2C_ACK,Z),RA=_E($_.MES_GRPCHAT_SYNC_READ_MSG_DELIVER_C2C,b),LA=_E($_.MES_GRPNOTIFY_DELIVER,a),DA=_E($_.MES_GRPNOTIFY_DELIVER_ACK,u),OA=_E($_.MES_JOINGRP_DELIVER,j),GA=_E($_.MES_JOINGRP_DELIVER_ACK,B),NA=_E($_.MES_EXCHANGE_KEY_DELIVER,d),TA=_E($_.MES_EXCHANGE_KEY_DELIVER_ACK,l),PA=_E($_.MES_EXCHANGE_KEY_DELIVERD_NOTIFY,l),MA=_E($_.MES_EXCHANGE_KEY_DELIVERD_NOTIFY_ACK,X),HA=_E($_.RADIO_CHAT,n),KA=_E($_.RADIO_CHAT_ACK,Y),VA=_E($_.RADIO_CHAT_DELIVER_ACK,t),UA=_E($_.RADIO_CHAT_DELIVER,n),oA=_E($_.MES_RADIO_RED_PACKET_GRABBED,n),mA=_E($_.MES_RADIO_REACTION_MSG_C2C,n),rA=_E($_.MES_RADIO_REACTION_MSG_C2C_ACK,Y),eA=_E($_.MES_RADIO_REACTION_DELIVER,n),YA=_E($_.RADIO_ADMIN_CANCEL_CHAT,i),nA=_E($_.RADIO_ADMIN_CANCEL_CHAT_ACK,Y),FA=_E($_.RADIO_ADMIN_CANCEL_CHAT_DELIVER_ACK,t),pA=_E($_.RADIO_ADMIN_CANCEL_CHAT_DELIVER,i),tA=_E($_.RADIO_CANCEL_CHAT,i),iA=_E($_.RADIO_CANCEL_CHAT_ACK,Y),sA=_E($_.RADIO_CANCEL_CHAT_DELIVER_ACK,t),gA=_E($_.RADIO_CANCEL_CHAT_DELIVER,i),cA=_E($_.RADIO_APPLY_DELIVER_ACK,p),fA=_E($_.RADIO_APPLY_DELIVER,F),bA=_E($_.RADIO_INVITE_DELIVER_ACK,p),aA=_E($_.RADIO_INVITE_DELIVER,F),uA=_E($_.RADIO_NOTIFY_DELIVER_ACK,t),jA=_E($_.RADIO_NOTIFY_DELIVER,n),BA=_E($_.MES_RADIO_SYNC_READ_MSG_C2C,g),dA=_E($_.MES_RADIO_SYNC_READ_MSG_C2C_ACK,Z),lA=_E($_.MES_RADIO_SYNC_READ_MSG_DELIVER_C2C,g),XA=_E($_.MES_RADIO_EDIT_MSG_C2C,s),hA=_E($_.MES_RADIO_EDIT_MSG_C2C_ACK,Y),JA=_E($_.SIG_SPONSORP2PCALL,p_),WA=_E($_.SIG_SPONSORP2PCALL_ACK,t_),wA=_E($_.SIG_SPONSORP2PCALL_DELIVER_ACK,X_),xA=_E($_.SIG_SPONSORP2PCALL_DELIVER,p_),kA=_E($_.SIG_SPONSORP2PCALL_ANS,i_),qA=_E($_.SIG_SPONSORP2PCALL_ANS_ACK,k_),vA=_E($_.SIG_SPONSORP2PCALL_ANS_DELIVER_ACK,h_),yA=_E($_.SIG_SPONSORP2PCALL_ANS_DELIVER,i_);_E($_.SIG_P2PCALL_EXCHANGE_NATINFO,c_);const zA=_E($_.SIG_P2PCALL_EXCHANGE_NATINFO_DELIVER_ACK,w_),QA=_E($_.SIG_P2PCALL_EXCHANGE_NATINFO_DELIVER,c_),ZA=_E($_.SIG_P2PCALLHANGUP,s_),$A=_E($_.SIG_P2PCALLHANGUP_ACK,q_),_C=_E($_.SIG_P2PCALLHANGUPDElIVER_ACK,J_),EC=_E($_.SIG_P2PCALLHANGUPDElIVER,s_),AC=_E($_.SIG_P2PCALLSTATENOTIFY,g_),CC=_E($_.SIG_P2PCALLSTATENOTIFY_ACK,v_),IC=_E($_.SIG_P2PCALLSTATENOTIFYDElIVER_ACK,W_),SC=_E($_.SIG_P2PCALLSTATENOTIFYDElIVER,g_),RC=_E($_.SIG_SPONSORGROUPCALL,f_),LC=_E($_.SIG_SPONSORGROUPCALL_ACK,b_),DC=_E($_.SIG_SPONSORGROUPCALL_DELIVER_ACK,x_),OC=_E($_.SIG_SPONSORGROUPCALL_DELIVER,f_),GC=_E($_.SIG_GROUPCALL_ANS,a_),NC=_E($_.SIG_GROUPCALL_ANS_ACK,b_),TC=_E($_.SIG_GROUPCALL_ANS_DELIVER_ACK,x_),PC=_E($_.SIG_GROUPCALL_ANS_DELIVER,a_),MC=_E($_.SIG_GROUPCALL_JOIN,u_),HC=_E($_.SIG_GROUPCALL_JOIN_ACK,b_),KC=_E($_.SIG_GROUPCALL_JOIN_DELIVER_ACK,x_),VC=_E($_.SIG_GROUPCALL_JOIN_DELIVER,u_),UC=_E($_.SIG_GROUPCALL_HANGUP,j_),oC=_E($_.SIG_GROUPCALL_HANGUP_ACK,b_),mC=_E($_.SIG_GROUPCALL_HANGUP_DELIVER_ACK,x_),rC=_E($_.SIG_GROUPCALL_HANGUP_DELIVER,j_),eC=_E($_.SIG_GROUPCALL_FINISH,j_),YC=_E($_.SIG_GROUPCALL_FINISH_ACK,b_),nC=_E($_.SIG_GROUPCALL_FINISH_DELIVER_ACK,x_),FC=_E($_.SIG_GROUPCALL_FINISH_DELIVER,j_),pC=_E($_.SIG_GROUPCALL_STATUS,l_),tC=_E($_.SIG_GROUPCALL_STATUS_ACK,b_),iC=_E($_.SIG_GROUPCALL_STATUS_DELIVER_ACK,x_),sC=_E($_.SIG_GROUPCALL_STATUS_DELIVER,l_),gC=_E($_.SIG_GROUPCALL_DISCONNECTED,d_),cC=_E($_.SIG_GROUPCALL_DISCONNECTED_ACK,b_),fC=_E($_.SIG_GROUPCALL_DISCONNECTED_DELIVER_ACK,x_),bC=_E($_.SIG_GROUPCALL_DISCONNECTED_DELIVER,d_),aC=_E($_.SIG_GROUPCALL_BUSY,B_),uC=_E($_.SIG_GROUPCALL_BUSY_ACK,b_),jC=_E($_.SIG_GROUPCALL_BUSY_DELIVER_ACK,x_),BC=_E($_.SIG_GROUPCALL_BUSY_DELIVER,B_),dC=EE(e),lC=EE(r),XC=EE(O_),hC=EE(Q_),JC=EE(Z_),WC=EE(y_),wC=EE(z_),xC=EE(H),kC=EE(K),qC=EE(o),vC=EE(m),yC=EE(V),zC=EE(U),QC=EE(P),ZC=EE(M),$C=EE(N),_I=EE(T),EI=EE(L),AI=EE(D),CI=EE(C),II=EE(I),SI=EE(O),RI=EE(G),LI=EE(S),DI=EE(R);AE([CE,RE,LE,IE,SE,DE,GE,NE,ME,HE,KE,VE,TE,PE,UE,oE,mE,rE,eE,YE,nE,FE,pE,iE,sE,gE,cE,fE,bE,aE,uE,lE,JE,WE,wE,xE,kE,qE,vE,yE,zE,QE,ZE,jE,BE,hE,$E,_A,EA,AA,CA,IA,SA,RA,LA,DA,OA,GA,NA,TA,PA,MA,HA,KA,VA,UA,oA,mA,rA,eA,YA,nA,FA,pA,tA,iA,sA,gA,cA,fA,bA,aA,uA,jA,BA,dA,lA,hA,JA,WA,wA,xA,kA,qA,vA,yA,zA,QA,ZA,$A,_C,EC,AC,CC,IC,SC,RC,LC,DC,OC,GC,NC,TC,PC,MC,HC,KC,VC,UC,oC,mC,rC,eC,YC,nC,FC,pC,tC,iC,sC,gC,cC,fC,bC,aC,uC,jC,BC]);export{lC as bContentCodec,dC as bMessageCodec,LE as cmClientStateAckCodec,RE as cmClientStateCodec,OE as cmKickoutNotificationCodec,DE as cmLoginAckCodec,CE as cmLoginCodec,SE as cmPushTokenSyncAckCodec,IE as cmPushTokenSyncCodec,cE as contactApplicationAnswerDeliverAckCodec,gE as contactApplicationAnswerDeliverCodec,sE as contactApplicationDeliverAckCodec,iE as contactApplicationDeliverCodec,AE as createImMessageRegistry,_E as defineMessageCodec,EE as defineNestedCodec,YE as friendActionNotifyAckCodec,eE as friendActionNotifyCodec,WC as getChatMsgByIdReqCodec,wC as getChatMsgByIdRespCodec,yC as getGroupHistoryMsgReqCodec,zC as getGroupHistoryMsgRespCodec,QC as getGroupMsgByIdReqCodec,ZC as getGroupMsgByIdRespCodec,ZE as groupChatAckCodec,BE as groupChatCancelAckCodec,jE as groupChatCancelCodec,$C as groupReadAllMsgReqCodec,_I as groupReadAllMsgRespCodec,NE as mesChatAckCodec,bE as mesChatCancelAckCodec,fE as mesChatCancelCodec,uE as mesChatCancelDeliverAckCodec,aE as mesChatCancelDeliverCodec,GE as mesChatCodec,PE as mesChatDeliverAckCodec,TE as mesChatDeliverCodec,WE as mesChatDeliveredNotificationAckCodec,JE as mesChatDeliveredNotificationCodec,mE as mesChatReactionAckCodec,UE as mesChatReactionCodec,rE as mesChatReactionDeliverCodec,oE as mesChatReactionOppositeEndCodec,xE as mesChatReadAckCodec,wE as mesChatReadCodec,qE as mesChatReadDeliverAckCodec,kE as mesChatReadDeliverCodec,yE as mesChatSyncReadMsgC2cAckCodec,vE as mesChatSyncReadMsgC2cCodec,zE as mesChatSyncReadMsgDeliverC2cCodec,TA as mesExchangeKeyDeliverAckCodec,NA as mesExchangeKeyDeliverCodec,MA as mesExchangeKeyDeliverNotifyAckCodec,PA as mesExchangeKeyDeliverNotifyCodec,SA as mesGroupSyncReadMsgC2cAckCodec,IA as mesGroupSyncReadMsgC2cCodec,RA as mesGroupSyncReadMsgDeliverC2cCodec,QE as mesGrpChatCodec,_A as mesGrpChatDeliverAckCodec,$E as mesGrpChatDeliverCodec,AA as mesGrpChatReactionAckCodec,EA as mesGrpChatReactionCodec,CA as mesGrpChatReactionDeliverCodec,hE as mesGrpMsgEditAckCodec,XE as mesGrpMsgEditCodec,DA as mesGrpNotifyDeliverAckCodec,LA as mesGrpNotifyDeliverCodec,GA as mesJoinGrpDeliverAckCodec,OA as mesJoinGrpDeliverCodec,lE as mesMsgEditAckCodec,dE as mesMsgEditCodec,hA as mesRadioEditMsgAckCodec,XA as mesRadioEditMsgCodec,dA as mesRadioSyncReadAckCodec,lA as mesRadioSyncReadDeliverCodec,BA as mesRadioSyncReadMsgCodec,XC as mesReactionContentCodec,VE as mesRobotDeleteNotifyCodec,hC as offlineChatMsgReqCodec,JC as offlineChatMsgRespCodec,qC as offlineGroupMsgReqCodec,vC as offlineGroupMsgRespCodec,xC as offlineGroupSessionReqCodec,kC as offlineGroupSessionRespCodec,LI as pullChannelMessagesByIdReqCodec,DI as pullChannelMessagesByIdRespCodec,CI as pullChannelMessagesReqCodec,II as pullChannelMessagesRespCodec,EI as pullChannelSessionsReqCodec,AI as pullChannelSessionsRespCodec,nA as radioAdminCancelChatAckCodec,YA as radioAdminCancelChatCodec,FA as radioAdminCancelChatDeliverAckCodec,pA as radioAdminCancelChatDeliverCodec,cA as radioApplyDeliverAckCodec,fA as radioApplyDeliverCodec,iA as radioCancelChatAckCodec,tA as radioCancelChatCodec,sA as radioCancelChatDeliverAckCodec,gA as radioCancelChatDeliverCodec,KA as radioChatAckCodec,HA as radioChatCodec,VA as radioChatDeliverAckCodec,UA as radioChatDeliverCodec,rA as radioChatReactionAckCodec,mA as radioChatReactionCodec,eA as radioChatReactionDeliverCodec,bA as radioInviteDeliverAckCodec,aA as radioInviteDeliverCodec,uA as radioNotifyDeliverAckCodec,jA as radioNotifyDeliverCodec,oA as radioRedPacketGrabbedCodec,HE as robotMsgAckCodec,ME as robotMsgCodec,KE as robotReplyUserMsgCodec,NC as sigGroupCallAnsAckCodec,GC as sigGroupCallAnsCodec,TC as sigGroupCallAnsDeliverAckCodec,PC as sigGroupCallAnsDeliverCodec,uC as sigGroupCallBusyAckCodec,aC as sigGroupCallBusyCodec,jC as sigGroupCallBusyDeliverAckCodec,BC as sigGroupCallBusyDeliverCodec,cC as sigGroupCallDisconnectedAckCodec,gC as sigGroupCallDisconnectedCodec,fC as sigGroupCallDisconnectedDeliverAckCodec,bC as sigGroupCallDisconnectedDeliverCodec,YC as sigGroupCallFinishAckCodec,eC as sigGroupCallFinishCodec,nC as sigGroupCallFinishDeliverAckCodec,FC as sigGroupCallFinishDeliverCodec,oC as sigGroupCallHangupAckCodec,UC as sigGroupCallHangupCodec,mC as sigGroupCallHangupDeliverAckCodec,rC as sigGroupCallHangupDeliverCodec,HC as sigGroupCallJoinAckCodec,MC as sigGroupCallJoinCodec,KC as sigGroupCallJoinDeliverAckCodec,VC as sigGroupCallJoinDeliverCodec,tC as sigGroupCallStatusAckCodec,pC as sigGroupCallStatusCodec,iC as sigGroupCallStatusDeliverAckCodec,sC as sigGroupCallStatusDeliverCodec,$A as sigHangUpAckCodec,ZA as sigHangUpCodec,_C as sigHangUpDeliverAckCodec,EC as sigHangUpDeliverCodec,zA as sigP2pCallExchangeNatInfoDeliverAckCodec,QA as sigP2pCallExchangeNatInfoDeliverCodec,CC as sigP2pCallStateNotifyAckCodec,AC as sigP2pCallStateNotifyCodec,IC as sigP2pCallStateNotifyDeliverAckCodec,SC as sigP2pCallStateNotifyDeliverCodec,WA as sigSponsorCallAckCodec,qA as sigSponsorCallAnsAckCodec,kA as sigSponsorCallAnsCodec,vA as sigSponsorCallAnsDeliverAckCodec,yA as sigSponsorCallAnsDeliverCodec,JA as sigSponsorCallCodec,wA as sigSponsorCallDeliverAckCodec,xA as sigSponsorCallDeliverCodec,LC as sigSponsorGroupCallAckCodec,RC as sigSponsorGroupCallCodec,DC as sigSponsorGroupCallDeliverAckCodec,OC as sigSponsorGroupCallDeliverCodec,tE as transferReturnNotifyCodec,SI as updateChannelReadIndexReqCodec,RI as updateChannelReadIndexRespCodec,nE as userFavoriteListChangedNotifyCodec,pE as walletNotifyDeliverAckCodec,FE as walletNotifyDeliverCodec};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createConversationCapabilitiesApi as e}from"./product/capabilities.js";import{toProductConversationListItem as n,createProductConversationsApi as t}from"./product/conversations.js";import{createProductEventsApi as r}from"./product/events.js";import{createLocalDataApi as o,createLocalDataError as a}from"./product/local-data.js";import{createImSdkError as s}from"./product/message.js";import{toProductProfileError as i,toProductGroupProfile as c,toProductChannelProfile as l,toProductContactProfile as p,toProductGroupPinnedMessage as u,toProductChannelPinnedMessage as d}from"./product/profiles.js";import{registerAdvancedMessageDiagnosticOperations as g,getAdvancedMessageDiagnosticOperations as v}from"./runtime/advanced-message-diagnostics.js";import{createSessionRuntime as h}from"./runtime/session-runtime.js";import{createImCacheNamespaceFactory as m}from"../../im-core/src/cache-namespace.js";import{createLazyBrowserApiProtocolClient as P}from"../../im-browser/src/http/lazy-api-protocol-client.js";import{createImEventEmitter as b}from"../../im-core/src/event-emitter.js";function y(e){const n=function(e){const n=f(e);return{...n,...void 0===e.coreApi?{}:{coreClient:A(e.authProvider,e.coreApi)}}}(e);return M(F(n),void 0!==e.coreApi)}function I(e){return F(function(e){const{adapters:n,channelJoinApplications:t,channelMembers:r,channelMentionMembers:o,channelProfile:a,contactApplications:s,coreApi:i,coreClient:c,directory:l,expressionProvider:p,sessionFavoriteProvider:u,http:d,network:g,profile:v,groupApplications:h,transport:m}=e,P=f(e);return{...P,adapters:n,channelJoinApplications:t,channelMembers:r,channelMentionMembers:o,channelProfile:a,contactApplications:s,directory:l,expressionProvider:p,sessionFavoriteProvider:u,...void 0!==c?{coreClient:c}:void 0===i?{}:{coreClient:A(e.authProvider,i)},http:d,network:g,profile:v,groupApplications:h,transport:m}}(e))}function f(e){const{authProvider:n,cache:t,clientType:r,connection:o,debug:a,endpointProvider:s,expressions:i,media:c,onRequestError:l,uploadRecovery:p}=e;return{authProvider:n,onRequestError:l,cache:t,clientType:r,connection:o,debug:a,endpointProvider:s,expressions:i,media:c,uploadRecovery:p}}function A(e,n){const t=n.baseUrl.trim();if(""===t)throw new Error("coreApi.baseUrl 不能为空");return P({config:{...void 0===n.appVersion?{}:{appVersion:n.appVersion},...void 0===n.envType?{}:{envType:n.envType},...void 0===n.brandId?{}:{brandId:n.brandId},...void 0===n.merchantId?{}:{merchantId:n.merchantId},...void 0===n.channelId?{}:{channelId:n.channelId},targets:{core:{baseUrl:t,prefix:n.prefix??"/api/h5"}}},getToken:async()=>(await e.getLoginContext())?.token,...void 0===n.getLocale?{}:{getLocale:n.getLocale}})}function M(r,o){const a=t({getCompatibilityApi:()=>r.conversations,subscribeEvents:e=>r.connection.subscribe(e),getSessionState:()=>r.session.getSnapshot().sessionState}),h={clearCache:()=>r.media.clearCache(),getSnapshot:()=>r.media.getSnapshot(),subscribe:e=>r.media.subscribe(e),cancel:(e,n)=>void 0===n?r.media.cancel(e):r.media.cancel(e,n),retry:(e,n)=>r.media.retry(e,n),pause:e=>r.media.pause(e),resume:e=>r.media.resume(e),getUploadRecovery:e=>r.media.getUploadRecovery(e),resumeUpload:(e,n)=>r.media.resumeUpload(e,n),download:e=>r.media.download(e),prioritizeDownload:e=>r.media.prioritizeDownload(e),probeCached:e=>r.media.probeCached(e),subscribeCacheChanges:e=>r.media.subscribeCacheChanges(e),getCached:e=>r.media.getCached(e),prepareLocalPreview:e=>r.media.prepareLocalPreview(e),prepareLocalVideoPoster:e=>r.media.prepareLocalVideoPoster(e),prepareLocalImageThumbnail:e=>r.media.prepareLocalImageThumbnail(e)},m=e=>Promise.reject(s({code:"IM_SDK_CORE_API_UNAVAILABLE",category:"contract",operation:e,retryable:!1}));async function P(e,n,t){if(!o)return m(e);try{return await n()}catch(n){throw i(n,e,t)}}function b(e,n,t){if(!o)throw s({code:"IM_SDK_CORE_API_UNAVAILABLE",category:"contract",operation:e,retryable:!1,conversation:t});try{return n()}catch(n){throw i(n,e,t)}}let y;const I=e=>P("contacts.getRelationship",()=>r.contacts.getRelationship(e)),f=(e,n)=>P("groups.getProfile",async()=>{const t=await r.groups.getProfile(e,n);return null===t?null:c(e,t)},e),A=(e,n)=>P("channels.getProfile",async()=>{const t=await r.channels.getProfile(e,n);return null===t?null:l(e,t)},e),M={listFirstPage:e=>P("contacts.listFirstPage",()=>r.contacts.listFirstPage(e)),listNextPage:e=>P("contacts.listNextPage",()=>r.contacts.listNextPage(e)),getProfile:(e,n)=>P("contacts.getProfile",async()=>{const t=await r.contacts.getProfile(e,n);return null===t?null:p(e,t)}),getRelationship:async e=>{const n=e.trim(),t={conversationType:"direct",conversationId:n},r=y?.beginProjectionUpdate(t),o=await I(e);return void 0!==r&&y?.updateRelationshipProjection(n,o,r),o},setRemark:(e,n)=>P("contacts.setRemark",()=>r.contacts.setRemark(e,{...void 0===n.name?{}:{name:n.name},...void 0===n.emails?{}:{email:[...n.emails]},...void 0===n.phones?{}:{phones:n.phones.map(e=>({countryCode:e.countryCode,mobile:e.mobile}))}})),searchUser:e=>P("contacts.searchUser",()=>r.contacts.searchUser(e)),requestFriendship:(e,n)=>P("contacts.requestFriendship",()=>r.contacts.requestFriendship(e,n)),blockUser:e=>P("contacts.blockUser",()=>r.contacts.blockUser(e),{conversationType:"direct",conversationId:e}),listBlocked:()=>P("contacts.listBlocked",()=>r.contacts.listBlocked()),unblockUser:e=>P("contacts.unblockUser",()=>r.contacts.unblockUser(e),{conversationType:"direct",conversationId:e}),reportUser:(e,n)=>P("contacts.reportUser",()=>r.contacts.reportUser(e,n),{conversationType:"direct",conversationId:e}),deleteFriendship:e=>P("contacts.deleteFriendship",()=>r.contacts.deleteFriendship(e),{conversationType:"direct",conversationId:e})},C={search:e=>P("directory.search",()=>r.directory.search(e))},F={listFirstPage:e=>P("groups.listFirstPage",()=>r.groups.listFirstPage(e)),listNextPage:e=>P("groups.listNextPage",()=>r.groups.listNextPage(e)),uploadAvatar:e=>P("groups.uploadAvatar",()=>r.groups.uploadAvatar(e)),create:e=>P("groups.create",()=>r.groups.create(e)),createFaceToFace:()=>P("groups.createFaceToFace",()=>r.groups.createFaceToFace()),mentions:o?r.groups.mentions:{listAll:()=>m("groups.mentions.listAll"),refreshAll:()=>m("groups.mentions.refreshAll")},getProfile:async(e,n)=>{const t=y?.beginProjectionUpdate(e),r=await f(e,n);return void 0!==t&&y?.updateGroupProfileProjection(e,r,t),r},updateName:(e,n)=>P("groups.updateName",()=>r.groups.updateName(e,n),e),updateAvatar:(e,n)=>P("groups.updateAvatar",()=>r.groups.updateAvatar(e,n),e),setMyNickname:(e,n)=>P("groups.setMyNickname",()=>r.groups.setMyNickname(e,n),e),updateVerification:(e,n,t)=>P("groups.updateVerification",()=>r.groups.updateVerification(e,n,t),e),requestJoin:(e,n)=>P("groups.requestJoin",()=>r.group.requestJoin(e.conversationId,n),e),joinByInviteCode:(e,n)=>P("groups.joinByInviteCode",()=>r.group.joinByInviteCode(e.conversationId,n),e),inviteMembers:(e,n)=>P("groups.inviteMembers",()=>r.group.inviteMembers(e.conversationId,n),e),removeMember:(e,n)=>P("groups.removeMember",()=>r.group.removeMember(e.conversationId,n),e),transferOwnership:(e,n)=>P("groups.transferOwnership",()=>r.group.transferOwnership(e.conversationId,n),e),leave:(e,n)=>P("groups.leave",()=>r.group.leave(e.conversationId,n),e),peekPinnedMessage:e=>b("groups.peekPinnedMessage",()=>{const n=r.group.peekPinnedMessage(e.conversationId);return null===n?null:u(e,n)},e),getPinnedMessage:e=>P("groups.getPinnedMessage",async()=>{const n=await r.groups.getPinnedMessage(e);return null===n?null:u(e,n)},e),pinMessage:(e,n)=>P("groups.pinMessage",async()=>{const t=await r.groups.pinMessage(e,n);return u(e,t)},e),unpinMessage:e=>P("groups.unpinMessage",()=>r.groups.unpinMessage(e),e)},w={listFirstPage:e=>P("channels.listFirstPage",()=>r.channels.listFirstPage(e)),listNextPage:e=>P("channels.listNextPage",()=>r.channels.listNextPage(e)),uploadAvatar:e=>P("channels.uploadAvatar",()=>r.channels.uploadAvatar(e)),create:e=>P("channels.create",()=>r.channels.create(e)),mentions:o?r.channels.mentions:{peekFirstPage:()=>null,peekSearchCandidates:()=>Object.freeze([]),getCachedPage:()=>m("channels.mentions.getCachedPage"),prefetchFirstPage:()=>m("channels.mentions.prefetchFirstPage"),refreshFirstPage:()=>m("channels.mentions.refreshFirstPage"),listFirstPage:()=>m("channels.mentions.listFirstPage"),listNextPage:()=>m("channels.mentions.listNextPage"),searchFirstPage:()=>m("channels.mentions.searchFirstPage"),refreshSearchFirstPage:()=>m("channels.mentions.refreshSearchFirstPage"),searchNextPage:()=>m("channels.mentions.searchNextPage")},getProfile:async(e,n)=>{const t=y?.beginProjectionUpdate(e),r=await A(e,n);return void 0!==t&&y?.updateChannelProfileProjection(e,r,t),r},updateName:(e,n)=>P("channels.updateName",()=>r.channel.updateName(e.conversationId,n),e),updateDescription:(e,n)=>P("channels.updateDescription",()=>r.channel.updateDescription(e.conversationId,n),e),updateAvatar:(e,n)=>P("channels.updateAvatar",()=>r.channel.updateAvatar(e.conversationId,n),e),updateVerification:(e,n,t)=>P("channels.updateVerification",()=>r.channels.updateVerification(e,n,t),e),requestJoin:(e,n)=>P("channels.requestJoin",()=>r.channel.requestJoin(e.conversationId,n),e),joinByInviteCode:(e,n)=>P("channels.joinByInviteCode",()=>r.channel.joinByInviteCode(e.conversationId,n),e),setAllMuted:(e,n)=>P("channels.setAllMuted",()=>r.channel.setAllMuted(e.conversationId,n),e),setMemberPrivateChatDisabled:(e,n)=>P("channels.setMemberPrivateChatDisabled",()=>r.channel.setMemberPrivateChatDisabled(e.conversationId,n),e),setMyNickname:(e,n)=>P("channels.setMyNickname",()=>r.channel.setMyNickname(e.conversationId,n),e),setMemberNickname:(e,n,t)=>P("channels.setMemberNickname",()=>r.channel.setMemberNickname(e.conversationId,n,t),e),inviteMembers:(e,n)=>P("channels.inviteMembers",()=>r.channel.inviteMembers(e.conversationId,n),e),removeMember:(e,n)=>P("channels.removeMember",()=>r.channel.removeMember(e.conversationId,n),e),addAdmin:(e,n)=>P("channels.addAdmin",()=>r.channel.addAdmin(e.conversationId,n),e),removeAdmin:(e,n)=>P("channels.removeAdmin",()=>r.channel.removeAdmin(e.conversationId,n),e),transferOwnership:(e,n)=>P("channels.transferOwnership",()=>r.channel.transferOwnership(e.conversationId,n),e),leave:(e,n)=>P("channels.leave",()=>r.channel.leave(e.conversationId,n),e),dismiss:e=>P("channels.dismiss",()=>r.channel.dismiss(e.conversationId),e),peekPinnedMessage:e=>b("channels.peekPinnedMessage",()=>{const n=r.channel.peekPinnedMessage(e.conversationId);return null===n?null:d(e,n)},e),getPinnedMessage:e=>P("channels.getPinnedMessage",async()=>{const n=await r.channels.getPinnedMessage(e);return null===n?null:d(e,n)},e),pinMessage:(e,n)=>P("channels.pinMessage",async()=>{const t=await r.channels.pinMessage(e,n);return d(e,t)},e),unpinMessage:e=>P("channels.unpinMessage",()=>r.channels.unpinMessage(e),e)},N=e({getSessionUserId:()=>r.session.getSnapshot().userId,getConversation:e=>{const t=r.conversations.getContext(e);return void 0===t?void 0:n({...t,draft:null})},subscribeConversations:e=>a.api.subscribe(n=>e(n.items)),subscribeContext:e=>r.connection.subscribe(n=>{"conversation-context:updated"===n.type&&"supergroup"!==n.conversation.conversationType&&e({conversationType:n.conversation.conversationType,conversationId:n.conversation.conversationId})}),getRelationship:I,getGroupProfile:f,getChannelProfile:A});y=N;const k=Object.freeze({start:e=>r.session.start(e),stop:e=>r.session.stop(e),logout:async e=>{N.reset();try{await r.session.logout(e)}finally{N.reset()}},getSnapshot:()=>r.session.getSnapshot(),subscribe:e=>r.session.subscribe(e)});const x={get session(){return k},get capabilities(){return N.api},get conversations(){return a.api},get directory(){return C},get customerService(){return r.customerService},get robots(){return r.robots},get contacts(){return M},get groups(){return F},get channels(){return w},get applications(){return r.applications},get expressions(){return r.expressions},get sessionFavorites(){return r.sessionFavorites},get outbox(){return r.outbox},get drafts(){return r.drafts},get search(){return r.search},get media(){return h},get settings(){return r.settings},get push(){return r.push},get localData(){return r.localData},get events(){return r.events},openConversation:async function(e,n={}){const t=r.conversations,o=r.openConversation,a=await t.ensureOpenableConversation(e);return"direct"===a.conversationType?o({conversationType:"direct",conversationId:a.conversationId},n):"group"===a.conversationType?o({conversationType:"group",conversationId:a.conversationId},n):"customerService"===a.conversationType?o({conversationType:"customerService",conversationId:a.conversationId},n):"robot"===a.conversationType?o({conversationType:"robot",conversationId:a.conversationId},n):o({conversationType:"channel",conversationId:a.conversationId},n)},dispose:async()=>{N.dispose(),a.dispose(),await r.dispose()}};return g(x,()=>v(r)),x}function C(e,n){return M(e,n.coreApiAvailable)}function F(e){const t=m(e.cache?.prefix),s=e.adapters?.namespaceFactory??t;if(s.hostPrefix!==t.hostPrefix)throw new Error("adapters.namespaceFactory.hostPrefix 必须与 cache.prefix 一致");const i=b();let c=0;const l=()=>h(e,i,s,c++);let p,u=l(),d=!1;async function v(e){if(d)throw new Error("IM SDK 已 dispose,不能 logout");const n=u;await n.teardown(e),d||u!==n||(u=l())}const P=o({getRuntime:()=>u.localData,purgeCurrentAccount:async function(){if(d)throw a({code:"IM_SDK_LOCAL_DATA_ACCOUNT_UNAVAILABLE",category:"state",operation:"localData.purgeCurrentAccount",retryable:!1});const e=u,n=await e.localData.getInfo();if(d||u!==e)throw a({code:"IM_SDK_LOCAL_DATA_ACCOUNT_UNAVAILABLE",category:"state",operation:"localData.purgeCurrentAccount",retryable:!1});let t;try{t=await e.teardown({localData:"purge"},{reportStorageErrors:!1})}catch(t){throw d||u!==e||(u=l()),a({code:"IM_SDK_LOCAL_DATA_PURGE_FAILED",category:"state",operation:"localData.purgeCurrentAccount",retryable:!0,accountScope:n.accountScope,cause:t})}if(d||u!==e||(u=l()),t.purgedAccountId!==n.accountScope)throw a({code:"IM_SDK_LOCAL_DATA_PURGE_FAILED",category:"state",operation:"localData.purgeCurrentAccount",retryable:!0,accountScope:n.accountScope,cause:t.purgeError??new Error("账号本地数据未完成删除")});i.emit({type:"local-data:cleared",accountScope:n.accountScope,category:"all"})}}),y={start:e=>u.connection.connect(e),stop:async e=>{u.connection.disconnect(e)},logout:v,getSnapshot:()=>u.connection.getLifecycle(),subscribe:e=>(e(u.connection.getLifecycle()),u.connection.subscribe(n=>{"connection:changed"!==n.type&&"receiving:changed"!==n.type&&"syncing:changed"!==n.type||e(u.connection.getLifecycle())}))},I=r({subscribeCore:e=>u.connection.subscribe(e),getLifecycleSnapshot:()=>u.connection.getLifecycle(),getConversation:e=>{const t=u.conversations.list().find(n=>n.type===e.conversationType&&n.id===e.conversationId);return void 0===t?void 0:n(t)},resolveContactApplicationAnswer:async e=>{const n=u,t=await n.contact.resolveApplicationAnswer(e.peerId,e.messageId);return u===n?t:null}}),f={listFirstPage:e=>u.contact.listFirstPage(e),listNextPage:e=>u.contact.listNextPage(e),getProfile:(e,n)=>u.contact.getProfile(e,n),getRelationship:e=>u.contact.getRelationship(e),setRemark:(e,n)=>u.contact.setRemark(e,n),searchUser:e=>u.contact.searchUser(e),requestFriendship:(e,n)=>u.contact.requestFriendship(e,n),blockUser:e=>u.contact.blockUser(e),listBlocked:()=>u.contact.listBlocked(),unblockUser:e=>u.contact.unblockUser(e),reportUser:(e,n)=>u.contact.reportUser(e,n),deleteFriendship:e=>u.contact.deleteFriendship(e)},A={listFirstPage:e=>u.group.listFirstPage(e),listNextPage:e=>u.group.listNextPage(e),uploadAvatar:e=>u.group.uploadAvatar(e),create:e=>u.group.create(e),createFaceToFace:()=>u.group.createFaceToFace(),get mentions(){return u.group.mentions},getProfile:(e,n)=>u.group.getProfile(e.conversationId,n),updateName:(e,n)=>u.group.updateName(e.conversationId,n),updateAvatar:async(e,n)=>{await u.group.updateAvatar(e.conversationId,n)},setMyNickname:(e,n)=>u.group.setMyNickname(e.conversationId,n),updateVerification:(e,n,t)=>u.group.updateVerification(e.conversationId,n,t),requestJoin:(e,n)=>u.group.requestJoin(e.conversationId,n),joinByInviteCode:(e,n)=>u.group.joinByInviteCode(e.conversationId,n),getPinnedMessage:e=>u.group.getPinnedMessage(e.conversationId),pinMessage:(e,n)=>u.group.pinMessage({groupId:e.conversationId,messageId:n}),unpinMessage:e=>u.group.unpinMessage(e.conversationId)},M={listFirstPage:e=>u.channel.listFirstPage(e),listNextPage:e=>u.channel.listNextPage(e),uploadAvatar:e=>u.channel.uploadAvatar(e),create:e=>u.channel.create(e),get mentions(){return u.channel.mentions},getProfile:(e,n)=>u.channel.getProfile(e.conversationId,n),updateVerification:(e,n,t)=>u.channel.updateVerification(e.conversationId,n,t),requestJoin:(e,n)=>u.channel.requestJoin(e.conversationId,n),joinByInviteCode:(e,n)=>u.channel.joinByInviteCode(e.conversationId,n),setAllMuted:(e,n)=>u.channel.setAllMuted(e.conversationId,n),setMemberPrivateChatDisabled:(e,n)=>u.channel.setMemberPrivateChatDisabled(e.conversationId,n),setMyNickname:(e,n)=>u.channel.setMyNickname(e.conversationId,n),setMemberNickname:(e,n,t)=>u.channel.setMemberNickname(e.conversationId,n,t),dismiss:e=>u.channel.dismiss(e.conversationId),getPinnedMessage:e=>u.channel.getPinnedMessage(e.conversationId),pinMessage:(e,n)=>u.channel.pinMessage({channelId:e.conversationId,messageId:n}),unpinMessage:e=>u.channel.unpinMessage(e.conversationId)};const C={get session(){return y},get connection(){return u.connection},get conversations(){return u.conversations},get directory(){return u.directory},get customerService(){return u.customerService},get robots(){return u.robots},get contacts(){return f},get groups(){return A},get channels(){return M},get events(){return I},get contact(){return u.contact},get group(){return u.group},get channel(){return u.channel},get media(){return u.media},get calls(){return u.calls},get groupCalls(){return u.groupCalls},get settings(){return u.settings},get push(){return u.push},get outbox(){return u.outbox},get localData(){return P},get search(){return u.search},get applications(){return u.applications},get expressions(){return u.expressions},get sessionFavorites(){return u.sessionFavorites},get drafts(){return u.drafts},get openConversation(){return u.openConversation},logout:v,dispose:function(){return void 0!==p||(d=!0,p=u.teardown({localData:"preserve"},{preserveUploadRecovery:!0}).then(()=>i.clear())),p}};return g(C,()=>u.advancedMessageDiagnostics),C}export{I as createAdvancedImClient,y as createImClient,C as createProductClientFacade};
|
|
1
|
+
import{createConversationCapabilitiesApi as e}from"./product/capabilities.js";import{toProductConversationListItem as n,createProductConversationsApi as t}from"./product/conversations.js";import{createProductEventsApi as r}from"./product/events.js";import{createLocalDataApi as o,createLocalDataError as a}from"./product/local-data.js";import{createImSdkError as s}from"./product/message.js";import{toProductProfileError as i,toProductGroupProfile as c,toProductChannelProfile as l,toProductContactProfile as p,toProductGroupPinnedMessage as u,toProductChannelPinnedMessage as d}from"./product/profiles.js";import{registerAdvancedMessageDiagnosticOperations as g,getAdvancedMessageDiagnosticOperations as v}from"./runtime/advanced-message-diagnostics.js";import{createSessionRuntime as h}from"./runtime/session-runtime.js";import{createImCacheNamespaceFactory as m}from"../../im-core/src/cache-namespace.js";import{createLazyBrowserApiProtocolClient as y}from"../../im-browser/src/http/lazy-api-protocol-client.js";import{createImEventEmitter as P}from"../../im-core/src/event-emitter.js";function b(e){const n=function(e){const n=f(e);return{...n,...void 0===e.coreApi?{}:{coreClient:A(e.authProvider,e.coreApi)}}}(e);return M(F(n),void 0!==e.coreApi)}function I(e){return F(function(e){const{adapters:n,channelJoinApplications:t,channelMembers:r,channelMentionMembers:o,channelProfile:a,contactApplications:s,coreApi:i,coreClient:c,directory:l,expressionProvider:p,sessionFavoriteProvider:u,http:d,network:g,profile:v,groupApplications:h,transport:m}=e,y=f(e);return{...y,adapters:n,channelJoinApplications:t,channelMembers:r,channelMentionMembers:o,channelProfile:a,contactApplications:s,directory:l,expressionProvider:p,sessionFavoriteProvider:u,...void 0!==c?{coreClient:c}:void 0===i?{}:{coreClient:A(e.authProvider,i)},http:d,network:g,profile:v,groupApplications:h,transport:m}}(e))}function f(e){const{authProvider:n,cache:t,clientType:r,connection:o,debug:a,endpointProvider:s,expressions:i,media:c,onRequestError:l,uploadRecovery:p}=e;return{authProvider:n,onRequestError:l,cache:t,clientType:r,connection:o,debug:a,endpointProvider:s,expressions:i,media:c,uploadRecovery:p}}function A(e,n){const t=n.baseUrl.trim();if(""===t)throw new Error("coreApi.baseUrl 不能为空");return y({config:{...void 0===n.appVersion?{}:{appVersion:n.appVersion},...void 0===n.envType?{}:{envType:n.envType},...void 0===n.brandId?{}:{brandId:n.brandId},...void 0===n.merchantId?{}:{merchantId:n.merchantId},...void 0===n.channelId?{}:{channelId:n.channelId},targets:{core:{baseUrl:t,prefix:n.prefix??"/api/h5"}}},getToken:async()=>(await e.getLoginContext())?.token,...void 0===n.getLocale?{}:{getLocale:n.getLocale}})}function M(r,o){const a=t({getCompatibilityApi:()=>r.conversations,subscribeEvents:e=>r.connection.subscribe(e),getSessionState:()=>r.session.getSnapshot().sessionState}),h={clearCache:()=>r.media.clearCache(),getSnapshot:()=>r.media.getSnapshot(),subscribe:e=>r.media.subscribe(e),cancel:(e,n)=>void 0===n?r.media.cancel(e):r.media.cancel(e,n),retry:(e,n)=>r.media.retry(e,n),pause:e=>r.media.pause(e),resume:e=>r.media.resume(e),getUploadRecovery:e=>r.media.getUploadRecovery(e),resumeUpload:(e,n)=>r.media.resumeUpload(e,n),download:e=>r.media.download(e),prioritizeDownload:e=>r.media.prioritizeDownload(e),probeCached:e=>r.media.probeCached(e),subscribeCacheChanges:e=>r.media.subscribeCacheChanges(e),getCached:e=>r.media.getCached(e),prepareLocalPreview:e=>r.media.prepareLocalPreview(e),prepareLocalVideoPoster:e=>r.media.prepareLocalVideoPoster(e),prepareLocalImageThumbnail:e=>r.media.prepareLocalImageThumbnail(e)},m=e=>Promise.reject(s({code:"IM_SDK_CORE_API_UNAVAILABLE",category:"contract",operation:e,retryable:!1}));async function y(e,n,t){if(!o)return m(e);try{return await n()}catch(n){throw i(n,e,t)}}function P(e,n,t){if(!o)throw s({code:"IM_SDK_CORE_API_UNAVAILABLE",category:"contract",operation:e,retryable:!1,conversation:t});try{return n()}catch(n){throw i(n,e,t)}}let b;const I=e=>y("contacts.getRelationship",()=>r.contacts.getRelationship(e)),f=(e,n)=>y("groups.getProfile",async()=>{const t=await r.groups.getProfile(e,n);return null===t?null:c(e,t)},e),A=(e,n)=>y("channels.getProfile",async()=>{const t=await r.channels.getProfile(e,n);return null===t?null:l(e,t)},e),M={listFirstPage:e=>y("contacts.listFirstPage",()=>r.contacts.listFirstPage(e)),listNextPage:e=>y("contacts.listNextPage",()=>r.contacts.listNextPage(e)),getProfile:(e,n)=>y("contacts.getProfile",async()=>{const t=await r.contacts.getProfile(e,n);return null===t?null:p(e,t)}),getRelationship:async e=>{const n=e.trim(),t={conversationType:"direct",conversationId:n},r=b?.beginProjectionUpdate(t),o=await I(e);return void 0!==r&&b?.updateRelationshipProjection(n,o,r),o},setRemark:(e,n)=>y("contacts.setRemark",()=>r.contacts.setRemark(e,{...void 0===n.name?{}:{name:n.name},...void 0===n.emails?{}:{email:[...n.emails]},...void 0===n.phones?{}:{phones:n.phones.map(e=>({countryCode:e.countryCode,mobile:e.mobile}))}})),searchUser:e=>y("contacts.searchUser",()=>r.contacts.searchUser(e)),requestFriendship:(e,n)=>y("contacts.requestFriendship",()=>r.contacts.requestFriendship(e,n)),blockUser:e=>y("contacts.blockUser",()=>r.contacts.blockUser(e),{conversationType:"direct",conversationId:e}),listBlocked:()=>y("contacts.listBlocked",()=>r.contacts.listBlocked()),unblockUser:e=>y("contacts.unblockUser",()=>r.contacts.unblockUser(e),{conversationType:"direct",conversationId:e}),reportUser:(e,n)=>y("contacts.reportUser",()=>r.contacts.reportUser(e,n),{conversationType:"direct",conversationId:e}),deleteFriendship:e=>y("contacts.deleteFriendship",()=>r.contacts.deleteFriendship(e),{conversationType:"direct",conversationId:e})},C={search:e=>y("directory.search",()=>r.directory.search(e))},F={listFirstPage:e=>y("groups.listFirstPage",()=>r.groups.listFirstPage(e)),listNextPage:e=>y("groups.listNextPage",()=>r.groups.listNextPage(e)),uploadAvatar:e=>y("groups.uploadAvatar",()=>r.groups.uploadAvatar(e)),create:e=>y("groups.create",()=>r.groups.create(e)),createFaceToFace:()=>y("groups.createFaceToFace",()=>r.groups.createFaceToFace()),mentions:o?r.groups.mentions:{listAll:()=>m("groups.mentions.listAll"),refreshAll:()=>m("groups.mentions.refreshAll")},getProfile:async(e,n)=>{const t=b?.beginProjectionUpdate(e),r=await f(e,n);return void 0!==t&&b?.updateGroupProfileProjection(e,r,t),r},updateName:(e,n)=>y("groups.updateName",()=>r.groups.updateName(e,n),e),updateAvatar:(e,n)=>y("groups.updateAvatar",()=>r.groups.updateAvatar(e,n),e),setMyNickname:(e,n)=>y("groups.setMyNickname",()=>r.groups.setMyNickname(e,n),e),updateVerification:(e,n,t)=>y("groups.updateVerification",()=>r.groups.updateVerification(e,n,t),e),requestJoin:(e,n)=>y("groups.requestJoin",()=>r.group.requestJoin(e.conversationId,n),e),joinByInviteCode:(e,n)=>y("groups.joinByInviteCode",()=>r.group.joinByInviteCode(e.conversationId,n),e),inviteMembers:(e,n)=>y("groups.inviteMembers",()=>r.group.inviteMembers(e.conversationId,n),e),removeMember:(e,n)=>y("groups.removeMember",()=>r.group.removeMember(e.conversationId,n),e),transferOwnership:(e,n)=>y("groups.transferOwnership",()=>r.group.transferOwnership(e.conversationId,n),e),leave:(e,n)=>y("groups.leave",()=>r.group.leave(e.conversationId,n),e),peekPinnedMessage:e=>P("groups.peekPinnedMessage",()=>{const n=r.group.peekPinnedMessage(e.conversationId);return null===n?null:u(e,n)},e),getPinnedMessage:e=>y("groups.getPinnedMessage",async()=>{const n=await r.groups.getPinnedMessage(e);return null===n?null:u(e,n)},e),pinMessage:(e,n)=>y("groups.pinMessage",async()=>{const t=await r.groups.pinMessage(e,n);return u(e,t)},e),unpinMessage:e=>y("groups.unpinMessage",()=>r.groups.unpinMessage(e),e)},w={listFirstPage:e=>y("channels.listFirstPage",()=>r.channels.listFirstPage(e)),listNextPage:e=>y("channels.listNextPage",()=>r.channels.listNextPage(e)),uploadAvatar:e=>y("channels.uploadAvatar",()=>r.channels.uploadAvatar(e)),create:e=>y("channels.create",()=>r.channels.create(e)),mentions:o?r.channels.mentions:{peekFirstPage:()=>null,peekSearchCandidates:()=>Object.freeze([]),getCachedPage:()=>m("channels.mentions.getCachedPage"),prefetchFirstPage:()=>m("channels.mentions.prefetchFirstPage"),refreshFirstPage:()=>m("channels.mentions.refreshFirstPage"),listFirstPage:()=>m("channels.mentions.listFirstPage"),listNextPage:()=>m("channels.mentions.listNextPage"),searchFirstPage:()=>m("channels.mentions.searchFirstPage"),refreshSearchFirstPage:()=>m("channels.mentions.refreshSearchFirstPage"),searchNextPage:()=>m("channels.mentions.searchNextPage")},getProfile:async(e,n)=>{const t=b?.beginProjectionUpdate(e),r=await A(e,n);return void 0!==t&&b?.updateChannelProfileProjection(e,r,t),r},updateName:(e,n)=>y("channels.updateName",()=>r.channel.updateName(e.conversationId,n),e),updateDescription:(e,n)=>y("channels.updateDescription",()=>r.channel.updateDescription(e.conversationId,n),e),updateAvatar:(e,n)=>y("channels.updateAvatar",()=>r.channel.updateAvatar(e.conversationId,n),e),updateVerification:(e,n,t)=>y("channels.updateVerification",()=>r.channels.updateVerification(e,n,t),e),requestJoin:(e,n)=>y("channels.requestJoin",()=>r.channel.requestJoin(e.conversationId,n),e),joinByInviteCode:(e,n)=>y("channels.joinByInviteCode",()=>r.channel.joinByInviteCode(e.conversationId,n),e),setAllMuted:(e,n)=>y("channels.setAllMuted",()=>r.channel.setAllMuted(e.conversationId,n),e),setMemberPrivateChatDisabled:(e,n)=>y("channels.setMemberPrivateChatDisabled",()=>r.channel.setMemberPrivateChatDisabled(e.conversationId,n),e),setMyNickname:(e,n)=>y("channels.setMyNickname",()=>r.channel.setMyNickname(e.conversationId,n),e),setMemberNickname:(e,n,t)=>y("channels.setMemberNickname",()=>r.channel.setMemberNickname(e.conversationId,n,t),e),inviteMembers:(e,n)=>y("channels.inviteMembers",()=>r.channel.inviteMembers(e.conversationId,n),e),removeMember:(e,n)=>y("channels.removeMember",()=>r.channel.removeMember(e.conversationId,n),e),addAdmin:(e,n)=>y("channels.addAdmin",()=>r.channel.addAdmin(e.conversationId,n),e),removeAdmin:(e,n)=>y("channels.removeAdmin",()=>r.channel.removeAdmin(e.conversationId,n),e),transferOwnership:(e,n)=>y("channels.transferOwnership",()=>r.channel.transferOwnership(e.conversationId,n),e),leave:(e,n)=>y("channels.leave",()=>r.channel.leave(e.conversationId,n),e),dismiss:e=>y("channels.dismiss",()=>r.channel.dismiss(e.conversationId),e),peekPinnedMessage:e=>P("channels.peekPinnedMessage",()=>{const n=r.channel.peekPinnedMessage(e.conversationId);return null===n?null:d(e,n)},e),getPinnedMessage:e=>y("channels.getPinnedMessage",async()=>{const n=await r.channels.getPinnedMessage(e);return null===n?null:d(e,n)},e),pinMessage:(e,n)=>y("channels.pinMessage",async()=>{const t=await r.channels.pinMessage(e,n);return d(e,t)},e),unpinMessage:e=>y("channels.unpinMessage",()=>r.channels.unpinMessage(e),e)},N=e({getSessionUserId:()=>r.session.getSnapshot().userId,getConversation:e=>{const t=r.conversations.getContext(e);return void 0===t?void 0:n({...t,draft:null})},subscribeConversations:e=>a.api.subscribe(n=>e(n.items)),subscribeContext:e=>r.connection.subscribe(n=>{"conversation-context:updated"===n.type&&"supergroup"!==n.conversation.conversationType&&e({conversationType:n.conversation.conversationType,conversationId:n.conversation.conversationId})}),getRelationship:I,getGroupProfile:f,getChannelProfile:A});b=N;const k=Object.freeze({start:e=>r.session.start(e),stop:e=>r.session.stop(e),logout:async e=>{N.reset();try{await r.session.logout(e)}finally{N.reset()}},getSnapshot:()=>r.session.getSnapshot(),subscribe:e=>r.session.subscribe(e)});const x={get session(){return k},get capabilities(){return N.api},get conversations(){return a.api},get directory(){return C},get customerService(){return r.customerService},get robots(){return r.robots},get contacts(){return M},get groups(){return F},get channels(){return w},get applications(){return r.applications},get expressions(){return r.expressions},get sessionFavorites(){return r.sessionFavorites},get outbox(){return r.outbox},get drafts(){return r.drafts},get search(){return r.search},get media(){return h},get settings(){return r.settings},get push(){return r.push},get activity(){return r.activity},get localData(){return r.localData},get events(){return r.events},openConversation:async function(e,n={}){const t=r.conversations,o=r.openConversation,a=await t.ensureOpenableConversation(e);return"direct"===a.conversationType?o({conversationType:"direct",conversationId:a.conversationId},n):"group"===a.conversationType?o({conversationType:"group",conversationId:a.conversationId},n):"customerService"===a.conversationType?o({conversationType:"customerService",conversationId:a.conversationId},n):"robot"===a.conversationType?o({conversationType:"robot",conversationId:a.conversationId},n):o({conversationType:"channel",conversationId:a.conversationId},n)},dispose:async()=>{N.dispose(),a.dispose(),await r.dispose()}};return g(x,()=>v(r)),x}function C(e,n){return M(e,n.coreApiAvailable)}function F(e){const t=m(e.cache?.prefix),s=e.adapters?.namespaceFactory??t;if(s.hostPrefix!==t.hostPrefix)throw new Error("adapters.namespaceFactory.hostPrefix 必须与 cache.prefix 一致");const i=P();let c=0;const l=()=>h(e,i,s,c++);let p,u=l(),d=!1;async function v(e){if(d)throw new Error("IM SDK 已 dispose,不能 logout");const n=u;await n.teardown(e),d||u!==n||(u=l())}const y=o({getRuntime:()=>u.localData,purgeCurrentAccount:async function(){if(d)throw a({code:"IM_SDK_LOCAL_DATA_ACCOUNT_UNAVAILABLE",category:"state",operation:"localData.purgeCurrentAccount",retryable:!1});const e=u,n=await e.localData.getInfo();if(d||u!==e)throw a({code:"IM_SDK_LOCAL_DATA_ACCOUNT_UNAVAILABLE",category:"state",operation:"localData.purgeCurrentAccount",retryable:!1});let t;try{t=await e.teardown({localData:"purge"},{reportStorageErrors:!1})}catch(t){throw d||u!==e||(u=l()),a({code:"IM_SDK_LOCAL_DATA_PURGE_FAILED",category:"state",operation:"localData.purgeCurrentAccount",retryable:!0,accountScope:n.accountScope,cause:t})}if(d||u!==e||(u=l()),t.purgedAccountId!==n.accountScope)throw a({code:"IM_SDK_LOCAL_DATA_PURGE_FAILED",category:"state",operation:"localData.purgeCurrentAccount",retryable:!0,accountScope:n.accountScope,cause:t.purgeError??new Error("账号本地数据未完成删除")});i.emit({type:"local-data:cleared",accountScope:n.accountScope,category:"all"})}}),b={start:e=>u.connection.connect(e),stop:async e=>{u.connection.disconnect(e)},logout:v,getSnapshot:()=>u.connection.getLifecycle(),subscribe:e=>(e(u.connection.getLifecycle()),u.connection.subscribe(n=>{"connection:changed"!==n.type&&"receiving:changed"!==n.type&&"syncing:changed"!==n.type||e(u.connection.getLifecycle())}))},I=r({subscribeCore:e=>u.connection.subscribe(e),getLifecycleSnapshot:()=>u.connection.getLifecycle(),getConversation:e=>{const t=u.conversations.list().find(n=>n.type===e.conversationType&&n.id===e.conversationId);return void 0===t?void 0:n(t)},resolveContactApplicationAnswer:async e=>{const n=u,t=await n.contact.resolveApplicationAnswer(e.peerId,e.messageId);return u===n?t:null}}),f={listFirstPage:e=>u.contact.listFirstPage(e),listNextPage:e=>u.contact.listNextPage(e),getProfile:(e,n)=>u.contact.getProfile(e,n),getRelationship:e=>u.contact.getRelationship(e),setRemark:(e,n)=>u.contact.setRemark(e,n),searchUser:e=>u.contact.searchUser(e),requestFriendship:(e,n)=>u.contact.requestFriendship(e,n),blockUser:e=>u.contact.blockUser(e),listBlocked:()=>u.contact.listBlocked(),unblockUser:e=>u.contact.unblockUser(e),reportUser:(e,n)=>u.contact.reportUser(e,n),deleteFriendship:e=>u.contact.deleteFriendship(e)},A={listFirstPage:e=>u.group.listFirstPage(e),listNextPage:e=>u.group.listNextPage(e),uploadAvatar:e=>u.group.uploadAvatar(e),create:e=>u.group.create(e),createFaceToFace:()=>u.group.createFaceToFace(),get mentions(){return u.group.mentions},getProfile:(e,n)=>u.group.getProfile(e.conversationId,n),updateName:(e,n)=>u.group.updateName(e.conversationId,n),updateAvatar:async(e,n)=>{await u.group.updateAvatar(e.conversationId,n)},setMyNickname:(e,n)=>u.group.setMyNickname(e.conversationId,n),updateVerification:(e,n,t)=>u.group.updateVerification(e.conversationId,n,t),requestJoin:(e,n)=>u.group.requestJoin(e.conversationId,n),joinByInviteCode:(e,n)=>u.group.joinByInviteCode(e.conversationId,n),getPinnedMessage:e=>u.group.getPinnedMessage(e.conversationId),pinMessage:(e,n)=>u.group.pinMessage({groupId:e.conversationId,messageId:n}),unpinMessage:e=>u.group.unpinMessage(e.conversationId)},M={listFirstPage:e=>u.channel.listFirstPage(e),listNextPage:e=>u.channel.listNextPage(e),uploadAvatar:e=>u.channel.uploadAvatar(e),create:e=>u.channel.create(e),get mentions(){return u.channel.mentions},getProfile:(e,n)=>u.channel.getProfile(e.conversationId,n),updateVerification:(e,n,t)=>u.channel.updateVerification(e.conversationId,n,t),requestJoin:(e,n)=>u.channel.requestJoin(e.conversationId,n),joinByInviteCode:(e,n)=>u.channel.joinByInviteCode(e.conversationId,n),setAllMuted:(e,n)=>u.channel.setAllMuted(e.conversationId,n),setMemberPrivateChatDisabled:(e,n)=>u.channel.setMemberPrivateChatDisabled(e.conversationId,n),setMyNickname:(e,n)=>u.channel.setMyNickname(e.conversationId,n),setMemberNickname:(e,n,t)=>u.channel.setMemberNickname(e.conversationId,n,t),dismiss:e=>u.channel.dismiss(e.conversationId),getPinnedMessage:e=>u.channel.getPinnedMessage(e.conversationId),pinMessage:(e,n)=>u.channel.pinMessage({channelId:e.conversationId,messageId:n}),unpinMessage:e=>u.channel.unpinMessage(e.conversationId)};const C={get session(){return b},get connection(){return u.connection},get conversations(){return u.conversations},get directory(){return u.directory},get customerService(){return u.customerService},get robots(){return u.robots},get contacts(){return f},get groups(){return A},get channels(){return M},get events(){return I},get contact(){return u.contact},get group(){return u.group},get channel(){return u.channel},get media(){return u.media},get calls(){return u.calls},get groupCalls(){return u.groupCalls},get settings(){return u.settings},get push(){return u.push},get activity(){return u.activity},get outbox(){return u.outbox},get localData(){return y},get search(){return u.search},get applications(){return u.applications},get expressions(){return u.expressions},get sessionFavorites(){return u.sessionFavorites},get drafts(){return u.drafts},get openConversation(){return u.openConversation},logout:v,dispose:function(){return void 0!==p||(d=!0,p=u.teardown({localData:"preserve"},{preserveUploadRecovery:!0}).then(()=>i.clear())),p}};return g(C,()=>u.advancedMessageDiagnostics),C}export{I as createAdvancedImClient,b as createImClient,C as createProductClientFacade};
|