@rongcloud/electron-renderer 5.9.0-alpha.1 → 5.9.0-alpha.3
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 +103 -42
- package/index.esm.js +1 -1
- package/index.js +1 -1
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -1,5 +1,65 @@
|
|
|
1
|
-
import { AEngine, IRuntime, Codec, InnerRTCKeyMaps, IEngineWatcher, IAPIContextOption, IExtraMethod, IAsyncRes, IPromiseResult, INaviInfo, LogType, BasicLogger, RCConnectionStatus, ConversationType, IReceivedMessage, MessageDirection, ErrorCode, IRecallMsgOptions, IReceivedConversation, IConversationOption, NotificationLevel, IFirstUnreadMessageInfo, IServerConversationStatus, ISetConversationStatusOptions, ISendMsgOptions, IMessageReaderResponse, IMessageReadReceiptV4Response, IGroupReadReceiptData, IServerUserSetting, IChatroomJoinResponse, IChatroomInfo, IChrmKVEntry, IChrmKVEntries, FileType, IUploadAuth, UploadMethod, IInsertMsgOptions, IInsertMessage, NotificationStatus, IRTCRoomBindOption, ITagParam, ITagInfo, IReceivedConversationByTag, ILocalTagStatus, IConversationTag, IBaseConversationInfo, IGroupMessageDeliverInfo, IConversationState, IUltraGroupConversation, OperateStatus, IUltraMsgQueryOptions, IUltraExMsgOptions, IUltraModifyMsgOptions, IGetMsgOption, IOSInfo, IProcessInfo, IProxy, IResponse, INetwork } from '@rongcloud/engine';
|
|
2
|
-
|
|
1
|
+
import { AEngine, IRuntime, Codec, InnerRTCKeyMaps, IEngineWatcher, IAPIContextOption, IExtraMethod, IAsyncRes, IPromiseResult, INaviInfo, LogType, BasicLogger, BasicStatistic, RCConnectionStatus, ConversationType as ConversationType$1, IReceivedMessage, MessageDirection, ErrorCode, IRecallMsgOptions, IReceivedConversation, IConversationOption, NotificationLevel, IFirstUnreadMessageInfo, IServerConversationStatus, ISetConversationStatusOptions, ISendMsgOptions, IMessageReaderResponse, IMessageReadReceiptV4Response, IGroupReadReceiptData, IServerUserSetting, IChatroomJoinResponse, IChatroomInfo, IChrmKVEntry, IChrmKVEntries, FileType, IUploadAuth, UploadMethod, IInsertMsgOptions, IInsertMessage, NotificationStatus, IRTCRoomBindOption, ITagParam, ITagInfo, IReceivedConversationByTag, ILocalTagStatus, IConversationTag, IBaseConversationInfo, IGroupMessageDeliverInfo, IConversationState, IUltraGroupConversation, OperateStatus, IUltraMsgQueryOptions, IUltraExMsgOptions, IUltraModifyMsgOptions, IGetMsgOption, IOSInfo, IProcessInfo, IProxy, IResponse, INetwork } from '@rongcloud/engine';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 会话类型
|
|
5
|
+
* @category Enum
|
|
6
|
+
*/
|
|
7
|
+
declare enum ConversationType {
|
|
8
|
+
/**
|
|
9
|
+
* 无类型
|
|
10
|
+
*/
|
|
11
|
+
NONE = 0,
|
|
12
|
+
/**
|
|
13
|
+
* 单聊
|
|
14
|
+
*/
|
|
15
|
+
PRIVATE = 1,
|
|
16
|
+
/**
|
|
17
|
+
* 讨论组
|
|
18
|
+
*/
|
|
19
|
+
DISCUSSION = 2,
|
|
20
|
+
/**
|
|
21
|
+
* 群组聊天
|
|
22
|
+
*/
|
|
23
|
+
GROUP = 3,
|
|
24
|
+
/**
|
|
25
|
+
* 聊天室会话
|
|
26
|
+
*/
|
|
27
|
+
CHATROOM = 4,
|
|
28
|
+
/**
|
|
29
|
+
* 客服会话
|
|
30
|
+
*/
|
|
31
|
+
CUSTOMER_SERVICE = 5,
|
|
32
|
+
/**
|
|
33
|
+
* 系统消息
|
|
34
|
+
*/
|
|
35
|
+
SYSTEM = 6,
|
|
36
|
+
/**
|
|
37
|
+
* 默认关注的公众号会话类型(MC)
|
|
38
|
+
*/
|
|
39
|
+
APP_PUBLIC_SERVICE = 7,
|
|
40
|
+
/**
|
|
41
|
+
* 需手动关注的公众号会话类型(MP)
|
|
42
|
+
*/
|
|
43
|
+
PUBLIC_SERVICE = 8,
|
|
44
|
+
/**
|
|
45
|
+
* 超级群
|
|
46
|
+
*/
|
|
47
|
+
ULTRA_GROUP = 10,
|
|
48
|
+
/**
|
|
49
|
+
* RTCLib 特有的会话类型
|
|
50
|
+
*/
|
|
51
|
+
RTC_ROOM = 12
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @category Interface
|
|
56
|
+
*/
|
|
57
|
+
interface IClearMessageOption {
|
|
58
|
+
targetId: string;
|
|
59
|
+
conversationType: ConversationType;
|
|
60
|
+
channelId?: string;
|
|
61
|
+
timestamp?: number;
|
|
62
|
+
}
|
|
3
63
|
|
|
4
64
|
declare class RCCppEngine extends AEngine {
|
|
5
65
|
private readonly _logEmitter;
|
|
@@ -28,52 +88,53 @@ declare class RCCppEngine extends AEngine {
|
|
|
28
88
|
refetchNaviInfo(): IPromiseResult<INaviInfo | null>;
|
|
29
89
|
getNaviInfoFromCache(): INaviInfo | null;
|
|
30
90
|
createLogger(id: string, type: LogType): BasicLogger;
|
|
91
|
+
createStatisticLogger(id: string, type: LogType): BasicStatistic;
|
|
31
92
|
getConnectionStatus(): RCConnectionStatus;
|
|
32
93
|
connect(token: string, reconnectKickEnable: boolean, openCallPlus: boolean, traceId: string): IPromiseResult<string>;
|
|
33
94
|
reportSDKInfo(versionInfo: {
|
|
34
95
|
[name: string]: string;
|
|
35
96
|
}): void;
|
|
36
97
|
getConnectedTime(): number;
|
|
37
|
-
getHistoryMessage(conversationType: ConversationType, targetId: string, timestamp: number, count: number, order: 0 | 1, channelId: string, objectName: string): IPromiseResult<{
|
|
98
|
+
getHistoryMessage(conversationType: ConversationType$1, targetId: string, timestamp: number, count: number, order: 0 | 1, channelId: string, objectName: string): IPromiseResult<{
|
|
38
99
|
list: IReceivedMessage[];
|
|
39
100
|
hasMore: boolean;
|
|
40
101
|
}>;
|
|
41
|
-
getMessages(conversationType: ConversationType, targetId: string, timestamp: number, count: number, order: 0 | 1, channelId: string): IPromiseResult<{
|
|
102
|
+
getMessages(conversationType: ConversationType$1, targetId: string, timestamp: number, count: number, order: 0 | 1, channelId: string): IPromiseResult<{
|
|
42
103
|
list: IReceivedMessage[];
|
|
43
104
|
hasMore: boolean;
|
|
44
105
|
}>;
|
|
45
|
-
getHistoryMessagesByObjectNames(conversationType: ConversationType, targetId: string, timestamp: number, count: number, messageTypes: string[], order: number, channelId: string): Promise<IAsyncRes<{
|
|
106
|
+
getHistoryMessagesByObjectNames(conversationType: ConversationType$1, targetId: string, timestamp: number, count: number, messageTypes: string[], order: number, channelId: string): Promise<IAsyncRes<{
|
|
46
107
|
list: IReceivedMessage[];
|
|
47
108
|
hasMore: boolean;
|
|
48
109
|
}>>;
|
|
49
|
-
deleteRemoteMessage(conversationType: ConversationType, targetId: string, messages: {
|
|
110
|
+
deleteRemoteMessage(conversationType: ConversationType$1, targetId: string, messages: {
|
|
50
111
|
messageUId: string;
|
|
51
112
|
sentTime: number;
|
|
52
113
|
messageDirection: MessageDirection;
|
|
53
114
|
}[], channelId: string): Promise<ErrorCode>;
|
|
54
|
-
recallMsg(conversationType: ConversationType, targetId: string, messageUId: string, sentTime: number, recallMsgOptions: IRecallMsgOptions): IPromiseResult<IReceivedMessage>;
|
|
55
|
-
deleteRemoteMessageByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, channelId: string): Promise<ErrorCode>;
|
|
56
|
-
getConversationList(count: number, conversationType?: ConversationType, startTime?: number, order?: 0 | 1, channelId?: string): IPromiseResult<IReceivedConversation[]>;
|
|
57
|
-
getConversationsByPage(conversationTypes: ConversationType[], startTime: number, count: number, channelId: string): IPromiseResult<IReceivedConversation[]>;
|
|
58
|
-
getUnreadConversationList(conversationTypes: ConversationType[]): IPromiseResult<IReceivedConversation[]>;
|
|
115
|
+
recallMsg(conversationType: ConversationType$1, targetId: string, messageUId: string, sentTime: number, recallMsgOptions: IRecallMsgOptions): IPromiseResult<IReceivedMessage>;
|
|
116
|
+
deleteRemoteMessageByTimestamp(conversationType: ConversationType$1, targetId: string, timestamp: number, channelId: string): Promise<ErrorCode>;
|
|
117
|
+
getConversationList(count: number, conversationType?: ConversationType$1, startTime?: number, order?: 0 | 1, channelId?: string): IPromiseResult<IReceivedConversation[]>;
|
|
118
|
+
getConversationsByPage(conversationTypes: ConversationType$1[], startTime: number, count: number, channelId: string): IPromiseResult<IReceivedConversation[]>;
|
|
119
|
+
getUnreadConversationList(conversationTypes: ConversationType$1[]): IPromiseResult<IReceivedConversation[]>;
|
|
59
120
|
getConversationListWithAllChannel(): IPromiseResult<IReceivedConversation[]>;
|
|
60
121
|
getConversationListWithAllChannelByPage(index: number, limit: number): IPromiseResult<IReceivedConversation[]>;
|
|
61
|
-
getConversation(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<IReceivedConversation>;
|
|
62
|
-
removeConversation(conversationType: ConversationType, targetId: string, channelId: string): Promise<ErrorCode>;
|
|
122
|
+
getConversation(conversationType: ConversationType$1, targetId: string, channelId: string): IPromiseResult<IReceivedConversation>;
|
|
123
|
+
removeConversation(conversationType: ConversationType$1, targetId: string, channelId: string): Promise<ErrorCode>;
|
|
63
124
|
batchRemoveConversation(conversations: IConversationOption[]): Promise<ErrorCode>;
|
|
64
|
-
getAllConversationUnreadCount(channelIds: string, conversationTypes: ConversationType[], includeMuted: boolean): IPromiseResult<number>;
|
|
65
|
-
getConversationUnreadCount(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<number>;
|
|
66
|
-
getTotalUnreadCountByLevels(conversationTypes: ConversationType[], levels: NotificationLevel[], isMentioned?: boolean): Promise<IAsyncRes<number>>;
|
|
67
|
-
clearConversationUnreadCount(conversationType: ConversationType, targetId: string, channelId: string): Promise<ErrorCode>;
|
|
68
|
-
getFirstUnreadMessage(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<IReceivedMessage | null>;
|
|
69
|
-
getFirstUnreadMessageInfo(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<IFirstUnreadMessageInfo | null>;
|
|
70
|
-
saveConversationMessageDraft(conversationType: ConversationType, targetId: string, draft: string): Promise<ErrorCode>;
|
|
71
|
-
getConversationMessageDraft(conversationType: ConversationType, targetId: string): IPromiseResult<string>;
|
|
72
|
-
clearConversationMessageDraft(conversationType: ConversationType, targetId: string): Promise<ErrorCode>;
|
|
125
|
+
getAllConversationUnreadCount(channelIds: string, conversationTypes: ConversationType$1[], includeMuted: boolean): IPromiseResult<number>;
|
|
126
|
+
getConversationUnreadCount(conversationType: ConversationType$1, targetId: string, channelId: string): IPromiseResult<number>;
|
|
127
|
+
getTotalUnreadCountByLevels(conversationTypes: ConversationType$1[], levels: NotificationLevel[], isMentioned?: boolean): Promise<IAsyncRes<number>>;
|
|
128
|
+
clearConversationUnreadCount(conversationType: ConversationType$1, targetId: string, channelId: string): Promise<ErrorCode>;
|
|
129
|
+
getFirstUnreadMessage(conversationType: ConversationType$1, targetId: string, channelId: string): IPromiseResult<IReceivedMessage | null>;
|
|
130
|
+
getFirstUnreadMessageInfo(conversationType: ConversationType$1, targetId: string, channelId: string): IPromiseResult<IFirstUnreadMessageInfo | null>;
|
|
131
|
+
saveConversationMessageDraft(conversationType: ConversationType$1, targetId: string, draft: string): Promise<ErrorCode>;
|
|
132
|
+
getConversationMessageDraft(conversationType: ConversationType$1, targetId: string): IPromiseResult<string>;
|
|
133
|
+
clearConversationMessageDraft(conversationType: ConversationType$1, targetId: string): Promise<ErrorCode>;
|
|
73
134
|
pullConversationStatus(timestamp: number): Promise<IAsyncRes<IServerConversationStatus[]>>;
|
|
74
135
|
batchSetConversationStatus(statusList: ISetConversationStatusOptions[]): Promise<ErrorCode>;
|
|
75
136
|
batchSetConversationToTop(conversations: IConversationOption[], isTop: boolean, isCreateConversation?: boolean): Promise<ErrorCode>;
|
|
76
|
-
sendMessage(conversationType: ConversationType, targetId: string, options: ISendMsgOptions, onBefore?: (messageId: number) => void, traceId?: string): IPromiseResult<IReceivedMessage>;
|
|
137
|
+
sendMessage(conversationType: ConversationType$1, targetId: string, options: ISendMsgOptions, onBefore?: (messageId: number) => void, traceId?: string): IPromiseResult<IReceivedMessage>;
|
|
77
138
|
sendReadReceiptMessage(targetId: string, messageUIds: string[], channelId?: string): Promise<IAsyncRes>;
|
|
78
139
|
getMessageReader(targetId: string, messageUId: string, channelId?: string): IPromiseResult<IMessageReaderResponse>;
|
|
79
140
|
/**
|
|
@@ -128,46 +189,46 @@ declare class RCCppEngine extends AEngine {
|
|
|
128
189
|
getUserStatus(userId: string): IPromiseResult<{
|
|
129
190
|
status: string;
|
|
130
191
|
}>;
|
|
131
|
-
clearConversations(conversationTypes?: ConversationType[], channelId?: string): Promise<ErrorCode>;
|
|
192
|
+
clearConversations(conversationTypes?: ConversationType$1[], channelId?: string): Promise<ErrorCode>;
|
|
132
193
|
addToBlacklist(userId: string): Promise<ErrorCode>;
|
|
133
194
|
removeFromBlacklist(userId: string): Promise<ErrorCode>;
|
|
134
195
|
getBlacklist(): IPromiseResult<string[]>;
|
|
135
196
|
getBlacklistStatus(userId: string): IPromiseResult<number>;
|
|
136
|
-
insertMessage(conversationType: ConversationType, targetId: string, insertOptions: IInsertMsgOptions): IPromiseResult<IReceivedMessage>;
|
|
197
|
+
insertMessage(conversationType: ConversationType$1, targetId: string, insertOptions: IInsertMsgOptions): IPromiseResult<IReceivedMessage>;
|
|
137
198
|
batchInsertMessage(messages: IInsertMessage[], checkDuplicate: boolean): IPromiseResult<boolean>;
|
|
138
|
-
getMessageCount(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<number>;
|
|
199
|
+
getMessageCount(conversationType: ConversationType$1, targetId: string, channelId: string): IPromiseResult<number>;
|
|
139
200
|
deleteMessages(messageIds: number[]): Promise<ErrorCode>;
|
|
140
|
-
deleteMessagesByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, cleanSpace: boolean, channelId: string): Promise<ErrorCode>;
|
|
201
|
+
deleteMessagesByTimestamp(conversationType: ConversationType$1, targetId: string, timestamp: number, cleanSpace: boolean, channelId: string): Promise<ErrorCode>;
|
|
141
202
|
batchClearMessagesByTimestamp(options: IClearMessageOption[]): Promise<ErrorCode>;
|
|
142
203
|
batchClearRemoteHistoryMessages(options: IClearMessageOption[], isDeleteLocal?: boolean): Promise<ErrorCode>;
|
|
143
|
-
clearMessages(conversationType: ConversationType, targetId: string, channelId: string): Promise<ErrorCode>;
|
|
204
|
+
clearMessages(conversationType: ConversationType$1, targetId: string, channelId: string): Promise<ErrorCode>;
|
|
144
205
|
getMessage(messageId: number | string): IPromiseResult<IReceivedMessage>;
|
|
145
206
|
setMessageContent(messageId: number, content: any, messageType: string): Promise<ErrorCode>;
|
|
146
207
|
setMessageSearchField(messageId: number, content: any, searchFiles: string): Promise<ErrorCode>;
|
|
147
|
-
searchConversationByContent(keyword: string, customMessageTypes: string[], channelId: string, conversationTypes?: ConversationType[]): IPromiseResult<IReceivedConversation[]>;
|
|
148
|
-
searchConversationByContentWithAllChannel(keyword: string, customMessageTypes: string[], conversationTypes?: ConversationType[]): IPromiseResult<IReceivedConversation[]>;
|
|
149
|
-
searchMessageByContentWithAllChannel(conversationType: ConversationType, targetId: string, keyword: string, timestamp: number, count: number): IPromiseResult<{
|
|
208
|
+
searchConversationByContent(keyword: string, customMessageTypes: string[], channelId: string, conversationTypes?: ConversationType$1[]): IPromiseResult<IReceivedConversation[]>;
|
|
209
|
+
searchConversationByContentWithAllChannel(keyword: string, customMessageTypes: string[], conversationTypes?: ConversationType$1[]): IPromiseResult<IReceivedConversation[]>;
|
|
210
|
+
searchMessageByContentWithAllChannel(conversationType: ConversationType$1, targetId: string, keyword: string, timestamp: number, count: number): IPromiseResult<{
|
|
150
211
|
messages: IReceivedMessage[];
|
|
151
212
|
count: number;
|
|
152
213
|
}>;
|
|
153
|
-
searchMessageByContentInTimeRangeWithAllChannel(conversationType: ConversationType, targetId: string, keyword: string, startTime: number, endTime: number, offset: number, limit: number): IPromiseResult<{
|
|
214
|
+
searchMessageByContentInTimeRangeWithAllChannel(conversationType: ConversationType$1, targetId: string, keyword: string, startTime: number, endTime: number, offset: number, limit: number): IPromiseResult<{
|
|
154
215
|
messages: IReceivedMessage[];
|
|
155
216
|
}>;
|
|
156
|
-
searchMessageByContent(conversationType: ConversationType, targetId: string, keyword: string, timestamp: number, count: number, total: number, channelId: string): IPromiseResult<{
|
|
217
|
+
searchMessageByContent(conversationType: ConversationType$1, targetId: string, keyword: string, timestamp: number, count: number, total: number, channelId: string): IPromiseResult<{
|
|
157
218
|
messages: IReceivedMessage[];
|
|
158
219
|
count: number;
|
|
159
220
|
}>;
|
|
160
|
-
searchMessagesByUser(conversationType: ConversationType, targetId: string, userId: string, timestamp: number, count: number, channelId: string): IPromiseResult<{
|
|
221
|
+
searchMessagesByUser(conversationType: ConversationType$1, targetId: string, userId: string, timestamp: number, count: number, channelId: string): IPromiseResult<{
|
|
161
222
|
messages: IReceivedMessage[];
|
|
162
223
|
}>;
|
|
163
|
-
getUnreadMentionedMessages(conversationType: ConversationType, targetId: string, channelId: string): IReceivedMessage[];
|
|
224
|
+
getUnreadMentionedMessages(conversationType: ConversationType$1, targetId: string, channelId: string): IReceivedMessage[];
|
|
164
225
|
setMessageSentStatus(messageId: number, sentStatus: number): Promise<ErrorCode>;
|
|
165
226
|
setMessageReceivedStatus(messageId: number, receivedStatus: number): Promise<ErrorCode>;
|
|
166
|
-
updateMessageReceiptStatus(conversationType: ConversationType, targetId: string, timestamp: number, channelId?: string): IPromiseResult<boolean>;
|
|
167
|
-
clearUnreadCountByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, channelId: string): Promise<ErrorCode>;
|
|
227
|
+
updateMessageReceiptStatus(conversationType: ConversationType$1, targetId: string, timestamp: number, channelId?: string): IPromiseResult<boolean>;
|
|
228
|
+
clearUnreadCountByTimestamp(conversationType: ConversationType$1, targetId: string, timestamp: number, channelId: string): Promise<ErrorCode>;
|
|
168
229
|
clearAllUnreadCount(): Promise<ErrorCode>;
|
|
169
|
-
getConversationNotificationStatus(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<NotificationStatus>;
|
|
170
|
-
getRemoteHistoryMessages(conversationType: ConversationType, targetId: string, timestamp: number, count: number, order: 0 | 1, channelId: string): IPromiseResult<{
|
|
230
|
+
getConversationNotificationStatus(conversationType: ConversationType$1, targetId: string, channelId: string): IPromiseResult<NotificationStatus>;
|
|
231
|
+
getRemoteHistoryMessages(conversationType: ConversationType$1, targetId: string, timestamp: number, count: number, order: 0 | 1, channelId: string): IPromiseResult<{
|
|
171
232
|
list: IReceivedMessage[];
|
|
172
233
|
hasMore: boolean;
|
|
173
234
|
}>;
|
|
@@ -199,7 +260,7 @@ declare class RCCppEngine extends AEngine {
|
|
|
199
260
|
key: string;
|
|
200
261
|
value: string;
|
|
201
262
|
}>>;
|
|
202
|
-
getTopConversationList(conversationTypes: ConversationType[], channelId?: string): Promise<IAsyncRes<IReceivedConversation[]>>;
|
|
263
|
+
getTopConversationList(conversationTypes: ConversationType$1[], channelId?: string): Promise<IAsyncRes<IReceivedConversation[]>>;
|
|
203
264
|
getUnreadMentionedCount(conversation: IConversationOption): Promise<IAsyncRes<number>>;
|
|
204
265
|
getAllUnreadMentionedCount(): Promise<IAsyncRes<number>>;
|
|
205
266
|
getAllConversationState(): Promise<IAsyncRes<IConversationState[]>>;
|
|
@@ -220,8 +281,8 @@ declare class RCCppEngine extends AEngine {
|
|
|
220
281
|
syncTime: number;
|
|
221
282
|
hasMore: boolean;
|
|
222
283
|
}>>;
|
|
223
|
-
getConversationNotificationLevel(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<NotificationLevel>;
|
|
224
|
-
setConversationNotificationLevel(conversationType: ConversationType, targetId: string, notificationLevel?: NotificationLevel, channelId?: string): Promise<ErrorCode>;
|
|
284
|
+
getConversationNotificationLevel(conversationType: ConversationType$1, targetId: string, channelId: string): IPromiseResult<NotificationLevel>;
|
|
285
|
+
setConversationNotificationLevel(conversationType: ConversationType$1, targetId: string, notificationLevel?: NotificationLevel, channelId?: string): Promise<ErrorCode>;
|
|
225
286
|
batchSetConversationNotificationLevel(conversations: IConversationOption[], notificationLevel: NotificationLevel): Promise<ErrorCode>;
|
|
226
287
|
getUltraGroupDefaultNotificationLevel(targetId: string, channelId: string): IPromiseResult<NotificationLevel>;
|
|
227
288
|
getAllUltraGroupUnreadCount(): Promise<{
|
package/index.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{BasicLogger as t,BasicStatistic as e,VersionManage as n,LogTagId as o,isUndefined as r,ErrorCode as i,EventEmitter as a,RCConnectionStatus as s,AEngine as c}from"@rongcloud/engine";import{ipcRenderer as l}from"electron";var u=function(t,e){return u=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])},u(t,e)};function p(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}u(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function h(t,e,n,o){return new(n||(n=Promise))((function(r,i){function a(t){try{c(o.next(t))}catch(t){i(t)}}function s(t){try{c(o.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}c((o=o.apply(t,e||[])).next())}))}function g(t,e){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function f(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}var y="logdata",M=function(t){function e(e,n,o,r){var i=t.call(this,e,n,o)||this;return i.emiter=r,i}return p(e,t),e.prototype.flush=function(t){this.emiter.emit(y,t)},e}(t),_=function(t){function e(e,n,o,r){var i=t.call(this,e,n,o)||this;return i.emiter=r,i}return p(e,t),e.prototype.flush=function(t){this.emiter.emit("logdata",t)},e}(e),d=0,C=Date.now(),v=function(t){var e=Date.now();return C!==e&&(C=e,d=0),[t,process.pid,e,d++].join("__")};n.add("electron-renderer","5.9.0-alpha.1");var m=function(t){function e(e,n,r,i){var c=this,u=new a,p=new M(i.appkey,"RC-E","IM",u),h=new _(i.appkey,"RC-E","IM",u);return(c=t.call(this,e,n,r,i,p,h)||this).waitingLogs=[],c.latestSendTimestamp=0,c._resolveMaps={},u.on(y,(function(t){c.waitingLogs.push(t),c.check2SendLog()})),c._logEmitter=u,p.setOutputLevel(i.logOutputLevel),l.on("__RC_CHANNEL_NOTIFICATION_FROM_MAIN__",(function(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];var a=r[e];if(a){var l={batchMessage:c._batchMessage.bind(c),onRTCDataChange:c._onRTCDataChange.bind(c),onConnected:c._onConnected.bind(c),onNaviDataChange:c._onNaviDataChange.bind(c)};if(l[e])l[e](n,a);else{var u={onConnecting:s.CONNECTING,onSuspend:s.SUSPENDED,onDisconnected:s.DISCONNECTED};u[e]&&c._setConnectionStatus(u[e]),a(n[0])}}else c.logger.error(o.L_UNSUPPORT_NTF_FROM_MAIN_E,e)})),l.on("__RC_CHANNEL_RESULT_FROM_MAIN__",(function(t,e){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];var r=c._resolveMaps[e];r&&(delete c._resolveMaps[e],r.apply(void 0,n))})),c._options.httpInMainProcess&&(e.httpReq=c.sendHTTPRequest.bind(c)),l.send("__RC_INNER_COMMAND_INIT__",{navigators:i.navigators,areaCode:i.areaCode,logServerUrl:i.logServerUrl}),c._cache=c._callMainSync("getMainProcessCache"),c}return p(e,t),e.prototype._batchMessage=function(t,e){var n=t[0].hasMoreMsg;delete t[0].hasMoreMsg,e([t[0]],void 0,n)},e.prototype._onRTCDataChange=function(t,e){var n=t[0];this._receiveRtcKv(new Uint8Array(n))},e.prototype._onConnected=function(t,e){this._cache=t[0],e(void 0)},e.prototype._onNaviDataChange=function(t,e){this._cache.naviInfo=t[0],e([t[0]])},e.prototype._setConnectionStatus=function(t){this._cache.connectionStatus=t},e.prototype.check2SendLog=function(){var t=Date.now();t-this.latestSendTimestamp<1e3||(this.logger.debug(o.T,"send logs 2 main -> ".concat(this.waitingLogs.length)),l.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];return new Promise((function(o){var r=v(t);e._resolveMaps[r]=o,l.send.apply(l,f(["__RC_CHANNEL_CALL_MAIN__",r,t],n,!1))}))},e.prototype.callExtra=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return this._callMain.apply(this,f(["callExtra",t],e,!1))},e.prototype._send2Main=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.send.apply(l,f(["__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 this.logger.info(o.L_CALL_MAIN_SYNC_O,t),l.sendSync.apply(l,f(["__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 M(this._appkey,t,e,this._logEmitter)},e.prototype.getConnectionStatus=function(){return this._cache.connectionStatus},e.prototype.connect=function(t,e,n,o){return h(this,void 0,void 0,(function(){return g(this,(function(r){return[2,this._callMain("connect",t,e,n,o)]}))}))},e.prototype.reportSDKInfo=function(t){this._send2Main("reportSDKInfo",t)},e.prototype.getConnectedTime=function(){return this._cache.connectedTime},e.prototype.getHistoryMessage=function(t,e,n,o,r,i,a){return this._callMain("getHistoryMessage",t,e,n,o,r,i,a)},e.prototype.getMessages=function(t,e,n,o,r,i){return this._callMain("getMessages",t,e,n,o,r,i)},e.prototype.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.batchRemoveConversation=function(t){return this._callMain("batchRemoveConversation",t)},e.prototype.getAllConversationUnreadCount=function(t,e,n){return this._callMain("getAllConversationUnreadCount",t,e,n)},e.prototype.getConversationUnreadCount=function(t,e,n){return this._callMain("getConversationUnreadCount",t,e,n)},e.prototype.getTotalUnreadCountByLevels=function(t,e,n){return this._callMain("getTotalUnreadCountByLevels",t,e,n)},e.prototype.clearConversationUnreadCount=function(t,e,n){return this._callMain("clearConversationUnreadCount",t,e,n)},e.prototype.getFirstUnreadMessage=function(t,e,n){return this._callMain("getFirstUnreadMessage",t,e,n)},e.prototype.getFirstUnreadMessageInfo=function(t,e,n){return this._callMain("getFirstUnreadMessageInfo",t,e,n)},e.prototype.saveConversationMessageDraft=function(t,e,n){return this._callMain("saveConversationMessageDraft",t,e,n)},e.prototype.getConversationMessageDraft=function(t,e){return this._callMain("getConversationMessageDraft",t,e)},e.prototype.clearConversationMessageDraft=function(t,e){return this._callMain("clearConversationMessageDraft",t,e)},e.prototype.pullConversationStatus=function(t){return this._callMain("pullConversationStatus",t)},e.prototype.batchSetConversationStatus=function(t){var e=t[0].notificationLevel;return r(e)?this._callMain("batchSetConversationStatus",t):Promise.resolve(i.NOT_SUPPORT)},e.prototype.batchSetConversationToTop=function(t,e,n){return this._callMain("batchSetConversationToTop",t,e,n)},e.prototype.sendMessage=function(t,e,n,r,i){var a=this,s=["sendMessageBefore",Date.now(),Math.floor(Math.random()*Date.now())].join("_");return r&&(this._resolveMaps[s]=function(t){try{r(t)}catch(t){a.logger.error(o.A_CALLBACK_E,JSON.stringify({error:null==t?void 0:t.stack,pos:"sendMsgBefore"}))}}),this._callMain("sendMessage",t,e,n,s,i)},e.prototype.sendReadReceiptMessage=function(t,e,n){return this._callMain("sendReadReceiptMessage",t,e,n)},e.prototype.getMessageReader=function(t,e,n){return this._callMain("getMessageReader",t,e,n)},e.prototype.sendReadReceiptMessageV4=function(t,e,n){return this._callMain("sendReadReceiptMessageV4",t,e,n)},e.prototype.getMessageReadReceiptV4=function(t,e){return this._callMain("getMessageReadReceiptV4",t,e)},e.prototype.batchGetMessageReadReceiptInfoV4=function(t,e){return Promise.resolve({code:i.NOT_SUPPORT})},e.prototype.updateConversationReadTime=function(t,e){return this._callMain("updateConversationReadTime",t,e)},e.prototype.disconnect=function(t){return h(this,void 0,void 0,(function(){return g(this,(function(e){return this._send2Main("disconnect",t),[2]}))}))},e.prototype.pullUserSettings=function(t){return this._callMain("pullUserSettings",t)},e.prototype.registerMessageType=function(t,e,n,o){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,r){return this._callMain("getFileToken",t,e,n,o,r)},e.prototype.getFileUrl=function(t,e,n,o){return this._callMain("getFileUrl",t,e,n,o)},e.prototype.setUserStatus=function(t){return this._callMain("setUserStatus",t)},e.prototype.subscribeUserStatus=function(t){return this._callMain("subscribeUserStatus",t)},e.prototype.getUserStatus=function(t){return this._callMain("getUserStatus",t)},e.prototype.clearConversations=function(t,e){return this._callMain("clearConversations",t,e)},e.prototype.addToBlacklist=function(t){return this._callMain("addToBlacklist",t)},e.prototype.removeFromBlacklist=function(t){return this._callMain("removeFromBlacklist",t)},e.prototype.getBlacklist=function(){return this._callMain("getBlacklist")},e.prototype.getBlacklistStatus=function(t){return this._callMain("getBlacklistStatus",t)},e.prototype.insertMessage=function(t,e,n){return this._callMain("insertMessage",t,e,n)},e.prototype.batchInsertMessage=function(t,e){return this._callMain("batchInsertMessage",t,e)},e.prototype.getMessageCount=function(t,e,n){return this._callMain("getMessageCount",t,e,n)},e.prototype.deleteMessages=function(t){return this._callMain("deleteMessages",t)},e.prototype.deleteMessagesByTimestamp=function(t,e,n,o,r){return this._callMain("deleteMessagesByTimestamp",t,e,n,o,r)},e.prototype.batchClearMessagesByTimestamp=function(t){return this._callMain("batchClearMessagesByTimestamp",t)},e.prototype.batchClearRemoteHistoryMessages=function(t,e){return this._callMain("batchClearRemoteHistoryMessages",t,e)},e.prototype.clearMessages=function(t,e,n){return this._callMain("clearMessages",t,e,n)},e.prototype.getMessage=function(t){return this._callMain("getMessage",t)},e.prototype.setMessageContent=function(t,e,n){return this._callMain("setMessageContent",t,e,n)},e.prototype.setMessageSearchField=function(t,e,n){return this._callMain("setMessageSearchField",t,e,n)},e.prototype.searchConversationByContent=function(t,e,n,o){return this._callMain("searchConversationByContent",t,e,n,o)},e.prototype.searchConversationByContentWithAllChannel=function(t,e,n){return this._callMain("searchConversationByContentWithAllChannel",t,e,n)},e.prototype.searchMessageByContentWithAllChannel=function(t,e,n,o,r){return this._callMain("searchMessageByContentWithAllChannel",t,e,n,o,r)},e.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(t,e,n,o,r,i,a){return this._callMain("searchMessageByContentInTimeRangeWithAllChannel",t,e,n,o,r,i,a)},e.prototype.searchMessageByContent=function(t,e,n,o,r,i,a){return this._callMain("searchMessageByContent",t,e,n,o,r,i,a)},e.prototype.searchMessagesByUser=function(t,e,n,o,r,i){return this._callMain("searchMessagesByUser",t,e,n,o,r,i)},e.prototype.getUnreadMentionedMessages=function(t,e,n){return this._callMainSync("getUnreadMentionedMessages",t,e,n)},e.prototype.setMessageSentStatus=function(t,e){return this._callMain("setMessageSentStatus",t,e)},e.prototype.setMessageReceivedStatus=function(t,e){return this._callMain("setMessageReceivedStatus",t,e)},e.prototype.updateMessageReceiptStatus=function(t,e,n,o){return this._callMain("updateMessageReceiptStatus",t,e,n,o)},e.prototype.clearUnreadCountByTimestamp=function(t,e,n,o){return this._callMain("clearUnreadCountByTimestamp",t,e,n,o)},e.prototype.clearAllUnreadCount=function(){throw new Error("Method not implemented.")},e.prototype.getConversationNotificationStatus=function(t,e,n){return this._callMain("getConversationNotificationStatus",t,e,n)},e.prototype.getRemoteHistoryMessages=function(t,e,n,o,r,i){return this._callMain("getRemoteHistoryMessages",t,e,n,o,r,i)},e.prototype.getServerTime=function(){return Date.now()-this._cache.deltaTime},e.prototype.getDeviceId=function(){return this._cache.deviceId},e.prototype.getCurrentUserId=function(){return this._cache.crtUserId},e.prototype.bindRTCRoomForChatroom=function(t){return this._callMain("bindRTCRoomForChatroom",t)},e.prototype.rtcSignaling=function(t,e,n,o){return h(this,void 0,void 0,(function(){var r,i,a;return g(this,(function(s){switch(s.label){case 0:return[4,this._callMain("rtcSignaling",t,e,n,o)];case 1:return r=s.sent(),i=r.code,a=r.buffer,[2,{code:i,buffer:a?new Uint8Array(a):a}]}}))}))},e.prototype.rtcPing=function(t,e,n){return this._callMain("rtcPing",t,e,n)},e.prototype.createTag=function(t){return this._callMain("createTag",t)},e.prototype.removeTag=function(t){return this._callMain("removeTag",t)},e.prototype.updateTag=function(t){return this._callMain("updateTag",t)},e.prototype.getTagList=function(){return this._callMain("getTagList")},e.prototype.addTagForConversations=function(t,e){return this._callMain("addTagForConversations",t,e)},e.prototype.removeTagForConversations=function(t,e){return this._callMain("removeTagForConversations",t,e)},e.prototype.removeTagsForConversation=function(t,e){return this._callMain("removeTagsForConversation",t,e)},e.prototype.getConversationListByTag=function(t,e,n,o){return this._callMain("getConversationListByTag",t,e,n,o)},e.prototype.getUnreadCountByTag=function(t,e){return this._callMain("getUnreadCountByTag",t,e)},e.prototype.setConversationStatusInTag=function(t,e,n){return this._callMain("setConversationStatusInTag",t,e,n)},e.prototype.getTagsForConversation=function(t){return this._callMain("getTagsForConversation",t)},e.prototype.clearData=function(){return this._callMain("clearData")},e.prototype.getBlockConversationList=function(){throw new Error("Method not implemented.")},e.prototype.getGroupMessageDeliverList=function(t,e,n){return this._callMain("getGroupMessageDeliverList",t,e,n)},e.prototype.getPrivateMessageDeliverTime=function(t,e){return this._callMain("getPrivateMessageDeliverTime",t,e)},e.prototype.setCallInfo=function(t,e,n){return this._callMain("setCallInfo",t,e,n)},e.prototype.getTopConversationList=function(t,e){return this._callMain("getTopConversationList",t,e)},e.prototype.getUnreadMentionedCount=function(t){throw new Error("Method not implemented.")},e.prototype.getAllUnreadMentionedCount=function(){return this._callMain("getAllUnreadMentionedCount")},e.prototype.getAllConversationState=function(){throw new Error("Method not implemented.")},e.prototype.getUltraGroupList=function(){throw new Error("Method not implemented.")},e.prototype.getBlockUltraGroupList=function(){throw new Error("Method not implemented.")},e.prototype.getTopUltraGroupList=function(){throw new Error("Method not implemented.")},e.prototype.clearUltraUnreadcount=function(t,e){throw new Error("Method not implemented.")},e.prototype.getUltraGroupUnreadMentionedCountByTargetId=function(t,e){throw new Error("Method not implemented.")},e.prototype.sendUltraMessage=function(t,e,n){throw new Error("Method not implemented.")},e.prototype.sendUltraGroupTypingStatus=function(t,e){throw new Error("Method not implemented.")},e.prototype.getUltraGroupMessageListByMessageUId=function(t){throw new Error("Method not implemented.")},e.prototype.expandUltraMessage=function(t){throw new Error("Method not implemented.")},e.prototype.modifyMessage=function(t){throw new Error("Method not implemented.")},e.prototype.getUltraHistoryMsg=function(t,e){throw new Error("Method not implemented.")},e.prototype.getConversationNotificationLevel=function(t,e,n){return this._callMain("getConversationNotificationLevel",t,e,n)},e.prototype.setConversationNotificationLevel=function(t,e,n,o){return this._callMain("setConversationNotificationLevel",t,e,n,o)},e.prototype.batchSetConversationNotificationLevel=function(t,e){return this._callMain("batchSetConversationNotificationLevel",t,e)},e.prototype.getUltraGroupDefaultNotificationLevel=function(t,e){return Promise.resolve({code:i.NOT_SUPPORT})},e.prototype.getAllUltraGroupUnreadCount=function(){return Promise.resolve({code:i.NOT_SUPPORT})},e.prototype.getUltraGroupUnreadCountByTargetId=function(){return Promise.resolve({code:i.NOT_SUPPORT})},e.prototype.setUltraGroupDefaultNotificationLevel=function(){return Promise.resolve({code:i.NOT_SUPPORT})},e.prototype.getUltraGroupUnreadMentionedMessages=function(){return Promise.resolve({code:i.NOT_SUPPORT})},e.prototype.getUltraGroupFirstUnreadMessageTimestamp=function(){return Promise.resolve({code:i.NOT_SUPPORT})},e.prototype.getUltraGroupUnreadInfoList=function(){return Promise.resolve({code:i.NOT_SUPPORT})},e.prototype.getOSInfo=function(){return h(this,void 0,void 0,(function(){return g(this,(function(t){return[2,this._callMain("getOSInfo")]}))}))},e.prototype.getProcessInfo=function(){return h(this,void 0,void 0,(function(){return g(this,(function(t){return[2,{code:i.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 h(this,void 0,void 0,(function(){return g(this,(function(t){return[2,this._callMain("getMainProcessInfo")]}))}))},e.prototype.setProxy=function(t){return this._callMain("setProxy",t)},e.prototype.getProxy=function(){return this._callMain("getProxy")},e.prototype.testProxy=function(t,e){return this._callMain("testProxy",t,e)},e.prototype.setCheckDuplicateMessage=function(t){return this._callMain("checkDuplicateMessage",t)},e.prototype.setNetwork=function(t,e){l.send("__RC_CHANNEL_SEND_2_MAIN__","onRendererNetworkStatusReceived",t,e)},e}(c);window&&(window.RCCppEngine=m);export{m as RCCppEngine};
|
|
1
|
+
import{BasicLogger as t,BasicStatistic as e,VersionManage as n,LogTagId as o,isUndefined as r,ErrorCode as i,EventEmitter as a,RCConnectionStatus as s,AEngine as c}from"@rongcloud/engine";import{ipcRenderer as l}from"electron";var u=function(t,e){return u=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])},u(t,e)};function p(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}u(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function h(t,e,n,o){return new(n||(n=Promise))((function(r,i){function a(t){try{c(o.next(t))}catch(t){i(t)}}function s(t){try{c(o.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}c((o=o.apply(t,e||[])).next())}))}function g(t,e){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function f(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}var y="logdata",M=function(t){function e(e,n,o,r){var i=t.call(this,e,n,o)||this;return i.emiter=r,i}return p(e,t),e.prototype.flush=function(t){this.emiter.emit(y,t)},e}(t),_=function(t){function e(e,n,o,r){var i=t.call(this,e,n,o)||this;return i.emiter=r,i}return p(e,t),e.prototype.flush=function(t){this.emiter.emit("logdata",t)},e}(e),d=0,C=Date.now(),v=function(t){var e=Date.now();return C!==e&&(C=e,d=0),[t,process.pid,e,d++].join("__")};n.add("electron-renderer","5.9.0-alpha.3");var m=function(t){function e(e,n,r,i){var c=this,u=new a,p=new M(i.appkey,"RC-E","IM",u),h=new _(i.appkey,"RC-E","IM",u);return(c=t.call(this,e,n,r,i,p,h)||this).waitingLogs=[],c.latestSendTimestamp=0,c._resolveMaps={},u.on(y,(function(t){c.waitingLogs.push(t),c.check2SendLog()})),c._logEmitter=u,p.setOutputLevel(i.logOutputLevel),l.on("__RC_CHANNEL_NOTIFICATION_FROM_MAIN__",(function(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];var a=r[e];if(a){var l={batchMessage:c._batchMessage.bind(c),onRTCDataChange:c._onRTCDataChange.bind(c),onConnected:c._onConnected.bind(c),onNaviDataChange:c._onNaviDataChange.bind(c)};if(l[e])l[e](n,a);else{var u={onConnecting:s.CONNECTING,onSuspend:s.SUSPENDED,onDisconnected:s.DISCONNECTED};u[e]&&c._setConnectionStatus(u[e]),a(n[0])}}else c.logger.error(o.L_UNSUPPORT_NTF_FROM_MAIN_E,e)})),l.on("__RC_CHANNEL_RESULT_FROM_MAIN__",(function(t,e){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];var r=c._resolveMaps[e];r&&(delete c._resolveMaps[e],r.apply(void 0,n))})),c._options.httpInMainProcess&&(e.httpReq=c.sendHTTPRequest.bind(c)),l.send("__RC_INNER_COMMAND_INIT__",{navigators:i.navigators,areaCode:i.areaCode,logServerUrl:i.logServerUrl}),c._cache=c._callMainSync("getMainProcessCache"),c}return p(e,t),e.prototype._batchMessage=function(t,e){var n=t[0].hasMoreMsg;delete t[0].hasMoreMsg,e([t[0]],void 0,n)},e.prototype._onRTCDataChange=function(t,e){var n=t[0];this._receiveRtcKv(new Uint8Array(n))},e.prototype._onConnected=function(t,e){this._cache=t[0],e(void 0)},e.prototype._onNaviDataChange=function(t,e){this._cache.naviInfo=t[0],e([t[0]])},e.prototype._setConnectionStatus=function(t){this._cache.connectionStatus=t},e.prototype.check2SendLog=function(){var t=Date.now();t-this.latestSendTimestamp<1e3||(this.logger.debug(o.T,"send logs 2 main -> ".concat(this.waitingLogs.length)),l.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];return new Promise((function(o){var r=v(t);e._resolveMaps[r]=o,l.send.apply(l,f(["__RC_CHANNEL_CALL_MAIN__",r,t],n,!1))}))},e.prototype.callExtra=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return this._callMain.apply(this,f(["callExtra",t],e,!1))},e.prototype._send2Main=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.send.apply(l,f(["__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 this.logger.info(o.L_CALL_MAIN_SYNC_O,t),l.sendSync.apply(l,f(["__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 M(this._appkey,t,e,this._logEmitter)},e.prototype.createStatisticLogger=function(t,e){return new _(this._appkey,t,e,this._logEmitter)},e.prototype.getConnectionStatus=function(){return this._cache.connectionStatus},e.prototype.connect=function(t,e,n,o){return h(this,void 0,void 0,(function(){return g(this,(function(r){return[2,this._callMain("connect",t,e,n,o)]}))}))},e.prototype.reportSDKInfo=function(t){this._send2Main("reportSDKInfo",t)},e.prototype.getConnectedTime=function(){return this._cache.connectedTime},e.prototype.getHistoryMessage=function(t,e,n,o,r,i,a){return this._callMain("getHistoryMessage",t,e,n,o,r,i,a)},e.prototype.getMessages=function(t,e,n,o,r,i){return this._callMain("getMessages",t,e,n,o,r,i)},e.prototype.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.batchRemoveConversation=function(t){return this._callMain("batchRemoveConversation",t)},e.prototype.getAllConversationUnreadCount=function(t,e,n){return this._callMain("getAllConversationUnreadCount",t,e,n)},e.prototype.getConversationUnreadCount=function(t,e,n){return this._callMain("getConversationUnreadCount",t,e,n)},e.prototype.getTotalUnreadCountByLevels=function(t,e,n){return this._callMain("getTotalUnreadCountByLevels",t,e,n)},e.prototype.clearConversationUnreadCount=function(t,e,n){return this._callMain("clearConversationUnreadCount",t,e,n)},e.prototype.getFirstUnreadMessage=function(t,e,n){return this._callMain("getFirstUnreadMessage",t,e,n)},e.prototype.getFirstUnreadMessageInfo=function(t,e,n){return this._callMain("getFirstUnreadMessageInfo",t,e,n)},e.prototype.saveConversationMessageDraft=function(t,e,n){return this._callMain("saveConversationMessageDraft",t,e,n)},e.prototype.getConversationMessageDraft=function(t,e){return this._callMain("getConversationMessageDraft",t,e)},e.prototype.clearConversationMessageDraft=function(t,e){return this._callMain("clearConversationMessageDraft",t,e)},e.prototype.pullConversationStatus=function(t){return this._callMain("pullConversationStatus",t)},e.prototype.batchSetConversationStatus=function(t){var e=t[0].notificationLevel;return r(e)?this._callMain("batchSetConversationStatus",t):Promise.resolve(i.NOT_SUPPORT)},e.prototype.batchSetConversationToTop=function(t,e,n){return this._callMain("batchSetConversationToTop",t,e,n)},e.prototype.sendMessage=function(t,e,n,r,i){var a=this,s=["sendMessageBefore",Date.now(),Math.floor(Math.random()*Date.now())].join("_");return r&&(this._resolveMaps[s]=function(t){try{r(t)}catch(t){a.logger.error(o.A_CALLBACK_E,JSON.stringify({error:null==t?void 0:t.stack,pos:"sendMsgBefore"}))}}),this._callMain("sendMessage",t,e,n,s,i)},e.prototype.sendReadReceiptMessage=function(t,e,n){return this._callMain("sendReadReceiptMessage",t,e,n)},e.prototype.getMessageReader=function(t,e,n){return this._callMain("getMessageReader",t,e,n)},e.prototype.sendReadReceiptMessageV4=function(t,e,n){return this._callMain("sendReadReceiptMessageV4",t,e,n)},e.prototype.getMessageReadReceiptV4=function(t,e){return this._callMain("getMessageReadReceiptV4",t,e)},e.prototype.batchGetMessageReadReceiptInfoV4=function(t,e){return Promise.resolve({code:i.NOT_SUPPORT})},e.prototype.updateConversationReadTime=function(t,e){return this._callMain("updateConversationReadTime",t,e)},e.prototype.disconnect=function(t){return h(this,void 0,void 0,(function(){return g(this,(function(e){return this._send2Main("disconnect",t),[2]}))}))},e.prototype.pullUserSettings=function(t){return this._callMain("pullUserSettings",t)},e.prototype.registerMessageType=function(t,e,n,o){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,r){return this._callMain("getFileToken",t,e,n,o,r)},e.prototype.getFileUrl=function(t,e,n,o){return this._callMain("getFileUrl",t,e,n,o)},e.prototype.setUserStatus=function(t){return this._callMain("setUserStatus",t)},e.prototype.subscribeUserStatus=function(t){return this._callMain("subscribeUserStatus",t)},e.prototype.getUserStatus=function(t){return this._callMain("getUserStatus",t)},e.prototype.clearConversations=function(t,e){return this._callMain("clearConversations",t,e)},e.prototype.addToBlacklist=function(t){return this._callMain("addToBlacklist",t)},e.prototype.removeFromBlacklist=function(t){return this._callMain("removeFromBlacklist",t)},e.prototype.getBlacklist=function(){return this._callMain("getBlacklist")},e.prototype.getBlacklistStatus=function(t){return this._callMain("getBlacklistStatus",t)},e.prototype.insertMessage=function(t,e,n){return this._callMain("insertMessage",t,e,n)},e.prototype.batchInsertMessage=function(t,e){return this._callMain("batchInsertMessage",t,e)},e.prototype.getMessageCount=function(t,e,n){return this._callMain("getMessageCount",t,e,n)},e.prototype.deleteMessages=function(t){return this._callMain("deleteMessages",t)},e.prototype.deleteMessagesByTimestamp=function(t,e,n,o,r){return this._callMain("deleteMessagesByTimestamp",t,e,n,o,r)},e.prototype.batchClearMessagesByTimestamp=function(t){return this._callMain("batchClearMessagesByTimestamp",t)},e.prototype.batchClearRemoteHistoryMessages=function(t,e){return this._callMain("batchClearRemoteHistoryMessages",t,e)},e.prototype.clearMessages=function(t,e,n){return this._callMain("clearMessages",t,e,n)},e.prototype.getMessage=function(t){return this._callMain("getMessage",t)},e.prototype.setMessageContent=function(t,e,n){return this._callMain("setMessageContent",t,e,n)},e.prototype.setMessageSearchField=function(t,e,n){return this._callMain("setMessageSearchField",t,e,n)},e.prototype.searchConversationByContent=function(t,e,n,o){return this._callMain("searchConversationByContent",t,e,n,o)},e.prototype.searchConversationByContentWithAllChannel=function(t,e,n){return this._callMain("searchConversationByContentWithAllChannel",t,e,n)},e.prototype.searchMessageByContentWithAllChannel=function(t,e,n,o,r){return this._callMain("searchMessageByContentWithAllChannel",t,e,n,o,r)},e.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(t,e,n,o,r,i,a){return this._callMain("searchMessageByContentInTimeRangeWithAllChannel",t,e,n,o,r,i,a)},e.prototype.searchMessageByContent=function(t,e,n,o,r,i,a){return this._callMain("searchMessageByContent",t,e,n,o,r,i,a)},e.prototype.searchMessagesByUser=function(t,e,n,o,r,i){return this._callMain("searchMessagesByUser",t,e,n,o,r,i)},e.prototype.getUnreadMentionedMessages=function(t,e,n){return this._callMainSync("getUnreadMentionedMessages",t,e,n)},e.prototype.setMessageSentStatus=function(t,e){return this._callMain("setMessageSentStatus",t,e)},e.prototype.setMessageReceivedStatus=function(t,e){return this._callMain("setMessageReceivedStatus",t,e)},e.prototype.updateMessageReceiptStatus=function(t,e,n,o){return this._callMain("updateMessageReceiptStatus",t,e,n,o)},e.prototype.clearUnreadCountByTimestamp=function(t,e,n,o){return this._callMain("clearUnreadCountByTimestamp",t,e,n,o)},e.prototype.clearAllUnreadCount=function(){throw new Error("Method not implemented.")},e.prototype.getConversationNotificationStatus=function(t,e,n){return this._callMain("getConversationNotificationStatus",t,e,n)},e.prototype.getRemoteHistoryMessages=function(t,e,n,o,r,i){return this._callMain("getRemoteHistoryMessages",t,e,n,o,r,i)},e.prototype.getServerTime=function(){return Date.now()-this._cache.deltaTime},e.prototype.getDeviceId=function(){return this._cache.deviceId},e.prototype.getCurrentUserId=function(){return this._cache.crtUserId},e.prototype.bindRTCRoomForChatroom=function(t){return this._callMain("bindRTCRoomForChatroom",t)},e.prototype.rtcSignaling=function(t,e,n,o){return h(this,void 0,void 0,(function(){var r,i,a;return g(this,(function(s){switch(s.label){case 0:return[4,this._callMain("rtcSignaling",t,e,n,o)];case 1:return r=s.sent(),i=r.code,a=r.buffer,[2,{code:i,buffer:a?new Uint8Array(a):a}]}}))}))},e.prototype.rtcPing=function(t,e,n){return this._callMain("rtcPing",t,e,n)},e.prototype.createTag=function(t){return this._callMain("createTag",t)},e.prototype.removeTag=function(t){return this._callMain("removeTag",t)},e.prototype.updateTag=function(t){return this._callMain("updateTag",t)},e.prototype.getTagList=function(){return this._callMain("getTagList")},e.prototype.addTagForConversations=function(t,e){return this._callMain("addTagForConversations",t,e)},e.prototype.removeTagForConversations=function(t,e){return this._callMain("removeTagForConversations",t,e)},e.prototype.removeTagsForConversation=function(t,e){return this._callMain("removeTagsForConversation",t,e)},e.prototype.getConversationListByTag=function(t,e,n,o){return this._callMain("getConversationListByTag",t,e,n,o)},e.prototype.getUnreadCountByTag=function(t,e){return this._callMain("getUnreadCountByTag",t,e)},e.prototype.setConversationStatusInTag=function(t,e,n){return this._callMain("setConversationStatusInTag",t,e,n)},e.prototype.getTagsForConversation=function(t){return this._callMain("getTagsForConversation",t)},e.prototype.clearData=function(){return this._callMain("clearData")},e.prototype.getBlockConversationList=function(){throw new Error("Method not implemented.")},e.prototype.getGroupMessageDeliverList=function(t,e,n){return this._callMain("getGroupMessageDeliverList",t,e,n)},e.prototype.getPrivateMessageDeliverTime=function(t,e){return this._callMain("getPrivateMessageDeliverTime",t,e)},e.prototype.setCallInfo=function(t,e,n){return this._callMain("setCallInfo",t,e,n)},e.prototype.getTopConversationList=function(t,e){return this._callMain("getTopConversationList",t,e)},e.prototype.getUnreadMentionedCount=function(t){throw new Error("Method not implemented.")},e.prototype.getAllUnreadMentionedCount=function(){return this._callMain("getAllUnreadMentionedCount")},e.prototype.getAllConversationState=function(){throw new Error("Method not implemented.")},e.prototype.getUltraGroupList=function(){throw new Error("Method not implemented.")},e.prototype.getBlockUltraGroupList=function(){throw new Error("Method not implemented.")},e.prototype.getTopUltraGroupList=function(){throw new Error("Method not implemented.")},e.prototype.clearUltraUnreadcount=function(t,e){throw new Error("Method not implemented.")},e.prototype.getUltraGroupUnreadMentionedCountByTargetId=function(t,e){throw new Error("Method not implemented.")},e.prototype.sendUltraMessage=function(t,e,n){throw new Error("Method not implemented.")},e.prototype.sendUltraGroupTypingStatus=function(t,e){throw new Error("Method not implemented.")},e.prototype.getUltraGroupMessageListByMessageUId=function(t){throw new Error("Method not implemented.")},e.prototype.expandUltraMessage=function(t){throw new Error("Method not implemented.")},e.prototype.modifyMessage=function(t){throw new Error("Method not implemented.")},e.prototype.getUltraHistoryMsg=function(t,e){throw new Error("Method not implemented.")},e.prototype.getConversationNotificationLevel=function(t,e,n){return this._callMain("getConversationNotificationLevel",t,e,n)},e.prototype.setConversationNotificationLevel=function(t,e,n,o){return this._callMain("setConversationNotificationLevel",t,e,n,o)},e.prototype.batchSetConversationNotificationLevel=function(t,e){return this._callMain("batchSetConversationNotificationLevel",t,e)},e.prototype.getUltraGroupDefaultNotificationLevel=function(t,e){return Promise.resolve({code:i.NOT_SUPPORT})},e.prototype.getAllUltraGroupUnreadCount=function(){return Promise.resolve({code:i.NOT_SUPPORT})},e.prototype.getUltraGroupUnreadCountByTargetId=function(){return Promise.resolve({code:i.NOT_SUPPORT})},e.prototype.setUltraGroupDefaultNotificationLevel=function(){return Promise.resolve({code:i.NOT_SUPPORT})},e.prototype.getUltraGroupUnreadMentionedMessages=function(){return Promise.resolve({code:i.NOT_SUPPORT})},e.prototype.getUltraGroupFirstUnreadMessageTimestamp=function(){return Promise.resolve({code:i.NOT_SUPPORT})},e.prototype.getUltraGroupUnreadInfoList=function(){return Promise.resolve({code:i.NOT_SUPPORT})},e.prototype.getOSInfo=function(){return h(this,void 0,void 0,(function(){return g(this,(function(t){return[2,this._callMain("getOSInfo")]}))}))},e.prototype.getProcessInfo=function(){return h(this,void 0,void 0,(function(){return g(this,(function(t){return[2,{code:i.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 h(this,void 0,void 0,(function(){return g(this,(function(t){return[2,this._callMain("getMainProcessInfo")]}))}))},e.prototype.setProxy=function(t){return this._callMain("setProxy",t)},e.prototype.getProxy=function(){return this._callMain("getProxy")},e.prototype.testProxy=function(t,e){return this._callMain("testProxy",t,e)},e.prototype.setCheckDuplicateMessage=function(t){return this._callMain("checkDuplicateMessage",t)},e.prototype.setNetwork=function(t,e){l.send("__RC_CHANNEL_SEND_2_MAIN__","onRendererNetworkStatusReceived",t,e)},e}(c);window&&(window.RCCppEngine=m);export{m 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="logdata",c=function(t){function e(e,n,o,r){var i=t.call(this,e,n,o)||this;return i.emiter=r,i}return o(e,t),e.prototype.flush=function(t){this.emiter.emit(s,t)},e}(t.BasicLogger),l=function(t){function e(e,n,o,r){var i=t.call(this,e,n,o)||this;return i.emiter=r,i}return o(e,t),e.prototype.flush=function(t){this.emiter.emit("logdata",t)},e}(t.BasicStatistic),u=0,p=Date.now(),h=function(t){var e=Date.now();return p!==e&&(p=e,u=0),[t,process.pid,e,u++].join("__")};t.VersionManage.add("electron-renderer","5.9.0-alpha.1");var g=function(n){function u(o,r,i,a){var u=this,p=new t.EventEmitter,h=new c(a.appkey,"RC-E","IM",p),g=new l(a.appkey,"RC-E","IM",p);return(u=n.call(this,o,r,i,a,h,g)||this).waitingLogs=[],u.latestSendTimestamp=0,u._resolveMaps={},p.on(s,(function(t){u.waitingLogs.push(t),u.check2SendLog()})),u._logEmitter=p,h.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){var s={batchMessage:u._batchMessage.bind(u),onRTCDataChange:u._onRTCDataChange.bind(u),onConnected:u._onConnected.bind(u),onNaviDataChange:u._onNaviDataChange.bind(u)};if(s[n])s[n](o,a);else{var c={onConnecting:t.RCConnectionStatus.CONNECTING,onSuspend:t.RCConnectionStatus.SUSPENDED,onDisconnected:t.RCConnectionStatus.DISCONNECTED};c[n]&&u._setConnectionStatus(c[n]),a(o[0])}}else u.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=u._resolveMaps[e];r&&(delete u._resolveMaps[e],r.apply(void 0,n))})),u._options.httpInMainProcess&&(o.httpReq=u.sendHTTPRequest.bind(u)),e.ipcRenderer.send("__RC_INNER_COMMAND_INIT__",{navigators:a.navigators,areaCode:a.areaCode,logServerUrl:a.logServerUrl}),u._cache=u._callMainSync("getMainProcessCache"),u}return o(u,n),u.prototype._batchMessage=function(t,e){var n=t[0].hasMoreMsg;delete t[0].hasMoreMsg,e([t[0]],void 0,n)},u.prototype._onRTCDataChange=function(t,e){var n=t[0];this._receiveRtcKv(new Uint8Array(n))},u.prototype._onConnected=function(t,e){this._cache=t[0],e(void 0)},u.prototype._onNaviDataChange=function(t,e){this._cache.naviInfo=t[0],e([t[0]])},u.prototype._setConnectionStatus=function(t){this._cache.connectionStatus=t},u.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)},u.prototype.sendHTTPRequest=function(t){return this._callMain("sendHTTPRequest",t)},u.prototype.setUserStatusListener=function(t,e){throw new Error("TODO -> RCCppEngine.setUserStatusListener")},u.prototype._callMain=function(t){for(var n=this,o=[],r=1;r<arguments.length;r++)o[r-1]=arguments[r];return new Promise((function(r){var i=h(t);n._resolveMaps[i]=r,e.ipcRenderer.send.apply(e.ipcRenderer,a(["__RC_CHANNEL_CALL_MAIN__",i,t],o,!1))}))},u.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))},u.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))},u.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))},u.prototype.refetchNaviInfo=function(){return this._callMain("refetchNaviInfo")},u.prototype.getNaviInfoFromCache=function(){return this._cache.naviInfo},u.prototype.createLogger=function(t,e){return new c(this._appkey,t,e,this._logEmitter)},u.prototype.getConnectionStatus=function(){return this._cache.connectionStatus},u.prototype.connect=function(t,e,n,o){return r(this,void 0,void 0,(function(){return i(this,(function(r){return[2,this._callMain("connect",t,e,n,o)]}))}))},u.prototype.reportSDKInfo=function(t){this._send2Main("reportSDKInfo",t)},u.prototype.getConnectedTime=function(){return this._cache.connectedTime},u.prototype.getHistoryMessage=function(t,e,n,o,r,i,a){return this._callMain("getHistoryMessage",t,e,n,o,r,i,a)},u.prototype.getMessages=function(t,e,n,o,r,i){return this._callMain("getMessages",t,e,n,o,r,i)},u.prototype.getHistoryMessagesByObjectNames=function(t,e,n,o,r,i,a){return this._callMain("getHistoryMessagesByObjectNames",t,e,n,o,r,i,a)},u.prototype.deleteRemoteMessage=function(t,e,n,o){return this._callMain("deleteRemoteMessage",t,e,n,o)},u.prototype.recallMsg=function(t,e,n,o,r){return this._callMain("recallMsg",t,e,n,o,r)},u.prototype.deleteRemoteMessageByTimestamp=function(t,e,n,o){return this._callMain("deleteRemoteMessageByTimestamp",t,e,n,o)},u.prototype.getConversationList=function(t,e,n,o,r){return this._callMain("getConversationList",t,e,n,o,r)},u.prototype.getConversationsByPage=function(t,e,n,o){return this._callMain("getConversationsByPage",t,e,n,o)},u.prototype.getUnreadConversationList=function(t){return this._callMain("getUnreadConversationList",t)},u.prototype.getConversationListWithAllChannel=function(){return this._callMain("getConversationListWithAllChannel")},u.prototype.getConversationListWithAllChannelByPage=function(t,e){return this._callMain("getConversationListWithAllChannelByPage",t,e)},u.prototype.getConversation=function(t,e,n){return this._callMain("getConversation",t,e,n)},u.prototype.removeConversation=function(t,e,n){return this._callMain("removeConversation",t,e,n)},u.prototype.batchRemoveConversation=function(t){return this._callMain("batchRemoveConversation",t)},u.prototype.getAllConversationUnreadCount=function(t,e,n){return this._callMain("getAllConversationUnreadCount",t,e,n)},u.prototype.getConversationUnreadCount=function(t,e,n){return this._callMain("getConversationUnreadCount",t,e,n)},u.prototype.getTotalUnreadCountByLevels=function(t,e,n){return this._callMain("getTotalUnreadCountByLevels",t,e,n)},u.prototype.clearConversationUnreadCount=function(t,e,n){return this._callMain("clearConversationUnreadCount",t,e,n)},u.prototype.getFirstUnreadMessage=function(t,e,n){return this._callMain("getFirstUnreadMessage",t,e,n)},u.prototype.getFirstUnreadMessageInfo=function(t,e,n){return this._callMain("getFirstUnreadMessageInfo",t,e,n)},u.prototype.saveConversationMessageDraft=function(t,e,n){return this._callMain("saveConversationMessageDraft",t,e,n)},u.prototype.getConversationMessageDraft=function(t,e){return this._callMain("getConversationMessageDraft",t,e)},u.prototype.clearConversationMessageDraft=function(t,e){return this._callMain("clearConversationMessageDraft",t,e)},u.prototype.pullConversationStatus=function(t){return this._callMain("pullConversationStatus",t)},u.prototype.batchSetConversationStatus=function(e){var n=e[0].notificationLevel;return t.isUndefined(n)?this._callMain("batchSetConversationStatus",e):Promise.resolve(t.ErrorCode.NOT_SUPPORT)},u.prototype.batchSetConversationToTop=function(t,e,n){return this._callMain("batchSetConversationToTop",t,e,n)},u.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)},u.prototype.sendReadReceiptMessage=function(t,e,n){return this._callMain("sendReadReceiptMessage",t,e,n)},u.prototype.getMessageReader=function(t,e,n){return this._callMain("getMessageReader",t,e,n)},u.prototype.sendReadReceiptMessageV4=function(t,e,n){return this._callMain("sendReadReceiptMessageV4",t,e,n)},u.prototype.getMessageReadReceiptV4=function(t,e){return this._callMain("getMessageReadReceiptV4",t,e)},u.prototype.batchGetMessageReadReceiptInfoV4=function(e,n){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},u.prototype.updateConversationReadTime=function(t,e){return this._callMain("updateConversationReadTime",t,e)},u.prototype.disconnect=function(t){return r(this,void 0,void 0,(function(){return i(this,(function(e){return this._send2Main("disconnect",t),[2]}))}))},u.prototype.pullUserSettings=function(t){return this._callMain("pullUserSettings",t)},u.prototype.registerMessageType=function(t,e,n,o){this._send2Main("registerMessageType",t,e,n,o)},u.prototype.joinChatroom=function(t,e){return this._callMain("joinChatroom",t,e)},u.prototype.joinExistChatroom=function(t,e){return this._callMain("joinExistChatroom",t,e)},u.prototype.quitChatroom=function(t){return this._callMain("quitChatroom",t)},u.prototype.getChatroomInfo=function(t,e,n){return this._callMain("getChatroomInfo",t,e,n)},u.prototype.getChatroomHistoryMessages=function(t,e,n,o){return this._callMain("getChatroomHistoryMessages",t,e,n,o)},u.prototype.setChatroomEntry=function(t,e){return this._callMain("setChatroomEntry",t,e)},u.prototype.setChatroomEntries=function(t,e){return this._callMain("setChatroomEntries",t,e)},u.prototype.forceSetChatroomEntry=function(t,e){return this._callMain("forceSetChatroomEntry",t,e)},u.prototype.removeChatroomEntry=function(t,e){return this._callMain("removeChatroomEntry",t,e)},u.prototype.forceRemoveChatroomEntry=function(t,e){return this._callMain("forceRemoveChatroomEntry",t,e)},u.prototype.removeChatroomEntries=function(t,e){return this._callMain("removeChatroomEntries",t,e)},u.prototype.getChatroomEntry=function(t,e){return this._callMain("getChatroomEntry",t,e)},u.prototype.getAllChatroomEntry=function(t){return this._callMain("getAllChatroomEntry",t)},u.prototype.getFileToken=function(t,e,n,o,r){return this._callMain("getFileToken",t,e,n,o,r)},u.prototype.getFileUrl=function(t,e,n,o){return this._callMain("getFileUrl",t,e,n,o)},u.prototype.setUserStatus=function(t){return this._callMain("setUserStatus",t)},u.prototype.subscribeUserStatus=function(t){return this._callMain("subscribeUserStatus",t)},u.prototype.getUserStatus=function(t){return this._callMain("getUserStatus",t)},u.prototype.clearConversations=function(t,e){return this._callMain("clearConversations",t,e)},u.prototype.addToBlacklist=function(t){return this._callMain("addToBlacklist",t)},u.prototype.removeFromBlacklist=function(t){return this._callMain("removeFromBlacklist",t)},u.prototype.getBlacklist=function(){return this._callMain("getBlacklist")},u.prototype.getBlacklistStatus=function(t){return this._callMain("getBlacklistStatus",t)},u.prototype.insertMessage=function(t,e,n){return this._callMain("insertMessage",t,e,n)},u.prototype.batchInsertMessage=function(t,e){return this._callMain("batchInsertMessage",t,e)},u.prototype.getMessageCount=function(t,e,n){return this._callMain("getMessageCount",t,e,n)},u.prototype.deleteMessages=function(t){return this._callMain("deleteMessages",t)},u.prototype.deleteMessagesByTimestamp=function(t,e,n,o,r){return this._callMain("deleteMessagesByTimestamp",t,e,n,o,r)},u.prototype.batchClearMessagesByTimestamp=function(t){return this._callMain("batchClearMessagesByTimestamp",t)},u.prototype.batchClearRemoteHistoryMessages=function(t,e){return this._callMain("batchClearRemoteHistoryMessages",t,e)},u.prototype.clearMessages=function(t,e,n){return this._callMain("clearMessages",t,e,n)},u.prototype.getMessage=function(t){return this._callMain("getMessage",t)},u.prototype.setMessageContent=function(t,e,n){return this._callMain("setMessageContent",t,e,n)},u.prototype.setMessageSearchField=function(t,e,n){return this._callMain("setMessageSearchField",t,e,n)},u.prototype.searchConversationByContent=function(t,e,n,o){return this._callMain("searchConversationByContent",t,e,n,o)},u.prototype.searchConversationByContentWithAllChannel=function(t,e,n){return this._callMain("searchConversationByContentWithAllChannel",t,e,n)},u.prototype.searchMessageByContentWithAllChannel=function(t,e,n,o,r){return this._callMain("searchMessageByContentWithAllChannel",t,e,n,o,r)},u.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(t,e,n,o,r,i,a){return this._callMain("searchMessageByContentInTimeRangeWithAllChannel",t,e,n,o,r,i,a)},u.prototype.searchMessageByContent=function(t,e,n,o,r,i,a){return this._callMain("searchMessageByContent",t,e,n,o,r,i,a)},u.prototype.searchMessagesByUser=function(t,e,n,o,r,i){return this._callMain("searchMessagesByUser",t,e,n,o,r,i)},u.prototype.getUnreadMentionedMessages=function(t,e,n){return this._callMainSync("getUnreadMentionedMessages",t,e,n)},u.prototype.setMessageSentStatus=function(t,e){return this._callMain("setMessageSentStatus",t,e)},u.prototype.setMessageReceivedStatus=function(t,e){return this._callMain("setMessageReceivedStatus",t,e)},u.prototype.updateMessageReceiptStatus=function(t,e,n,o){return this._callMain("updateMessageReceiptStatus",t,e,n,o)},u.prototype.clearUnreadCountByTimestamp=function(t,e,n,o){return this._callMain("clearUnreadCountByTimestamp",t,e,n,o)},u.prototype.clearAllUnreadCount=function(){throw new Error("Method not implemented.")},u.prototype.getConversationNotificationStatus=function(t,e,n){return this._callMain("getConversationNotificationStatus",t,e,n)},u.prototype.getRemoteHistoryMessages=function(t,e,n,o,r,i){return this._callMain("getRemoteHistoryMessages",t,e,n,o,r,i)},u.prototype.getServerTime=function(){return Date.now()-this._cache.deltaTime},u.prototype.getDeviceId=function(){return this._cache.deviceId},u.prototype.getCurrentUserId=function(){return this._cache.crtUserId},u.prototype.bindRTCRoomForChatroom=function(t){return this._callMain("bindRTCRoomForChatroom",t)},u.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}]}}))}))},u.prototype.rtcPing=function(t,e,n){return this._callMain("rtcPing",t,e,n)},u.prototype.createTag=function(t){return this._callMain("createTag",t)},u.prototype.removeTag=function(t){return this._callMain("removeTag",t)},u.prototype.updateTag=function(t){return this._callMain("updateTag",t)},u.prototype.getTagList=function(){return this._callMain("getTagList")},u.prototype.addTagForConversations=function(t,e){return this._callMain("addTagForConversations",t,e)},u.prototype.removeTagForConversations=function(t,e){return this._callMain("removeTagForConversations",t,e)},u.prototype.removeTagsForConversation=function(t,e){return this._callMain("removeTagsForConversation",t,e)},u.prototype.getConversationListByTag=function(t,e,n,o){return this._callMain("getConversationListByTag",t,e,n,o)},u.prototype.getUnreadCountByTag=function(t,e){return this._callMain("getUnreadCountByTag",t,e)},u.prototype.setConversationStatusInTag=function(t,e,n){return this._callMain("setConversationStatusInTag",t,e,n)},u.prototype.getTagsForConversation=function(t){return this._callMain("getTagsForConversation",t)},u.prototype.clearData=function(){return this._callMain("clearData")},u.prototype.getBlockConversationList=function(){throw new Error("Method not implemented.")},u.prototype.getGroupMessageDeliverList=function(t,e,n){return this._callMain("getGroupMessageDeliverList",t,e,n)},u.prototype.getPrivateMessageDeliverTime=function(t,e){return this._callMain("getPrivateMessageDeliverTime",t,e)},u.prototype.setCallInfo=function(t,e,n){return this._callMain("setCallInfo",t,e,n)},u.prototype.getTopConversationList=function(t,e){return this._callMain("getTopConversationList",t,e)},u.prototype.getUnreadMentionedCount=function(t){throw new Error("Method not implemented.")},u.prototype.getAllUnreadMentionedCount=function(){return this._callMain("getAllUnreadMentionedCount")},u.prototype.getAllConversationState=function(){throw new Error("Method not implemented.")},u.prototype.getUltraGroupList=function(){throw new Error("Method not implemented.")},u.prototype.getBlockUltraGroupList=function(){throw new Error("Method not implemented.")},u.prototype.getTopUltraGroupList=function(){throw new Error("Method not implemented.")},u.prototype.clearUltraUnreadcount=function(t,e){throw new Error("Method not implemented.")},u.prototype.getUltraGroupUnreadMentionedCountByTargetId=function(t,e){throw new Error("Method not implemented.")},u.prototype.sendUltraMessage=function(t,e,n){throw new Error("Method not implemented.")},u.prototype.sendUltraGroupTypingStatus=function(t,e){throw new Error("Method not implemented.")},u.prototype.getUltraGroupMessageListByMessageUId=function(t){throw new Error("Method not implemented.")},u.prototype.expandUltraMessage=function(t){throw new Error("Method not implemented.")},u.prototype.modifyMessage=function(t){throw new Error("Method not implemented.")},u.prototype.getUltraHistoryMsg=function(t,e){throw new Error("Method not implemented.")},u.prototype.getConversationNotificationLevel=function(t,e,n){return this._callMain("getConversationNotificationLevel",t,e,n)},u.prototype.setConversationNotificationLevel=function(t,e,n,o){return this._callMain("setConversationNotificationLevel",t,e,n,o)},u.prototype.batchSetConversationNotificationLevel=function(t,e){return this._callMain("batchSetConversationNotificationLevel",t,e)},u.prototype.getUltraGroupDefaultNotificationLevel=function(e,n){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},u.prototype.getAllUltraGroupUnreadCount=function(){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},u.prototype.getUltraGroupUnreadCountByTargetId=function(){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},u.prototype.setUltraGroupDefaultNotificationLevel=function(){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},u.prototype.getUltraGroupUnreadMentionedMessages=function(){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},u.prototype.getUltraGroupFirstUnreadMessageTimestamp=function(){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},u.prototype.getUltraGroupUnreadInfoList=function(){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},u.prototype.getOSInfo=function(){return r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this._callMain("getOSInfo")]}))}))},u.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()}}]}))}))},u.prototype.getMainProcessInfo=function(){return r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this._callMain("getMainProcessInfo")]}))}))},u.prototype.setProxy=function(t){return this._callMain("setProxy",t)},u.prototype.getProxy=function(){return this._callMain("getProxy")},u.prototype.testProxy=function(t,e){return this._callMain("testProxy",t,e)},u.prototype.setCheckDuplicateMessage=function(t){return this._callMain("checkDuplicateMessage",t)},u.prototype.setNetwork=function(t,n){e.ipcRenderer.send("__RC_CHANNEL_SEND_2_MAIN__","onRendererNetworkStatusReceived",t,n)},u}(t.AEngine);window&&(window.RCCppEngine=g),exports.RCCppEngine=g;
|
|
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="logdata",c=function(t){function e(e,n,o,r){var i=t.call(this,e,n,o)||this;return i.emiter=r,i}return o(e,t),e.prototype.flush=function(t){this.emiter.emit(s,t)},e}(t.BasicLogger),l=function(t){function e(e,n,o,r){var i=t.call(this,e,n,o)||this;return i.emiter=r,i}return o(e,t),e.prototype.flush=function(t){this.emiter.emit("logdata",t)},e}(t.BasicStatistic),p=0,u=Date.now(),h=function(t){var e=Date.now();return u!==e&&(u=e,p=0),[t,process.pid,e,p++].join("__")};t.VersionManage.add("electron-renderer","5.9.0-alpha.3");var g=function(n){function p(o,r,i,a){var p=this,u=new t.EventEmitter,h=new c(a.appkey,"RC-E","IM",u),g=new l(a.appkey,"RC-E","IM",u);return(p=n.call(this,o,r,i,a,h,g)||this).waitingLogs=[],p.latestSendTimestamp=0,p._resolveMaps={},u.on(s,(function(t){p.waitingLogs.push(t),p.check2SendLog()})),p._logEmitter=u,h.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){var s={batchMessage:p._batchMessage.bind(p),onRTCDataChange:p._onRTCDataChange.bind(p),onConnected:p._onConnected.bind(p),onNaviDataChange:p._onNaviDataChange.bind(p)};if(s[n])s[n](o,a);else{var c={onConnecting:t.RCConnectionStatus.CONNECTING,onSuspend:t.RCConnectionStatus.SUSPENDED,onDisconnected:t.RCConnectionStatus.DISCONNECTED};c[n]&&p._setConnectionStatus(c[n]),a(o[0])}}else p.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=p._resolveMaps[e];r&&(delete p._resolveMaps[e],r.apply(void 0,n))})),p._options.httpInMainProcess&&(o.httpReq=p.sendHTTPRequest.bind(p)),e.ipcRenderer.send("__RC_INNER_COMMAND_INIT__",{navigators:a.navigators,areaCode:a.areaCode,logServerUrl:a.logServerUrl}),p._cache=p._callMainSync("getMainProcessCache"),p}return o(p,n),p.prototype._batchMessage=function(t,e){var n=t[0].hasMoreMsg;delete t[0].hasMoreMsg,e([t[0]],void 0,n)},p.prototype._onRTCDataChange=function(t,e){var n=t[0];this._receiveRtcKv(new Uint8Array(n))},p.prototype._onConnected=function(t,e){this._cache=t[0],e(void 0)},p.prototype._onNaviDataChange=function(t,e){this._cache.naviInfo=t[0],e([t[0]])},p.prototype._setConnectionStatus=function(t){this._cache.connectionStatus=t},p.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)},p.prototype.sendHTTPRequest=function(t){return this._callMain("sendHTTPRequest",t)},p.prototype.setUserStatusListener=function(t,e){throw new Error("TODO -> RCCppEngine.setUserStatusListener")},p.prototype._callMain=function(t){for(var n=this,o=[],r=1;r<arguments.length;r++)o[r-1]=arguments[r];return new Promise((function(r){var i=h(t);n._resolveMaps[i]=r,e.ipcRenderer.send.apply(e.ipcRenderer,a(["__RC_CHANNEL_CALL_MAIN__",i,t],o,!1))}))},p.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))},p.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))},p.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))},p.prototype.refetchNaviInfo=function(){return this._callMain("refetchNaviInfo")},p.prototype.getNaviInfoFromCache=function(){return this._cache.naviInfo},p.prototype.createLogger=function(t,e){return new c(this._appkey,t,e,this._logEmitter)},p.prototype.createStatisticLogger=function(t,e){return new l(this._appkey,t,e,this._logEmitter)},p.prototype.getConnectionStatus=function(){return this._cache.connectionStatus},p.prototype.connect=function(t,e,n,o){return r(this,void 0,void 0,(function(){return i(this,(function(r){return[2,this._callMain("connect",t,e,n,o)]}))}))},p.prototype.reportSDKInfo=function(t){this._send2Main("reportSDKInfo",t)},p.prototype.getConnectedTime=function(){return this._cache.connectedTime},p.prototype.getHistoryMessage=function(t,e,n,o,r,i,a){return this._callMain("getHistoryMessage",t,e,n,o,r,i,a)},p.prototype.getMessages=function(t,e,n,o,r,i){return this._callMain("getMessages",t,e,n,o,r,i)},p.prototype.getHistoryMessagesByObjectNames=function(t,e,n,o,r,i,a){return this._callMain("getHistoryMessagesByObjectNames",t,e,n,o,r,i,a)},p.prototype.deleteRemoteMessage=function(t,e,n,o){return this._callMain("deleteRemoteMessage",t,e,n,o)},p.prototype.recallMsg=function(t,e,n,o,r){return this._callMain("recallMsg",t,e,n,o,r)},p.prototype.deleteRemoteMessageByTimestamp=function(t,e,n,o){return this._callMain("deleteRemoteMessageByTimestamp",t,e,n,o)},p.prototype.getConversationList=function(t,e,n,o,r){return this._callMain("getConversationList",t,e,n,o,r)},p.prototype.getConversationsByPage=function(t,e,n,o){return this._callMain("getConversationsByPage",t,e,n,o)},p.prototype.getUnreadConversationList=function(t){return this._callMain("getUnreadConversationList",t)},p.prototype.getConversationListWithAllChannel=function(){return this._callMain("getConversationListWithAllChannel")},p.prototype.getConversationListWithAllChannelByPage=function(t,e){return this._callMain("getConversationListWithAllChannelByPage",t,e)},p.prototype.getConversation=function(t,e,n){return this._callMain("getConversation",t,e,n)},p.prototype.removeConversation=function(t,e,n){return this._callMain("removeConversation",t,e,n)},p.prototype.batchRemoveConversation=function(t){return this._callMain("batchRemoveConversation",t)},p.prototype.getAllConversationUnreadCount=function(t,e,n){return this._callMain("getAllConversationUnreadCount",t,e,n)},p.prototype.getConversationUnreadCount=function(t,e,n){return this._callMain("getConversationUnreadCount",t,e,n)},p.prototype.getTotalUnreadCountByLevels=function(t,e,n){return this._callMain("getTotalUnreadCountByLevels",t,e,n)},p.prototype.clearConversationUnreadCount=function(t,e,n){return this._callMain("clearConversationUnreadCount",t,e,n)},p.prototype.getFirstUnreadMessage=function(t,e,n){return this._callMain("getFirstUnreadMessage",t,e,n)},p.prototype.getFirstUnreadMessageInfo=function(t,e,n){return this._callMain("getFirstUnreadMessageInfo",t,e,n)},p.prototype.saveConversationMessageDraft=function(t,e,n){return this._callMain("saveConversationMessageDraft",t,e,n)},p.prototype.getConversationMessageDraft=function(t,e){return this._callMain("getConversationMessageDraft",t,e)},p.prototype.clearConversationMessageDraft=function(t,e){return this._callMain("clearConversationMessageDraft",t,e)},p.prototype.pullConversationStatus=function(t){return this._callMain("pullConversationStatus",t)},p.prototype.batchSetConversationStatus=function(e){var n=e[0].notificationLevel;return t.isUndefined(n)?this._callMain("batchSetConversationStatus",e):Promise.resolve(t.ErrorCode.NOT_SUPPORT)},p.prototype.batchSetConversationToTop=function(t,e,n){return this._callMain("batchSetConversationToTop",t,e,n)},p.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)},p.prototype.sendReadReceiptMessage=function(t,e,n){return this._callMain("sendReadReceiptMessage",t,e,n)},p.prototype.getMessageReader=function(t,e,n){return this._callMain("getMessageReader",t,e,n)},p.prototype.sendReadReceiptMessageV4=function(t,e,n){return this._callMain("sendReadReceiptMessageV4",t,e,n)},p.prototype.getMessageReadReceiptV4=function(t,e){return this._callMain("getMessageReadReceiptV4",t,e)},p.prototype.batchGetMessageReadReceiptInfoV4=function(e,n){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},p.prototype.updateConversationReadTime=function(t,e){return this._callMain("updateConversationReadTime",t,e)},p.prototype.disconnect=function(t){return r(this,void 0,void 0,(function(){return i(this,(function(e){return this._send2Main("disconnect",t),[2]}))}))},p.prototype.pullUserSettings=function(t){return this._callMain("pullUserSettings",t)},p.prototype.registerMessageType=function(t,e,n,o){this._send2Main("registerMessageType",t,e,n,o)},p.prototype.joinChatroom=function(t,e){return this._callMain("joinChatroom",t,e)},p.prototype.joinExistChatroom=function(t,e){return this._callMain("joinExistChatroom",t,e)},p.prototype.quitChatroom=function(t){return this._callMain("quitChatroom",t)},p.prototype.getChatroomInfo=function(t,e,n){return this._callMain("getChatroomInfo",t,e,n)},p.prototype.getChatroomHistoryMessages=function(t,e,n,o){return this._callMain("getChatroomHistoryMessages",t,e,n,o)},p.prototype.setChatroomEntry=function(t,e){return this._callMain("setChatroomEntry",t,e)},p.prototype.setChatroomEntries=function(t,e){return this._callMain("setChatroomEntries",t,e)},p.prototype.forceSetChatroomEntry=function(t,e){return this._callMain("forceSetChatroomEntry",t,e)},p.prototype.removeChatroomEntry=function(t,e){return this._callMain("removeChatroomEntry",t,e)},p.prototype.forceRemoveChatroomEntry=function(t,e){return this._callMain("forceRemoveChatroomEntry",t,e)},p.prototype.removeChatroomEntries=function(t,e){return this._callMain("removeChatroomEntries",t,e)},p.prototype.getChatroomEntry=function(t,e){return this._callMain("getChatroomEntry",t,e)},p.prototype.getAllChatroomEntry=function(t){return this._callMain("getAllChatroomEntry",t)},p.prototype.getFileToken=function(t,e,n,o,r){return this._callMain("getFileToken",t,e,n,o,r)},p.prototype.getFileUrl=function(t,e,n,o){return this._callMain("getFileUrl",t,e,n,o)},p.prototype.setUserStatus=function(t){return this._callMain("setUserStatus",t)},p.prototype.subscribeUserStatus=function(t){return this._callMain("subscribeUserStatus",t)},p.prototype.getUserStatus=function(t){return this._callMain("getUserStatus",t)},p.prototype.clearConversations=function(t,e){return this._callMain("clearConversations",t,e)},p.prototype.addToBlacklist=function(t){return this._callMain("addToBlacklist",t)},p.prototype.removeFromBlacklist=function(t){return this._callMain("removeFromBlacklist",t)},p.prototype.getBlacklist=function(){return this._callMain("getBlacklist")},p.prototype.getBlacklistStatus=function(t){return this._callMain("getBlacklistStatus",t)},p.prototype.insertMessage=function(t,e,n){return this._callMain("insertMessage",t,e,n)},p.prototype.batchInsertMessage=function(t,e){return this._callMain("batchInsertMessage",t,e)},p.prototype.getMessageCount=function(t,e,n){return this._callMain("getMessageCount",t,e,n)},p.prototype.deleteMessages=function(t){return this._callMain("deleteMessages",t)},p.prototype.deleteMessagesByTimestamp=function(t,e,n,o,r){return this._callMain("deleteMessagesByTimestamp",t,e,n,o,r)},p.prototype.batchClearMessagesByTimestamp=function(t){return this._callMain("batchClearMessagesByTimestamp",t)},p.prototype.batchClearRemoteHistoryMessages=function(t,e){return this._callMain("batchClearRemoteHistoryMessages",t,e)},p.prototype.clearMessages=function(t,e,n){return this._callMain("clearMessages",t,e,n)},p.prototype.getMessage=function(t){return this._callMain("getMessage",t)},p.prototype.setMessageContent=function(t,e,n){return this._callMain("setMessageContent",t,e,n)},p.prototype.setMessageSearchField=function(t,e,n){return this._callMain("setMessageSearchField",t,e,n)},p.prototype.searchConversationByContent=function(t,e,n,o){return this._callMain("searchConversationByContent",t,e,n,o)},p.prototype.searchConversationByContentWithAllChannel=function(t,e,n){return this._callMain("searchConversationByContentWithAllChannel",t,e,n)},p.prototype.searchMessageByContentWithAllChannel=function(t,e,n,o,r){return this._callMain("searchMessageByContentWithAllChannel",t,e,n,o,r)},p.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(t,e,n,o,r,i,a){return this._callMain("searchMessageByContentInTimeRangeWithAllChannel",t,e,n,o,r,i,a)},p.prototype.searchMessageByContent=function(t,e,n,o,r,i,a){return this._callMain("searchMessageByContent",t,e,n,o,r,i,a)},p.prototype.searchMessagesByUser=function(t,e,n,o,r,i){return this._callMain("searchMessagesByUser",t,e,n,o,r,i)},p.prototype.getUnreadMentionedMessages=function(t,e,n){return this._callMainSync("getUnreadMentionedMessages",t,e,n)},p.prototype.setMessageSentStatus=function(t,e){return this._callMain("setMessageSentStatus",t,e)},p.prototype.setMessageReceivedStatus=function(t,e){return this._callMain("setMessageReceivedStatus",t,e)},p.prototype.updateMessageReceiptStatus=function(t,e,n,o){return this._callMain("updateMessageReceiptStatus",t,e,n,o)},p.prototype.clearUnreadCountByTimestamp=function(t,e,n,o){return this._callMain("clearUnreadCountByTimestamp",t,e,n,o)},p.prototype.clearAllUnreadCount=function(){throw new Error("Method not implemented.")},p.prototype.getConversationNotificationStatus=function(t,e,n){return this._callMain("getConversationNotificationStatus",t,e,n)},p.prototype.getRemoteHistoryMessages=function(t,e,n,o,r,i){return this._callMain("getRemoteHistoryMessages",t,e,n,o,r,i)},p.prototype.getServerTime=function(){return Date.now()-this._cache.deltaTime},p.prototype.getDeviceId=function(){return this._cache.deviceId},p.prototype.getCurrentUserId=function(){return this._cache.crtUserId},p.prototype.bindRTCRoomForChatroom=function(t){return this._callMain("bindRTCRoomForChatroom",t)},p.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}]}}))}))},p.prototype.rtcPing=function(t,e,n){return this._callMain("rtcPing",t,e,n)},p.prototype.createTag=function(t){return this._callMain("createTag",t)},p.prototype.removeTag=function(t){return this._callMain("removeTag",t)},p.prototype.updateTag=function(t){return this._callMain("updateTag",t)},p.prototype.getTagList=function(){return this._callMain("getTagList")},p.prototype.addTagForConversations=function(t,e){return this._callMain("addTagForConversations",t,e)},p.prototype.removeTagForConversations=function(t,e){return this._callMain("removeTagForConversations",t,e)},p.prototype.removeTagsForConversation=function(t,e){return this._callMain("removeTagsForConversation",t,e)},p.prototype.getConversationListByTag=function(t,e,n,o){return this._callMain("getConversationListByTag",t,e,n,o)},p.prototype.getUnreadCountByTag=function(t,e){return this._callMain("getUnreadCountByTag",t,e)},p.prototype.setConversationStatusInTag=function(t,e,n){return this._callMain("setConversationStatusInTag",t,e,n)},p.prototype.getTagsForConversation=function(t){return this._callMain("getTagsForConversation",t)},p.prototype.clearData=function(){return this._callMain("clearData")},p.prototype.getBlockConversationList=function(){throw new Error("Method not implemented.")},p.prototype.getGroupMessageDeliverList=function(t,e,n){return this._callMain("getGroupMessageDeliverList",t,e,n)},p.prototype.getPrivateMessageDeliverTime=function(t,e){return this._callMain("getPrivateMessageDeliverTime",t,e)},p.prototype.setCallInfo=function(t,e,n){return this._callMain("setCallInfo",t,e,n)},p.prototype.getTopConversationList=function(t,e){return this._callMain("getTopConversationList",t,e)},p.prototype.getUnreadMentionedCount=function(t){throw new Error("Method not implemented.")},p.prototype.getAllUnreadMentionedCount=function(){return this._callMain("getAllUnreadMentionedCount")},p.prototype.getAllConversationState=function(){throw new Error("Method not implemented.")},p.prototype.getUltraGroupList=function(){throw new Error("Method not implemented.")},p.prototype.getBlockUltraGroupList=function(){throw new Error("Method not implemented.")},p.prototype.getTopUltraGroupList=function(){throw new Error("Method not implemented.")},p.prototype.clearUltraUnreadcount=function(t,e){throw new Error("Method not implemented.")},p.prototype.getUltraGroupUnreadMentionedCountByTargetId=function(t,e){throw new Error("Method not implemented.")},p.prototype.sendUltraMessage=function(t,e,n){throw new Error("Method not implemented.")},p.prototype.sendUltraGroupTypingStatus=function(t,e){throw new Error("Method not implemented.")},p.prototype.getUltraGroupMessageListByMessageUId=function(t){throw new Error("Method not implemented.")},p.prototype.expandUltraMessage=function(t){throw new Error("Method not implemented.")},p.prototype.modifyMessage=function(t){throw new Error("Method not implemented.")},p.prototype.getUltraHistoryMsg=function(t,e){throw new Error("Method not implemented.")},p.prototype.getConversationNotificationLevel=function(t,e,n){return this._callMain("getConversationNotificationLevel",t,e,n)},p.prototype.setConversationNotificationLevel=function(t,e,n,o){return this._callMain("setConversationNotificationLevel",t,e,n,o)},p.prototype.batchSetConversationNotificationLevel=function(t,e){return this._callMain("batchSetConversationNotificationLevel",t,e)},p.prototype.getUltraGroupDefaultNotificationLevel=function(e,n){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},p.prototype.getAllUltraGroupUnreadCount=function(){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},p.prototype.getUltraGroupUnreadCountByTargetId=function(){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},p.prototype.setUltraGroupDefaultNotificationLevel=function(){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},p.prototype.getUltraGroupUnreadMentionedMessages=function(){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},p.prototype.getUltraGroupFirstUnreadMessageTimestamp=function(){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},p.prototype.getUltraGroupUnreadInfoList=function(){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},p.prototype.getOSInfo=function(){return r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this._callMain("getOSInfo")]}))}))},p.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()}}]}))}))},p.prototype.getMainProcessInfo=function(){return r(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this._callMain("getMainProcessInfo")]}))}))},p.prototype.setProxy=function(t){return this._callMain("setProxy",t)},p.prototype.getProxy=function(){return this._callMain("getProxy")},p.prototype.testProxy=function(t,e){return this._callMain("testProxy",t,e)},p.prototype.setCheckDuplicateMessage=function(t){return this._callMain("checkDuplicateMessage",t)},p.prototype.setNetwork=function(t,n){e.ipcRenderer.send("__RC_CHANNEL_SEND_2_MAIN__","onRendererNetworkStatusReceived",t,n)},p}(t.AEngine);window&&(window.RCCppEngine=g),exports.RCCppEngine=g;
|
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.9.0-alpha.
|
|
13
|
+
"version": "5.9.0-alpha.3",
|
|
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.9.0-alpha.
|
|
24
|
+
"@rongcloud/engine": "=5.9.0-alpha.3"
|
|
25
25
|
}
|
|
26
26
|
}
|