@simplex-chat/types 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/events.d.ts +52 -48
- package/dist/responses.d.ts +55 -51
- package/package.json +4 -3
- package/src/commands.ts +693 -0
- package/src/events.ts +439 -0
- package/src/index.ts +4 -0
- package/src/responses.ts +423 -0
- package/src/types.ts +4587 -0
package/dist/responses.d.ts
CHANGED
|
@@ -1,265 +1,269 @@
|
|
|
1
1
|
import * as T from "./types";
|
|
2
|
-
export type ChatResponse = CR.AcceptingContactRequest | CR.ActiveUser | CR.ChatItemNotChanged | CR.ChatItemReaction | CR.ChatItemUpdated | CR.ChatItemsDeleted | CR.ChatRunning | CR.ChatStarted | CR.ChatStopped | CR.CmdOk | CR.ChatCmdError | CR.ConnectionPlan | CR.ContactAlreadyExists | CR.ContactConnectionDeleted | CR.ContactDeleted | CR.ContactPrefsUpdated | CR.ContactRequestRejected | CR.ContactsList | CR.GroupDeletedUser | CR.GroupLink | CR.GroupLinkCreated | CR.GroupLinkDeleted | CR.GroupCreated | CR.GroupMembers | CR.GroupUpdated | CR.GroupsList | CR.Invitation | CR.LeftMemberUser | CR.MemberAccepted | CR.MembersBlockedForAllUser | CR.MembersRoleUser | CR.NewChatItems | CR.RcvFileAccepted | CR.RcvFileAcceptedSndCancelled | CR.RcvFileCancelled | CR.SentConfirmation | CR.SentGroupInvitation | CR.SentInvitation | CR.SndFileCancelled | CR.UserAcceptedGroupSent | CR.UserContactLink | CR.UserContactLinkCreated | CR.UserContactLinkDeleted | CR.UserContactLinkUpdated | CR.UserDeletedMembers | CR.UserProfileUpdated | CR.UserProfileNoChange | CR.UsersList;
|
|
2
|
+
export type ChatResponse = CR.AcceptingContactRequest | CR.ActiveUser | CR.ChatItemNotChanged | CR.ChatItemReaction | CR.ChatItemUpdated | CR.ChatItemsDeleted | CR.ChatRunning | CR.ChatStarted | CR.ChatStopped | CR.CmdOk | CR.ChatCmdError | CR.ConnectionPlan | CR.ContactAlreadyExists | CR.ContactConnectionDeleted | CR.ContactDeleted | CR.ContactPrefsUpdated | CR.ContactRequestRejected | CR.ContactsList | CR.GroupDeletedUser | CR.GroupLink | CR.GroupLinkCreated | CR.GroupLinkDeleted | CR.GroupCreated | CR.GroupMembers | CR.GroupUpdated | CR.GroupsList | CR.Invitation | CR.LeftMemberUser | CR.MemberAccepted | CR.MembersBlockedForAllUser | CR.MembersRoleUser | CR.NewChatItems | CR.RcvFileAccepted | CR.RcvFileAcceptedSndCancelled | CR.RcvFileCancelled | CR.SentConfirmation | CR.SentGroupInvitation | CR.SentInvitation | CR.SndFileCancelled | CR.UserAcceptedGroupSent | CR.UserContactLink | CR.UserContactLinkCreated | CR.UserContactLinkDeleted | CR.UserContactLinkUpdated | CR.UserDeletedMembers | CR.UserProfileUpdated | CR.UserProfileNoChange | CR.UsersList | CR.Unkwnown;
|
|
3
3
|
export declare namespace CR {
|
|
4
|
-
|
|
4
|
+
type Tag = KnownTag | UnknownTag;
|
|
5
|
+
type KnownTag = "acceptingContactRequest" | "activeUser" | "chatItemNotChanged" | "chatItemReaction" | "chatItemUpdated" | "chatItemsDeleted" | "chatRunning" | "chatStarted" | "chatStopped" | "cmdOk" | "chatCmdError" | "connectionPlan" | "contactAlreadyExists" | "contactConnectionDeleted" | "contactDeleted" | "contactPrefsUpdated" | "contactRequestRejected" | "contactsList" | "groupDeletedUser" | "groupLink" | "groupLinkCreated" | "groupLinkDeleted" | "groupCreated" | "groupMembers" | "groupUpdated" | "groupsList" | "invitation" | "leftMemberUser" | "memberAccepted" | "membersBlockedForAllUser" | "membersRoleUser" | "newChatItems" | "rcvFileAccepted" | "rcvFileAcceptedSndCancelled" | "rcvFileCancelled" | "sentConfirmation" | "sentGroupInvitation" | "sentInvitation" | "sndFileCancelled" | "userAcceptedGroupSent" | "userContactLink" | "userContactLinkCreated" | "userContactLinkDeleted" | "userContactLinkUpdated" | "userDeletedMembers" | "userProfileUpdated" | "userProfileNoChange" | "usersList";
|
|
5
6
|
interface Interface {
|
|
6
7
|
type: Tag;
|
|
7
8
|
}
|
|
8
|
-
|
|
9
|
+
type UnknownTag = Exclude<string, KnownTag>;
|
|
10
|
+
interface AcceptingContactRequest extends Interface {
|
|
9
11
|
type: "acceptingContactRequest";
|
|
10
12
|
user: T.User;
|
|
11
13
|
contact: T.Contact;
|
|
12
14
|
}
|
|
13
|
-
|
|
15
|
+
interface ActiveUser extends Interface {
|
|
14
16
|
type: "activeUser";
|
|
15
17
|
user: T.User;
|
|
16
18
|
}
|
|
17
|
-
|
|
19
|
+
interface ChatItemNotChanged extends Interface {
|
|
18
20
|
type: "chatItemNotChanged";
|
|
19
21
|
user: T.User;
|
|
20
22
|
chatItem: T.AChatItem;
|
|
21
23
|
}
|
|
22
|
-
|
|
24
|
+
interface ChatItemReaction extends Interface {
|
|
23
25
|
type: "chatItemReaction";
|
|
24
26
|
user: T.User;
|
|
25
27
|
added: boolean;
|
|
26
28
|
reaction: T.ACIReaction;
|
|
27
29
|
}
|
|
28
|
-
|
|
30
|
+
interface ChatItemUpdated extends Interface {
|
|
29
31
|
type: "chatItemUpdated";
|
|
30
32
|
user: T.User;
|
|
31
33
|
chatItem: T.AChatItem;
|
|
32
34
|
}
|
|
33
|
-
|
|
35
|
+
interface ChatItemsDeleted extends Interface {
|
|
34
36
|
type: "chatItemsDeleted";
|
|
35
37
|
user: T.User;
|
|
36
38
|
chatItemDeletions: T.ChatItemDeletion[];
|
|
37
39
|
byUser: boolean;
|
|
38
40
|
timed: boolean;
|
|
39
41
|
}
|
|
40
|
-
|
|
42
|
+
interface ChatRunning extends Interface {
|
|
41
43
|
type: "chatRunning";
|
|
42
44
|
}
|
|
43
|
-
|
|
45
|
+
interface ChatStarted extends Interface {
|
|
44
46
|
type: "chatStarted";
|
|
45
47
|
}
|
|
46
|
-
|
|
48
|
+
interface ChatStopped extends Interface {
|
|
47
49
|
type: "chatStopped";
|
|
48
50
|
}
|
|
49
|
-
|
|
51
|
+
interface CmdOk extends Interface {
|
|
50
52
|
type: "cmdOk";
|
|
51
53
|
user_?: T.User;
|
|
52
54
|
}
|
|
53
|
-
|
|
55
|
+
interface ChatCmdError extends Interface {
|
|
54
56
|
type: "chatCmdError";
|
|
55
57
|
chatError: T.ChatError;
|
|
56
58
|
}
|
|
57
|
-
|
|
59
|
+
interface ConnectionPlan extends Interface {
|
|
58
60
|
type: "connectionPlan";
|
|
59
61
|
user: T.User;
|
|
60
62
|
connLink: T.CreatedConnLink;
|
|
61
63
|
connectionPlan: T.ConnectionPlan;
|
|
62
64
|
}
|
|
63
|
-
|
|
65
|
+
interface ContactAlreadyExists extends Interface {
|
|
64
66
|
type: "contactAlreadyExists";
|
|
65
67
|
user: T.User;
|
|
66
68
|
contact: T.Contact;
|
|
67
69
|
}
|
|
68
|
-
|
|
70
|
+
interface ContactConnectionDeleted extends Interface {
|
|
69
71
|
type: "contactConnectionDeleted";
|
|
70
72
|
user: T.User;
|
|
71
73
|
connection: T.PendingContactConnection;
|
|
72
74
|
}
|
|
73
|
-
|
|
75
|
+
interface ContactDeleted extends Interface {
|
|
74
76
|
type: "contactDeleted";
|
|
75
77
|
user: T.User;
|
|
76
78
|
contact: T.Contact;
|
|
77
79
|
}
|
|
78
|
-
|
|
80
|
+
interface ContactPrefsUpdated extends Interface {
|
|
79
81
|
type: "contactPrefsUpdated";
|
|
80
82
|
user: T.User;
|
|
81
83
|
fromContact: T.Contact;
|
|
82
84
|
toContact: T.Contact;
|
|
83
85
|
}
|
|
84
|
-
|
|
86
|
+
interface ContactRequestRejected extends Interface {
|
|
85
87
|
type: "contactRequestRejected";
|
|
86
88
|
user: T.User;
|
|
87
89
|
contactRequest: T.UserContactRequest;
|
|
88
90
|
contact_?: T.Contact;
|
|
89
91
|
}
|
|
90
|
-
|
|
92
|
+
interface ContactsList extends Interface {
|
|
91
93
|
type: "contactsList";
|
|
92
94
|
user: T.User;
|
|
93
95
|
contacts: T.Contact[];
|
|
94
96
|
}
|
|
95
|
-
|
|
97
|
+
interface GroupDeletedUser extends Interface {
|
|
96
98
|
type: "groupDeletedUser";
|
|
97
99
|
user: T.User;
|
|
98
100
|
groupInfo: T.GroupInfo;
|
|
99
101
|
}
|
|
100
|
-
|
|
102
|
+
interface GroupLink extends Interface {
|
|
101
103
|
type: "groupLink";
|
|
102
104
|
user: T.User;
|
|
103
105
|
groupInfo: T.GroupInfo;
|
|
104
106
|
groupLink: T.GroupLink;
|
|
105
107
|
}
|
|
106
|
-
|
|
108
|
+
interface GroupLinkCreated extends Interface {
|
|
107
109
|
type: "groupLinkCreated";
|
|
108
110
|
user: T.User;
|
|
109
111
|
groupInfo: T.GroupInfo;
|
|
110
112
|
groupLink: T.GroupLink;
|
|
111
113
|
}
|
|
112
|
-
|
|
114
|
+
interface GroupLinkDeleted extends Interface {
|
|
113
115
|
type: "groupLinkDeleted";
|
|
114
116
|
user: T.User;
|
|
115
117
|
groupInfo: T.GroupInfo;
|
|
116
118
|
}
|
|
117
|
-
|
|
119
|
+
interface GroupCreated extends Interface {
|
|
118
120
|
type: "groupCreated";
|
|
119
121
|
user: T.User;
|
|
120
122
|
groupInfo: T.GroupInfo;
|
|
121
123
|
}
|
|
122
|
-
|
|
124
|
+
interface GroupMembers extends Interface {
|
|
123
125
|
type: "groupMembers";
|
|
124
126
|
user: T.User;
|
|
125
127
|
group: T.Group;
|
|
126
128
|
}
|
|
127
|
-
|
|
129
|
+
interface GroupUpdated extends Interface {
|
|
128
130
|
type: "groupUpdated";
|
|
129
131
|
user: T.User;
|
|
130
132
|
fromGroup: T.GroupInfo;
|
|
131
133
|
toGroup: T.GroupInfo;
|
|
132
134
|
member_?: T.GroupMember;
|
|
133
135
|
}
|
|
134
|
-
|
|
136
|
+
interface GroupsList extends Interface {
|
|
135
137
|
type: "groupsList";
|
|
136
138
|
user: T.User;
|
|
137
139
|
groups: T.GroupInfo[];
|
|
138
140
|
}
|
|
139
|
-
|
|
141
|
+
interface Invitation extends Interface {
|
|
140
142
|
type: "invitation";
|
|
141
143
|
user: T.User;
|
|
142
144
|
connLinkInvitation: T.CreatedConnLink;
|
|
143
145
|
connection: T.PendingContactConnection;
|
|
144
146
|
}
|
|
145
|
-
|
|
147
|
+
interface LeftMemberUser extends Interface {
|
|
146
148
|
type: "leftMemberUser";
|
|
147
149
|
user: T.User;
|
|
148
150
|
groupInfo: T.GroupInfo;
|
|
149
151
|
}
|
|
150
|
-
|
|
152
|
+
interface MemberAccepted extends Interface {
|
|
151
153
|
type: "memberAccepted";
|
|
152
154
|
user: T.User;
|
|
153
155
|
groupInfo: T.GroupInfo;
|
|
154
156
|
member: T.GroupMember;
|
|
155
157
|
}
|
|
156
|
-
|
|
158
|
+
interface MembersBlockedForAllUser extends Interface {
|
|
157
159
|
type: "membersBlockedForAllUser";
|
|
158
160
|
user: T.User;
|
|
159
161
|
groupInfo: T.GroupInfo;
|
|
160
162
|
members: T.GroupMember[];
|
|
161
163
|
blocked: boolean;
|
|
162
164
|
}
|
|
163
|
-
|
|
165
|
+
interface MembersRoleUser extends Interface {
|
|
164
166
|
type: "membersRoleUser";
|
|
165
167
|
user: T.User;
|
|
166
168
|
groupInfo: T.GroupInfo;
|
|
167
169
|
members: T.GroupMember[];
|
|
168
170
|
toRole: T.GroupMemberRole;
|
|
169
171
|
}
|
|
170
|
-
|
|
172
|
+
interface NewChatItems extends Interface {
|
|
171
173
|
type: "newChatItems";
|
|
172
174
|
user: T.User;
|
|
173
175
|
chatItems: T.AChatItem[];
|
|
174
176
|
}
|
|
175
|
-
|
|
177
|
+
interface RcvFileAccepted extends Interface {
|
|
176
178
|
type: "rcvFileAccepted";
|
|
177
179
|
user: T.User;
|
|
178
180
|
chatItem: T.AChatItem;
|
|
179
181
|
}
|
|
180
|
-
|
|
182
|
+
interface RcvFileAcceptedSndCancelled extends Interface {
|
|
181
183
|
type: "rcvFileAcceptedSndCancelled";
|
|
182
184
|
user: T.User;
|
|
183
185
|
rcvFileTransfer: T.RcvFileTransfer;
|
|
184
186
|
}
|
|
185
|
-
|
|
187
|
+
interface RcvFileCancelled extends Interface {
|
|
186
188
|
type: "rcvFileCancelled";
|
|
187
189
|
user: T.User;
|
|
188
190
|
chatItem_?: T.AChatItem;
|
|
189
191
|
rcvFileTransfer: T.RcvFileTransfer;
|
|
190
192
|
}
|
|
191
|
-
|
|
193
|
+
interface SentConfirmation extends Interface {
|
|
192
194
|
type: "sentConfirmation";
|
|
193
195
|
user: T.User;
|
|
194
196
|
connection: T.PendingContactConnection;
|
|
195
197
|
customUserProfile?: T.Profile;
|
|
196
198
|
}
|
|
197
|
-
|
|
199
|
+
interface SentGroupInvitation extends Interface {
|
|
198
200
|
type: "sentGroupInvitation";
|
|
199
201
|
user: T.User;
|
|
200
202
|
groupInfo: T.GroupInfo;
|
|
201
203
|
contact: T.Contact;
|
|
202
204
|
member: T.GroupMember;
|
|
203
205
|
}
|
|
204
|
-
|
|
206
|
+
interface SentInvitation extends Interface {
|
|
205
207
|
type: "sentInvitation";
|
|
206
208
|
user: T.User;
|
|
207
209
|
connection: T.PendingContactConnection;
|
|
208
210
|
customUserProfile?: T.Profile;
|
|
209
211
|
}
|
|
210
|
-
|
|
212
|
+
interface SndFileCancelled extends Interface {
|
|
211
213
|
type: "sndFileCancelled";
|
|
212
214
|
user: T.User;
|
|
213
215
|
chatItem_?: T.AChatItem;
|
|
214
216
|
fileTransferMeta: T.FileTransferMeta;
|
|
215
217
|
sndFileTransfers: T.SndFileTransfer[];
|
|
216
218
|
}
|
|
217
|
-
|
|
219
|
+
interface UserAcceptedGroupSent extends Interface {
|
|
218
220
|
type: "userAcceptedGroupSent";
|
|
219
221
|
user: T.User;
|
|
220
222
|
groupInfo: T.GroupInfo;
|
|
221
223
|
hostContact?: T.Contact;
|
|
222
224
|
}
|
|
223
|
-
|
|
225
|
+
interface UserContactLink extends Interface {
|
|
224
226
|
type: "userContactLink";
|
|
225
227
|
user: T.User;
|
|
226
228
|
contactLink: T.UserContactLink;
|
|
227
229
|
}
|
|
228
|
-
|
|
230
|
+
interface UserContactLinkCreated extends Interface {
|
|
229
231
|
type: "userContactLinkCreated";
|
|
230
232
|
user: T.User;
|
|
231
233
|
connLinkContact: T.CreatedConnLink;
|
|
232
234
|
}
|
|
233
|
-
|
|
235
|
+
interface UserContactLinkDeleted extends Interface {
|
|
234
236
|
type: "userContactLinkDeleted";
|
|
235
237
|
user: T.User;
|
|
236
238
|
}
|
|
237
|
-
|
|
239
|
+
interface UserContactLinkUpdated extends Interface {
|
|
238
240
|
type: "userContactLinkUpdated";
|
|
239
241
|
user: T.User;
|
|
240
242
|
contactLink: T.UserContactLink;
|
|
241
243
|
}
|
|
242
|
-
|
|
244
|
+
interface UserDeletedMembers extends Interface {
|
|
243
245
|
type: "userDeletedMembers";
|
|
244
246
|
user: T.User;
|
|
245
247
|
groupInfo: T.GroupInfo;
|
|
246
248
|
members: T.GroupMember[];
|
|
247
249
|
withMessages: boolean;
|
|
248
250
|
}
|
|
249
|
-
|
|
251
|
+
interface UserProfileUpdated extends Interface {
|
|
250
252
|
type: "userProfileUpdated";
|
|
251
253
|
user: T.User;
|
|
252
254
|
fromProfile: T.Profile;
|
|
253
255
|
toProfile: T.Profile;
|
|
254
256
|
updateSummary: T.UserProfileUpdateSummary;
|
|
255
257
|
}
|
|
256
|
-
|
|
258
|
+
interface UserProfileNoChange extends Interface {
|
|
257
259
|
type: "userProfileNoChange";
|
|
258
260
|
user: T.User;
|
|
259
261
|
}
|
|
260
|
-
|
|
262
|
+
interface UsersList extends Interface {
|
|
261
263
|
type: "usersList";
|
|
262
264
|
users: T.UserInfo[];
|
|
263
265
|
}
|
|
264
|
-
|
|
266
|
+
interface Unkwnown extends Interface {
|
|
267
|
+
type: UnknownTag;
|
|
268
|
+
}
|
|
265
269
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simplex-chat/types",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "TypeScript types for SimpleX Chat bot libraries",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"files": [
|
|
8
|
-
"dist"
|
|
8
|
+
"dist",
|
|
9
|
+
"src"
|
|
9
10
|
],
|
|
10
11
|
"publishConfig": {
|
|
11
12
|
"access": "public",
|
|
@@ -35,7 +36,7 @@
|
|
|
35
36
|
"bugs": {
|
|
36
37
|
"url": "https://github.com/simplex-chat/simplex-chat/issues"
|
|
37
38
|
},
|
|
38
|
-
"homepage": "https://github.com/simplex-chat/simplex-chat#readme",
|
|
39
|
+
"homepage": "https://github.com/simplex-chat/simplex-chat/tree/stable/packages/simplex-chat-client/types/typescript#readme",
|
|
39
40
|
"dependencies": {
|
|
40
41
|
"typescript": "^5.9.2"
|
|
41
42
|
}
|