@oxidezap/whatsapp-rust-bridge 0.9.0 → 0.10.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/dist/index.js +2 -2
- package/dist/proto-types.d.ts +616 -4
- package/dist/whatsapp_rust_bridge.d.ts +108 -67
- package/dist/whatsapp_rust_bridge_bg.wasm +0 -0
- package/package.json +2 -2
|
@@ -91,10 +91,13 @@ export interface Jid {
|
|
|
91
91
|
integrator: number;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
+
/** Any JSON value, as `serde_json::Value` crosses. */
|
|
95
|
+
export type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue };
|
|
96
|
+
|
|
94
97
|
/** Addressing mode for a group (phone number vs LID). */
|
|
95
98
|
export type AddressingMode = "pn" | "lid";
|
|
96
99
|
|
|
97
|
-
/** A batched app-state sync finished without leaving every collection synced. Collections are named as they appear on the wire (`critical_block`, `regular_high`, …) rather than as an enum, so the payload stays stable if the set of collections changes. `fatal` is the one a consumer usually has to act on: the server refused the collection, and repeating the request gets the same answer. WhatsApp Web treats that as grounds to notify the primary device and log out; this library will not end a session on its own, so it reports the refusal and keeps the connection. When `connected` is true the client dispatched [`Event::Connected`] anyway and is usable, minus whatever those collections carry — for `critical_block` that includes the push name, so presence stays unavailable until it syncs. */
|
|
100
|
+
/** A batched app-state sync finished without leaving every collection synced. Collections are named as they appear on the wire (`critical_block`, `regular_high`, …) rather than as an enum, so the payload stays stable if the set of collections changes. `fatal` is the one a consumer usually has to act on: the server refused the collection, and repeating the request gets the same answer. WhatsApp Web treats that as grounds to notify the primary device and log out; this library will not end a session on its own, so it reports the refusal and keeps the connection. When `connected` is true the client dispatched [`Event::Connected`] anyway and is usable, minus whatever those collections carry — for `critical_block` that includes the push name, so presence stays unavailable until it syncs. The initial sync that follows pairing normally connects, so its report normally carries `connected: true`. A `false` means no [`Event::Connected`] accompanied this report: a sync that ran before the connection was ready, such as one a `syncd_app_state` dirty bit started while the offline backlog was still being processed, or an initial sync whose connection was paused, superseded or rejected by the server as it finished. */
|
|
98
101
|
export interface AppStateSyncFailed {
|
|
99
102
|
/** Refused outright by the server (400/404). Terminal for this connection. */
|
|
100
103
|
fatal: string[];
|
|
@@ -116,8 +119,8 @@ export interface AppStateSyncKey {
|
|
|
116
119
|
export interface ArchiveUpdate {
|
|
117
120
|
/** The chat being archived or unarchived. */
|
|
118
121
|
jid: Jid;
|
|
119
|
-
timestamp:
|
|
120
|
-
action:
|
|
122
|
+
timestamp: string;
|
|
123
|
+
action: import('./proto-types').proto.SyncActionValue.IArchiveChatAction;
|
|
121
124
|
from_full_sync: boolean;
|
|
122
125
|
}
|
|
123
126
|
|
|
@@ -263,6 +266,20 @@ export interface CallLinkPreview {
|
|
|
263
266
|
is_admin: boolean;
|
|
264
267
|
}
|
|
265
268
|
|
|
269
|
+
/** A call placed or received on the primary device, synced through app state. The only channel that carries a call the companion never saw signalling for: a call placed on the phone puts nothing on this socket, so [`Event::IncomingCall`] and friends cannot see it. */
|
|
270
|
+
export interface CallLogSync {
|
|
271
|
+
/** Who started the call, from the mutation's index. The index rather than the record: `record.call_creator_jid` is optional and WA Web leaves it unset for calls it received none for, while it fills the index in either way — falling back to this account for a call it placed, or to the peer for one it took. */
|
|
272
|
+
call_creator_jid: Jid;
|
|
273
|
+
/** The call's identifier, from the mutation's index (the same value `record.call_id` carries when the record carries one). */
|
|
274
|
+
call_id: string;
|
|
275
|
+
/** Whether *this account* placed the call. Read this rather than `record.is_incoming`, which despite its name holds the same thing rather than its opposite: WA Web writes the record with `isIncoming: fromMe`, so a consumer taking the field at its word files every call backwards. */
|
|
276
|
+
from_me: boolean;
|
|
277
|
+
/** When the mutation was written, not when the call happened — the call's own time is `record.start_time`. This is the field WA Web measures against the pairing timestamp to decide whether a record predates the device, so it is worth having; it is not a time to file the call under. A mutation that arrives without one falls back to the moment it was received, as every other app-state event does. */
|
|
278
|
+
timestamp: string;
|
|
279
|
+
record: import('./proto-types').proto.ICallLogRecord;
|
|
280
|
+
from_full_sync: boolean;
|
|
281
|
+
}
|
|
282
|
+
|
|
266
283
|
/** Meta Verified subscription state, which is what lifts the cap permanently. */
|
|
267
284
|
export type CappingMvStatus = "NOT_ELIGIBLE" | "NOT_ACTIVE" | "ACTIVE" | "ACTIVE_UPGRADE_AVAILABLE" | string;
|
|
268
285
|
|
|
@@ -299,8 +316,8 @@ export interface ClearChatUpdate {
|
|
|
299
316
|
delete_starred: boolean;
|
|
300
317
|
/** From the index, not the proto. */
|
|
301
318
|
delete_media: boolean;
|
|
302
|
-
timestamp:
|
|
303
|
-
action:
|
|
319
|
+
timestamp: string;
|
|
320
|
+
action: import('./proto-types').proto.SyncActionValue.IClearChatAction;
|
|
304
321
|
from_full_sync: boolean;
|
|
305
322
|
}
|
|
306
323
|
|
|
@@ -329,28 +346,28 @@ export interface ContactNumberChanged {
|
|
|
329
346
|
old_lid?: Jid | null;
|
|
330
347
|
/** New LID (if provided by server). */
|
|
331
348
|
new_lid?: Jid | null;
|
|
332
|
-
timestamp:
|
|
349
|
+
timestamp: string;
|
|
333
350
|
}
|
|
334
351
|
|
|
335
352
|
/** A saved contact was deleted on a linked device. Carries no action payload: the mutation is a syncd `Remove`, and WA Web's `WAWebContactSync` ignores the value on that branch and simply drops the contact from the address book. */
|
|
336
353
|
export interface ContactRemoved {
|
|
337
354
|
/** The contact that is no longer saved. */
|
|
338
355
|
jid: Jid;
|
|
339
|
-
timestamp:
|
|
356
|
+
timestamp: string;
|
|
340
357
|
from_full_sync: boolean;
|
|
341
358
|
}
|
|
342
359
|
|
|
343
360
|
/** Server requests a full contact re-sync. Emitted from `<notification type="contacts"><sync after="..."/>`. */
|
|
344
361
|
export interface ContactSyncRequested {
|
|
345
|
-
after?:
|
|
346
|
-
timestamp:
|
|
362
|
+
after?: string | null;
|
|
363
|
+
timestamp: string;
|
|
347
364
|
}
|
|
348
365
|
|
|
349
366
|
export interface ContactUpdate {
|
|
350
367
|
/** The chat/contact this sync action applies to. */
|
|
351
368
|
jid: Jid;
|
|
352
|
-
timestamp:
|
|
353
|
-
action:
|
|
369
|
+
timestamp: string;
|
|
370
|
+
action: import('./proto-types').proto.SyncActionValue.IContactAction;
|
|
354
371
|
from_full_sync: boolean;
|
|
355
372
|
}
|
|
356
373
|
|
|
@@ -358,7 +375,7 @@ export interface ContactUpdate {
|
|
|
358
375
|
export interface ContactUpdated {
|
|
359
376
|
/** The contact whose profile was updated. */
|
|
360
377
|
jid: Jid;
|
|
361
|
-
timestamp:
|
|
378
|
+
timestamp: string;
|
|
362
379
|
}
|
|
363
380
|
|
|
364
381
|
export type DayOfWeek = "sun" | "mon" | "tue" | "wed" | "thu" | "fri" | "sat" | string;
|
|
@@ -380,8 +397,8 @@ export interface DeleteChatUpdate {
|
|
|
380
397
|
jid: Jid;
|
|
381
398
|
/** From the index, not the proto — DeleteChatAction only has messageRange. */
|
|
382
399
|
delete_media: boolean;
|
|
383
|
-
timestamp:
|
|
384
|
-
action:
|
|
400
|
+
timestamp: string;
|
|
401
|
+
action: import('./proto-types').proto.SyncActionValue.IDeleteChatAction;
|
|
385
402
|
from_full_sync: boolean;
|
|
386
403
|
}
|
|
387
404
|
|
|
@@ -391,8 +408,8 @@ export interface DeleteMessageForMeUpdate {
|
|
|
391
408
|
participant_jid?: Jid | null;
|
|
392
409
|
message_id: string;
|
|
393
410
|
from_me: boolean;
|
|
394
|
-
timestamp:
|
|
395
|
-
action:
|
|
411
|
+
timestamp: string;
|
|
412
|
+
action: import('./proto-types').proto.SyncActionValue.IDeleteMessageForMeAction;
|
|
396
413
|
from_full_sync: boolean;
|
|
397
414
|
}
|
|
398
415
|
|
|
@@ -406,7 +423,7 @@ export interface Device {
|
|
|
406
423
|
signed_pre_key_id: number;
|
|
407
424
|
signed_pre_key_signature: Uint8Array;
|
|
408
425
|
adv_secret_key: Uint8Array;
|
|
409
|
-
account?:
|
|
426
|
+
account?: import('./proto-types').proto.IADVSignedDeviceIdentity | null;
|
|
410
427
|
push_name: string;
|
|
411
428
|
app_version_primary: number;
|
|
412
429
|
app_version_secondary: number;
|
|
@@ -543,8 +560,8 @@ export type DirtyType = "account_sync" | "groups" | "syncd_app_state" | "newslet
|
|
|
543
560
|
export interface DisableLinkPreviewsUpdate {
|
|
544
561
|
/** `true` when link previews are now disabled. Only emitted when the wire carried the flag; WA Web treats an absent one as a malformed mutation. */
|
|
545
562
|
previews_disabled: boolean;
|
|
546
|
-
timestamp:
|
|
547
|
-
action:
|
|
563
|
+
timestamp: string;
|
|
564
|
+
action: import('./proto-types').proto.SyncActionValue.IPrivacySettingDisableLinkPreviewsAction;
|
|
548
565
|
from_full_sync: boolean;
|
|
549
566
|
}
|
|
550
567
|
|
|
@@ -764,7 +781,7 @@ export interface GroupUpdate {
|
|
|
764
781
|
/** Country code supplied for the participant by the server. */
|
|
765
782
|
participant_country_code?: string | null;
|
|
766
783
|
/** When the change occurred */
|
|
767
|
-
timestamp:
|
|
784
|
+
timestamp: string;
|
|
768
785
|
/** Whether the group uses LID addressing mode */
|
|
769
786
|
is_lid_addressing_mode: boolean;
|
|
770
787
|
/** Whether participant identity information was incomplete in the source stanza. */
|
|
@@ -787,7 +804,7 @@ export interface IdentityChange {
|
|
|
787
804
|
|
|
788
805
|
/** One decrypted inbound message. The same items (and order) back both consumer surfaces: the durability hook's batch and [`Event::Messages`]. */
|
|
789
806
|
export interface InboundMessage {
|
|
790
|
-
message:
|
|
807
|
+
message: import('./proto-types').proto.IMessage;
|
|
791
808
|
info: MessageInfo;
|
|
792
809
|
}
|
|
793
810
|
|
|
@@ -826,8 +843,8 @@ export interface LabelAssociationUpdate {
|
|
|
826
843
|
label_id: string;
|
|
827
844
|
/** The chat the label was associated with or removed from. */
|
|
828
845
|
chat_jid: Jid;
|
|
829
|
-
timestamp:
|
|
830
|
-
action:
|
|
846
|
+
timestamp: string;
|
|
847
|
+
action: import('./proto-types').proto.SyncActionValue.ILabelAssociationAction;
|
|
831
848
|
from_full_sync: boolean;
|
|
832
849
|
}
|
|
833
850
|
|
|
@@ -835,8 +852,8 @@ export interface LabelAssociationUpdate {
|
|
|
835
852
|
export interface LabelEditUpdate {
|
|
836
853
|
/** The label identifier (the index key, not a JID). */
|
|
837
854
|
label_id: string;
|
|
838
|
-
timestamp:
|
|
839
|
-
action:
|
|
855
|
+
timestamp: string;
|
|
856
|
+
action: import('./proto-types').proto.SyncActionValue.ILabelEditAction;
|
|
840
857
|
from_full_sync: boolean;
|
|
841
858
|
}
|
|
842
859
|
|
|
@@ -889,8 +906,8 @@ export interface LogoutMessage {
|
|
|
889
906
|
export interface MarkChatAsReadUpdate {
|
|
890
907
|
/** The chat being marked as read or unread. */
|
|
891
908
|
jid: Jid;
|
|
892
|
-
timestamp:
|
|
893
|
-
action:
|
|
909
|
+
timestamp: string;
|
|
910
|
+
action: import('./proto-types').proto.SyncActionValue.IMarkChatAsReadAction;
|
|
894
911
|
from_full_sync: boolean;
|
|
895
912
|
}
|
|
896
913
|
|
|
@@ -944,7 +961,7 @@ export interface MessageInfo {
|
|
|
944
961
|
/** Envelope `peer_recipient_pn` attr. Present on companion-device self-synced DM stanzas to identify the peer's PN (so the receipt goes to the right routing target). */
|
|
945
962
|
peer_recipient_pn?: Jid | null;
|
|
946
963
|
/** Parent post key when the dispatched message is a decrypted CAG channel comment (`enc_comment_message`). The inner `Message` proto has no slot for the threading link, so it surfaces here. */
|
|
947
|
-
comment_target?:
|
|
964
|
+
comment_target?: import('./proto-types').proto.IMessageKey | null;
|
|
948
965
|
/** Broadcast-contact-list recipients from `<participants><to jid>` on an incoming broadcast/status stanza. Populated only for broadcasts; used to validate a `deviceSentMessage.phash` (WA Web `validateBclHash`). Empty otherwise. */
|
|
949
966
|
bcl_participants: Jid[];
|
|
950
967
|
}
|
|
@@ -957,8 +974,8 @@ export interface MessageLabelAssociationUpdate {
|
|
|
957
974
|
chat_jid: Jid;
|
|
958
975
|
/** The labelled message's id. */
|
|
959
976
|
message_id: string;
|
|
960
|
-
timestamp:
|
|
961
|
-
action:
|
|
977
|
+
timestamp: string;
|
|
978
|
+
action: import('./proto-types').proto.SyncActionValue.ILabelAssociationAction;
|
|
962
979
|
from_full_sync: boolean;
|
|
963
980
|
}
|
|
964
981
|
|
|
@@ -994,12 +1011,12 @@ export interface MexNotification {
|
|
|
994
1011
|
from?: Jid | null;
|
|
995
1012
|
stanza_id?: string | null;
|
|
996
1013
|
offline?: string | null;
|
|
997
|
-
payload:
|
|
1014
|
+
payload: JsonValue;
|
|
998
1015
|
}
|
|
999
1016
|
|
|
1000
1017
|
/** MEX GraphQL response. */
|
|
1001
1018
|
export interface MexResponse {
|
|
1002
|
-
data?:
|
|
1019
|
+
data?: JsonValue | null;
|
|
1003
1020
|
errors?: MexGraphQLError[] | null;
|
|
1004
1021
|
}
|
|
1005
1022
|
|
|
@@ -1018,7 +1035,7 @@ export type MissedReason = "offline" | "remote";
|
|
|
1018
1035
|
export interface MsgBotInfo {
|
|
1019
1036
|
edit_type?: BotEditType | null;
|
|
1020
1037
|
edit_target_id?: string | null;
|
|
1021
|
-
edit_sender_timestamp_ms?:
|
|
1038
|
+
edit_sender_timestamp_ms?: string | null;
|
|
1022
1039
|
}
|
|
1023
1040
|
|
|
1024
1041
|
export interface MsgMetaInfo {
|
|
@@ -1049,7 +1066,7 @@ export interface MsgSecretEntry {
|
|
|
1049
1066
|
sender: string;
|
|
1050
1067
|
/** Message identifier. `Arc<str>` keeps entry clones used by buffered persistence cheap without changing the serialized representation. */
|
|
1051
1068
|
msg_id: string;
|
|
1052
|
-
secret:
|
|
1069
|
+
secret: Uint8Array;
|
|
1053
1070
|
/** Absolute unix-seconds retention deadline. `0` means never expire. Computed by the caller from the parent message's event time plus a per-add-on-kind horizon (see `MsgSecretRetention`). The store prunes rows whose deadline has passed; it does not know the horizon itself. */
|
|
1054
1071
|
expires_at: number | string;
|
|
1055
1072
|
/** Parent message event time (unix seconds), or `0` when unknown. Kept so the receive path can enforce the edit-processing window (`editTs < message_ts + window`) the same way WhatsApp Web does. */
|
|
@@ -1059,8 +1076,8 @@ export interface MsgSecretEntry {
|
|
|
1059
1076
|
export interface MuteUpdate {
|
|
1060
1077
|
/** The chat being muted or unmuted. */
|
|
1061
1078
|
jid: Jid;
|
|
1062
|
-
timestamp:
|
|
1063
|
-
action:
|
|
1079
|
+
timestamp: string;
|
|
1080
|
+
action: import('./proto-types').proto.SyncActionValue.IMuteAction;
|
|
1064
1081
|
from_full_sync: boolean;
|
|
1065
1082
|
}
|
|
1066
1083
|
|
|
@@ -1185,7 +1202,7 @@ export interface PictureUpdate {
|
|
|
1185
1202
|
jid: Jid;
|
|
1186
1203
|
/** The user who made the change. Present for group picture changes (the admin who changed it). `None` for personal picture updates. */
|
|
1187
1204
|
author?: Jid | null;
|
|
1188
|
-
timestamp:
|
|
1205
|
+
timestamp: string;
|
|
1189
1206
|
/** Whether the picture was removed (true) or set/updated (false). */
|
|
1190
1207
|
removed: boolean;
|
|
1191
1208
|
/** The server-assigned picture ID (from `<set id="..."/>`). `None` for deletions. */
|
|
@@ -1195,8 +1212,8 @@ export interface PictureUpdate {
|
|
|
1195
1212
|
export interface PinUpdate {
|
|
1196
1213
|
/** The chat being pinned or unpinned. */
|
|
1197
1214
|
jid: Jid;
|
|
1198
|
-
timestamp:
|
|
1199
|
-
action:
|
|
1215
|
+
timestamp: string;
|
|
1216
|
+
action: import('./proto-types').proto.SyncActionValue.IPinAction;
|
|
1200
1217
|
from_full_sync: boolean;
|
|
1201
1218
|
}
|
|
1202
1219
|
|
|
@@ -1208,7 +1225,7 @@ export interface PresenceUpdate {
|
|
|
1208
1225
|
/** The contact whose presence changed. */
|
|
1209
1226
|
from: Jid;
|
|
1210
1227
|
unavailable: boolean;
|
|
1211
|
-
last_seen?:
|
|
1228
|
+
last_seen?: string | null;
|
|
1212
1229
|
}
|
|
1213
1230
|
|
|
1214
1231
|
export type PrivacyCategory = "last" | "online" | "profile" | "status" | "groupadd" | "readreceipts" | "calladd" | "messages" | "defense" | string;
|
|
@@ -1237,20 +1254,36 @@ export type PushPriority = "high" | "high_force";
|
|
|
1237
1254
|
export interface QuickReplyUpdate {
|
|
1238
1255
|
/** The quick reply's identifier (the index key, not a JID). */
|
|
1239
1256
|
id: string;
|
|
1240
|
-
timestamp:
|
|
1241
|
-
action:
|
|
1257
|
+
timestamp: string;
|
|
1258
|
+
action: import('./proto-types').proto.SyncActionValue.IQuickReplyAction;
|
|
1242
1259
|
from_full_sync: boolean;
|
|
1243
1260
|
}
|
|
1244
1261
|
|
|
1245
1262
|
export interface Receipt {
|
|
1246
1263
|
source: MessageSource;
|
|
1247
1264
|
message_ids: string[];
|
|
1248
|
-
timestamp:
|
|
1265
|
+
timestamp: string;
|
|
1249
1266
|
type: ReceiptType;
|
|
1250
1267
|
/** True when the receipt carried the `offline` attribute, i.e. it was drained from the server's offline queue on reconnect rather than delivered live. Mirrors WA Web `incomingMsgReceiptParser` (`offline: maybeAttrString`). */
|
|
1251
1268
|
offline: boolean;
|
|
1252
1269
|
}
|
|
1253
1270
|
|
|
1271
|
+
export type ReceiptType =
|
|
1272
|
+
| "Delivered"
|
|
1273
|
+
| "Sent"
|
|
1274
|
+
| "Sender"
|
|
1275
|
+
| "Retry"
|
|
1276
|
+
| "EncRekeyRetry"
|
|
1277
|
+
| "Read"
|
|
1278
|
+
| "ReadSelf"
|
|
1279
|
+
| "Played"
|
|
1280
|
+
| "PlayedSelf"
|
|
1281
|
+
| "ServerError"
|
|
1282
|
+
| "Inactive"
|
|
1283
|
+
| "PeerMsg"
|
|
1284
|
+
| "HistorySync"
|
|
1285
|
+
| { "Other": string };
|
|
1286
|
+
|
|
1254
1287
|
/** Chat state type as received from incoming stanzas. Aligned with WhatsApp Web's `WAChatState` constants: - `typing` = ACTIVE_CHAT_STATE_TYPE.TYPING - `recording_audio` = ACTIVE_CHAT_STATE_TYPE.RECORDING_AUDIO - `idle` = IDLE_CHAT_STATE_TYPE.IDLE */
|
|
1255
1288
|
export type ReceivedChatState = "typing" | "recording_audio" | "idle";
|
|
1256
1289
|
|
|
@@ -1279,7 +1312,7 @@ export interface ServerAck {
|
|
|
1279
1312
|
/** Chat/entity the ack refers to, when present and parseable. */
|
|
1280
1313
|
from?: Jid | null;
|
|
1281
1314
|
/** Server timestamp from the ack's `t` attribute, when present. For a message ack this is the authoritative send timestamp (whatsmeow reads the same attribute into `SendResponse.Timestamp`). */
|
|
1282
|
-
timestamp?:
|
|
1315
|
+
timestamp?: string | null;
|
|
1283
1316
|
/** Nack code (e.g. `"479"`) when the server rejected the stanza; `None` for a plain ack. */
|
|
1284
1317
|
error?: string | null;
|
|
1285
1318
|
}
|
|
@@ -1294,8 +1327,8 @@ export interface StarUpdate {
|
|
|
1294
1327
|
participant_jid?: Jid | null;
|
|
1295
1328
|
message_id: string;
|
|
1296
1329
|
from_me: boolean;
|
|
1297
|
-
timestamp:
|
|
1298
|
-
action:
|
|
1330
|
+
timestamp: string;
|
|
1331
|
+
action: import('./proto-types').proto.SyncActionValue.IStarAction;
|
|
1299
1332
|
from_full_sync: boolean;
|
|
1300
1333
|
}
|
|
1301
1334
|
|
|
@@ -1345,7 +1378,7 @@ export interface UserAboutUpdate {
|
|
|
1345
1378
|
/** The contact whose about text changed. */
|
|
1346
1379
|
jid: Jid;
|
|
1347
1380
|
status: string;
|
|
1348
|
-
timestamp:
|
|
1381
|
+
timestamp: string;
|
|
1349
1382
|
}
|
|
1350
1383
|
|
|
1351
1384
|
/** A contact/group/newsletter's status updates were muted/unmuted on a linked device. */
|
|
@@ -1354,8 +1387,8 @@ export interface UserStatusMuteUpdate {
|
|
|
1354
1387
|
jid: Jid;
|
|
1355
1388
|
/** `true` = status muted, `false` = unmuted. */
|
|
1356
1389
|
muted: boolean;
|
|
1357
|
-
timestamp:
|
|
1358
|
-
action:
|
|
1390
|
+
timestamp: string;
|
|
1391
|
+
action: import('./proto-types').proto.SyncActionValue.IUserStatusMuteAction;
|
|
1359
1392
|
from_full_sync: boolean;
|
|
1360
1393
|
}
|
|
1361
1394
|
|
|
@@ -3268,20 +3301,8 @@ export type WhatsAppEvent =
|
|
|
3268
3301
|
| { type: 'contact_number_changed'; data: ContactNumberChanged }
|
|
3269
3302
|
| { type: 'contact_sync_requested'; data: ContactSyncRequested }
|
|
3270
3303
|
| { type: 'group_update'; data: GroupUpdate }
|
|
3271
|
-
| { type: 'contact_update'; data: ContactUpdate }
|
|
3272
3304
|
| { type: 'push_name_update'; data: PushNameUpdate }
|
|
3273
3305
|
| { type: 'self_push_name_updated'; data: SelfPushNameUpdated }
|
|
3274
|
-
| { type: 'pin_update'; data: PinUpdate }
|
|
3275
|
-
| { type: 'mute_update'; data: MuteUpdate }
|
|
3276
|
-
| { type: 'archive_update'; data: ArchiveUpdate }
|
|
3277
|
-
| { type: 'star_update'; data: StarUpdate }
|
|
3278
|
-
| { type: 'mark_chat_as_read_update'; data: MarkChatAsReadUpdate }
|
|
3279
|
-
| { type: 'delete_chat_update'; data: DeleteChatUpdate }
|
|
3280
|
-
| { type: 'clear_chat_update'; data: ClearChatUpdate }
|
|
3281
|
-
| { type: 'user_status_mute_update'; data: UserStatusMuteUpdate }
|
|
3282
|
-
| { type: 'delete_message_for_me_update'; data: DeleteMessageForMeUpdate }
|
|
3283
|
-
| { type: 'label_edit_update'; data: LabelEditUpdate }
|
|
3284
|
-
| { type: 'label_association_update'; data: LabelAssociationUpdate }
|
|
3285
3306
|
| { type: 'offline_sync_preview'; data: OfflineSyncPreview }
|
|
3286
3307
|
| { type: 'offline_sync_completed'; data: OfflineSyncCompleted }
|
|
3287
3308
|
| { type: 'dirty_state'; data: { dirty_type: DirtyType; timestamp?: number | null } }
|
|
@@ -3301,6 +3322,25 @@ export type WhatsAppEvent =
|
|
|
3301
3322
|
| { type: 'pair_passkey_request'; data: PairPasskeyRequest }
|
|
3302
3323
|
| { type: 'pair_passkey_confirmation'; data: PairPasskeyConfirmation }
|
|
3303
3324
|
| { type: 'pair_passkey_error'; data: PairPasskeyError }
|
|
3325
|
+
| { type: 'app_state_sync_failed'; data: AppStateSyncFailed }
|
|
3326
|
+
| { type: 'contact_removed'; data: ContactRemoved }
|
|
3327
|
+
| { type: 'pairing_qr_codes_exhausted'; data: PairingQrCodesExhausted }
|
|
3328
|
+
| { type: 'contact_update'; data: ContactUpdate }
|
|
3329
|
+
| { type: 'pin_update'; data: PinUpdate }
|
|
3330
|
+
| { type: 'mute_update'; data: MuteUpdate }
|
|
3331
|
+
| { type: 'archive_update'; data: ArchiveUpdate }
|
|
3332
|
+
| { type: 'star_update'; data: StarUpdate }
|
|
3333
|
+
| { type: 'mark_chat_as_read_update'; data: MarkChatAsReadUpdate }
|
|
3334
|
+
| { type: 'delete_chat_update'; data: DeleteChatUpdate }
|
|
3335
|
+
| { type: 'clear_chat_update'; data: ClearChatUpdate }
|
|
3336
|
+
| { type: 'user_status_mute_update'; data: UserStatusMuteUpdate }
|
|
3337
|
+
| { type: 'delete_message_for_me_update'; data: DeleteMessageForMeUpdate }
|
|
3338
|
+
| { type: 'label_edit_update'; data: LabelEditUpdate }
|
|
3339
|
+
| { type: 'label_association_update'; data: LabelAssociationUpdate }
|
|
3340
|
+
| { type: 'message_label_association_update'; data: MessageLabelAssociationUpdate }
|
|
3341
|
+
| { type: 'quick_reply_update'; data: QuickReplyUpdate }
|
|
3342
|
+
| { type: 'disable_link_previews_update'; data: DisableLinkPreviewsUpdate }
|
|
3343
|
+
| { type: 'call_log_sync'; data: CallLogSync }
|
|
3304
3344
|
| { type: 'connected'; data: Record<string, never> }
|
|
3305
3345
|
| { type: 'disconnected'; data: Record<string, never> }
|
|
3306
3346
|
| { type: 'qr'; data: { code: string; timeout: number } }
|
|
@@ -3315,6 +3355,7 @@ export type WhatsAppEvent =
|
|
|
3315
3355
|
| { type: 'client_outdated'; data: Record<string, never> }
|
|
3316
3356
|
| { type: 'raw_node'; data: { tag: string; attrs: Record<string, string>; content?: unknown } }
|
|
3317
3357
|
| { type: 'history_sync'; data: import('./proto-types').proto.IHistorySync & { syncType: number; chunkOrder?: number; progress?: number; peerDataRequestSessionId?: string } }
|
|
3358
|
+
| { type: 'pairing_code_error'; data: PairingCodeError }
|
|
3318
3359
|
;
|
|
3319
3360
|
|
|
3320
3361
|
|
|
@@ -4595,12 +4636,12 @@ export interface InitOutput {
|
|
|
4595
4636
|
readonly intounderlyingsink_write: (a: number, b: number) => number;
|
|
4596
4637
|
readonly intounderlyingsource_cancel: (a: number) => void;
|
|
4597
4638
|
readonly intounderlyingsource_pull: (a: number, b: number) => number;
|
|
4598
|
-
readonly
|
|
4599
|
-
readonly
|
|
4600
|
-
readonly
|
|
4601
|
-
readonly
|
|
4602
|
-
readonly
|
|
4603
|
-
readonly
|
|
4639
|
+
readonly __wasm_bindgen_func_elem_4319: (a: number, b: number, c: number) => void;
|
|
4640
|
+
readonly __wasm_bindgen_func_elem_26158: (a: number, b: number, c: number, d: number) => void;
|
|
4641
|
+
readonly __wasm_bindgen_func_elem_26160: (a: number, b: number, c: number, d: number) => void;
|
|
4642
|
+
readonly __wasm_bindgen_func_elem_9212: (a: number, b: number, c: number) => void;
|
|
4643
|
+
readonly __wasm_bindgen_func_elem_4318: (a: number, b: number, c: number) => void;
|
|
4644
|
+
readonly __wasm_bindgen_func_elem_4317: (a: number, b: number) => void;
|
|
4604
4645
|
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
4605
4646
|
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
4606
4647
|
readonly __wbindgen_export3: (a: number) => void;
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxidezap/whatsapp-rust-bridge",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "A high-performance utilities for WhatsApp, powered by Rust and WebAssembly.",
|
|
5
5
|
"author": "João Lucas <jlucaso@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"gen:bridge-types": "cargo fetch && cd codegen && cargo run -q --bin gen-types --target $(rustc -vV | grep host | cut -d' ' -f2) > ../src/generated_types.rs.tmp && mv ../src/generated_types.rs.tmp ../src/generated_types.rs",
|
|
35
35
|
"gen:proto-codec": "bun run scripts/gen-ts-proto.ts",
|
|
36
36
|
"gen:proto-types": "bun run scripts/gen-protobufjs-dts.ts",
|
|
37
|
-
"gen": "bun run gen:
|
|
37
|
+
"gen": "bun run gen:proto-codec && bun run gen:proto-types && bun run gen:bridge-types",
|
|
38
38
|
"build:wasm": "wasm-pack build --target web --out-dir pkg --no-pack",
|
|
39
39
|
"build:wasm:dev": "wasm-pack build --target web --out-dir pkg --no-pack --dev",
|
|
40
40
|
"build:ts": "bun build ts/index.ts --minify --outfile dist/index.js --target node && cp pkg/whatsapp_rust_bridge_bg.wasm dist/ && cp ts/proto-types.d.ts dist/proto-types.d.ts && cp ts/proto-types.d.ts pkg/proto-types.d.ts && printf 'export { proto } from \"./index.js\";\\n' > dist/proto-types.js",
|