@rongcloud/electron-renderer 5.3.4 → 5.4.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 +21 -5
- package/index.esm.js +1 -1
- package/index.js +1 -1
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AEngine, IRuntime, IEngineWatcher, IAPIContextOption, IExtraMethod, IAsyncRes, INaviInfo, ErrorCode, ConversationType, IPromiseResult, IReceivedMessage, MessageDirection, IRecallMsgOptions, IReceivedConversation, IServerConversationStatus, ISetConversationStatusOptions, ISendMsgOptions, IMessageReaderResponse, IServerUserSetting, IChatroomInfo, IChrmKVEntry, IChrmKVEntries, FileType, IUploadAuth, UploadMethod, IInsertMsgOptions, NotificationStatus, RTCMode, RTCJoinType, IRTCUserData, IJoinRTCRoomData, IRTCRoomInfo, IRTCUsers, RTCApiType, KVString, IRtcTokenData, ITagParam, ITagInfo, IConversationOption, IReceivedConversationByTag, ILocalTagStatus, IConversationTag, IServerRTCRoomEntry, RTCIdentityChangeType, IRTCJoinedInfo, IBaseConversationInfo, IConversationState, IReqRoomPKOptions, ICancelRoomPKOptions, IResRoomPKOptions, IEndRoomPKOptions, OperateStatus, IUltraMsgQueryOptions, IUltraExMsgOptions, IUltraModifyMsgOptions, IGetMsgOption, IRTCRoomBindOption, NotificationLevel } from '@rongcloud/engine';
|
|
1
|
+
import { AEngine, IRuntime, IEngineWatcher, IAPIContextOption, IExtraMethod, IAsyncRes, INaviInfo, ErrorCode, ConversationType, IPromiseResult, IReceivedMessage, MessageDirection, IRecallMsgOptions, IReceivedConversation, IServerConversationStatus, ISetConversationStatusOptions, ISendMsgOptions, IMessageReaderResponse, IServerUserSetting, IChatroomInfo, IChrmKVEntry, IChrmKVEntries, FileType, IUploadAuth, UploadMethod, IInsertMsgOptions, NotificationStatus, RTCMode, RTCJoinType, IRTCUserData, IJoinRTCRoomData, IRTCRoomInfo, IRTCUsers, RTCApiType, KVString, IRtcTokenData, ITagParam, ITagInfo, IConversationOption, IReceivedConversationByTag, ILocalTagStatus, IConversationTag, IServerRTCRoomEntry, RTCIdentityChangeType, IRTCJoinedInfo, IBaseConversationInfo, IConversationState, IReqRoomPKOptions, ICancelRoomPKOptions, IResRoomPKOptions, IEndRoomPKOptions, IUltraGroupConversation, OperateStatus, IUltraMsgQueryOptions, IUltraExMsgOptions, IUltraModifyMsgOptions, IGetMsgOption, IRTCRoomBindOption, NotificationLevel } from '@rongcloud/engine';
|
|
2
2
|
|
|
3
3
|
declare class RCCppEngine extends AEngine {
|
|
4
4
|
constructor(runtime: IRuntime, watcher: IEngineWatcher, options: IAPIContextOption);
|
|
@@ -11,6 +11,7 @@ declare class RCCppEngine extends AEngine {
|
|
|
11
11
|
private _send2Main;
|
|
12
12
|
private _callMainSync;
|
|
13
13
|
requestNaviInfo(uris: string[], appkey: string, token: string, checkCA?: boolean): Promise<INaviInfo | null>;
|
|
14
|
+
getNaviInfoFromCache(): INaviInfo | null;
|
|
14
15
|
private _insertLog2IndexDB;
|
|
15
16
|
connect(token: string, naviInfo: INaviInfo, reconnectKickEnable?: boolean, traceId?: string): Promise<ErrorCode>;
|
|
16
17
|
reportSDKInfo(versionInfo: {
|
|
@@ -21,6 +22,10 @@ declare class RCCppEngine extends AEngine {
|
|
|
21
22
|
list: IReceivedMessage[];
|
|
22
23
|
hasMore: boolean;
|
|
23
24
|
}>;
|
|
25
|
+
getHistoryMessagesByObjectNames(conversationType: ConversationType, targetId: string, timestamp: number, count: number, messageTypes: string[], order: number, channelId: string): Promise<IAsyncRes<{
|
|
26
|
+
list: IReceivedMessage[];
|
|
27
|
+
hasMore: boolean;
|
|
28
|
+
}>>;
|
|
24
29
|
deleteRemoteMessage(conversationType: ConversationType, targetId: string, messages: {
|
|
25
30
|
messageUId: string;
|
|
26
31
|
sentTime: number;
|
|
@@ -29,6 +34,7 @@ declare class RCCppEngine extends AEngine {
|
|
|
29
34
|
recallMsg(conversationType: ConversationType, targetId: string, messageUId: string, sentTime: number, recallMsgOptions: IRecallMsgOptions): IPromiseResult<IReceivedMessage>;
|
|
30
35
|
deleteRemoteMessageByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, channelId: string): Promise<ErrorCode>;
|
|
31
36
|
getConversationList(count: number, conversationType?: ConversationType, startTime?: number, order?: 0 | 1, channelId?: string): IPromiseResult<IReceivedConversation[]>;
|
|
37
|
+
getConversationsByPage(conversationTypes: ConversationType[], startTime: number, count: number, channelId: string): IPromiseResult<IReceivedConversation[]>;
|
|
32
38
|
getConversationListWithAllChannel(): IPromiseResult<IReceivedConversation[]>;
|
|
33
39
|
getConversationListWithAllChannelByPage(index: number, limit: number): IPromiseResult<IReceivedConversation[]>;
|
|
34
40
|
getConversation(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<IReceivedConversation>;
|
|
@@ -85,15 +91,23 @@ declare class RCCppEngine extends AEngine {
|
|
|
85
91
|
addToBlacklist(userId: string): Promise<ErrorCode>;
|
|
86
92
|
removeFromBlacklist(userId: string): Promise<ErrorCode>;
|
|
87
93
|
getBlacklist(): IPromiseResult<string[]>;
|
|
88
|
-
getBlacklistStatus(userId: string): IPromiseResult<
|
|
94
|
+
getBlacklistStatus(userId: string): IPromiseResult<number>;
|
|
89
95
|
insertMessage(conversationType: ConversationType, targetId: string, insertOptions: IInsertMsgOptions): IPromiseResult<IReceivedMessage>;
|
|
90
|
-
deleteMessages(
|
|
96
|
+
deleteMessages(messageIds: number[]): Promise<ErrorCode>;
|
|
91
97
|
deleteMessagesByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, cleanSpace: boolean, channelId: string): Promise<ErrorCode>;
|
|
92
98
|
clearMessages(conversationType: ConversationType, targetId: string, channelId: string): Promise<ErrorCode>;
|
|
93
99
|
getMessage(messageId: number): IPromiseResult<IReceivedMessage>;
|
|
94
100
|
setMessageContent(messageId: number, content: any, messageType: string): Promise<ErrorCode>;
|
|
95
101
|
setMessageSearchField(messageId: number, content: any, searchFiles: string): Promise<ErrorCode>;
|
|
96
102
|
searchConversationByContent(keyword: string, customMessageTypes: string[], channelId: string, conversationTypes?: ConversationType[]): IPromiseResult<IReceivedConversation[]>;
|
|
103
|
+
searchConversationByContentWithAllChannel(keyword: string, customMessageTypes: string[], conversationTypes?: ConversationType[]): IPromiseResult<IReceivedConversation[]>;
|
|
104
|
+
searchMessageByContentWithAllChannel(conversationType: ConversationType, targetId: string, keyword: string, timestamp: number, count: number): IPromiseResult<{
|
|
105
|
+
messages: IReceivedMessage[];
|
|
106
|
+
count: number;
|
|
107
|
+
}>;
|
|
108
|
+
searchMessageByContentInTimeRangeWithAllChannel(conversationType: ConversationType, targetId: string, keyword: string, startTime: number, endTime: number, offset: number, limit: number): IPromiseResult<{
|
|
109
|
+
messages: IReceivedMessage[];
|
|
110
|
+
}>;
|
|
97
111
|
searchMessageByContent(conversationType: ConversationType, targetId: string, keyword: string, timestamp: number, count: number, total: number, channelId: string): IPromiseResult<{
|
|
98
112
|
messages: IReceivedMessage[];
|
|
99
113
|
count: number;
|
|
@@ -101,6 +115,7 @@ declare class RCCppEngine extends AEngine {
|
|
|
101
115
|
getUnreadMentionedMessages(conversationType: ConversationType, targetId: string, channelId: string): IReceivedMessage[];
|
|
102
116
|
setMessageSentStatus(messageId: number, sentStatus: number): Promise<ErrorCode>;
|
|
103
117
|
setMessageReceivedStatus(messageId: number, receivedStatus: number): Promise<ErrorCode>;
|
|
118
|
+
updateMessageReceiptStatus(conversationType: ConversationType, targetId: string, timestamp: number, channelId?: string): IPromiseResult<boolean>;
|
|
104
119
|
clearUnreadCountByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, channelId: string): Promise<ErrorCode>;
|
|
105
120
|
clearAllUnreadCount(): Promise<ErrorCode>;
|
|
106
121
|
getConversationNotificationStatus(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<NotificationStatus>;
|
|
@@ -149,6 +164,7 @@ declare class RCCppEngine extends AEngine {
|
|
|
149
164
|
getUnreadCountByTag(tagId: string, containMuted: boolean): IPromiseResult<number>;
|
|
150
165
|
setConversationStatusInTag(tagId: string, conversation: IConversationOption, status: ILocalTagStatus): IPromiseResult<IAsyncRes>;
|
|
151
166
|
getTagsForConversation(conversation: IConversationOption): IPromiseResult<IConversationTag[]>;
|
|
167
|
+
clearData(): Promise<IAsyncRes<boolean>>;
|
|
152
168
|
joinLivingRoomAsAudience(roomId: string, mode: RTCMode, broadcastType?: number): Promise<IAsyncRes<{
|
|
153
169
|
token: string;
|
|
154
170
|
kvEntries: IServerRTCRoomEntry[];
|
|
@@ -165,12 +181,12 @@ declare class RCCppEngine extends AEngine {
|
|
|
165
181
|
cancelRoomPK(options: ICancelRoomPKOptions): Promise<ErrorCode>;
|
|
166
182
|
responseRoomPK(options: IResRoomPKOptions): Promise<ErrorCode>;
|
|
167
183
|
endRoomPK(options: IEndRoomPKOptions): Promise<ErrorCode>;
|
|
168
|
-
getUltraGroupList(): Promise<IAsyncRes<
|
|
184
|
+
getUltraGroupList(): Promise<IAsyncRes<IUltraGroupConversation[]>>;
|
|
169
185
|
getBlockUltraGroupList(): Promise<IAsyncRes<IBaseConversationInfo[]>>;
|
|
170
186
|
getTopUltraGroupList(): Promise<IAsyncRes<IBaseConversationInfo[]>>;
|
|
171
187
|
clearUltraUnreadcount(targetId: string, channelId: string): Promise<ErrorCode>;
|
|
172
188
|
getUltraGroupUnreadMentionedCountByTargetId(targetId: string): Promise<IAsyncRes<number>>;
|
|
173
|
-
sendUltraMessage(targetId: string, options: ISendMsgOptions): Promise<IAsyncRes>;
|
|
189
|
+
sendUltraMessage(targetId: string, options: ISendMsgOptions, onSendBefore: (messageId: number) => void): Promise<IAsyncRes>;
|
|
174
190
|
sendUltraGroupTypingStatus(options: IConversationOption, operationType?: OperateStatus): Promise<IAsyncRes>;
|
|
175
191
|
getUltraGroupMessageListByMessageUId(options: IUltraMsgQueryOptions): Promise<IAsyncRes<Object>>;
|
|
176
192
|
expandUltraMessage(options: IUltraExMsgOptions): Promise<IAsyncRes>;
|
package/index.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Logger as t,VersionManage as e,logger as o,isUndefined as n,ErrorCode as r,AEngine as i}from"@rongcloud/engine";import{ipcRenderer as a}from"electron";var s=function(t,e){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])},s(t,e)};function l(t,e,o,n){return new(o||(o=Promise))((function(r,i){function a(t){try{l(n.next(t))}catch(t){i(t)}}function s(t){try{l(n.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(a,s)}l((n=n.apply(t,e||[])).next())}))}function c(t,e){var o,n,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(i){return function(s){return function(i){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,n&&(r=2&i[0]?n.return:i[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,i[1])).done)return r;switch(n=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{o=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function u(t,e,o){if(o||2===arguments.length)for(var n,r=0,i=e.length;r<i;r++)!n&&r in e||(n||(n=Array.prototype.slice.call(e,0,r)),n[r]=e[r]);return t.concat(n||Array.prototype.slice.call(e))}var p=new t("RCRenderer"),f=0,h=Date.now(),y=function(t){var e=Date.now();return h!==e&&(h=e,f=0),[t,process.pid,e,f++].join("__")};e.add("electron-renderer","5.3.4");var g=function(t){function e(e,n,r){var i=t.call(this,e,n,r)||this;return i._resolveMaps={},o.init({customLogPrint:r.logStdout,localLogLevel:r.logLevel}),p.setLogLevel(r.logLevel),p.setLogStdout(r.logStdout),a.on("__RC_CHANNEL_NOTIFICATION_FROM_MAIN__",(function(t,e){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];var i=n[e];if(i)if("batchMessage"===e){var a=i,s=o[0].hasMoreMsg;delete o[0].hasMoreMsg,a([o[0]],void 0,s)}else if("onRTCDataChange"===e){a=i;var l=o[0][0].roomId;a(o[0],l)}else i(o[0]);else console.error.apply(console,u(["unknown notification type: ".concat(e),e],o,!1))})),a.on("__RC_CHANNEL_RESULT_FROM_MAIN__",(function(t,e){for(var o=[],n=2;n<arguments.length;n++)o[n-2]=arguments[n];p.info.apply(p,u(["__RC_CHANNEL_RESULT_FROM_MAIN__",e],o,!1));var r=i._resolveMaps[e];r&&(delete i._resolveMaps[e],r.apply(void 0,o))})),a.on("__RC_CHANNEL_CALL_RENDER__",(function(t,e){for(var o=[],n=2;n<arguments.length;n++)o[n-2]=arguments[n];i[e].apply(i,o)})),a.send("__RC_INNER_COMMAND_INIT__",i._options),i}return function(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}s(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}(e,t),e.prototype.setUserStatusListener=function(t,e){throw new Error("TODO -> setUserStatusListener")},e.prototype._callMain=function(t){for(var e=this,o=[],n=1;n<arguments.length;n++)o[n-1]=arguments[n];var r=new Promise((function(n){var r=y(t);e._resolveMaps[r]=n,p.info.apply(p,u(["__RC_CHANNEL_CALL_MAIN__",r,t],o,!1)),a.send.apply(a,u(["__RC_CHANNEL_CALL_MAIN__",r,t],o,!1))}));return r},e.prototype.callExtra=function(t){for(var e=[],o=1;o<arguments.length;o++)e[o-1]=arguments[o];return this._callMain.apply(this,u(["callExtra",t],e,!1))},e.prototype._send2Main=function(t){for(var e=[],o=1;o<arguments.length;o++)e[o-1]=arguments[o];p.info.apply(p,u(["__RC_CHANNEL_SEND_2_MAIN__",t],e,!1)),a.send.apply(a,u(["__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 p.info.apply(p,u(["__RC_CHANNEL_CALL_MAIN_SYNC__",t],e,!1)),a.sendSync.apply(a,u(["__RC_CHANNEL_CALL_MAIN_SYNC__",t],e,!1))},e.prototype.requestNaviInfo=function(t,e,o,n){return void 0===n&&(n=!0),l(this,void 0,void 0,(function(){return c(this,(function(r){return[2,this._callMain("requestNaviInfo",t,e,o,n)]}))}))},e.prototype._insertLog2IndexDB=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[0],r=t[1],i=t[2],a=t[3];o.insertIntoLogCache(n,i,r,a)},e.prototype.connect=function(t,e,o,n){return this._callMain("connect",t,e,o,n)},e.prototype.reportSDKInfo=function(t){this._callMain("reportSDKInfo",t)},e.prototype.getConnectedTime=function(){return this._callMainSync("getConnectedTime")},e.prototype.getHistoryMessage=function(t,e,o,n,r,i,a){return this._callMain("getHistoryMessage",t,e,o,n,r,i,a)},e.prototype.deleteRemoteMessage=function(t,e,o,n){return this._callMain("deleteRemoteMessage",t,e,o,n)},e.prototype.recallMsg=function(t,e,o,n,r){return this._callMain("recallMsg",t,e,o,n,r)},e.prototype.deleteRemoteMessageByTimestamp=function(t,e,o,n){return this._callMain("deleteRemoteMessageByTimestamp",t,e,o,n)},e.prototype.getConversationList=function(t,e,o,n,r){return this._callMain("getConversationList",t,e,o,n,r)},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,o){return this._callMain("getConversation",t,e,o)},e.prototype.removeConversation=function(t,e,o){return this._callMain("removeConversation",t,e,o)},e.prototype.getAllConversationUnreadCount=function(t,e,o){return this._callMain("getAllConversationUnreadCount",t,e,o)},e.prototype.getConversationUnreadCount=function(t,e,o){return this._callMain("getConversationUnreadCount",t,e,o)},e.prototype.clearConversationUnreadCount=function(t,e,o){return this._callMain("clearConversationUnreadCount",t,e,o)},e.prototype.getFirstUnreadMessage=function(t,e,o){return this._callMain("getFirstUnreadMessage",t,e,o)},e.prototype.saveConversationMessageDraft=function(t,e,o){return this._callMain("saveConversationMessageDraft",t,e,o)},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 n(e)?this._callMain("batchSetConversationStatus",t):Promise.resolve(r.NOT_SUPPORT)},e.prototype.sendMessage=function(t,e,o,n,r){var i=["sendMessageBefore",Date.now(),Math.floor(Math.random()*Date.now())].join("_");return n&&(this._resolveMaps[i]=function(t){try{n(t)}catch(t){p.error(t)}}),this._callMain("sendMessage",t,e,o,void 0,r,i)},e.prototype.sendReadReceiptMessage=function(t,e,o){return this._callMain("sendReadReceiptMessage",t,e,o)},e.prototype.getMessageReader=function(t,e,o){return this._callMain("getMessageReader",t,e,o)},e.prototype.disconnect=function(){this._send2Main("disconnect")},e.prototype.pullUserSettings=function(t){return this._callMain("pullUserSettings",t)},e.prototype.registerMessageType=function(t,e,o,n){this._send2Main("registerMessageType",t,e,o,n)},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,o){return this._callMain("getChatroomInfo",t,e,o)},e.prototype.getChatroomHistoryMessages=function(t,e,o,n){return this._callMain("getChatroomHistoryMessages",t,e,o,n)},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,o,n){return this._callMain("getFileToken",t,e,o,n)},e.prototype.getFileUrl=function(t,e,o,n){return this._callMain("getFileUrl",t,e,o,n)},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,o){return this._callMain("insertMessage",t,e,o)},e.prototype.deleteMessages=function(t){return this._callMain("deleteMessages",t)},e.prototype.deleteMessagesByTimestamp=function(t,e,o,n,r){return this._callMain("deleteMessagesByTimestamp",t,e,o,n,r)},e.prototype.clearMessages=function(t,e,o){return this._callMain("clearMessages",t,e,o)},e.prototype.getMessage=function(t){return this._callMain("getMessage",t)},e.prototype.setMessageContent=function(t,e,o){return this._callMain("setMessageContent",t,e,o)},e.prototype.setMessageSearchField=function(t,e,o){return this._callMain("setMessageSearchField",t,e,o)},e.prototype.searchConversationByContent=function(t,e,o,n){return this._callMain("searchConversationByContent",t,e,o,n)},e.prototype.searchMessageByContent=function(t,e,o,n,r,i,a){return this._callMain("searchMessageByContent",t,e,o,n,r,i,a)},e.prototype.getUnreadMentionedMessages=function(t,e,o){return this._callMainSync("getUnreadMentionedMessages",t,e,o)},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.clearUnreadCountByTimestamp=function(t,e,o,n){return this._callMain("clearUnreadCountByTimestamp",t,e,o,n)},e.prototype.clearAllUnreadCount=function(){throw new Error("Method not implemented.")},e.prototype.getConversationNotificationStatus=function(t,e,o){return this._callMain("getConversationNotificationStatus",t,e,o)},e.prototype.getRemoteHistoryMessages=function(t,e,o,n,r,i){return this._callMain("getRemoteHistoryMessages",t,e,o,n,r,i)},e.prototype.getServerTime=function(){return this._callMainSync("getServerTime")},e.prototype.getDeviceId=function(){return this._callMainSync("getDeviceId")},e.prototype.getCurrentUserId=function(){return this._callMainSync("getCurrentUserId")},e.prototype.joinRTCRoom=function(t,e,o,n,r,i){return this._callMain("joinRTCRoom",t,e,o,n,r,i)},e.prototype.quitRTCRoom=function(t){return this._callMain("quitRTCRoom",t)},e.prototype.rtcPing=function(t,e,o){return this._callMain("rtcPing",t,e,o)},e.prototype.getRTCRoomInfo=function(t){return this._callMain("getRTCRoomInfo",t)},e.prototype.getRTCUserInfoList=function(t){return this._callMain("getRTCUserInfoList",t)},e.prototype.getRTCUserInfo=function(t){return this._callMain("getRTCUserInfo",t)},e.prototype.setRTCUserInfo=function(t,e,o){return this._callMain("setRTCUserInfo",t,e,o)},e.prototype.removeRTCUserInfo=function(t,e){return this._callMain("removeRTCUserInfo",t,e)},e.prototype.setRTCData=function(t,e,o,n,r,i){return this._callMain("setRTCData",t,e,o,n,r,i)},e.prototype.setRTCTotalRes=function(t,e,o,n,r){return this._callMain("setRTCTotalRes",t,e,o,n,r)},e.prototype.setRTCCDNUris=function(t,e,o){return this._callMain("setRTCCDNUris",t,e,o)},e.prototype.getRTCData=function(t,e,o,n){return this._callMain("getRTCData",t,e,o,n)},e.prototype.removeRTCData=function(t,e,o,n,r){return this._callMain("removeRTCData",t,e,o,n,r)},e.prototype.setRTCOutData=function(t,e,o,n){return this._callMain("setRTCOutData",t,e,o,n)},e.prototype.getRTCOutData=function(t,e){return this._callMain("getRTCOutData",t,e)},e.prototype.getRTCToken=function(t,e,o){return this._callMain("getRTCToken",t,e,o)},e.prototype.setRTCState=function(t,e){return this._callMain("setRTCState",t,e)},e.prototype.getRTCUserList=function(t){return this._callMain("getRTCUserList",t)},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,o,n){return this._callMain("getConversationListByTag",t,e,o,n)},e.prototype.getUnreadCountByTag=function(t,e){return this._callMain("getUnreadCountByTag",t,e)},e.prototype.setConversationStatusInTag=function(t,e,o){return this._callMain("setConversationStatusInTag",t,e,o)},e.prototype.getTagsForConversation=function(t){return this._callMain("getTagsForConversation",t)},e.prototype.joinLivingRoomAsAudience=function(t,e,o){return this._callMain("joinLivingRoomAsAudience",t,e,o)},e.prototype.quitLivingRoomAsAudience=function(t){return this._callMain("quitLivingRoomAsAudience",t)},e.prototype.rtcIdentityChange=function(t,e,o){return this._callMain("switchLivingRoomRole",t,e,o)},e.prototype.getRTCJoinedUserInfo=function(t){return this._callMain("getRTCJoinedUserInfo",t)},e.prototype.getBlockConversationList=function(){throw new Error("Method not implemented.")},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.requestRoomPK=function(t){return this._callMain("requestRoomPK",t)},e.prototype.cancelRoomPK=function(t){return this._callMain("cancelRoomPK",t)},e.prototype.responseRoomPK=function(t){return this._callMain("responseRoomPK",t)},e.prototype.endRoomPK=function(t){return this._callMain("endRoomPK",t)},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){throw new Error("Method not implemented.")},e.prototype.sendUltraMessage=function(t,e){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.bindRTCRoomForChatroom=function(t){return this._callMain("bindRTCRoomForChatroom",t)},e.prototype.getConversationNotificationLevel=function(t,e,o){return l(this,void 0,void 0,(function(){return c(this,(function(t){return[2,Promise.resolve({code:r.NOT_SUPPORT})]}))}))},e.prototype.getUltraGroupDefaultNotificationLevel=function(t,e){return Promise.resolve({code:r.NOT_SUPPORT})},e.prototype.getAllUltraGroupUnreadCount=function(){return Promise.resolve({code:r.NOT_SUPPORT})},e.prototype.getUltraGroupUnreadCountByTargetId=function(){return Promise.resolve({code:r.NOT_SUPPORT})},e.prototype.setUltraGroupDefaultNotificationLevel=function(){return Promise.resolve({code:r.NOT_SUPPORT})},e}(i);window&&(window.RCCppEngine=g);export{g as RCCppEngine};
|
|
1
|
+
import{Logger as t,VersionManage as e,logger as n,isUndefined as o,ErrorCode as r,AEngine as i}from"@rongcloud/engine";import{ipcRenderer as a}from"electron";var s=function(t,e){return s=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])},s(t,e)};function l(t,e,n,o){return new(n||(n=Promise))((function(r,i){function a(t){try{l(o.next(t))}catch(t){i(t)}}function s(t){try{l(o.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))}function c(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(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function u(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 p=new t("RCRenderer"),h=0,f=Date.now(),y=function(t){var e=Date.now();return f!==e&&(f=e,h=0),[t,process.pid,e,h++].join("__")};e.add("electron-renderer","5.4.2");var g=function(t){function e(e,o,r){var i=t.call(this,e,o,r)||this;return i._resolveMaps={},n.init({customLogPrint:r.logStdout,localLogLevel:r.logLevel}),p.setLogLevel(r.logLevel),p.setLogStdout(r.logStdout),a.on("__RC_CHANNEL_NOTIFICATION_FROM_MAIN__",(function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=o[e];if(i)if("batchMessage"===e){var a=i,s=n[0].hasMoreMsg;delete n[0].hasMoreMsg,a([n[0]],void 0,s)}else if("onRTCDataChange"===e){a=i;var l=n[0][0].roomId;a(n[0],l)}else i(n[0]);else console.error.apply(console,u(["unknown notification type: ".concat(e),e],n,!1))})),a.on("__RC_CHANNEL_RESULT_FROM_MAIN__",(function(t,e){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];p.info.apply(p,u(["__RC_CHANNEL_RESULT_FROM_MAIN__",e],n,!1));var r=i._resolveMaps[e];r&&(delete i._resolveMaps[e],r.apply(void 0,n))})),a.on("__RC_CHANNEL_CALL_RENDER__",(function(t,e){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];i[e].apply(i,n)})),a.send("__RC_INNER_COMMAND_INIT__",i._options),i}return function(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}s(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.setUserStatusListener=function(t,e){throw new Error("TODO -> 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=y(t);e._resolveMaps[r]=o,p.info.apply(p,u(["__RC_CHANNEL_CALL_MAIN__",r,t],n,!1)),a.send.apply(a,u(["__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,u(["callExtra",t],e,!1))},e.prototype._send2Main=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];p.info.apply(p,u(["__RC_CHANNEL_SEND_2_MAIN__",t],e,!1)),a.send.apply(a,u(["__RC_CHANNEL_SEND_2_MAIN__",t],e,!1))},e.prototype._callMainSync=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return p.info.apply(p,u(["__RC_CHANNEL_CALL_MAIN_SYNC__",t],e,!1)),a.sendSync.apply(a,u(["__RC_CHANNEL_CALL_MAIN_SYNC__",t],e,!1))},e.prototype.requestNaviInfo=function(t,e,n,o){return void 0===o&&(o=!0),l(this,void 0,void 0,(function(){return c(this,(function(r){return[2,this._callMain("requestNaviInfo",t,e,n,o)]}))}))},e.prototype.getNaviInfoFromCache=function(){return this._callMainSync("getNaviInfoFromCache")},e.prototype._insertLog2IndexDB=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var o=t[0],r=t[1],i=t[2],a=t[3];n.insertIntoLogCache(o,i,r,a)},e.prototype.connect=function(t,e,n,o){return this._callMain("connect",t,e,n,o)},e.prototype.reportSDKInfo=function(t){this._callMain("reportSDKInfo",t)},e.prototype.getConnectedTime=function(){return this._callMainSync("getConnectedTime")},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.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 o(e)?this._callMain("batchSetConversationStatus",t):Promise.resolve(r.NOT_SUPPORT)},e.prototype.sendMessage=function(t,e,n,o,r){var i=["sendMessageBefore",Date.now(),Math.floor(Math.random()*Date.now())].join("_");return o&&(this._resolveMaps[i]=function(t){try{o(t)}catch(t){p.error(t)}}),this._callMain("sendMessage",t,e,n,i,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.disconnect=function(){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._callMainSync("getDeviceId")},e.prototype.getCurrentUserId=function(){return this._callMainSync("getCurrentUserId")},e.prototype.joinRTCRoom=function(t,e,n,o,r,i){return this._callMain("joinRTCRoom",t,e,n,o,r,i)},e.prototype.quitRTCRoom=function(t){return this._callMain("quitRTCRoom",t)},e.prototype.rtcPing=function(t,e,n){return this._callMain("rtcPing",t,e,n)},e.prototype.getRTCRoomInfo=function(t){return this._callMain("getRTCRoomInfo",t)},e.prototype.getRTCUserInfoList=function(t){return this._callMain("getRTCUserInfoList",t)},e.prototype.getRTCUserInfo=function(t){return this._callMain("getRTCUserInfo",t)},e.prototype.setRTCUserInfo=function(t,e,n){return this._callMain("setRTCUserInfo",t,e,n)},e.prototype.removeRTCUserInfo=function(t,e){return this._callMain("removeRTCUserInfo",t,e)},e.prototype.setRTCData=function(t,e,n,o,r,i){return this._callMain("setRTCData",t,e,n,o,r,i)},e.prototype.setRTCTotalRes=function(t,e,n,o,r){return this._callMain("setRTCTotalRes",t,e,n,o,r)},e.prototype.setRTCCDNUris=function(t,e,n){return this._callMain("setRTCCDNUris",t,e,n)},e.prototype.getRTCData=function(t,e,n,o){return this._callMain("getRTCData",t,e,n,o)},e.prototype.removeRTCData=function(t,e,n,o,r){return this._callMain("removeRTCData",t,e,n,o,r)},e.prototype.setRTCOutData=function(t,e,n,o){return this._callMain("setRTCOutData",t,e,n,o)},e.prototype.getRTCOutData=function(t,e){return this._callMain("getRTCOutData",t,e)},e.prototype.getRTCToken=function(t,e,n){return this._callMain("getRTCToken",t,e,n)},e.prototype.setRTCState=function(t,e){return this._callMain("setRTCState",t,e)},e.prototype.getRTCUserList=function(t){return this._callMain("getRTCUserList",t)},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.joinLivingRoomAsAudience=function(t,e,n){return this._callMain("joinLivingRoomAsAudience",t,e,n)},e.prototype.quitLivingRoomAsAudience=function(t){return this._callMain("quitLivingRoomAsAudience",t)},e.prototype.rtcIdentityChange=function(t,e,n){return this._callMain("switchLivingRoomRole",t,e,n)},e.prototype.getRTCJoinedUserInfo=function(t){return this._callMain("getRTCJoinedUserInfo",t)},e.prototype.getBlockConversationList=function(){throw new Error("Method not implemented.")},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.requestRoomPK=function(t){return this._callMain("requestRoomPK",t)},e.prototype.cancelRoomPK=function(t){return this._callMain("cancelRoomPK",t)},e.prototype.responseRoomPK=function(t){return this._callMain("responseRoomPK",t)},e.prototype.endRoomPK=function(t){return this._callMain("endRoomPK",t)},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){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.bindRTCRoomForChatroom=function(t){return this._callMain("bindRTCRoomForChatroom",t)},e.prototype.getConversationNotificationLevel=function(t,e,n){return l(this,void 0,void 0,(function(){return c(this,(function(t){return[2,Promise.resolve({code:r.NOT_SUPPORT})]}))}))},e.prototype.getUltraGroupDefaultNotificationLevel=function(t,e){return Promise.resolve({code:r.NOT_SUPPORT})},e.prototype.getAllUltraGroupUnreadCount=function(){return Promise.resolve({code:r.NOT_SUPPORT})},e.prototype.getUltraGroupUnreadCountByTargetId=function(){return Promise.resolve({code:r.NOT_SUPPORT})},e.prototype.setUltraGroupDefaultNotificationLevel=function(){return Promise.resolve({code:r.NOT_SUPPORT})},e}(i);window&&(window.RCCppEngine=g);export{g 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,n,o){return new(n||(n=Promise))((function(r,i){function a(t){try{l(o.next(t))}catch(t){i(t)}}function s(t){try{l(o.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))}function r(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(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function i(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 a=new t.Logger("RCRenderer"),s=0,l=Date.now(),c=function(t){var e=Date.now();return l!==e&&(l=e,s=0),[t,process.pid,e,s++].join("__")};t.VersionManage.add("electron-renderer","5.3.4");var u=function(s){function l(n,o,r){var l=s.call(this,n,o,r)||this;return l._resolveMaps={},t.logger.init({customLogPrint:r.logStdout,localLogLevel:r.logLevel}),a.setLogLevel(r.logLevel),a.setLogStdout(r.logStdout),e.ipcRenderer.on("__RC_CHANNEL_NOTIFICATION_FROM_MAIN__",(function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var a=o[e];if(a)if("batchMessage"===e){var s=a,l=n[0].hasMoreMsg;delete n[0].hasMoreMsg,s([n[0]],void 0,l)}else if("onRTCDataChange"===e){s=a;var c=n[0][0].roomId;s(n[0],c)}else a(n[0]);else console.error.apply(console,i(["unknown notification type: ".concat(e),e],n,!1))})),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];a.info.apply(a,i(["__RC_CHANNEL_RESULT_FROM_MAIN__",e],n,!1));var r=l._resolveMaps[e];r&&(delete l._resolveMaps[e],r.apply(void 0,n))})),e.ipcRenderer.on("__RC_CHANNEL_CALL_RENDER__",(function(t,e){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];l[e].apply(l,n)})),e.ipcRenderer.send("__RC_INNER_COMMAND_INIT__",l._options),l}return function(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)}(l,s),l.prototype.setUserStatusListener=function(t,e){throw new Error("TODO -> setUserStatusListener")},l.prototype._callMain=function(t){for(var n=this,o=[],r=1;r<arguments.length;r++)o[r-1]=arguments[r];var s=new Promise((function(r){var s=c(t);n._resolveMaps[s]=r,a.info.apply(a,i(["__RC_CHANNEL_CALL_MAIN__",s,t],o,!1)),e.ipcRenderer.send.apply(e.ipcRenderer,i(["__RC_CHANNEL_CALL_MAIN__",s,t],o,!1))}));return s},l.prototype.callExtra=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return this._callMain.apply(this,i(["callExtra",t],e,!1))},l.prototype._send2Main=function(t){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];a.info.apply(a,i(["__RC_CHANNEL_SEND_2_MAIN__",t],n,!1)),e.ipcRenderer.send.apply(e.ipcRenderer,i(["__RC_CHANNEL_SEND_2_MAIN__",t],n,!1))},l.prototype._callMainSync=function(t){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];return a.info.apply(a,i(["__RC_CHANNEL_CALL_MAIN_SYNC__",t],n,!1)),e.ipcRenderer.sendSync.apply(e.ipcRenderer,i(["__RC_CHANNEL_CALL_MAIN_SYNC__",t],n,!1))},l.prototype.requestNaviInfo=function(t,e,n,i){return void 0===i&&(i=!0),o(this,void 0,void 0,(function(){return r(this,(function(o){return[2,this._callMain("requestNaviInfo",t,e,n,i)]}))}))},l.prototype._insertLog2IndexDB=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var o=e[0],r=e[1],i=e[2],a=e[3];t.logger.insertIntoLogCache(o,i,r,a)},l.prototype.connect=function(t,e,n,o){return this._callMain("connect",t,e,n,o)},l.prototype.reportSDKInfo=function(t){this._callMain("reportSDKInfo",t)},l.prototype.getConnectedTime=function(){return this._callMainSync("getConnectedTime")},l.prototype.getHistoryMessage=function(t,e,n,o,r,i,a){return this._callMain("getHistoryMessage",t,e,n,o,r,i,a)},l.prototype.deleteRemoteMessage=function(t,e,n,o){return this._callMain("deleteRemoteMessage",t,e,n,o)},l.prototype.recallMsg=function(t,e,n,o,r){return this._callMain("recallMsg",t,e,n,o,r)},l.prototype.deleteRemoteMessageByTimestamp=function(t,e,n,o){return this._callMain("deleteRemoteMessageByTimestamp",t,e,n,o)},l.prototype.getConversationList=function(t,e,n,o,r){return this._callMain("getConversationList",t,e,n,o,r)},l.prototype.getConversationListWithAllChannel=function(){return this._callMain("getConversationListWithAllChannel")},l.prototype.getConversationListWithAllChannelByPage=function(t,e){return this._callMain("getConversationListWithAllChannelByPage",t,e)},l.prototype.getConversation=function(t,e,n){return this._callMain("getConversation",t,e,n)},l.prototype.removeConversation=function(t,e,n){return this._callMain("removeConversation",t,e,n)},l.prototype.getAllConversationUnreadCount=function(t,e,n){return this._callMain("getAllConversationUnreadCount",t,e,n)},l.prototype.getConversationUnreadCount=function(t,e,n){return this._callMain("getConversationUnreadCount",t,e,n)},l.prototype.clearConversationUnreadCount=function(t,e,n){return this._callMain("clearConversationUnreadCount",t,e,n)},l.prototype.getFirstUnreadMessage=function(t,e,n){return this._callMain("getFirstUnreadMessage",t,e,n)},l.prototype.saveConversationMessageDraft=function(t,e,n){return this._callMain("saveConversationMessageDraft",t,e,n)},l.prototype.getConversationMessageDraft=function(t,e){return this._callMain("getConversationMessageDraft",t,e)},l.prototype.clearConversationMessageDraft=function(t,e){return this._callMain("clearConversationMessageDraft",t,e)},l.prototype.pullConversationStatus=function(t){return this._callMain("pullConversationStatus",t)},l.prototype.batchSetConversationStatus=function(e){var n=e[0].notificationLevel;return t.isUndefined(n)?this._callMain("batchSetConversationStatus",e):Promise.resolve(t.ErrorCode.NOT_SUPPORT)},l.prototype.sendMessage=function(t,e,n,o,r){var i=["sendMessageBefore",Date.now(),Math.floor(Math.random()*Date.now())].join("_");return o&&(this._resolveMaps[i]=function(t){try{o(t)}catch(t){a.error(t)}}),this._callMain("sendMessage",t,e,n,void 0,r,i)},l.prototype.sendReadReceiptMessage=function(t,e,n){return this._callMain("sendReadReceiptMessage",t,e,n)},l.prototype.getMessageReader=function(t,e,n){return this._callMain("getMessageReader",t,e,n)},l.prototype.disconnect=function(){this._send2Main("disconnect")},l.prototype.pullUserSettings=function(t){return this._callMain("pullUserSettings",t)},l.prototype.registerMessageType=function(t,e,n,o){this._send2Main("registerMessageType",t,e,n,o)},l.prototype.joinChatroom=function(t,e){return this._callMain("joinChatroom",t,e)},l.prototype.joinExistChatroom=function(t,e){return this._callMain("joinExistChatroom",t,e)},l.prototype.quitChatroom=function(t){return this._callMain("quitChatroom",t)},l.prototype.getChatroomInfo=function(t,e,n){return this._callMain("getChatroomInfo",t,e,n)},l.prototype.getChatroomHistoryMessages=function(t,e,n,o){return this._callMain("getChatroomHistoryMessages",t,e,n,o)},l.prototype.setChatroomEntry=function(t,e){return this._callMain("setChatroomEntry",t,e)},l.prototype.setChatroomEntries=function(t,e){return this._callMain("setChatroomEntries",t,e)},l.prototype.forceSetChatroomEntry=function(t,e){return this._callMain("forceSetChatroomEntry",t,e)},l.prototype.removeChatroomEntry=function(t,e){return this._callMain("removeChatroomEntry",t,e)},l.prototype.forceRemoveChatroomEntry=function(t,e){return this._callMain("forceRemoveChatroomEntry",t,e)},l.prototype.removeChatroomEntries=function(t,e){return this._callMain("removeChatroomEntries",t,e)},l.prototype.getChatroomEntry=function(t,e){return this._callMain("getChatroomEntry",t,e)},l.prototype.getAllChatroomEntry=function(t){return this._callMain("getAllChatroomEntry",t)},l.prototype.getFileToken=function(t,e,n,o){return this._callMain("getFileToken",t,e,n,o)},l.prototype.getFileUrl=function(t,e,n,o){return this._callMain("getFileUrl",t,e,n,o)},l.prototype.setUserStatus=function(t){return this._callMain("setUserStatus",t)},l.prototype.subscribeUserStatus=function(t){return this._callMain("subscribeUserStatus",t)},l.prototype.getUserStatus=function(t){return this._callMain("getUserStatus",t)},l.prototype.clearConversations=function(t,e){return this._callMain("clearConversations",t,e)},l.prototype.addToBlacklist=function(t){return this._callMain("addToBlacklist",t)},l.prototype.removeFromBlacklist=function(t){return this._callMain("removeFromBlacklist",t)},l.prototype.getBlacklist=function(){return this._callMain("getBlacklist")},l.prototype.getBlacklistStatus=function(t){return this._callMain("getBlacklistStatus",t)},l.prototype.insertMessage=function(t,e,n){return this._callMain("insertMessage",t,e,n)},l.prototype.deleteMessages=function(t){return this._callMain("deleteMessages",t)},l.prototype.deleteMessagesByTimestamp=function(t,e,n,o,r){return this._callMain("deleteMessagesByTimestamp",t,e,n,o,r)},l.prototype.clearMessages=function(t,e,n){return this._callMain("clearMessages",t,e,n)},l.prototype.getMessage=function(t){return this._callMain("getMessage",t)},l.prototype.setMessageContent=function(t,e,n){return this._callMain("setMessageContent",t,e,n)},l.prototype.setMessageSearchField=function(t,e,n){return this._callMain("setMessageSearchField",t,e,n)},l.prototype.searchConversationByContent=function(t,e,n,o){return this._callMain("searchConversationByContent",t,e,n,o)},l.prototype.searchMessageByContent=function(t,e,n,o,r,i,a){return this._callMain("searchMessageByContent",t,e,n,o,r,i,a)},l.prototype.getUnreadMentionedMessages=function(t,e,n){return this._callMainSync("getUnreadMentionedMessages",t,e,n)},l.prototype.setMessageSentStatus=function(t,e){return this._callMain("setMessageSentStatus",t,e)},l.prototype.setMessageReceivedStatus=function(t,e){return this._callMain("setMessageReceivedStatus",t,e)},l.prototype.clearUnreadCountByTimestamp=function(t,e,n,o){return this._callMain("clearUnreadCountByTimestamp",t,e,n,o)},l.prototype.clearAllUnreadCount=function(){throw new Error("Method not implemented.")},l.prototype.getConversationNotificationStatus=function(t,e,n){return this._callMain("getConversationNotificationStatus",t,e,n)},l.prototype.getRemoteHistoryMessages=function(t,e,n,o,r,i){return this._callMain("getRemoteHistoryMessages",t,e,n,o,r,i)},l.prototype.getServerTime=function(){return this._callMainSync("getServerTime")},l.prototype.getDeviceId=function(){return this._callMainSync("getDeviceId")},l.prototype.getCurrentUserId=function(){return this._callMainSync("getCurrentUserId")},l.prototype.joinRTCRoom=function(t,e,n,o,r,i){return this._callMain("joinRTCRoom",t,e,n,o,r,i)},l.prototype.quitRTCRoom=function(t){return this._callMain("quitRTCRoom",t)},l.prototype.rtcPing=function(t,e,n){return this._callMain("rtcPing",t,e,n)},l.prototype.getRTCRoomInfo=function(t){return this._callMain("getRTCRoomInfo",t)},l.prototype.getRTCUserInfoList=function(t){return this._callMain("getRTCUserInfoList",t)},l.prototype.getRTCUserInfo=function(t){return this._callMain("getRTCUserInfo",t)},l.prototype.setRTCUserInfo=function(t,e,n){return this._callMain("setRTCUserInfo",t,e,n)},l.prototype.removeRTCUserInfo=function(t,e){return this._callMain("removeRTCUserInfo",t,e)},l.prototype.setRTCData=function(t,e,n,o,r,i){return this._callMain("setRTCData",t,e,n,o,r,i)},l.prototype.setRTCTotalRes=function(t,e,n,o,r){return this._callMain("setRTCTotalRes",t,e,n,o,r)},l.prototype.setRTCCDNUris=function(t,e,n){return this._callMain("setRTCCDNUris",t,e,n)},l.prototype.getRTCData=function(t,e,n,o){return this._callMain("getRTCData",t,e,n,o)},l.prototype.removeRTCData=function(t,e,n,o,r){return this._callMain("removeRTCData",t,e,n,o,r)},l.prototype.setRTCOutData=function(t,e,n,o){return this._callMain("setRTCOutData",t,e,n,o)},l.prototype.getRTCOutData=function(t,e){return this._callMain("getRTCOutData",t,e)},l.prototype.getRTCToken=function(t,e,n){return this._callMain("getRTCToken",t,e,n)},l.prototype.setRTCState=function(t,e){return this._callMain("setRTCState",t,e)},l.prototype.getRTCUserList=function(t){return this._callMain("getRTCUserList",t)},l.prototype.createTag=function(t){return this._callMain("createTag",t)},l.prototype.removeTag=function(t){return this._callMain("removeTag",t)},l.prototype.updateTag=function(t){return this._callMain("updateTag",t)},l.prototype.getTagList=function(){return this._callMain("getTagList")},l.prototype.addTagForConversations=function(t,e){return this._callMain("addTagForConversations",t,e)},l.prototype.removeTagForConversations=function(t,e){return this._callMain("removeTagForConversations",t,e)},l.prototype.removeTagsForConversation=function(t,e){return this._callMain("removeTagsForConversation",t,e)},l.prototype.getConversationListByTag=function(t,e,n,o){return this._callMain("getConversationListByTag",t,e,n,o)},l.prototype.getUnreadCountByTag=function(t,e){return this._callMain("getUnreadCountByTag",t,e)},l.prototype.setConversationStatusInTag=function(t,e,n){return this._callMain("setConversationStatusInTag",t,e,n)},l.prototype.getTagsForConversation=function(t){return this._callMain("getTagsForConversation",t)},l.prototype.joinLivingRoomAsAudience=function(t,e,n){return this._callMain("joinLivingRoomAsAudience",t,e,n)},l.prototype.quitLivingRoomAsAudience=function(t){return this._callMain("quitLivingRoomAsAudience",t)},l.prototype.rtcIdentityChange=function(t,e,n){return this._callMain("switchLivingRoomRole",t,e,n)},l.prototype.getRTCJoinedUserInfo=function(t){return this._callMain("getRTCJoinedUserInfo",t)},l.prototype.getBlockConversationList=function(){throw new Error("Method not implemented.")},l.prototype.getTopConversationList=function(){throw new Error("Method not implemented.")},l.prototype.getUnreadMentionedCount=function(t){throw new Error("Method not implemented.")},l.prototype.getAllUnreadMentionedCount=function(){throw new Error("Method not implemented.")},l.prototype.getAllConversationState=function(){throw new Error("Method not implemented.")},l.prototype.requestRoomPK=function(t){return this._callMain("requestRoomPK",t)},l.prototype.cancelRoomPK=function(t){return this._callMain("cancelRoomPK",t)},l.prototype.responseRoomPK=function(t){return this._callMain("responseRoomPK",t)},l.prototype.endRoomPK=function(t){return this._callMain("endRoomPK",t)},l.prototype.getUltraGroupList=function(){throw new Error("Method not implemented.")},l.prototype.getBlockUltraGroupList=function(){throw new Error("Method not implemented.")},l.prototype.getTopUltraGroupList=function(){throw new Error("Method not implemented.")},l.prototype.clearUltraUnreadcount=function(t,e){throw new Error("Method not implemented.")},l.prototype.getUltraGroupUnreadMentionedCountByTargetId=function(t){throw new Error("Method not implemented.")},l.prototype.sendUltraMessage=function(t,e){throw new Error("Method not implemented.")},l.prototype.sendUltraGroupTypingStatus=function(t,e){throw new Error("Method not implemented.")},l.prototype.getUltraGroupMessageListByMessageUId=function(t){throw new Error("Method not implemented.")},l.prototype.expandUltraMessage=function(t){throw new Error("Method not implemented.")},l.prototype.modifyMessage=function(t){throw new Error("Method not implemented.")},l.prototype.getUltraHistoryMsg=function(t,e){throw new Error("Method not implemented.")},l.prototype.bindRTCRoomForChatroom=function(t){return this._callMain("bindRTCRoomForChatroom",t)},l.prototype.getConversationNotificationLevel=function(e,n,i){return o(this,void 0,void 0,(function(){return r(this,(function(e){return[2,Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})]}))}))},l.prototype.getUltraGroupDefaultNotificationLevel=function(e,n){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},l.prototype.getAllUltraGroupUnreadCount=function(){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},l.prototype.getUltraGroupUnreadCountByTargetId=function(){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},l.prototype.setUltraGroupDefaultNotificationLevel=function(){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},l}(t.AEngine);window&&(window.RCCppEngine=u),exports.RCCppEngine=u;
|
|
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,n,o){return new(n||(n=Promise))((function(r,i){function a(t){try{l(o.next(t))}catch(t){i(t)}}function s(t){try{l(o.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))}function r(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(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function i(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 a=new t.Logger("RCRenderer"),s=0,l=Date.now(),c=function(t){var e=Date.now();return l!==e&&(l=e,s=0),[t,process.pid,e,s++].join("__")};t.VersionManage.add("electron-renderer","5.4.2");var u=function(s){function l(n,o,r){var l=s.call(this,n,o,r)||this;return l._resolveMaps={},t.logger.init({customLogPrint:r.logStdout,localLogLevel:r.logLevel}),a.setLogLevel(r.logLevel),a.setLogStdout(r.logStdout),e.ipcRenderer.on("__RC_CHANNEL_NOTIFICATION_FROM_MAIN__",(function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var a=o[e];if(a)if("batchMessage"===e){var s=a,l=n[0].hasMoreMsg;delete n[0].hasMoreMsg,s([n[0]],void 0,l)}else if("onRTCDataChange"===e){s=a;var c=n[0][0].roomId;s(n[0],c)}else a(n[0]);else console.error.apply(console,i(["unknown notification type: ".concat(e),e],n,!1))})),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];a.info.apply(a,i(["__RC_CHANNEL_RESULT_FROM_MAIN__",e],n,!1));var r=l._resolveMaps[e];r&&(delete l._resolveMaps[e],r.apply(void 0,n))})),e.ipcRenderer.on("__RC_CHANNEL_CALL_RENDER__",(function(t,e){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];l[e].apply(l,n)})),e.ipcRenderer.send("__RC_INNER_COMMAND_INIT__",l._options),l}return function(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)}(l,s),l.prototype.setUserStatusListener=function(t,e){throw new Error("TODO -> setUserStatusListener")},l.prototype._callMain=function(t){for(var n=this,o=[],r=1;r<arguments.length;r++)o[r-1]=arguments[r];var s=new Promise((function(r){var s=c(t);n._resolveMaps[s]=r,a.info.apply(a,i(["__RC_CHANNEL_CALL_MAIN__",s,t],o,!1)),e.ipcRenderer.send.apply(e.ipcRenderer,i(["__RC_CHANNEL_CALL_MAIN__",s,t],o,!1))}));return s},l.prototype.callExtra=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return this._callMain.apply(this,i(["callExtra",t],e,!1))},l.prototype._send2Main=function(t){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];a.info.apply(a,i(["__RC_CHANNEL_SEND_2_MAIN__",t],n,!1)),e.ipcRenderer.send.apply(e.ipcRenderer,i(["__RC_CHANNEL_SEND_2_MAIN__",t],n,!1))},l.prototype._callMainSync=function(t){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];return a.info.apply(a,i(["__RC_CHANNEL_CALL_MAIN_SYNC__",t],n,!1)),e.ipcRenderer.sendSync.apply(e.ipcRenderer,i(["__RC_CHANNEL_CALL_MAIN_SYNC__",t],n,!1))},l.prototype.requestNaviInfo=function(t,e,n,i){return void 0===i&&(i=!0),o(this,void 0,void 0,(function(){return r(this,(function(o){return[2,this._callMain("requestNaviInfo",t,e,n,i)]}))}))},l.prototype.getNaviInfoFromCache=function(){return this._callMainSync("getNaviInfoFromCache")},l.prototype._insertLog2IndexDB=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var o=e[0],r=e[1],i=e[2],a=e[3];t.logger.insertIntoLogCache(o,i,r,a)},l.prototype.connect=function(t,e,n,o){return this._callMain("connect",t,e,n,o)},l.prototype.reportSDKInfo=function(t){this._callMain("reportSDKInfo",t)},l.prototype.getConnectedTime=function(){return this._callMainSync("getConnectedTime")},l.prototype.getHistoryMessage=function(t,e,n,o,r,i,a){return this._callMain("getHistoryMessage",t,e,n,o,r,i,a)},l.prototype.getHistoryMessagesByObjectNames=function(t,e,n,o,r,i,a){return this._callMain("getHistoryMessagesByObjectNames",t,e,n,o,r,i,a)},l.prototype.deleteRemoteMessage=function(t,e,n,o){return this._callMain("deleteRemoteMessage",t,e,n,o)},l.prototype.recallMsg=function(t,e,n,o,r){return this._callMain("recallMsg",t,e,n,o,r)},l.prototype.deleteRemoteMessageByTimestamp=function(t,e,n,o){return this._callMain("deleteRemoteMessageByTimestamp",t,e,n,o)},l.prototype.getConversationList=function(t,e,n,o,r){return this._callMain("getConversationList",t,e,n,o,r)},l.prototype.getConversationsByPage=function(t,e,n,o){return this._callMain("getConversationsByPage",t,e,n,o)},l.prototype.getConversationListWithAllChannel=function(){return this._callMain("getConversationListWithAllChannel")},l.prototype.getConversationListWithAllChannelByPage=function(t,e){return this._callMain("getConversationListWithAllChannelByPage",t,e)},l.prototype.getConversation=function(t,e,n){return this._callMain("getConversation",t,e,n)},l.prototype.removeConversation=function(t,e,n){return this._callMain("removeConversation",t,e,n)},l.prototype.getAllConversationUnreadCount=function(t,e,n){return this._callMain("getAllConversationUnreadCount",t,e,n)},l.prototype.getConversationUnreadCount=function(t,e,n){return this._callMain("getConversationUnreadCount",t,e,n)},l.prototype.clearConversationUnreadCount=function(t,e,n){return this._callMain("clearConversationUnreadCount",t,e,n)},l.prototype.getFirstUnreadMessage=function(t,e,n){return this._callMain("getFirstUnreadMessage",t,e,n)},l.prototype.saveConversationMessageDraft=function(t,e,n){return this._callMain("saveConversationMessageDraft",t,e,n)},l.prototype.getConversationMessageDraft=function(t,e){return this._callMain("getConversationMessageDraft",t,e)},l.prototype.clearConversationMessageDraft=function(t,e){return this._callMain("clearConversationMessageDraft",t,e)},l.prototype.pullConversationStatus=function(t){return this._callMain("pullConversationStatus",t)},l.prototype.batchSetConversationStatus=function(e){var n=e[0].notificationLevel;return t.isUndefined(n)?this._callMain("batchSetConversationStatus",e):Promise.resolve(t.ErrorCode.NOT_SUPPORT)},l.prototype.sendMessage=function(t,e,n,o,r){var i=["sendMessageBefore",Date.now(),Math.floor(Math.random()*Date.now())].join("_");return o&&(this._resolveMaps[i]=function(t){try{o(t)}catch(t){a.error(t)}}),this._callMain("sendMessage",t,e,n,i,r)},l.prototype.sendReadReceiptMessage=function(t,e,n){return this._callMain("sendReadReceiptMessage",t,e,n)},l.prototype.getMessageReader=function(t,e,n){return this._callMain("getMessageReader",t,e,n)},l.prototype.disconnect=function(){this._send2Main("disconnect")},l.prototype.pullUserSettings=function(t){return this._callMain("pullUserSettings",t)},l.prototype.registerMessageType=function(t,e,n,o){this._send2Main("registerMessageType",t,e,n,o)},l.prototype.joinChatroom=function(t,e){return this._callMain("joinChatroom",t,e)},l.prototype.joinExistChatroom=function(t,e){return this._callMain("joinExistChatroom",t,e)},l.prototype.quitChatroom=function(t){return this._callMain("quitChatroom",t)},l.prototype.getChatroomInfo=function(t,e,n){return this._callMain("getChatroomInfo",t,e,n)},l.prototype.getChatroomHistoryMessages=function(t,e,n,o){return this._callMain("getChatroomHistoryMessages",t,e,n,o)},l.prototype.setChatroomEntry=function(t,e){return this._callMain("setChatroomEntry",t,e)},l.prototype.setChatroomEntries=function(t,e){return this._callMain("setChatroomEntries",t,e)},l.prototype.forceSetChatroomEntry=function(t,e){return this._callMain("forceSetChatroomEntry",t,e)},l.prototype.removeChatroomEntry=function(t,e){return this._callMain("removeChatroomEntry",t,e)},l.prototype.forceRemoveChatroomEntry=function(t,e){return this._callMain("forceRemoveChatroomEntry",t,e)},l.prototype.removeChatroomEntries=function(t,e){return this._callMain("removeChatroomEntries",t,e)},l.prototype.getChatroomEntry=function(t,e){return this._callMain("getChatroomEntry",t,e)},l.prototype.getAllChatroomEntry=function(t){return this._callMain("getAllChatroomEntry",t)},l.prototype.getFileToken=function(t,e,n,o){return this._callMain("getFileToken",t,e,n,o)},l.prototype.getFileUrl=function(t,e,n,o){return this._callMain("getFileUrl",t,e,n,o)},l.prototype.setUserStatus=function(t){return this._callMain("setUserStatus",t)},l.prototype.subscribeUserStatus=function(t){return this._callMain("subscribeUserStatus",t)},l.prototype.getUserStatus=function(t){return this._callMain("getUserStatus",t)},l.prototype.clearConversations=function(t,e){return this._callMain("clearConversations",t,e)},l.prototype.addToBlacklist=function(t){return this._callMain("addToBlacklist",t)},l.prototype.removeFromBlacklist=function(t){return this._callMain("removeFromBlacklist",t)},l.prototype.getBlacklist=function(){return this._callMain("getBlacklist")},l.prototype.getBlacklistStatus=function(t){return this._callMain("getBlacklistStatus",t)},l.prototype.insertMessage=function(t,e,n){return this._callMain("insertMessage",t,e,n)},l.prototype.deleteMessages=function(t){return this._callMain("deleteMessages",t)},l.prototype.deleteMessagesByTimestamp=function(t,e,n,o,r){return this._callMain("deleteMessagesByTimestamp",t,e,n,o,r)},l.prototype.clearMessages=function(t,e,n){return this._callMain("clearMessages",t,e,n)},l.prototype.getMessage=function(t){return this._callMain("getMessage",t)},l.prototype.setMessageContent=function(t,e,n){return this._callMain("setMessageContent",t,e,n)},l.prototype.setMessageSearchField=function(t,e,n){return this._callMain("setMessageSearchField",t,e,n)},l.prototype.searchConversationByContent=function(t,e,n,o){return this._callMain("searchConversationByContent",t,e,n,o)},l.prototype.searchConversationByContentWithAllChannel=function(t,e,n){return this._callMain("searchConversationByContentWithAllChannel",t,e,n)},l.prototype.searchMessageByContentWithAllChannel=function(t,e,n,o,r){return this._callMain("searchMessageByContentWithAllChannel",t,e,n,o,r)},l.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(t,e,n,o,r,i,a){return this._callMain("searchMessageByContentInTimeRangeWithAllChannel",t,e,n,o,r,i,a)},l.prototype.searchMessageByContent=function(t,e,n,o,r,i,a){return this._callMain("searchMessageByContent",t,e,n,o,r,i,a)},l.prototype.getUnreadMentionedMessages=function(t,e,n){return this._callMainSync("getUnreadMentionedMessages",t,e,n)},l.prototype.setMessageSentStatus=function(t,e){return this._callMain("setMessageSentStatus",t,e)},l.prototype.setMessageReceivedStatus=function(t,e){return this._callMain("setMessageReceivedStatus",t,e)},l.prototype.updateMessageReceiptStatus=function(t,e,n,o){return this._callMain("updateMessageReceiptStatus",t,e,n,o)},l.prototype.clearUnreadCountByTimestamp=function(t,e,n,o){return this._callMain("clearUnreadCountByTimestamp",t,e,n,o)},l.prototype.clearAllUnreadCount=function(){throw new Error("Method not implemented.")},l.prototype.getConversationNotificationStatus=function(t,e,n){return this._callMain("getConversationNotificationStatus",t,e,n)},l.prototype.getRemoteHistoryMessages=function(t,e,n,o,r,i){return this._callMain("getRemoteHistoryMessages",t,e,n,o,r,i)},l.prototype.getServerTime=function(){return this._callMainSync("getServerTime")},l.prototype.getDeviceId=function(){return this._callMainSync("getDeviceId")},l.prototype.getCurrentUserId=function(){return this._callMainSync("getCurrentUserId")},l.prototype.joinRTCRoom=function(t,e,n,o,r,i){return this._callMain("joinRTCRoom",t,e,n,o,r,i)},l.prototype.quitRTCRoom=function(t){return this._callMain("quitRTCRoom",t)},l.prototype.rtcPing=function(t,e,n){return this._callMain("rtcPing",t,e,n)},l.prototype.getRTCRoomInfo=function(t){return this._callMain("getRTCRoomInfo",t)},l.prototype.getRTCUserInfoList=function(t){return this._callMain("getRTCUserInfoList",t)},l.prototype.getRTCUserInfo=function(t){return this._callMain("getRTCUserInfo",t)},l.prototype.setRTCUserInfo=function(t,e,n){return this._callMain("setRTCUserInfo",t,e,n)},l.prototype.removeRTCUserInfo=function(t,e){return this._callMain("removeRTCUserInfo",t,e)},l.prototype.setRTCData=function(t,e,n,o,r,i){return this._callMain("setRTCData",t,e,n,o,r,i)},l.prototype.setRTCTotalRes=function(t,e,n,o,r){return this._callMain("setRTCTotalRes",t,e,n,o,r)},l.prototype.setRTCCDNUris=function(t,e,n){return this._callMain("setRTCCDNUris",t,e,n)},l.prototype.getRTCData=function(t,e,n,o){return this._callMain("getRTCData",t,e,n,o)},l.prototype.removeRTCData=function(t,e,n,o,r){return this._callMain("removeRTCData",t,e,n,o,r)},l.prototype.setRTCOutData=function(t,e,n,o){return this._callMain("setRTCOutData",t,e,n,o)},l.prototype.getRTCOutData=function(t,e){return this._callMain("getRTCOutData",t,e)},l.prototype.getRTCToken=function(t,e,n){return this._callMain("getRTCToken",t,e,n)},l.prototype.setRTCState=function(t,e){return this._callMain("setRTCState",t,e)},l.prototype.getRTCUserList=function(t){return this._callMain("getRTCUserList",t)},l.prototype.createTag=function(t){return this._callMain("createTag",t)},l.prototype.removeTag=function(t){return this._callMain("removeTag",t)},l.prototype.updateTag=function(t){return this._callMain("updateTag",t)},l.prototype.getTagList=function(){return this._callMain("getTagList")},l.prototype.addTagForConversations=function(t,e){return this._callMain("addTagForConversations",t,e)},l.prototype.removeTagForConversations=function(t,e){return this._callMain("removeTagForConversations",t,e)},l.prototype.removeTagsForConversation=function(t,e){return this._callMain("removeTagsForConversation",t,e)},l.prototype.getConversationListByTag=function(t,e,n,o){return this._callMain("getConversationListByTag",t,e,n,o)},l.prototype.getUnreadCountByTag=function(t,e){return this._callMain("getUnreadCountByTag",t,e)},l.prototype.setConversationStatusInTag=function(t,e,n){return this._callMain("setConversationStatusInTag",t,e,n)},l.prototype.getTagsForConversation=function(t){return this._callMain("getTagsForConversation",t)},l.prototype.clearData=function(){return this._callMain("clearData")},l.prototype.joinLivingRoomAsAudience=function(t,e,n){return this._callMain("joinLivingRoomAsAudience",t,e,n)},l.prototype.quitLivingRoomAsAudience=function(t){return this._callMain("quitLivingRoomAsAudience",t)},l.prototype.rtcIdentityChange=function(t,e,n){return this._callMain("switchLivingRoomRole",t,e,n)},l.prototype.getRTCJoinedUserInfo=function(t){return this._callMain("getRTCJoinedUserInfo",t)},l.prototype.getBlockConversationList=function(){throw new Error("Method not implemented.")},l.prototype.getTopConversationList=function(){throw new Error("Method not implemented.")},l.prototype.getUnreadMentionedCount=function(t){throw new Error("Method not implemented.")},l.prototype.getAllUnreadMentionedCount=function(){throw new Error("Method not implemented.")},l.prototype.getAllConversationState=function(){throw new Error("Method not implemented.")},l.prototype.requestRoomPK=function(t){return this._callMain("requestRoomPK",t)},l.prototype.cancelRoomPK=function(t){return this._callMain("cancelRoomPK",t)},l.prototype.responseRoomPK=function(t){return this._callMain("responseRoomPK",t)},l.prototype.endRoomPK=function(t){return this._callMain("endRoomPK",t)},l.prototype.getUltraGroupList=function(){throw new Error("Method not implemented.")},l.prototype.getBlockUltraGroupList=function(){throw new Error("Method not implemented.")},l.prototype.getTopUltraGroupList=function(){throw new Error("Method not implemented.")},l.prototype.clearUltraUnreadcount=function(t,e){throw new Error("Method not implemented.")},l.prototype.getUltraGroupUnreadMentionedCountByTargetId=function(t){throw new Error("Method not implemented.")},l.prototype.sendUltraMessage=function(t,e,n){throw new Error("Method not implemented.")},l.prototype.sendUltraGroupTypingStatus=function(t,e){throw new Error("Method not implemented.")},l.prototype.getUltraGroupMessageListByMessageUId=function(t){throw new Error("Method not implemented.")},l.prototype.expandUltraMessage=function(t){throw new Error("Method not implemented.")},l.prototype.modifyMessage=function(t){throw new Error("Method not implemented.")},l.prototype.getUltraHistoryMsg=function(t,e){throw new Error("Method not implemented.")},l.prototype.bindRTCRoomForChatroom=function(t){return this._callMain("bindRTCRoomForChatroom",t)},l.prototype.getConversationNotificationLevel=function(e,n,i){return o(this,void 0,void 0,(function(){return r(this,(function(e){return[2,Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})]}))}))},l.prototype.getUltraGroupDefaultNotificationLevel=function(e,n){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},l.prototype.getAllUltraGroupUnreadCount=function(){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},l.prototype.getUltraGroupUnreadCountByTargetId=function(){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},l.prototype.setUltraGroupDefaultNotificationLevel=function(){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},l}(t.AEngine);window&&(window.RCCppEngine=u),exports.RCCppEngine=u;
|
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.
|
|
13
|
+
"version": "5.4.2",
|
|
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.
|
|
24
|
+
"@rongcloud/engine": "=5.4.2"
|
|
25
25
|
}
|
|
26
26
|
}
|