@rongcloud/electron-renderer 5.9.7 → 5.9.8-alpha.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/index.d.ts +23 -1
- package/index.esm.js +1 -1
- package/index.js +1 -1
- package/package.json +2 -2
- package/renderer.js +1 -1
package/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AEngine, IRuntime, Codec, InnerRTCKeyMaps, IEngineWatcher, IAPIContextOption, IExtraMethod, IAsyncRes, IPromiseResult, INaviInfo, LogType, BasicLogger, BasicStatistic, RCConnectionStatus, ConversationType, IReceivedMessage, MessageDirection, ErrorCode, IRecallMsgOptions, IReceivedConversation, IConversationOption, NotificationLevel, IFirstUnreadMessageInfo, IServerConversationStatus, ISetConversationStatusOptions, ISendMsgOptions, IMessageReaderResponse, IMessageReadReceiptV4Response, IGroupReadReceiptData, IServerUserSetting, IChatroomJoinResponse, IChatroomInfo, IChrmKVEntry, IChrmKVEntries, FileType, IUploadAuth, UploadMethod, IInsertMsgOptions, IInsertMessage, IClearMessageOption, NotificationStatus, IRTCRoomBindOption, ITagParam, ITagInfo, IReceivedConversationByTag, ILocalTagStatus, IConversationTag, IBaseConversationInfo, IGroupMessageDeliverInfo, IConversationState, IUltraGroupConversation, OperateStatus, IUltraMsgQueryOptions, IUltraExMsgOptions, IUltraModifyMsgOptions, IGetMsgOption, IOSInfo, IProcessInfo, IProxy, IResponse, INetwork } from '@rongcloud/engine';
|
|
1
|
+
import { AEngine, IRuntime, Codec, InnerRTCKeyMaps, IEngineWatcher, IAPIContextOption, IExtraMethod, IAsyncRes, IPromiseResult, INaviInfo, LogType, BasicLogger, BasicStatistic, RCConnectionStatus, ConversationType, IReceivedMessage, MessageDirection, ErrorCode, IRecallMsgOptions, IReceivedConversation, IConversationOption, NotificationLevel, IFirstUnreadMessageInfo, IServerConversationStatus, ISetConversationStatusOptions, ISendMsgOptions, IMessageReaderResponse, IMessageReadReceiptV4Response, IGroupReadReceiptData, IServerUserSetting, IChatroomJoinResponse, IChatroomInfo, IChrmKVEntry, IChrmKVEntries, FileType, IUploadAuth, UploadMethod, IInsertMsgOptions, IInsertMessage, IClearMessageOption, NotificationStatus, IRTCRoomBindOption, ITagParam, ITagInfo, IReceivedConversationByTag, ILocalTagStatus, IConversationTag, IBaseConversationInfo, IGroupMessageDeliverInfo, IConversationState, IUltraGroupConversation, OperateStatus, IUltraMsgQueryOptions, IUltraExMsgOptions, IUltraModifyMsgOptions, IGetMsgOption, IOSInfo, IProcessInfo, IProxy, IResponse, INetwork, SubscribeType, ISubscribeUserStatusInfo } from '@rongcloud/engine';
|
|
2
2
|
|
|
3
3
|
declare class RCCppEngine extends AEngine {
|
|
4
4
|
private readonly _logEmitter;
|
|
@@ -162,9 +162,13 @@ declare class RCCppEngine extends AEngine {
|
|
|
162
162
|
messages: IReceivedMessage[];
|
|
163
163
|
count: number;
|
|
164
164
|
}>;
|
|
165
|
+
searchMessageByContentAndMessageType(conversationType: ConversationType, targetId: string, keyword: string, timestamp: number, count: number, messageTypes: string[], channelId?: string): IPromiseResult<{
|
|
166
|
+
messages: IReceivedMessage[];
|
|
167
|
+
}>;
|
|
165
168
|
searchMessagesByUser(conversationType: ConversationType, targetId: string, userId: string, timestamp: number, count: number, channelId: string): IPromiseResult<{
|
|
166
169
|
messages: IReceivedMessage[];
|
|
167
170
|
}>;
|
|
171
|
+
getMessagesByTimestamp(conversation: IConversationOption, timestamp: number, beforeCount: number, afterCount: number): IPromiseResult<IReceivedMessage[]>;
|
|
168
172
|
getUnreadMentionedMessages(conversationType: ConversationType, targetId: string, channelId: string): IReceivedMessage[];
|
|
169
173
|
setMessageSentStatus(messageId: number, sentStatus: number): Promise<ErrorCode>;
|
|
170
174
|
setMessageReceivedStatus(messageId: number, receivedStatus: number): Promise<ErrorCode>;
|
|
@@ -228,6 +232,8 @@ declare class RCCppEngine extends AEngine {
|
|
|
228
232
|
getConversationNotificationLevel(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<NotificationLevel>;
|
|
229
233
|
setConversationNotificationLevel(conversationType: ConversationType, targetId: string, notificationLevel?: NotificationLevel, channelId?: string): Promise<ErrorCode>;
|
|
230
234
|
batchSetConversationNotificationLevel(conversations: IConversationOption[], notificationLevel: NotificationLevel): Promise<ErrorCode>;
|
|
235
|
+
setConversationTypeNotificationLevel(conversationType: ConversationType, level: NotificationLevel): Promise<IAsyncRes<void>>;
|
|
236
|
+
getConversationTypeNotificationLevel(conversationType: ConversationType): Promise<IAsyncRes<NotificationLevel>>;
|
|
231
237
|
getUltraGroupDefaultNotificationLevel(targetId: string, channelId: string): IPromiseResult<NotificationLevel>;
|
|
232
238
|
getAllUltraGroupUnreadCount(): Promise<{
|
|
233
239
|
code: ErrorCode;
|
|
@@ -276,6 +282,22 @@ declare class RCCppEngine extends AEngine {
|
|
|
276
282
|
*/
|
|
277
283
|
setCheckDuplicateMessage(enableCheck: boolean): Promise<IAsyncRes<boolean>>;
|
|
278
284
|
setNetwork(data: INetwork, isUnPrintLog?: boolean): void;
|
|
285
|
+
/**
|
|
286
|
+
* 订阅用户状态事件
|
|
287
|
+
*/
|
|
288
|
+
subscribeUser(userIds: string[], subscribeType: SubscribeType, expiry: number): Promise<IAsyncRes<string[]>>;
|
|
289
|
+
/**
|
|
290
|
+
* 取消订阅用户状态事件
|
|
291
|
+
*/
|
|
292
|
+
unSubscribeUser(userIds: string[], subscribeType: SubscribeType): Promise<IAsyncRes<void>>;
|
|
293
|
+
/**
|
|
294
|
+
* 获取已订阅列表
|
|
295
|
+
*/
|
|
296
|
+
getSubscribeUserList(subscribeType: SubscribeType, count: number, offset: number): Promise<IAsyncRes<ISubscribeUserStatusInfo[]>>;
|
|
297
|
+
/**
|
|
298
|
+
* 获取指定用户的在线状态
|
|
299
|
+
*/
|
|
300
|
+
getSubscribeUserStatus(subscribeType: SubscribeType, userIds: string[]): Promise<IAsyncRes<ISubscribeUserStatusInfo[]>>;
|
|
279
301
|
}
|
|
280
302
|
|
|
281
303
|
declare const initContextBridge: () => void;
|
package/index.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ipcRenderer as t,contextBridge as e}from"electron";import{BasicLogger as n,BasicStatistic as o,VersionManage as r,LogTagId as i,isUndefined as a,ErrorCode as s,EventEmitter as c,RCConnectionStatus as l,AEngine as u}from"@rongcloud/engine";var p=function(t,e){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},p(t,e)};function g(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}p(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function h(t,e,n,o){return new(n||(n=Promise))((function(r,i){function a(t){try{c(o.next(t))}catch(t){i(t)}}function s(t){try{c(o.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}c((o=o.apply(t,e||[])).next())}))}function _(t,e){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function f(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var y="logdata",M=function(t){function e(e,n,o,r){var i=t.call(this,e,n,o)||this;return i.emiter=r,i}return g(e,t),e.prototype.flush=function(t){this.emiter.emit(y,t)},e}(n),d=function(t){function e(e,n,o,r){var i=t.call(this,e,n,o)||this;return i.emiter=r,i}return g(e,t),e.prototype.flush=function(t){this.emiter.emit("logdata",t)},e}(o),C=0,v=Date.now();r.add("electron-renderer","5.9.7");var m=function(t){function e(e,n,o,r){var a=this,s=new c,u=new M(r.appkey,"RC-E","IM",s),p=new d(r.appkey,"RC-E","IM",s);return(a=t.call(this,e,n,o,r,u,p)||this).waitingLogs=[],a.latestSendTimestamp=0,a._resolveMaps={},s.on(y,(function(t){a.waitingLogs.push(t),a.check2SendLog()})),a._logEmitter=s,u.setOutputLevel(r.logOutputLevel),window.__ContextBridge__.on("__RC_CHANNEL_NOTIFICATION_FROM_MAIN__",(function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var s=o[e];if(s){var c={batchMessage:a._batchMessage.bind(a),onRTCDataChange:a._onRTCDataChange.bind(a),onConnected:a._onConnected.bind(a),onNaviDataChange:a._onNaviDataChange.bind(a)};if(c[e])c[e](n,s);else{var u={onConnecting:l.CONNECTING,onSuspend:l.SUSPENDED,onDisconnected:l.DISCONNECTED};u[e]&&a._setConnectionStatus(u[e]),s(n[0])}}else a.logger.error(i.L_UNSUPPORT_NTF_FROM_MAIN_E,e)})),window.__ContextBridge__.on("__RC_CHANNEL_RESULT_FROM_MAIN__",(function(t,e){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];var r=a._resolveMaps[e];r&&(delete a._resolveMaps[e],r.apply(void 0,n))})),a._options.httpInMainProcess&&(e.httpReq=a.sendHTTPRequest.bind(a)),window.__ContextBridge__.send("__RC_INNER_COMMAND_INIT__",{navigators:r.navigators,areaCode:r.areaCode,logServerUrl:r.logServerUrl}),a._cache=a._callMainSync("getMainProcessCache"),a}return g(e,t),e.prototype._batchMessage=function(t,e){var n=t[0].hasMoreMsg;delete t[0].hasMoreMsg,e([t[0]],void 0,n)},e.prototype._onRTCDataChange=function(t,e){var n=t[0];this._receiveRtcKv(new Uint8Array(n))},e.prototype._onConnected=function(t,e){this._cache=t[0],e(void 0)},e.prototype._onNaviDataChange=function(t,e){this._cache.naviInfo=t[0],e([t[0]])},e.prototype._setConnectionStatus=function(t){this._cache.connectionStatus=t},e.prototype.check2SendLog=function(){var t=Date.now();t-this.latestSendTimestamp<1e3||(this.logger.debug(i.T,"send logs 2 main -> "+this.waitingLogs.length),window.__ContextBridge__.send("__RC_CHANNEL_SEND_2_MAIN__","onRendererLogsReceived",this.waitingLogs.splice(0)),this.latestSendTimestamp=t)},e.prototype.sendHTTPRequest=function(t){return this._callMain("sendHTTPRequest",t)},e.prototype.setUserStatusListener=function(t,e){throw new Error("TODO -> RCCppEngine.setUserStatusListener")},e.prototype._callMain=function(t){for(var e=this,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];var r=new Promise((function(o){var r,i=function(t){var e=Date.now();return v!==e&&(v=e,C=0),[t,window.__ContextBridge__.getProcessInfo("pid"),e,C++].join("__")}(t);e._resolveMaps[i]=o,(r=window.__ContextBridge__).send.apply(r,f(["__RC_CHANNEL_CALL_MAIN__",i,t],n,!1))}));return r},e.prototype.callExtra=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return this._callMain.apply(this,f(["callExtra",t],e,!1))},e.prototype._send2Main=function(t){for(var e,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];(e=window.__ContextBridge__).send.apply(e,f(["__RC_CHANNEL_SEND_2_MAIN__",t],n,!1))},e.prototype._callMainSync=function(t){for(var e,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];return this.logger.info(i.L_CALL_MAIN_SYNC_O,t),(e=window.__ContextBridge__).sendSync.apply(e,f(["__RC_CHANNEL_CALL_MAIN_SYNC__",t],n,!1))},e.prototype.refetchNaviInfo=function(){return this._callMain("refetchNaviInfo")},e.prototype.getNaviInfoFromCache=function(){return this._cache.naviInfo},e.prototype.createLogger=function(t,e){return new M(this._appkey,t,e,this._logEmitter)},e.prototype.createStatisticLogger=function(t,e){return new d(this._appkey,t,e,this._logEmitter)},e.prototype.getConnectionStatus=function(){return this._cache.connectionStatus},e.prototype.connect=function(t,e,n,o){return h(this,void 0,void 0,(function(){return _(this,(function(r){return[2,this._callMain("connect",t,e,n,o)]}))}))},e.prototype.reportSDKInfo=function(t){this._send2Main("reportSDKInfo",t)},e.prototype.getConnectedTime=function(){return this._cache.connectedTime},e.prototype.getHistoryMessage=function(t,e,n,o,r,i,a){return this._callMain("getHistoryMessage",t,e,n,o,r,i,a)},e.prototype.getMessages=function(t,e,n,o,r,i){return this._callMain("getMessages",t,e,n,o,r,i)},e.prototype.getContinuousMessages=function(t,e,n,o,r,i){return this._callMain("getContinuousMessages",t,e,n,o,r,i)},e.prototype.getHistoryMessagesByObjectNames=function(t,e,n,o,r,i,a){return this._callMain("getHistoryMessagesByObjectNames",t,e,n,o,r,i,a)},e.prototype.deleteRemoteMessage=function(t,e,n,o){return this._callMain("deleteRemoteMessage",t,e,n,o)},e.prototype.recallMsg=function(t,e,n,o,r){return this._callMain("recallMsg",t,e,n,o,r)},e.prototype.deleteRemoteMessageByTimestamp=function(t,e,n,o){return this._callMain("deleteRemoteMessageByTimestamp",t,e,n,o)},e.prototype.getConversationList=function(t,e,n,o,r){return this._callMain("getConversationList",t,e,n,o,r)},e.prototype.getConversationsByPage=function(t,e,n,o,r){return this._callMain("getConversationsByPage",t,e,n,o,r)},e.prototype.getUnreadConversationList=function(t){return this._callMain("getUnreadConversationList",t)},e.prototype.getConversationListWithAllChannel=function(){return this._callMain("getConversationListWithAllChannel")},e.prototype.getConversationListWithAllChannelByPage=function(t,e){return this._callMain("getConversationListWithAllChannelByPage",t,e)},e.prototype.getConversation=function(t,e,n){return this._callMain("getConversation",t,e,n)},e.prototype.removeConversation=function(t,e,n){return this._callMain("removeConversation",t,e,n)},e.prototype.batchRemoveConversation=function(t){return this._callMain("batchRemoveConversation",t)},e.prototype.getAllConversationUnreadCount=function(t,e,n){return this._callMain("getAllConversationUnreadCount",t,e,n)},e.prototype.getConversationUnreadCount=function(t,e,n){return this._callMain("getConversationUnreadCount",t,e,n)},e.prototype.getTotalUnreadCountByLevels=function(t,e,n){return this._callMain("getTotalUnreadCountByLevels",t,e,n)},e.prototype.clearConversationUnreadCount=function(t,e,n){return this._callMain("clearConversationUnreadCount",t,e,n)},e.prototype.getFirstUnreadMessage=function(t,e,n){return this._callMain("getFirstUnreadMessage",t,e,n)},e.prototype.getFirstUnreadMessageInfo=function(t,e,n){return this._callMain("getFirstUnreadMessageInfo",t,e,n)},e.prototype.saveConversationMessageDraft=function(t,e,n){return this._callMain("saveConversationMessageDraft",t,e,n)},e.prototype.getConversationMessageDraft=function(t,e){return this._callMain("getConversationMessageDraft",t,e)},e.prototype.clearConversationMessageDraft=function(t,e){return this._callMain("clearConversationMessageDraft",t,e)},e.prototype.pullConversationStatus=function(t){return this._callMain("pullConversationStatus",t)},e.prototype.batchSetConversationStatus=function(t){var e=t[0].notificationLevel;return a(e)?this._callMain("batchSetConversationStatus",t):Promise.resolve(s.NOT_SUPPORT)},e.prototype.batchSetConversationToTop=function(t,e,n){return this._callMain("batchSetConversationToTop",t,e,n)},e.prototype.sendMessage=function(t,e,n,o,r){var a=this,s=["sendMessageBefore",Date.now(),Math.floor(Math.random()*Date.now())].join("_");return o&&(this._resolveMaps[s]=function(t){try{o(t)}catch(t){a.logger.error(i.A_CALLBACK_E,JSON.stringify({error:null==t?void 0:t.stack,pos:"sendMsgBefore"}))}}),this._callMain("sendMessage",t,e,n,s,r)},e.prototype.sendReadReceiptMessage=function(t,e,n){return this._callMain("sendReadReceiptMessage",t,e,n)},e.prototype.getMessageReader=function(t,e,n){return this._callMain("getMessageReader",t,e,n)},e.prototype.sendReadReceiptMessageV4=function(t,e,n){return this._callMain("sendReadReceiptMessageV4",t,e,n)},e.prototype.getMessageReadReceiptV4=function(t,e){return this._callMain("getMessageReadReceiptV4",t,e)},e.prototype.batchGetMessageReadReceiptInfoV4=function(t,e){return Promise.resolve({code:s.NOT_SUPPORT})},e.prototype.updateConversationReadTime=function(t,e){return this._callMain("updateConversationReadTime",t,e)},e.prototype.disconnect=function(t){return h(this,void 0,void 0,(function(){return _(this,(function(e){return this._send2Main("disconnect",t),[2]}))}))},e.prototype.pullUserSettings=function(t){return this._callMain("pullUserSettings",t)},e.prototype.registerMessageType=function(t,e,n,o,r){this._send2Main("registerMessageType",t,e,n,o,r)},e.prototype.joinChatroom=function(t,e){return this._callMain("joinChatroom",t,e)},e.prototype.joinExistChatroom=function(t,e){return this._callMain("joinExistChatroom",t,e)},e.prototype.quitChatroom=function(t){return this._callMain("quitChatroom",t)},e.prototype.getChatroomInfo=function(t,e,n){return this._callMain("getChatroomInfo",t,e,n)},e.prototype.getChatroomHistoryMessages=function(t,e,n,o){return this._callMain("getChatroomHistoryMessages",t,e,n,o)},e.prototype.setChatroomEntry=function(t,e){return this._callMain("setChatroomEntry",t,e)},e.prototype.setChatroomEntries=function(t,e){return this._callMain("setChatroomEntries",t,e)},e.prototype.forceSetChatroomEntry=function(t,e){return this._callMain("forceSetChatroomEntry",t,e)},e.prototype.removeChatroomEntry=function(t,e){return this._callMain("removeChatroomEntry",t,e)},e.prototype.forceRemoveChatroomEntry=function(t,e){return this._callMain("forceRemoveChatroomEntry",t,e)},e.prototype.removeChatroomEntries=function(t,e){return this._callMain("removeChatroomEntries",t,e)},e.prototype.getChatroomEntry=function(t,e){return this._callMain("getChatroomEntry",t,e)},e.prototype.getAllChatroomEntry=function(t){return this._callMain("getAllChatroomEntry",t)},e.prototype.getFileToken=function(t,e,n,o,r){return this._callMain("getFileToken",t,e,n,o,r)},e.prototype.getFileUrl=function(t,e,n,o){return this._callMain("getFileUrl",t,e,n,o)},e.prototype.setUserStatus=function(t){return this._callMain("setUserStatus",t)},e.prototype.subscribeUserStatus=function(t){return this._callMain("subscribeUserStatus",t)},e.prototype.getUserStatus=function(t){return this._callMain("getUserStatus",t)},e.prototype.clearConversations=function(t,e){return this._callMain("clearConversations",t,e)},e.prototype.addToBlacklist=function(t){return this._callMain("addToBlacklist",t)},e.prototype.removeFromBlacklist=function(t){return this._callMain("removeFromBlacklist",t)},e.prototype.getBlacklist=function(){return this._callMain("getBlacklist")},e.prototype.getBlacklistStatus=function(t){return this._callMain("getBlacklistStatus",t)},e.prototype.insertMessage=function(t,e,n){return this._callMain("insertMessage",t,e,n)},e.prototype.batchInsertMessage=function(t,e){return this._callMain("batchInsertMessage",t,e)},e.prototype.getMessageCount=function(t,e,n){return this._callMain("getMessageCount",t,e,n)},e.prototype.deleteMessages=function(t){return this._callMain("deleteMessages",t)},e.prototype.deleteMessagesByTimestamp=function(t,e,n,o,r){return this._callMain("deleteMessagesByTimestamp",t,e,n,o,r)},e.prototype.batchClearMessagesByTimestamp=function(t){return this._callMain("batchClearMessagesByTimestamp",t)},e.prototype.batchClearRemoteHistoryMessages=function(t,e){return this._callMain("batchClearRemoteHistoryMessages",t,e)},e.prototype.clearMessages=function(t,e,n){return this._callMain("clearMessages",t,e,n)},e.prototype.getMessage=function(t){return this._callMain("getMessage",t)},e.prototype.setMessageContent=function(t,e,n){return this._callMain("setMessageContent",t,e,n)},e.prototype.setMessageSearchField=function(t,e,n){return this._callMain("setMessageSearchField",t,e,n)},e.prototype.searchConversationByContent=function(t,e,n,o){return this._callMain("searchConversationByContent",t,e,n,o)},e.prototype.searchConversationByContentWithAllChannel=function(t,e,n){return this._callMain("searchConversationByContentWithAllChannel",t,e,n)},e.prototype.searchMessageByContentWithAllChannel=function(t,e,n,o,r){return this._callMain("searchMessageByContentWithAllChannel",t,e,n,o,r)},e.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(t,e,n,o,r,i,a){return this._callMain("searchMessageByContentInTimeRangeWithAllChannel",t,e,n,o,r,i,a)},e.prototype.searchMessageByContent=function(t,e,n,o,r,i,a){return this._callMain("searchMessageByContent",t,e,n,o,r,i,a)},e.prototype.searchMessagesByUser=function(t,e,n,o,r,i){return this._callMain("searchMessagesByUser",t,e,n,o,r,i)},e.prototype.getUnreadMentionedMessages=function(t,e,n){return this._callMainSync("getUnreadMentionedMessages",t,e,n)},e.prototype.setMessageSentStatus=function(t,e){return this._callMain("setMessageSentStatus",t,e)},e.prototype.setMessageReceivedStatus=function(t,e){return this._callMain("setMessageReceivedStatus",t,e)},e.prototype.updateMessageReceiptStatus=function(t,e,n,o){return this._callMain("updateMessageReceiptStatus",t,e,n,o)},e.prototype.clearUnreadCountByTimestamp=function(t,e,n,o){return this._callMain("clearUnreadCountByTimestamp",t,e,n,o)},e.prototype.clearAllUnreadCount=function(){throw new Error("Method not implemented.")},e.prototype.getConversationNotificationStatus=function(t,e,n){return this._callMain("getConversationNotificationStatus",t,e,n)},e.prototype.getRemoteHistoryMessages=function(t,e,n,o,r,i){return this._callMain("getRemoteHistoryMessages",t,e,n,o,r,i)},e.prototype.getServerTime=function(){return Date.now()-this._cache.deltaTime},e.prototype.getDeviceId=function(){return this._cache.deviceId},e.prototype.getCurrentUserId=function(){return this._cache.crtUserId},e.prototype.bindRTCRoomForChatroom=function(t){return this._callMain("bindRTCRoomForChatroom",t)},e.prototype.rtcSignaling=function(t,e,n,o){return h(this,void 0,void 0,(function(){var r,i,a;return _(this,(function(s){switch(s.label){case 0:return[4,this._callMain("rtcSignaling",t,e,n,o)];case 1:return r=s.sent(),i=r.code,a=r.buffer,[2,{code:i,buffer:a?new Uint8Array(a):a}]}}))}))},e.prototype.rtcPing=function(t,e,n){return this._callMain("rtcPing",t,e,n)},e.prototype.createTag=function(t){return this._callMain("createTag",t)},e.prototype.removeTag=function(t){return this._callMain("removeTag",t)},e.prototype.updateTag=function(t){return this._callMain("updateTag",t)},e.prototype.getTagList=function(){return this._callMain("getTagList")},e.prototype.addTagForConversations=function(t,e){return this._callMain("addTagForConversations",t,e)},e.prototype.removeTagForConversations=function(t,e){return this._callMain("removeTagForConversations",t,e)},e.prototype.removeTagsForConversation=function(t,e){return this._callMain("removeTagsForConversation",t,e)},e.prototype.getConversationListByTag=function(t,e,n,o){return this._callMain("getConversationListByTag",t,e,n,o)},e.prototype.getUnreadCountByTag=function(t,e){return this._callMain("getUnreadCountByTag",t,e)},e.prototype.setConversationStatusInTag=function(t,e,n){return this._callMain("setConversationStatusInTag",t,e,n)},e.prototype.getTagsForConversation=function(t){return this._callMain("getTagsForConversation",t)},e.prototype.clearData=function(){return this._callMain("clearData")},e.prototype.getBlockConversationList=function(){throw new Error("Method not implemented.")},e.prototype.getGroupMessageDeliverList=function(t,e,n){return this._callMain("getGroupMessageDeliverList",t,e,n)},e.prototype.getPrivateMessageDeliverTime=function(t,e){return this._callMain("getPrivateMessageDeliverTime",t,e)},e.prototype.setCallInfo=function(t,e,n){return this._callMain("setCallInfo",t,e,n)},e.prototype.getTopConversationList=function(t,e){return this._callMain("getTopConversationList",t,e)},e.prototype.getUnreadMentionedCount=function(t){throw new Error("Method not implemented.")},e.prototype.getAllUnreadMentionedCount=function(){return this._callMain("getAllUnreadMentionedCount")},e.prototype.getAllConversationState=function(){throw new Error("Method not implemented.")},e.prototype.getUltraGroupList=function(){throw new Error("Method not implemented.")},e.prototype.getBlockUltraGroupList=function(){throw new Error("Method not implemented.")},e.prototype.getTopUltraGroupList=function(){throw new Error("Method not implemented.")},e.prototype.clearUltraUnreadcount=function(t,e){throw new Error("Method not implemented.")},e.prototype.getUltraGroupUnreadMentionedCountByTargetId=function(t,e){throw new Error("Method not implemented.")},e.prototype.sendUltraMessage=function(t,e,n){throw new Error("Method not implemented.")},e.prototype.sendUltraGroupTypingStatus=function(t,e){throw new Error("Method not implemented.")},e.prototype.getUltraGroupMessageListByMessageUId=function(t){throw new Error("Method not implemented.")},e.prototype.expandUltraMessage=function(t){throw new Error("Method not implemented.")},e.prototype.modifyMessage=function(t){throw new Error("Method not implemented.")},e.prototype.getUltraHistoryMsg=function(t,e){throw new Error("Method not implemented.")},e.prototype.getConversationNotificationLevel=function(t,e,n){return this._callMain("getConversationNotificationLevel",t,e,n)},e.prototype.setConversationNotificationLevel=function(t,e,n,o){return this._callMain("setConversationNotificationLevel",t,e,n,o)},e.prototype.batchSetConversationNotificationLevel=function(t,e){return this._callMain("batchSetConversationNotificationLevel",t,e)},e.prototype.getUltraGroupDefaultNotificationLevel=function(t,e){return Promise.resolve({code:s.NOT_SUPPORT})},e.prototype.getAllUltraGroupUnreadCount=function(){return Promise.resolve({code:s.NOT_SUPPORT})},e.prototype.getUltraGroupUnreadCountByTargetId=function(){return Promise.resolve({code:s.NOT_SUPPORT})},e.prototype.setUltraGroupDefaultNotificationLevel=function(){return Promise.resolve({code:s.NOT_SUPPORT})},e.prototype.getUltraGroupUnreadMentionedMessages=function(){return Promise.resolve({code:s.NOT_SUPPORT})},e.prototype.getUltraGroupFirstUnreadMessageTimestamp=function(){return Promise.resolve({code:s.NOT_SUPPORT})},e.prototype.getUltraGroupUnreadInfoList=function(){return Promise.resolve({code:s.NOT_SUPPORT})},e.prototype.getOSInfo=function(){return h(this,void 0,void 0,(function(){return _(this,(function(t){return[2,this._callMain("getOSInfo")]}))}))},e.prototype.getProcessInfo=function(){return h(this,void 0,void 0,(function(){return _(this,(function(t){return[2,{code:s.SUCCESS,data:{title:window.__ContextBridge__.getProcessInfo("title"),pid:window.__ContextBridge__.getProcessInfo("pid"),ppid:window.__ContextBridge__.getProcessInfo("ppid"),platform:window.__ContextBridge__.getProcessInfo("platform"),arch:window.__ContextBridge__.getProcessInfo("arch"),uptime:window.__ContextBridge__.callProcessMethod("uptime"),cpuUsage:window.__ContextBridge__.callProcessMethod("cpuUsage"),memoryUsage:window.__ContextBridge__.callProcessMethod("cpuUsage"),resourceUsage:window.__ContextBridge__.callProcessMethod("cpuUsage")}}]}))}))},e.prototype.getMainProcessInfo=function(){return h(this,void 0,void 0,(function(){return _(this,(function(t){return[2,this._callMain("getMainProcessInfo")]}))}))},e.prototype.setProxy=function(t){return this._callMain("setProxy",t)},e.prototype.getProxy=function(){return this._callMain("getProxy")},e.prototype.testProxy=function(t,e){return this._callMain("testProxy",t,e)},e.prototype.setCheckDuplicateMessage=function(t){return this._callMain("checkDuplicateMessage",t)},e.prototype.setNetwork=function(t,e){window.__ContextBridge__.send("__RC_CHANNEL_SEND_2_MAIN__","onRendererNetworkStatusReceived",t,e)},e}(u),w={on:function(e,n){t.on(e,(function(t){for(var e=[],o=1;o<arguments.length;o++)e[o-1]=arguments[o];n.apply(void 0,f([t],e,!1))}))},send:function(e){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];t.send.apply(t,f([e],n,!1))},sendSync:function(e){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];return t.sendSync.apply(t,f([e],n,!1))},getProcessInfo:function(t){return process[t]},callProcessMethod:function(t){for(var e,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];return(e=process)[t].apply(e,n)}};window&&(window.RCCppEngine=m,window.__ContextBridge__=w);var T=function(){e&&e.exposeInMainWorld("__ContextBridge__",w)};export{m as RCCppEngine,T as initContextBridge};
|
|
1
|
+
import{ipcRenderer as t,contextBridge as e}from"electron";import{BasicLogger as n,BasicStatistic as o,VersionManage as r,LogTagId as i,isUndefined as a,ErrorCode as s,EventEmitter as c,RCConnectionStatus as l,AEngine as u}from"@rongcloud/engine";var p=function(t,e){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},p(t,e)};function g(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}p(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function h(t,e,n,o){return new(n||(n=Promise))((function(r,i){function a(t){try{c(o.next(t))}catch(t){i(t)}}function s(t){try{c(o.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}c((o=o.apply(t,e||[])).next())}))}function _(t,e){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function f(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var y="logdata",M=function(t){function e(e,n,o,r){var i=t.call(this,e,n,o)||this;return i.emiter=r,i}return g(e,t),e.prototype.flush=function(t){this.emiter.emit(y,t)},e}(n),d=function(t){function e(e,n,o,r){var i=t.call(this,e,n,o)||this;return i.emiter=r,i}return g(e,t),e.prototype.flush=function(t){this.emiter.emit("logdata",t)},e}(o),C=0,v=Date.now();r.add("electron-renderer","5.9.8-alpha.2");var m=function(t){function e(e,n,o,r){var a=this,s=new c,u=new M(r.appkey,"RC-E","IM",s),p=new d(r.appkey,"RC-E","IM",s);return(a=t.call(this,e,n,o,r,u,p)||this).waitingLogs=[],a.latestSendTimestamp=0,a._resolveMaps={},s.on(y,(function(t){a.waitingLogs.push(t),a.check2SendLog()})),a._logEmitter=s,u.setOutputLevel(r.logOutputLevel),window.__ContextBridge__.on("__RC_CHANNEL_NOTIFICATION_FROM_MAIN__",(function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var s=o[e];if(s){var c={batchMessage:a._batchMessage.bind(a),onRTCDataChange:a._onRTCDataChange.bind(a),onConnected:a._onConnected.bind(a),onNaviDataChange:a._onNaviDataChange.bind(a)};if(c[e])c[e](n,s);else{var u={onConnecting:l.CONNECTING,onSuspend:l.SUSPENDED,onDisconnected:l.DISCONNECTED};u[e]&&a._setConnectionStatus(u[e]),s(n[0])}}else a.logger.error(i.L_UNSUPPORT_NTF_FROM_MAIN_E,e)})),window.__ContextBridge__.on("__RC_CHANNEL_RESULT_FROM_MAIN__",(function(t,e){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];var r=a._resolveMaps[e];r&&(delete a._resolveMaps[e],r.apply(void 0,n))})),a._options.httpInMainProcess&&(e.httpReq=a.sendHTTPRequest.bind(a)),window.__ContextBridge__.send("__RC_INNER_COMMAND_INIT__",{navigators:r.navigators,areaCode:r.areaCode,logServerUrl:r.logServerUrl,environment:r.environment}),a._cache=a._callMainSync("getMainProcessCache"),a}return g(e,t),e.prototype._batchMessage=function(t,e){var n=t[0].hasMoreMsg;delete t[0].hasMoreMsg,e([t[0]],void 0,n)},e.prototype._onRTCDataChange=function(t,e){var n=t[0];this._receiveRtcKv(new Uint8Array(n))},e.prototype._onConnected=function(t,e){this._cache=t[0],e(void 0)},e.prototype._onNaviDataChange=function(t,e){this._cache.naviInfo=t[0],e([t[0]])},e.prototype._setConnectionStatus=function(t){this._cache.connectionStatus=t},e.prototype.check2SendLog=function(){var t=Date.now();t-this.latestSendTimestamp<1e3||(this.logger.debug(i.T,"send logs 2 main -> "+this.waitingLogs.length),window.__ContextBridge__.send("__RC_CHANNEL_SEND_2_MAIN__","onRendererLogsReceived",this.waitingLogs.splice(0)),this.latestSendTimestamp=t)},e.prototype.sendHTTPRequest=function(t){return this._callMain("sendHTTPRequest",t)},e.prototype.setUserStatusListener=function(t,e){throw new Error("TODO -> RCCppEngine.setUserStatusListener")},e.prototype._callMain=function(t){for(var e=this,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];var r=new Promise((function(o){var r,i=function(t){var e=Date.now();return v!==e&&(v=e,C=0),[t,window.__ContextBridge__.getProcessInfo("pid"),e,C++].join("__")}(t);e._resolveMaps[i]=o,(r=window.__ContextBridge__).send.apply(r,f(["__RC_CHANNEL_CALL_MAIN__",i,t],n,!1))}));return r},e.prototype.callExtra=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return this._callMain.apply(this,f(["callExtra",t],e,!1))},e.prototype._send2Main=function(t){for(var e,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];(e=window.__ContextBridge__).send.apply(e,f(["__RC_CHANNEL_SEND_2_MAIN__",t],n,!1))},e.prototype._callMainSync=function(t){for(var e,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];return this.logger.info(i.L_CALL_MAIN_SYNC_O,t),(e=window.__ContextBridge__).sendSync.apply(e,f(["__RC_CHANNEL_CALL_MAIN_SYNC__",t],n,!1))},e.prototype.refetchNaviInfo=function(){return this._callMain("refetchNaviInfo")},e.prototype.getNaviInfoFromCache=function(){return this._cache.naviInfo},e.prototype.createLogger=function(t,e){return new M(this._appkey,t,e,this._logEmitter)},e.prototype.createStatisticLogger=function(t,e){return new d(this._appkey,t,e,this._logEmitter)},e.prototype.getConnectionStatus=function(){return this._cache.connectionStatus},e.prototype.connect=function(t,e,n,o){return h(this,void 0,void 0,(function(){return _(this,(function(r){return[2,this._callMain("connect",t,e,n,o)]}))}))},e.prototype.reportSDKInfo=function(t){this._send2Main("reportSDKInfo",t)},e.prototype.getConnectedTime=function(){return this._cache.connectedTime},e.prototype.getHistoryMessage=function(t,e,n,o,r,i,a){return this._callMain("getHistoryMessage",t,e,n,o,r,i,a)},e.prototype.getMessages=function(t,e,n,o,r,i){return this._callMain("getMessages",t,e,n,o,r,i)},e.prototype.getContinuousMessages=function(t,e,n,o,r,i){return this._callMain("getContinuousMessages",t,e,n,o,r,i)},e.prototype.getHistoryMessagesByObjectNames=function(t,e,n,o,r,i,a){return this._callMain("getHistoryMessagesByObjectNames",t,e,n,o,r,i,a)},e.prototype.deleteRemoteMessage=function(t,e,n,o){return this._callMain("deleteRemoteMessage",t,e,n,o)},e.prototype.recallMsg=function(t,e,n,o,r){return this._callMain("recallMsg",t,e,n,o,r)},e.prototype.deleteRemoteMessageByTimestamp=function(t,e,n,o){return this._callMain("deleteRemoteMessageByTimestamp",t,e,n,o)},e.prototype.getConversationList=function(t,e,n,o,r){return this._callMain("getConversationList",t,e,n,o,r)},e.prototype.getConversationsByPage=function(t,e,n,o,r){return this._callMain("getConversationsByPage",t,e,n,o,r)},e.prototype.getUnreadConversationList=function(t){return this._callMain("getUnreadConversationList",t)},e.prototype.getConversationListWithAllChannel=function(){return this._callMain("getConversationListWithAllChannel")},e.prototype.getConversationListWithAllChannelByPage=function(t,e){return this._callMain("getConversationListWithAllChannelByPage",t,e)},e.prototype.getConversation=function(t,e,n){return this._callMain("getConversation",t,e,n)},e.prototype.removeConversation=function(t,e,n){return this._callMain("removeConversation",t,e,n)},e.prototype.batchRemoveConversation=function(t){return this._callMain("batchRemoveConversation",t)},e.prototype.getAllConversationUnreadCount=function(t,e,n){return this._callMain("getAllConversationUnreadCount",t,e,n)},e.prototype.getConversationUnreadCount=function(t,e,n){return this._callMain("getConversationUnreadCount",t,e,n)},e.prototype.getTotalUnreadCountByLevels=function(t,e,n){return this._callMain("getTotalUnreadCountByLevels",t,e,n)},e.prototype.clearConversationUnreadCount=function(t,e,n){return this._callMain("clearConversationUnreadCount",t,e,n)},e.prototype.getFirstUnreadMessage=function(t,e,n){return this._callMain("getFirstUnreadMessage",t,e,n)},e.prototype.getFirstUnreadMessageInfo=function(t,e,n){return this._callMain("getFirstUnreadMessageInfo",t,e,n)},e.prototype.saveConversationMessageDraft=function(t,e,n){return this._callMain("saveConversationMessageDraft",t,e,n)},e.prototype.getConversationMessageDraft=function(t,e){return this._callMain("getConversationMessageDraft",t,e)},e.prototype.clearConversationMessageDraft=function(t,e){return this._callMain("clearConversationMessageDraft",t,e)},e.prototype.pullConversationStatus=function(t){return this._callMain("pullConversationStatus",t)},e.prototype.batchSetConversationStatus=function(t){var e=t[0].notificationLevel;return a(e)?this._callMain("batchSetConversationStatus",t):Promise.resolve(s.NOT_SUPPORT)},e.prototype.batchSetConversationToTop=function(t,e,n){return this._callMain("batchSetConversationToTop",t,e,n)},e.prototype.sendMessage=function(t,e,n,o,r){var a=this,s=["sendMessageBefore",Date.now(),Math.floor(Math.random()*Date.now())].join("_");return o&&(this._resolveMaps[s]=function(t){try{o(t)}catch(t){a.logger.error(i.A_CALLBACK_E,JSON.stringify({error:null==t?void 0:t.stack,pos:"sendMsgBefore"}))}}),this._callMain("sendMessage",t,e,n,s,r)},e.prototype.sendReadReceiptMessage=function(t,e,n){return this._callMain("sendReadReceiptMessage",t,e,n)},e.prototype.getMessageReader=function(t,e,n){return this._callMain("getMessageReader",t,e,n)},e.prototype.sendReadReceiptMessageV4=function(t,e,n){return this._callMain("sendReadReceiptMessageV4",t,e,n)},e.prototype.getMessageReadReceiptV4=function(t,e){return this._callMain("getMessageReadReceiptV4",t,e)},e.prototype.batchGetMessageReadReceiptInfoV4=function(t,e){return Promise.resolve({code:s.NOT_SUPPORT})},e.prototype.updateConversationReadTime=function(t,e){return this._callMain("updateConversationReadTime",t,e)},e.prototype.disconnect=function(t){return h(this,void 0,void 0,(function(){return _(this,(function(e){return this._send2Main("disconnect",t),[2]}))}))},e.prototype.pullUserSettings=function(t){return this._callMain("pullUserSettings",t)},e.prototype.registerMessageType=function(t,e,n,o,r){this._send2Main("registerMessageType",t,e,n,o,r)},e.prototype.joinChatroom=function(t,e){return this._callMain("joinChatroom",t,e)},e.prototype.joinExistChatroom=function(t,e){return this._callMain("joinExistChatroom",t,e)},e.prototype.quitChatroom=function(t){return this._callMain("quitChatroom",t)},e.prototype.getChatroomInfo=function(t,e,n){return this._callMain("getChatroomInfo",t,e,n)},e.prototype.getChatroomHistoryMessages=function(t,e,n,o){return this._callMain("getChatroomHistoryMessages",t,e,n,o)},e.prototype.setChatroomEntry=function(t,e){return this._callMain("setChatroomEntry",t,e)},e.prototype.setChatroomEntries=function(t,e){return this._callMain("setChatroomEntries",t,e)},e.prototype.forceSetChatroomEntry=function(t,e){return this._callMain("forceSetChatroomEntry",t,e)},e.prototype.removeChatroomEntry=function(t,e){return this._callMain("removeChatroomEntry",t,e)},e.prototype.forceRemoveChatroomEntry=function(t,e){return this._callMain("forceRemoveChatroomEntry",t,e)},e.prototype.removeChatroomEntries=function(t,e){return this._callMain("removeChatroomEntries",t,e)},e.prototype.getChatroomEntry=function(t,e){return this._callMain("getChatroomEntry",t,e)},e.prototype.getAllChatroomEntry=function(t){return this._callMain("getAllChatroomEntry",t)},e.prototype.getFileToken=function(t,e,n,o,r){return this._callMain("getFileToken",t,e,n,o,r)},e.prototype.getFileUrl=function(t,e,n,o){return this._callMain("getFileUrl",t,e,n,o)},e.prototype.setUserStatus=function(t){return this._callMain("setUserStatus",t)},e.prototype.subscribeUserStatus=function(t){return this._callMain("subscribeUserStatus",t)},e.prototype.getUserStatus=function(t){return this._callMain("getUserStatus",t)},e.prototype.clearConversations=function(t,e){return this._callMain("clearConversations",t,e)},e.prototype.addToBlacklist=function(t){return this._callMain("addToBlacklist",t)},e.prototype.removeFromBlacklist=function(t){return this._callMain("removeFromBlacklist",t)},e.prototype.getBlacklist=function(){return this._callMain("getBlacklist")},e.prototype.getBlacklistStatus=function(t){return this._callMain("getBlacklistStatus",t)},e.prototype.insertMessage=function(t,e,n){return this._callMain("insertMessage",t,e,n)},e.prototype.batchInsertMessage=function(t,e){return this._callMain("batchInsertMessage",t,e)},e.prototype.getMessageCount=function(t,e,n){return this._callMain("getMessageCount",t,e,n)},e.prototype.deleteMessages=function(t){return this._callMain("deleteMessages",t)},e.prototype.deleteMessagesByTimestamp=function(t,e,n,o,r){return this._callMain("deleteMessagesByTimestamp",t,e,n,o,r)},e.prototype.batchClearMessagesByTimestamp=function(t){return this._callMain("batchClearMessagesByTimestamp",t)},e.prototype.batchClearRemoteHistoryMessages=function(t,e){return this._callMain("batchClearRemoteHistoryMessages",t,e)},e.prototype.clearMessages=function(t,e,n){return this._callMain("clearMessages",t,e,n)},e.prototype.getMessage=function(t){return this._callMain("getMessage",t)},e.prototype.setMessageContent=function(t,e,n){return this._callMain("setMessageContent",t,e,n)},e.prototype.setMessageSearchField=function(t,e,n){return this._callMain("setMessageSearchField",t,e,n)},e.prototype.searchConversationByContent=function(t,e,n,o){return this._callMain("searchConversationByContent",t,e,n,o)},e.prototype.searchConversationByContentWithAllChannel=function(t,e,n){return this._callMain("searchConversationByContentWithAllChannel",t,e,n)},e.prototype.searchMessageByContentWithAllChannel=function(t,e,n,o,r){return this._callMain("searchMessageByContentWithAllChannel",t,e,n,o,r)},e.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(t,e,n,o,r,i,a){return this._callMain("searchMessageByContentInTimeRangeWithAllChannel",t,e,n,o,r,i,a)},e.prototype.searchMessageByContent=function(t,e,n,o,r,i,a){return this._callMain("searchMessageByContent",t,e,n,o,r,i,a)},e.prototype.searchMessageByContentAndMessageType=function(t,e,n,o,r,i,a){return this._callMain("searchMessageByContentAndMessageType",t,e,n,o,r,i,a)},e.prototype.searchMessagesByUser=function(t,e,n,o,r,i){return this._callMain("searchMessagesByUser",t,e,n,o,r,i)},e.prototype.getMessagesByTimestamp=function(t,e,n,o){return this._callMain("getMatchedMessage",t,e,n,o)},e.prototype.getUnreadMentionedMessages=function(t,e,n){return this._callMainSync("getUnreadMentionedMessages",t,e,n)},e.prototype.setMessageSentStatus=function(t,e){return this._callMain("setMessageSentStatus",t,e)},e.prototype.setMessageReceivedStatus=function(t,e){return this._callMain("setMessageReceivedStatus",t,e)},e.prototype.updateMessageReceiptStatus=function(t,e,n,o){return this._callMain("updateMessageReceiptStatus",t,e,n,o)},e.prototype.clearUnreadCountByTimestamp=function(t,e,n,o){return this._callMain("clearUnreadCountByTimestamp",t,e,n,o)},e.prototype.clearAllUnreadCount=function(){throw new Error("Method not implemented.")},e.prototype.getConversationNotificationStatus=function(t,e,n){return this._callMain("getConversationNotificationStatus",t,e,n)},e.prototype.getRemoteHistoryMessages=function(t,e,n,o,r,i){return this._callMain("getRemoteHistoryMessages",t,e,n,o,r,i)},e.prototype.getServerTime=function(){return Date.now()-this._cache.deltaTime},e.prototype.getDeviceId=function(){return this._cache.deviceId},e.prototype.getCurrentUserId=function(){return this._cache.crtUserId},e.prototype.bindRTCRoomForChatroom=function(t){return this._callMain("bindRTCRoomForChatroom",t)},e.prototype.rtcSignaling=function(t,e,n,o){return h(this,void 0,void 0,(function(){var r,i,a;return _(this,(function(s){switch(s.label){case 0:return[4,this._callMain("rtcSignaling",t,e,n,o)];case 1:return r=s.sent(),i=r.code,a=r.buffer,[2,{code:i,buffer:a?new Uint8Array(a):a}]}}))}))},e.prototype.rtcPing=function(t,e,n){return this._callMain("rtcPing",t,e,n)},e.prototype.createTag=function(t){return this._callMain("createTag",t)},e.prototype.removeTag=function(t){return this._callMain("removeTag",t)},e.prototype.updateTag=function(t){return this._callMain("updateTag",t)},e.prototype.getTagList=function(){return this._callMain("getTagList")},e.prototype.addTagForConversations=function(t,e){return this._callMain("addTagForConversations",t,e)},e.prototype.removeTagForConversations=function(t,e){return this._callMain("removeTagForConversations",t,e)},e.prototype.removeTagsForConversation=function(t,e){return this._callMain("removeTagsForConversation",t,e)},e.prototype.getConversationListByTag=function(t,e,n,o){return this._callMain("getConversationListByTag",t,e,n,o)},e.prototype.getUnreadCountByTag=function(t,e){return this._callMain("getUnreadCountByTag",t,e)},e.prototype.setConversationStatusInTag=function(t,e,n){return this._callMain("setConversationStatusInTag",t,e,n)},e.prototype.getTagsForConversation=function(t){return this._callMain("getTagsForConversation",t)},e.prototype.clearData=function(){return this._callMain("clearData")},e.prototype.getBlockConversationList=function(){throw new Error("Method not implemented.")},e.prototype.getGroupMessageDeliverList=function(t,e,n){return this._callMain("getGroupMessageDeliverList",t,e,n)},e.prototype.getPrivateMessageDeliverTime=function(t,e){return this._callMain("getPrivateMessageDeliverTime",t,e)},e.prototype.setCallInfo=function(t,e,n){return this._callMain("setCallInfo",t,e,n)},e.prototype.getTopConversationList=function(t,e){return this._callMain("getTopConversationList",t,e)},e.prototype.getUnreadMentionedCount=function(t){throw new Error("Method not implemented.")},e.prototype.getAllUnreadMentionedCount=function(){return this._callMain("getAllUnreadMentionedCount")},e.prototype.getAllConversationState=function(){throw new Error("Method not implemented.")},e.prototype.getUltraGroupList=function(){throw new Error("Method not implemented.")},e.prototype.getBlockUltraGroupList=function(){throw new Error("Method not implemented.")},e.prototype.getTopUltraGroupList=function(){throw new Error("Method not implemented.")},e.prototype.clearUltraUnreadcount=function(t,e){throw new Error("Method not implemented.")},e.prototype.getUltraGroupUnreadMentionedCountByTargetId=function(t,e){throw new Error("Method not implemented.")},e.prototype.sendUltraMessage=function(t,e,n){throw new Error("Method not implemented.")},e.prototype.sendUltraGroupTypingStatus=function(t,e){throw new Error("Method not implemented.")},e.prototype.getUltraGroupMessageListByMessageUId=function(t){throw new Error("Method not implemented.")},e.prototype.expandUltraMessage=function(t){throw new Error("Method not implemented.")},e.prototype.modifyMessage=function(t){throw new Error("Method not implemented.")},e.prototype.getUltraHistoryMsg=function(t,e){throw new Error("Method not implemented.")},e.prototype.getConversationNotificationLevel=function(t,e,n){return this._callMain("getConversationNotificationLevel",t,e,n)},e.prototype.setConversationNotificationLevel=function(t,e,n,o){return this._callMain("setConversationNotificationLevel",t,e,n,o)},e.prototype.batchSetConversationNotificationLevel=function(t,e){return this._callMain("batchSetConversationNotificationLevel",t,e)},e.prototype.setConversationTypeNotificationLevel=function(t,e){return this._callMain("setConversationTypeNotificationLevel",t,e)},e.prototype.getConversationTypeNotificationLevel=function(t){return this._callMain("getConversationTypeNotificationLevel",t)},e.prototype.getUltraGroupDefaultNotificationLevel=function(t,e){return Promise.resolve({code:s.NOT_SUPPORT})},e.prototype.getAllUltraGroupUnreadCount=function(){return Promise.resolve({code:s.NOT_SUPPORT})},e.prototype.getUltraGroupUnreadCountByTargetId=function(){return Promise.resolve({code:s.NOT_SUPPORT})},e.prototype.setUltraGroupDefaultNotificationLevel=function(){return Promise.resolve({code:s.NOT_SUPPORT})},e.prototype.getUltraGroupUnreadMentionedMessages=function(){return Promise.resolve({code:s.NOT_SUPPORT})},e.prototype.getUltraGroupFirstUnreadMessageTimestamp=function(){return Promise.resolve({code:s.NOT_SUPPORT})},e.prototype.getUltraGroupUnreadInfoList=function(){return Promise.resolve({code:s.NOT_SUPPORT})},e.prototype.getOSInfo=function(){return h(this,void 0,void 0,(function(){return _(this,(function(t){return[2,this._callMain("getOSInfo")]}))}))},e.prototype.getProcessInfo=function(){return h(this,void 0,void 0,(function(){return _(this,(function(t){return[2,{code:s.SUCCESS,data:{title:window.__ContextBridge__.getProcessInfo("title"),pid:window.__ContextBridge__.getProcessInfo("pid"),ppid:window.__ContextBridge__.getProcessInfo("ppid"),platform:window.__ContextBridge__.getProcessInfo("platform"),arch:window.__ContextBridge__.getProcessInfo("arch"),uptime:window.__ContextBridge__.callProcessMethod("uptime"),cpuUsage:window.__ContextBridge__.callProcessMethod("cpuUsage"),memoryUsage:window.__ContextBridge__.callProcessMethod("cpuUsage"),resourceUsage:window.__ContextBridge__.callProcessMethod("cpuUsage")}}]}))}))},e.prototype.getMainProcessInfo=function(){return h(this,void 0,void 0,(function(){return _(this,(function(t){return[2,this._callMain("getMainProcessInfo")]}))}))},e.prototype.setProxy=function(t){return this._callMain("setProxy",t)},e.prototype.getProxy=function(){return this._callMain("getProxy")},e.prototype.testProxy=function(t,e){return this._callMain("testProxy",t,e)},e.prototype.setCheckDuplicateMessage=function(t){return this._callMain("checkDuplicateMessage",t)},e.prototype.setNetwork=function(t,e){window.__ContextBridge__.send("__RC_CHANNEL_SEND_2_MAIN__","onRendererNetworkStatusReceived",t,e)},e.prototype.subscribeUser=function(t,e,n){return this._callMain("subscribeUser",t,e,n)},e.prototype.unSubscribeUser=function(t,e){return this._callMain("unSubscribeUser",t,e)},e.prototype.getSubscribeUserList=function(t,e,n){return this._callMain("getSubscribeUserList",t,e,n)},e.prototype.getSubscribeUserStatus=function(t,e){return this._callMain("getSubscribeUserStatus",t,e)},e}(u),T={on:function(e,n){t.on(e,(function(t){for(var e=[],o=1;o<arguments.length;o++)e[o-1]=arguments[o];n.apply(void 0,f([t],e,!1))}))},send:function(e){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];t.send.apply(t,f([e],n,!1))},sendSync:function(e){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];return t.sendSync.apply(t,f([e],n,!1))},getProcessInfo:function(t){return process[t]},callProcessMethod:function(t){for(var e,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];return(e=process)[t].apply(e,n)}};window&&(window.RCCppEngine=m,window.__ContextBridge__=T);var w=function(){e&&e.exposeInMainWorld("__ContextBridge__",T)};export{m as RCCppEngine,w as initContextBridge};
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("electron"),e=require("@rongcloud/engine"),n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},n(t,e)};function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}function r(t,e,n,o){return new(n||(n=Promise))((function(r,i){function a(t){try{c(o.next(t))}catch(t){i(t)}}function s(t){try{c(o.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}c((o=o.apply(t,e||[])).next())}))}function i(t,e){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function a(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var s="logdata",c=function(t){function e(e,n,o,r){var i=t.call(this,e,n,o)||this;return i.emiter=r,i}return o(e,t),e.prototype.flush=function(t){this.emiter.emit(s,t)},e}(e.BasicLogger),l=function(t){function e(e,n,o,r){var i=t.call(this,e,n,o)||this;return i.emiter=r,i}return o(e,t),e.prototype.flush=function(t){this.emiter.emit("logdata",t)},e}(e.BasicStatistic),u=0,p=Date.now();e.VersionManage.add("electron-renderer","5.9.7");var g=function(t){function n(n,o,r,i){var a=this,u=new e.EventEmitter,p=new c(i.appkey,"RC-E","IM",u),g=new l(i.appkey,"RC-E","IM",u);return(a=t.call(this,n,o,r,i,p,g)||this).waitingLogs=[],a.latestSendTimestamp=0,a._resolveMaps={},u.on(s,(function(t){a.waitingLogs.push(t),a.check2SendLog()})),a._logEmitter=u,p.setOutputLevel(i.logOutputLevel),window.__ContextBridge__.on("__RC_CHANNEL_NOTIFICATION_FROM_MAIN__",(function(t,n){for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];var s=r[n];if(s){var c={batchMessage:a._batchMessage.bind(a),onRTCDataChange:a._onRTCDataChange.bind(a),onConnected:a._onConnected.bind(a),onNaviDataChange:a._onNaviDataChange.bind(a)};if(c[n])c[n](o,s);else{var l={onConnecting:e.RCConnectionStatus.CONNECTING,onSuspend:e.RCConnectionStatus.SUSPENDED,onDisconnected:e.RCConnectionStatus.DISCONNECTED};l[n]&&a._setConnectionStatus(l[n]),s(o[0])}}else a.logger.error(e.LogTagId.L_UNSUPPORT_NTF_FROM_MAIN_E,n)})),window.__ContextBridge__.on("__RC_CHANNEL_RESULT_FROM_MAIN__",(function(t,e){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];var r=a._resolveMaps[e];r&&(delete a._resolveMaps[e],r.apply(void 0,n))})),a._options.httpInMainProcess&&(n.httpReq=a.sendHTTPRequest.bind(a)),window.__ContextBridge__.send("__RC_INNER_COMMAND_INIT__",{navigators:i.navigators,areaCode:i.areaCode,logServerUrl:i.logServerUrl}),a._cache=a._callMainSync("getMainProcessCache"),a}return o(n,t),n.prototype._batchMessage=function(t,e){var n=t[0].hasMoreMsg;delete t[0].hasMoreMsg,e([t[0]],void 0,n)},n.prototype._onRTCDataChange=function(t,e){var n=t[0];this._receiveRtcKv(new Uint8Array(n))},n.prototype._onConnected=function(t,e){this._cache=t[0],e(void 0)},n.prototype._onNaviDataChange=function(t,e){this._cache.naviInfo=t[0],e([t[0]])},n.prototype._setConnectionStatus=function(t){this._cache.connectionStatus=t},n.prototype.check2SendLog=function(){var t=Date.now();t-this.latestSendTimestamp<1e3||(this.logger.debug(e.LogTagId.T,"send logs 2 main -> "+this.waitingLogs.length),window.__ContextBridge__.send("__RC_CHANNEL_SEND_2_MAIN__","onRendererLogsReceived",this.waitingLogs.splice(0)),this.latestSendTimestamp=t)},n.prototype.sendHTTPRequest=function(t){return this._callMain("sendHTTPRequest",t)},n.prototype.setUserStatusListener=function(t,e){throw new Error("TODO -> RCCppEngine.setUserStatusListener")},n.prototype._callMain=function(t){for(var e=this,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];var r=new Promise((function(o){var r,i=function(t){var e=Date.now();return p!==e&&(p=e,u=0),[t,window.__ContextBridge__.getProcessInfo("pid"),e,u++].join("__")}(t);e._resolveMaps[i]=o,(r=window.__ContextBridge__).send.apply(r,a(["__RC_CHANNEL_CALL_MAIN__",i,t],n,!1))}));return r},n.prototype.callExtra=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return this._callMain.apply(this,a(["callExtra",t],e,!1))},n.prototype._send2Main=function(t){for(var e,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];(e=window.__ContextBridge__).send.apply(e,a(["__RC_CHANNEL_SEND_2_MAIN__",t],n,!1))},n.prototype._callMainSync=function(t){for(var n,o=[],r=1;r<arguments.length;r++)o[r-1]=arguments[r];return this.logger.info(e.LogTagId.L_CALL_MAIN_SYNC_O,t),(n=window.__ContextBridge__).sendSync.apply(n,a(["__RC_CHANNEL_CALL_MAIN_SYNC__",t],o,!1))},n.prototype.refetchNaviInfo=function(){return this._callMain("refetchNaviInfo")},n.prototype.getNaviInfoFromCache=function(){return this._cache.naviInfo},n.prototype.createLogger=function(t,e){return new c(this._appkey,t,e,this._logEmitter)},n.prototype.createStatisticLogger=function(t,e){return new l(this._appkey,t,e,this._logEmitter)},n.prototype.getConnectionStatus=function(){return this._cache.connectionStatus},n.prototype.connect=function(t,e,n,o){return r(this,void 0,void 0,(function(){return i(this,(function(r){return[2,this._callMain("connect",t,e,n,o)]}))}))},n.prototype.reportSDKInfo=function(t){this._send2Main("reportSDKInfo",t)},n.prototype.getConnectedTime=function(){return this._cache.connectedTime},n.prototype.getHistoryMessage=function(t,e,n,o,r,i,a){return this._callMain("getHistoryMessage",t,e,n,o,r,i,a)},n.prototype.getMessages=function(t,e,n,o,r,i){return this._callMain("getMessages",t,e,n,o,r,i)},n.prototype.getContinuousMessages=function(t,e,n,o,r,i){return this._callMain("getContinuousMessages",t,e,n,o,r,i)},n.prototype.getHistoryMessagesByObjectNames=function(t,e,n,o,r,i,a){return this._callMain("getHistoryMessagesByObjectNames",t,e,n,o,r,i,a)},n.prototype.deleteRemoteMessage=function(t,e,n,o){return this._callMain("deleteRemoteMessage",t,e,n,o)},n.prototype.recallMsg=function(t,e,n,o,r){return this._callMain("recallMsg",t,e,n,o,r)},n.prototype.deleteRemoteMessageByTimestamp=function(t,e,n,o){return this._callMain("deleteRemoteMessageByTimestamp",t,e,n,o)},n.prototype.getConversationList=function(t,e,n,o,r){return this._callMain("getConversationList",t,e,n,o,r)},n.prototype.getConversationsByPage=function(t,e,n,o,r){return this._callMain("getConversationsByPage",t,e,n,o,r)},n.prototype.getUnreadConversationList=function(t){return this._callMain("getUnreadConversationList",t)},n.prototype.getConversationListWithAllChannel=function(){return this._callMain("getConversationListWithAllChannel")},n.prototype.getConversationListWithAllChannelByPage=function(t,e){return this._callMain("getConversationListWithAllChannelByPage",t,e)},n.prototype.getConversation=function(t,e,n){return this._callMain("getConversation",t,e,n)},n.prototype.removeConversation=function(t,e,n){return this._callMain("removeConversation",t,e,n)},n.prototype.batchRemoveConversation=function(t){return this._callMain("batchRemoveConversation",t)},n.prototype.getAllConversationUnreadCount=function(t,e,n){return this._callMain("getAllConversationUnreadCount",t,e,n)},n.prototype.getConversationUnreadCount=function(t,e,n){return this._callMain("getConversationUnreadCount",t,e,n)},n.prototype.getTotalUnreadCountByLevels=function(t,e,n){return this._callMain("getTotalUnreadCountByLevels",t,e,n)},n.prototype.clearConversationUnreadCount=function(t,e,n){return this._callMain("clearConversationUnreadCount",t,e,n)},n.prototype.getFirstUnreadMessage=function(t,e,n){return this._callMain("getFirstUnreadMessage",t,e,n)},n.prototype.getFirstUnreadMessageInfo=function(t,e,n){return this._callMain("getFirstUnreadMessageInfo",t,e,n)},n.prototype.saveConversationMessageDraft=function(t,e,n){return this._callMain("saveConversationMessageDraft",t,e,n)},n.prototype.getConversationMessageDraft=function(t,e){return this._callMain("getConversationMessageDraft",t,e)},n.prototype.clearConversationMessageDraft=function(t,e){return this._callMain("clearConversationMessageDraft",t,e)},n.prototype.pullConversationStatus=function(t){return this._callMain("pullConversationStatus",t)},n.prototype.batchSetConversationStatus=function(t){var n=t[0].notificationLevel;return e.isUndefined(n)?this._callMain("batchSetConversationStatus",t):Promise.resolve(e.ErrorCode.NOT_SUPPORT)},n.prototype.batchSetConversationToTop=function(t,e,n){return this._callMain("batchSetConversationToTop",t,e,n)},n.prototype.sendMessage=function(t,n,o,r,i){var a=this,s=["sendMessageBefore",Date.now(),Math.floor(Math.random()*Date.now())].join("_");return r&&(this._resolveMaps[s]=function(t){try{r(t)}catch(t){a.logger.error(e.LogTagId.A_CALLBACK_E,JSON.stringify({error:null==t?void 0:t.stack,pos:"sendMsgBefore"}))}}),this._callMain("sendMessage",t,n,o,s,i)},n.prototype.sendReadReceiptMessage=function(t,e,n){return this._callMain("sendReadReceiptMessage",t,e,n)},n.prototype.getMessageReader=function(t,e,n){return this._callMain("getMessageReader",t,e,n)},n.prototype.sendReadReceiptMessageV4=function(t,e,n){return this._callMain("sendReadReceiptMessageV4",t,e,n)},n.prototype.getMessageReadReceiptV4=function(t,e){return this._callMain("getMessageReadReceiptV4",t,e)},n.prototype.batchGetMessageReadReceiptInfoV4=function(t,n){return Promise.resolve({code:e.ErrorCode.NOT_SUPPORT})},n.prototype.updateConversationReadTime=function(t,e){return this._callMain("updateConversationReadTime",t,e)},n.prototype.disconnect=function(t){return r(this,void 0,void 0,(function(){return i(this,(function(e){return this._send2Main("disconnect",t),[2]}))}))},n.prototype.pullUserSettings=function(t){return this._callMain("pullUserSettings",t)},n.prototype.registerMessageType=function(t,e,n,o,r){this._send2Main("registerMessageType",t,e,n,o,r)},n.prototype.joinChatroom=function(t,e){return this._callMain("joinChatroom",t,e)},n.prototype.joinExistChatroom=function(t,e){return this._callMain("joinExistChatroom",t,e)},n.prototype.quitChatroom=function(t){return this._callMain("quitChatroom",t)},n.prototype.getChatroomInfo=function(t,e,n){return this._callMain("getChatroomInfo",t,e,n)},n.prototype.getChatroomHistoryMessages=function(t,e,n,o){return this._callMain("getChatroomHistoryMessages",t,e,n,o)},n.prototype.setChatroomEntry=function(t,e){return this._callMain("setChatroomEntry",t,e)},n.prototype.setChatroomEntries=function(t,e){return this._callMain("setChatroomEntries",t,e)},n.prototype.forceSetChatroomEntry=function(t,e){return this._callMain("forceSetChatroomEntry",t,e)},n.prototype.removeChatroomEntry=function(t,e){return this._callMain("removeChatroomEntry",t,e)},n.prototype.forceRemoveChatroomEntry=function(t,e){return this._callMain("forceRemoveChatroomEntry",t,e)},n.prototype.removeChatroomEntries=function(t,e){return this._callMain("removeChatroomEntries",t,e)},n.prototype.getChatroomEntry=function(t,e){return this._callMain("getChatroomEntry",t,e)},n.prototype.getAllChatroomEntry=function(t){return this._callMain("getAllChatroomEntry",t)},n.prototype.getFileToken=function(t,e,n,o,r){return this._callMain("getFileToken",t,e,n,o,r)},n.prototype.getFileUrl=function(t,e,n,o){return this._callMain("getFileUrl",t,e,n,o)},n.prototype.setUserStatus=function(t){return this._callMain("setUserStatus",t)},n.prototype.subscribeUserStatus=function(t){return this._callMain("subscribeUserStatus",t)},n.prototype.getUserStatus=function(t){return this._callMain("getUserStatus",t)},n.prototype.clearConversations=function(t,e){return this._callMain("clearConversations",t,e)},n.prototype.addToBlacklist=function(t){return this._callMain("addToBlacklist",t)},n.prototype.removeFromBlacklist=function(t){return this._callMain("removeFromBlacklist",t)},n.prototype.getBlacklist=function(){return this._callMain("getBlacklist")},n.prototype.getBlacklistStatus=function(t){return this._callMain("getBlacklistStatus",t)},n.prototype.insertMessage=function(t,e,n){return this._callMain("insertMessage",t,e,n)},n.prototype.batchInsertMessage=function(t,e){return this._callMain("batchInsertMessage",t,e)},n.prototype.getMessageCount=function(t,e,n){return this._callMain("getMessageCount",t,e,n)},n.prototype.deleteMessages=function(t){return this._callMain("deleteMessages",t)},n.prototype.deleteMessagesByTimestamp=function(t,e,n,o,r){return this._callMain("deleteMessagesByTimestamp",t,e,n,o,r)},n.prototype.batchClearMessagesByTimestamp=function(t){return this._callMain("batchClearMessagesByTimestamp",t)},n.prototype.batchClearRemoteHistoryMessages=function(t,e){return this._callMain("batchClearRemoteHistoryMessages",t,e)},n.prototype.clearMessages=function(t,e,n){return this._callMain("clearMessages",t,e,n)},n.prototype.getMessage=function(t){return this._callMain("getMessage",t)},n.prototype.setMessageContent=function(t,e,n){return this._callMain("setMessageContent",t,e,n)},n.prototype.setMessageSearchField=function(t,e,n){return this._callMain("setMessageSearchField",t,e,n)},n.prototype.searchConversationByContent=function(t,e,n,o){return this._callMain("searchConversationByContent",t,e,n,o)},n.prototype.searchConversationByContentWithAllChannel=function(t,e,n){return this._callMain("searchConversationByContentWithAllChannel",t,e,n)},n.prototype.searchMessageByContentWithAllChannel=function(t,e,n,o,r){return this._callMain("searchMessageByContentWithAllChannel",t,e,n,o,r)},n.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(t,e,n,o,r,i,a){return this._callMain("searchMessageByContentInTimeRangeWithAllChannel",t,e,n,o,r,i,a)},n.prototype.searchMessageByContent=function(t,e,n,o,r,i,a){return this._callMain("searchMessageByContent",t,e,n,o,r,i,a)},n.prototype.searchMessagesByUser=function(t,e,n,o,r,i){return this._callMain("searchMessagesByUser",t,e,n,o,r,i)},n.prototype.getUnreadMentionedMessages=function(t,e,n){return this._callMainSync("getUnreadMentionedMessages",t,e,n)},n.prototype.setMessageSentStatus=function(t,e){return this._callMain("setMessageSentStatus",t,e)},n.prototype.setMessageReceivedStatus=function(t,e){return this._callMain("setMessageReceivedStatus",t,e)},n.prototype.updateMessageReceiptStatus=function(t,e,n,o){return this._callMain("updateMessageReceiptStatus",t,e,n,o)},n.prototype.clearUnreadCountByTimestamp=function(t,e,n,o){return this._callMain("clearUnreadCountByTimestamp",t,e,n,o)},n.prototype.clearAllUnreadCount=function(){throw new Error("Method not implemented.")},n.prototype.getConversationNotificationStatus=function(t,e,n){return this._callMain("getConversationNotificationStatus",t,e,n)},n.prototype.getRemoteHistoryMessages=function(t,e,n,o,r,i){return this._callMain("getRemoteHistoryMessages",t,e,n,o,r,i)},n.prototype.getServerTime=function(){return Date.now()-this._cache.deltaTime},n.prototype.getDeviceId=function(){return this._cache.deviceId},n.prototype.getCurrentUserId=function(){return this._cache.crtUserId},n.prototype.bindRTCRoomForChatroom=function(t){return this._callMain("bindRTCRoomForChatroom",t)},n.prototype.rtcSignaling=function(t,e,n,o){return r(this,void 0,void 0,(function(){var r,a,s;return i(this,(function(i){switch(i.label){case 0:return[4,this._callMain("rtcSignaling",t,e,n,o)];case 1:return r=i.sent(),a=r.code,s=r.buffer,[2,{code:a,buffer:s?new Uint8Array(s):s}]}}))}))},n.prototype.rtcPing=function(t,e,n){return this._callMain("rtcPing",t,e,n)},n.prototype.createTag=function(t){return this._callMain("createTag",t)},n.prototype.removeTag=function(t){return this._callMain("removeTag",t)},n.prototype.updateTag=function(t){return this._callMain("updateTag",t)},n.prototype.getTagList=function(){return this._callMain("getTagList")},n.prototype.addTagForConversations=function(t,e){return this._callMain("addTagForConversations",t,e)},n.prototype.removeTagForConversations=function(t,e){return this._callMain("removeTagForConversations",t,e)},n.prototype.removeTagsForConversation=function(t,e){return this._callMain("removeTagsForConversation",t,e)},n.prototype.getConversationListByTag=function(t,e,n,o){return this._callMain("getConversationListByTag",t,e,n,o)},n.prototype.getUnreadCountByTag=function(t,e){return this._callMain("getUnreadCountByTag",t,e)},n.prototype.setConversationStatusInTag=function(t,e,n){return this._callMain("setConversationStatusInTag",t,e,n)},n.prototype.getTagsForConversation=function(t){return this._callMain("getTagsForConversation",t)},n.prototype.clearData=function(){return this._callMain("clearData")},n.prototype.getBlockConversationList=function(){throw new Error("Method not implemented.")},n.prototype.getGroupMessageDeliverList=function(t,e,n){return this._callMain("getGroupMessageDeliverList",t,e,n)},n.prototype.getPrivateMessageDeliverTime=function(t,e){return this._callMain("getPrivateMessageDeliverTime",t,e)},n.prototype.setCallInfo=function(t,e,n){return this._callMain("setCallInfo",t,e,n)},n.prototype.getTopConversationList=function(t,e){return this._callMain("getTopConversationList",t,e)},n.prototype.getUnreadMentionedCount=function(t){throw new Error("Method not implemented.")},n.prototype.getAllUnreadMentionedCount=function(){return this._callMain("getAllUnreadMentionedCount")},n.prototype.getAllConversationState=function(){throw new Error("Method not implemented.")},n.prototype.getUltraGroupList=function(){throw new Error("Method not implemented.")},n.prototype.getBlockUltraGroupList=function(){throw new Error("Method not implemented.")},n.prototype.getTopUltraGroupList=function(){throw new Error("Method not implemented.")},n.prototype.clearUltraUnreadcount=function(t,e){throw new Error("Method not implemented.")},n.prototype.getUltraGroupUnreadMentionedCountByTargetId=function(t,e){throw new Error("Method not implemented.")},n.prototype.sendUltraMessage=function(t,e,n){throw new Error("Method not implemented.")},n.prototype.sendUltraGroupTypingStatus=function(t,e){throw new Error("Method not implemented.")},n.prototype.getUltraGroupMessageListByMessageUId=function(t){throw new Error("Method not implemented.")},n.prototype.expandUltraMessage=function(t){throw new Error("Method not implemented.")},n.prototype.modifyMessage=function(t){throw new Error("Method not implemented.")},n.prototype.getUltraHistoryMsg=function(t,e){throw new Error("Method not implemented.")},n.prototype.getConversationNotificationLevel=function(t,e,n){return this._callMain("getConversationNotificationLevel",t,e,n)},n.prototype.setConversationNotificationLevel=function(t,e,n,o){return this._callMain("setConversationNotificationLevel",t,e,n,o)},n.prototype.batchSetConversationNotificationLevel=function(t,e){return this._callMain("batchSetConversationNotificationLevel",t,e)},n.prototype.getUltraGroupDefaultNotificationLevel=function(t,n){return Promise.resolve({code:e.ErrorCode.NOT_SUPPORT})},n.prototype.getAllUltraGroupUnreadCount=function(){return Promise.resolve({code:e.ErrorCode.NOT_SUPPORT})},n.prototype.getUltraGroupUnreadCountByTargetId=function(){return Promise.resolve({code:e.ErrorCode.NOT_SUPPORT})},n.prototype.setUltraGroupDefaultNotificationLevel=function(){return Promise.resolve({code:e.ErrorCode.NOT_SUPPORT})},n.prototype.getUltraGroupUnreadMentionedMessages=function(){return Promise.resolve({code:e.ErrorCode.NOT_SUPPORT})},n.prototype.getUltraGroupFirstUnreadMessageTimestamp=function(){return Promise.resolve({code:e.ErrorCode.NOT_SUPPORT})},n.prototype.getUltraGroupUnreadInfoList=function(){return Promise.resolve({code:e.ErrorCode.NOT_SUPPORT})},n.prototype.getOSInfo=function(){return r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this._callMain("getOSInfo")]}))}))},n.prototype.getProcessInfo=function(){return r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,{code:e.ErrorCode.SUCCESS,data:{title:window.__ContextBridge__.getProcessInfo("title"),pid:window.__ContextBridge__.getProcessInfo("pid"),ppid:window.__ContextBridge__.getProcessInfo("ppid"),platform:window.__ContextBridge__.getProcessInfo("platform"),arch:window.__ContextBridge__.getProcessInfo("arch"),uptime:window.__ContextBridge__.callProcessMethod("uptime"),cpuUsage:window.__ContextBridge__.callProcessMethod("cpuUsage"),memoryUsage:window.__ContextBridge__.callProcessMethod("cpuUsage"),resourceUsage:window.__ContextBridge__.callProcessMethod("cpuUsage")}}]}))}))},n.prototype.getMainProcessInfo=function(){return r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this._callMain("getMainProcessInfo")]}))}))},n.prototype.setProxy=function(t){return this._callMain("setProxy",t)},n.prototype.getProxy=function(){return this._callMain("getProxy")},n.prototype.testProxy=function(t,e){return this._callMain("testProxy",t,e)},n.prototype.setCheckDuplicateMessage=function(t){return this._callMain("checkDuplicateMessage",t)},n.prototype.setNetwork=function(t,e){window.__ContextBridge__.send("__RC_CHANNEL_SEND_2_MAIN__","onRendererNetworkStatusReceived",t,e)},n}(e.AEngine),h={on:function(e,n){t.ipcRenderer.on(e,(function(t){for(var e=[],o=1;o<arguments.length;o++)e[o-1]=arguments[o];n.apply(void 0,a([t],e,!1))}))},send:function(e){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];t.ipcRenderer.send.apply(t.ipcRenderer,a([e],n,!1))},sendSync:function(e){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];return t.ipcRenderer.sendSync.apply(t.ipcRenderer,a([e],n,!1))},getProcessInfo:function(t){return process[t]},callProcessMethod:function(t){for(var e,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];return(e=process)[t].apply(e,n)}};window&&(window.RCCppEngine=g,window.__ContextBridge__=h);exports.RCCppEngine=g,exports.initContextBridge=function(){t.contextBridge&&t.contextBridge.exposeInMainWorld("__ContextBridge__",h)};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("electron"),e=require("@rongcloud/engine"),n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},n(t,e)};function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}function r(t,e,n,o){return new(n||(n=Promise))((function(r,i){function a(t){try{c(o.next(t))}catch(t){i(t)}}function s(t){try{c(o.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}c((o=o.apply(t,e||[])).next())}))}function i(t,e){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function a(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var s="logdata",c=function(t){function e(e,n,o,r){var i=t.call(this,e,n,o)||this;return i.emiter=r,i}return o(e,t),e.prototype.flush=function(t){this.emiter.emit(s,t)},e}(e.BasicLogger),l=function(t){function e(e,n,o,r){var i=t.call(this,e,n,o)||this;return i.emiter=r,i}return o(e,t),e.prototype.flush=function(t){this.emiter.emit("logdata",t)},e}(e.BasicStatistic),u=0,p=Date.now();e.VersionManage.add("electron-renderer","5.9.8-alpha.2");var g=function(t){function n(n,o,r,i){var a=this,u=new e.EventEmitter,p=new c(i.appkey,"RC-E","IM",u),g=new l(i.appkey,"RC-E","IM",u);return(a=t.call(this,n,o,r,i,p,g)||this).waitingLogs=[],a.latestSendTimestamp=0,a._resolveMaps={},u.on(s,(function(t){a.waitingLogs.push(t),a.check2SendLog()})),a._logEmitter=u,p.setOutputLevel(i.logOutputLevel),window.__ContextBridge__.on("__RC_CHANNEL_NOTIFICATION_FROM_MAIN__",(function(t,n){for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];var s=r[n];if(s){var c={batchMessage:a._batchMessage.bind(a),onRTCDataChange:a._onRTCDataChange.bind(a),onConnected:a._onConnected.bind(a),onNaviDataChange:a._onNaviDataChange.bind(a)};if(c[n])c[n](o,s);else{var l={onConnecting:e.RCConnectionStatus.CONNECTING,onSuspend:e.RCConnectionStatus.SUSPENDED,onDisconnected:e.RCConnectionStatus.DISCONNECTED};l[n]&&a._setConnectionStatus(l[n]),s(o[0])}}else a.logger.error(e.LogTagId.L_UNSUPPORT_NTF_FROM_MAIN_E,n)})),window.__ContextBridge__.on("__RC_CHANNEL_RESULT_FROM_MAIN__",(function(t,e){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];var r=a._resolveMaps[e];r&&(delete a._resolveMaps[e],r.apply(void 0,n))})),a._options.httpInMainProcess&&(n.httpReq=a.sendHTTPRequest.bind(a)),window.__ContextBridge__.send("__RC_INNER_COMMAND_INIT__",{navigators:i.navigators,areaCode:i.areaCode,logServerUrl:i.logServerUrl,environment:i.environment}),a._cache=a._callMainSync("getMainProcessCache"),a}return o(n,t),n.prototype._batchMessage=function(t,e){var n=t[0].hasMoreMsg;delete t[0].hasMoreMsg,e([t[0]],void 0,n)},n.prototype._onRTCDataChange=function(t,e){var n=t[0];this._receiveRtcKv(new Uint8Array(n))},n.prototype._onConnected=function(t,e){this._cache=t[0],e(void 0)},n.prototype._onNaviDataChange=function(t,e){this._cache.naviInfo=t[0],e([t[0]])},n.prototype._setConnectionStatus=function(t){this._cache.connectionStatus=t},n.prototype.check2SendLog=function(){var t=Date.now();t-this.latestSendTimestamp<1e3||(this.logger.debug(e.LogTagId.T,"send logs 2 main -> "+this.waitingLogs.length),window.__ContextBridge__.send("__RC_CHANNEL_SEND_2_MAIN__","onRendererLogsReceived",this.waitingLogs.splice(0)),this.latestSendTimestamp=t)},n.prototype.sendHTTPRequest=function(t){return this._callMain("sendHTTPRequest",t)},n.prototype.setUserStatusListener=function(t,e){throw new Error("TODO -> RCCppEngine.setUserStatusListener")},n.prototype._callMain=function(t){for(var e=this,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];var r=new Promise((function(o){var r,i=function(t){var e=Date.now();return p!==e&&(p=e,u=0),[t,window.__ContextBridge__.getProcessInfo("pid"),e,u++].join("__")}(t);e._resolveMaps[i]=o,(r=window.__ContextBridge__).send.apply(r,a(["__RC_CHANNEL_CALL_MAIN__",i,t],n,!1))}));return r},n.prototype.callExtra=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return this._callMain.apply(this,a(["callExtra",t],e,!1))},n.prototype._send2Main=function(t){for(var e,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];(e=window.__ContextBridge__).send.apply(e,a(["__RC_CHANNEL_SEND_2_MAIN__",t],n,!1))},n.prototype._callMainSync=function(t){for(var n,o=[],r=1;r<arguments.length;r++)o[r-1]=arguments[r];return this.logger.info(e.LogTagId.L_CALL_MAIN_SYNC_O,t),(n=window.__ContextBridge__).sendSync.apply(n,a(["__RC_CHANNEL_CALL_MAIN_SYNC__",t],o,!1))},n.prototype.refetchNaviInfo=function(){return this._callMain("refetchNaviInfo")},n.prototype.getNaviInfoFromCache=function(){return this._cache.naviInfo},n.prototype.createLogger=function(t,e){return new c(this._appkey,t,e,this._logEmitter)},n.prototype.createStatisticLogger=function(t,e){return new l(this._appkey,t,e,this._logEmitter)},n.prototype.getConnectionStatus=function(){return this._cache.connectionStatus},n.prototype.connect=function(t,e,n,o){return r(this,void 0,void 0,(function(){return i(this,(function(r){return[2,this._callMain("connect",t,e,n,o)]}))}))},n.prototype.reportSDKInfo=function(t){this._send2Main("reportSDKInfo",t)},n.prototype.getConnectedTime=function(){return this._cache.connectedTime},n.prototype.getHistoryMessage=function(t,e,n,o,r,i,a){return this._callMain("getHistoryMessage",t,e,n,o,r,i,a)},n.prototype.getMessages=function(t,e,n,o,r,i){return this._callMain("getMessages",t,e,n,o,r,i)},n.prototype.getContinuousMessages=function(t,e,n,o,r,i){return this._callMain("getContinuousMessages",t,e,n,o,r,i)},n.prototype.getHistoryMessagesByObjectNames=function(t,e,n,o,r,i,a){return this._callMain("getHistoryMessagesByObjectNames",t,e,n,o,r,i,a)},n.prototype.deleteRemoteMessage=function(t,e,n,o){return this._callMain("deleteRemoteMessage",t,e,n,o)},n.prototype.recallMsg=function(t,e,n,o,r){return this._callMain("recallMsg",t,e,n,o,r)},n.prototype.deleteRemoteMessageByTimestamp=function(t,e,n,o){return this._callMain("deleteRemoteMessageByTimestamp",t,e,n,o)},n.prototype.getConversationList=function(t,e,n,o,r){return this._callMain("getConversationList",t,e,n,o,r)},n.prototype.getConversationsByPage=function(t,e,n,o,r){return this._callMain("getConversationsByPage",t,e,n,o,r)},n.prototype.getUnreadConversationList=function(t){return this._callMain("getUnreadConversationList",t)},n.prototype.getConversationListWithAllChannel=function(){return this._callMain("getConversationListWithAllChannel")},n.prototype.getConversationListWithAllChannelByPage=function(t,e){return this._callMain("getConversationListWithAllChannelByPage",t,e)},n.prototype.getConversation=function(t,e,n){return this._callMain("getConversation",t,e,n)},n.prototype.removeConversation=function(t,e,n){return this._callMain("removeConversation",t,e,n)},n.prototype.batchRemoveConversation=function(t){return this._callMain("batchRemoveConversation",t)},n.prototype.getAllConversationUnreadCount=function(t,e,n){return this._callMain("getAllConversationUnreadCount",t,e,n)},n.prototype.getConversationUnreadCount=function(t,e,n){return this._callMain("getConversationUnreadCount",t,e,n)},n.prototype.getTotalUnreadCountByLevels=function(t,e,n){return this._callMain("getTotalUnreadCountByLevels",t,e,n)},n.prototype.clearConversationUnreadCount=function(t,e,n){return this._callMain("clearConversationUnreadCount",t,e,n)},n.prototype.getFirstUnreadMessage=function(t,e,n){return this._callMain("getFirstUnreadMessage",t,e,n)},n.prototype.getFirstUnreadMessageInfo=function(t,e,n){return this._callMain("getFirstUnreadMessageInfo",t,e,n)},n.prototype.saveConversationMessageDraft=function(t,e,n){return this._callMain("saveConversationMessageDraft",t,e,n)},n.prototype.getConversationMessageDraft=function(t,e){return this._callMain("getConversationMessageDraft",t,e)},n.prototype.clearConversationMessageDraft=function(t,e){return this._callMain("clearConversationMessageDraft",t,e)},n.prototype.pullConversationStatus=function(t){return this._callMain("pullConversationStatus",t)},n.prototype.batchSetConversationStatus=function(t){var n=t[0].notificationLevel;return e.isUndefined(n)?this._callMain("batchSetConversationStatus",t):Promise.resolve(e.ErrorCode.NOT_SUPPORT)},n.prototype.batchSetConversationToTop=function(t,e,n){return this._callMain("batchSetConversationToTop",t,e,n)},n.prototype.sendMessage=function(t,n,o,r,i){var a=this,s=["sendMessageBefore",Date.now(),Math.floor(Math.random()*Date.now())].join("_");return r&&(this._resolveMaps[s]=function(t){try{r(t)}catch(t){a.logger.error(e.LogTagId.A_CALLBACK_E,JSON.stringify({error:null==t?void 0:t.stack,pos:"sendMsgBefore"}))}}),this._callMain("sendMessage",t,n,o,s,i)},n.prototype.sendReadReceiptMessage=function(t,e,n){return this._callMain("sendReadReceiptMessage",t,e,n)},n.prototype.getMessageReader=function(t,e,n){return this._callMain("getMessageReader",t,e,n)},n.prototype.sendReadReceiptMessageV4=function(t,e,n){return this._callMain("sendReadReceiptMessageV4",t,e,n)},n.prototype.getMessageReadReceiptV4=function(t,e){return this._callMain("getMessageReadReceiptV4",t,e)},n.prototype.batchGetMessageReadReceiptInfoV4=function(t,n){return Promise.resolve({code:e.ErrorCode.NOT_SUPPORT})},n.prototype.updateConversationReadTime=function(t,e){return this._callMain("updateConversationReadTime",t,e)},n.prototype.disconnect=function(t){return r(this,void 0,void 0,(function(){return i(this,(function(e){return this._send2Main("disconnect",t),[2]}))}))},n.prototype.pullUserSettings=function(t){return this._callMain("pullUserSettings",t)},n.prototype.registerMessageType=function(t,e,n,o,r){this._send2Main("registerMessageType",t,e,n,o,r)},n.prototype.joinChatroom=function(t,e){return this._callMain("joinChatroom",t,e)},n.prototype.joinExistChatroom=function(t,e){return this._callMain("joinExistChatroom",t,e)},n.prototype.quitChatroom=function(t){return this._callMain("quitChatroom",t)},n.prototype.getChatroomInfo=function(t,e,n){return this._callMain("getChatroomInfo",t,e,n)},n.prototype.getChatroomHistoryMessages=function(t,e,n,o){return this._callMain("getChatroomHistoryMessages",t,e,n,o)},n.prototype.setChatroomEntry=function(t,e){return this._callMain("setChatroomEntry",t,e)},n.prototype.setChatroomEntries=function(t,e){return this._callMain("setChatroomEntries",t,e)},n.prototype.forceSetChatroomEntry=function(t,e){return this._callMain("forceSetChatroomEntry",t,e)},n.prototype.removeChatroomEntry=function(t,e){return this._callMain("removeChatroomEntry",t,e)},n.prototype.forceRemoveChatroomEntry=function(t,e){return this._callMain("forceRemoveChatroomEntry",t,e)},n.prototype.removeChatroomEntries=function(t,e){return this._callMain("removeChatroomEntries",t,e)},n.prototype.getChatroomEntry=function(t,e){return this._callMain("getChatroomEntry",t,e)},n.prototype.getAllChatroomEntry=function(t){return this._callMain("getAllChatroomEntry",t)},n.prototype.getFileToken=function(t,e,n,o,r){return this._callMain("getFileToken",t,e,n,o,r)},n.prototype.getFileUrl=function(t,e,n,o){return this._callMain("getFileUrl",t,e,n,o)},n.prototype.setUserStatus=function(t){return this._callMain("setUserStatus",t)},n.prototype.subscribeUserStatus=function(t){return this._callMain("subscribeUserStatus",t)},n.prototype.getUserStatus=function(t){return this._callMain("getUserStatus",t)},n.prototype.clearConversations=function(t,e){return this._callMain("clearConversations",t,e)},n.prototype.addToBlacklist=function(t){return this._callMain("addToBlacklist",t)},n.prototype.removeFromBlacklist=function(t){return this._callMain("removeFromBlacklist",t)},n.prototype.getBlacklist=function(){return this._callMain("getBlacklist")},n.prototype.getBlacklistStatus=function(t){return this._callMain("getBlacklistStatus",t)},n.prototype.insertMessage=function(t,e,n){return this._callMain("insertMessage",t,e,n)},n.prototype.batchInsertMessage=function(t,e){return this._callMain("batchInsertMessage",t,e)},n.prototype.getMessageCount=function(t,e,n){return this._callMain("getMessageCount",t,e,n)},n.prototype.deleteMessages=function(t){return this._callMain("deleteMessages",t)},n.prototype.deleteMessagesByTimestamp=function(t,e,n,o,r){return this._callMain("deleteMessagesByTimestamp",t,e,n,o,r)},n.prototype.batchClearMessagesByTimestamp=function(t){return this._callMain("batchClearMessagesByTimestamp",t)},n.prototype.batchClearRemoteHistoryMessages=function(t,e){return this._callMain("batchClearRemoteHistoryMessages",t,e)},n.prototype.clearMessages=function(t,e,n){return this._callMain("clearMessages",t,e,n)},n.prototype.getMessage=function(t){return this._callMain("getMessage",t)},n.prototype.setMessageContent=function(t,e,n){return this._callMain("setMessageContent",t,e,n)},n.prototype.setMessageSearchField=function(t,e,n){return this._callMain("setMessageSearchField",t,e,n)},n.prototype.searchConversationByContent=function(t,e,n,o){return this._callMain("searchConversationByContent",t,e,n,o)},n.prototype.searchConversationByContentWithAllChannel=function(t,e,n){return this._callMain("searchConversationByContentWithAllChannel",t,e,n)},n.prototype.searchMessageByContentWithAllChannel=function(t,e,n,o,r){return this._callMain("searchMessageByContentWithAllChannel",t,e,n,o,r)},n.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(t,e,n,o,r,i,a){return this._callMain("searchMessageByContentInTimeRangeWithAllChannel",t,e,n,o,r,i,a)},n.prototype.searchMessageByContent=function(t,e,n,o,r,i,a){return this._callMain("searchMessageByContent",t,e,n,o,r,i,a)},n.prototype.searchMessageByContentAndMessageType=function(t,e,n,o,r,i,a){return this._callMain("searchMessageByContentAndMessageType",t,e,n,o,r,i,a)},n.prototype.searchMessagesByUser=function(t,e,n,o,r,i){return this._callMain("searchMessagesByUser",t,e,n,o,r,i)},n.prototype.getMessagesByTimestamp=function(t,e,n,o){return this._callMain("getMatchedMessage",t,e,n,o)},n.prototype.getUnreadMentionedMessages=function(t,e,n){return this._callMainSync("getUnreadMentionedMessages",t,e,n)},n.prototype.setMessageSentStatus=function(t,e){return this._callMain("setMessageSentStatus",t,e)},n.prototype.setMessageReceivedStatus=function(t,e){return this._callMain("setMessageReceivedStatus",t,e)},n.prototype.updateMessageReceiptStatus=function(t,e,n,o){return this._callMain("updateMessageReceiptStatus",t,e,n,o)},n.prototype.clearUnreadCountByTimestamp=function(t,e,n,o){return this._callMain("clearUnreadCountByTimestamp",t,e,n,o)},n.prototype.clearAllUnreadCount=function(){throw new Error("Method not implemented.")},n.prototype.getConversationNotificationStatus=function(t,e,n){return this._callMain("getConversationNotificationStatus",t,e,n)},n.prototype.getRemoteHistoryMessages=function(t,e,n,o,r,i){return this._callMain("getRemoteHistoryMessages",t,e,n,o,r,i)},n.prototype.getServerTime=function(){return Date.now()-this._cache.deltaTime},n.prototype.getDeviceId=function(){return this._cache.deviceId},n.prototype.getCurrentUserId=function(){return this._cache.crtUserId},n.prototype.bindRTCRoomForChatroom=function(t){return this._callMain("bindRTCRoomForChatroom",t)},n.prototype.rtcSignaling=function(t,e,n,o){return r(this,void 0,void 0,(function(){var r,a,s;return i(this,(function(i){switch(i.label){case 0:return[4,this._callMain("rtcSignaling",t,e,n,o)];case 1:return r=i.sent(),a=r.code,s=r.buffer,[2,{code:a,buffer:s?new Uint8Array(s):s}]}}))}))},n.prototype.rtcPing=function(t,e,n){return this._callMain("rtcPing",t,e,n)},n.prototype.createTag=function(t){return this._callMain("createTag",t)},n.prototype.removeTag=function(t){return this._callMain("removeTag",t)},n.prototype.updateTag=function(t){return this._callMain("updateTag",t)},n.prototype.getTagList=function(){return this._callMain("getTagList")},n.prototype.addTagForConversations=function(t,e){return this._callMain("addTagForConversations",t,e)},n.prototype.removeTagForConversations=function(t,e){return this._callMain("removeTagForConversations",t,e)},n.prototype.removeTagsForConversation=function(t,e){return this._callMain("removeTagsForConversation",t,e)},n.prototype.getConversationListByTag=function(t,e,n,o){return this._callMain("getConversationListByTag",t,e,n,o)},n.prototype.getUnreadCountByTag=function(t,e){return this._callMain("getUnreadCountByTag",t,e)},n.prototype.setConversationStatusInTag=function(t,e,n){return this._callMain("setConversationStatusInTag",t,e,n)},n.prototype.getTagsForConversation=function(t){return this._callMain("getTagsForConversation",t)},n.prototype.clearData=function(){return this._callMain("clearData")},n.prototype.getBlockConversationList=function(){throw new Error("Method not implemented.")},n.prototype.getGroupMessageDeliverList=function(t,e,n){return this._callMain("getGroupMessageDeliverList",t,e,n)},n.prototype.getPrivateMessageDeliverTime=function(t,e){return this._callMain("getPrivateMessageDeliverTime",t,e)},n.prototype.setCallInfo=function(t,e,n){return this._callMain("setCallInfo",t,e,n)},n.prototype.getTopConversationList=function(t,e){return this._callMain("getTopConversationList",t,e)},n.prototype.getUnreadMentionedCount=function(t){throw new Error("Method not implemented.")},n.prototype.getAllUnreadMentionedCount=function(){return this._callMain("getAllUnreadMentionedCount")},n.prototype.getAllConversationState=function(){throw new Error("Method not implemented.")},n.prototype.getUltraGroupList=function(){throw new Error("Method not implemented.")},n.prototype.getBlockUltraGroupList=function(){throw new Error("Method not implemented.")},n.prototype.getTopUltraGroupList=function(){throw new Error("Method not implemented.")},n.prototype.clearUltraUnreadcount=function(t,e){throw new Error("Method not implemented.")},n.prototype.getUltraGroupUnreadMentionedCountByTargetId=function(t,e){throw new Error("Method not implemented.")},n.prototype.sendUltraMessage=function(t,e,n){throw new Error("Method not implemented.")},n.prototype.sendUltraGroupTypingStatus=function(t,e){throw new Error("Method not implemented.")},n.prototype.getUltraGroupMessageListByMessageUId=function(t){throw new Error("Method not implemented.")},n.prototype.expandUltraMessage=function(t){throw new Error("Method not implemented.")},n.prototype.modifyMessage=function(t){throw new Error("Method not implemented.")},n.prototype.getUltraHistoryMsg=function(t,e){throw new Error("Method not implemented.")},n.prototype.getConversationNotificationLevel=function(t,e,n){return this._callMain("getConversationNotificationLevel",t,e,n)},n.prototype.setConversationNotificationLevel=function(t,e,n,o){return this._callMain("setConversationNotificationLevel",t,e,n,o)},n.prototype.batchSetConversationNotificationLevel=function(t,e){return this._callMain("batchSetConversationNotificationLevel",t,e)},n.prototype.setConversationTypeNotificationLevel=function(t,e){return this._callMain("setConversationTypeNotificationLevel",t,e)},n.prototype.getConversationTypeNotificationLevel=function(t){return this._callMain("getConversationTypeNotificationLevel",t)},n.prototype.getUltraGroupDefaultNotificationLevel=function(t,n){return Promise.resolve({code:e.ErrorCode.NOT_SUPPORT})},n.prototype.getAllUltraGroupUnreadCount=function(){return Promise.resolve({code:e.ErrorCode.NOT_SUPPORT})},n.prototype.getUltraGroupUnreadCountByTargetId=function(){return Promise.resolve({code:e.ErrorCode.NOT_SUPPORT})},n.prototype.setUltraGroupDefaultNotificationLevel=function(){return Promise.resolve({code:e.ErrorCode.NOT_SUPPORT})},n.prototype.getUltraGroupUnreadMentionedMessages=function(){return Promise.resolve({code:e.ErrorCode.NOT_SUPPORT})},n.prototype.getUltraGroupFirstUnreadMessageTimestamp=function(){return Promise.resolve({code:e.ErrorCode.NOT_SUPPORT})},n.prototype.getUltraGroupUnreadInfoList=function(){return Promise.resolve({code:e.ErrorCode.NOT_SUPPORT})},n.prototype.getOSInfo=function(){return r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this._callMain("getOSInfo")]}))}))},n.prototype.getProcessInfo=function(){return r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,{code:e.ErrorCode.SUCCESS,data:{title:window.__ContextBridge__.getProcessInfo("title"),pid:window.__ContextBridge__.getProcessInfo("pid"),ppid:window.__ContextBridge__.getProcessInfo("ppid"),platform:window.__ContextBridge__.getProcessInfo("platform"),arch:window.__ContextBridge__.getProcessInfo("arch"),uptime:window.__ContextBridge__.callProcessMethod("uptime"),cpuUsage:window.__ContextBridge__.callProcessMethod("cpuUsage"),memoryUsage:window.__ContextBridge__.callProcessMethod("cpuUsage"),resourceUsage:window.__ContextBridge__.callProcessMethod("cpuUsage")}}]}))}))},n.prototype.getMainProcessInfo=function(){return r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this._callMain("getMainProcessInfo")]}))}))},n.prototype.setProxy=function(t){return this._callMain("setProxy",t)},n.prototype.getProxy=function(){return this._callMain("getProxy")},n.prototype.testProxy=function(t,e){return this._callMain("testProxy",t,e)},n.prototype.setCheckDuplicateMessage=function(t){return this._callMain("checkDuplicateMessage",t)},n.prototype.setNetwork=function(t,e){window.__ContextBridge__.send("__RC_CHANNEL_SEND_2_MAIN__","onRendererNetworkStatusReceived",t,e)},n.prototype.subscribeUser=function(t,e,n){return this._callMain("subscribeUser",t,e,n)},n.prototype.unSubscribeUser=function(t,e){return this._callMain("unSubscribeUser",t,e)},n.prototype.getSubscribeUserList=function(t,e,n){return this._callMain("getSubscribeUserList",t,e,n)},n.prototype.getSubscribeUserStatus=function(t,e){return this._callMain("getSubscribeUserStatus",t,e)},n}(e.AEngine),h={on:function(e,n){t.ipcRenderer.on(e,(function(t){for(var e=[],o=1;o<arguments.length;o++)e[o-1]=arguments[o];n.apply(void 0,a([t],e,!1))}))},send:function(e){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];t.ipcRenderer.send.apply(t.ipcRenderer,a([e],n,!1))},sendSync:function(e){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];return t.ipcRenderer.sendSync.apply(t.ipcRenderer,a([e],n,!1))},getProcessInfo:function(t){return process[t]},callProcessMethod:function(t){for(var e,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];return(e=process)[t].apply(e,n)}};window&&(window.RCCppEngine=g,window.__ContextBridge__=h);exports.RCCppEngine=g,exports.initContextBridge=function(){t.contextBridge&&t.contextBridge.exposeInMainWorld("__ContextBridge__",h)};
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
],
|
|
12
12
|
"types": "index.d.ts",
|
|
13
13
|
"module": "index.esm.js",
|
|
14
|
-
"version": "5.9.
|
|
14
|
+
"version": "5.9.8-alpha.2",
|
|
15
15
|
"author": "pass-web@rongcloud.cn",
|
|
16
16
|
"license": "LGPL 2.1",
|
|
17
17
|
"homepage": "https://www.rongcloud.cn",
|
|
@@ -22,6 +22,6 @@
|
|
|
22
22
|
"globals": "RCCppEngine"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@rongcloud/engine": "=5.9.
|
|
25
|
+
"@rongcloud/engine": "=5.9.8-alpha.2"
|
|
26
26
|
}
|
|
27
27
|
}
|
package/renderer.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{BasicLogger as t,BasicStatistic as e,VersionManage as n,LogTagId as o,isUndefined as r,ErrorCode as i,EventEmitter as a,RCConnectionStatus as s,AEngine as c}from"@rongcloud/engine";var l=function(t,e){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},l(t,e)};function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}l(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function p(t,e,n,o){return new(n||(n=Promise))((function(r,i){function a(t){try{c(o.next(t))}catch(t){i(t)}}function s(t){try{c(o.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}c((o=o.apply(t,e||[])).next())}))}function g(t,e){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function h(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var _="logdata",f=function(t){function e(e,n,o,r){var i=t.call(this,e,n,o)||this;return i.emiter=r,i}return u(e,t),e.prototype.flush=function(t){this.emiter.emit(_,t)},e}(t),y=function(t){function e(e,n,o,r){var i=t.call(this,e,n,o)||this;return i.emiter=r,i}return u(e,t),e.prototype.flush=function(t){this.emiter.emit("logdata",t)},e}(e),M=0,d=Date.now();n.add("electron-renderer","5.9.7");var C=function(t){function e(e,n,r,i){var c=this,l=new a,u=new f(i.appkey,"RC-E","IM",l),p=new y(i.appkey,"RC-E","IM",l);return(c=t.call(this,e,n,r,i,u,p)||this).waitingLogs=[],c.latestSendTimestamp=0,c._resolveMaps={},l.on(_,(function(t){c.waitingLogs.push(t),c.check2SendLog()})),c._logEmitter=l,u.setOutputLevel(i.logOutputLevel),window.__ContextBridge__.on("__RC_CHANNEL_NOTIFICATION_FROM_MAIN__",(function(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];var a=r[e];if(a){var l={batchMessage:c._batchMessage.bind(c),onRTCDataChange:c._onRTCDataChange.bind(c),onConnected:c._onConnected.bind(c),onNaviDataChange:c._onNaviDataChange.bind(c)};if(l[e])l[e](n,a);else{var u={onConnecting:s.CONNECTING,onSuspend:s.SUSPENDED,onDisconnected:s.DISCONNECTED};u[e]&&c._setConnectionStatus(u[e]),a(n[0])}}else c.logger.error(o.L_UNSUPPORT_NTF_FROM_MAIN_E,e)})),window.__ContextBridge__.on("__RC_CHANNEL_RESULT_FROM_MAIN__",(function(t,e){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];var r=c._resolveMaps[e];r&&(delete c._resolveMaps[e],r.apply(void 0,n))})),c._options.httpInMainProcess&&(e.httpReq=c.sendHTTPRequest.bind(c)),window.__ContextBridge__.send("__RC_INNER_COMMAND_INIT__",{navigators:i.navigators,areaCode:i.areaCode,logServerUrl:i.logServerUrl}),c._cache=c._callMainSync("getMainProcessCache"),c}return u(e,t),e.prototype._batchMessage=function(t,e){var n=t[0].hasMoreMsg;delete t[0].hasMoreMsg,e([t[0]],void 0,n)},e.prototype._onRTCDataChange=function(t,e){var n=t[0];this._receiveRtcKv(new Uint8Array(n))},e.prototype._onConnected=function(t,e){this._cache=t[0],e(void 0)},e.prototype._onNaviDataChange=function(t,e){this._cache.naviInfo=t[0],e([t[0]])},e.prototype._setConnectionStatus=function(t){this._cache.connectionStatus=t},e.prototype.check2SendLog=function(){var t=Date.now();t-this.latestSendTimestamp<1e3||(this.logger.debug(o.T,"send logs 2 main -> "+this.waitingLogs.length),window.__ContextBridge__.send("__RC_CHANNEL_SEND_2_MAIN__","onRendererLogsReceived",this.waitingLogs.splice(0)),this.latestSendTimestamp=t)},e.prototype.sendHTTPRequest=function(t){return this._callMain("sendHTTPRequest",t)},e.prototype.setUserStatusListener=function(t,e){throw new Error("TODO -> RCCppEngine.setUserStatusListener")},e.prototype._callMain=function(t){for(var e=this,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];var r=new Promise((function(o){var r,i=function(t){var e=Date.now();return d!==e&&(d=e,M=0),[t,window.__ContextBridge__.getProcessInfo("pid"),e,M++].join("__")}(t);e._resolveMaps[i]=o,(r=window.__ContextBridge__).send.apply(r,h(["__RC_CHANNEL_CALL_MAIN__",i,t],n,!1))}));return r},e.prototype.callExtra=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return this._callMain.apply(this,h(["callExtra",t],e,!1))},e.prototype._send2Main=function(t){for(var e,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];(e=window.__ContextBridge__).send.apply(e,h(["__RC_CHANNEL_SEND_2_MAIN__",t],n,!1))},e.prototype._callMainSync=function(t){for(var e,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return this.logger.info(o.L_CALL_MAIN_SYNC_O,t),(e=window.__ContextBridge__).sendSync.apply(e,h(["__RC_CHANNEL_CALL_MAIN_SYNC__",t],n,!1))},e.prototype.refetchNaviInfo=function(){return this._callMain("refetchNaviInfo")},e.prototype.getNaviInfoFromCache=function(){return this._cache.naviInfo},e.prototype.createLogger=function(t,e){return new f(this._appkey,t,e,this._logEmitter)},e.prototype.createStatisticLogger=function(t,e){return new y(this._appkey,t,e,this._logEmitter)},e.prototype.getConnectionStatus=function(){return this._cache.connectionStatus},e.prototype.connect=function(t,e,n,o){return p(this,void 0,void 0,(function(){return g(this,(function(r){return[2,this._callMain("connect",t,e,n,o)]}))}))},e.prototype.reportSDKInfo=function(t){this._send2Main("reportSDKInfo",t)},e.prototype.getConnectedTime=function(){return this._cache.connectedTime},e.prototype.getHistoryMessage=function(t,e,n,o,r,i,a){return this._callMain("getHistoryMessage",t,e,n,o,r,i,a)},e.prototype.getMessages=function(t,e,n,o,r,i){return this._callMain("getMessages",t,e,n,o,r,i)},e.prototype.getContinuousMessages=function(t,e,n,o,r,i){return this._callMain("getContinuousMessages",t,e,n,o,r,i)},e.prototype.getHistoryMessagesByObjectNames=function(t,e,n,o,r,i,a){return this._callMain("getHistoryMessagesByObjectNames",t,e,n,o,r,i,a)},e.prototype.deleteRemoteMessage=function(t,e,n,o){return this._callMain("deleteRemoteMessage",t,e,n,o)},e.prototype.recallMsg=function(t,e,n,o,r){return this._callMain("recallMsg",t,e,n,o,r)},e.prototype.deleteRemoteMessageByTimestamp=function(t,e,n,o){return this._callMain("deleteRemoteMessageByTimestamp",t,e,n,o)},e.prototype.getConversationList=function(t,e,n,o,r){return this._callMain("getConversationList",t,e,n,o,r)},e.prototype.getConversationsByPage=function(t,e,n,o,r){return this._callMain("getConversationsByPage",t,e,n,o,r)},e.prototype.getUnreadConversationList=function(t){return this._callMain("getUnreadConversationList",t)},e.prototype.getConversationListWithAllChannel=function(){return this._callMain("getConversationListWithAllChannel")},e.prototype.getConversationListWithAllChannelByPage=function(t,e){return this._callMain("getConversationListWithAllChannelByPage",t,e)},e.prototype.getConversation=function(t,e,n){return this._callMain("getConversation",t,e,n)},e.prototype.removeConversation=function(t,e,n){return this._callMain("removeConversation",t,e,n)},e.prototype.batchRemoveConversation=function(t){return this._callMain("batchRemoveConversation",t)},e.prototype.getAllConversationUnreadCount=function(t,e,n){return this._callMain("getAllConversationUnreadCount",t,e,n)},e.prototype.getConversationUnreadCount=function(t,e,n){return this._callMain("getConversationUnreadCount",t,e,n)},e.prototype.getTotalUnreadCountByLevels=function(t,e,n){return this._callMain("getTotalUnreadCountByLevels",t,e,n)},e.prototype.clearConversationUnreadCount=function(t,e,n){return this._callMain("clearConversationUnreadCount",t,e,n)},e.prototype.getFirstUnreadMessage=function(t,e,n){return this._callMain("getFirstUnreadMessage",t,e,n)},e.prototype.getFirstUnreadMessageInfo=function(t,e,n){return this._callMain("getFirstUnreadMessageInfo",t,e,n)},e.prototype.saveConversationMessageDraft=function(t,e,n){return this._callMain("saveConversationMessageDraft",t,e,n)},e.prototype.getConversationMessageDraft=function(t,e){return this._callMain("getConversationMessageDraft",t,e)},e.prototype.clearConversationMessageDraft=function(t,e){return this._callMain("clearConversationMessageDraft",t,e)},e.prototype.pullConversationStatus=function(t){return this._callMain("pullConversationStatus",t)},e.prototype.batchSetConversationStatus=function(t){var e=t[0].notificationLevel;return r(e)?this._callMain("batchSetConversationStatus",t):Promise.resolve(i.NOT_SUPPORT)},e.prototype.batchSetConversationToTop=function(t,e,n){return this._callMain("batchSetConversationToTop",t,e,n)},e.prototype.sendMessage=function(t,e,n,r,i){var a=this,s=["sendMessageBefore",Date.now(),Math.floor(Math.random()*Date.now())].join("_");return r&&(this._resolveMaps[s]=function(t){try{r(t)}catch(t){a.logger.error(o.A_CALLBACK_E,JSON.stringify({error:null==t?void 0:t.stack,pos:"sendMsgBefore"}))}}),this._callMain("sendMessage",t,e,n,s,i)},e.prototype.sendReadReceiptMessage=function(t,e,n){return this._callMain("sendReadReceiptMessage",t,e,n)},e.prototype.getMessageReader=function(t,e,n){return this._callMain("getMessageReader",t,e,n)},e.prototype.sendReadReceiptMessageV4=function(t,e,n){return this._callMain("sendReadReceiptMessageV4",t,e,n)},e.prototype.getMessageReadReceiptV4=function(t,e){return this._callMain("getMessageReadReceiptV4",t,e)},e.prototype.batchGetMessageReadReceiptInfoV4=function(t,e){return Promise.resolve({code:i.NOT_SUPPORT})},e.prototype.updateConversationReadTime=function(t,e){return this._callMain("updateConversationReadTime",t,e)},e.prototype.disconnect=function(t){return p(this,void 0,void 0,(function(){return g(this,(function(e){return this._send2Main("disconnect",t),[2]}))}))},e.prototype.pullUserSettings=function(t){return this._callMain("pullUserSettings",t)},e.prototype.registerMessageType=function(t,e,n,o,r){this._send2Main("registerMessageType",t,e,n,o,r)},e.prototype.joinChatroom=function(t,e){return this._callMain("joinChatroom",t,e)},e.prototype.joinExistChatroom=function(t,e){return this._callMain("joinExistChatroom",t,e)},e.prototype.quitChatroom=function(t){return this._callMain("quitChatroom",t)},e.prototype.getChatroomInfo=function(t,e,n){return this._callMain("getChatroomInfo",t,e,n)},e.prototype.getChatroomHistoryMessages=function(t,e,n,o){return this._callMain("getChatroomHistoryMessages",t,e,n,o)},e.prototype.setChatroomEntry=function(t,e){return this._callMain("setChatroomEntry",t,e)},e.prototype.setChatroomEntries=function(t,e){return this._callMain("setChatroomEntries",t,e)},e.prototype.forceSetChatroomEntry=function(t,e){return this._callMain("forceSetChatroomEntry",t,e)},e.prototype.removeChatroomEntry=function(t,e){return this._callMain("removeChatroomEntry",t,e)},e.prototype.forceRemoveChatroomEntry=function(t,e){return this._callMain("forceRemoveChatroomEntry",t,e)},e.prototype.removeChatroomEntries=function(t,e){return this._callMain("removeChatroomEntries",t,e)},e.prototype.getChatroomEntry=function(t,e){return this._callMain("getChatroomEntry",t,e)},e.prototype.getAllChatroomEntry=function(t){return this._callMain("getAllChatroomEntry",t)},e.prototype.getFileToken=function(t,e,n,o,r){return this._callMain("getFileToken",t,e,n,o,r)},e.prototype.getFileUrl=function(t,e,n,o){return this._callMain("getFileUrl",t,e,n,o)},e.prototype.setUserStatus=function(t){return this._callMain("setUserStatus",t)},e.prototype.subscribeUserStatus=function(t){return this._callMain("subscribeUserStatus",t)},e.prototype.getUserStatus=function(t){return this._callMain("getUserStatus",t)},e.prototype.clearConversations=function(t,e){return this._callMain("clearConversations",t,e)},e.prototype.addToBlacklist=function(t){return this._callMain("addToBlacklist",t)},e.prototype.removeFromBlacklist=function(t){return this._callMain("removeFromBlacklist",t)},e.prototype.getBlacklist=function(){return this._callMain("getBlacklist")},e.prototype.getBlacklistStatus=function(t){return this._callMain("getBlacklistStatus",t)},e.prototype.insertMessage=function(t,e,n){return this._callMain("insertMessage",t,e,n)},e.prototype.batchInsertMessage=function(t,e){return this._callMain("batchInsertMessage",t,e)},e.prototype.getMessageCount=function(t,e,n){return this._callMain("getMessageCount",t,e,n)},e.prototype.deleteMessages=function(t){return this._callMain("deleteMessages",t)},e.prototype.deleteMessagesByTimestamp=function(t,e,n,o,r){return this._callMain("deleteMessagesByTimestamp",t,e,n,o,r)},e.prototype.batchClearMessagesByTimestamp=function(t){return this._callMain("batchClearMessagesByTimestamp",t)},e.prototype.batchClearRemoteHistoryMessages=function(t,e){return this._callMain("batchClearRemoteHistoryMessages",t,e)},e.prototype.clearMessages=function(t,e,n){return this._callMain("clearMessages",t,e,n)},e.prototype.getMessage=function(t){return this._callMain("getMessage",t)},e.prototype.setMessageContent=function(t,e,n){return this._callMain("setMessageContent",t,e,n)},e.prototype.setMessageSearchField=function(t,e,n){return this._callMain("setMessageSearchField",t,e,n)},e.prototype.searchConversationByContent=function(t,e,n,o){return this._callMain("searchConversationByContent",t,e,n,o)},e.prototype.searchConversationByContentWithAllChannel=function(t,e,n){return this._callMain("searchConversationByContentWithAllChannel",t,e,n)},e.prototype.searchMessageByContentWithAllChannel=function(t,e,n,o,r){return this._callMain("searchMessageByContentWithAllChannel",t,e,n,o,r)},e.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(t,e,n,o,r,i,a){return this._callMain("searchMessageByContentInTimeRangeWithAllChannel",t,e,n,o,r,i,a)},e.prototype.searchMessageByContent=function(t,e,n,o,r,i,a){return this._callMain("searchMessageByContent",t,e,n,o,r,i,a)},e.prototype.searchMessagesByUser=function(t,e,n,o,r,i){return this._callMain("searchMessagesByUser",t,e,n,o,r,i)},e.prototype.getUnreadMentionedMessages=function(t,e,n){return this._callMainSync("getUnreadMentionedMessages",t,e,n)},e.prototype.setMessageSentStatus=function(t,e){return this._callMain("setMessageSentStatus",t,e)},e.prototype.setMessageReceivedStatus=function(t,e){return this._callMain("setMessageReceivedStatus",t,e)},e.prototype.updateMessageReceiptStatus=function(t,e,n,o){return this._callMain("updateMessageReceiptStatus",t,e,n,o)},e.prototype.clearUnreadCountByTimestamp=function(t,e,n,o){return this._callMain("clearUnreadCountByTimestamp",t,e,n,o)},e.prototype.clearAllUnreadCount=function(){throw new Error("Method not implemented.")},e.prototype.getConversationNotificationStatus=function(t,e,n){return this._callMain("getConversationNotificationStatus",t,e,n)},e.prototype.getRemoteHistoryMessages=function(t,e,n,o,r,i){return this._callMain("getRemoteHistoryMessages",t,e,n,o,r,i)},e.prototype.getServerTime=function(){return Date.now()-this._cache.deltaTime},e.prototype.getDeviceId=function(){return this._cache.deviceId},e.prototype.getCurrentUserId=function(){return this._cache.crtUserId},e.prototype.bindRTCRoomForChatroom=function(t){return this._callMain("bindRTCRoomForChatroom",t)},e.prototype.rtcSignaling=function(t,e,n,o){return p(this,void 0,void 0,(function(){var r,i,a;return g(this,(function(s){switch(s.label){case 0:return[4,this._callMain("rtcSignaling",t,e,n,o)];case 1:return r=s.sent(),i=r.code,a=r.buffer,[2,{code:i,buffer:a?new Uint8Array(a):a}]}}))}))},e.prototype.rtcPing=function(t,e,n){return this._callMain("rtcPing",t,e,n)},e.prototype.createTag=function(t){return this._callMain("createTag",t)},e.prototype.removeTag=function(t){return this._callMain("removeTag",t)},e.prototype.updateTag=function(t){return this._callMain("updateTag",t)},e.prototype.getTagList=function(){return this._callMain("getTagList")},e.prototype.addTagForConversations=function(t,e){return this._callMain("addTagForConversations",t,e)},e.prototype.removeTagForConversations=function(t,e){return this._callMain("removeTagForConversations",t,e)},e.prototype.removeTagsForConversation=function(t,e){return this._callMain("removeTagsForConversation",t,e)},e.prototype.getConversationListByTag=function(t,e,n,o){return this._callMain("getConversationListByTag",t,e,n,o)},e.prototype.getUnreadCountByTag=function(t,e){return this._callMain("getUnreadCountByTag",t,e)},e.prototype.setConversationStatusInTag=function(t,e,n){return this._callMain("setConversationStatusInTag",t,e,n)},e.prototype.getTagsForConversation=function(t){return this._callMain("getTagsForConversation",t)},e.prototype.clearData=function(){return this._callMain("clearData")},e.prototype.getBlockConversationList=function(){throw new Error("Method not implemented.")},e.prototype.getGroupMessageDeliverList=function(t,e,n){return this._callMain("getGroupMessageDeliverList",t,e,n)},e.prototype.getPrivateMessageDeliverTime=function(t,e){return this._callMain("getPrivateMessageDeliverTime",t,e)},e.prototype.setCallInfo=function(t,e,n){return this._callMain("setCallInfo",t,e,n)},e.prototype.getTopConversationList=function(t,e){return this._callMain("getTopConversationList",t,e)},e.prototype.getUnreadMentionedCount=function(t){throw new Error("Method not implemented.")},e.prototype.getAllUnreadMentionedCount=function(){return this._callMain("getAllUnreadMentionedCount")},e.prototype.getAllConversationState=function(){throw new Error("Method not implemented.")},e.prototype.getUltraGroupList=function(){throw new Error("Method not implemented.")},e.prototype.getBlockUltraGroupList=function(){throw new Error("Method not implemented.")},e.prototype.getTopUltraGroupList=function(){throw new Error("Method not implemented.")},e.prototype.clearUltraUnreadcount=function(t,e){throw new Error("Method not implemented.")},e.prototype.getUltraGroupUnreadMentionedCountByTargetId=function(t,e){throw new Error("Method not implemented.")},e.prototype.sendUltraMessage=function(t,e,n){throw new Error("Method not implemented.")},e.prototype.sendUltraGroupTypingStatus=function(t,e){throw new Error("Method not implemented.")},e.prototype.getUltraGroupMessageListByMessageUId=function(t){throw new Error("Method not implemented.")},e.prototype.expandUltraMessage=function(t){throw new Error("Method not implemented.")},e.prototype.modifyMessage=function(t){throw new Error("Method not implemented.")},e.prototype.getUltraHistoryMsg=function(t,e){throw new Error("Method not implemented.")},e.prototype.getConversationNotificationLevel=function(t,e,n){return this._callMain("getConversationNotificationLevel",t,e,n)},e.prototype.setConversationNotificationLevel=function(t,e,n,o){return this._callMain("setConversationNotificationLevel",t,e,n,o)},e.prototype.batchSetConversationNotificationLevel=function(t,e){return this._callMain("batchSetConversationNotificationLevel",t,e)},e.prototype.getUltraGroupDefaultNotificationLevel=function(t,e){return Promise.resolve({code:i.NOT_SUPPORT})},e.prototype.getAllUltraGroupUnreadCount=function(){return Promise.resolve({code:i.NOT_SUPPORT})},e.prototype.getUltraGroupUnreadCountByTargetId=function(){return Promise.resolve({code:i.NOT_SUPPORT})},e.prototype.setUltraGroupDefaultNotificationLevel=function(){return Promise.resolve({code:i.NOT_SUPPORT})},e.prototype.getUltraGroupUnreadMentionedMessages=function(){return Promise.resolve({code:i.NOT_SUPPORT})},e.prototype.getUltraGroupFirstUnreadMessageTimestamp=function(){return Promise.resolve({code:i.NOT_SUPPORT})},e.prototype.getUltraGroupUnreadInfoList=function(){return Promise.resolve({code:i.NOT_SUPPORT})},e.prototype.getOSInfo=function(){return p(this,void 0,void 0,(function(){return g(this,(function(t){return[2,this._callMain("getOSInfo")]}))}))},e.prototype.getProcessInfo=function(){return p(this,void 0,void 0,(function(){return g(this,(function(t){return[2,{code:i.SUCCESS,data:{title:window.__ContextBridge__.getProcessInfo("title"),pid:window.__ContextBridge__.getProcessInfo("pid"),ppid:window.__ContextBridge__.getProcessInfo("ppid"),platform:window.__ContextBridge__.getProcessInfo("platform"),arch:window.__ContextBridge__.getProcessInfo("arch"),uptime:window.__ContextBridge__.callProcessMethod("uptime"),cpuUsage:window.__ContextBridge__.callProcessMethod("cpuUsage"),memoryUsage:window.__ContextBridge__.callProcessMethod("cpuUsage"),resourceUsage:window.__ContextBridge__.callProcessMethod("cpuUsage")}}]}))}))},e.prototype.getMainProcessInfo=function(){return p(this,void 0,void 0,(function(){return g(this,(function(t){return[2,this._callMain("getMainProcessInfo")]}))}))},e.prototype.setProxy=function(t){return this._callMain("setProxy",t)},e.prototype.getProxy=function(){return this._callMain("getProxy")},e.prototype.testProxy=function(t,e){return this._callMain("testProxy",t,e)},e.prototype.setCheckDuplicateMessage=function(t){return this._callMain("checkDuplicateMessage",t)},e.prototype.setNetwork=function(t,e){window.__ContextBridge__.send("__RC_CHANNEL_SEND_2_MAIN__","onRendererNetworkStatusReceived",t,e)},e}(c),v=function(){window.RCCppEngine=C};export{v as initRenderer};
|
|
1
|
+
import{BasicLogger as t,BasicStatistic as e,VersionManage as n,LogTagId as o,isUndefined as r,ErrorCode as i,EventEmitter as a,RCConnectionStatus as s,AEngine as c}from"@rongcloud/engine";var l=function(t,e){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},l(t,e)};function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}l(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function p(t,e,n,o){return new(n||(n=Promise))((function(r,i){function a(t){try{c(o.next(t))}catch(t){i(t)}}function s(t){try{c(o.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}c((o=o.apply(t,e||[])).next())}))}function g(t,e){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function h(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var _="logdata",f=function(t){function e(e,n,o,r){var i=t.call(this,e,n,o)||this;return i.emiter=r,i}return u(e,t),e.prototype.flush=function(t){this.emiter.emit(_,t)},e}(t),y=function(t){function e(e,n,o,r){var i=t.call(this,e,n,o)||this;return i.emiter=r,i}return u(e,t),e.prototype.flush=function(t){this.emiter.emit("logdata",t)},e}(e),M=0,d=Date.now();n.add("electron-renderer","5.9.8-alpha.2");var C=function(t){function e(e,n,r,i){var c=this,l=new a,u=new f(i.appkey,"RC-E","IM",l),p=new y(i.appkey,"RC-E","IM",l);return(c=t.call(this,e,n,r,i,u,p)||this).waitingLogs=[],c.latestSendTimestamp=0,c._resolveMaps={},l.on(_,(function(t){c.waitingLogs.push(t),c.check2SendLog()})),c._logEmitter=l,u.setOutputLevel(i.logOutputLevel),window.__ContextBridge__.on("__RC_CHANNEL_NOTIFICATION_FROM_MAIN__",(function(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];var a=r[e];if(a){var l={batchMessage:c._batchMessage.bind(c),onRTCDataChange:c._onRTCDataChange.bind(c),onConnected:c._onConnected.bind(c),onNaviDataChange:c._onNaviDataChange.bind(c)};if(l[e])l[e](n,a);else{var u={onConnecting:s.CONNECTING,onSuspend:s.SUSPENDED,onDisconnected:s.DISCONNECTED};u[e]&&c._setConnectionStatus(u[e]),a(n[0])}}else c.logger.error(o.L_UNSUPPORT_NTF_FROM_MAIN_E,e)})),window.__ContextBridge__.on("__RC_CHANNEL_RESULT_FROM_MAIN__",(function(t,e){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];var r=c._resolveMaps[e];r&&(delete c._resolveMaps[e],r.apply(void 0,n))})),c._options.httpInMainProcess&&(e.httpReq=c.sendHTTPRequest.bind(c)),window.__ContextBridge__.send("__RC_INNER_COMMAND_INIT__",{navigators:i.navigators,areaCode:i.areaCode,logServerUrl:i.logServerUrl,environment:i.environment}),c._cache=c._callMainSync("getMainProcessCache"),c}return u(e,t),e.prototype._batchMessage=function(t,e){var n=t[0].hasMoreMsg;delete t[0].hasMoreMsg,e([t[0]],void 0,n)},e.prototype._onRTCDataChange=function(t,e){var n=t[0];this._receiveRtcKv(new Uint8Array(n))},e.prototype._onConnected=function(t,e){this._cache=t[0],e(void 0)},e.prototype._onNaviDataChange=function(t,e){this._cache.naviInfo=t[0],e([t[0]])},e.prototype._setConnectionStatus=function(t){this._cache.connectionStatus=t},e.prototype.check2SendLog=function(){var t=Date.now();t-this.latestSendTimestamp<1e3||(this.logger.debug(o.T,"send logs 2 main -> "+this.waitingLogs.length),window.__ContextBridge__.send("__RC_CHANNEL_SEND_2_MAIN__","onRendererLogsReceived",this.waitingLogs.splice(0)),this.latestSendTimestamp=t)},e.prototype.sendHTTPRequest=function(t){return this._callMain("sendHTTPRequest",t)},e.prototype.setUserStatusListener=function(t,e){throw new Error("TODO -> RCCppEngine.setUserStatusListener")},e.prototype._callMain=function(t){for(var e=this,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];var r=new Promise((function(o){var r,i=function(t){var e=Date.now();return d!==e&&(d=e,M=0),[t,window.__ContextBridge__.getProcessInfo("pid"),e,M++].join("__")}(t);e._resolveMaps[i]=o,(r=window.__ContextBridge__).send.apply(r,h(["__RC_CHANNEL_CALL_MAIN__",i,t],n,!1))}));return r},e.prototype.callExtra=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return this._callMain.apply(this,h(["callExtra",t],e,!1))},e.prototype._send2Main=function(t){for(var e,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];(e=window.__ContextBridge__).send.apply(e,h(["__RC_CHANNEL_SEND_2_MAIN__",t],n,!1))},e.prototype._callMainSync=function(t){for(var e,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return this.logger.info(o.L_CALL_MAIN_SYNC_O,t),(e=window.__ContextBridge__).sendSync.apply(e,h(["__RC_CHANNEL_CALL_MAIN_SYNC__",t],n,!1))},e.prototype.refetchNaviInfo=function(){return this._callMain("refetchNaviInfo")},e.prototype.getNaviInfoFromCache=function(){return this._cache.naviInfo},e.prototype.createLogger=function(t,e){return new f(this._appkey,t,e,this._logEmitter)},e.prototype.createStatisticLogger=function(t,e){return new y(this._appkey,t,e,this._logEmitter)},e.prototype.getConnectionStatus=function(){return this._cache.connectionStatus},e.prototype.connect=function(t,e,n,o){return p(this,void 0,void 0,(function(){return g(this,(function(r){return[2,this._callMain("connect",t,e,n,o)]}))}))},e.prototype.reportSDKInfo=function(t){this._send2Main("reportSDKInfo",t)},e.prototype.getConnectedTime=function(){return this._cache.connectedTime},e.prototype.getHistoryMessage=function(t,e,n,o,r,i,a){return this._callMain("getHistoryMessage",t,e,n,o,r,i,a)},e.prototype.getMessages=function(t,e,n,o,r,i){return this._callMain("getMessages",t,e,n,o,r,i)},e.prototype.getContinuousMessages=function(t,e,n,o,r,i){return this._callMain("getContinuousMessages",t,e,n,o,r,i)},e.prototype.getHistoryMessagesByObjectNames=function(t,e,n,o,r,i,a){return this._callMain("getHistoryMessagesByObjectNames",t,e,n,o,r,i,a)},e.prototype.deleteRemoteMessage=function(t,e,n,o){return this._callMain("deleteRemoteMessage",t,e,n,o)},e.prototype.recallMsg=function(t,e,n,o,r){return this._callMain("recallMsg",t,e,n,o,r)},e.prototype.deleteRemoteMessageByTimestamp=function(t,e,n,o){return this._callMain("deleteRemoteMessageByTimestamp",t,e,n,o)},e.prototype.getConversationList=function(t,e,n,o,r){return this._callMain("getConversationList",t,e,n,o,r)},e.prototype.getConversationsByPage=function(t,e,n,o,r){return this._callMain("getConversationsByPage",t,e,n,o,r)},e.prototype.getUnreadConversationList=function(t){return this._callMain("getUnreadConversationList",t)},e.prototype.getConversationListWithAllChannel=function(){return this._callMain("getConversationListWithAllChannel")},e.prototype.getConversationListWithAllChannelByPage=function(t,e){return this._callMain("getConversationListWithAllChannelByPage",t,e)},e.prototype.getConversation=function(t,e,n){return this._callMain("getConversation",t,e,n)},e.prototype.removeConversation=function(t,e,n){return this._callMain("removeConversation",t,e,n)},e.prototype.batchRemoveConversation=function(t){return this._callMain("batchRemoveConversation",t)},e.prototype.getAllConversationUnreadCount=function(t,e,n){return this._callMain("getAllConversationUnreadCount",t,e,n)},e.prototype.getConversationUnreadCount=function(t,e,n){return this._callMain("getConversationUnreadCount",t,e,n)},e.prototype.getTotalUnreadCountByLevels=function(t,e,n){return this._callMain("getTotalUnreadCountByLevels",t,e,n)},e.prototype.clearConversationUnreadCount=function(t,e,n){return this._callMain("clearConversationUnreadCount",t,e,n)},e.prototype.getFirstUnreadMessage=function(t,e,n){return this._callMain("getFirstUnreadMessage",t,e,n)},e.prototype.getFirstUnreadMessageInfo=function(t,e,n){return this._callMain("getFirstUnreadMessageInfo",t,e,n)},e.prototype.saveConversationMessageDraft=function(t,e,n){return this._callMain("saveConversationMessageDraft",t,e,n)},e.prototype.getConversationMessageDraft=function(t,e){return this._callMain("getConversationMessageDraft",t,e)},e.prototype.clearConversationMessageDraft=function(t,e){return this._callMain("clearConversationMessageDraft",t,e)},e.prototype.pullConversationStatus=function(t){return this._callMain("pullConversationStatus",t)},e.prototype.batchSetConversationStatus=function(t){var e=t[0].notificationLevel;return r(e)?this._callMain("batchSetConversationStatus",t):Promise.resolve(i.NOT_SUPPORT)},e.prototype.batchSetConversationToTop=function(t,e,n){return this._callMain("batchSetConversationToTop",t,e,n)},e.prototype.sendMessage=function(t,e,n,r,i){var a=this,s=["sendMessageBefore",Date.now(),Math.floor(Math.random()*Date.now())].join("_");return r&&(this._resolveMaps[s]=function(t){try{r(t)}catch(t){a.logger.error(o.A_CALLBACK_E,JSON.stringify({error:null==t?void 0:t.stack,pos:"sendMsgBefore"}))}}),this._callMain("sendMessage",t,e,n,s,i)},e.prototype.sendReadReceiptMessage=function(t,e,n){return this._callMain("sendReadReceiptMessage",t,e,n)},e.prototype.getMessageReader=function(t,e,n){return this._callMain("getMessageReader",t,e,n)},e.prototype.sendReadReceiptMessageV4=function(t,e,n){return this._callMain("sendReadReceiptMessageV4",t,e,n)},e.prototype.getMessageReadReceiptV4=function(t,e){return this._callMain("getMessageReadReceiptV4",t,e)},e.prototype.batchGetMessageReadReceiptInfoV4=function(t,e){return Promise.resolve({code:i.NOT_SUPPORT})},e.prototype.updateConversationReadTime=function(t,e){return this._callMain("updateConversationReadTime",t,e)},e.prototype.disconnect=function(t){return p(this,void 0,void 0,(function(){return g(this,(function(e){return this._send2Main("disconnect",t),[2]}))}))},e.prototype.pullUserSettings=function(t){return this._callMain("pullUserSettings",t)},e.prototype.registerMessageType=function(t,e,n,o,r){this._send2Main("registerMessageType",t,e,n,o,r)},e.prototype.joinChatroom=function(t,e){return this._callMain("joinChatroom",t,e)},e.prototype.joinExistChatroom=function(t,e){return this._callMain("joinExistChatroom",t,e)},e.prototype.quitChatroom=function(t){return this._callMain("quitChatroom",t)},e.prototype.getChatroomInfo=function(t,e,n){return this._callMain("getChatroomInfo",t,e,n)},e.prototype.getChatroomHistoryMessages=function(t,e,n,o){return this._callMain("getChatroomHistoryMessages",t,e,n,o)},e.prototype.setChatroomEntry=function(t,e){return this._callMain("setChatroomEntry",t,e)},e.prototype.setChatroomEntries=function(t,e){return this._callMain("setChatroomEntries",t,e)},e.prototype.forceSetChatroomEntry=function(t,e){return this._callMain("forceSetChatroomEntry",t,e)},e.prototype.removeChatroomEntry=function(t,e){return this._callMain("removeChatroomEntry",t,e)},e.prototype.forceRemoveChatroomEntry=function(t,e){return this._callMain("forceRemoveChatroomEntry",t,e)},e.prototype.removeChatroomEntries=function(t,e){return this._callMain("removeChatroomEntries",t,e)},e.prototype.getChatroomEntry=function(t,e){return this._callMain("getChatroomEntry",t,e)},e.prototype.getAllChatroomEntry=function(t){return this._callMain("getAllChatroomEntry",t)},e.prototype.getFileToken=function(t,e,n,o,r){return this._callMain("getFileToken",t,e,n,o,r)},e.prototype.getFileUrl=function(t,e,n,o){return this._callMain("getFileUrl",t,e,n,o)},e.prototype.setUserStatus=function(t){return this._callMain("setUserStatus",t)},e.prototype.subscribeUserStatus=function(t){return this._callMain("subscribeUserStatus",t)},e.prototype.getUserStatus=function(t){return this._callMain("getUserStatus",t)},e.prototype.clearConversations=function(t,e){return this._callMain("clearConversations",t,e)},e.prototype.addToBlacklist=function(t){return this._callMain("addToBlacklist",t)},e.prototype.removeFromBlacklist=function(t){return this._callMain("removeFromBlacklist",t)},e.prototype.getBlacklist=function(){return this._callMain("getBlacklist")},e.prototype.getBlacklistStatus=function(t){return this._callMain("getBlacklistStatus",t)},e.prototype.insertMessage=function(t,e,n){return this._callMain("insertMessage",t,e,n)},e.prototype.batchInsertMessage=function(t,e){return this._callMain("batchInsertMessage",t,e)},e.prototype.getMessageCount=function(t,e,n){return this._callMain("getMessageCount",t,e,n)},e.prototype.deleteMessages=function(t){return this._callMain("deleteMessages",t)},e.prototype.deleteMessagesByTimestamp=function(t,e,n,o,r){return this._callMain("deleteMessagesByTimestamp",t,e,n,o,r)},e.prototype.batchClearMessagesByTimestamp=function(t){return this._callMain("batchClearMessagesByTimestamp",t)},e.prototype.batchClearRemoteHistoryMessages=function(t,e){return this._callMain("batchClearRemoteHistoryMessages",t,e)},e.prototype.clearMessages=function(t,e,n){return this._callMain("clearMessages",t,e,n)},e.prototype.getMessage=function(t){return this._callMain("getMessage",t)},e.prototype.setMessageContent=function(t,e,n){return this._callMain("setMessageContent",t,e,n)},e.prototype.setMessageSearchField=function(t,e,n){return this._callMain("setMessageSearchField",t,e,n)},e.prototype.searchConversationByContent=function(t,e,n,o){return this._callMain("searchConversationByContent",t,e,n,o)},e.prototype.searchConversationByContentWithAllChannel=function(t,e,n){return this._callMain("searchConversationByContentWithAllChannel",t,e,n)},e.prototype.searchMessageByContentWithAllChannel=function(t,e,n,o,r){return this._callMain("searchMessageByContentWithAllChannel",t,e,n,o,r)},e.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(t,e,n,o,r,i,a){return this._callMain("searchMessageByContentInTimeRangeWithAllChannel",t,e,n,o,r,i,a)},e.prototype.searchMessageByContent=function(t,e,n,o,r,i,a){return this._callMain("searchMessageByContent",t,e,n,o,r,i,a)},e.prototype.searchMessageByContentAndMessageType=function(t,e,n,o,r,i,a){return this._callMain("searchMessageByContentAndMessageType",t,e,n,o,r,i,a)},e.prototype.searchMessagesByUser=function(t,e,n,o,r,i){return this._callMain("searchMessagesByUser",t,e,n,o,r,i)},e.prototype.getMessagesByTimestamp=function(t,e,n,o){return this._callMain("getMatchedMessage",t,e,n,o)},e.prototype.getUnreadMentionedMessages=function(t,e,n){return this._callMainSync("getUnreadMentionedMessages",t,e,n)},e.prototype.setMessageSentStatus=function(t,e){return this._callMain("setMessageSentStatus",t,e)},e.prototype.setMessageReceivedStatus=function(t,e){return this._callMain("setMessageReceivedStatus",t,e)},e.prototype.updateMessageReceiptStatus=function(t,e,n,o){return this._callMain("updateMessageReceiptStatus",t,e,n,o)},e.prototype.clearUnreadCountByTimestamp=function(t,e,n,o){return this._callMain("clearUnreadCountByTimestamp",t,e,n,o)},e.prototype.clearAllUnreadCount=function(){throw new Error("Method not implemented.")},e.prototype.getConversationNotificationStatus=function(t,e,n){return this._callMain("getConversationNotificationStatus",t,e,n)},e.prototype.getRemoteHistoryMessages=function(t,e,n,o,r,i){return this._callMain("getRemoteHistoryMessages",t,e,n,o,r,i)},e.prototype.getServerTime=function(){return Date.now()-this._cache.deltaTime},e.prototype.getDeviceId=function(){return this._cache.deviceId},e.prototype.getCurrentUserId=function(){return this._cache.crtUserId},e.prototype.bindRTCRoomForChatroom=function(t){return this._callMain("bindRTCRoomForChatroom",t)},e.prototype.rtcSignaling=function(t,e,n,o){return p(this,void 0,void 0,(function(){var r,i,a;return g(this,(function(s){switch(s.label){case 0:return[4,this._callMain("rtcSignaling",t,e,n,o)];case 1:return r=s.sent(),i=r.code,a=r.buffer,[2,{code:i,buffer:a?new Uint8Array(a):a}]}}))}))},e.prototype.rtcPing=function(t,e,n){return this._callMain("rtcPing",t,e,n)},e.prototype.createTag=function(t){return this._callMain("createTag",t)},e.prototype.removeTag=function(t){return this._callMain("removeTag",t)},e.prototype.updateTag=function(t){return this._callMain("updateTag",t)},e.prototype.getTagList=function(){return this._callMain("getTagList")},e.prototype.addTagForConversations=function(t,e){return this._callMain("addTagForConversations",t,e)},e.prototype.removeTagForConversations=function(t,e){return this._callMain("removeTagForConversations",t,e)},e.prototype.removeTagsForConversation=function(t,e){return this._callMain("removeTagsForConversation",t,e)},e.prototype.getConversationListByTag=function(t,e,n,o){return this._callMain("getConversationListByTag",t,e,n,o)},e.prototype.getUnreadCountByTag=function(t,e){return this._callMain("getUnreadCountByTag",t,e)},e.prototype.setConversationStatusInTag=function(t,e,n){return this._callMain("setConversationStatusInTag",t,e,n)},e.prototype.getTagsForConversation=function(t){return this._callMain("getTagsForConversation",t)},e.prototype.clearData=function(){return this._callMain("clearData")},e.prototype.getBlockConversationList=function(){throw new Error("Method not implemented.")},e.prototype.getGroupMessageDeliverList=function(t,e,n){return this._callMain("getGroupMessageDeliverList",t,e,n)},e.prototype.getPrivateMessageDeliverTime=function(t,e){return this._callMain("getPrivateMessageDeliverTime",t,e)},e.prototype.setCallInfo=function(t,e,n){return this._callMain("setCallInfo",t,e,n)},e.prototype.getTopConversationList=function(t,e){return this._callMain("getTopConversationList",t,e)},e.prototype.getUnreadMentionedCount=function(t){throw new Error("Method not implemented.")},e.prototype.getAllUnreadMentionedCount=function(){return this._callMain("getAllUnreadMentionedCount")},e.prototype.getAllConversationState=function(){throw new Error("Method not implemented.")},e.prototype.getUltraGroupList=function(){throw new Error("Method not implemented.")},e.prototype.getBlockUltraGroupList=function(){throw new Error("Method not implemented.")},e.prototype.getTopUltraGroupList=function(){throw new Error("Method not implemented.")},e.prototype.clearUltraUnreadcount=function(t,e){throw new Error("Method not implemented.")},e.prototype.getUltraGroupUnreadMentionedCountByTargetId=function(t,e){throw new Error("Method not implemented.")},e.prototype.sendUltraMessage=function(t,e,n){throw new Error("Method not implemented.")},e.prototype.sendUltraGroupTypingStatus=function(t,e){throw new Error("Method not implemented.")},e.prototype.getUltraGroupMessageListByMessageUId=function(t){throw new Error("Method not implemented.")},e.prototype.expandUltraMessage=function(t){throw new Error("Method not implemented.")},e.prototype.modifyMessage=function(t){throw new Error("Method not implemented.")},e.prototype.getUltraHistoryMsg=function(t,e){throw new Error("Method not implemented.")},e.prototype.getConversationNotificationLevel=function(t,e,n){return this._callMain("getConversationNotificationLevel",t,e,n)},e.prototype.setConversationNotificationLevel=function(t,e,n,o){return this._callMain("setConversationNotificationLevel",t,e,n,o)},e.prototype.batchSetConversationNotificationLevel=function(t,e){return this._callMain("batchSetConversationNotificationLevel",t,e)},e.prototype.setConversationTypeNotificationLevel=function(t,e){return this._callMain("setConversationTypeNotificationLevel",t,e)},e.prototype.getConversationTypeNotificationLevel=function(t){return this._callMain("getConversationTypeNotificationLevel",t)},e.prototype.getUltraGroupDefaultNotificationLevel=function(t,e){return Promise.resolve({code:i.NOT_SUPPORT})},e.prototype.getAllUltraGroupUnreadCount=function(){return Promise.resolve({code:i.NOT_SUPPORT})},e.prototype.getUltraGroupUnreadCountByTargetId=function(){return Promise.resolve({code:i.NOT_SUPPORT})},e.prototype.setUltraGroupDefaultNotificationLevel=function(){return Promise.resolve({code:i.NOT_SUPPORT})},e.prototype.getUltraGroupUnreadMentionedMessages=function(){return Promise.resolve({code:i.NOT_SUPPORT})},e.prototype.getUltraGroupFirstUnreadMessageTimestamp=function(){return Promise.resolve({code:i.NOT_SUPPORT})},e.prototype.getUltraGroupUnreadInfoList=function(){return Promise.resolve({code:i.NOT_SUPPORT})},e.prototype.getOSInfo=function(){return p(this,void 0,void 0,(function(){return g(this,(function(t){return[2,this._callMain("getOSInfo")]}))}))},e.prototype.getProcessInfo=function(){return p(this,void 0,void 0,(function(){return g(this,(function(t){return[2,{code:i.SUCCESS,data:{title:window.__ContextBridge__.getProcessInfo("title"),pid:window.__ContextBridge__.getProcessInfo("pid"),ppid:window.__ContextBridge__.getProcessInfo("ppid"),platform:window.__ContextBridge__.getProcessInfo("platform"),arch:window.__ContextBridge__.getProcessInfo("arch"),uptime:window.__ContextBridge__.callProcessMethod("uptime"),cpuUsage:window.__ContextBridge__.callProcessMethod("cpuUsage"),memoryUsage:window.__ContextBridge__.callProcessMethod("cpuUsage"),resourceUsage:window.__ContextBridge__.callProcessMethod("cpuUsage")}}]}))}))},e.prototype.getMainProcessInfo=function(){return p(this,void 0,void 0,(function(){return g(this,(function(t){return[2,this._callMain("getMainProcessInfo")]}))}))},e.prototype.setProxy=function(t){return this._callMain("setProxy",t)},e.prototype.getProxy=function(){return this._callMain("getProxy")},e.prototype.testProxy=function(t,e){return this._callMain("testProxy",t,e)},e.prototype.setCheckDuplicateMessage=function(t){return this._callMain("checkDuplicateMessage",t)},e.prototype.setNetwork=function(t,e){window.__ContextBridge__.send("__RC_CHANNEL_SEND_2_MAIN__","onRendererNetworkStatusReceived",t,e)},e.prototype.subscribeUser=function(t,e,n){return this._callMain("subscribeUser",t,e,n)},e.prototype.unSubscribeUser=function(t,e){return this._callMain("unSubscribeUser",t,e)},e.prototype.getSubscribeUserList=function(t,e,n){return this._callMain("getSubscribeUserList",t,e,n)},e.prototype.getSubscribeUserStatus=function(t,e){return this._callMain("getSubscribeUserStatus",t,e)},e}(c),v=function(){window.RCCppEngine=C};export{v as initRenderer};
|