@rongcloud/electron-renderer 5.6.2-beem.6 → 5.7.0

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 CHANGED
@@ -1,10 +1,8 @@
1
- import { AEngine, IRuntime, Codec, InnerRTCKeyMaps, IEngineWatcher, IAPIContextOption, IExtraMethod, IAsyncRes, INaviInfo, LogType, BasicLogger, ErrorCode, ConversationType, IPromiseResult, IReceivedMessage, MessageDirection, IRecallMsgOptions, IReceivedConversation, NotificationLevel, IServerConversationStatus, ISetConversationStatusOptions, ISendMsgOptions, IMessageReaderResponse, IServerUserSetting, IChatroomInfo, IChrmKVEntry, IChrmKVEntries, FileType, IUploadAuth, UploadMethod, IInsertMsgOptions, NotificationStatus, IRTCRoomBindOption, ITagParam, ITagInfo, IConversationOption, IReceivedConversationByTag, ILocalTagStatus, IConversationTag, IBaseConversationInfo, IGroupMessageDeliverInfo, IConversationState, IUltraGroupConversation, OperateStatus, IUltraMsgQueryOptions, IUltraExMsgOptions, IUltraModifyMsgOptions, IGetMsgOption, IOSInfo, IProcessInfo } from '@rongcloud/engine';
1
+ import { AEngine, IRuntime, Codec, InnerRTCKeyMaps, IEngineWatcher, IAPIContextOption, IExtraMethod, IAsyncRes, IPromiseResult, INaviInfo, LogType, BasicLogger, RCConnectionStatus, ConversationType, IReceivedMessage, MessageDirection, ErrorCode, IRecallMsgOptions, IReceivedConversation, NotificationLevel, IServerConversationStatus, ISetConversationStatusOptions, ISendMsgOptions, IMessageReaderResponse, IServerUserSetting, IChatroomInfo, IChrmKVEntry, IChrmKVEntries, FileType, IUploadAuth, UploadMethod, IInsertMsgOptions, NotificationStatus, IRTCRoomBindOption, ITagParam, ITagInfo, IConversationOption, IReceivedConversationByTag, ILocalTagStatus, IConversationTag, IBaseConversationInfo, IGroupMessageDeliverInfo, IConversationState, IUltraGroupConversation, OperateStatus, IUltraMsgQueryOptions, IUltraExMsgOptions, IUltraModifyMsgOptions, IGetMsgOption, IOSInfo, IProcessInfo, IProxy, IResponse } from '@rongcloud/engine';
2
2
 
3
3
  declare class RCCppEngine extends AEngine {
4
- private readonly logEmitter;
5
- private _connectedTime;
6
- private _crtUserId;
7
- private _deviceId;
4
+ private readonly _logEmitter;
5
+ private _cache;
8
6
  constructor(runtime: IRuntime, codec: Codec<InnerRTCKeyMaps>, watcher: IEngineWatcher, options: IAPIContextOption);
9
7
  private waitingLogs;
10
8
  private latestSendTimestamp;
@@ -21,11 +19,11 @@ declare class RCCppEngine extends AEngine {
21
19
  callExtra(method: string | keyof IExtraMethod, ...args: any[]): Promise<IAsyncRes<unknown>>;
22
20
  private _send2Main;
23
21
  private _callMainSync;
24
- private naviInfo;
25
- requestNaviInfo(uris: string[], appkey: string, token: string, checkCA?: boolean): Promise<INaviInfo | null>;
22
+ refetchNaviInfo(): IPromiseResult<INaviInfo | null>;
26
23
  getNaviInfoFromCache(): INaviInfo | null;
27
24
  createLogger(id: string, type: LogType): BasicLogger;
28
- connect(token: string, naviInfo: INaviInfo, reconnectKickEnable?: boolean, traceId?: string): Promise<ErrorCode>;
25
+ getConnectionStatus(): RCConnectionStatus;
26
+ connect(token: string, reconnectKickEnable: boolean, traceId: string): IPromiseResult<string>;
29
27
  reportSDKInfo(versionInfo: {
30
28
  [name: string]: string;
31
29
  }): void;
@@ -47,6 +45,7 @@ declare class RCCppEngine extends AEngine {
47
45
  deleteRemoteMessageByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, channelId: string): Promise<ErrorCode>;
48
46
  getConversationList(count: number, conversationType?: ConversationType, startTime?: number, order?: 0 | 1, channelId?: string): IPromiseResult<IReceivedConversation[]>;
49
47
  getConversationsByPage(conversationTypes: ConversationType[], startTime: number, count: number, channelId: string): IPromiseResult<IReceivedConversation[]>;
48
+ getUnreadConversationList(conversationTypes: ConversationType[]): IPromiseResult<IReceivedConversation[]>;
50
49
  getConversationListWithAllChannel(): IPromiseResult<IReceivedConversation[]>;
51
50
  getConversationListWithAllChannelByPage(index: number, limit: number): IPromiseResult<IReceivedConversation[]>;
52
51
  getConversation(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<IReceivedConversation>;
@@ -64,7 +63,7 @@ declare class RCCppEngine extends AEngine {
64
63
  sendMessage(conversationType: ConversationType, targetId: string, options: ISendMsgOptions, onBefore?: (messageId: number) => void, traceId?: string): IPromiseResult<IReceivedMessage>;
65
64
  sendReadReceiptMessage(targetId: string, messageUIds: string[], channelId?: string): Promise<IAsyncRes>;
66
65
  getMessageReader(targetId: string, messageUId: string, channelId?: string): IPromiseResult<IMessageReaderResponse>;
67
- disconnect(): void;
66
+ disconnect(): Promise<void>;
68
67
  pullUserSettings(version: number): IPromiseResult<IServerUserSetting>;
69
68
  registerMessageType(objectName: string, isPersited: boolean, isCounted: boolean, searchProps: string[]): void;
70
69
  joinChatroom(chatroomId: string, count: number): Promise<ErrorCode>;
@@ -109,7 +108,7 @@ declare class RCCppEngine extends AEngine {
109
108
  deleteMessages(messageIds: number[]): Promise<ErrorCode>;
110
109
  deleteMessagesByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, cleanSpace: boolean, channelId: string): Promise<ErrorCode>;
111
110
  clearMessages(conversationType: ConversationType, targetId: string, channelId: string): Promise<ErrorCode>;
112
- getMessage(messageId: number): IPromiseResult<IReceivedMessage>;
111
+ getMessage(messageId: number | string): IPromiseResult<IReceivedMessage>;
113
112
  setMessageContent(messageId: number, content: any, messageType: string): Promise<ErrorCode>;
114
113
  setMessageSearchField(messageId: number, content: any, searchFiles: string): Promise<ErrorCode>;
115
114
  searchConversationByContent(keyword: string, customMessageTypes: string[], channelId: string, conversationTypes?: ConversationType[]): IPromiseResult<IReceivedConversation[]>;
@@ -164,7 +163,7 @@ declare class RCCppEngine extends AEngine {
164
163
  key: string;
165
164
  value: string;
166
165
  }>>;
167
- getTopConversationList(): Promise<IAsyncRes<IBaseConversationInfo[]>>;
166
+ getTopConversationList(conversationTypes: ConversationType[], channelId?: string): Promise<IAsyncRes<IReceivedConversation[]>>;
168
167
  getUnreadMentionedCount(conversation: IConversationOption): Promise<IAsyncRes<number>>;
169
168
  getAllUnreadMentionedCount(): Promise<IAsyncRes<number>>;
170
169
  getAllConversationState(): Promise<IAsyncRes<IConversationState[]>>;
@@ -214,6 +213,18 @@ declare class RCCppEngine extends AEngine {
214
213
  * 获取应用主进程信息,仅限 Electron 平台可用
215
214
  */
216
215
  getMainProcessInfo(): IPromiseResult<IProcessInfo>;
216
+ /**
217
+ * 设置代理
218
+ */
219
+ setProxy(proxy: IProxy | null): IPromiseResult<IProxy>;
220
+ /**
221
+ * 获取代理
222
+ */
223
+ getProxy(): IPromiseResult<IProxy>;
224
+ /**
225
+ * 测试代理
226
+ */
227
+ testProxy(proxy: IProxy, testHost: string): Promise<IResponse>;
217
228
  }
218
229
 
219
230
  export { RCCppEngine };
package/index.esm.js CHANGED
@@ -1 +1 @@
1
- import{BasicLogger as t,VersionManage as e,LogTagId as n,ErrorCode as o,isUndefined as r,EventEmitter as i,ConnectionStatus as a,AEngine as s}from"@rongcloud/engine";import{ipcRenderer as c}from"electron";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 h(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 g(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))}var 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("logdata",t)},e}(t),y=0,M=Date.now(),d=function(t){var e=Date.now();return M!==e&&(M=e,y=0),[t,process.pid,e,y++].join("__")};e.add("electron-renderer","5.6.2-beem.6");var _=function(t){function e(e,o,r,s){var l=this,u=new i,p=new f(s.appkey,"RC-E","IM",u);return(l=t.call(this,e,o,r,s,p)||this)._connectedTime=0,l._crtUserId="",l._deviceId="",l.waitingLogs=[],l.latestSendTimestamp=0,l._resolveMaps={},l.naviInfo=null,u.on("logdata",(function(t){l.waitingLogs.push(t),l.check2SendLog()})),l.logEmitter=u,p.setOutputLevel(s.logOutputLevel),c.on("__RC_CHANNEL_NOTIFICATION_FROM_MAIN__",(function(t,e){for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];var s=r[e];if(s){if("batchMessage"===e){var c=o[0].hasMoreMsg;return delete o[0].hasMoreMsg,void s([o[0]],void 0,c)}if("onRTCDataChange"!==e){if("onNaviDataChange"===e)l.naviInfo=o[0];else if("status"===e){var u=o[0];u===a.CONNECTED&&(l._crtUserId="",l._connectedTime=0)}s(o[0])}else{var p=o[0];l._receiveRtcKv(new Uint8Array(p))}}else l.logger.error(n.L_UNSUPPORT_NTF_FROM_MAIN_E,e)})),c.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=l._resolveMaps[e];r&&(delete l._resolveMaps[e],r.apply(void 0,n))})),l._options.httpInMainProcess&&(e.httpReq=l.sendHTTPRequest.bind(l)),c.send("__RC_INNER_COMMAND_INIT__"),l}return u(e,t),e.prototype.check2SendLog=function(){var t=Date.now();t-this.latestSendTimestamp<1e3||(this.logger.debug(n.T,"send logs 2 main -> ".concat(this.waitingLogs.length)),c.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=d(t);e._resolveMaps[r]=o,c.send.apply(c,g(["__RC_CHANNEL_CALL_MAIN__",r,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,g(["callExtra",t],e,!1))},e.prototype._send2Main=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.send.apply(c,g(["__RC_CHANNEL_SEND_2_MAIN__",t],e,!1))},e.prototype._callMainSync=function(t){for(var e=[],o=1;o<arguments.length;o++)e[o-1]=arguments[o];return this.logger.info(n.L_CALL_MAIN_SYNC_O,t),c.sendSync.apply(c,g(["__RC_CHANNEL_CALL_MAIN_SYNC__",t],e,!1))},e.prototype.requestNaviInfo=function(t,e,n,o){return void 0===o&&(o=!0),p(this,void 0,void 0,(function(){var r;return h(this,(function(i){switch(i.label){case 0:return[4,this._callMain("requestNaviInfo",t,e,n,o)];case 1:return(r=i.sent())&&(this.naviInfo=r),[2,r]}}))}))},e.prototype.getNaviInfoFromCache=function(){return this.naviInfo||(this.naviInfo=this._callMainSync("getNaviInfoFromCache")),this.naviInfo},e.prototype.createLogger=function(t,e){return new f(this._appkey,t,e,this.logEmitter)},e.prototype.connect=function(t,e,n,r){return p(this,void 0,void 0,(function(){var i;return h(this,(function(a){switch(a.label){case 0:return[4,this._callMain("connect",t,e,n,r)];case 1:return(i=a.sent())===o.SUCCESS&&(this.getCurrentUserId(),this.getConnectedTime()),[2,i]}}))}))},e.prototype.reportSDKInfo=function(t){this._callMain("reportSDKInfo",t)},e.prototype.getConnectedTime=function(){return 0===this._connectedTime&&(this._connectedTime=this._callMainSync("getConnectedTime")),this._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.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){return this._callMain("getConversationsByPage",t,e,n,o)},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.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){return Promise.resolve({code:o.NOT_SUPPORT})},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.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(o.NOT_SUPPORT)},e.prototype.sendMessage=function(t,e,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(n.A_CALLBACK_E,JSON.stringify({error:null==t?void 0:t.stack,pos:"sendMsgBefore"}))}}),this._callMain("sendMessage",t,e,o,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.disconnect=function(){this._crtUserId="",this._connectedTime=0,this._send2Main("disconnect")},e.prototype.pullUserSettings=function(t){return this._callMain("pullUserSettings",t)},e.prototype.registerMessageType=function(t,e,n,o){this._send2Main("registerMessageType",t,e,n,o)},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){return this._callMain("getFileToken",t,e,n,o)},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.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.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.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 this._callMainSync("getServerTime")},e.prototype.getDeviceId=function(){return""===this._deviceId&&(this._deviceId=this._callMainSync("getDeviceId")),this._deviceId},e.prototype.getCurrentUserId=function(){return""===this._crtUserId&&(this._crtUserId=this._callMainSync("getCurrentUserId")),this._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 h(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(){throw new Error("Method not implemented.")},e.prototype.getUnreadMentionedCount=function(t){throw new Error("Method not implemented.")},e.prototype.getAllUnreadMentionedCount=function(){throw new Error("Method not implemented.")},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 p(this,void 0,void 0,(function(){return h(this,(function(t){return[2,Promise.resolve({code:o.NOT_SUPPORT})]}))}))},e.prototype.getUltraGroupDefaultNotificationLevel=function(t,e){return Promise.resolve({code:o.NOT_SUPPORT})},e.prototype.getAllUltraGroupUnreadCount=function(){return Promise.resolve({code:o.NOT_SUPPORT})},e.prototype.getUltraGroupUnreadCountByTargetId=function(){return Promise.resolve({code:o.NOT_SUPPORT})},e.prototype.setUltraGroupDefaultNotificationLevel=function(){return Promise.resolve({code:o.NOT_SUPPORT})},e.prototype.getUltraGroupUnreadMentionedMessages=function(){return Promise.resolve({code:o.NOT_SUPPORT})},e.prototype.getUltraGroupFirstUnreadMessageTimestamp=function(){return Promise.resolve({code:o.NOT_SUPPORT})},e.prototype.getOSInfo=function(){return p(this,void 0,void 0,(function(){return h(this,(function(t){return[2,this._callMain("getOSInfo")]}))}))},e.prototype.getProcessInfo=function(){return p(this,void 0,void 0,(function(){return h(this,(function(t){return[2,{code:o.SUCCESS,data:{title:process.title,pid:process.pid,ppid:process.ppid,platform:process.platform,arch:process.arch,uptime:process.uptime(),cpuUsage:process.cpuUsage(),memoryUsage:process.memoryUsage(),resourceUsage:process.resourceUsage()}}]}))}))},e.prototype.getMainProcessInfo=function(){return p(this,void 0,void 0,(function(){return h(this,(function(t){return[2,this._callMain("getMainProcessInfo")]}))}))},e}(s);window&&(window.RCCppEngine=_);export{_ as RCCppEngine};
1
+ import{BasicLogger as t,VersionManage as e,LogTagId as n,ErrorCode as o,isUndefined as r,EventEmitter as i,RCConnectionStatus as a,AEngine as s}from"@rongcloud/engine";import{ipcRenderer as c}from"electron";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 h(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 g(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))}var 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("logdata",t)},e}(t),y=0,M=Date.now(),_=function(t){var e=Date.now();return M!==e&&(M=e,y=0),[t,process.pid,e,y++].join("__")};e.add("electron-renderer","5.7.0");var d=function(t){function e(e,o,r,s){var l=this,u=new i,p=new f(s.appkey,"RC-E","IM",u);return(l=t.call(this,e,o,r,s,p)||this).waitingLogs=[],l.latestSendTimestamp=0,l._resolveMaps={},u.on("logdata",(function(t){l.waitingLogs.push(t),l.check2SendLog()})),l._logEmitter=u,p.setOutputLevel(s.logOutputLevel),c.on("__RC_CHANNEL_NOTIFICATION_FROM_MAIN__",(function(t,e){for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];var s=r[e];if(s){if("batchMessage"===e){var c=o[0].hasMoreMsg;return delete o[0].hasMoreMsg,void s([o[0]],void 0,c)}if("onRTCDataChange"!==e){if("onConnected"===e)return l._cache=o[0],void s(void 0);"onConnecting"===e?l._cache.connectionStatus=a.CONNECTING:"onNaviDataChange"===e?l._cache.naviInfo=o[0]:"onSuspend"===e?l._cache.connectionStatus=a.SUSPENDED:"onDisconnected"===e&&(l._cache.connectionStatus=a.DISCONNECTED),s(o[0])}else{var u=o[0];l._receiveRtcKv(new Uint8Array(u))}}else l.logger.error(n.L_UNSUPPORT_NTF_FROM_MAIN_E,e)})),c.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=l._resolveMaps[e];r&&(delete l._resolveMaps[e],r.apply(void 0,n))})),l._options.httpInMainProcess&&(e.httpReq=l.sendHTTPRequest.bind(l)),c.send("__RC_INNER_COMMAND_INIT__",{navigators:s.navigators}),l._cache=l._callMainSync("getMainProcessCache"),l}return u(e,t),e.prototype.check2SendLog=function(){var t=Date.now();t-this.latestSendTimestamp<1e3||(this.logger.debug(n.T,"send logs 2 main -> ".concat(this.waitingLogs.length)),c.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=_(t);e._resolveMaps[r]=o,c.send.apply(c,g(["__RC_CHANNEL_CALL_MAIN__",r,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,g(["callExtra",t],e,!1))},e.prototype._send2Main=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.send.apply(c,g(["__RC_CHANNEL_SEND_2_MAIN__",t],e,!1))},e.prototype._callMainSync=function(t){for(var e=[],o=1;o<arguments.length;o++)e[o-1]=arguments[o];return this.logger.info(n.L_CALL_MAIN_SYNC_O,t),c.sendSync.apply(c,g(["__RC_CHANNEL_CALL_MAIN_SYNC__",t],e,!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.getConnectionStatus=function(){return this._cache.connectionStatus},e.prototype.connect=function(t,e,n){return p(this,void 0,void 0,(function(){return h(this,(function(o){return[2,this._callMain("connect",t,e,n)]}))}))},e.prototype.reportSDKInfo=function(t){this._callMain("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.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){return this._callMain("getConversationsByPage",t,e,n,o)},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.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){return Promise.resolve({code:o.NOT_SUPPORT})},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.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(o.NOT_SUPPORT)},e.prototype.sendMessage=function(t,e,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(n.A_CALLBACK_E,JSON.stringify({error:null==t?void 0:t.stack,pos:"sendMsgBefore"}))}}),this._callMain("sendMessage",t,e,o,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.disconnect=function(){return p(this,void 0,void 0,(function(){return h(this,(function(t){return this._send2Main("disconnect"),[2]}))}))},e.prototype.pullUserSettings=function(t){return this._callMain("pullUserSettings",t)},e.prototype.registerMessageType=function(t,e,n,o){this._send2Main("registerMessageType",t,e,n,o)},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){return this._callMain("getFileToken",t,e,n,o)},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.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.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.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 this._callMainSync("getServerTime")},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 h(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(){throw new Error("Method not implemented.")},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 p(this,void 0,void 0,(function(){return h(this,(function(t){return[2,Promise.resolve({code:o.NOT_SUPPORT})]}))}))},e.prototype.getUltraGroupDefaultNotificationLevel=function(t,e){return Promise.resolve({code:o.NOT_SUPPORT})},e.prototype.getAllUltraGroupUnreadCount=function(){return Promise.resolve({code:o.NOT_SUPPORT})},e.prototype.getUltraGroupUnreadCountByTargetId=function(){return Promise.resolve({code:o.NOT_SUPPORT})},e.prototype.setUltraGroupDefaultNotificationLevel=function(){return Promise.resolve({code:o.NOT_SUPPORT})},e.prototype.getUltraGroupUnreadMentionedMessages=function(){return Promise.resolve({code:o.NOT_SUPPORT})},e.prototype.getUltraGroupFirstUnreadMessageTimestamp=function(){return Promise.resolve({code:o.NOT_SUPPORT})},e.prototype.getOSInfo=function(){return p(this,void 0,void 0,(function(){return h(this,(function(t){return[2,this._callMain("getOSInfo")]}))}))},e.prototype.getProcessInfo=function(){return p(this,void 0,void 0,(function(){return h(this,(function(t){return[2,{code:o.SUCCESS,data:{title:process.title,pid:process.pid,ppid:process.ppid,platform:process.platform,arch:process.arch,uptime:process.uptime(),cpuUsage:process.cpuUsage(),memoryUsage:process.memoryUsage(),resourceUsage:process.resourceUsage()}}]}))}))},e.prototype.getMainProcessInfo=function(){return p(this,void 0,void 0,(function(){return h(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}(s);window&&(window.RCCppEngine=d);export{d as RCCppEngine};
package/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@rongcloud/engine"),e=require("electron"),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))}var s=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}(t.BasicLogger),c=0,l=Date.now(),u=function(t){var e=Date.now();return l!==e&&(l=e,c=0),[t,process.pid,e,c++].join("__")};t.VersionManage.add("electron-renderer","5.6.2-beem.6");var p=function(n){function c(o,r,i,a){var c=this,l=new t.EventEmitter,u=new s(a.appkey,"RC-E","IM",l);return(c=n.call(this,o,r,i,a,u)||this)._connectedTime=0,c._crtUserId="",c._deviceId="",c.waitingLogs=[],c.latestSendTimestamp=0,c._resolveMaps={},c.naviInfo=null,l.on("logdata",(function(t){c.waitingLogs.push(t),c.check2SendLog()})),c.logEmitter=l,u.setOutputLevel(a.logOutputLevel),e.ipcRenderer.on("__RC_CHANNEL_NOTIFICATION_FROM_MAIN__",(function(e,n){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];var a=i[n];if(a){if("batchMessage"===n){var s=o[0].hasMoreMsg;return delete o[0].hasMoreMsg,void a([o[0]],void 0,s)}if("onRTCDataChange"!==n){if("onNaviDataChange"===n)c.naviInfo=o[0];else if("status"===n){var l=o[0];l===t.ConnectionStatus.CONNECTED&&(c._crtUserId="",c._connectedTime=0)}a(o[0])}else{var u=o[0];c._receiveRtcKv(new Uint8Array(u))}}else c.logger.error(t.LogTagId.L_UNSUPPORT_NTF_FROM_MAIN_E,n)})),e.ipcRenderer.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&&(o.httpReq=c.sendHTTPRequest.bind(c)),e.ipcRenderer.send("__RC_INNER_COMMAND_INIT__"),c}return o(c,n),c.prototype.check2SendLog=function(){var n=Date.now();n-this.latestSendTimestamp<1e3||(this.logger.debug(t.LogTagId.T,"send logs 2 main -> ".concat(this.waitingLogs.length)),e.ipcRenderer.send("__RC_CHANNEL_SEND_2_MAIN__","onRendererLogsReceived",this.waitingLogs.splice(0)),this.latestSendTimestamp=n)},c.prototype.sendHTTPRequest=function(t){return this._callMain("sendHTTPRequest",t)},c.prototype.setUserStatusListener=function(t,e){throw new Error("TODO -> RCCppEngine.setUserStatusListener")},c.prototype._callMain=function(t){for(var n=this,o=[],r=1;r<arguments.length;r++)o[r-1]=arguments[r];var i=new Promise((function(r){var i=u(t);n._resolveMaps[i]=r,e.ipcRenderer.send.apply(e.ipcRenderer,a(["__RC_CHANNEL_CALL_MAIN__",i,t],o,!1))}));return i},c.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))},c.prototype._send2Main=function(t){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];e.ipcRenderer.send.apply(e.ipcRenderer,a(["__RC_CHANNEL_SEND_2_MAIN__",t],n,!1))},c.prototype._callMainSync=function(n){for(var o=[],r=1;r<arguments.length;r++)o[r-1]=arguments[r];return this.logger.info(t.LogTagId.L_CALL_MAIN_SYNC_O,n),e.ipcRenderer.sendSync.apply(e.ipcRenderer,a(["__RC_CHANNEL_CALL_MAIN_SYNC__",n],o,!1))},c.prototype.requestNaviInfo=function(t,e,n,o){return void 0===o&&(o=!0),r(this,void 0,void 0,(function(){var r;return i(this,(function(i){switch(i.label){case 0:return[4,this._callMain("requestNaviInfo",t,e,n,o)];case 1:return(r=i.sent())&&(this.naviInfo=r),[2,r]}}))}))},c.prototype.getNaviInfoFromCache=function(){return this.naviInfo||(this.naviInfo=this._callMainSync("getNaviInfoFromCache")),this.naviInfo},c.prototype.createLogger=function(t,e){return new s(this._appkey,t,e,this.logEmitter)},c.prototype.connect=function(e,n,o,a){return r(this,void 0,void 0,(function(){var r;return i(this,(function(i){switch(i.label){case 0:return[4,this._callMain("connect",e,n,o,a)];case 1:return(r=i.sent())===t.ErrorCode.SUCCESS&&(this.getCurrentUserId(),this.getConnectedTime()),[2,r]}}))}))},c.prototype.reportSDKInfo=function(t){this._callMain("reportSDKInfo",t)},c.prototype.getConnectedTime=function(){return 0===this._connectedTime&&(this._connectedTime=this._callMainSync("getConnectedTime")),this._connectedTime},c.prototype.getHistoryMessage=function(t,e,n,o,r,i,a){return this._callMain("getHistoryMessage",t,e,n,o,r,i,a)},c.prototype.getHistoryMessagesByObjectNames=function(t,e,n,o,r,i,a){return this._callMain("getHistoryMessagesByObjectNames",t,e,n,o,r,i,a)},c.prototype.deleteRemoteMessage=function(t,e,n,o){return this._callMain("deleteRemoteMessage",t,e,n,o)},c.prototype.recallMsg=function(t,e,n,o,r){return this._callMain("recallMsg",t,e,n,o,r)},c.prototype.deleteRemoteMessageByTimestamp=function(t,e,n,o){return this._callMain("deleteRemoteMessageByTimestamp",t,e,n,o)},c.prototype.getConversationList=function(t,e,n,o,r){return this._callMain("getConversationList",t,e,n,o,r)},c.prototype.getConversationsByPage=function(t,e,n,o){return this._callMain("getConversationsByPage",t,e,n,o)},c.prototype.getConversationListWithAllChannel=function(){return this._callMain("getConversationListWithAllChannel")},c.prototype.getConversationListWithAllChannelByPage=function(t,e){return this._callMain("getConversationListWithAllChannelByPage",t,e)},c.prototype.getConversation=function(t,e,n){return this._callMain("getConversation",t,e,n)},c.prototype.removeConversation=function(t,e,n){return this._callMain("removeConversation",t,e,n)},c.prototype.getAllConversationUnreadCount=function(t,e,n){return this._callMain("getAllConversationUnreadCount",t,e,n)},c.prototype.getConversationUnreadCount=function(t,e,n){return this._callMain("getConversationUnreadCount",t,e,n)},c.prototype.getTotalUnreadCountByLevels=function(e,n){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},c.prototype.clearConversationUnreadCount=function(t,e,n){return this._callMain("clearConversationUnreadCount",t,e,n)},c.prototype.getFirstUnreadMessage=function(t,e,n){return this._callMain("getFirstUnreadMessage",t,e,n)},c.prototype.saveConversationMessageDraft=function(t,e,n){return this._callMain("saveConversationMessageDraft",t,e,n)},c.prototype.getConversationMessageDraft=function(t,e){return this._callMain("getConversationMessageDraft",t,e)},c.prototype.clearConversationMessageDraft=function(t,e){return this._callMain("clearConversationMessageDraft",t,e)},c.prototype.pullConversationStatus=function(t){return this._callMain("pullConversationStatus",t)},c.prototype.batchSetConversationStatus=function(e){var n=e[0].notificationLevel;return t.isUndefined(n)?this._callMain("batchSetConversationStatus",e):Promise.resolve(t.ErrorCode.NOT_SUPPORT)},c.prototype.sendMessage=function(e,n,o,r,i){var a=this,s=["sendMessageBefore",Date.now(),Math.floor(Math.random()*Date.now())].join("_");return r&&(this._resolveMaps[s]=function(e){try{r(e)}catch(e){a.logger.error(t.LogTagId.A_CALLBACK_E,JSON.stringify({error:null==e?void 0:e.stack,pos:"sendMsgBefore"}))}}),this._callMain("sendMessage",e,n,o,s,i)},c.prototype.sendReadReceiptMessage=function(t,e,n){return this._callMain("sendReadReceiptMessage",t,e,n)},c.prototype.getMessageReader=function(t,e,n){return this._callMain("getMessageReader",t,e,n)},c.prototype.disconnect=function(){this._crtUserId="",this._connectedTime=0,this._send2Main("disconnect")},c.prototype.pullUserSettings=function(t){return this._callMain("pullUserSettings",t)},c.prototype.registerMessageType=function(t,e,n,o){this._send2Main("registerMessageType",t,e,n,o)},c.prototype.joinChatroom=function(t,e){return this._callMain("joinChatroom",t,e)},c.prototype.joinExistChatroom=function(t,e){return this._callMain("joinExistChatroom",t,e)},c.prototype.quitChatroom=function(t){return this._callMain("quitChatroom",t)},c.prototype.getChatroomInfo=function(t,e,n){return this._callMain("getChatroomInfo",t,e,n)},c.prototype.getChatroomHistoryMessages=function(t,e,n,o){return this._callMain("getChatroomHistoryMessages",t,e,n,o)},c.prototype.setChatroomEntry=function(t,e){return this._callMain("setChatroomEntry",t,e)},c.prototype.setChatroomEntries=function(t,e){return this._callMain("setChatroomEntries",t,e)},c.prototype.forceSetChatroomEntry=function(t,e){return this._callMain("forceSetChatroomEntry",t,e)},c.prototype.removeChatroomEntry=function(t,e){return this._callMain("removeChatroomEntry",t,e)},c.prototype.forceRemoveChatroomEntry=function(t,e){return this._callMain("forceRemoveChatroomEntry",t,e)},c.prototype.removeChatroomEntries=function(t,e){return this._callMain("removeChatroomEntries",t,e)},c.prototype.getChatroomEntry=function(t,e){return this._callMain("getChatroomEntry",t,e)},c.prototype.getAllChatroomEntry=function(t){return this._callMain("getAllChatroomEntry",t)},c.prototype.getFileToken=function(t,e,n,o){return this._callMain("getFileToken",t,e,n,o)},c.prototype.getFileUrl=function(t,e,n,o){return this._callMain("getFileUrl",t,e,n,o)},c.prototype.setUserStatus=function(t){return this._callMain("setUserStatus",t)},c.prototype.subscribeUserStatus=function(t){return this._callMain("subscribeUserStatus",t)},c.prototype.getUserStatus=function(t){return this._callMain("getUserStatus",t)},c.prototype.clearConversations=function(t,e){return this._callMain("clearConversations",t,e)},c.prototype.addToBlacklist=function(t){return this._callMain("addToBlacklist",t)},c.prototype.removeFromBlacklist=function(t){return this._callMain("removeFromBlacklist",t)},c.prototype.getBlacklist=function(){return this._callMain("getBlacklist")},c.prototype.getBlacklistStatus=function(t){return this._callMain("getBlacklistStatus",t)},c.prototype.insertMessage=function(t,e,n){return this._callMain("insertMessage",t,e,n)},c.prototype.deleteMessages=function(t){return this._callMain("deleteMessages",t)},c.prototype.deleteMessagesByTimestamp=function(t,e,n,o,r){return this._callMain("deleteMessagesByTimestamp",t,e,n,o,r)},c.prototype.clearMessages=function(t,e,n){return this._callMain("clearMessages",t,e,n)},c.prototype.getMessage=function(t){return this._callMain("getMessage",t)},c.prototype.setMessageContent=function(t,e,n){return this._callMain("setMessageContent",t,e,n)},c.prototype.setMessageSearchField=function(t,e,n){return this._callMain("setMessageSearchField",t,e,n)},c.prototype.searchConversationByContent=function(t,e,n,o){return this._callMain("searchConversationByContent",t,e,n,o)},c.prototype.searchConversationByContentWithAllChannel=function(t,e,n){return this._callMain("searchConversationByContentWithAllChannel",t,e,n)},c.prototype.searchMessageByContentWithAllChannel=function(t,e,n,o,r){return this._callMain("searchMessageByContentWithAllChannel",t,e,n,o,r)},c.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(t,e,n,o,r,i,a){return this._callMain("searchMessageByContentInTimeRangeWithAllChannel",t,e,n,o,r,i,a)},c.prototype.searchMessageByContent=function(t,e,n,o,r,i,a){return this._callMain("searchMessageByContent",t,e,n,o,r,i,a)},c.prototype.getUnreadMentionedMessages=function(t,e,n){return this._callMainSync("getUnreadMentionedMessages",t,e,n)},c.prototype.setMessageSentStatus=function(t,e){return this._callMain("setMessageSentStatus",t,e)},c.prototype.setMessageReceivedStatus=function(t,e){return this._callMain("setMessageReceivedStatus",t,e)},c.prototype.updateMessageReceiptStatus=function(t,e,n,o){return this._callMain("updateMessageReceiptStatus",t,e,n,o)},c.prototype.clearUnreadCountByTimestamp=function(t,e,n,o){return this._callMain("clearUnreadCountByTimestamp",t,e,n,o)},c.prototype.clearAllUnreadCount=function(){throw new Error("Method not implemented.")},c.prototype.getConversationNotificationStatus=function(t,e,n){return this._callMain("getConversationNotificationStatus",t,e,n)},c.prototype.getRemoteHistoryMessages=function(t,e,n,o,r,i){return this._callMain("getRemoteHistoryMessages",t,e,n,o,r,i)},c.prototype.getServerTime=function(){return this._callMainSync("getServerTime")},c.prototype.getDeviceId=function(){return""===this._deviceId&&(this._deviceId=this._callMainSync("getDeviceId")),this._deviceId},c.prototype.getCurrentUserId=function(){return""===this._crtUserId&&(this._crtUserId=this._callMainSync("getCurrentUserId")),this._crtUserId},c.prototype.bindRTCRoomForChatroom=function(t){return this._callMain("bindRTCRoomForChatroom",t)},c.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}]}}))}))},c.prototype.rtcPing=function(t,e,n){return this._callMain("rtcPing",t,e,n)},c.prototype.createTag=function(t){return this._callMain("createTag",t)},c.prototype.removeTag=function(t){return this._callMain("removeTag",t)},c.prototype.updateTag=function(t){return this._callMain("updateTag",t)},c.prototype.getTagList=function(){return this._callMain("getTagList")},c.prototype.addTagForConversations=function(t,e){return this._callMain("addTagForConversations",t,e)},c.prototype.removeTagForConversations=function(t,e){return this._callMain("removeTagForConversations",t,e)},c.prototype.removeTagsForConversation=function(t,e){return this._callMain("removeTagsForConversation",t,e)},c.prototype.getConversationListByTag=function(t,e,n,o){return this._callMain("getConversationListByTag",t,e,n,o)},c.prototype.getUnreadCountByTag=function(t,e){return this._callMain("getUnreadCountByTag",t,e)},c.prototype.setConversationStatusInTag=function(t,e,n){return this._callMain("setConversationStatusInTag",t,e,n)},c.prototype.getTagsForConversation=function(t){return this._callMain("getTagsForConversation",t)},c.prototype.clearData=function(){return this._callMain("clearData")},c.prototype.getBlockConversationList=function(){throw new Error("Method not implemented.")},c.prototype.getGroupMessageDeliverList=function(t,e,n){return this._callMain("getGroupMessageDeliverList",t,e,n)},c.prototype.getPrivateMessageDeliverTime=function(t,e){return this._callMain("getPrivateMessageDeliverTime",t,e)},c.prototype.setCallInfo=function(t,e,n){return this._callMain("setCallInfo",t,e,n)},c.prototype.getTopConversationList=function(){throw new Error("Method not implemented.")},c.prototype.getUnreadMentionedCount=function(t){throw new Error("Method not implemented.")},c.prototype.getAllUnreadMentionedCount=function(){throw new Error("Method not implemented.")},c.prototype.getAllConversationState=function(){throw new Error("Method not implemented.")},c.prototype.getUltraGroupList=function(){throw new Error("Method not implemented.")},c.prototype.getBlockUltraGroupList=function(){throw new Error("Method not implemented.")},c.prototype.getTopUltraGroupList=function(){throw new Error("Method not implemented.")},c.prototype.clearUltraUnreadcount=function(t,e){throw new Error("Method not implemented.")},c.prototype.getUltraGroupUnreadMentionedCountByTargetId=function(t,e){throw new Error("Method not implemented.")},c.prototype.sendUltraMessage=function(t,e,n){throw new Error("Method not implemented.")},c.prototype.sendUltraGroupTypingStatus=function(t,e){throw new Error("Method not implemented.")},c.prototype.getUltraGroupMessageListByMessageUId=function(t){throw new Error("Method not implemented.")},c.prototype.expandUltraMessage=function(t){throw new Error("Method not implemented.")},c.prototype.modifyMessage=function(t){throw new Error("Method not implemented.")},c.prototype.getUltraHistoryMsg=function(t,e){throw new Error("Method not implemented.")},c.prototype.getConversationNotificationLevel=function(e,n,o){return r(this,void 0,void 0,(function(){return i(this,(function(e){return[2,Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})]}))}))},c.prototype.getUltraGroupDefaultNotificationLevel=function(e,n){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},c.prototype.getAllUltraGroupUnreadCount=function(){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},c.prototype.getUltraGroupUnreadCountByTargetId=function(){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},c.prototype.setUltraGroupDefaultNotificationLevel=function(){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},c.prototype.getUltraGroupUnreadMentionedMessages=function(){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},c.prototype.getUltraGroupFirstUnreadMessageTimestamp=function(){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},c.prototype.getOSInfo=function(){return r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this._callMain("getOSInfo")]}))}))},c.prototype.getProcessInfo=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){return[2,{code:t.ErrorCode.SUCCESS,data:{title:process.title,pid:process.pid,ppid:process.ppid,platform:process.platform,arch:process.arch,uptime:process.uptime(),cpuUsage:process.cpuUsage(),memoryUsage:process.memoryUsage(),resourceUsage:process.resourceUsage()}}]}))}))},c.prototype.getMainProcessInfo=function(){return r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this._callMain("getMainProcessInfo")]}))}))},c}(t.AEngine);window&&(window.RCCppEngine=p),exports.RCCppEngine=p;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@rongcloud/engine"),e=require("electron"),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))}var s=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}(t.BasicLogger),c=0,l=Date.now(),u=function(t){var e=Date.now();return l!==e&&(l=e,c=0),[t,process.pid,e,c++].join("__")};t.VersionManage.add("electron-renderer","5.7.0");var p=function(n){function c(o,r,i,a){var c=this,l=new t.EventEmitter,u=new s(a.appkey,"RC-E","IM",l);return(c=n.call(this,o,r,i,a,u)||this).waitingLogs=[],c.latestSendTimestamp=0,c._resolveMaps={},l.on("logdata",(function(t){c.waitingLogs.push(t),c.check2SendLog()})),c._logEmitter=l,u.setOutputLevel(a.logOutputLevel),e.ipcRenderer.on("__RC_CHANNEL_NOTIFICATION_FROM_MAIN__",(function(e,n){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];var a=i[n];if(a){if("batchMessage"===n){var s=o[0].hasMoreMsg;return delete o[0].hasMoreMsg,void a([o[0]],void 0,s)}if("onRTCDataChange"!==n){if("onConnected"===n)return c._cache=o[0],void a(void 0);"onConnecting"===n?c._cache.connectionStatus=t.RCConnectionStatus.CONNECTING:"onNaviDataChange"===n?c._cache.naviInfo=o[0]:"onSuspend"===n?c._cache.connectionStatus=t.RCConnectionStatus.SUSPENDED:"onDisconnected"===n&&(c._cache.connectionStatus=t.RCConnectionStatus.DISCONNECTED),a(o[0])}else{var l=o[0];c._receiveRtcKv(new Uint8Array(l))}}else c.logger.error(t.LogTagId.L_UNSUPPORT_NTF_FROM_MAIN_E,n)})),e.ipcRenderer.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&&(o.httpReq=c.sendHTTPRequest.bind(c)),e.ipcRenderer.send("__RC_INNER_COMMAND_INIT__",{navigators:a.navigators}),c._cache=c._callMainSync("getMainProcessCache"),c}return o(c,n),c.prototype.check2SendLog=function(){var n=Date.now();n-this.latestSendTimestamp<1e3||(this.logger.debug(t.LogTagId.T,"send logs 2 main -> ".concat(this.waitingLogs.length)),e.ipcRenderer.send("__RC_CHANNEL_SEND_2_MAIN__","onRendererLogsReceived",this.waitingLogs.splice(0)),this.latestSendTimestamp=n)},c.prototype.sendHTTPRequest=function(t){return this._callMain("sendHTTPRequest",t)},c.prototype.setUserStatusListener=function(t,e){throw new Error("TODO -> RCCppEngine.setUserStatusListener")},c.prototype._callMain=function(t){for(var n=this,o=[],r=1;r<arguments.length;r++)o[r-1]=arguments[r];var i=new Promise((function(r){var i=u(t);n._resolveMaps[i]=r,e.ipcRenderer.send.apply(e.ipcRenderer,a(["__RC_CHANNEL_CALL_MAIN__",i,t],o,!1))}));return i},c.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))},c.prototype._send2Main=function(t){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];e.ipcRenderer.send.apply(e.ipcRenderer,a(["__RC_CHANNEL_SEND_2_MAIN__",t],n,!1))},c.prototype._callMainSync=function(n){for(var o=[],r=1;r<arguments.length;r++)o[r-1]=arguments[r];return this.logger.info(t.LogTagId.L_CALL_MAIN_SYNC_O,n),e.ipcRenderer.sendSync.apply(e.ipcRenderer,a(["__RC_CHANNEL_CALL_MAIN_SYNC__",n],o,!1))},c.prototype.refetchNaviInfo=function(){return this._callMain("refetchNaviInfo")},c.prototype.getNaviInfoFromCache=function(){return this._cache.naviInfo},c.prototype.createLogger=function(t,e){return new s(this._appkey,t,e,this._logEmitter)},c.prototype.getConnectionStatus=function(){return this._cache.connectionStatus},c.prototype.connect=function(t,e,n){return r(this,void 0,void 0,(function(){return i(this,(function(o){return[2,this._callMain("connect",t,e,n)]}))}))},c.prototype.reportSDKInfo=function(t){this._callMain("reportSDKInfo",t)},c.prototype.getConnectedTime=function(){return this._cache.connectedTime},c.prototype.getHistoryMessage=function(t,e,n,o,r,i,a){return this._callMain("getHistoryMessage",t,e,n,o,r,i,a)},c.prototype.getHistoryMessagesByObjectNames=function(t,e,n,o,r,i,a){return this._callMain("getHistoryMessagesByObjectNames",t,e,n,o,r,i,a)},c.prototype.deleteRemoteMessage=function(t,e,n,o){return this._callMain("deleteRemoteMessage",t,e,n,o)},c.prototype.recallMsg=function(t,e,n,o,r){return this._callMain("recallMsg",t,e,n,o,r)},c.prototype.deleteRemoteMessageByTimestamp=function(t,e,n,o){return this._callMain("deleteRemoteMessageByTimestamp",t,e,n,o)},c.prototype.getConversationList=function(t,e,n,o,r){return this._callMain("getConversationList",t,e,n,o,r)},c.prototype.getConversationsByPage=function(t,e,n,o){return this._callMain("getConversationsByPage",t,e,n,o)},c.prototype.getUnreadConversationList=function(t){return this._callMain("getUnreadConversationList",t)},c.prototype.getConversationListWithAllChannel=function(){return this._callMain("getConversationListWithAllChannel")},c.prototype.getConversationListWithAllChannelByPage=function(t,e){return this._callMain("getConversationListWithAllChannelByPage",t,e)},c.prototype.getConversation=function(t,e,n){return this._callMain("getConversation",t,e,n)},c.prototype.removeConversation=function(t,e,n){return this._callMain("removeConversation",t,e,n)},c.prototype.getAllConversationUnreadCount=function(t,e,n){return this._callMain("getAllConversationUnreadCount",t,e,n)},c.prototype.getConversationUnreadCount=function(t,e,n){return this._callMain("getConversationUnreadCount",t,e,n)},c.prototype.getTotalUnreadCountByLevels=function(e,n){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},c.prototype.clearConversationUnreadCount=function(t,e,n){return this._callMain("clearConversationUnreadCount",t,e,n)},c.prototype.getFirstUnreadMessage=function(t,e,n){return this._callMain("getFirstUnreadMessage",t,e,n)},c.prototype.saveConversationMessageDraft=function(t,e,n){return this._callMain("saveConversationMessageDraft",t,e,n)},c.prototype.getConversationMessageDraft=function(t,e){return this._callMain("getConversationMessageDraft",t,e)},c.prototype.clearConversationMessageDraft=function(t,e){return this._callMain("clearConversationMessageDraft",t,e)},c.prototype.pullConversationStatus=function(t){return this._callMain("pullConversationStatus",t)},c.prototype.batchSetConversationStatus=function(e){var n=e[0].notificationLevel;return t.isUndefined(n)?this._callMain("batchSetConversationStatus",e):Promise.resolve(t.ErrorCode.NOT_SUPPORT)},c.prototype.sendMessage=function(e,n,o,r,i){var a=this,s=["sendMessageBefore",Date.now(),Math.floor(Math.random()*Date.now())].join("_");return r&&(this._resolveMaps[s]=function(e){try{r(e)}catch(e){a.logger.error(t.LogTagId.A_CALLBACK_E,JSON.stringify({error:null==e?void 0:e.stack,pos:"sendMsgBefore"}))}}),this._callMain("sendMessage",e,n,o,s,i)},c.prototype.sendReadReceiptMessage=function(t,e,n){return this._callMain("sendReadReceiptMessage",t,e,n)},c.prototype.getMessageReader=function(t,e,n){return this._callMain("getMessageReader",t,e,n)},c.prototype.disconnect=function(){return r(this,void 0,void 0,(function(){return i(this,(function(t){return this._send2Main("disconnect"),[2]}))}))},c.prototype.pullUserSettings=function(t){return this._callMain("pullUserSettings",t)},c.prototype.registerMessageType=function(t,e,n,o){this._send2Main("registerMessageType",t,e,n,o)},c.prototype.joinChatroom=function(t,e){return this._callMain("joinChatroom",t,e)},c.prototype.joinExistChatroom=function(t,e){return this._callMain("joinExistChatroom",t,e)},c.prototype.quitChatroom=function(t){return this._callMain("quitChatroom",t)},c.prototype.getChatroomInfo=function(t,e,n){return this._callMain("getChatroomInfo",t,e,n)},c.prototype.getChatroomHistoryMessages=function(t,e,n,o){return this._callMain("getChatroomHistoryMessages",t,e,n,o)},c.prototype.setChatroomEntry=function(t,e){return this._callMain("setChatroomEntry",t,e)},c.prototype.setChatroomEntries=function(t,e){return this._callMain("setChatroomEntries",t,e)},c.prototype.forceSetChatroomEntry=function(t,e){return this._callMain("forceSetChatroomEntry",t,e)},c.prototype.removeChatroomEntry=function(t,e){return this._callMain("removeChatroomEntry",t,e)},c.prototype.forceRemoveChatroomEntry=function(t,e){return this._callMain("forceRemoveChatroomEntry",t,e)},c.prototype.removeChatroomEntries=function(t,e){return this._callMain("removeChatroomEntries",t,e)},c.prototype.getChatroomEntry=function(t,e){return this._callMain("getChatroomEntry",t,e)},c.prototype.getAllChatroomEntry=function(t){return this._callMain("getAllChatroomEntry",t)},c.prototype.getFileToken=function(t,e,n,o){return this._callMain("getFileToken",t,e,n,o)},c.prototype.getFileUrl=function(t,e,n,o){return this._callMain("getFileUrl",t,e,n,o)},c.prototype.setUserStatus=function(t){return this._callMain("setUserStatus",t)},c.prototype.subscribeUserStatus=function(t){return this._callMain("subscribeUserStatus",t)},c.prototype.getUserStatus=function(t){return this._callMain("getUserStatus",t)},c.prototype.clearConversations=function(t,e){return this._callMain("clearConversations",t,e)},c.prototype.addToBlacklist=function(t){return this._callMain("addToBlacklist",t)},c.prototype.removeFromBlacklist=function(t){return this._callMain("removeFromBlacklist",t)},c.prototype.getBlacklist=function(){return this._callMain("getBlacklist")},c.prototype.getBlacklistStatus=function(t){return this._callMain("getBlacklistStatus",t)},c.prototype.insertMessage=function(t,e,n){return this._callMain("insertMessage",t,e,n)},c.prototype.deleteMessages=function(t){return this._callMain("deleteMessages",t)},c.prototype.deleteMessagesByTimestamp=function(t,e,n,o,r){return this._callMain("deleteMessagesByTimestamp",t,e,n,o,r)},c.prototype.clearMessages=function(t,e,n){return this._callMain("clearMessages",t,e,n)},c.prototype.getMessage=function(t){return this._callMain("getMessage",t)},c.prototype.setMessageContent=function(t,e,n){return this._callMain("setMessageContent",t,e,n)},c.prototype.setMessageSearchField=function(t,e,n){return this._callMain("setMessageSearchField",t,e,n)},c.prototype.searchConversationByContent=function(t,e,n,o){return this._callMain("searchConversationByContent",t,e,n,o)},c.prototype.searchConversationByContentWithAllChannel=function(t,e,n){return this._callMain("searchConversationByContentWithAllChannel",t,e,n)},c.prototype.searchMessageByContentWithAllChannel=function(t,e,n,o,r){return this._callMain("searchMessageByContentWithAllChannel",t,e,n,o,r)},c.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(t,e,n,o,r,i,a){return this._callMain("searchMessageByContentInTimeRangeWithAllChannel",t,e,n,o,r,i,a)},c.prototype.searchMessageByContent=function(t,e,n,o,r,i,a){return this._callMain("searchMessageByContent",t,e,n,o,r,i,a)},c.prototype.getUnreadMentionedMessages=function(t,e,n){return this._callMainSync("getUnreadMentionedMessages",t,e,n)},c.prototype.setMessageSentStatus=function(t,e){return this._callMain("setMessageSentStatus",t,e)},c.prototype.setMessageReceivedStatus=function(t,e){return this._callMain("setMessageReceivedStatus",t,e)},c.prototype.updateMessageReceiptStatus=function(t,e,n,o){return this._callMain("updateMessageReceiptStatus",t,e,n,o)},c.prototype.clearUnreadCountByTimestamp=function(t,e,n,o){return this._callMain("clearUnreadCountByTimestamp",t,e,n,o)},c.prototype.clearAllUnreadCount=function(){throw new Error("Method not implemented.")},c.prototype.getConversationNotificationStatus=function(t,e,n){return this._callMain("getConversationNotificationStatus",t,e,n)},c.prototype.getRemoteHistoryMessages=function(t,e,n,o,r,i){return this._callMain("getRemoteHistoryMessages",t,e,n,o,r,i)},c.prototype.getServerTime=function(){return this._callMainSync("getServerTime")},c.prototype.getDeviceId=function(){return this._cache.deviceId},c.prototype.getCurrentUserId=function(){return this._cache.crtUserId},c.prototype.bindRTCRoomForChatroom=function(t){return this._callMain("bindRTCRoomForChatroom",t)},c.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}]}}))}))},c.prototype.rtcPing=function(t,e,n){return this._callMain("rtcPing",t,e,n)},c.prototype.createTag=function(t){return this._callMain("createTag",t)},c.prototype.removeTag=function(t){return this._callMain("removeTag",t)},c.prototype.updateTag=function(t){return this._callMain("updateTag",t)},c.prototype.getTagList=function(){return this._callMain("getTagList")},c.prototype.addTagForConversations=function(t,e){return this._callMain("addTagForConversations",t,e)},c.prototype.removeTagForConversations=function(t,e){return this._callMain("removeTagForConversations",t,e)},c.prototype.removeTagsForConversation=function(t,e){return this._callMain("removeTagsForConversation",t,e)},c.prototype.getConversationListByTag=function(t,e,n,o){return this._callMain("getConversationListByTag",t,e,n,o)},c.prototype.getUnreadCountByTag=function(t,e){return this._callMain("getUnreadCountByTag",t,e)},c.prototype.setConversationStatusInTag=function(t,e,n){return this._callMain("setConversationStatusInTag",t,e,n)},c.prototype.getTagsForConversation=function(t){return this._callMain("getTagsForConversation",t)},c.prototype.clearData=function(){return this._callMain("clearData")},c.prototype.getBlockConversationList=function(){throw new Error("Method not implemented.")},c.prototype.getGroupMessageDeliverList=function(t,e,n){return this._callMain("getGroupMessageDeliverList",t,e,n)},c.prototype.getPrivateMessageDeliverTime=function(t,e){return this._callMain("getPrivateMessageDeliverTime",t,e)},c.prototype.setCallInfo=function(t,e,n){return this._callMain("setCallInfo",t,e,n)},c.prototype.getTopConversationList=function(t,e){return this._callMain("getTopConversationList",t,e)},c.prototype.getUnreadMentionedCount=function(t){throw new Error("Method not implemented.")},c.prototype.getAllUnreadMentionedCount=function(){throw new Error("Method not implemented.")},c.prototype.getAllConversationState=function(){throw new Error("Method not implemented.")},c.prototype.getUltraGroupList=function(){throw new Error("Method not implemented.")},c.prototype.getBlockUltraGroupList=function(){throw new Error("Method not implemented.")},c.prototype.getTopUltraGroupList=function(){throw new Error("Method not implemented.")},c.prototype.clearUltraUnreadcount=function(t,e){throw new Error("Method not implemented.")},c.prototype.getUltraGroupUnreadMentionedCountByTargetId=function(t,e){throw new Error("Method not implemented.")},c.prototype.sendUltraMessage=function(t,e,n){throw new Error("Method not implemented.")},c.prototype.sendUltraGroupTypingStatus=function(t,e){throw new Error("Method not implemented.")},c.prototype.getUltraGroupMessageListByMessageUId=function(t){throw new Error("Method not implemented.")},c.prototype.expandUltraMessage=function(t){throw new Error("Method not implemented.")},c.prototype.modifyMessage=function(t){throw new Error("Method not implemented.")},c.prototype.getUltraHistoryMsg=function(t,e){throw new Error("Method not implemented.")},c.prototype.getConversationNotificationLevel=function(e,n,o){return r(this,void 0,void 0,(function(){return i(this,(function(e){return[2,Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})]}))}))},c.prototype.getUltraGroupDefaultNotificationLevel=function(e,n){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},c.prototype.getAllUltraGroupUnreadCount=function(){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},c.prototype.getUltraGroupUnreadCountByTargetId=function(){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},c.prototype.setUltraGroupDefaultNotificationLevel=function(){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},c.prototype.getUltraGroupUnreadMentionedMessages=function(){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},c.prototype.getUltraGroupFirstUnreadMessageTimestamp=function(){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},c.prototype.getOSInfo=function(){return r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this._callMain("getOSInfo")]}))}))},c.prototype.getProcessInfo=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){return[2,{code:t.ErrorCode.SUCCESS,data:{title:process.title,pid:process.pid,ppid:process.ppid,platform:process.platform,arch:process.arch,uptime:process.uptime(),cpuUsage:process.cpuUsage(),memoryUsage:process.memoryUsage(),resourceUsage:process.resourceUsage()}}]}))}))},c.prototype.getMainProcessInfo=function(){return r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this._callMain("getMainProcessInfo")]}))}))},c.prototype.setProxy=function(t){return this._callMain("setProxy",t)},c.prototype.getProxy=function(){return this._callMain("getProxy")},c.prototype.testProxy=function(t,e){return this._callMain("testProxy",t,e)},c}(t.AEngine);window&&(window.RCCppEngine=p),exports.RCCppEngine=p;
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  ],
11
11
  "types": "index.d.ts",
12
12
  "module": "index.esm.js",
13
- "version": "5.6.2-beem.6",
13
+ "version": "5.7.0",
14
14
  "author": "pass-web@rongcloud.cn",
15
15
  "license": "LGPL 2.1",
16
16
  "homepage": "https://www.rongcloud.cn",
@@ -21,6 +21,6 @@
21
21
  "globals": "RCCppEngine"
22
22
  },
23
23
  "peerDependencies": {
24
- "@rongcloud/engine": "=5.6.2-beem.6"
24
+ "@rongcloud/engine": "=5.7.0"
25
25
  }
26
26
  }