simplex-chat 0.1.0 → 0.2.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/README.md +29 -9
- package/dist/client.d.ts +23 -7
- package/dist/client.js +120 -27
- package/dist/client.js.map +1 -1
- package/dist/command.d.ts +281 -15
- package/dist/command.js +125 -11
- package/dist/command.js.map +1 -1
- package/dist/queue.d.ts +1 -1
- package/dist/response.d.ts +391 -24
- package/dist/response.js.map +1 -1
- package/dist/transport.d.ts +1 -1
- package/package.json +3 -3
package/dist/response.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ChatItemId, MsgContent, DeleteMode, Profile } from "./command";
|
|
2
|
-
export
|
|
3
|
-
|
|
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 | CRNewChatItem | 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 | CRNewContactConnection | CRContactConnectionDeleted | CRMessageError | CRChatCmdError | CRChatError;
|
|
3
|
+
type ChatResponseTag = "activeUser" | "usersList" | "chatStarted" | "chatRunning" | "chatStopped" | "apiChats" | "apiChat" | "apiParsedMarkdown" | "userProtoServers" | "contactInfo" | "groupMemberInfo" | "newChatItem" | "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
4
|
interface CR {
|
|
5
5
|
type: ChatResponseTag;
|
|
6
6
|
}
|
|
@@ -8,157 +8,446 @@ export interface CRActiveUser extends CR {
|
|
|
8
8
|
type: "activeUser";
|
|
9
9
|
user: User;
|
|
10
10
|
}
|
|
11
|
+
export interface CRUsersList extends CR {
|
|
12
|
+
type: "usersList";
|
|
13
|
+
users: UserInfo[];
|
|
14
|
+
}
|
|
11
15
|
export interface CRChatStarted extends CR {
|
|
12
16
|
type: "chatStarted";
|
|
13
17
|
}
|
|
14
18
|
export interface CRChatRunning extends CR {
|
|
15
19
|
type: "chatRunning";
|
|
16
20
|
}
|
|
21
|
+
export interface CRChatStopped extends CR {
|
|
22
|
+
type: "chatStopped";
|
|
23
|
+
}
|
|
17
24
|
export interface CRApiChats extends CR {
|
|
18
25
|
type: "apiChats";
|
|
26
|
+
user: User;
|
|
19
27
|
chats: Chat[];
|
|
20
28
|
}
|
|
21
29
|
export interface CRApiChat extends CR {
|
|
22
30
|
type: "apiChat";
|
|
31
|
+
user: User;
|
|
23
32
|
chat: Chat;
|
|
24
33
|
}
|
|
25
34
|
export interface CRApiParsedMarkdown extends CR {
|
|
26
35
|
type: "apiParsedMarkdown";
|
|
27
36
|
formattedText?: FormattedText[];
|
|
28
37
|
}
|
|
29
|
-
export interface
|
|
30
|
-
type: "
|
|
31
|
-
|
|
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;
|
|
32
56
|
}
|
|
33
57
|
export interface CRNewChatItem extends CR {
|
|
34
58
|
type: "newChatItem";
|
|
59
|
+
user: User;
|
|
35
60
|
chatItem: AChatItem;
|
|
36
61
|
}
|
|
37
62
|
export interface CRChatItemStatusUpdated extends CR {
|
|
38
63
|
type: "chatItemStatusUpdated";
|
|
64
|
+
user: User;
|
|
39
65
|
chatItem: AChatItem;
|
|
40
66
|
}
|
|
41
67
|
export interface CRChatItemUpdated extends CR {
|
|
42
68
|
type: "chatItemUpdated";
|
|
69
|
+
user: User;
|
|
43
70
|
chatItem: AChatItem;
|
|
44
71
|
}
|
|
45
72
|
export interface CRChatItemDeleted extends CR {
|
|
46
73
|
type: "chatItemDeleted";
|
|
74
|
+
user: User;
|
|
47
75
|
deletedChatItem: AChatItem;
|
|
48
|
-
toChatItem
|
|
76
|
+
toChatItem?: AChatItem;
|
|
77
|
+
byUser: boolean;
|
|
49
78
|
}
|
|
50
79
|
export interface CRMsgIntegrityError extends CR {
|
|
51
80
|
type: "msgIntegrityError";
|
|
81
|
+
user: User;
|
|
52
82
|
msgError: MsgErrorType;
|
|
53
83
|
}
|
|
54
84
|
export interface CRCmdOk extends CR {
|
|
55
85
|
type: "cmdOk";
|
|
86
|
+
user_?: User;
|
|
56
87
|
}
|
|
57
88
|
export interface CRUserContactLink extends CR {
|
|
58
89
|
type: "userContactLink";
|
|
59
|
-
|
|
60
|
-
|
|
90
|
+
user: User;
|
|
91
|
+
contactLink: UserContactLink;
|
|
61
92
|
}
|
|
62
93
|
export interface CRUserContactLinkUpdated extends CR {
|
|
63
94
|
type: "userContactLinkUpdated";
|
|
95
|
+
user: User;
|
|
64
96
|
connReqContact: string;
|
|
65
97
|
autoAccept: boolean;
|
|
98
|
+
autoReply?: MsgContent;
|
|
66
99
|
}
|
|
67
100
|
export interface CRContactRequestRejected extends CR {
|
|
68
101
|
type: "contactRequestRejected";
|
|
102
|
+
user: User;
|
|
69
103
|
contactRequest: UserContactRequest;
|
|
70
104
|
}
|
|
71
105
|
export interface CRUserProfile extends CR {
|
|
72
106
|
type: "userProfile";
|
|
107
|
+
user: User;
|
|
73
108
|
profile: Profile;
|
|
74
109
|
}
|
|
75
110
|
export interface CRUserProfileNoChange extends CR {
|
|
76
111
|
type: "userProfileNoChange";
|
|
112
|
+
user: User;
|
|
77
113
|
}
|
|
78
114
|
export interface CRUserProfileUpdated extends CR {
|
|
79
115
|
type: "userProfileUpdated";
|
|
116
|
+
user: User;
|
|
80
117
|
fromProfile: Profile;
|
|
81
118
|
toProfile: Profile;
|
|
82
119
|
}
|
|
120
|
+
export interface CRContactAliasUpdated extends CR {
|
|
121
|
+
type: "contactAliasUpdated";
|
|
122
|
+
user: User;
|
|
123
|
+
toContact: Contact;
|
|
124
|
+
}
|
|
83
125
|
export interface CRInvitation extends CR {
|
|
84
126
|
type: "invitation";
|
|
127
|
+
user: User;
|
|
85
128
|
connReqInvitation: string;
|
|
86
129
|
}
|
|
87
130
|
export interface CRSentConfirmation extends CR {
|
|
88
131
|
type: "sentConfirmation";
|
|
132
|
+
user: User;
|
|
89
133
|
}
|
|
90
134
|
export interface CRSentInvitation extends CR {
|
|
91
135
|
type: "sentInvitation";
|
|
136
|
+
user: User;
|
|
92
137
|
}
|
|
93
138
|
export interface CRContactUpdated extends CR {
|
|
94
139
|
type: "contactUpdated";
|
|
140
|
+
user: User;
|
|
95
141
|
fromContact: Contact;
|
|
96
142
|
toContact: Contact;
|
|
97
143
|
}
|
|
144
|
+
export interface CRContactsMerged extends CR {
|
|
145
|
+
type: "contactsMerged";
|
|
146
|
+
user: User;
|
|
147
|
+
intoContact: Contact;
|
|
148
|
+
mergedContact: Contact;
|
|
149
|
+
}
|
|
98
150
|
export interface CRContactDeleted extends CR {
|
|
99
151
|
type: "contactDeleted";
|
|
152
|
+
user: User;
|
|
100
153
|
contact: Contact;
|
|
101
154
|
}
|
|
155
|
+
export interface CRChatCleared extends CR {
|
|
156
|
+
type: "chatCleared";
|
|
157
|
+
user: User;
|
|
158
|
+
chatInfo: ChatInfo;
|
|
159
|
+
}
|
|
102
160
|
export interface CRUserContactLinkCreated extends CR {
|
|
103
161
|
type: "userContactLinkCreated";
|
|
162
|
+
user: User;
|
|
104
163
|
connReqContact: string;
|
|
105
164
|
}
|
|
106
165
|
export interface CRUserContactLinkDeleted extends CR {
|
|
107
166
|
type: "userContactLinkDeleted";
|
|
167
|
+
user: User;
|
|
108
168
|
}
|
|
109
169
|
export interface CRReceivedContactRequest extends CR {
|
|
110
170
|
type: "receivedContactRequest";
|
|
171
|
+
user: User;
|
|
111
172
|
contactRequest: UserContactRequest;
|
|
112
173
|
}
|
|
113
174
|
export interface CRAcceptingContactRequest extends CR {
|
|
114
175
|
type: "acceptingContactRequest";
|
|
176
|
+
user: User;
|
|
115
177
|
contact: Contact;
|
|
116
178
|
}
|
|
117
179
|
export interface CRContactAlreadyExists extends CR {
|
|
118
180
|
type: "contactAlreadyExists";
|
|
181
|
+
user: User;
|
|
119
182
|
contact: Contact;
|
|
120
183
|
}
|
|
121
184
|
export interface CRContactRequestAlreadyAccepted extends CR {
|
|
122
185
|
type: "contactRequestAlreadyAccepted";
|
|
186
|
+
user: User;
|
|
123
187
|
contact: Contact;
|
|
124
188
|
}
|
|
125
189
|
export interface CRContactConnecting extends CR {
|
|
126
190
|
type: "contactConnecting";
|
|
191
|
+
user: User;
|
|
127
192
|
contact: Contact;
|
|
128
193
|
}
|
|
129
194
|
export interface CRContactConnected extends CR {
|
|
130
195
|
type: "contactConnected";
|
|
131
196
|
contact: Contact;
|
|
197
|
+
user: User;
|
|
198
|
+
userCustomProfile?: Profile;
|
|
132
199
|
}
|
|
133
200
|
export interface CRContactAnotherClient extends CR {
|
|
134
201
|
type: "contactAnotherClient";
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
export interface CRContactDisconnected extends CR {
|
|
138
|
-
type: "contactDisconnected";
|
|
139
|
-
contact: Contact;
|
|
140
|
-
}
|
|
141
|
-
export interface CRContactSubscribed extends CR {
|
|
142
|
-
type: "contactSubscribed";
|
|
202
|
+
user: User;
|
|
143
203
|
contact: Contact;
|
|
144
204
|
}
|
|
145
205
|
export interface CRContactSubError extends CR {
|
|
146
206
|
type: "contactSubError";
|
|
207
|
+
user: User;
|
|
147
208
|
contact: Contact;
|
|
148
209
|
chatError: ChatError;
|
|
149
210
|
}
|
|
150
211
|
export interface CRContactSubSummary extends CR {
|
|
151
212
|
type: "contactSubSummary";
|
|
213
|
+
user: User;
|
|
152
214
|
contactSubscriptions: ContactSubStatus[];
|
|
153
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
|
+
}
|
|
154
238
|
export interface CRGroupEmpty extends CR {
|
|
155
239
|
type: "groupEmpty";
|
|
240
|
+
user: User;
|
|
241
|
+
groupInfo: GroupInfo;
|
|
242
|
+
}
|
|
243
|
+
export interface CRMemberSubError extends CR {
|
|
244
|
+
type: "memberSubError";
|
|
245
|
+
user: User;
|
|
156
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;
|
|
157
332
|
}
|
|
158
333
|
export interface CRPendingSubSummary extends CR {
|
|
159
334
|
type: "pendingSubSummary";
|
|
335
|
+
user: User;
|
|
160
336
|
pendingSubStatus: PendingSubStatus[];
|
|
161
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
|
+
}
|
|
162
451
|
export interface CRUserContactLinkSubscribed extends CR {
|
|
163
452
|
type: "userContactLinkSubscribed";
|
|
164
453
|
}
|
|
@@ -166,32 +455,53 @@ export interface CRUserContactLinkSubError extends CR {
|
|
|
166
455
|
type: "userContactLinkSubError";
|
|
167
456
|
chatError: ChatError;
|
|
168
457
|
}
|
|
458
|
+
export interface CRNewContactConnection extends CR {
|
|
459
|
+
type: "newContactConnection";
|
|
460
|
+
user: User;
|
|
461
|
+
connection: PendingContactConnection;
|
|
462
|
+
}
|
|
463
|
+
export interface CRContactConnectionDeleted extends CR {
|
|
464
|
+
type: "contactConnectionDeleted";
|
|
465
|
+
user: User;
|
|
466
|
+
connection: PendingContactConnection;
|
|
467
|
+
}
|
|
169
468
|
export interface CRMessageError extends CR {
|
|
170
469
|
type: "messageError";
|
|
470
|
+
user: User;
|
|
171
471
|
severity: string;
|
|
172
472
|
errorMessage: string;
|
|
173
473
|
}
|
|
174
474
|
export interface CRChatCmdError extends CR {
|
|
175
475
|
type: "chatCmdError";
|
|
476
|
+
user_?: User;
|
|
176
477
|
chatError: ChatError;
|
|
177
478
|
}
|
|
178
479
|
export interface CRChatError extends CR {
|
|
179
480
|
type: "chatError";
|
|
481
|
+
user_?: User;
|
|
180
482
|
chatError: ChatError;
|
|
181
483
|
}
|
|
182
484
|
export interface User {
|
|
183
485
|
userId: number;
|
|
486
|
+
agentUserId: string;
|
|
184
487
|
userContactId: number;
|
|
185
488
|
localDisplayName: string;
|
|
186
|
-
profile:
|
|
489
|
+
profile: LocalProfile;
|
|
187
490
|
activeUser: boolean;
|
|
491
|
+
viewPwdHash: string;
|
|
492
|
+
showNtfs: boolean;
|
|
493
|
+
}
|
|
494
|
+
export interface UserProtoServers {
|
|
495
|
+
serverProtocol: ServerProtocol;
|
|
496
|
+
protoServers: ServerCfg[];
|
|
497
|
+
presetServers: string;
|
|
188
498
|
}
|
|
189
499
|
export interface Chat {
|
|
190
500
|
chatInfo: ChatInfo;
|
|
191
501
|
chatItems: [ChatItem];
|
|
192
502
|
chatStats: ChatStats;
|
|
193
503
|
}
|
|
194
|
-
export
|
|
504
|
+
export type ChatInfo = CInfoDirect | CInfoGroup | CInfoContactRequest;
|
|
195
505
|
export declare enum ChatInfoType {
|
|
196
506
|
Direct = "direct",
|
|
197
507
|
Group = "group",
|
|
@@ -212,6 +522,14 @@ interface CInfoContactRequest extends IChatInfo {
|
|
|
212
522
|
type: ChatInfoType.ContactRequest;
|
|
213
523
|
contactRequest: UserContactRequest;
|
|
214
524
|
}
|
|
525
|
+
export interface UserPwdHash {
|
|
526
|
+
hash: string;
|
|
527
|
+
salt: string;
|
|
528
|
+
}
|
|
529
|
+
interface UserInfo {
|
|
530
|
+
user: User;
|
|
531
|
+
unreadCount: number;
|
|
532
|
+
}
|
|
215
533
|
export interface Contact {
|
|
216
534
|
contactId: number;
|
|
217
535
|
localDisplayName: string;
|
|
@@ -220,6 +538,14 @@ export interface Contact {
|
|
|
220
538
|
viaGroup?: number;
|
|
221
539
|
createdAt: Date;
|
|
222
540
|
}
|
|
541
|
+
export interface ContactRef {
|
|
542
|
+
contactId: number;
|
|
543
|
+
localDisplayName: string;
|
|
544
|
+
}
|
|
545
|
+
export interface Group {
|
|
546
|
+
groupInfo: GroupInfo;
|
|
547
|
+
members: GroupMember[];
|
|
548
|
+
}
|
|
223
549
|
export interface GroupInfo {
|
|
224
550
|
groupId: number;
|
|
225
551
|
localDisplayName: string;
|
|
@@ -235,6 +561,7 @@ export interface GroupProfile {
|
|
|
235
561
|
export interface GroupMember {
|
|
236
562
|
groupMemberId: number;
|
|
237
563
|
memberId: string;
|
|
564
|
+
memberRole: GroupMemberRole;
|
|
238
565
|
localDisplayName: string;
|
|
239
566
|
memberProfile: Profile;
|
|
240
567
|
memberContactId?: number;
|
|
@@ -260,7 +587,7 @@ export interface ChatItem {
|
|
|
260
587
|
formattedText?: FormattedText[];
|
|
261
588
|
quotedItem?: CIQuote;
|
|
262
589
|
}
|
|
263
|
-
export
|
|
590
|
+
export type CIDirection = CIDirectSnd | CIDirectRcv | CIGroupSnd | CIGroupRcv;
|
|
264
591
|
interface ICIDirection {
|
|
265
592
|
type: "directSnd" | "directRcv" | "groupSnd" | "groupRcv";
|
|
266
593
|
}
|
|
@@ -287,7 +614,7 @@ export interface CIMeta {
|
|
|
287
614
|
itemEdited: boolean;
|
|
288
615
|
editable: boolean;
|
|
289
616
|
}
|
|
290
|
-
export
|
|
617
|
+
export type CIContent = CISndMsgContent | CIRcvMsgContent | CISndDeleted | CIRcvDeleted | CISndFileInvitation | CIRcvFileInvitation;
|
|
291
618
|
interface ICIContent {
|
|
292
619
|
type: "sndMsgContent" | "rcvMsgContent" | "sndDeleted" | "rcvDeleted" | "sndFileInvitation" | "rcvFileInvitation";
|
|
293
620
|
}
|
|
@@ -318,6 +645,36 @@ interface CIRcvFileInvitation extends ICIContent {
|
|
|
318
645
|
}
|
|
319
646
|
export declare function ciContentText(content: CIContent): string | undefined;
|
|
320
647
|
interface RcvFileTransfer {
|
|
648
|
+
fileId: number;
|
|
649
|
+
senderDisplayName: string;
|
|
650
|
+
chunkSize: number;
|
|
651
|
+
cancelled: boolean;
|
|
652
|
+
grpMemberId?: number;
|
|
653
|
+
}
|
|
654
|
+
interface SndFileTransfer {
|
|
655
|
+
fileId: number;
|
|
656
|
+
fileName: string;
|
|
657
|
+
filePath: string;
|
|
658
|
+
fileSize: number;
|
|
659
|
+
chunkSize: number;
|
|
660
|
+
recipientDisplayName: string;
|
|
661
|
+
connId: number;
|
|
662
|
+
}
|
|
663
|
+
interface FileTransferMeta {
|
|
664
|
+
fileId: number;
|
|
665
|
+
fileName: string;
|
|
666
|
+
filePath: string;
|
|
667
|
+
fileSize: number;
|
|
668
|
+
chunkSize: number;
|
|
669
|
+
cancelled: boolean;
|
|
670
|
+
}
|
|
671
|
+
interface UserContactLink {
|
|
672
|
+
connReqContact: string;
|
|
673
|
+
autoAccept?: AutoAccept;
|
|
674
|
+
}
|
|
675
|
+
interface AutoAccept {
|
|
676
|
+
acceptIncognito: boolean;
|
|
677
|
+
autoReply?: MsgContent;
|
|
321
678
|
}
|
|
322
679
|
export interface ChatStats {
|
|
323
680
|
unreadCount: number;
|
|
@@ -331,7 +688,7 @@ export interface CIQuote {
|
|
|
331
688
|
content: MsgContent;
|
|
332
689
|
formattedText?: FormattedText[];
|
|
333
690
|
}
|
|
334
|
-
export
|
|
691
|
+
export type CIStatus = CISndNew | CISndSent | CISndErrorAuth | CISndError | CIRcvNew | CIRcvRead;
|
|
335
692
|
interface ICIStatus {
|
|
336
693
|
type: "sndNew" | "sndSent" | "sndErrorAuth" | "sndError" | "rcvNew" | "rcvRead";
|
|
337
694
|
}
|
|
@@ -358,7 +715,7 @@ interface FormattedText {
|
|
|
358
715
|
}
|
|
359
716
|
interface MsgErrorType {
|
|
360
717
|
}
|
|
361
|
-
export
|
|
718
|
+
export type ChatError = ChatErrorChat | ChatErrorAgent | ChatErrorStore;
|
|
362
719
|
interface ChatErrorChat {
|
|
363
720
|
type: "error";
|
|
364
721
|
errorType: ChatErrorType;
|
|
@@ -371,7 +728,7 @@ interface ChatErrorStore {
|
|
|
371
728
|
type: "errorStore";
|
|
372
729
|
storeError: StoreErrorType;
|
|
373
730
|
}
|
|
374
|
-
|
|
731
|
+
type ChatErrorType = CENoActiveUser | CEActiveUserExists;
|
|
375
732
|
interface CENoActiveUser {
|
|
376
733
|
type: "noActiveUser";
|
|
377
734
|
}
|
|
@@ -382,6 +739,16 @@ interface ContactSubStatus {
|
|
|
382
739
|
}
|
|
383
740
|
interface PendingSubStatus {
|
|
384
741
|
}
|
|
742
|
+
export interface ConnectionStats {
|
|
743
|
+
rcvServers?: string[];
|
|
744
|
+
sndServers?: string[];
|
|
745
|
+
}
|
|
746
|
+
interface PendingContactConnection {
|
|
747
|
+
}
|
|
748
|
+
interface MemberSubStatus {
|
|
749
|
+
member: GroupMember;
|
|
750
|
+
memberError?: ChatError;
|
|
751
|
+
}
|
|
385
752
|
interface AgentErrorType {
|
|
386
753
|
type: string;
|
|
387
754
|
[x: string]: any;
|
package/dist/response.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response.js","sourceRoot":"","sources":["../src/response.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"response.js","sourceRoot":"","sources":["../src/response.ts"],"names":[],"mappings":";;;AAsxBA,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,+BAAe,CAAA;IACf,iDAAiC,CAAA;AACnC,CAAC,EAJW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAIvB;AA4KD,SAAgB,aAAa,CAAC,OAAkB;IAC9C,QAAQ,OAAO,CAAC,IAAI,EAAE;QACpB,KAAK,eAAe;YAClB,OAAO,OAAO,CAAC,UAAU,CAAC,IAAI,CAAA;QAChC,KAAK,eAAe;YAClB,OAAO,OAAO,CAAC,UAAU,CAAC,IAAI,CAAA;QAChC;YACE,OAAO,SAAS,CAAA;KACnB;AACH,CAAC;AATD,sCASC"}
|
package/dist/transport.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export declare abstract class Transport<W, R> {
|
|
|
11
11
|
read(): Promise<R>;
|
|
12
12
|
next(): Promise<NextIter<R>>;
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
type WSData = Uint8Array | string;
|
|
15
15
|
export declare class WSTransport extends Transport<WSData, WSData> {
|
|
16
16
|
private readonly sock;
|
|
17
17
|
readonly timeout: number;
|