@rongcloud/electron-renderer 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -0
- package/README.md +1 -0
- package/index.d.ts +193 -0
- package/index.esm.js +1 -0
- package/index.js +1 -0
- package/package.json +26 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Copyright (c) 2016 RongCloud.
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
+
a copy of this software and associated documentation files (the
|
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
+
the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be
|
|
12
|
+
included in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# @rongcloud/electron-renderer
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { AEngine, IRuntime, IEngineWatcher, IAPIContextOption, IExtraMethod, IAsyncRes, ANavi, INaviInfo, ErrorCode, ConversationType, IPromiseResult, IReceivedMessage, MessageDirection, IRecallMsgOptions, IReceivedConversation, IServerConversationStatus, ISetConversationStatusOptions, ISendMsgOptions, IMessageReaderResponse, IServerUserSetting, IChatroomInfo, IChrmKVEntry, IChrmKVEntries, FileType, IUploadAuth, UploadMethod, IInsertMsgOptions, NotificationStatus, RTCMode, RTCJoinType, IRTCUserData, IJoinRTCRoomData, IRTCRoomInfo, IRTCUsers, RTCApiType, KVString, IRtcTokenData, ITagParam, ITagInfo, IConversationOption, IReceivedConversationByTag, ILocalTagStatus, IConversationTag, IServerRTCRoomEntry, RTCIdentityChangeType, IRTCJoinedInfo, IBaseConversationInfo, IConversationState, IReqRoomPKOptions, ICancelRoomPKOptions, IResRoomPKOptions, IEndRoomPKOptions, OperateStatus, IUltraMsgQueryOptions, IUltraExMsgOptions, IUltraModifyMsgOptions, IGetMsgOption, IRTCRoomBindOption, NotificationLevel } from '@rongcloud/engine';
|
|
2
|
+
|
|
3
|
+
declare class RCCppEngine extends AEngine {
|
|
4
|
+
constructor(runtime: IRuntime, watcher: IEngineWatcher, options: IAPIContextOption);
|
|
5
|
+
setUserStatusListener(config: {
|
|
6
|
+
userIds: string[];
|
|
7
|
+
}, listener: Function): void;
|
|
8
|
+
private _resolveMaps;
|
|
9
|
+
private _callMain;
|
|
10
|
+
callExtra(method: string | keyof IExtraMethod, ...args: any[]): Promise<IAsyncRes<unknown>>;
|
|
11
|
+
private _send2Main;
|
|
12
|
+
private _callMainSync;
|
|
13
|
+
protected _createNavi(): ANavi;
|
|
14
|
+
private _insertLog2IndexDB;
|
|
15
|
+
connect(token: string, naviInfo: INaviInfo, reconnectKickEnable?: boolean): Promise<ErrorCode>;
|
|
16
|
+
reportSDKInfo(versionInfo: {
|
|
17
|
+
[name: string]: string;
|
|
18
|
+
}): void;
|
|
19
|
+
getConnectedTime(): number;
|
|
20
|
+
getHistoryMessage(conversationType: ConversationType, targetId: string, timestamp: number, count: number, order: 0 | 1, channelId: string, objectName: string): IPromiseResult<{
|
|
21
|
+
list: IReceivedMessage[];
|
|
22
|
+
hasMore: boolean;
|
|
23
|
+
}>;
|
|
24
|
+
deleteRemoteMessage(conversationType: ConversationType, targetId: string, messages: {
|
|
25
|
+
messageUId: string;
|
|
26
|
+
sentTime: number;
|
|
27
|
+
messageDirection: MessageDirection;
|
|
28
|
+
}[], channelId: string): Promise<ErrorCode>;
|
|
29
|
+
recallMsg(conversationType: ConversationType, targetId: string, messageUId: string, sentTime: number, recallMsgOptions: IRecallMsgOptions): IPromiseResult<IReceivedMessage>;
|
|
30
|
+
deleteRemoteMessageByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, channelId: string): Promise<ErrorCode>;
|
|
31
|
+
getConversationList(count: number, conversationType?: ConversationType, startTime?: number, order?: 0 | 1, channelId?: string): IPromiseResult<IReceivedConversation[]>;
|
|
32
|
+
getConversationListWithAllChannel(): IPromiseResult<IReceivedConversation[]>;
|
|
33
|
+
getConversationListWithAllChannelByPage(index: number, limit: number): IPromiseResult<IReceivedConversation[]>;
|
|
34
|
+
getConversation(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<IReceivedConversation>;
|
|
35
|
+
removeConversation(conversationType: ConversationType, targetId: string, channelId: string): Promise<ErrorCode>;
|
|
36
|
+
getAllConversationUnreadCount(channelIds: string, conversationTypes: ConversationType[], includeMuted: boolean): IPromiseResult<number>;
|
|
37
|
+
getConversationUnreadCount(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<number>;
|
|
38
|
+
clearConversationUnreadCount(conversationType: ConversationType, targetId: string, channelId: string): Promise<ErrorCode>;
|
|
39
|
+
getFirstUnreadMessage(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<IReceivedMessage | null>;
|
|
40
|
+
saveConversationMessageDraft(conversationType: ConversationType, targetId: string, draft: string): Promise<ErrorCode>;
|
|
41
|
+
getConversationMessageDraft(conversationType: ConversationType, targetId: string): IPromiseResult<string>;
|
|
42
|
+
clearConversationMessageDraft(conversationType: ConversationType, targetId: string): Promise<ErrorCode>;
|
|
43
|
+
pullConversationStatus(timestamp: number): Promise<IAsyncRes<IServerConversationStatus[]>>;
|
|
44
|
+
batchSetConversationStatus(statusList: ISetConversationStatusOptions[]): Promise<ErrorCode>;
|
|
45
|
+
sendMessage(conversationType: ConversationType, targetId: string, options: ISendMsgOptions, onBefore?: (messageId: number) => void): IPromiseResult<IReceivedMessage>;
|
|
46
|
+
sendReadReceiptMessage(targetId: string, messageUIds: string[], channelId?: string): Promise<IAsyncRes>;
|
|
47
|
+
getMessageReader(targetId: string, messageUId: string, channelId?: string): IPromiseResult<IMessageReaderResponse>;
|
|
48
|
+
disconnect(): void;
|
|
49
|
+
pullUserSettings(version: number): IPromiseResult<IServerUserSetting>;
|
|
50
|
+
registerMessageType(objectName: string, isPersited: boolean, isCounted: boolean, searchProps: string[]): void;
|
|
51
|
+
joinChatroom(chatroomId: string, count: number): Promise<ErrorCode>;
|
|
52
|
+
joinExistChatroom(chatroomId: string, count: number): Promise<ErrorCode>;
|
|
53
|
+
quitChatroom(chatroomId: string): Promise<ErrorCode>;
|
|
54
|
+
getChatroomInfo(chatroomId: string, count: number, order: number): IPromiseResult<IChatroomInfo>;
|
|
55
|
+
getChatroomHistoryMessages(chatroomId: string, timestamp: number, count: number, order: number): IPromiseResult<{
|
|
56
|
+
list: IReceivedMessage[];
|
|
57
|
+
hasMore: boolean;
|
|
58
|
+
}>;
|
|
59
|
+
setChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
|
|
60
|
+
setChatroomEntries(chatroomId: string, entryOptions: IChrmKVEntries): Promise<({
|
|
61
|
+
code: ErrorCode;
|
|
62
|
+
data?: any;
|
|
63
|
+
})>;
|
|
64
|
+
forceSetChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
|
|
65
|
+
removeChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
|
|
66
|
+
forceRemoveChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
|
|
67
|
+
removeChatroomEntries(chatroomId: string, entryOptions: IChrmKVEntries): Promise<{
|
|
68
|
+
code: ErrorCode;
|
|
69
|
+
data?: any;
|
|
70
|
+
}>;
|
|
71
|
+
getChatroomEntry(chatroomId: string, key: string): IPromiseResult<string | null>;
|
|
72
|
+
getAllChatroomEntry(chatroomId: string): IPromiseResult<{
|
|
73
|
+
[key: string]: string;
|
|
74
|
+
}>;
|
|
75
|
+
getFileToken(fileType: FileType, fileName?: string, httpMethod?: string, queryUriString?: string): Promise<IAsyncRes<IUploadAuth>>;
|
|
76
|
+
getFileUrl(fileType: FileType, uploadMethod: UploadMethod, fileName?: string, originName?: string): IPromiseResult<{
|
|
77
|
+
downloadUrl: string;
|
|
78
|
+
}>;
|
|
79
|
+
setUserStatus(status: number): Promise<ErrorCode>;
|
|
80
|
+
subscribeUserStatus(userIds: string[]): Promise<ErrorCode>;
|
|
81
|
+
getUserStatus(userId: string): IPromiseResult<{
|
|
82
|
+
status: string;
|
|
83
|
+
}>;
|
|
84
|
+
clearConversations(conversationTypes?: ConversationType[], channelId?: string): Promise<ErrorCode>;
|
|
85
|
+
addToBlacklist(userId: string): Promise<ErrorCode>;
|
|
86
|
+
removeFromBlacklist(userId: string): Promise<ErrorCode>;
|
|
87
|
+
getBlacklist(): IPromiseResult<string[]>;
|
|
88
|
+
getBlacklistStatus(userId: string): IPromiseResult<string>;
|
|
89
|
+
insertMessage(conversationType: ConversationType, targetId: string, insertOptions: IInsertMsgOptions): IPromiseResult<IReceivedMessage>;
|
|
90
|
+
deleteMessages(timestamps: number[]): Promise<ErrorCode>;
|
|
91
|
+
deleteMessagesByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, cleanSpace: boolean, channelId: string): Promise<ErrorCode>;
|
|
92
|
+
clearMessages(conversationType: ConversationType, targetId: string, channelId: string): Promise<ErrorCode>;
|
|
93
|
+
getMessage(messageId: number): IPromiseResult<IReceivedMessage>;
|
|
94
|
+
setMessageContent(messageId: number, content: any, messageType: string): Promise<ErrorCode>;
|
|
95
|
+
setMessageSearchField(messageId: number, content: any, searchFiles: string): Promise<ErrorCode>;
|
|
96
|
+
searchConversationByContent(keyword: string, customMessageTypes: string[], channelId: string, conversationTypes?: ConversationType[]): IPromiseResult<IReceivedConversation[]>;
|
|
97
|
+
searchMessageByContent(conversationType: ConversationType, targetId: string, keyword: string, timestamp: number, count: number, total: number, channelId: string): IPromiseResult<{
|
|
98
|
+
messages: IReceivedMessage[];
|
|
99
|
+
count: number;
|
|
100
|
+
}>;
|
|
101
|
+
getUnreadMentionedMessages(conversationType: ConversationType, targetId: string, channelId: string): IReceivedMessage[];
|
|
102
|
+
setMessageSentStatus(messageId: number, sentStatus: number): Promise<ErrorCode>;
|
|
103
|
+
setMessageReceivedStatus(messageId: number, receivedStatus: number): Promise<ErrorCode>;
|
|
104
|
+
clearUnreadCountByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, channelId: string): Promise<ErrorCode>;
|
|
105
|
+
clearAllUnreadCount(): Promise<ErrorCode>;
|
|
106
|
+
getConversationNotificationStatus(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<NotificationStatus>;
|
|
107
|
+
getRemoteHistoryMessages(conversationType: ConversationType, targetId: string, timestamp: number, count: number, order: 0 | 1, channelId: string): IPromiseResult<{
|
|
108
|
+
list: IReceivedMessage[];
|
|
109
|
+
hasMore: boolean;
|
|
110
|
+
}>;
|
|
111
|
+
getServerTime(): number;
|
|
112
|
+
getDeviceId(): string;
|
|
113
|
+
getCurrentUserId(): string;
|
|
114
|
+
joinRTCRoom(roomId: string, mode: RTCMode, broadcastType?: number, joinType?: RTCJoinType, innerUserDatas?: IRTCUserData, outerUserDatas?: IRTCUserData): IPromiseResult<IJoinRTCRoomData>;
|
|
115
|
+
quitRTCRoom(roomId: string): Promise<ErrorCode>;
|
|
116
|
+
rtcPing(roomId: string, mode: number, broadcastType?: number): Promise<ErrorCode>;
|
|
117
|
+
getRTCRoomInfo(roomId: string): IPromiseResult<IRTCRoomInfo>;
|
|
118
|
+
getRTCUserInfoList(roomId: string): IPromiseResult<IRTCUsers>;
|
|
119
|
+
getRTCUserInfo(roomId: string): IPromiseResult<unknown>;
|
|
120
|
+
setRTCUserInfo(roomId: string, key: string, value: string): Promise<ErrorCode>;
|
|
121
|
+
removeRTCUserInfo(roomId: string, keys: string[]): Promise<ErrorCode>;
|
|
122
|
+
setRTCData(roomId: string, key: string, value: string, isInner: boolean, apiType: RTCApiType, message?: {
|
|
123
|
+
name: string;
|
|
124
|
+
content: string;
|
|
125
|
+
}): Promise<ErrorCode>;
|
|
126
|
+
setRTCTotalRes(roomId: string, message: {
|
|
127
|
+
name: string;
|
|
128
|
+
content: string;
|
|
129
|
+
}, valueInfo: string, objectName: string, mcuValInfo: string): Promise<ErrorCode>;
|
|
130
|
+
setRTCCDNUris(roomId: string, objectName: string, CDNUris: string): Promise<ErrorCode>;
|
|
131
|
+
getRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType): IPromiseResult<KVString>;
|
|
132
|
+
removeRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType, message?: {
|
|
133
|
+
name: string;
|
|
134
|
+
content: string;
|
|
135
|
+
}): Promise<ErrorCode>;
|
|
136
|
+
setRTCOutData(roomId: string, rtcData: unknown, type: number, message: unknown): Promise<ErrorCode>;
|
|
137
|
+
getRTCOutData(roomId: string, userIds: string[]): IPromiseResult<unknown>;
|
|
138
|
+
getRTCToken(roomId: string, mode: number, broadcastType?: number): IPromiseResult<IRtcTokenData>;
|
|
139
|
+
setRTCState(roomId: string, reportId: string): Promise<ErrorCode>;
|
|
140
|
+
getRTCUserList(roomId: string): IPromiseResult<IRTCUsers>;
|
|
141
|
+
createTag(tag: ITagParam): IPromiseResult<IAsyncRes>;
|
|
142
|
+
removeTag(tagId: string): IPromiseResult<IAsyncRes>;
|
|
143
|
+
updateTag(tag: ITagParam): IPromiseResult<IAsyncRes>;
|
|
144
|
+
getTagList(): IPromiseResult<Array<ITagInfo>>;
|
|
145
|
+
addTagForConversations(tagId: string, conversations: IConversationOption[]): IPromiseResult<IAsyncRes>;
|
|
146
|
+
removeTagForConversations(tagId: string, conversations: IConversationOption[]): IPromiseResult<IAsyncRes>;
|
|
147
|
+
removeTagsForConversation(conversation: IConversationOption, tagIds: string[]): IPromiseResult<IAsyncRes>;
|
|
148
|
+
getConversationListByTag(tagId: string, startTime: number, count?: number, channelId?: string): IPromiseResult<IReceivedConversationByTag[]>;
|
|
149
|
+
getUnreadCountByTag(tagId: string, containMuted: boolean): IPromiseResult<number>;
|
|
150
|
+
setConversationStatusInTag(tagId: string, conversation: IConversationOption, status: ILocalTagStatus): IPromiseResult<IAsyncRes>;
|
|
151
|
+
getTagsForConversation(conversation: IConversationOption): IPromiseResult<IConversationTag[]>;
|
|
152
|
+
joinLivingRoomAsAudience(roomId: string, mode: RTCMode, broadcastType?: number): Promise<IAsyncRes<{
|
|
153
|
+
token: string;
|
|
154
|
+
kvEntries: IServerRTCRoomEntry[];
|
|
155
|
+
}>>;
|
|
156
|
+
quitLivingRoomAsAudience(roomId: string): Promise<ErrorCode>;
|
|
157
|
+
rtcIdentityChange(roomId: string, changeType: RTCIdentityChangeType, broadcastType?: number): Promise<IAsyncRes<IJoinRTCRoomData>>;
|
|
158
|
+
getRTCJoinedUserInfo(userId: string): Promise<IAsyncRes<IRTCJoinedInfo[]>>;
|
|
159
|
+
getBlockConversationList(): Promise<IAsyncRes<IBaseConversationInfo[]>>;
|
|
160
|
+
getTopConversationList(): Promise<IAsyncRes<IBaseConversationInfo[]>>;
|
|
161
|
+
getUnreadMentionedCount(conversation: IConversationOption): Promise<IAsyncRes<number>>;
|
|
162
|
+
getAllUnreadMentionedCount(): Promise<IAsyncRes<number>>;
|
|
163
|
+
getAllConversationState(): Promise<IAsyncRes<IConversationState[]>>;
|
|
164
|
+
requestRoomPK(options: IReqRoomPKOptions): Promise<ErrorCode>;
|
|
165
|
+
cancelRoomPK(options: ICancelRoomPKOptions): Promise<ErrorCode>;
|
|
166
|
+
responseRoomPK(options: IResRoomPKOptions): Promise<ErrorCode>;
|
|
167
|
+
endRoomPK(options: IEndRoomPKOptions): Promise<ErrorCode>;
|
|
168
|
+
getUltraGroupList(): Promise<IAsyncRes<IReceivedConversation[]>>;
|
|
169
|
+
getBlockUltraGroupList(): Promise<IAsyncRes<IBaseConversationInfo[]>>;
|
|
170
|
+
getTopUltraGroupList(): Promise<IAsyncRes<IBaseConversationInfo[]>>;
|
|
171
|
+
clearUltraUnreadcount(targetId: string, channelId: string): Promise<ErrorCode>;
|
|
172
|
+
getUltraGroupUnreadMentionedCountByTargetId(targetId: string): Promise<IAsyncRes<number>>;
|
|
173
|
+
sendUltraMessage(targetId: string, options: ISendMsgOptions): Promise<IAsyncRes>;
|
|
174
|
+
sendUltraGroupTypingStatus(options: IConversationOption, operationType?: OperateStatus): Promise<IAsyncRes>;
|
|
175
|
+
getUltraGroupMessageListByMessageUId(options: IUltraMsgQueryOptions): Promise<IAsyncRes<Object>>;
|
|
176
|
+
expandUltraMessage(options: IUltraExMsgOptions): Promise<IAsyncRes>;
|
|
177
|
+
modifyMessage(options: IUltraModifyMsgOptions): Promise<IAsyncRes>;
|
|
178
|
+
getUltraHistoryMsg(targetId: string, options: IGetMsgOption): Promise<IAsyncRes>;
|
|
179
|
+
bindRTCRoomForChatroom(options: IRTCRoomBindOption): Promise<ErrorCode>;
|
|
180
|
+
getConversationNotificationLevel(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<NotificationLevel | any>;
|
|
181
|
+
getUltraGroupDefaultNotificationLevel(targetId: string, channelId: string): IPromiseResult<NotificationLevel>;
|
|
182
|
+
getAllUltraGroupUnreadCount(): Promise<{
|
|
183
|
+
code: ErrorCode;
|
|
184
|
+
}>;
|
|
185
|
+
getUltraGroupUnreadCountByTargetId(): Promise<{
|
|
186
|
+
code: ErrorCode;
|
|
187
|
+
}>;
|
|
188
|
+
setUltraGroupDefaultNotificationLevel(): Promise<{
|
|
189
|
+
code: ErrorCode;
|
|
190
|
+
}>;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export { RCCppEngine };
|
package/index.esm.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Logger as t,ANavi as e,VersionManage as n,ErrorCode as o,AEngine as r}from"@rongcloud/engine";import{request as a}from"http";import{Agent as i,request as s}from"https";import{ipcRenderer as c}from"electron";var l=function(t,e){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},l(t,e)};function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}l(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function p(t,e,n,o){return new(n||(n=Promise))((function(r,a){function i(t){try{c(o.next(t))}catch(t){a(t)}}function s(t){try{c(o.throw(t))}catch(t){a(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(i,s)}c((o=o.apply(t,e||[])).next())}))}function f(t,e){var n,o,r,a,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,o&&(r=2&a[0]?o.return:a[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,a[1])).done)return r;switch(o=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,o=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(r=i.trys,(r=r.length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){i.label=a[1];break}if(6===a[0]&&i.label<r[1]){i.label=r[1],r=a;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(a);break}r[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],o=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}function h(t,e,n){if(n||2===arguments.length)for(var o,r=0,a=e.length;r<a;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=new t("RCRenderer"),_=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return u(e,t),e.prototype._reqNavi=function(t,e,n,o){return void 0===o&&(o=!0),p(this,void 0,void 0,(function(){var r,c,l,u,p;return f(this,(function(h){switch(h.label){case 0:y.info("request navi -> token: ".concat(n,", appkey: ").concat(e)),r=function(r,l){var u,p,h,_,g;return f(this,(function(l){switch(l.label){case 0:return u="".concat(t[r],"/navi.json?r=").concat(Date.now()),p="token=".concat(encodeURIComponent(n),"&v=").concat(c._apiVersion,"&p=PC&ev=").concat("5.3.0"),[4,new Promise((function(t){var n=/^https/.test(u),r={headers:{appId:e},method:"POST"};n&&(r.rejectUnauthorized=o,r.agent=new i(r));var c=(n?s:a)(u,r,(function(e){var n=e.statusCode,o="";e.setEncoding("utf8"),e.on("data",(function(t){o+=t})),e.on("end",(function(){t({status:n||0,data:o})}))}));c.on("error",(function(e){y.error(e),t({status:0})})),c.write(p),c.end()}))];case 1:if(200!==(h=l.sent()).status)return y.error("request navi failed -> ".concat(u)),h.data&&y.error(h.data),[2,"continue"];y.info("request navi success -> ".concat(u));try{return _=JSON.parse(h.data),g=/^https/.test(u)?"https":"http",_.protocol=g,[2,{value:_}]}catch(t){y.error("parse navi err => ".concat(h.data))}return[2]}}))},c=this,l=0,u=t.length,h.label=1;case 1:return l<u?[5,r(l,u)]:[3,4];case 2:if("object"==typeof(p=h.sent()))return[2,p.value];h.label=3;case 3:return l+=1,[3,1];case 4:return[2,null]}}))}))},e}(e),g=0,M=Date.now(),C=function(t){var e=Date.now();return M!==e?(M=e,g=1):g+=1,[t,process.pid,Date.now(),g].join("__")};n.add("electron-renderer","5.3.0");var d=function(t){function e(e,n,o){var r=t.call(this,e,n,o)||this;return r._resolveMaps={},y.setLogLevel(o.logLevel),y.setLogStdout(o.logStdout),c.on("__RC_CHANNEL_NOTIFICATION_FROM_MAIN__",(function(t,e){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];var a=n[e];if(a)if("batchMessage"===e){var i=a,s=o[0].hasMoreMsg;delete o[0].hasMoreMsg,i([o[0]],void 0,s)}else if("onRTCDataChange"===e){i=a;var c=o[0][0].roomId;i(o[0],c)}else a(o[0]);else console.error.apply(console,h(["unknown notification type: ".concat(e),e],o,!1))})),c.on("__RC_CHANNEL_RESULT_FROM_MAIN__",(function(t,e){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];y.info.apply(y,h(["__RC_CHANNEL_RESULT_FROM_MAIN__",e],n,!1));var a=r._resolveMaps[e];a&&(delete r._resolveMaps[e],a.apply(void 0,n))})),c.on("__RC_CHANNEL_CALL_RENDER__",(function(t,e){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];r[e].apply(r,n)})),c.send("__RC_INNER_COMMAND_INIT__",r._options),r}return u(e,t),e.prototype.setUserStatusListener=function(t,e){throw new Error("TODO -> setUserStatusListener")},e.prototype._callMain=function(t){for(var e=this,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];var r=new Promise((function(o){var r=C(t);e._resolveMaps[r]=o,y.info.apply(y,h(["__RC_CHANNEL_CALL_MAIN__",r,t],n,!1)),c.send.apply(c,h(["__RC_CHANNEL_CALL_MAIN__",r,t],n,!1))}));return r},e.prototype.callExtra=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return this._callMain.apply(this,h(["callExtra",t],e,!1))},e.prototype._send2Main=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];y.info.apply(y,h(["__RC_CHANNEL_SEND_2_MAIN__",t],e,!1)),c.send.apply(c,h(["__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 y.info.apply(y,h(["__RC_CHANNEL_CALL_MAIN_SYNC__",t],e,!1)),c.sendSync.apply(c,h(["__RC_CHANNEL_CALL_MAIN_SYNC__",t],e,!1))},e.prototype._createNavi=function(){return new _(this.runtime,this._options)},e.prototype._insertLog2IndexDB=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[0],o=t[1],r=t[2];y.__pushLocalLog(n,o,r)},e.prototype.connect=function(t,e,n){return this.currentUserId=e.userId,this._callMain("connect",t,e,n)},e.prototype.reportSDKInfo=function(t){this._callMain("reportSDKInfo",t)},e.prototype.getConnectedTime=function(){return this._callMainSync("getConnectedTime")},e.prototype.getHistoryMessage=function(t,e,n,o,r,a,i){return this._callMain("getHistoryMessage",t,e,n,o,r,a,i)},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.getConversationListWithAllChannel=function(){return this._callMain("getConversationListWithAllChannel")},e.prototype.getConversationListWithAllChannelByPage=function(t,e){return this._callMain("getConversationListWithAllChannelByPage",t,e)},e.prototype.getConversation=function(t,e,n){return this._callMain("getConversation",t,e,n)},e.prototype.removeConversation=function(t,e,n){return this._callMain("removeConversation",t,e,n)},e.prototype.getAllConversationUnreadCount=function(t,e,n){return this._callMain("getAllConversationUnreadCount",t,e,n)},e.prototype.getConversationUnreadCount=function(t,e,n){return this._callMain("getConversationUnreadCount",t,e,n)},e.prototype.clearConversationUnreadCount=function(t,e,n){return this._callMain("clearConversationUnreadCount",t,e,n)},e.prototype.getFirstUnreadMessage=function(t,e,n){return this._callMain("getFirstUnreadMessage",t,e,n)},e.prototype.saveConversationMessageDraft=function(t,e,n){return this._callMain("saveConversationMessageDraft",t,e,n)},e.prototype.getConversationMessageDraft=function(t,e){return this._callMain("getConversationMessageDraft",t,e)},e.prototype.clearConversationMessageDraft=function(t,e){return this._callMain("clearConversationMessageDraft",t,e)},e.prototype.pullConversationStatus=function(t){return this._callMain("pullConversationStatus",t)},e.prototype.batchSetConversationStatus=function(t){return this._callMain("batchSetConversationStatus",t)},e.prototype.sendMessage=function(t,e,n,o){var r=["sendMessageBefore",Date.now(),Math.floor(Math.random()*Date.now())].join("_");return o&&(this._resolveMaps[r]=function(t){try{o(t)}catch(t){y.error(t)}}),this._callMain("sendMessage",t,e,n,r)},e.prototype.sendReadReceiptMessage=function(t,e,n){return this._callMain("sendReadReceiptMessage",t,e,n)},e.prototype.getMessageReader=function(t,e,n){return this._callMain("getMessageReader",t,e,n)},e.prototype.disconnect=function(){this._send2Main("disconnect")},e.prototype.pullUserSettings=function(t){return this._callMain("pullUserSettings",t)},e.prototype.registerMessageType=function(t,e,n,o){this._send2Main("registerMessageType",t,e,n,o)},e.prototype.joinChatroom=function(t,e){return this._callMain("joinChatroom",t,e)},e.prototype.joinExistChatroom=function(t,e){return this._callMain("joinExistChatroom",t,e)},e.prototype.quitChatroom=function(t){return this._callMain("quitChatroom",t)},e.prototype.getChatroomInfo=function(t,e,n){return this._callMain("getChatroomInfo",t,e,n)},e.prototype.getChatroomHistoryMessages=function(t,e,n,o){return this._callMain("getChatroomHistoryMessages",t,e,n,o)},e.prototype.setChatroomEntry=function(t,e){return this._callMain("setChatroomEntry",t,e)},e.prototype.setChatroomEntries=function(t,e){return this._callMain("setChatroomEntries",t,e)},e.prototype.forceSetChatroomEntry=function(t,e){return this._callMain("forceSetChatroomEntry",t,e)},e.prototype.removeChatroomEntry=function(t,e){return this._callMain("removeChatroomEntry",t,e)},e.prototype.forceRemoveChatroomEntry=function(t,e){return this._callMain("forceRemoveChatroomEntry",t,e)},e.prototype.removeChatroomEntries=function(t,e){return this._callMain("removeChatroomEntries",t,e)},e.prototype.getChatroomEntry=function(t,e){return this._callMain("getChatroomEntry",t,e)},e.prototype.getAllChatroomEntry=function(t){return this._callMain("getAllChatroomEntry",t)},e.prototype.getFileToken=function(t,e,n,o){return this._callMain("getFileToken",t,e,n,o)},e.prototype.getFileUrl=function(t,e,n,o){return this._callMain("getFileUrl",t,e,n,o)},e.prototype.setUserStatus=function(t){return this._callMain("setUserStatus",t)},e.prototype.subscribeUserStatus=function(t){return this._callMain("subscribeUserStatus",t)},e.prototype.getUserStatus=function(t){return this._callMain("getUserStatus",t)},e.prototype.clearConversations=function(t,e){return this._callMain("clearConversations",t,e)},e.prototype.addToBlacklist=function(t){return this._callMain("addToBlacklist",t)},e.prototype.removeFromBlacklist=function(t){return this._callMain("removeFromBlacklist",t)},e.prototype.getBlacklist=function(){return this._callMain("getBlacklist")},e.prototype.getBlacklistStatus=function(t){return this._callMain("getBlacklistStatus",t)},e.prototype.insertMessage=function(t,e,n){return this._callMain("insertMessage",t,e,n)},e.prototype.deleteMessages=function(t){return this._callMain("deleteMessages",t)},e.prototype.deleteMessagesByTimestamp=function(t,e,n,o,r){return this._callMain("deleteMessagesByTimestamp",t,e,n,o,r)},e.prototype.clearMessages=function(t,e,n){return this._callMain("clearMessages",t,e,n)},e.prototype.getMessage=function(t){return this._callMain("getMessage",t)},e.prototype.setMessageContent=function(t,e,n){return this._callMain("setMessageContent",t,e,n)},e.prototype.setMessageSearchField=function(t,e,n){return this._callMain("setMessageSearchField",t,e,n)},e.prototype.searchConversationByContent=function(t,e,n,o){return this._callMain("searchConversationByContent",t,e,n,o)},e.prototype.searchMessageByContent=function(t,e,n,o,r,a,i){return this._callMain("searchMessageByContent",t,e,n,o,r,a,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.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,a){return this._callMain("getRemoteHistoryMessages",t,e,n,o,r,a)},e.prototype.getServerTime=function(){return this._callMainSync("getServerTime")},e.prototype.getDeviceId=function(){return this._callMainSync("getDeviceId")},e.prototype.getCurrentUserId=function(){return this._callMainSync("getCurrentUserId")},e.prototype.joinRTCRoom=function(t,e,n,o,r,a){return this._callMain("joinRTCRoom",t,e,n,o,r,a)},e.prototype.quitRTCRoom=function(t){return this._callMain("quitRTCRoom",t)},e.prototype.rtcPing=function(t,e,n){return this._callMain("rtcPing",t,e,n)},e.prototype.getRTCRoomInfo=function(t){return this._callMain("getRTCRoomInfo",t)},e.prototype.getRTCUserInfoList=function(t){return this._callMain("getRTCUserInfoList",t)},e.prototype.getRTCUserInfo=function(t){return this._callMain("getRTCUserInfo",t)},e.prototype.setRTCUserInfo=function(t,e,n){return this._callMain("setRTCUserInfo",t,e,n)},e.prototype.removeRTCUserInfo=function(t,e){return this._callMain("removeRTCUserInfo",t,e)},e.prototype.setRTCData=function(t,e,n,o,r,a){return this._callMain("setRTCData",t,e,n,o,r,a)},e.prototype.setRTCTotalRes=function(t,e,n,o,r){return this._callMain("setRTCTotalRes",t,e,n,o,r)},e.prototype.setRTCCDNUris=function(t,e,n){return this._callMain("setRTCCDNUris",t,e,n)},e.prototype.getRTCData=function(t,e,n,o){return this._callMain("getRTCData",t,e,n,o)},e.prototype.removeRTCData=function(t,e,n,o,r){return this._callMain("removeRTCData",t,e,n,o,r)},e.prototype.setRTCOutData=function(t,e,n,o){return this._callMain("setRTCOutData",t,e,n,o)},e.prototype.getRTCOutData=function(t,e){return this._callMain("getRTCOutData",t,e)},e.prototype.getRTCToken=function(t,e,n){return this._callMain("getRTCToken",t,e,n)},e.prototype.setRTCState=function(t,e){return this._callMain("setRTCState",t,e)},e.prototype.getRTCUserList=function(t){return this._callMain("getRTCUserList",t)},e.prototype.createTag=function(t){return this._callMain("createTag",t)},e.prototype.removeTag=function(t){return this._callMain("removeTag",t)},e.prototype.updateTag=function(t){return this._callMain("updateTag",t)},e.prototype.getTagList=function(){return this._callMain("getTagList")},e.prototype.addTagForConversations=function(t,e){return this._callMain("addTagForConversations",t,e)},e.prototype.removeTagForConversations=function(t,e){return this._callMain("removeTagForConversations",t,e)},e.prototype.removeTagsForConversation=function(t,e){return this._callMain("removeTagsForConversation",t,e)},e.prototype.getConversationListByTag=function(t,e,n,o){return this._callMain("getConversationListByTag",t,e,n,o)},e.prototype.getUnreadCountByTag=function(t,e){return this._callMain("getUnreadCountByTag",t,e)},e.prototype.setConversationStatusInTag=function(t,e,n){return this._callMain("setConversationStatusInTag",t,e,n)},e.prototype.getTagsForConversation=function(t){return this._callMain("getTagsForConversation",t)},e.prototype.joinLivingRoomAsAudience=function(t,e,n){return this._callMain("joinLivingRoomAsAudience",t,e,n)},e.prototype.quitLivingRoomAsAudience=function(t){return this._callMain("quitLivingRoomAsAudience",t)},e.prototype.rtcIdentityChange=function(t,e,n){return this._callMain("switchLivingRoomRole",t,e,n)},e.prototype.getRTCJoinedUserInfo=function(t){return this._callMain("getRTCJoinedUserInfo",t)},e.prototype.getBlockConversationList=function(){throw new Error("Method not implemented.")},e.prototype.getTopConversationList=function(){throw new Error("Method not implemented.")},e.prototype.getUnreadMentionedCount=function(t){throw new Error("Method not implemented.")},e.prototype.getAllUnreadMentionedCount=function(){throw new Error("Method not implemented.")},e.prototype.getAllConversationState=function(){throw new Error("Method not implemented.")},e.prototype.requestRoomPK=function(t){return this._callMain("requestRoomPK",t)},e.prototype.cancelRoomPK=function(t){return this._callMain("cancelRoomPK",t)},e.prototype.responseRoomPK=function(t){return this._callMain("responseRoomPK",t)},e.prototype.endRoomPK=function(t){return this._callMain("endRoomPK",t)},e.prototype.getUltraGroupList=function(){throw new Error("Method not implemented.")},e.prototype.getBlockUltraGroupList=function(){throw new Error("Method not implemented.")},e.prototype.getTopUltraGroupList=function(){throw new Error("Method not implemented.")},e.prototype.clearUltraUnreadcount=function(t,e){throw new Error("Method not implemented.")},e.prototype.getUltraGroupUnreadMentionedCountByTargetId=function(t){throw new Error("Method not implemented.")},e.prototype.sendUltraMessage=function(t,e){throw new Error("Method not implemented.")},e.prototype.sendUltraGroupTypingStatus=function(t,e){throw new Error("Method not implemented.")},e.prototype.getUltraGroupMessageListByMessageUId=function(t){throw new Error("Method not implemented.")},e.prototype.expandUltraMessage=function(t){throw new Error("Method not implemented.")},e.prototype.modifyMessage=function(t){throw new Error("Method not implemented.")},e.prototype.getUltraHistoryMsg=function(t,e){throw new Error("Method not implemented.")},e.prototype.bindRTCRoomForChatroom=function(t){return this._callMain("bindRTCRoomForChatroom",t)},e.prototype.getConversationNotificationLevel=function(t,e,n){return p(this,void 0,void 0,(function(){return f(this,(function(t){return[2,Promise.resolve({code:o.NOT_SUPPORT})]}))}))},e.prototype.getUltraGroupDefaultNotificationLevel=function(t,e){return Promise.resolve({code:o.NOT_SUPPORT})},e.prototype.getAllUltraGroupUnreadCount=function(){return Promise.resolve({code:o.NOT_SUPPORT})},e.prototype.getUltraGroupUnreadCountByTargetId=function(){return Promise.resolve({code:o.NOT_SUPPORT})},e.prototype.setUltraGroupDefaultNotificationLevel=function(){return Promise.resolve({code:o.NOT_SUPPORT})},e}(r);window&&(window.RCCppEngine=d);export{d as RCCppEngine};
|
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@rongcloud/engine"),e=require("http"),n=require("https"),o=require("electron"),r=function(t,e){return r=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])},r(t,e)};function i(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}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function a(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 s(t,e){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function c(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 l=new t.Logger("RCRenderer"),u=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return i(o,t),o.prototype._reqNavi=function(t,o,r,i){return void 0===i&&(i=!0),a(this,void 0,void 0,(function(){var a,c,u,p,f;return s(this,(function(h){switch(h.label){case 0:l.info("request navi -> token: ".concat(r,", appkey: ").concat(o)),a=function(a,u){var p,f,h,y,g;return s(this,(function(s){switch(s.label){case 0:return p="".concat(t[a],"/navi.json?r=").concat(Date.now()),f="token=".concat(encodeURIComponent(r),"&v=").concat(c._apiVersion,"&p=PC&ev=").concat("5.3.0"),[4,new Promise((function(t){var r=/^https/.test(p),a={headers:{appId:o},method:"POST"};r&&(a.rejectUnauthorized=i,a.agent=new n.Agent(a));var s=(r?n.request:e.request)(p,a,(function(e){var n=e.statusCode,o="";e.setEncoding("utf8"),e.on("data",(function(t){o+=t})),e.on("end",(function(){t({status:n||0,data:o})}))}));s.on("error",(function(e){l.error(e),t({status:0})})),s.write(f),s.end()}))];case 1:if(200!==(h=s.sent()).status)return l.error("request navi failed -> ".concat(p)),h.data&&l.error(h.data),[2,"continue"];l.info("request navi success -> ".concat(p));try{return y=JSON.parse(h.data),g=/^https/.test(p)?"https":"http",y.protocol=g,[2,{value:y}]}catch(t){l.error("parse navi err => ".concat(h.data))}return[2]}}))},c=this,u=0,p=t.length,h.label=1;case 1:return u<p?[5,a(u,p)]:[3,4];case 2:if("object"==typeof(f=h.sent()))return[2,f.value];h.label=3;case 3:return u+=1,[3,1];case 4:return[2,null]}}))}))},o}(t.ANavi),p=0,f=Date.now(),h=function(t){var e=Date.now();return f!==e?(f=e,p=1):p+=1,[t,process.pid,Date.now(),p].join("__")};t.VersionManage.add("electron-renderer","5.3.0");var y=function(e){function n(t,n,r){var i=e.call(this,t,n,r)||this;return i._resolveMaps={},l.setLogLevel(r.logLevel),l.setLogStdout(r.logStdout),o.ipcRenderer.on("__RC_CHANNEL_NOTIFICATION_FROM_MAIN__",(function(t,e){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];var i=n[e];if(i)if("batchMessage"===e){var a=i,s=o[0].hasMoreMsg;delete o[0].hasMoreMsg,a([o[0]],void 0,s)}else if("onRTCDataChange"===e){a=i;var l=o[0][0].roomId;a(o[0],l)}else i(o[0]);else console.error.apply(console,c(["unknown notification type: ".concat(e),e],o,!1))})),o.ipcRenderer.on("__RC_CHANNEL_RESULT_FROM_MAIN__",(function(t,e){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];l.info.apply(l,c(["__RC_CHANNEL_RESULT_FROM_MAIN__",e],n,!1));var r=i._resolveMaps[e];r&&(delete i._resolveMaps[e],r.apply(void 0,n))})),o.ipcRenderer.on("__RC_CHANNEL_CALL_RENDER__",(function(t,e){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];i[e].apply(i,n)})),o.ipcRenderer.send("__RC_INNER_COMMAND_INIT__",i._options),i}return i(n,e),n.prototype.setUserStatusListener=function(t,e){throw new Error("TODO -> setUserStatusListener")},n.prototype._callMain=function(t){for(var e=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=new Promise((function(r){var i=h(t);e._resolveMaps[i]=r,l.info.apply(l,c(["__RC_CHANNEL_CALL_MAIN__",i,t],n,!1)),o.ipcRenderer.send.apply(o.ipcRenderer,c(["__RC_CHANNEL_CALL_MAIN__",i,t],n,!1))}));return i},n.prototype.callExtra=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return this._callMain.apply(this,c(["callExtra",t],e,!1))},n.prototype._send2Main=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.info.apply(l,c(["__RC_CHANNEL_SEND_2_MAIN__",t],e,!1)),o.ipcRenderer.send.apply(o.ipcRenderer,c(["__RC_CHANNEL_SEND_2_MAIN__",t],e,!1))},n.prototype._callMainSync=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return l.info.apply(l,c(["__RC_CHANNEL_CALL_MAIN_SYNC__",t],e,!1)),o.ipcRenderer.sendSync.apply(o.ipcRenderer,c(["__RC_CHANNEL_CALL_MAIN_SYNC__",t],e,!1))},n.prototype._createNavi=function(){return new u(this.runtime,this._options)},n.prototype._insertLog2IndexDB=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[0],o=t[1],r=t[2];l.__pushLocalLog(n,o,r)},n.prototype.connect=function(t,e,n){return this.currentUserId=e.userId,this._callMain("connect",t,e,n)},n.prototype.reportSDKInfo=function(t){this._callMain("reportSDKInfo",t)},n.prototype.getConnectedTime=function(){return this._callMainSync("getConnectedTime")},n.prototype.getHistoryMessage=function(t,e,n,o,r,i,a){return this._callMain("getHistoryMessage",t,e,n,o,r,i,a)},n.prototype.deleteRemoteMessage=function(t,e,n,o){return this._callMain("deleteRemoteMessage",t,e,n,o)},n.prototype.recallMsg=function(t,e,n,o,r){return this._callMain("recallMsg",t,e,n,o,r)},n.prototype.deleteRemoteMessageByTimestamp=function(t,e,n,o){return this._callMain("deleteRemoteMessageByTimestamp",t,e,n,o)},n.prototype.getConversationList=function(t,e,n,o,r){return this._callMain("getConversationList",t,e,n,o,r)},n.prototype.getConversationListWithAllChannel=function(){return this._callMain("getConversationListWithAllChannel")},n.prototype.getConversationListWithAllChannelByPage=function(t,e){return this._callMain("getConversationListWithAllChannelByPage",t,e)},n.prototype.getConversation=function(t,e,n){return this._callMain("getConversation",t,e,n)},n.prototype.removeConversation=function(t,e,n){return this._callMain("removeConversation",t,e,n)},n.prototype.getAllConversationUnreadCount=function(t,e,n){return this._callMain("getAllConversationUnreadCount",t,e,n)},n.prototype.getConversationUnreadCount=function(t,e,n){return this._callMain("getConversationUnreadCount",t,e,n)},n.prototype.clearConversationUnreadCount=function(t,e,n){return this._callMain("clearConversationUnreadCount",t,e,n)},n.prototype.getFirstUnreadMessage=function(t,e,n){return this._callMain("getFirstUnreadMessage",t,e,n)},n.prototype.saveConversationMessageDraft=function(t,e,n){return this._callMain("saveConversationMessageDraft",t,e,n)},n.prototype.getConversationMessageDraft=function(t,e){return this._callMain("getConversationMessageDraft",t,e)},n.prototype.clearConversationMessageDraft=function(t,e){return this._callMain("clearConversationMessageDraft",t,e)},n.prototype.pullConversationStatus=function(t){return this._callMain("pullConversationStatus",t)},n.prototype.batchSetConversationStatus=function(t){return this._callMain("batchSetConversationStatus",t)},n.prototype.sendMessage=function(t,e,n,o){var r=["sendMessageBefore",Date.now(),Math.floor(Math.random()*Date.now())].join("_");return o&&(this._resolveMaps[r]=function(t){try{o(t)}catch(t){l.error(t)}}),this._callMain("sendMessage",t,e,n,r)},n.prototype.sendReadReceiptMessage=function(t,e,n){return this._callMain("sendReadReceiptMessage",t,e,n)},n.prototype.getMessageReader=function(t,e,n){return this._callMain("getMessageReader",t,e,n)},n.prototype.disconnect=function(){this._send2Main("disconnect")},n.prototype.pullUserSettings=function(t){return this._callMain("pullUserSettings",t)},n.prototype.registerMessageType=function(t,e,n,o){this._send2Main("registerMessageType",t,e,n,o)},n.prototype.joinChatroom=function(t,e){return this._callMain("joinChatroom",t,e)},n.prototype.joinExistChatroom=function(t,e){return this._callMain("joinExistChatroom",t,e)},n.prototype.quitChatroom=function(t){return this._callMain("quitChatroom",t)},n.prototype.getChatroomInfo=function(t,e,n){return this._callMain("getChatroomInfo",t,e,n)},n.prototype.getChatroomHistoryMessages=function(t,e,n,o){return this._callMain("getChatroomHistoryMessages",t,e,n,o)},n.prototype.setChatroomEntry=function(t,e){return this._callMain("setChatroomEntry",t,e)},n.prototype.setChatroomEntries=function(t,e){return this._callMain("setChatroomEntries",t,e)},n.prototype.forceSetChatroomEntry=function(t,e){return this._callMain("forceSetChatroomEntry",t,e)},n.prototype.removeChatroomEntry=function(t,e){return this._callMain("removeChatroomEntry",t,e)},n.prototype.forceRemoveChatroomEntry=function(t,e){return this._callMain("forceRemoveChatroomEntry",t,e)},n.prototype.removeChatroomEntries=function(t,e){return this._callMain("removeChatroomEntries",t,e)},n.prototype.getChatroomEntry=function(t,e){return this._callMain("getChatroomEntry",t,e)},n.prototype.getAllChatroomEntry=function(t){return this._callMain("getAllChatroomEntry",t)},n.prototype.getFileToken=function(t,e,n,o){return this._callMain("getFileToken",t,e,n,o)},n.prototype.getFileUrl=function(t,e,n,o){return this._callMain("getFileUrl",t,e,n,o)},n.prototype.setUserStatus=function(t){return this._callMain("setUserStatus",t)},n.prototype.subscribeUserStatus=function(t){return this._callMain("subscribeUserStatus",t)},n.prototype.getUserStatus=function(t){return this._callMain("getUserStatus",t)},n.prototype.clearConversations=function(t,e){return this._callMain("clearConversations",t,e)},n.prototype.addToBlacklist=function(t){return this._callMain("addToBlacklist",t)},n.prototype.removeFromBlacklist=function(t){return this._callMain("removeFromBlacklist",t)},n.prototype.getBlacklist=function(){return this._callMain("getBlacklist")},n.prototype.getBlacklistStatus=function(t){return this._callMain("getBlacklistStatus",t)},n.prototype.insertMessage=function(t,e,n){return this._callMain("insertMessage",t,e,n)},n.prototype.deleteMessages=function(t){return this._callMain("deleteMessages",t)},n.prototype.deleteMessagesByTimestamp=function(t,e,n,o,r){return this._callMain("deleteMessagesByTimestamp",t,e,n,o,r)},n.prototype.clearMessages=function(t,e,n){return this._callMain("clearMessages",t,e,n)},n.prototype.getMessage=function(t){return this._callMain("getMessage",t)},n.prototype.setMessageContent=function(t,e,n){return this._callMain("setMessageContent",t,e,n)},n.prototype.setMessageSearchField=function(t,e,n){return this._callMain("setMessageSearchField",t,e,n)},n.prototype.searchConversationByContent=function(t,e,n,o){return this._callMain("searchConversationByContent",t,e,n,o)},n.prototype.searchMessageByContent=function(t,e,n,o,r,i,a){return this._callMain("searchMessageByContent",t,e,n,o,r,i,a)},n.prototype.getUnreadMentionedMessages=function(t,e,n){return this._callMainSync("getUnreadMentionedMessages",t,e,n)},n.prototype.setMessageSentStatus=function(t,e){return this._callMain("setMessageSentStatus",t,e)},n.prototype.setMessageReceivedStatus=function(t,e){return this._callMain("setMessageReceivedStatus",t,e)},n.prototype.clearUnreadCountByTimestamp=function(t,e,n,o){return this._callMain("clearUnreadCountByTimestamp",t,e,n,o)},n.prototype.clearAllUnreadCount=function(){throw new Error("Method not implemented.")},n.prototype.getConversationNotificationStatus=function(t,e,n){return this._callMain("getConversationNotificationStatus",t,e,n)},n.prototype.getRemoteHistoryMessages=function(t,e,n,o,r,i){return this._callMain("getRemoteHistoryMessages",t,e,n,o,r,i)},n.prototype.getServerTime=function(){return this._callMainSync("getServerTime")},n.prototype.getDeviceId=function(){return this._callMainSync("getDeviceId")},n.prototype.getCurrentUserId=function(){return this._callMainSync("getCurrentUserId")},n.prototype.joinRTCRoom=function(t,e,n,o,r,i){return this._callMain("joinRTCRoom",t,e,n,o,r,i)},n.prototype.quitRTCRoom=function(t){return this._callMain("quitRTCRoom",t)},n.prototype.rtcPing=function(t,e,n){return this._callMain("rtcPing",t,e,n)},n.prototype.getRTCRoomInfo=function(t){return this._callMain("getRTCRoomInfo",t)},n.prototype.getRTCUserInfoList=function(t){return this._callMain("getRTCUserInfoList",t)},n.prototype.getRTCUserInfo=function(t){return this._callMain("getRTCUserInfo",t)},n.prototype.setRTCUserInfo=function(t,e,n){return this._callMain("setRTCUserInfo",t,e,n)},n.prototype.removeRTCUserInfo=function(t,e){return this._callMain("removeRTCUserInfo",t,e)},n.prototype.setRTCData=function(t,e,n,o,r,i){return this._callMain("setRTCData",t,e,n,o,r,i)},n.prototype.setRTCTotalRes=function(t,e,n,o,r){return this._callMain("setRTCTotalRes",t,e,n,o,r)},n.prototype.setRTCCDNUris=function(t,e,n){return this._callMain("setRTCCDNUris",t,e,n)},n.prototype.getRTCData=function(t,e,n,o){return this._callMain("getRTCData",t,e,n,o)},n.prototype.removeRTCData=function(t,e,n,o,r){return this._callMain("removeRTCData",t,e,n,o,r)},n.prototype.setRTCOutData=function(t,e,n,o){return this._callMain("setRTCOutData",t,e,n,o)},n.prototype.getRTCOutData=function(t,e){return this._callMain("getRTCOutData",t,e)},n.prototype.getRTCToken=function(t,e,n){return this._callMain("getRTCToken",t,e,n)},n.prototype.setRTCState=function(t,e){return this._callMain("setRTCState",t,e)},n.prototype.getRTCUserList=function(t){return this._callMain("getRTCUserList",t)},n.prototype.createTag=function(t){return this._callMain("createTag",t)},n.prototype.removeTag=function(t){return this._callMain("removeTag",t)},n.prototype.updateTag=function(t){return this._callMain("updateTag",t)},n.prototype.getTagList=function(){return this._callMain("getTagList")},n.prototype.addTagForConversations=function(t,e){return this._callMain("addTagForConversations",t,e)},n.prototype.removeTagForConversations=function(t,e){return this._callMain("removeTagForConversations",t,e)},n.prototype.removeTagsForConversation=function(t,e){return this._callMain("removeTagsForConversation",t,e)},n.prototype.getConversationListByTag=function(t,e,n,o){return this._callMain("getConversationListByTag",t,e,n,o)},n.prototype.getUnreadCountByTag=function(t,e){return this._callMain("getUnreadCountByTag",t,e)},n.prototype.setConversationStatusInTag=function(t,e,n){return this._callMain("setConversationStatusInTag",t,e,n)},n.prototype.getTagsForConversation=function(t){return this._callMain("getTagsForConversation",t)},n.prototype.joinLivingRoomAsAudience=function(t,e,n){return this._callMain("joinLivingRoomAsAudience",t,e,n)},n.prototype.quitLivingRoomAsAudience=function(t){return this._callMain("quitLivingRoomAsAudience",t)},n.prototype.rtcIdentityChange=function(t,e,n){return this._callMain("switchLivingRoomRole",t,e,n)},n.prototype.getRTCJoinedUserInfo=function(t){return this._callMain("getRTCJoinedUserInfo",t)},n.prototype.getBlockConversationList=function(){throw new Error("Method not implemented.")},n.prototype.getTopConversationList=function(){throw new Error("Method not implemented.")},n.prototype.getUnreadMentionedCount=function(t){throw new Error("Method not implemented.")},n.prototype.getAllUnreadMentionedCount=function(){throw new Error("Method not implemented.")},n.prototype.getAllConversationState=function(){throw new Error("Method not implemented.")},n.prototype.requestRoomPK=function(t){return this._callMain("requestRoomPK",t)},n.prototype.cancelRoomPK=function(t){return this._callMain("cancelRoomPK",t)},n.prototype.responseRoomPK=function(t){return this._callMain("responseRoomPK",t)},n.prototype.endRoomPK=function(t){return this._callMain("endRoomPK",t)},n.prototype.getUltraGroupList=function(){throw new Error("Method not implemented.")},n.prototype.getBlockUltraGroupList=function(){throw new Error("Method not implemented.")},n.prototype.getTopUltraGroupList=function(){throw new Error("Method not implemented.")},n.prototype.clearUltraUnreadcount=function(t,e){throw new Error("Method not implemented.")},n.prototype.getUltraGroupUnreadMentionedCountByTargetId=function(t){throw new Error("Method not implemented.")},n.prototype.sendUltraMessage=function(t,e){throw new Error("Method not implemented.")},n.prototype.sendUltraGroupTypingStatus=function(t,e){throw new Error("Method not implemented.")},n.prototype.getUltraGroupMessageListByMessageUId=function(t){throw new Error("Method not implemented.")},n.prototype.expandUltraMessage=function(t){throw new Error("Method not implemented.")},n.prototype.modifyMessage=function(t){throw new Error("Method not implemented.")},n.prototype.getUltraHistoryMsg=function(t,e){throw new Error("Method not implemented.")},n.prototype.bindRTCRoomForChatroom=function(t){return this._callMain("bindRTCRoomForChatroom",t)},n.prototype.getConversationNotificationLevel=function(e,n,o){return a(this,void 0,void 0,(function(){return s(this,(function(e){return[2,Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})]}))}))},n.prototype.getUltraGroupDefaultNotificationLevel=function(e,n){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},n.prototype.getAllUltraGroupUnreadCount=function(){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},n.prototype.getUltraGroupUnreadCountByTargetId=function(){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},n.prototype.setUltraGroupDefaultNotificationLevel=function(){return Promise.resolve({code:t.ErrorCode.NOT_SUPPORT})},n}(t.AEngine);window&&(window.RCCppEngine=y),exports.RCCppEngine=y;
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@rongcloud/electron-renderer",
|
|
3
|
+
"main": "index.js",
|
|
4
|
+
"files": [
|
|
5
|
+
"README.md",
|
|
6
|
+
"LICENSE",
|
|
7
|
+
"index.js",
|
|
8
|
+
"index.d.ts",
|
|
9
|
+
"index.esm.js"
|
|
10
|
+
],
|
|
11
|
+
"types": "index.d.ts",
|
|
12
|
+
"module": "index.esm.js",
|
|
13
|
+
"version": "5.3.0",
|
|
14
|
+
"author": "pass-web@rongcloud.cn",
|
|
15
|
+
"license": "LGPL 2.1",
|
|
16
|
+
"homepage": "https://www.rongcloud.cn",
|
|
17
|
+
"contributors": [
|
|
18
|
+
"pass-web@rongcloud.cn"
|
|
19
|
+
],
|
|
20
|
+
"__attrs__": {
|
|
21
|
+
"globals": "RCCppEngine"
|
|
22
|
+
},
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"@rongcloud/engine": "=5.3.0"
|
|
25
|
+
}
|
|
26
|
+
}
|