simplex-chat 0.2.1 → 6.5.0-beta.10
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/README.md +108 -21
- package/binding.gyp +50 -0
- package/cpp/simplex.cc +426 -0
- package/cpp/simplex.h +46 -0
- package/dist/api.d.ts +423 -0
- package/dist/api.js +857 -0
- package/dist/api.js.map +1 -0
- package/dist/bot.d.ts +29 -0
- package/dist/bot.js +189 -0
- package/dist/bot.js.map +1 -0
- package/dist/core.d.ts +128 -0
- package/dist/core.js +121 -0
- package/dist/core.js.map +1 -0
- package/dist/index.d.ts +19 -2
- package/dist/index.js +20 -4
- package/dist/index.js.map +1 -1
- package/dist/simplex.d.ts +10 -0
- package/dist/simplex.js +1 -0
- package/dist/util.d.ts +15 -0
- package/dist/util.js +91 -0
- package/dist/util.js.map +1 -0
- package/docs/Namespace.api.md +33 -0
- package/docs/Namespace.bot.md +23 -0
- package/docs/Namespace.core.md +48 -0
- package/docs/Namespace.util.md +25 -0
- package/docs/README.md +12 -0
- package/docs/api.Class.ChatApi.md +1752 -0
- package/docs/api.Class.ChatCommandError.md +205 -0
- package/docs/api.Enumeration.ConnReqType.md +27 -0
- package/docs/api.Interface.BotAddressSettings.md +60 -0
- package/docs/api.TypeAlias.DbConfig.md +64 -0
- package/docs/api.TypeAlias.EventSubscriberFunc.md +27 -0
- package/docs/api.TypeAlias.EventSubscribers.md +11 -0
- package/docs/api.Variable.defaultBotAddressSettings.md +11 -0
- package/docs/bot.Function.run.md +21 -0
- package/docs/bot.Interface.BotConfig.md +75 -0
- package/docs/bot.Interface.BotOptions.md +81 -0
- package/docs/bot.TypeAlias.BotDbOpts.md +17 -0
- package/docs/core.Class.ChatAPIError.md +205 -0
- package/docs/core.Class.ChatInitError.md +205 -0
- package/docs/core.DBMigrationError.Interface.ErrorMigration.md +41 -0
- package/docs/core.DBMigrationError.Interface.ErrorNotADatabase.md +33 -0
- package/docs/core.DBMigrationError.Interface.ErrorSQL.md +41 -0
- package/docs/core.DBMigrationError.Interface.InvalidConfirmation.md +25 -0
- package/docs/core.DBMigrationError.TypeAlias.Tag.md +11 -0
- package/docs/core.Enumeration.MigrationConfirmation.md +43 -0
- package/docs/core.Function.chatCloseStore.md +23 -0
- package/docs/core.Function.chatDecryptFile.md +31 -0
- package/docs/core.Function.chatEncryptFile.md +31 -0
- package/docs/core.Function.chatMigrateInit.md +31 -0
- package/docs/core.Function.chatReadFile.md +27 -0
- package/docs/core.Function.chatRecvMsgWait.md +27 -0
- package/docs/core.Function.chatSendCmd.md +27 -0
- package/docs/core.Function.chatWriteFile.md +31 -0
- package/docs/core.Interface.APIResult.md +31 -0
- package/docs/core.Interface.CryptoArgs.md +27 -0
- package/docs/core.Interface.UpMigration.md +25 -0
- package/docs/core.MTRError.Interface.MTREDifferent.md +33 -0
- package/docs/core.MTRError.Interface.MTRENoDown.md +33 -0
- package/docs/core.MTRError.TypeAlias.Tag.md +11 -0
- package/docs/core.MigrationError.Interface.MEDowngrade.md +33 -0
- package/docs/core.MigrationError.Interface.MEUpgrade.md +33 -0
- package/docs/core.MigrationError.Interface.MigrationError.md +33 -0
- package/docs/core.MigrationError.TypeAlias.Tag.md +11 -0
- package/docs/core.Namespace.DBMigrationError.md +18 -0
- package/docs/core.Namespace.MTRError.md +16 -0
- package/docs/core.Namespace.MigrationError.md +17 -0
- package/docs/core.TypeAlias.DBMigrationError.md +11 -0
- package/docs/core.TypeAlias.MTRError.md +11 -0
- package/docs/core.TypeAlias.MigrationError.md +11 -0
- package/docs/util.Function.botAddressSettings.md +21 -0
- package/docs/util.Function.chatInfoName.md +21 -0
- package/docs/util.Function.chatInfoRef.md +21 -0
- package/docs/util.Function.ciBotCommand.md +21 -0
- package/docs/util.Function.ciContentText.md +21 -0
- package/docs/util.Function.contactAddressStr.md +21 -0
- package/docs/util.Function.fromLocalProfile.md +21 -0
- package/docs/util.Function.reactionText.md +21 -0
- package/docs/util.Function.senderName.md +25 -0
- package/docs/util.Interface.BotCommand.md +25 -0
- package/examples/squaring-bot-pg.js +21 -0
- package/examples/squaring-bot-readme.js +17 -0
- package/examples/squaring-bot.ts +42 -0
- package/package.json +34 -37
- package/src/api.ts +939 -0
- package/src/bot.ts +214 -0
- package/src/core.ts +210 -0
- package/src/download-libs.js +239 -0
- package/src/index.ts +22 -0
- package/src/simplex.d.ts +10 -0
- package/src/simplex.js +1 -0
- package/src/util.ts +92 -0
- package/tsconfig.json +23 -0
- package/dist/client.d.ts +0 -76
- package/dist/client.js +0 -329
- package/dist/client.js.map +0 -1
- package/dist/command.d.ts +0 -412
- package/dist/command.js +0 -186
- package/dist/command.js.map +0 -1
- package/dist/index-web.d.ts +0 -1
- package/dist/index-web.js +0 -6
- package/dist/index-web.js.map +0 -1
- package/dist/index.bundle.js +0 -11
- package/dist/queue.d.ts +0 -24
- package/dist/queue.js +0 -77
- package/dist/queue.js.map +0 -1
- package/dist/response.d.ts +0 -755
- package/dist/response.js +0 -21
- package/dist/response.js.map +0 -1
- package/dist/test.html +0 -7
- package/dist/transport.d.ts +0 -51
- package/dist/transport.js +0 -131
- package/dist/transport.js.map +0 -1
- package/dist/websocket.d.ts +0 -8
- package/dist/websocket.js +0 -4
- package/dist/websocket.js.map +0 -1
package/dist/response.d.ts
DELETED
|
@@ -1,755 +0,0 @@
|
|
|
1
|
-
import { ChatItemId, MsgContent, DeleteMode, Profile, GroupMemberRole, LocalProfile, ServerProtocol, ServerCfg } from "./command";
|
|
2
|
-
export type ChatResponse = CRActiveUser | CRUsersList | CRChatStarted | CRChatRunning | CRChatStopped | CRApiChats | CRApiChat | CRApiParsedMarkdown | CRUserProtoServers | CRContactInfo | CRGroupMemberInfo | CRNewChatItems | CRChatItemStatusUpdated | CRChatItemUpdated | CRChatItemDeleted | CRMsgIntegrityError | CRCmdOk | CRUserContactLink | CRUserContactLinkUpdated | CRContactRequestRejected | CRUserProfile | CRUserProfileNoChange | CRUserProfileUpdated | CRContactAliasUpdated | CRInvitation | CRSentConfirmation | CRSentInvitation | CRContactUpdated | CRContactsMerged | CRContactDeleted | CRChatCleared | CRUserContactLinkCreated | CRUserContactLinkDeleted | CRReceivedContactRequest | CRAcceptingContactRequest | CRContactAlreadyExists | CRContactRequestAlreadyAccepted | CRContactConnecting | CRContactConnected | CRContactAnotherClient | CRContactSubError | CRContactSubSummary | CRContactsDisconnected | CRContactsSubscribed | CRHostConnected | CRHostDisconnected | CRGroupEmpty | CRMemberSubError | CRMemberSubSummary | CRGroupSubscribed | CRRcvFileAccepted | CRRcvFileAcceptedSndCancelled | CRRcvFileStart | CRRcvFileComplete | CRRcvFileCancelled | CRRcvFileSndCancelled | CRSndFileStart | CRSndFileComplete | CRSndFileCancelled | CRSndFileRcvCancelled | CRSndGroupFileCancelled | CRSndFileSubError | CRRcvFileSubError | CRPendingSubSummary | CRGroupCreated | CRGroupMembers | CRUserAcceptedGroupSent | CRUserDeletedMember | CRSentGroupInvitation | CRLeftMemberUser | CRGroupDeletedUser | CRGroupInvitation | CRReceivedGroupInvitation | CRUserJoinedGroup | CRJoinedGroupMember | CRJoinedGroupMemberConnecting | CRConnectedToGroupMember | CRDeletedMember | CRDeletedMemberUser | CRLeftMember | CRGroupRemoved | CRGroupDeleted | CRGroupUpdated | CRUserContactLinkSubscribed | CRUserContactLinkSubError | CRContactConnectionDeleted | CRMessageError | CRChatCmdError | CRChatError;
|
|
3
|
-
type ChatResponseTag = "activeUser" | "usersList" | "chatStarted" | "chatRunning" | "chatStopped" | "apiChats" | "apiChat" | "apiParsedMarkdown" | "userProtoServers" | "contactInfo" | "groupMemberInfo" | "newChatItems" | "chatItemStatusUpdated" | "chatItemUpdated" | "chatItemDeleted" | "msgIntegrityError" | "cmdOk" | "userContactLink" | "userContactLinkUpdated" | "userContactLinkCreated" | "userContactLinkDeleted" | "contactRequestRejected" | "userProfile" | "userProfileNoChange" | "userProfileUpdated" | "contactAliasUpdated" | "invitation" | "sentConfirmation" | "sentInvitation" | "contactUpdated" | "contactsMerged" | "contactDeleted" | "chatCleared" | "receivedContactRequest" | "acceptingContactRequest" | "contactAlreadyExists" | "contactRequestAlreadyAccepted" | "contactConnecting" | "contactConnected" | "contactAnotherClient" | "contactSubError" | "contactSubSummary" | "contactsDisconnected" | "contactsSubscribed" | "hostConnected" | "hostDisconnected" | "groupEmpty" | "memberSubError" | "memberSubSummary" | "groupSubscribed" | "rcvFileAccepted" | "rcvFileAcceptedSndCancelled" | "rcvFileStart" | "rcvFileComplete" | "rcvFileCancelled" | "rcvFileSndCancelled" | "sndFileStart" | "sndFileComplete" | "sndFileCancelled" | "sndFileRcvCancelled" | "sndGroupFileCancelled" | "fileTransferStatus" | "sndFileSubError" | "rcvFileSubError" | "pendingSubSummary" | "groupCreated" | "groupMembers" | "userAcceptedGroupSent" | "userDeletedMember" | "sentGroupInvitation" | "leftMemberUser" | "groupDeletedUser" | "groupInvitation" | "receivedGroupInvitation" | "userJoinedGroup" | "joinedGroupMember" | "joinedGroupMemberConnecting" | "connectedToGroupMember" | "deletedMember" | "deletedMemberUser" | "leftMember" | "groupRemoved" | "groupDeleted" | "groupUpdated" | "userContactLinkSubscribed" | "userContactLinkSubError" | "newContactConnection" | "contactConnectionDeleted" | "messageError" | "chatCmdError" | "chatError";
|
|
4
|
-
interface CR {
|
|
5
|
-
type: ChatResponseTag;
|
|
6
|
-
}
|
|
7
|
-
export interface CRActiveUser extends CR {
|
|
8
|
-
type: "activeUser";
|
|
9
|
-
user: User;
|
|
10
|
-
}
|
|
11
|
-
export interface CRUsersList extends CR {
|
|
12
|
-
type: "usersList";
|
|
13
|
-
users: UserInfo[];
|
|
14
|
-
}
|
|
15
|
-
export interface CRChatStarted extends CR {
|
|
16
|
-
type: "chatStarted";
|
|
17
|
-
}
|
|
18
|
-
export interface CRChatRunning extends CR {
|
|
19
|
-
type: "chatRunning";
|
|
20
|
-
}
|
|
21
|
-
export interface CRChatStopped extends CR {
|
|
22
|
-
type: "chatStopped";
|
|
23
|
-
}
|
|
24
|
-
export interface CRApiChats extends CR {
|
|
25
|
-
type: "apiChats";
|
|
26
|
-
user: User;
|
|
27
|
-
chats: Chat[];
|
|
28
|
-
}
|
|
29
|
-
export interface CRApiChat extends CR {
|
|
30
|
-
type: "apiChat";
|
|
31
|
-
user: User;
|
|
32
|
-
chat: Chat;
|
|
33
|
-
}
|
|
34
|
-
export interface CRApiParsedMarkdown extends CR {
|
|
35
|
-
type: "apiParsedMarkdown";
|
|
36
|
-
formattedText?: FormattedText[];
|
|
37
|
-
}
|
|
38
|
-
export interface CRUserProtoServers extends CR {
|
|
39
|
-
type: "userProtoServers";
|
|
40
|
-
user: User;
|
|
41
|
-
servers: UserProtoServers;
|
|
42
|
-
}
|
|
43
|
-
export interface CRContactInfo extends CR {
|
|
44
|
-
type: "contactInfo";
|
|
45
|
-
user: User;
|
|
46
|
-
contact: Contact;
|
|
47
|
-
connectionStats: ConnectionStats;
|
|
48
|
-
customUserProfile?: Profile;
|
|
49
|
-
}
|
|
50
|
-
export interface CRGroupMemberInfo extends CR {
|
|
51
|
-
type: "groupMemberInfo";
|
|
52
|
-
user: User;
|
|
53
|
-
groupInfo: GroupInfo;
|
|
54
|
-
member: GroupMember;
|
|
55
|
-
connectionStats_?: ConnectionStats;
|
|
56
|
-
}
|
|
57
|
-
export interface CRNewChatItems extends CR {
|
|
58
|
-
type: "newChatItems";
|
|
59
|
-
user: User;
|
|
60
|
-
chatItems: AChatItem[];
|
|
61
|
-
}
|
|
62
|
-
export interface CRChatItemStatusUpdated extends CR {
|
|
63
|
-
type: "chatItemStatusUpdated";
|
|
64
|
-
user: User;
|
|
65
|
-
chatItem: AChatItem;
|
|
66
|
-
}
|
|
67
|
-
export interface CRChatItemUpdated extends CR {
|
|
68
|
-
type: "chatItemUpdated";
|
|
69
|
-
user: User;
|
|
70
|
-
chatItem: AChatItem;
|
|
71
|
-
}
|
|
72
|
-
export interface CRChatItemDeleted extends CR {
|
|
73
|
-
type: "chatItemDeleted";
|
|
74
|
-
user: User;
|
|
75
|
-
deletedChatItem: AChatItem;
|
|
76
|
-
toChatItem?: AChatItem;
|
|
77
|
-
byUser: boolean;
|
|
78
|
-
}
|
|
79
|
-
export interface CRMsgIntegrityError extends CR {
|
|
80
|
-
type: "msgIntegrityError";
|
|
81
|
-
user: User;
|
|
82
|
-
msgError: MsgErrorType;
|
|
83
|
-
}
|
|
84
|
-
export interface CRCmdOk extends CR {
|
|
85
|
-
type: "cmdOk";
|
|
86
|
-
user_?: User;
|
|
87
|
-
}
|
|
88
|
-
export interface CRUserContactLink extends CR {
|
|
89
|
-
type: "userContactLink";
|
|
90
|
-
user: User;
|
|
91
|
-
contactLink: UserContactLink;
|
|
92
|
-
}
|
|
93
|
-
export interface CRUserContactLinkUpdated extends CR {
|
|
94
|
-
type: "userContactLinkUpdated";
|
|
95
|
-
user: User;
|
|
96
|
-
connReqContact: string;
|
|
97
|
-
autoAccept: boolean;
|
|
98
|
-
autoReply?: MsgContent;
|
|
99
|
-
}
|
|
100
|
-
export interface CRContactRequestRejected extends CR {
|
|
101
|
-
type: "contactRequestRejected";
|
|
102
|
-
user: User;
|
|
103
|
-
contactRequest: UserContactRequest;
|
|
104
|
-
}
|
|
105
|
-
export interface CRUserProfile extends CR {
|
|
106
|
-
type: "userProfile";
|
|
107
|
-
user: User;
|
|
108
|
-
profile: Profile;
|
|
109
|
-
}
|
|
110
|
-
export interface CRUserProfileNoChange extends CR {
|
|
111
|
-
type: "userProfileNoChange";
|
|
112
|
-
user: User;
|
|
113
|
-
}
|
|
114
|
-
export interface CRUserProfileUpdated extends CR {
|
|
115
|
-
type: "userProfileUpdated";
|
|
116
|
-
user: User;
|
|
117
|
-
fromProfile: Profile;
|
|
118
|
-
toProfile: Profile;
|
|
119
|
-
}
|
|
120
|
-
export interface CRContactAliasUpdated extends CR {
|
|
121
|
-
type: "contactAliasUpdated";
|
|
122
|
-
user: User;
|
|
123
|
-
toContact: Contact;
|
|
124
|
-
}
|
|
125
|
-
export interface CRInvitation extends CR {
|
|
126
|
-
type: "invitation";
|
|
127
|
-
user: User;
|
|
128
|
-
connReqInvitation: string;
|
|
129
|
-
}
|
|
130
|
-
export interface CRSentConfirmation extends CR {
|
|
131
|
-
type: "sentConfirmation";
|
|
132
|
-
user: User;
|
|
133
|
-
}
|
|
134
|
-
export interface CRSentInvitation extends CR {
|
|
135
|
-
type: "sentInvitation";
|
|
136
|
-
user: User;
|
|
137
|
-
}
|
|
138
|
-
export interface CRContactUpdated extends CR {
|
|
139
|
-
type: "contactUpdated";
|
|
140
|
-
user: User;
|
|
141
|
-
fromContact: Contact;
|
|
142
|
-
toContact: Contact;
|
|
143
|
-
}
|
|
144
|
-
export interface CRContactsMerged extends CR {
|
|
145
|
-
type: "contactsMerged";
|
|
146
|
-
user: User;
|
|
147
|
-
intoContact: Contact;
|
|
148
|
-
mergedContact: Contact;
|
|
149
|
-
}
|
|
150
|
-
export interface CRContactDeleted extends CR {
|
|
151
|
-
type: "contactDeleted";
|
|
152
|
-
user: User;
|
|
153
|
-
contact: Contact;
|
|
154
|
-
}
|
|
155
|
-
export interface CRChatCleared extends CR {
|
|
156
|
-
type: "chatCleared";
|
|
157
|
-
user: User;
|
|
158
|
-
chatInfo: ChatInfo;
|
|
159
|
-
}
|
|
160
|
-
export interface CRUserContactLinkCreated extends CR {
|
|
161
|
-
type: "userContactLinkCreated";
|
|
162
|
-
user: User;
|
|
163
|
-
connReqContact: string;
|
|
164
|
-
}
|
|
165
|
-
export interface CRUserContactLinkDeleted extends CR {
|
|
166
|
-
type: "userContactLinkDeleted";
|
|
167
|
-
user: User;
|
|
168
|
-
}
|
|
169
|
-
export interface CRReceivedContactRequest extends CR {
|
|
170
|
-
type: "receivedContactRequest";
|
|
171
|
-
user: User;
|
|
172
|
-
contactRequest: UserContactRequest;
|
|
173
|
-
}
|
|
174
|
-
export interface CRAcceptingContactRequest extends CR {
|
|
175
|
-
type: "acceptingContactRequest";
|
|
176
|
-
user: User;
|
|
177
|
-
contact: Contact;
|
|
178
|
-
}
|
|
179
|
-
export interface CRContactAlreadyExists extends CR {
|
|
180
|
-
type: "contactAlreadyExists";
|
|
181
|
-
user: User;
|
|
182
|
-
contact: Contact;
|
|
183
|
-
}
|
|
184
|
-
export interface CRContactRequestAlreadyAccepted extends CR {
|
|
185
|
-
type: "contactRequestAlreadyAccepted";
|
|
186
|
-
user: User;
|
|
187
|
-
contact: Contact;
|
|
188
|
-
}
|
|
189
|
-
export interface CRContactConnecting extends CR {
|
|
190
|
-
type: "contactConnecting";
|
|
191
|
-
user: User;
|
|
192
|
-
contact: Contact;
|
|
193
|
-
}
|
|
194
|
-
export interface CRContactConnected extends CR {
|
|
195
|
-
type: "contactConnected";
|
|
196
|
-
contact: Contact;
|
|
197
|
-
user: User;
|
|
198
|
-
userCustomProfile?: Profile;
|
|
199
|
-
}
|
|
200
|
-
export interface CRContactAnotherClient extends CR {
|
|
201
|
-
type: "contactAnotherClient";
|
|
202
|
-
user: User;
|
|
203
|
-
contact: Contact;
|
|
204
|
-
}
|
|
205
|
-
export interface CRContactSubError extends CR {
|
|
206
|
-
type: "contactSubError";
|
|
207
|
-
user: User;
|
|
208
|
-
contact: Contact;
|
|
209
|
-
chatError: ChatError;
|
|
210
|
-
}
|
|
211
|
-
export interface CRContactSubSummary extends CR {
|
|
212
|
-
type: "contactSubSummary";
|
|
213
|
-
user: User;
|
|
214
|
-
contactSubscriptions: ContactSubStatus[];
|
|
215
|
-
}
|
|
216
|
-
export interface CRContactsDisconnected extends CR {
|
|
217
|
-
type: "contactsDisconnected";
|
|
218
|
-
user: User;
|
|
219
|
-
server: string;
|
|
220
|
-
contactRefs: ContactRef[];
|
|
221
|
-
}
|
|
222
|
-
export interface CRContactsSubscribed extends CR {
|
|
223
|
-
type: "contactsSubscribed";
|
|
224
|
-
user: User;
|
|
225
|
-
server: string;
|
|
226
|
-
contactRefs: ContactRef[];
|
|
227
|
-
}
|
|
228
|
-
export interface CRHostConnected extends CR {
|
|
229
|
-
type: "hostConnected";
|
|
230
|
-
protocol: string;
|
|
231
|
-
transportHost: string;
|
|
232
|
-
}
|
|
233
|
-
export interface CRHostDisconnected extends CR {
|
|
234
|
-
type: "hostDisconnected";
|
|
235
|
-
protocol: string;
|
|
236
|
-
transportHost: string;
|
|
237
|
-
}
|
|
238
|
-
export interface CRGroupEmpty extends CR {
|
|
239
|
-
type: "groupEmpty";
|
|
240
|
-
user: User;
|
|
241
|
-
groupInfo: GroupInfo;
|
|
242
|
-
}
|
|
243
|
-
export interface CRMemberSubError extends CR {
|
|
244
|
-
type: "memberSubError";
|
|
245
|
-
user: User;
|
|
246
|
-
groupInfo: GroupInfo;
|
|
247
|
-
member: GroupMember;
|
|
248
|
-
chatError: ChatError;
|
|
249
|
-
}
|
|
250
|
-
export interface CRMemberSubSummary extends CR {
|
|
251
|
-
type: "memberSubSummary";
|
|
252
|
-
user: User;
|
|
253
|
-
memberSubscriptions: MemberSubStatus[];
|
|
254
|
-
}
|
|
255
|
-
export interface CRGroupSubscribed extends CR {
|
|
256
|
-
type: "groupSubscribed";
|
|
257
|
-
user: User;
|
|
258
|
-
groupInfo: GroupInfo;
|
|
259
|
-
}
|
|
260
|
-
export interface CRRcvFileAccepted extends CR {
|
|
261
|
-
type: "rcvFileAccepted";
|
|
262
|
-
user: User;
|
|
263
|
-
chatItem: AChatItem;
|
|
264
|
-
}
|
|
265
|
-
export interface CRRcvFileAcceptedSndCancelled extends CR {
|
|
266
|
-
type: "rcvFileAcceptedSndCancelled";
|
|
267
|
-
user: User;
|
|
268
|
-
rcvFileTransfer: RcvFileTransfer;
|
|
269
|
-
}
|
|
270
|
-
export interface CRRcvFileStart extends CR {
|
|
271
|
-
type: "rcvFileStart";
|
|
272
|
-
user: User;
|
|
273
|
-
chatItem: AChatItem;
|
|
274
|
-
}
|
|
275
|
-
export interface CRRcvFileComplete extends CR {
|
|
276
|
-
type: "rcvFileComplete";
|
|
277
|
-
user: User;
|
|
278
|
-
chatItem: AChatItem;
|
|
279
|
-
}
|
|
280
|
-
export interface CRRcvFileCancelled extends CR {
|
|
281
|
-
type: "rcvFileCancelled";
|
|
282
|
-
user: User;
|
|
283
|
-
rcvFileTransfer: RcvFileTransfer;
|
|
284
|
-
}
|
|
285
|
-
export interface CRRcvFileSndCancelled extends CR {
|
|
286
|
-
type: "rcvFileSndCancelled";
|
|
287
|
-
user: User;
|
|
288
|
-
rcvFileTransfer: RcvFileTransfer;
|
|
289
|
-
}
|
|
290
|
-
export interface CRSndFileStart extends CR {
|
|
291
|
-
type: "sndFileStart";
|
|
292
|
-
user: User;
|
|
293
|
-
chatItem: AChatItem;
|
|
294
|
-
sndFileTransfer: SndFileTransfer;
|
|
295
|
-
}
|
|
296
|
-
export interface CRSndFileComplete extends CR {
|
|
297
|
-
type: "sndFileComplete";
|
|
298
|
-
user: User;
|
|
299
|
-
chatItem: AChatItem;
|
|
300
|
-
sndFileTransfer: SndFileTransfer;
|
|
301
|
-
}
|
|
302
|
-
export interface CRSndFileCancelled extends CR {
|
|
303
|
-
type: "sndFileCancelled";
|
|
304
|
-
user: User;
|
|
305
|
-
chatItem: AChatItem;
|
|
306
|
-
sndFileTransfer: SndFileTransfer;
|
|
307
|
-
}
|
|
308
|
-
export interface CRSndFileRcvCancelled extends CR {
|
|
309
|
-
type: "sndFileRcvCancelled";
|
|
310
|
-
user: User;
|
|
311
|
-
chatItem: AChatItem;
|
|
312
|
-
sndFileTransfer: SndFileTransfer;
|
|
313
|
-
}
|
|
314
|
-
export interface CRSndGroupFileCancelled extends CR {
|
|
315
|
-
type: "sndGroupFileCancelled";
|
|
316
|
-
user: User;
|
|
317
|
-
chatItem: AChatItem;
|
|
318
|
-
fileTransferMeta: FileTransferMeta;
|
|
319
|
-
sndFileTransfers: SndFileTransfer[];
|
|
320
|
-
}
|
|
321
|
-
export interface CRSndFileSubError extends CR {
|
|
322
|
-
type: "sndFileSubError";
|
|
323
|
-
user: User;
|
|
324
|
-
sndFileTransfer: SndFileTransfer;
|
|
325
|
-
chatError: ChatError;
|
|
326
|
-
}
|
|
327
|
-
export interface CRRcvFileSubError extends CR {
|
|
328
|
-
type: "rcvFileSubError";
|
|
329
|
-
user: User;
|
|
330
|
-
rcvFileTransfer: RcvFileTransfer;
|
|
331
|
-
chatError: ChatError;
|
|
332
|
-
}
|
|
333
|
-
export interface CRPendingSubSummary extends CR {
|
|
334
|
-
type: "pendingSubSummary";
|
|
335
|
-
user: User;
|
|
336
|
-
pendingSubStatus: PendingSubStatus[];
|
|
337
|
-
}
|
|
338
|
-
export interface CRGroupCreated extends CR {
|
|
339
|
-
type: "groupCreated";
|
|
340
|
-
user: User;
|
|
341
|
-
groupInfo: GroupInfo;
|
|
342
|
-
}
|
|
343
|
-
export interface CRGroupMembers extends CR {
|
|
344
|
-
type: "groupMembers";
|
|
345
|
-
user: User;
|
|
346
|
-
group: Group;
|
|
347
|
-
}
|
|
348
|
-
export interface CRUserAcceptedGroupSent extends CR {
|
|
349
|
-
type: "userAcceptedGroupSent";
|
|
350
|
-
user: User;
|
|
351
|
-
groupInfo: GroupInfo;
|
|
352
|
-
hostContact?: Contact;
|
|
353
|
-
}
|
|
354
|
-
export interface CRUserDeletedMember extends CR {
|
|
355
|
-
type: "userDeletedMember";
|
|
356
|
-
user: User;
|
|
357
|
-
groupInfo: GroupInfo;
|
|
358
|
-
member: GroupMember;
|
|
359
|
-
}
|
|
360
|
-
export interface CRSentGroupInvitation extends CR {
|
|
361
|
-
type: "sentGroupInvitation";
|
|
362
|
-
user: User;
|
|
363
|
-
groupInfo: GroupInfo;
|
|
364
|
-
contact: Contact;
|
|
365
|
-
member: GroupMember;
|
|
366
|
-
}
|
|
367
|
-
export interface CRLeftMemberUser extends CR {
|
|
368
|
-
type: "leftMemberUser";
|
|
369
|
-
user: User;
|
|
370
|
-
groupInfo: GroupInfo;
|
|
371
|
-
}
|
|
372
|
-
export interface CRGroupDeletedUser extends CR {
|
|
373
|
-
type: "groupDeletedUser";
|
|
374
|
-
user: User;
|
|
375
|
-
groupInfo: GroupInfo;
|
|
376
|
-
}
|
|
377
|
-
export interface CRGroupInvitation extends CR {
|
|
378
|
-
type: "groupInvitation";
|
|
379
|
-
user: User;
|
|
380
|
-
groupInfo: GroupInfo;
|
|
381
|
-
}
|
|
382
|
-
export interface CRReceivedGroupInvitation extends CR {
|
|
383
|
-
type: "receivedGroupInvitation";
|
|
384
|
-
user: User;
|
|
385
|
-
groupInfo: GroupInfo;
|
|
386
|
-
contact: Contact;
|
|
387
|
-
memberRole: GroupMemberRole;
|
|
388
|
-
}
|
|
389
|
-
export interface CRUserJoinedGroup extends CR {
|
|
390
|
-
type: "userJoinedGroup";
|
|
391
|
-
user: User;
|
|
392
|
-
groupInfo: GroupInfo;
|
|
393
|
-
hostMember: GroupMember;
|
|
394
|
-
}
|
|
395
|
-
export interface CRJoinedGroupMember extends CR {
|
|
396
|
-
type: "joinedGroupMember";
|
|
397
|
-
user: User;
|
|
398
|
-
groupInfo: GroupInfo;
|
|
399
|
-
member: GroupMember;
|
|
400
|
-
}
|
|
401
|
-
export interface CRJoinedGroupMemberConnecting extends CR {
|
|
402
|
-
type: "joinedGroupMemberConnecting";
|
|
403
|
-
user: User;
|
|
404
|
-
groupInfo: GroupInfo;
|
|
405
|
-
hostMember: GroupMember;
|
|
406
|
-
member: GroupMember;
|
|
407
|
-
}
|
|
408
|
-
export interface CRConnectedToGroupMember extends CR {
|
|
409
|
-
type: "connectedToGroupMember";
|
|
410
|
-
user: User;
|
|
411
|
-
groupInfo: GroupInfo;
|
|
412
|
-
member: GroupMember;
|
|
413
|
-
}
|
|
414
|
-
export interface CRDeletedMember extends CR {
|
|
415
|
-
type: "deletedMember";
|
|
416
|
-
user: User;
|
|
417
|
-
groupInfo: GroupInfo;
|
|
418
|
-
byMember: GroupMember;
|
|
419
|
-
deletedMember: GroupMember;
|
|
420
|
-
}
|
|
421
|
-
export interface CRDeletedMemberUser extends CR {
|
|
422
|
-
type: "deletedMemberUser";
|
|
423
|
-
user: User;
|
|
424
|
-
groupInfo: GroupInfo;
|
|
425
|
-
member: GroupMember;
|
|
426
|
-
}
|
|
427
|
-
export interface CRLeftMember extends CR {
|
|
428
|
-
type: "leftMember";
|
|
429
|
-
user: User;
|
|
430
|
-
groupInfo: GroupInfo;
|
|
431
|
-
member: GroupMember;
|
|
432
|
-
}
|
|
433
|
-
export interface CRGroupRemoved extends CR {
|
|
434
|
-
type: "groupRemoved";
|
|
435
|
-
user: User;
|
|
436
|
-
groupInfo: GroupInfo;
|
|
437
|
-
}
|
|
438
|
-
export interface CRGroupDeleted extends CR {
|
|
439
|
-
type: "groupDeleted";
|
|
440
|
-
user: User;
|
|
441
|
-
groupInfo: GroupInfo;
|
|
442
|
-
member: GroupMember;
|
|
443
|
-
}
|
|
444
|
-
export interface CRGroupUpdated extends CR {
|
|
445
|
-
type: "groupUpdated";
|
|
446
|
-
user: User;
|
|
447
|
-
fromGroup: GroupInfo;
|
|
448
|
-
toGroup: GroupInfo;
|
|
449
|
-
member_?: GroupMember;
|
|
450
|
-
}
|
|
451
|
-
export interface CRUserContactLinkSubscribed extends CR {
|
|
452
|
-
type: "userContactLinkSubscribed";
|
|
453
|
-
}
|
|
454
|
-
export interface CRUserContactLinkSubError extends CR {
|
|
455
|
-
type: "userContactLinkSubError";
|
|
456
|
-
chatError: ChatError;
|
|
457
|
-
}
|
|
458
|
-
export interface CRContactConnectionDeleted extends CR {
|
|
459
|
-
type: "contactConnectionDeleted";
|
|
460
|
-
user: User;
|
|
461
|
-
connection: PendingContactConnection;
|
|
462
|
-
}
|
|
463
|
-
export interface CRMessageError extends CR {
|
|
464
|
-
type: "messageError";
|
|
465
|
-
user: User;
|
|
466
|
-
severity: string;
|
|
467
|
-
errorMessage: string;
|
|
468
|
-
}
|
|
469
|
-
export interface CRChatCmdError extends CR {
|
|
470
|
-
type: "chatCmdError";
|
|
471
|
-
user_?: User;
|
|
472
|
-
chatError: ChatError;
|
|
473
|
-
}
|
|
474
|
-
export interface CRChatError extends CR {
|
|
475
|
-
type: "chatError";
|
|
476
|
-
user_?: User;
|
|
477
|
-
chatError: ChatError;
|
|
478
|
-
}
|
|
479
|
-
export interface User {
|
|
480
|
-
userId: number;
|
|
481
|
-
agentUserId: string;
|
|
482
|
-
userContactId: number;
|
|
483
|
-
localDisplayName: string;
|
|
484
|
-
profile: LocalProfile;
|
|
485
|
-
activeUser: boolean;
|
|
486
|
-
viewPwdHash: string;
|
|
487
|
-
showNtfs: boolean;
|
|
488
|
-
}
|
|
489
|
-
export interface UserProtoServers {
|
|
490
|
-
serverProtocol: ServerProtocol;
|
|
491
|
-
protoServers: ServerCfg[];
|
|
492
|
-
presetServers: string;
|
|
493
|
-
}
|
|
494
|
-
export interface Chat {
|
|
495
|
-
chatInfo: ChatInfo;
|
|
496
|
-
chatItems: [ChatItem];
|
|
497
|
-
chatStats: ChatStats;
|
|
498
|
-
}
|
|
499
|
-
export type ChatInfo = CInfoDirect | CInfoGroup | CInfoContactRequest;
|
|
500
|
-
export declare enum ChatInfoType {
|
|
501
|
-
Direct = "direct",
|
|
502
|
-
Group = "group",
|
|
503
|
-
ContactRequest = "contactRequest"
|
|
504
|
-
}
|
|
505
|
-
interface IChatInfo {
|
|
506
|
-
type: ChatInfoType;
|
|
507
|
-
}
|
|
508
|
-
interface CInfoDirect extends IChatInfo {
|
|
509
|
-
type: ChatInfoType.Direct;
|
|
510
|
-
contact: Contact;
|
|
511
|
-
}
|
|
512
|
-
interface CInfoGroup extends IChatInfo {
|
|
513
|
-
type: ChatInfoType.Group;
|
|
514
|
-
groupInfo: GroupInfo;
|
|
515
|
-
}
|
|
516
|
-
interface CInfoContactRequest extends IChatInfo {
|
|
517
|
-
type: ChatInfoType.ContactRequest;
|
|
518
|
-
contactRequest: UserContactRequest;
|
|
519
|
-
}
|
|
520
|
-
export interface UserPwdHash {
|
|
521
|
-
hash: string;
|
|
522
|
-
salt: string;
|
|
523
|
-
}
|
|
524
|
-
interface UserInfo {
|
|
525
|
-
user: User;
|
|
526
|
-
unreadCount: number;
|
|
527
|
-
}
|
|
528
|
-
export interface Contact {
|
|
529
|
-
contactId: number;
|
|
530
|
-
localDisplayName: string;
|
|
531
|
-
profile: Profile;
|
|
532
|
-
activeConn: Connection;
|
|
533
|
-
viaGroup?: number;
|
|
534
|
-
createdAt: Date;
|
|
535
|
-
}
|
|
536
|
-
export interface ContactRef {
|
|
537
|
-
contactId: number;
|
|
538
|
-
localDisplayName: string;
|
|
539
|
-
}
|
|
540
|
-
export interface Group {
|
|
541
|
-
groupInfo: GroupInfo;
|
|
542
|
-
members: GroupMember[];
|
|
543
|
-
}
|
|
544
|
-
export interface GroupInfo {
|
|
545
|
-
groupId: number;
|
|
546
|
-
localDisplayName: string;
|
|
547
|
-
groupProfile: GroupProfile;
|
|
548
|
-
membership: GroupMember;
|
|
549
|
-
createdAt: Date;
|
|
550
|
-
}
|
|
551
|
-
export interface GroupProfile {
|
|
552
|
-
displayName: string;
|
|
553
|
-
fullName: string;
|
|
554
|
-
image?: string;
|
|
555
|
-
}
|
|
556
|
-
export interface GroupMember {
|
|
557
|
-
groupMemberId: number;
|
|
558
|
-
memberId: string;
|
|
559
|
-
memberRole: GroupMemberRole;
|
|
560
|
-
localDisplayName: string;
|
|
561
|
-
memberProfile: Profile;
|
|
562
|
-
memberContactId?: number;
|
|
563
|
-
activeConn?: Connection;
|
|
564
|
-
}
|
|
565
|
-
export interface UserContactRequest {
|
|
566
|
-
contactRequestId: number;
|
|
567
|
-
localDisplayName: string;
|
|
568
|
-
profile: Profile;
|
|
569
|
-
createdAt: Date;
|
|
570
|
-
}
|
|
571
|
-
interface Connection {
|
|
572
|
-
connId: number;
|
|
573
|
-
}
|
|
574
|
-
export interface AChatItem {
|
|
575
|
-
chatInfo: ChatInfo;
|
|
576
|
-
chatItem: ChatItem;
|
|
577
|
-
}
|
|
578
|
-
export interface ChatItem {
|
|
579
|
-
chatDir: CIDirection;
|
|
580
|
-
meta: CIMeta;
|
|
581
|
-
content: CIContent;
|
|
582
|
-
formattedText?: FormattedText[];
|
|
583
|
-
quotedItem?: CIQuote;
|
|
584
|
-
}
|
|
585
|
-
export type CIDirection = CIDirectSnd | CIDirectRcv | CIGroupSnd | CIGroupRcv;
|
|
586
|
-
interface ICIDirection {
|
|
587
|
-
type: "directSnd" | "directRcv" | "groupSnd" | "groupRcv";
|
|
588
|
-
}
|
|
589
|
-
interface CIDirectSnd extends ICIDirection {
|
|
590
|
-
type: "directSnd";
|
|
591
|
-
}
|
|
592
|
-
interface CIDirectRcv extends ICIDirection {
|
|
593
|
-
type: "directRcv";
|
|
594
|
-
}
|
|
595
|
-
interface CIGroupSnd extends ICIDirection {
|
|
596
|
-
type: "groupSnd";
|
|
597
|
-
}
|
|
598
|
-
interface CIGroupRcv extends ICIDirection {
|
|
599
|
-
type: "groupRcv";
|
|
600
|
-
groupMember: GroupMember;
|
|
601
|
-
}
|
|
602
|
-
export interface CIMeta {
|
|
603
|
-
itemId: ChatItemId;
|
|
604
|
-
itemTs: Date;
|
|
605
|
-
itemText: string;
|
|
606
|
-
itemStatus: CIStatus;
|
|
607
|
-
createdAt: Date;
|
|
608
|
-
itemDeleted: boolean;
|
|
609
|
-
itemEdited: boolean;
|
|
610
|
-
editable: boolean;
|
|
611
|
-
}
|
|
612
|
-
export type CIContent = CISndMsgContent | CIRcvMsgContent | CISndDeleted | CIRcvDeleted | CISndFileInvitation | CIRcvFileInvitation;
|
|
613
|
-
interface ICIContent {
|
|
614
|
-
type: "sndMsgContent" | "rcvMsgContent" | "sndDeleted" | "rcvDeleted" | "sndFileInvitation" | "rcvFileInvitation";
|
|
615
|
-
}
|
|
616
|
-
interface CISndMsgContent extends ICIContent {
|
|
617
|
-
type: "sndMsgContent";
|
|
618
|
-
msgContent: MsgContent;
|
|
619
|
-
}
|
|
620
|
-
interface CIRcvMsgContent extends ICIContent {
|
|
621
|
-
type: "rcvMsgContent";
|
|
622
|
-
msgContent: MsgContent;
|
|
623
|
-
}
|
|
624
|
-
interface CISndDeleted extends ICIContent {
|
|
625
|
-
type: "sndDeleted";
|
|
626
|
-
deleteMode: DeleteMode;
|
|
627
|
-
}
|
|
628
|
-
interface CIRcvDeleted extends ICIContent {
|
|
629
|
-
type: "rcvDeleted";
|
|
630
|
-
deleteMode: DeleteMode;
|
|
631
|
-
}
|
|
632
|
-
interface CISndFileInvitation extends ICIContent {
|
|
633
|
-
type: "sndFileInvitation";
|
|
634
|
-
fileId: number;
|
|
635
|
-
filePath: string;
|
|
636
|
-
}
|
|
637
|
-
interface CIRcvFileInvitation extends ICIContent {
|
|
638
|
-
type: "rcvFileInvitation";
|
|
639
|
-
rcvFileTransfer: RcvFileTransfer;
|
|
640
|
-
}
|
|
641
|
-
export declare function ciContentText(content: CIContent): string | undefined;
|
|
642
|
-
interface RcvFileTransfer {
|
|
643
|
-
fileId: number;
|
|
644
|
-
senderDisplayName: string;
|
|
645
|
-
chunkSize: number;
|
|
646
|
-
cancelled: boolean;
|
|
647
|
-
grpMemberId?: number;
|
|
648
|
-
}
|
|
649
|
-
interface SndFileTransfer {
|
|
650
|
-
fileId: number;
|
|
651
|
-
fileName: string;
|
|
652
|
-
filePath: string;
|
|
653
|
-
fileSize: number;
|
|
654
|
-
chunkSize: number;
|
|
655
|
-
recipientDisplayName: string;
|
|
656
|
-
connId: number;
|
|
657
|
-
}
|
|
658
|
-
interface FileTransferMeta {
|
|
659
|
-
fileId: number;
|
|
660
|
-
fileName: string;
|
|
661
|
-
filePath: string;
|
|
662
|
-
fileSize: number;
|
|
663
|
-
chunkSize: number;
|
|
664
|
-
cancelled: boolean;
|
|
665
|
-
}
|
|
666
|
-
interface UserContactLink {
|
|
667
|
-
connReqContact: string;
|
|
668
|
-
autoAccept?: AutoAccept;
|
|
669
|
-
}
|
|
670
|
-
interface AutoAccept {
|
|
671
|
-
acceptIncognito: boolean;
|
|
672
|
-
autoReply?: MsgContent;
|
|
673
|
-
}
|
|
674
|
-
export interface ChatStats {
|
|
675
|
-
unreadCount: number;
|
|
676
|
-
minUnreadItemId: number;
|
|
677
|
-
}
|
|
678
|
-
export interface CIQuote {
|
|
679
|
-
chatDir?: CIDirection;
|
|
680
|
-
itemId?: number;
|
|
681
|
-
sharedMsgId?: string;
|
|
682
|
-
sentAt: Date;
|
|
683
|
-
content: MsgContent;
|
|
684
|
-
formattedText?: FormattedText[];
|
|
685
|
-
}
|
|
686
|
-
export type CIStatus = CISndNew | CISndSent | CISndErrorAuth | CISndError | CIRcvNew | CIRcvRead;
|
|
687
|
-
interface ICIStatus {
|
|
688
|
-
type: "sndNew" | "sndSent" | "sndErrorAuth" | "sndError" | "rcvNew" | "rcvRead";
|
|
689
|
-
}
|
|
690
|
-
interface CISndNew extends ICIStatus {
|
|
691
|
-
type: "sndNew";
|
|
692
|
-
}
|
|
693
|
-
interface CISndSent extends ICIStatus {
|
|
694
|
-
type: "sndSent";
|
|
695
|
-
}
|
|
696
|
-
interface CISndErrorAuth extends ICIStatus {
|
|
697
|
-
type: "sndErrorAuth";
|
|
698
|
-
}
|
|
699
|
-
interface CISndError extends ICIStatus {
|
|
700
|
-
type: "sndError";
|
|
701
|
-
agentError: AgentErrorType;
|
|
702
|
-
}
|
|
703
|
-
interface CIRcvNew extends ICIStatus {
|
|
704
|
-
type: "rcvNew";
|
|
705
|
-
}
|
|
706
|
-
interface CIRcvRead extends ICIStatus {
|
|
707
|
-
type: "rcvRead";
|
|
708
|
-
}
|
|
709
|
-
interface FormattedText {
|
|
710
|
-
}
|
|
711
|
-
interface MsgErrorType {
|
|
712
|
-
}
|
|
713
|
-
export type ChatError = ChatErrorChat | ChatErrorAgent | ChatErrorStore;
|
|
714
|
-
interface ChatErrorChat {
|
|
715
|
-
type: "error";
|
|
716
|
-
errorType: ChatErrorType;
|
|
717
|
-
}
|
|
718
|
-
interface ChatErrorAgent {
|
|
719
|
-
type: "errorAgent";
|
|
720
|
-
agentError: AgentErrorType;
|
|
721
|
-
}
|
|
722
|
-
interface ChatErrorStore {
|
|
723
|
-
type: "errorStore";
|
|
724
|
-
storeError: StoreErrorType;
|
|
725
|
-
}
|
|
726
|
-
type ChatErrorType = CENoActiveUser | CEActiveUserExists;
|
|
727
|
-
interface CENoActiveUser {
|
|
728
|
-
type: "noActiveUser";
|
|
729
|
-
}
|
|
730
|
-
interface CEActiveUserExists {
|
|
731
|
-
type: "activeUserExists";
|
|
732
|
-
}
|
|
733
|
-
interface ContactSubStatus {
|
|
734
|
-
}
|
|
735
|
-
interface PendingSubStatus {
|
|
736
|
-
}
|
|
737
|
-
export interface ConnectionStats {
|
|
738
|
-
rcvServers?: string[];
|
|
739
|
-
sndServers?: string[];
|
|
740
|
-
}
|
|
741
|
-
interface PendingContactConnection {
|
|
742
|
-
}
|
|
743
|
-
interface MemberSubStatus {
|
|
744
|
-
member: GroupMember;
|
|
745
|
-
memberError?: ChatError;
|
|
746
|
-
}
|
|
747
|
-
interface AgentErrorType {
|
|
748
|
-
type: string;
|
|
749
|
-
[x: string]: any;
|
|
750
|
-
}
|
|
751
|
-
interface StoreErrorType {
|
|
752
|
-
type: string;
|
|
753
|
-
[x: string]: any;
|
|
754
|
-
}
|
|
755
|
-
export {};
|