wuzapi 1.0.1 → 1.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 +722 -1
- package/dist/client.d.ts +16 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +308 -1
- package/dist/index.js.map +1 -1
- package/dist/modules/admin.d.ts +16 -0
- package/dist/modules/chat.d.ts +68 -0
- package/dist/modules/group.d.ts +40 -0
- package/dist/modules/session.d.ts +43 -0
- package/dist/modules/user.d.ts +20 -0
- package/dist/modules/webhook.d.ts +12 -0
- package/dist/types/admin.d.ts +27 -0
- package/dist/types/chat.d.ts +94 -0
- package/dist/types/common.d.ts +29 -0
- package/dist/types/events.d.ts +557 -0
- package/dist/types/group.d.ts +76 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/message.d.ts +799 -0
- package/dist/types/session.d.ts +32 -0
- package/dist/types/user.d.ts +55 -0
- package/dist/types/webhook.d.ts +10 -0
- package/dist/vite-env.d.ts +1 -0
- package/dist/wuzapi-client.d.ts +22 -0
- package/package.json +4 -3
|
@@ -0,0 +1,557 @@
|
|
|
1
|
+
import { Message } from './message.js';
|
|
2
|
+
export interface WaBinaryNode {
|
|
3
|
+
Tag: string;
|
|
4
|
+
Attrs: Record<string, string>;
|
|
5
|
+
Content: unknown;
|
|
6
|
+
}
|
|
7
|
+
export interface SyncAction {
|
|
8
|
+
timestamp: Date;
|
|
9
|
+
action: unknown;
|
|
10
|
+
}
|
|
11
|
+
export interface StarAction extends SyncAction {
|
|
12
|
+
starred: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface ArchiveAction extends SyncAction {
|
|
15
|
+
archived: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface ClearChatAction extends SyncAction {
|
|
18
|
+
messageRange?: {
|
|
19
|
+
lastMessageTimestamp?: Date;
|
|
20
|
+
lastSystemMessageTimestamp?: Date;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export interface DeleteChatAction extends SyncAction {
|
|
24
|
+
}
|
|
25
|
+
export interface DeleteMessageForMeAction extends SyncAction {
|
|
26
|
+
}
|
|
27
|
+
export interface MarkChatAsReadAction extends SyncAction {
|
|
28
|
+
read: boolean;
|
|
29
|
+
messageRange?: {
|
|
30
|
+
lastMessageTimestamp?: Date;
|
|
31
|
+
lastSystemMessageTimestamp?: Date;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export interface MuteAction extends SyncAction {
|
|
35
|
+
muted: boolean;
|
|
36
|
+
muteEndTimestamp?: Date;
|
|
37
|
+
}
|
|
38
|
+
export interface PinAction extends SyncAction {
|
|
39
|
+
pinned: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface PushNameSettingAction extends SyncAction {
|
|
42
|
+
name: string;
|
|
43
|
+
}
|
|
44
|
+
export interface UnarchiveChatsSettingAction extends SyncAction {
|
|
45
|
+
unarchiveChats: boolean;
|
|
46
|
+
}
|
|
47
|
+
export interface LabelAssociationAction extends SyncAction {
|
|
48
|
+
labeled: boolean;
|
|
49
|
+
}
|
|
50
|
+
export interface LabelEditAction extends SyncAction {
|
|
51
|
+
name: string;
|
|
52
|
+
color: number;
|
|
53
|
+
predefinedId?: string;
|
|
54
|
+
deleted: boolean;
|
|
55
|
+
}
|
|
56
|
+
export interface BusinessNameAction extends SyncAction {
|
|
57
|
+
businessName: string;
|
|
58
|
+
verified: number;
|
|
59
|
+
}
|
|
60
|
+
export interface UserStatusMuteAction extends SyncAction {
|
|
61
|
+
muted: boolean;
|
|
62
|
+
}
|
|
63
|
+
export interface Armadillo {
|
|
64
|
+
payload?: unknown;
|
|
65
|
+
}
|
|
66
|
+
export interface ConsumerApplication {
|
|
67
|
+
metadata?: unknown;
|
|
68
|
+
}
|
|
69
|
+
export interface BasicCallMeta {
|
|
70
|
+
from: JID;
|
|
71
|
+
timestamp: Date;
|
|
72
|
+
callId: string;
|
|
73
|
+
callCreator: JID;
|
|
74
|
+
}
|
|
75
|
+
export interface CallRemoteMeta {
|
|
76
|
+
remoteJid: JID;
|
|
77
|
+
fromMe: boolean;
|
|
78
|
+
}
|
|
79
|
+
export interface EventGroupParticipant {
|
|
80
|
+
JID: JID;
|
|
81
|
+
IsAdmin: boolean;
|
|
82
|
+
IsSuperAdmin: boolean;
|
|
83
|
+
}
|
|
84
|
+
export interface HistorySyncData {
|
|
85
|
+
conversations?: unknown[];
|
|
86
|
+
messages?: unknown[];
|
|
87
|
+
}
|
|
88
|
+
export interface JID {
|
|
89
|
+
User: string;
|
|
90
|
+
Agent: number;
|
|
91
|
+
Device: number;
|
|
92
|
+
Integrator: number;
|
|
93
|
+
Server: string;
|
|
94
|
+
AD: boolean;
|
|
95
|
+
}
|
|
96
|
+
export interface MessageInfo {
|
|
97
|
+
ID: string;
|
|
98
|
+
Type: string;
|
|
99
|
+
PushName: string;
|
|
100
|
+
Timestamp: Date;
|
|
101
|
+
Source: MessageSource;
|
|
102
|
+
DeviceSentMeta?: DeviceSentMeta;
|
|
103
|
+
ServerID?: number;
|
|
104
|
+
Status?: MessageStatus;
|
|
105
|
+
}
|
|
106
|
+
export interface MessageSource {
|
|
107
|
+
Chat: JID;
|
|
108
|
+
Sender: JID;
|
|
109
|
+
IsFromMe: boolean;
|
|
110
|
+
IsGroup: boolean;
|
|
111
|
+
BroadcastListOwner?: JID;
|
|
112
|
+
}
|
|
113
|
+
export interface DeviceSentMeta {
|
|
114
|
+
DestinationJID: string;
|
|
115
|
+
Phash: string;
|
|
116
|
+
}
|
|
117
|
+
export declare enum MessageStatus {
|
|
118
|
+
ERROR = "ERROR",
|
|
119
|
+
PENDING = "PENDING",
|
|
120
|
+
SERVER_ACK = "SERVER_ACK",
|
|
121
|
+
DELIVERY_ACK = "DELIVERY_ACK",
|
|
122
|
+
READ = "READ",
|
|
123
|
+
PLAYED = "PLAYED"
|
|
124
|
+
}
|
|
125
|
+
export declare enum ReceiptType {
|
|
126
|
+
UNKNOWN = "",
|
|
127
|
+
DELIVERY = "delivery",
|
|
128
|
+
READ = "read",
|
|
129
|
+
READ_SELF = "read-self",
|
|
130
|
+
PLAYED = "played",
|
|
131
|
+
SENDER = "sender",
|
|
132
|
+
INACTIVE = "inactive",
|
|
133
|
+
PEER_MSG = "peer_msg"
|
|
134
|
+
}
|
|
135
|
+
export declare enum DecryptFailMode {
|
|
136
|
+
UNAVAILABLE = "unavailable",
|
|
137
|
+
DECRYPT_FAIL = "decrypt_fail"
|
|
138
|
+
}
|
|
139
|
+
export declare enum UnavailableType {
|
|
140
|
+
UNKNOWN = "",
|
|
141
|
+
VIEW_ONCE = "view_once"
|
|
142
|
+
}
|
|
143
|
+
export declare enum ConnectFailureReason {
|
|
144
|
+
SOCKET_OPEN_TIMEOUT = 4001,
|
|
145
|
+
SOCKET_PING_TIMEOUT = 4002,
|
|
146
|
+
SOCKET_PONG_TIMEOUT = 4003,
|
|
147
|
+
UNKNOWN_LOGOUT = 4004,
|
|
148
|
+
BAD_MAC = 4005,
|
|
149
|
+
INIT_TIMEOUT = 4006,
|
|
150
|
+
MULTI_DEVICE_MISMATCH = 4007,
|
|
151
|
+
MULTI_DEVICE_DISABLED = 4008,
|
|
152
|
+
TEMP_BANNED = 4009,
|
|
153
|
+
CLIENT_OUTDATED = 4010,
|
|
154
|
+
STREAM_ERROR = 4011,
|
|
155
|
+
DEVICE_GONE = 4012,
|
|
156
|
+
IDENTITY_MISSING = 4013,
|
|
157
|
+
RATE_LIMIT_HIT = 4014,
|
|
158
|
+
MAIN_DEVICE_GONE = 4015
|
|
159
|
+
}
|
|
160
|
+
export declare enum TempBanReason {
|
|
161
|
+
SENT_TO_TOO_MANY_PEOPLE = 101,
|
|
162
|
+
BLOCKED_BY_USERS = 102,
|
|
163
|
+
CREATED_TOO_MANY_GROUPS = 103,
|
|
164
|
+
SENT_TOO_MANY_SAME_MESSAGE = 104,
|
|
165
|
+
BROADCAST_LIST = 106
|
|
166
|
+
}
|
|
167
|
+
export interface AppState {
|
|
168
|
+
name: string;
|
|
169
|
+
version: number;
|
|
170
|
+
hash: string[];
|
|
171
|
+
}
|
|
172
|
+
export interface AppStateSyncComplete {
|
|
173
|
+
name: string;
|
|
174
|
+
}
|
|
175
|
+
export interface Archive {
|
|
176
|
+
JID: JID;
|
|
177
|
+
Timestamp: Date;
|
|
178
|
+
Action: ArchiveAction;
|
|
179
|
+
FromFullSync: boolean;
|
|
180
|
+
}
|
|
181
|
+
export interface Blocklist {
|
|
182
|
+
JID: JID;
|
|
183
|
+
action: string;
|
|
184
|
+
dhash: string;
|
|
185
|
+
}
|
|
186
|
+
export interface BlocklistAction {
|
|
187
|
+
action: string;
|
|
188
|
+
}
|
|
189
|
+
export interface BlocklistChange {
|
|
190
|
+
JID: JID;
|
|
191
|
+
action: BlocklistChangeAction;
|
|
192
|
+
}
|
|
193
|
+
export interface BlocklistChangeAction {
|
|
194
|
+
action: string;
|
|
195
|
+
}
|
|
196
|
+
export interface BusinessName {
|
|
197
|
+
BusinessJID: JID;
|
|
198
|
+
PushName: string;
|
|
199
|
+
VerifiedName: string;
|
|
200
|
+
VerifiedLevel: string;
|
|
201
|
+
Action: BusinessNameAction;
|
|
202
|
+
FromFullSync: boolean;
|
|
203
|
+
}
|
|
204
|
+
export interface CATRefreshError {
|
|
205
|
+
code: string;
|
|
206
|
+
text: string;
|
|
207
|
+
}
|
|
208
|
+
export interface CallAccept {
|
|
209
|
+
BasicCallMeta: BasicCallMeta;
|
|
210
|
+
}
|
|
211
|
+
export interface CallOffer {
|
|
212
|
+
BasicCallMeta: BasicCallMeta;
|
|
213
|
+
CallRemoteMeta: CallRemoteMeta;
|
|
214
|
+
Data: string;
|
|
215
|
+
}
|
|
216
|
+
export interface CallOfferNotice {
|
|
217
|
+
BasicCallMeta: BasicCallMeta;
|
|
218
|
+
Media: string;
|
|
219
|
+
Type: string;
|
|
220
|
+
Data: string;
|
|
221
|
+
}
|
|
222
|
+
export interface CallPreAccept {
|
|
223
|
+
BasicCallMeta: BasicCallMeta;
|
|
224
|
+
CallRemoteMeta: CallRemoteMeta;
|
|
225
|
+
}
|
|
226
|
+
export interface CallReject {
|
|
227
|
+
BasicCallMeta: BasicCallMeta;
|
|
228
|
+
}
|
|
229
|
+
export interface CallRelayLatency {
|
|
230
|
+
BasicCallMeta: BasicCallMeta;
|
|
231
|
+
Latency: number;
|
|
232
|
+
}
|
|
233
|
+
export interface CallTerminate {
|
|
234
|
+
BasicCallMeta: BasicCallMeta;
|
|
235
|
+
Reason: string;
|
|
236
|
+
}
|
|
237
|
+
export interface CallTransport {
|
|
238
|
+
BasicCallMeta: BasicCallMeta;
|
|
239
|
+
}
|
|
240
|
+
export interface ChatPresence {
|
|
241
|
+
MessageSource: MessageSource;
|
|
242
|
+
State: string;
|
|
243
|
+
Media: string;
|
|
244
|
+
}
|
|
245
|
+
export interface ClearChat {
|
|
246
|
+
ChatJID: JID;
|
|
247
|
+
Timestamp: Date;
|
|
248
|
+
Action: ClearChatAction;
|
|
249
|
+
FromFullSync: boolean;
|
|
250
|
+
}
|
|
251
|
+
export interface ClientOutdated {
|
|
252
|
+
}
|
|
253
|
+
export interface ConnectFailure {
|
|
254
|
+
Reason: ConnectFailureReason;
|
|
255
|
+
Raw: WaBinaryNode;
|
|
256
|
+
}
|
|
257
|
+
export interface Connected {
|
|
258
|
+
}
|
|
259
|
+
export interface EventContact {
|
|
260
|
+
JID: JID;
|
|
261
|
+
Found: boolean;
|
|
262
|
+
FirstName: string;
|
|
263
|
+
FullName: string;
|
|
264
|
+
PushName: string;
|
|
265
|
+
BusinessName: string;
|
|
266
|
+
}
|
|
267
|
+
export interface DeleteChat {
|
|
268
|
+
ChatJID: JID;
|
|
269
|
+
Timestamp: Date;
|
|
270
|
+
Action: DeleteChatAction;
|
|
271
|
+
FromFullSync: boolean;
|
|
272
|
+
}
|
|
273
|
+
export interface DeleteForMe {
|
|
274
|
+
ChatJID: JID;
|
|
275
|
+
SenderJID: JID;
|
|
276
|
+
IsFromMe: boolean;
|
|
277
|
+
MessageID: string;
|
|
278
|
+
Timestamp: Date;
|
|
279
|
+
Action: DeleteMessageForMeAction;
|
|
280
|
+
FromFullSync: boolean;
|
|
281
|
+
}
|
|
282
|
+
export interface Disconnected {
|
|
283
|
+
}
|
|
284
|
+
export interface FBMessage {
|
|
285
|
+
Info: MessageInfo;
|
|
286
|
+
IsEphemeral: boolean;
|
|
287
|
+
IsViewOnce: boolean;
|
|
288
|
+
IsDocumentWithCaption: boolean;
|
|
289
|
+
IsEdit: boolean;
|
|
290
|
+
Message: Armadillo;
|
|
291
|
+
}
|
|
292
|
+
export interface EventGroupInfo {
|
|
293
|
+
JID: JID;
|
|
294
|
+
GroupName: string;
|
|
295
|
+
GroupTopic: string;
|
|
296
|
+
GroupLocked: boolean;
|
|
297
|
+
GroupAnnounce: boolean;
|
|
298
|
+
GroupEphemeral: boolean;
|
|
299
|
+
GroupParent?: JID;
|
|
300
|
+
GroupLinkedParent?: JID;
|
|
301
|
+
GroupIsDefaultSub: boolean;
|
|
302
|
+
GroupCreated: Date;
|
|
303
|
+
ParticipantVersionID: string;
|
|
304
|
+
Participants: EventGroupParticipant[];
|
|
305
|
+
PendingParticipants: EventGroupParticipant[];
|
|
306
|
+
JoinedAt: Date;
|
|
307
|
+
CreateKey: string;
|
|
308
|
+
Sender: JID;
|
|
309
|
+
Timestamp: Date;
|
|
310
|
+
}
|
|
311
|
+
export interface HistorySync {
|
|
312
|
+
Data: HistorySyncData;
|
|
313
|
+
}
|
|
314
|
+
export interface IdentityChange {
|
|
315
|
+
JID: JID;
|
|
316
|
+
Timestamp: Date;
|
|
317
|
+
Implicit: boolean;
|
|
318
|
+
}
|
|
319
|
+
export interface JoinedGroup {
|
|
320
|
+
Reason: string;
|
|
321
|
+
Type: string;
|
|
322
|
+
CreateKey: string;
|
|
323
|
+
Participants: EventGroupParticipant[];
|
|
324
|
+
}
|
|
325
|
+
export interface KeepAliveRestored {
|
|
326
|
+
}
|
|
327
|
+
export interface KeepAliveTimeout {
|
|
328
|
+
}
|
|
329
|
+
export interface LabelAssociationChat {
|
|
330
|
+
ChatJID: JID;
|
|
331
|
+
LabelID: string;
|
|
332
|
+
Labeled: boolean;
|
|
333
|
+
Timestamp: Date;
|
|
334
|
+
Action: LabelAssociationAction;
|
|
335
|
+
FromFullSync: boolean;
|
|
336
|
+
}
|
|
337
|
+
export interface LabelAssociationMessage {
|
|
338
|
+
ChatJID: JID;
|
|
339
|
+
SenderJID: JID;
|
|
340
|
+
IsFromMe: boolean;
|
|
341
|
+
MessageID: string;
|
|
342
|
+
LabelID: string;
|
|
343
|
+
Labeled: boolean;
|
|
344
|
+
Timestamp: Date;
|
|
345
|
+
Action: LabelAssociationAction;
|
|
346
|
+
FromFullSync: boolean;
|
|
347
|
+
}
|
|
348
|
+
export interface LabelEdit {
|
|
349
|
+
ID: string;
|
|
350
|
+
Name: string;
|
|
351
|
+
Color: number;
|
|
352
|
+
Deleted: boolean;
|
|
353
|
+
Timestamp: Date;
|
|
354
|
+
Action: LabelEditAction;
|
|
355
|
+
FromFullSync: boolean;
|
|
356
|
+
}
|
|
357
|
+
export interface LoggedOut {
|
|
358
|
+
OnConnect: boolean;
|
|
359
|
+
Reason: string;
|
|
360
|
+
}
|
|
361
|
+
export interface ManualLoginReconnect {
|
|
362
|
+
}
|
|
363
|
+
export interface MarkChatAsRead {
|
|
364
|
+
ChatJID: JID;
|
|
365
|
+
Timestamp: Date;
|
|
366
|
+
Action: MarkChatAsReadAction;
|
|
367
|
+
FromFullSync: boolean;
|
|
368
|
+
}
|
|
369
|
+
export interface MediaRetry {
|
|
370
|
+
MessageID: string;
|
|
371
|
+
ChatJID: JID;
|
|
372
|
+
SenderJID: JID;
|
|
373
|
+
IsFromMe: boolean;
|
|
374
|
+
Timestamp: Date;
|
|
375
|
+
}
|
|
376
|
+
export interface MediaRetryError {
|
|
377
|
+
MessageID: string;
|
|
378
|
+
ChatJID: JID;
|
|
379
|
+
SenderJID: JID;
|
|
380
|
+
IsFromMe: boolean;
|
|
381
|
+
Timestamp: Date;
|
|
382
|
+
Error: string;
|
|
383
|
+
}
|
|
384
|
+
export interface MessageEvent {
|
|
385
|
+
Info: MessageInfo;
|
|
386
|
+
Message: Message;
|
|
387
|
+
IsEphemeral: boolean;
|
|
388
|
+
IsViewOnce: boolean;
|
|
389
|
+
IsDocumentWithCaption: boolean;
|
|
390
|
+
IsEdit: boolean;
|
|
391
|
+
RawMessage: WaBinaryNode;
|
|
392
|
+
}
|
|
393
|
+
export interface Mute {
|
|
394
|
+
ChatJID: JID;
|
|
395
|
+
Timestamp: Date;
|
|
396
|
+
Action: MuteAction;
|
|
397
|
+
FromFullSync: boolean;
|
|
398
|
+
}
|
|
399
|
+
export interface NewsletterJoin {
|
|
400
|
+
ID: JID;
|
|
401
|
+
NewsletterMeta: {
|
|
402
|
+
name: string;
|
|
403
|
+
description?: string;
|
|
404
|
+
invite?: string;
|
|
405
|
+
creationTime?: Date;
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
export interface NewsletterLeave {
|
|
409
|
+
ID: JID;
|
|
410
|
+
}
|
|
411
|
+
export interface NewsletterLiveUpdate {
|
|
412
|
+
ID: JID;
|
|
413
|
+
Time: Date;
|
|
414
|
+
Messages: unknown[];
|
|
415
|
+
}
|
|
416
|
+
export interface NewsletterMessageMeta {
|
|
417
|
+
ID: JID;
|
|
418
|
+
MessageServerID: number;
|
|
419
|
+
MessageID: string;
|
|
420
|
+
ReactionCounts: Record<string, number>;
|
|
421
|
+
Views: number;
|
|
422
|
+
}
|
|
423
|
+
export interface NewsletterMuteChange {
|
|
424
|
+
ID: JID;
|
|
425
|
+
Mute: string;
|
|
426
|
+
}
|
|
427
|
+
export interface OfflineSyncCompleted {
|
|
428
|
+
Count: number;
|
|
429
|
+
}
|
|
430
|
+
export interface OfflineSyncPreview {
|
|
431
|
+
Messages: unknown[];
|
|
432
|
+
IsLatest: boolean;
|
|
433
|
+
}
|
|
434
|
+
export interface PairError {
|
|
435
|
+
ID: string;
|
|
436
|
+
Error: string;
|
|
437
|
+
}
|
|
438
|
+
export interface PairSuccess {
|
|
439
|
+
ID: string;
|
|
440
|
+
BusinessName: string;
|
|
441
|
+
Platform: string;
|
|
442
|
+
}
|
|
443
|
+
export interface PermanentDisconnect {
|
|
444
|
+
}
|
|
445
|
+
export interface Picture {
|
|
446
|
+
JID: JID;
|
|
447
|
+
Author: JID;
|
|
448
|
+
Timestamp: Date;
|
|
449
|
+
Remove: boolean;
|
|
450
|
+
NewPicture?: {
|
|
451
|
+
id: string;
|
|
452
|
+
type: string;
|
|
453
|
+
directPath: string;
|
|
454
|
+
};
|
|
455
|
+
OldPicture?: {
|
|
456
|
+
id: string;
|
|
457
|
+
type: string;
|
|
458
|
+
directPath: string;
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
export interface Pin {
|
|
462
|
+
ChatJID: JID;
|
|
463
|
+
SenderJID: JID;
|
|
464
|
+
IsFromMe: boolean;
|
|
465
|
+
MessageID: string;
|
|
466
|
+
Timestamp: Date;
|
|
467
|
+
Action: PinAction;
|
|
468
|
+
FromFullSync: boolean;
|
|
469
|
+
}
|
|
470
|
+
export interface Presence {
|
|
471
|
+
From: JID;
|
|
472
|
+
Unavailable: boolean;
|
|
473
|
+
LastSeen: Date;
|
|
474
|
+
}
|
|
475
|
+
export interface PrivacySettings {
|
|
476
|
+
GroupAddChanged: boolean;
|
|
477
|
+
LastSeenChanged: boolean;
|
|
478
|
+
StatusChanged: boolean;
|
|
479
|
+
ProfileChanged: boolean;
|
|
480
|
+
ReadReceiptsChanged: boolean;
|
|
481
|
+
OnlineChanged: boolean;
|
|
482
|
+
CallAddChanged: boolean;
|
|
483
|
+
}
|
|
484
|
+
export interface PushName {
|
|
485
|
+
JID: JID;
|
|
486
|
+
Message: MessageInfo;
|
|
487
|
+
OldPushName: string;
|
|
488
|
+
NewPushName: string;
|
|
489
|
+
}
|
|
490
|
+
export interface PushNameSetting {
|
|
491
|
+
Timestamp: Date;
|
|
492
|
+
Action: PushNameSettingAction;
|
|
493
|
+
FromFullSync: boolean;
|
|
494
|
+
}
|
|
495
|
+
export interface QR {
|
|
496
|
+
Codes: string[];
|
|
497
|
+
}
|
|
498
|
+
export interface QRScannedWithoutMultidevice {
|
|
499
|
+
}
|
|
500
|
+
export interface Receipt {
|
|
501
|
+
MessageSource: MessageSource;
|
|
502
|
+
MessageIDs: string[];
|
|
503
|
+
Timestamp: Date;
|
|
504
|
+
Type: ReceiptType;
|
|
505
|
+
MessageSender: JID;
|
|
506
|
+
}
|
|
507
|
+
export interface Star {
|
|
508
|
+
ChatJID: JID;
|
|
509
|
+
SenderJID: JID;
|
|
510
|
+
IsFromMe: boolean;
|
|
511
|
+
MessageID: string;
|
|
512
|
+
Timestamp: Date;
|
|
513
|
+
Action: StarAction;
|
|
514
|
+
FromFullSync: boolean;
|
|
515
|
+
}
|
|
516
|
+
export interface StreamError {
|
|
517
|
+
Code: string;
|
|
518
|
+
Raw: WaBinaryNode;
|
|
519
|
+
}
|
|
520
|
+
export interface StreamReplaced {
|
|
521
|
+
}
|
|
522
|
+
export interface TemporaryBan {
|
|
523
|
+
Code: TempBanReason;
|
|
524
|
+
Expire: number;
|
|
525
|
+
}
|
|
526
|
+
export interface UnarchiveChatsSetting {
|
|
527
|
+
Timestamp: Date;
|
|
528
|
+
Action: UnarchiveChatsSettingAction;
|
|
529
|
+
FromFullSync: boolean;
|
|
530
|
+
}
|
|
531
|
+
export interface UndecryptableMessage {
|
|
532
|
+
Info: MessageInfo;
|
|
533
|
+
IsUnavailable: boolean;
|
|
534
|
+
UnavailableType: UnavailableType;
|
|
535
|
+
DecryptFailMode: DecryptFailMode;
|
|
536
|
+
}
|
|
537
|
+
export interface UnknownCallEvent {
|
|
538
|
+
Node: WaBinaryNode;
|
|
539
|
+
}
|
|
540
|
+
export interface UserAbout {
|
|
541
|
+
JID: JID;
|
|
542
|
+
Status: string;
|
|
543
|
+
Timestamp: Date;
|
|
544
|
+
}
|
|
545
|
+
export interface UserStatusMute {
|
|
546
|
+
JID: JID;
|
|
547
|
+
Timestamp: Date;
|
|
548
|
+
Action: UserStatusMuteAction;
|
|
549
|
+
FromFullSync: boolean;
|
|
550
|
+
}
|
|
551
|
+
export type WhatsAppEvent = AppState | AppStateSyncComplete | Archive | Blocklist | BlocklistAction | BlocklistChange | BusinessName | CATRefreshError | CallAccept | CallOffer | CallOfferNotice | CallPreAccept | CallReject | CallRelayLatency | CallTerminate | CallTransport | ChatPresence | ClearChat | ClientOutdated | ConnectFailure | Connected | EventContact | DeleteChat | DeleteForMe | Disconnected | FBMessage | EventGroupInfo | HistorySync | IdentityChange | JoinedGroup | KeepAliveRestored | KeepAliveTimeout | LabelAssociationChat | LabelAssociationMessage | LabelEdit | LoggedOut | ManualLoginReconnect | MarkChatAsRead | MediaRetry | MediaRetryError | MessageEvent | Mute | NewsletterJoin | NewsletterLeave | NewsletterLiveUpdate | NewsletterMessageMeta | NewsletterMuteChange | OfflineSyncCompleted | OfflineSyncPreview | PairError | PairSuccess | PermanentDisconnect | Picture | Pin | Presence | PrivacySettings | PushName | PushNameSetting | QR | QRScannedWithoutMultidevice | Receipt | Star | StreamError | StreamReplaced | TemporaryBan | UnarchiveChatsSetting | UndecryptableMessage | UnknownCallEvent | UserAbout | UserStatusMute;
|
|
552
|
+
export type EventHandler<T extends WhatsAppEvent = WhatsAppEvent> = (event: T) => void | Promise<void>;
|
|
553
|
+
export interface EventEmitter {
|
|
554
|
+
on<T extends WhatsAppEvent>(eventType: string, handler: EventHandler<T>): void;
|
|
555
|
+
off<T extends WhatsAppEvent>(eventType: string, handler: EventHandler<T>): void;
|
|
556
|
+
emit<T extends WhatsAppEvent>(eventType: string, event: T): void;
|
|
557
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
export interface GroupParticipant {
|
|
2
|
+
IsAdmin: boolean;
|
|
3
|
+
IsSuperAdmin: boolean;
|
|
4
|
+
JID: string;
|
|
5
|
+
}
|
|
6
|
+
export interface GroupInfo {
|
|
7
|
+
AnnounceVersionID: string;
|
|
8
|
+
DisappearingTimer: number;
|
|
9
|
+
GroupCreated: string;
|
|
10
|
+
IsAnnounce: boolean;
|
|
11
|
+
IsEphemeral: boolean;
|
|
12
|
+
IsLocked: boolean;
|
|
13
|
+
JID: string;
|
|
14
|
+
Name: string;
|
|
15
|
+
NameSetAt: string;
|
|
16
|
+
NameSetBy: string;
|
|
17
|
+
OwnerJID: string;
|
|
18
|
+
ParticipantVersionID: string;
|
|
19
|
+
Participants: GroupParticipant[];
|
|
20
|
+
Topic: string;
|
|
21
|
+
TopicID: string;
|
|
22
|
+
TopicSetAt: string;
|
|
23
|
+
TopicSetBy: string;
|
|
24
|
+
}
|
|
25
|
+
export interface GroupListResponse {
|
|
26
|
+
Groups: GroupInfo[];
|
|
27
|
+
}
|
|
28
|
+
export interface GroupInviteLinkRequest {
|
|
29
|
+
GroupJID: string;
|
|
30
|
+
}
|
|
31
|
+
export interface GroupInviteLinkResponse {
|
|
32
|
+
InviteLink: string;
|
|
33
|
+
}
|
|
34
|
+
export interface GroupInfoRequest {
|
|
35
|
+
GroupJID: string;
|
|
36
|
+
}
|
|
37
|
+
export interface GroupPhotoRequest {
|
|
38
|
+
GroupJID: string;
|
|
39
|
+
Image: string;
|
|
40
|
+
}
|
|
41
|
+
export interface GroupPhotoResponse {
|
|
42
|
+
Details: string;
|
|
43
|
+
PictureID: string;
|
|
44
|
+
}
|
|
45
|
+
export interface GroupNameRequest {
|
|
46
|
+
GroupJID: string;
|
|
47
|
+
Name: string;
|
|
48
|
+
}
|
|
49
|
+
export interface GroupNameResponse {
|
|
50
|
+
Details: string;
|
|
51
|
+
}
|
|
52
|
+
export interface GroupCreateRequest {
|
|
53
|
+
name: string;
|
|
54
|
+
participants: string[];
|
|
55
|
+
}
|
|
56
|
+
export type GroupCreateResponse = GroupInfo;
|
|
57
|
+
export interface GroupLockedRequest {
|
|
58
|
+
groupjid: string;
|
|
59
|
+
locked: boolean;
|
|
60
|
+
}
|
|
61
|
+
export interface GroupLockedResponse {
|
|
62
|
+
Details: string;
|
|
63
|
+
}
|
|
64
|
+
export interface GroupEphemeralRequest {
|
|
65
|
+
groupjid: string;
|
|
66
|
+
duration: "24h" | "7d" | "90d" | "off";
|
|
67
|
+
}
|
|
68
|
+
export interface GroupEphemeralResponse {
|
|
69
|
+
Details: string;
|
|
70
|
+
}
|
|
71
|
+
export interface GroupPhotoRemoveRequest {
|
|
72
|
+
groupjid: string;
|
|
73
|
+
}
|
|
74
|
+
export interface GroupPhotoRemoveResponse {
|
|
75
|
+
Details: string;
|
|
76
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './common.js';
|
|
2
|
+
export * from './admin.js';
|
|
3
|
+
export * from './session.js';
|
|
4
|
+
export * from './user.js';
|
|
5
|
+
export * from './chat.js';
|
|
6
|
+
export * from './group.js';
|
|
7
|
+
export * from './webhook.js';
|
|
8
|
+
export * from './message.js';
|
|
9
|
+
export * from './events.js';
|