@wirecat/whatsapp-cli 0.1.0 → 0.3.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.
Files changed (102) hide show
  1. package/README.md +213 -94
  2. package/dist/adapter/adapter.d.ts +8 -4
  3. package/dist/adapter/adapter.d.ts.map +1 -1
  4. package/dist/adapter/adapter.js +349 -90
  5. package/dist/adapter/adapter.js.map +1 -1
  6. package/dist/adapter/channels.d.ts +43 -0
  7. package/dist/adapter/channels.d.ts.map +1 -0
  8. package/dist/adapter/channels.js +100 -0
  9. package/dist/adapter/channels.js.map +1 -0
  10. package/dist/adapter/checks.d.ts +2 -3
  11. package/dist/adapter/checks.d.ts.map +1 -1
  12. package/dist/adapter/checks.js +1 -2
  13. package/dist/adapter/checks.js.map +1 -1
  14. package/dist/adapter/errors.d.ts +0 -5
  15. package/dist/adapter/errors.d.ts.map +1 -1
  16. package/dist/adapter/errors.js +7 -9
  17. package/dist/adapter/errors.js.map +1 -1
  18. package/dist/adapter/groups.d.ts +5 -1
  19. package/dist/adapter/groups.d.ts.map +1 -1
  20. package/dist/adapter/groups.js +51 -9
  21. package/dist/adapter/groups.js.map +1 -1
  22. package/dist/adapter/map.d.ts +17 -2
  23. package/dist/adapter/map.d.ts.map +1 -1
  24. package/dist/adapter/map.js +68 -7
  25. package/dist/adapter/map.js.map +1 -1
  26. package/dist/adapter/pins.d.ts +11 -0
  27. package/dist/adapter/pins.d.ts.map +1 -0
  28. package/dist/adapter/pins.js +10 -0
  29. package/dist/adapter/pins.js.map +1 -0
  30. package/dist/adapter/polls.d.ts +1 -1
  31. package/dist/adapter/polls.d.ts.map +1 -1
  32. package/dist/adapter/polls.js +2 -2
  33. package/dist/adapter/polls.js.map +1 -1
  34. package/dist/adapter/privacy.d.ts +18 -0
  35. package/dist/adapter/privacy.d.ts.map +1 -0
  36. package/dist/adapter/privacy.js +94 -0
  37. package/dist/adapter/privacy.js.map +1 -0
  38. package/dist/adapter/settings.d.ts +21 -0
  39. package/dist/adapter/settings.d.ts.map +1 -0
  40. package/dist/adapter/settings.js +76 -0
  41. package/dist/adapter/settings.js.map +1 -0
  42. package/dist/bin/wa.js +0 -13
  43. package/dist/bin/wa.js.map +1 -1
  44. package/dist/commands/session.d.ts +18 -7
  45. package/dist/commands/session.d.ts.map +1 -1
  46. package/dist/commands/session.js +92 -93
  47. package/dist/commands/session.js.map +1 -1
  48. package/dist/commands/setup.d.ts.map +1 -1
  49. package/dist/commands/setup.js +77 -129
  50. package/dist/commands/setup.js.map +1 -1
  51. package/dist/commands/update.d.ts.map +1 -1
  52. package/dist/commands/update.js +3 -22
  53. package/dist/commands/update.js.map +1 -1
  54. package/dist/engine/channels.d.ts +109 -0
  55. package/dist/engine/channels.d.ts.map +1 -0
  56. package/dist/engine/channels.js +29 -0
  57. package/dist/engine/channels.js.map +1 -0
  58. package/dist/engine/contract.d.ts +617 -43
  59. package/dist/engine/contract.d.ts.map +1 -1
  60. package/dist/engine/contract.js +226 -11
  61. package/dist/engine/contract.js.map +1 -1
  62. package/dist/engine/go-engine.d.ts.map +1 -1
  63. package/dist/engine/go-engine.js +23 -34
  64. package/dist/engine/go-engine.js.map +1 -1
  65. package/dist/engine/groups.d.ts +32 -14
  66. package/dist/engine/groups.d.ts.map +1 -1
  67. package/dist/engine/groups.js +2 -0
  68. package/dist/engine/groups.js.map +1 -1
  69. package/dist/engine/privacy.d.ts +33 -0
  70. package/dist/engine/privacy.d.ts.map +1 -0
  71. package/dist/engine/privacy.js +23 -0
  72. package/dist/engine/privacy.js.map +1 -0
  73. package/dist/engine/settings.d.ts +45 -0
  74. package/dist/engine/settings.d.ts.map +1 -0
  75. package/dist/engine/settings.js +34 -0
  76. package/dist/engine/settings.js.map +1 -0
  77. package/dist/install/postinstall.d.ts.map +1 -1
  78. package/dist/install/postinstall.js +4 -3
  79. package/dist/install/postinstall.js.map +1 -1
  80. package/dist/messenger.d.ts +3 -4
  81. package/dist/messenger.d.ts.map +1 -1
  82. package/dist/messenger.js +31 -14
  83. package/dist/messenger.js.map +1 -1
  84. package/dist/program.d.ts +5 -1
  85. package/dist/program.d.ts.map +1 -1
  86. package/dist/program.js +10 -38
  87. package/dist/program.js.map +1 -1
  88. package/dist/reasons.d.ts.map +1 -1
  89. package/dist/reasons.js +8 -0
  90. package/dist/reasons.js.map +1 -1
  91. package/dist/update.d.ts +0 -1
  92. package/dist/update.d.ts.map +1 -1
  93. package/dist/update.js +0 -7
  94. package/dist/update.js.map +1 -1
  95. package/dist/version.d.ts +1 -1
  96. package/dist/version.js +1 -1
  97. package/package.json +10 -10
  98. package/skills/whatsapp-cli/SKILL.md +59 -24
  99. package/dist/commands/answer.d.ts +0 -7
  100. package/dist/commands/answer.d.ts.map +0 -1
  101. package/dist/commands/answer.js +0 -11
  102. package/dist/commands/answer.js.map +0 -1
@@ -1,5 +1,8 @@
1
1
  import * as v from "valibot";
2
+ import type { ChannelEngine } from "./channels.js";
2
3
  import type { GroupEngine } from "./groups.js";
4
+ import type { PrivacyEngine } from "./privacy.js";
5
+ import type { SettingsEngine } from "./settings.js";
3
6
  /**
4
7
  * What the engine and the adapter say to each other, in WhatsApp's own terms. The Go engine speaks it as JSON
5
8
  * lines; `FakeEngine` speaks it in memory. Bump `PROTOCOL` on any change an older peer would misread — the
@@ -10,16 +13,99 @@ import type { GroupEngine } from "./groups.js";
10
13
  * emits a chat (cli-private plans/2026-10-16-whatsapp-foundation.md, decision 3). Names are what the address book or the
11
14
  * person set; a phone number is never a name.
12
15
  */
13
- export declare const PROTOCOL = 10;
16
+ export declare const PROTOCOL = 45;
17
+ /**
18
+ * Every request the engine answers. A write changes something on WhatsApp or sends something: cut by a dropped
19
+ * connection or the engine's end, it may have gone through, so it answers `outcome_unknown`, never a retryable error
20
+ * (WC-LIFE-9). The engine's `writes` (engine/cmd/wa-engine/errors.go) must name the same writes; its tests check
21
+ * that and that it dispatches exactly these ops.
22
+ */
23
+ export declare const ENGINE_OPS: {
24
+ readonly send: "write";
25
+ readonly sendMedia: "write";
26
+ readonly sendAlbum: "write";
27
+ readonly forward: "write";
28
+ readonly edit: "write";
29
+ readonly revoke: "write";
30
+ readonly react: "write";
31
+ readonly read: "write";
32
+ readonly createPoll: "write";
33
+ readonly vote: "write";
34
+ readonly pin: "write";
35
+ readonly unpin: "write";
36
+ readonly createGroup: "write";
37
+ readonly join: "write";
38
+ readonly leave: "write";
39
+ readonly updateGroup: "write";
40
+ readonly setGroupPhoto: "write";
41
+ readonly resetLink: "write";
42
+ readonly participants: "write";
43
+ readonly answerRequest: "write";
44
+ readonly block: "write";
45
+ readonly setPrivacy: "write";
46
+ readonly mute: "write";
47
+ readonly updateProfile: "write";
48
+ readonly deleteChat: "write";
49
+ readonly clearChat: "write";
50
+ readonly deleteForMe: "write";
51
+ readonly star: "write";
52
+ readonly archiveChat: "write";
53
+ readonly unarchiveChat: "write";
54
+ readonly pinChat: "write";
55
+ readonly unpinChat: "write";
56
+ readonly markChatRead: "write";
57
+ readonly markChatUnread: "write";
58
+ readonly followChannel: "write";
59
+ readonly unfollowChannel: "write";
60
+ readonly logout: "write";
61
+ readonly connect: "read";
62
+ readonly close: "read";
63
+ readonly link: "read";
64
+ readonly me: "read";
65
+ readonly directory: "read";
66
+ readonly chat: "read";
67
+ readonly download: "read";
68
+ readonly older: "read";
69
+ readonly group: "read";
70
+ readonly requests: "read";
71
+ readonly profile: "read";
72
+ readonly lookup: "read";
73
+ readonly contacts: "read";
74
+ readonly privacy: "read";
75
+ readonly channel: "read";
76
+ readonly channelMessages: "read";
77
+ readonly storedChats: "read";
78
+ readonly canonicalChat: "read";
79
+ };
80
+ export type EngineOp = keyof typeof ENGINE_OPS;
81
+ export declare const isWrite: (op: EngineOp) => boolean;
14
82
  export declare const waChat: v.StrictObjectSchema<{
15
83
  readonly jid: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>;
16
- readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
84
+ /**
85
+ * `unread` and `lastMessageAt` are absent when the source does not say. Only a notice, such as a group leaving its
86
+ * community or a chat archived, muted or read on the phone, leaves out `name` and `participants`: a pushed chat
87
+ * keeps the stored value of whatever is absent.
88
+ */
89
+ readonly name: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
17
90
  readonly kind: v.PicklistSchema<["dm", "self", "group", "newsletter", "broadcast"], undefined>;
18
- readonly unread: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
19
- readonly lastMessageAt: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
20
- readonly participants: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
91
+ readonly unread: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
92
+ readonly lastMessageAt: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>, undefined>;
93
+ readonly participants: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
21
94
  readonly archived: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
22
95
  readonly muted: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
96
+ /** When the mute ends; only with `muted: true`, and absent for a mute for good. */
97
+ readonly mutedUntil: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
98
+ /** The owner marked the chat unread on the phone, whatever its count. */
99
+ readonly markedUnread: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
100
+ /** The community a group is linked to; `null` when a live read says it is in none, absent when nothing said. */
101
+ readonly parent: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>, undefined>, undefined>;
102
+ /** A community itself: a group that holds other groups. */
103
+ readonly community: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
104
+ /**
105
+ * `left` when WhatsApp said the owner left the group or was removed, `member` when it said the owner was added back;
106
+ * never `null`, which clears `archived` too.
107
+ */
108
+ readonly membershipState: v.OptionalSchema<v.PicklistSchema<["left", "member"], undefined>, undefined>;
23
109
  }, undefined>;
24
110
  export declare const waContact: v.StrictObjectSchema<{
25
111
  readonly jid: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>;
@@ -35,10 +121,43 @@ export declare const waMediaRef: v.StrictObjectSchema<{
35
121
  readonly mediaKey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
36
122
  readonly fileSha256: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
37
123
  readonly fileEncSha256: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
124
+ /** The upload's URL: a phone does not show a photo or a video whose message lacks it. */
125
+ readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
126
+ readonly mediaKeyTimestamp: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
127
+ }, undefined>;
128
+ /**
129
+ * A download's answer: the new path when the phone had to upload the file again, `null` when WhatsApp still kept it.
130
+ * The key stays that of the stored ref; the checksums come too when the phone encrypted the file again.
131
+ */
132
+ export declare const waDownloaded: v.NullableSchema<v.StrictObjectSchema<{
133
+ readonly directPath: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>]>;
134
+ readonly fileSha256: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
135
+ readonly fileEncSha256: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
136
+ }, undefined>, undefined>;
137
+ /** A place as its message carried it, kept so a forward sends it again; `geo:` in `url` rounds the coordinates. */
138
+ export declare const waPlaceRef: v.StrictObjectSchema<{
139
+ readonly place: v.StrictObjectSchema<{
140
+ readonly latitude: v.NumberSchema<undefined>;
141
+ readonly longitude: v.NumberSchema<undefined>;
142
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
143
+ readonly address: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
144
+ readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
145
+ }, undefined>;
146
+ }, undefined>;
147
+ /**
148
+ * A contact card as its message carried it, kept so a forward sends it again. The vCard holds a phone number: it
149
+ * stays in the opaque `providerRef`, which cli-core never prints, and never reaches a log or an error.
150
+ */
151
+ export declare const waCardRef: v.StrictObjectSchema<{
152
+ readonly card: v.StrictObjectSchema<{
153
+ readonly name: v.StringSchema<undefined>;
154
+ readonly vcard: v.StringSchema<undefined>;
155
+ }, undefined>;
38
156
  }, undefined>;
39
157
  /**
40
158
  * cli-core's Attachment in WhatsApp's terms: `photo`, `video`, `voice`, `audio`, `document`, `sticker`, `location`
41
- * (`url` is a `geo:` link), `contact` (its name only — the card holds a phone number). `ref` only for a file.
159
+ * (`url` is a `geo:` link), `contact` (its name; the card itself only in `ref`). `ref` is a file's keys, or what a
160
+ * place or a contact card needs to be sent again; a live location has none.
42
161
  */
43
162
  export declare const waAttachment: v.StrictObjectSchema<{
44
163
  readonly kind: v.PicklistSchema<["photo", "video", "voice", "audio", "document", "sticker", "location", "contact"], undefined>;
@@ -50,13 +169,29 @@ export declare const waAttachment: v.StrictObjectSchema<{
50
169
  readonly size: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
51
170
  readonly mime: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
52
171
  readonly duration: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
53
- readonly ref: v.OptionalSchema<v.StrictObjectSchema<{
172
+ readonly ref: v.OptionalSchema<v.UnionSchema<[v.StrictObjectSchema<{
54
173
  readonly media: v.PicklistSchema<["image", "video", "audio", "document", "sticker"], undefined>;
55
174
  readonly directPath: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>]>;
56
175
  readonly mediaKey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
57
176
  readonly fileSha256: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
58
177
  readonly fileEncSha256: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
59
- }, undefined>, undefined>;
178
+ /** The upload's URL: a phone does not show a photo or a video whose message lacks it. */
179
+ readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
180
+ readonly mediaKeyTimestamp: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
181
+ }, undefined>, v.StrictObjectSchema<{
182
+ readonly place: v.StrictObjectSchema<{
183
+ readonly latitude: v.NumberSchema<undefined>;
184
+ readonly longitude: v.NumberSchema<undefined>;
185
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
186
+ readonly address: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
187
+ readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
188
+ }, undefined>;
189
+ }, undefined>, v.StrictObjectSchema<{
190
+ readonly card: v.StrictObjectSchema<{
191
+ readonly name: v.StringSchema<undefined>;
192
+ readonly vcard: v.StringSchema<undefined>;
193
+ }, undefined>;
194
+ }, undefined>], undefined>, undefined>;
60
195
  }, undefined>;
61
196
  /**
62
197
  * A poll as its message carries it. An answer's `id` is the start of the SHA-256 of its text, which is what a vote
@@ -71,6 +206,26 @@ export declare const waPoll: v.StrictObjectSchema<{
71
206
  }, undefined>, undefined>;
72
207
  readonly multiple: v.BooleanSchema<undefined>;
73
208
  }, undefined>;
209
+ /**
210
+ * A call, recorded as a message keyed by the call's id: once as it rings, and again with `outcome` when it ends in a
211
+ * one-to-one chat. `duration` is in seconds, for an answered call whose end this connection saw.
212
+ */
213
+ export declare const waCall: v.StrictObjectSchema<{
214
+ readonly video: v.BooleanSchema<undefined>;
215
+ readonly group: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
216
+ readonly outcome: v.OptionalSchema<v.PicklistSchema<["missed", "answered", "declined"], undefined>, undefined>;
217
+ readonly duration: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
218
+ }, undefined>;
219
+ /**
220
+ * The other person's phone got the owner's message, or they opened it (a played voice note counts). Only for a
221
+ * one-to-one chat: a group's come one person at a time, and the engine sends none of them.
222
+ */
223
+ export declare const waReceipt: v.StrictObjectSchema<{
224
+ readonly chat: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>;
225
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>]>;
226
+ readonly delivery: v.PicklistSchema<["delivered", "read"], undefined>;
227
+ readonly at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
228
+ }, undefined>;
74
229
  export declare const waMessage: v.StrictObjectSchema<{
75
230
  readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>]>;
76
231
  readonly chat: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>;
@@ -91,13 +246,29 @@ export declare const waMessage: v.StrictObjectSchema<{
91
246
  readonly size: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
92
247
  readonly mime: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
93
248
  readonly duration: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
94
- readonly ref: v.OptionalSchema<v.StrictObjectSchema<{
249
+ readonly ref: v.OptionalSchema<v.UnionSchema<[v.StrictObjectSchema<{
95
250
  readonly media: v.PicklistSchema<["image", "video", "audio", "document", "sticker"], undefined>;
96
251
  readonly directPath: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>]>;
97
252
  readonly mediaKey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
98
253
  readonly fileSha256: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
99
254
  readonly fileEncSha256: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
100
- }, undefined>, undefined>;
255
+ /** The upload's URL: a phone does not show a photo or a video whose message lacks it. */
256
+ readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
257
+ readonly mediaKeyTimestamp: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
258
+ }, undefined>, v.StrictObjectSchema<{
259
+ readonly place: v.StrictObjectSchema<{
260
+ readonly latitude: v.NumberSchema<undefined>;
261
+ readonly longitude: v.NumberSchema<undefined>;
262
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
263
+ readonly address: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
264
+ readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
265
+ }, undefined>;
266
+ }, undefined>, v.StrictObjectSchema<{
267
+ readonly card: v.StrictObjectSchema<{
268
+ readonly name: v.StringSchema<undefined>;
269
+ readonly vcard: v.StringSchema<undefined>;
270
+ }, undefined>;
271
+ }, undefined>], undefined>, undefined>;
101
272
  }, undefined>, undefined>, undefined>;
102
273
  readonly poll: v.OptionalSchema<v.StrictObjectSchema<{
103
274
  readonly question: v.StringSchema<undefined>;
@@ -107,6 +278,18 @@ export declare const waMessage: v.StrictObjectSchema<{
107
278
  }, undefined>, undefined>;
108
279
  readonly multiple: v.BooleanSchema<undefined>;
109
280
  }, undefined>, undefined>;
281
+ /** Only ever `true`, on a pushed message the owner starred: a push may be older than a star taken off since. */
282
+ readonly starred: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
283
+ /** A channel post's number on WhatsApp's servers: a channel's history is read back from it. */
284
+ readonly serverId: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
285
+ readonly call: v.OptionalSchema<v.StrictObjectSchema<{
286
+ readonly video: v.BooleanSchema<undefined>;
287
+ readonly group: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
288
+ readonly outcome: v.OptionalSchema<v.PicklistSchema<["missed", "answered", "declined"], undefined>, undefined>;
289
+ readonly duration: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
290
+ }, undefined>, undefined>;
291
+ /** The owner's own message in a one-to-one chat, as far as the phone knew it got. */
292
+ readonly delivery: v.OptionalSchema<v.PicklistSchema<["delivered", "read"], undefined>, undefined>;
110
293
  }, undefined>;
111
294
  /**
112
295
  * One person's newest choice in a poll: `selected` is the full SHA-256 of each chosen answer's text, and none takes
@@ -130,21 +313,84 @@ export declare const waVote: v.StrictObjectSchema<{
130
313
  readonly multiple: v.BooleanSchema<undefined>;
131
314
  }, undefined>, undefined>;
132
315
  }, undefined>;
316
+ /**
317
+ * One person's reaction change to a message: WhatsApp sends each change on its own, never a message's totals.
318
+ * `reaction` is the emoji, `null` when they took it back. `reactor` is in LID form like a sender, one id per person on
319
+ * every path, and the account's own reaction is under `self()` with `own`. `reactedAt` is when the reactor sent it, by
320
+ * WhatsApp's clock: the store keeps a person's newest reaction by it.
321
+ */
322
+ export declare const waReaction: v.StrictObjectSchema<{
323
+ readonly chat: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>;
324
+ readonly message: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>]>;
325
+ readonly reactor: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>;
326
+ readonly reactorName: v.NullableSchema<v.StringSchema<undefined>, undefined>;
327
+ readonly own: v.BooleanSchema<undefined>;
328
+ readonly reaction: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>]>, undefined>;
329
+ readonly reactedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
330
+ }, undefined>;
331
+ /**
332
+ * A one-to-one chat the engine emitted before in phone form (`from`), now named by its person's LID (`to`). The store
333
+ * moves the old chat to the new id before anything under the new id lands. The engine repeats a re-key for a while,
334
+ * since the CLI may not have been listening; a repeat changes nothing.
335
+ */
336
+ export declare const waRekey: v.StrictObjectSchema<{
337
+ readonly from: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>;
338
+ readonly to: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>;
339
+ }, undefined>;
340
+ /**
341
+ * Who joined, left, was added, removed, promoted or demoted in a group, or its new title, live or from the group's
342
+ * service message in a history push. WhatsApp gives a live change no id, so `id` is derived from the chat, the time in
343
+ * seconds, the action and the sorted people: both paths give one change the same id, and the store keeps it once.
344
+ * `by` and `people` are in LID form like a sender; `by` is `null` where WhatsApp did not say who.
345
+ */
346
+ export declare const waChatEvent: v.StrictObjectSchema<{
347
+ readonly chat: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>;
348
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>]>;
349
+ readonly timestamp: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
350
+ readonly event: v.PicklistSchema<["join", "leave", "add", "remove", "promote", "demote", "title"], undefined>;
351
+ readonly by: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>, undefined>;
352
+ readonly byName: v.NullableSchema<v.StringSchema<undefined>, undefined>;
353
+ readonly people: v.ArraySchema<v.StrictObjectSchema<{
354
+ readonly jid: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>;
355
+ readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
356
+ }, undefined>, undefined>;
357
+ readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
358
+ }, undefined>;
133
359
  /**
134
360
  * One push from the phone. `kind` follows whatsmeow's sync types; the adapter treats them all alike. `votes` are the
135
- * votes in the pushed polls, which the store saves with the push, not as `vote` events.
361
+ * votes in the pushed polls and `reactions` the reactions on the pushed messages, which the store saves with the push,
362
+ * not as `vote` or `reaction` events. `events` are the groups'
363
+ * service messages in the push, which come as no message. `rekeys` apply first.
136
364
  */
137
365
  export declare const waHistory: v.StrictObjectSchema<{
138
366
  readonly kind: v.PicklistSchema<["bootstrap", "recent", "full", "on_demand", "push_name", "other"], undefined>;
139
367
  readonly chats: v.ArraySchema<v.StrictObjectSchema<{
140
368
  readonly jid: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>;
141
- readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
369
+ /**
370
+ * `unread` and `lastMessageAt` are absent when the source does not say. Only a notice, such as a group leaving its
371
+ * community or a chat archived, muted or read on the phone, leaves out `name` and `participants`: a pushed chat
372
+ * keeps the stored value of whatever is absent.
373
+ */
374
+ readonly name: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
142
375
  readonly kind: v.PicklistSchema<["dm", "self", "group", "newsletter", "broadcast"], undefined>;
143
- readonly unread: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
144
- readonly lastMessageAt: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
145
- readonly participants: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
376
+ readonly unread: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
377
+ readonly lastMessageAt: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>, undefined>;
378
+ readonly participants: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
146
379
  readonly archived: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
147
380
  readonly muted: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
381
+ /** When the mute ends; only with `muted: true`, and absent for a mute for good. */
382
+ readonly mutedUntil: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
383
+ /** The owner marked the chat unread on the phone, whatever its count. */
384
+ readonly markedUnread: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
385
+ /** The community a group is linked to; `null` when a live read says it is in none, absent when nothing said. */
386
+ readonly parent: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>, undefined>, undefined>;
387
+ /** A community itself: a group that holds other groups. */
388
+ readonly community: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
389
+ /**
390
+ * `left` when WhatsApp said the owner left the group or was removed, `member` when it said the owner was added back;
391
+ * never `null`, which clears `archived` too.
392
+ */
393
+ readonly membershipState: v.OptionalSchema<v.PicklistSchema<["left", "member"], undefined>, undefined>;
148
394
  }, undefined>, undefined>;
149
395
  readonly contacts: v.ArraySchema<v.StrictObjectSchema<{
150
396
  readonly jid: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>;
@@ -170,13 +416,29 @@ export declare const waHistory: v.StrictObjectSchema<{
170
416
  readonly size: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
171
417
  readonly mime: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
172
418
  readonly duration: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
173
- readonly ref: v.OptionalSchema<v.StrictObjectSchema<{
419
+ readonly ref: v.OptionalSchema<v.UnionSchema<[v.StrictObjectSchema<{
174
420
  readonly media: v.PicklistSchema<["image", "video", "audio", "document", "sticker"], undefined>;
175
421
  readonly directPath: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>]>;
176
422
  readonly mediaKey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
177
423
  readonly fileSha256: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
178
424
  readonly fileEncSha256: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
179
- }, undefined>, undefined>;
425
+ /** The upload's URL: a phone does not show a photo or a video whose message lacks it. */
426
+ readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
427
+ readonly mediaKeyTimestamp: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
428
+ }, undefined>, v.StrictObjectSchema<{
429
+ readonly place: v.StrictObjectSchema<{
430
+ readonly latitude: v.NumberSchema<undefined>;
431
+ readonly longitude: v.NumberSchema<undefined>;
432
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
433
+ readonly address: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
434
+ readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
435
+ }, undefined>;
436
+ }, undefined>, v.StrictObjectSchema<{
437
+ readonly card: v.StrictObjectSchema<{
438
+ readonly name: v.StringSchema<undefined>;
439
+ readonly vcard: v.StringSchema<undefined>;
440
+ }, undefined>;
441
+ }, undefined>], undefined>, undefined>;
180
442
  }, undefined>, undefined>, undefined>;
181
443
  readonly poll: v.OptionalSchema<v.StrictObjectSchema<{
182
444
  readonly question: v.StringSchema<undefined>;
@@ -186,6 +448,18 @@ export declare const waHistory: v.StrictObjectSchema<{
186
448
  }, undefined>, undefined>;
187
449
  readonly multiple: v.BooleanSchema<undefined>;
188
450
  }, undefined>, undefined>;
451
+ /** Only ever `true`, on a pushed message the owner starred: a push may be older than a star taken off since. */
452
+ readonly starred: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
453
+ /** A channel post's number on WhatsApp's servers: a channel's history is read back from it. */
454
+ readonly serverId: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
455
+ readonly call: v.OptionalSchema<v.StrictObjectSchema<{
456
+ readonly video: v.BooleanSchema<undefined>;
457
+ readonly group: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
458
+ readonly outcome: v.OptionalSchema<v.PicklistSchema<["missed", "answered", "declined"], undefined>, undefined>;
459
+ readonly duration: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
460
+ }, undefined>, undefined>;
461
+ /** The owner's own message in a one-to-one chat, as far as the phone knew it got. */
462
+ readonly delivery: v.OptionalSchema<v.PicklistSchema<["delivered", "read"], undefined>, undefined>;
189
463
  }, undefined>, undefined>;
190
464
  readonly votes: v.ArraySchema<v.StrictObjectSchema<{
191
465
  readonly chat: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>;
@@ -203,6 +477,32 @@ export declare const waHistory: v.StrictObjectSchema<{
203
477
  readonly multiple: v.BooleanSchema<undefined>;
204
478
  }, undefined>, undefined>;
205
479
  }, undefined>, undefined>;
480
+ readonly reactions: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
481
+ readonly chat: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>;
482
+ readonly message: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>]>;
483
+ readonly reactor: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>;
484
+ readonly reactorName: v.NullableSchema<v.StringSchema<undefined>, undefined>;
485
+ readonly own: v.BooleanSchema<undefined>;
486
+ readonly reaction: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>]>, undefined>;
487
+ readonly reactedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
488
+ }, undefined>, undefined>, undefined>;
489
+ readonly rekeys: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
490
+ readonly from: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>;
491
+ readonly to: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>;
492
+ }, undefined>, undefined>, undefined>;
493
+ readonly events: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
494
+ readonly chat: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>;
495
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>]>;
496
+ readonly timestamp: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
497
+ readonly event: v.PicklistSchema<["join", "leave", "add", "remove", "promote", "demote", "title"], undefined>;
498
+ readonly by: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>, undefined>;
499
+ readonly byName: v.NullableSchema<v.StringSchema<undefined>, undefined>;
500
+ readonly people: v.ArraySchema<v.StrictObjectSchema<{
501
+ readonly jid: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>;
502
+ readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
503
+ }, undefined>, undefined>;
504
+ readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
505
+ }, undefined>, undefined>, undefined>;
206
506
  }, undefined>;
207
507
  /**
208
508
  * The phone's answer to `older`: the chat's messages sent before the anchor, as many as were asked or fewer. No
@@ -230,13 +530,29 @@ export declare const waOlder: v.StrictObjectSchema<{
230
530
  readonly size: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
231
531
  readonly mime: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
232
532
  readonly duration: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
233
- readonly ref: v.OptionalSchema<v.StrictObjectSchema<{
533
+ readonly ref: v.OptionalSchema<v.UnionSchema<[v.StrictObjectSchema<{
234
534
  readonly media: v.PicklistSchema<["image", "video", "audio", "document", "sticker"], undefined>;
235
535
  readonly directPath: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>]>;
236
536
  readonly mediaKey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
237
537
  readonly fileSha256: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
238
538
  readonly fileEncSha256: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
239
- }, undefined>, undefined>;
539
+ /** The upload's URL: a phone does not show a photo or a video whose message lacks it. */
540
+ readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
541
+ readonly mediaKeyTimestamp: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
542
+ }, undefined>, v.StrictObjectSchema<{
543
+ readonly place: v.StrictObjectSchema<{
544
+ readonly latitude: v.NumberSchema<undefined>;
545
+ readonly longitude: v.NumberSchema<undefined>;
546
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
547
+ readonly address: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
548
+ readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
549
+ }, undefined>;
550
+ }, undefined>, v.StrictObjectSchema<{
551
+ readonly card: v.StrictObjectSchema<{
552
+ readonly name: v.StringSchema<undefined>;
553
+ readonly vcard: v.StringSchema<undefined>;
554
+ }, undefined>;
555
+ }, undefined>], undefined>, undefined>;
240
556
  }, undefined>, undefined>, undefined>;
241
557
  readonly poll: v.OptionalSchema<v.StrictObjectSchema<{
242
558
  readonly question: v.StringSchema<undefined>;
@@ -246,6 +562,18 @@ export declare const waOlder: v.StrictObjectSchema<{
246
562
  }, undefined>, undefined>;
247
563
  readonly multiple: v.BooleanSchema<undefined>;
248
564
  }, undefined>, undefined>;
565
+ /** Only ever `true`, on a pushed message the owner starred: a push may be older than a star taken off since. */
566
+ readonly starred: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
567
+ /** A channel post's number on WhatsApp's servers: a channel's history is read back from it. */
568
+ readonly serverId: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
569
+ readonly call: v.OptionalSchema<v.StrictObjectSchema<{
570
+ readonly video: v.BooleanSchema<undefined>;
571
+ readonly group: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
572
+ readonly outcome: v.OptionalSchema<v.PicklistSchema<["missed", "answered", "declined"], undefined>, undefined>;
573
+ readonly duration: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
574
+ }, undefined>, undefined>;
575
+ /** The owner's own message in a one-to-one chat, as far as the phone knew it got. */
576
+ readonly delivery: v.OptionalSchema<v.PicklistSchema<["delivered", "read"], undefined>, undefined>;
249
577
  }, undefined>, undefined>;
250
578
  readonly more: v.BooleanSchema<undefined>;
251
579
  }, undefined>;
@@ -257,13 +585,31 @@ export declare const engineEvent: v.VariantSchema<"event", [v.StrictObjectSchema
257
585
  readonly kind: v.PicklistSchema<["bootstrap", "recent", "full", "on_demand", "push_name", "other"], undefined>;
258
586
  readonly chats: v.ArraySchema<v.StrictObjectSchema<{
259
587
  readonly jid: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>;
260
- readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
588
+ /**
589
+ * `unread` and `lastMessageAt` are absent when the source does not say. Only a notice, such as a group leaving its
590
+ * community or a chat archived, muted or read on the phone, leaves out `name` and `participants`: a pushed chat
591
+ * keeps the stored value of whatever is absent.
592
+ */
593
+ readonly name: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
261
594
  readonly kind: v.PicklistSchema<["dm", "self", "group", "newsletter", "broadcast"], undefined>;
262
- readonly unread: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
263
- readonly lastMessageAt: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
264
- readonly participants: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
595
+ readonly unread: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
596
+ readonly lastMessageAt: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>, undefined>;
597
+ readonly participants: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
265
598
  readonly archived: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
266
599
  readonly muted: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
600
+ /** When the mute ends; only with `muted: true`, and absent for a mute for good. */
601
+ readonly mutedUntil: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
602
+ /** The owner marked the chat unread on the phone, whatever its count. */
603
+ readonly markedUnread: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
604
+ /** The community a group is linked to; `null` when a live read says it is in none, absent when nothing said. */
605
+ readonly parent: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>, undefined>, undefined>;
606
+ /** A community itself: a group that holds other groups. */
607
+ readonly community: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
608
+ /**
609
+ * `left` when WhatsApp said the owner left the group or was removed, `member` when it said the owner was added back;
610
+ * never `null`, which clears `archived` too.
611
+ */
612
+ readonly membershipState: v.OptionalSchema<v.PicklistSchema<["left", "member"], undefined>, undefined>;
267
613
  }, undefined>, undefined>;
268
614
  readonly contacts: v.ArraySchema<v.StrictObjectSchema<{
269
615
  readonly jid: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>;
@@ -289,13 +635,29 @@ export declare const engineEvent: v.VariantSchema<"event", [v.StrictObjectSchema
289
635
  readonly size: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
290
636
  readonly mime: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
291
637
  readonly duration: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
292
- readonly ref: v.OptionalSchema<v.StrictObjectSchema<{
638
+ readonly ref: v.OptionalSchema<v.UnionSchema<[v.StrictObjectSchema<{
293
639
  readonly media: v.PicklistSchema<["image", "video", "audio", "document", "sticker"], undefined>;
294
640
  readonly directPath: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>]>;
295
641
  readonly mediaKey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
296
642
  readonly fileSha256: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
297
643
  readonly fileEncSha256: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
298
- }, undefined>, undefined>;
644
+ /** The upload's URL: a phone does not show a photo or a video whose message lacks it. */
645
+ readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
646
+ readonly mediaKeyTimestamp: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
647
+ }, undefined>, v.StrictObjectSchema<{
648
+ readonly place: v.StrictObjectSchema<{
649
+ readonly latitude: v.NumberSchema<undefined>;
650
+ readonly longitude: v.NumberSchema<undefined>;
651
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
652
+ readonly address: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
653
+ readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
654
+ }, undefined>;
655
+ }, undefined>, v.StrictObjectSchema<{
656
+ readonly card: v.StrictObjectSchema<{
657
+ readonly name: v.StringSchema<undefined>;
658
+ readonly vcard: v.StringSchema<undefined>;
659
+ }, undefined>;
660
+ }, undefined>], undefined>, undefined>;
299
661
  }, undefined>, undefined>, undefined>;
300
662
  readonly poll: v.OptionalSchema<v.StrictObjectSchema<{
301
663
  readonly question: v.StringSchema<undefined>;
@@ -305,6 +667,18 @@ export declare const engineEvent: v.VariantSchema<"event", [v.StrictObjectSchema
305
667
  }, undefined>, undefined>;
306
668
  readonly multiple: v.BooleanSchema<undefined>;
307
669
  }, undefined>, undefined>;
670
+ /** Only ever `true`, on a pushed message the owner starred: a push may be older than a star taken off since. */
671
+ readonly starred: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
672
+ /** A channel post's number on WhatsApp's servers: a channel's history is read back from it. */
673
+ readonly serverId: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
674
+ readonly call: v.OptionalSchema<v.StrictObjectSchema<{
675
+ readonly video: v.BooleanSchema<undefined>;
676
+ readonly group: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
677
+ readonly outcome: v.OptionalSchema<v.PicklistSchema<["missed", "answered", "declined"], undefined>, undefined>;
678
+ readonly duration: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
679
+ }, undefined>, undefined>;
680
+ /** The owner's own message in a one-to-one chat, as far as the phone knew it got. */
681
+ readonly delivery: v.OptionalSchema<v.PicklistSchema<["delivered", "read"], undefined>, undefined>;
308
682
  }, undefined>, undefined>;
309
683
  readonly votes: v.ArraySchema<v.StrictObjectSchema<{
310
684
  readonly chat: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>;
@@ -322,6 +696,32 @@ export declare const engineEvent: v.VariantSchema<"event", [v.StrictObjectSchema
322
696
  readonly multiple: v.BooleanSchema<undefined>;
323
697
  }, undefined>, undefined>;
324
698
  }, undefined>, undefined>;
699
+ readonly reactions: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
700
+ readonly chat: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>;
701
+ readonly message: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>]>;
702
+ readonly reactor: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>;
703
+ readonly reactorName: v.NullableSchema<v.StringSchema<undefined>, undefined>;
704
+ readonly own: v.BooleanSchema<undefined>;
705
+ readonly reaction: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>]>, undefined>;
706
+ readonly reactedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
707
+ }, undefined>, undefined>, undefined>;
708
+ readonly rekeys: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
709
+ readonly from: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>;
710
+ readonly to: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>;
711
+ }, undefined>, undefined>, undefined>;
712
+ readonly events: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
713
+ readonly chat: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>;
714
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>]>;
715
+ readonly timestamp: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
716
+ readonly event: v.PicklistSchema<["join", "leave", "add", "remove", "promote", "demote", "title"], undefined>;
717
+ readonly by: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>, undefined>;
718
+ readonly byName: v.NullableSchema<v.StringSchema<undefined>, undefined>;
719
+ readonly people: v.ArraySchema<v.StrictObjectSchema<{
720
+ readonly jid: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>;
721
+ readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
722
+ }, undefined>, undefined>;
723
+ readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
724
+ }, undefined>, undefined>, undefined>;
325
725
  }, undefined>;
326
726
  }, undefined>, v.StrictObjectSchema<{
327
727
  readonly event: v.LiteralSchema<"message", undefined>;
@@ -345,13 +745,29 @@ export declare const engineEvent: v.VariantSchema<"event", [v.StrictObjectSchema
345
745
  readonly size: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
346
746
  readonly mime: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
347
747
  readonly duration: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
348
- readonly ref: v.OptionalSchema<v.StrictObjectSchema<{
748
+ readonly ref: v.OptionalSchema<v.UnionSchema<[v.StrictObjectSchema<{
349
749
  readonly media: v.PicklistSchema<["image", "video", "audio", "document", "sticker"], undefined>;
350
750
  readonly directPath: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>]>;
351
751
  readonly mediaKey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
352
752
  readonly fileSha256: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
353
753
  readonly fileEncSha256: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
354
- }, undefined>, undefined>;
754
+ /** The upload's URL: a phone does not show a photo or a video whose message lacks it. */
755
+ readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
756
+ readonly mediaKeyTimestamp: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
757
+ }, undefined>, v.StrictObjectSchema<{
758
+ readonly place: v.StrictObjectSchema<{
759
+ readonly latitude: v.NumberSchema<undefined>;
760
+ readonly longitude: v.NumberSchema<undefined>;
761
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
762
+ readonly address: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
763
+ readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
764
+ }, undefined>;
765
+ }, undefined>, v.StrictObjectSchema<{
766
+ readonly card: v.StrictObjectSchema<{
767
+ readonly name: v.StringSchema<undefined>;
768
+ readonly vcard: v.StringSchema<undefined>;
769
+ }, undefined>;
770
+ }, undefined>], undefined>, undefined>;
355
771
  }, undefined>, undefined>, undefined>;
356
772
  readonly poll: v.OptionalSchema<v.StrictObjectSchema<{
357
773
  readonly question: v.StringSchema<undefined>;
@@ -361,6 +777,18 @@ export declare const engineEvent: v.VariantSchema<"event", [v.StrictObjectSchema
361
777
  }, undefined>, undefined>;
362
778
  readonly multiple: v.BooleanSchema<undefined>;
363
779
  }, undefined>, undefined>;
780
+ /** Only ever `true`, on a pushed message the owner starred: a push may be older than a star taken off since. */
781
+ readonly starred: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
782
+ /** A channel post's number on WhatsApp's servers: a channel's history is read back from it. */
783
+ readonly serverId: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
784
+ readonly call: v.OptionalSchema<v.StrictObjectSchema<{
785
+ readonly video: v.BooleanSchema<undefined>;
786
+ readonly group: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
787
+ readonly outcome: v.OptionalSchema<v.PicklistSchema<["missed", "answered", "declined"], undefined>, undefined>;
788
+ readonly duration: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
789
+ }, undefined>, undefined>;
790
+ /** The owner's own message in a one-to-one chat, as far as the phone knew it got. */
791
+ readonly delivery: v.OptionalSchema<v.PicklistSchema<["delivered", "read"], undefined>, undefined>;
364
792
  }, undefined>;
365
793
  }, undefined>, v.StrictObjectSchema<{
366
794
  readonly event: v.LiteralSchema<"edit", undefined>;
@@ -384,13 +812,29 @@ export declare const engineEvent: v.VariantSchema<"event", [v.StrictObjectSchema
384
812
  readonly size: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
385
813
  readonly mime: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
386
814
  readonly duration: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
387
- readonly ref: v.OptionalSchema<v.StrictObjectSchema<{
815
+ readonly ref: v.OptionalSchema<v.UnionSchema<[v.StrictObjectSchema<{
388
816
  readonly media: v.PicklistSchema<["image", "video", "audio", "document", "sticker"], undefined>;
389
817
  readonly directPath: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>]>;
390
818
  readonly mediaKey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
391
819
  readonly fileSha256: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
392
820
  readonly fileEncSha256: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
393
- }, undefined>, undefined>;
821
+ /** The upload's URL: a phone does not show a photo or a video whose message lacks it. */
822
+ readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
823
+ readonly mediaKeyTimestamp: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
824
+ }, undefined>, v.StrictObjectSchema<{
825
+ readonly place: v.StrictObjectSchema<{
826
+ readonly latitude: v.NumberSchema<undefined>;
827
+ readonly longitude: v.NumberSchema<undefined>;
828
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
829
+ readonly address: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
830
+ readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
831
+ }, undefined>;
832
+ }, undefined>, v.StrictObjectSchema<{
833
+ readonly card: v.StrictObjectSchema<{
834
+ readonly name: v.StringSchema<undefined>;
835
+ readonly vcard: v.StringSchema<undefined>;
836
+ }, undefined>;
837
+ }, undefined>], undefined>, undefined>;
394
838
  }, undefined>, undefined>, undefined>;
395
839
  readonly poll: v.OptionalSchema<v.StrictObjectSchema<{
396
840
  readonly question: v.StringSchema<undefined>;
@@ -400,6 +844,18 @@ export declare const engineEvent: v.VariantSchema<"event", [v.StrictObjectSchema
400
844
  }, undefined>, undefined>;
401
845
  readonly multiple: v.BooleanSchema<undefined>;
402
846
  }, undefined>, undefined>;
847
+ /** Only ever `true`, on a pushed message the owner starred: a push may be older than a star taken off since. */
848
+ readonly starred: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
849
+ /** A channel post's number on WhatsApp's servers: a channel's history is read back from it. */
850
+ readonly serverId: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
851
+ readonly call: v.OptionalSchema<v.StrictObjectSchema<{
852
+ readonly video: v.BooleanSchema<undefined>;
853
+ readonly group: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
854
+ readonly outcome: v.OptionalSchema<v.PicklistSchema<["missed", "answered", "declined"], undefined>, undefined>;
855
+ readonly duration: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
856
+ }, undefined>, undefined>;
857
+ /** The owner's own message in a one-to-one chat, as far as the phone knew it got. */
858
+ readonly delivery: v.OptionalSchema<v.PicklistSchema<["delivered", "read"], undefined>, undefined>;
403
859
  }, undefined>;
404
860
  }, undefined>, v.StrictObjectSchema<{
405
861
  readonly event: v.LiteralSchema<"delete", undefined>;
@@ -423,22 +879,70 @@ export declare const engineEvent: v.VariantSchema<"event", [v.StrictObjectSchema
423
879
  readonly multiple: v.BooleanSchema<undefined>;
424
880
  }, undefined>, undefined>;
425
881
  }, undefined>;
882
+ }, undefined>, v.StrictObjectSchema<{
883
+ readonly event: v.LiteralSchema<"reaction", undefined>;
884
+ readonly reaction: v.StrictObjectSchema<{
885
+ readonly chat: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>;
886
+ readonly message: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>]>;
887
+ readonly reactor: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>;
888
+ readonly reactorName: v.NullableSchema<v.StringSchema<undefined>, undefined>;
889
+ readonly own: v.BooleanSchema<undefined>;
890
+ readonly reaction: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>]>, undefined>;
891
+ readonly reactedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
892
+ }, undefined>;
893
+ }, undefined>, v.StrictObjectSchema<{
894
+ readonly event: v.LiteralSchema<"chat_event", undefined>;
895
+ readonly change: v.StrictObjectSchema<{
896
+ readonly chat: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>;
897
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>]>;
898
+ readonly timestamp: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
899
+ readonly event: v.PicklistSchema<["join", "leave", "add", "remove", "promote", "demote", "title"], undefined>;
900
+ readonly by: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>, undefined>;
901
+ readonly byName: v.NullableSchema<v.StringSchema<undefined>, undefined>;
902
+ readonly people: v.ArraySchema<v.StrictObjectSchema<{
903
+ readonly jid: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>;
904
+ readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
905
+ }, undefined>, undefined>;
906
+ readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
907
+ }, undefined>;
908
+ }, undefined>, v.StrictObjectSchema<{
909
+ readonly event: v.LiteralSchema<"receipt", undefined>;
910
+ readonly receipt: v.StrictObjectSchema<{
911
+ readonly chat: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>;
912
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>]>;
913
+ readonly delivery: v.PicklistSchema<["delivered", "read"], undefined>;
914
+ readonly at: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
915
+ }, undefined>;
916
+ }, undefined>, v.StrictObjectSchema<{
917
+ readonly event: v.LiteralSchema<"star", undefined>;
918
+ readonly chat: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>;
919
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>]>;
920
+ readonly starred: v.BooleanSchema<undefined>;
921
+ }, undefined>, v.StrictObjectSchema<{
922
+ readonly from: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>;
923
+ readonly to: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>;
924
+ readonly event: v.LiteralSchema<"rekey", undefined>;
426
925
  }, undefined>, v.StrictObjectSchema<{
427
926
  readonly event: v.LiteralSchema<"connection", undefined>;
428
927
  readonly state: v.PicklistSchema<["connected", "disconnected", "logged_out", "replaced", "banned", "outdated", "stopped"], undefined>;
928
+ readonly until: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
429
929
  }, undefined>], undefined>;
430
930
  export declare const engineErrorCode: v.PicklistSchema<["validation_error", "authentication_error", "permission_error", "not_found", "rate_limited", "timeout", "network_error", "provider_error", "provider_unavailable", "outcome_unknown"], undefined>;
431
931
  /**
432
932
  * Why, for the refusals an agent recovers from differently than their code says: another process holds the device
433
933
  * (`device.in-use`), WhatsApp handed the login to another connection (`device.replaced`), logged the device out, refuses
434
934
  * this version (`client.outdated`), banned the account, or asked it to slow down (`account.rate-limited`, never the
435
- * engine's own lookup pace). The CLI registers each one (`src/reasons.ts`).
935
+ * engine's own lookup pace), or has not yet sent the keys a settings change is sealed with (`settings.keys-missing`).
936
+ * A download WhatsApp no longer keeps the file for says how asking the phone to upload it again ended (`media.*`), or
937
+ * that the engine stopped while it waited (`engine.stopped`). The CLI registers each one (`src/reasons.ts`).
436
938
  */
437
- export declare const engineReason: v.PicklistSchema<["device.in-use", "device.replaced", "device.logged-out", "client.outdated", "account.banned", "account.rate-limited"], undefined>;
939
+ export declare const engineReason: v.PicklistSchema<["device.in-use", "device.replaced", "device.logged-out", "client.outdated", "account.banned", "account.rate-limited", "settings.keys-missing", "media.not-on-phone", "media.phone-cannot-decrypt", "media.phone-answer-unreadable", "media.phone-failed", "media.phone-timeout", "media.retry-failed", "engine.stopped"], undefined>;
438
940
  export declare const engineError: v.StrictObjectSchema<{
439
941
  readonly code: v.PicklistSchema<["validation_error", "authentication_error", "permission_error", "not_found", "rate_limited", "timeout", "network_error", "provider_error", "provider_unavailable", "outcome_unknown"], undefined>;
440
942
  readonly message: v.StringSchema<undefined>;
441
- readonly reason: v.OptionalSchema<v.PicklistSchema<["device.in-use", "device.replaced", "device.logged-out", "client.outdated", "account.banned", "account.rate-limited"], undefined>, undefined>;
943
+ readonly reason: v.OptionalSchema<v.PicklistSchema<["device.in-use", "device.replaced", "device.logged-out", "client.outdated", "account.banned", "account.rate-limited", "settings.keys-missing", "media.not-on-phone", "media.phone-cannot-decrypt", "media.phone-answer-unreadable", "media.phone-failed", "media.phone-timeout", "media.retry-failed", "engine.stopped"], undefined>, undefined>;
944
+ /** When a temporary ban ends, if WhatsApp said. */
945
+ readonly until: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
442
946
  }, undefined>;
443
947
  /** The engine's first line: its protocol and the linked account (`self()`), or `null` before a login. */
444
948
  export declare const hello: v.StrictObjectSchema<{
@@ -454,13 +958,31 @@ export declare const waAccount: v.StrictObjectSchema<{
454
958
  export declare const waChatCard: v.StrictObjectSchema<{
455
959
  readonly chat: v.StrictObjectSchema<{
456
960
  readonly jid: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>;
457
- readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
961
+ /**
962
+ * `unread` and `lastMessageAt` are absent when the source does not say. Only a notice, such as a group leaving its
963
+ * community or a chat archived, muted or read on the phone, leaves out `name` and `participants`: a pushed chat
964
+ * keeps the stored value of whatever is absent.
965
+ */
966
+ readonly name: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
458
967
  readonly kind: v.PicklistSchema<["dm", "self", "group", "newsletter", "broadcast"], undefined>;
459
- readonly unread: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
460
- readonly lastMessageAt: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
461
- readonly participants: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
968
+ readonly unread: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
969
+ readonly lastMessageAt: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>, undefined>;
970
+ readonly participants: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
462
971
  readonly archived: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
463
972
  readonly muted: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
973
+ /** When the mute ends; only with `muted: true`, and absent for a mute for good. */
974
+ readonly mutedUntil: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
975
+ /** The owner marked the chat unread on the phone, whatever its count. */
976
+ readonly markedUnread: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
977
+ /** The community a group is linked to; `null` when a live read says it is in none, absent when nothing said. */
978
+ readonly parent: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>, undefined>, undefined>;
979
+ /** A community itself: a group that holds other groups. */
980
+ readonly community: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
981
+ /**
982
+ * `left` when WhatsApp said the owner left the group or was removed, `member` when it said the owner was added back;
983
+ * never `null`, which clears `archived` too.
984
+ */
985
+ readonly membershipState: v.OptionalSchema<v.PicklistSchema<["left", "member"], undefined>, undefined>;
464
986
  }, undefined>;
465
987
  readonly members: v.NullableSchema<v.ArraySchema<v.StrictObjectSchema<{
466
988
  readonly jid: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "@", undefined>]>;
@@ -480,9 +1002,15 @@ export type WaContact = v.InferOutput<typeof waContact>;
480
1002
  export type WaMessage = v.InferOutput<typeof waMessage>;
481
1003
  export type WaPoll = v.InferOutput<typeof waPoll>;
482
1004
  export type WaVote = v.InferOutput<typeof waVote>;
1005
+ export type WaReaction = v.InferOutput<typeof waReaction>;
1006
+ export type WaChatEvent = v.InferOutput<typeof waChatEvent>;
483
1007
  export type WaMediaRef = v.InferOutput<typeof waMediaRef>;
1008
+ export type WaDownloaded = v.InferOutput<typeof waDownloaded>;
1009
+ export type WaPlaceRef = v.InferOutput<typeof waPlaceRef>;
1010
+ export type WaCardRef = v.InferOutput<typeof waCardRef>;
484
1011
  export type WaAttachment = v.InferOutput<typeof waAttachment>;
485
1012
  export type WaHistory = v.InferOutput<typeof waHistory>;
1013
+ export type WaRekey = v.InferOutput<typeof waRekey>;
486
1014
  export type EngineEvent = v.InferOutput<typeof engineEvent>;
487
1015
  export type ConnectionState = v.InferOutput<typeof connectionState>;
488
1016
  export type EngineErrorCode = v.InferOutput<typeof engineErrorCode>;
@@ -513,14 +1041,18 @@ export interface WaQuote {
513
1041
  sender: string | null;
514
1042
  text: string;
515
1043
  }
516
- /** One file from this machine, sent with `text` as its caption. `kind` is decided as tg decides it. */
1044
+ /** One file from this machine, sent with `text` as its caption. `kind` is decided as tg decides it; a sticker goes alone. */
517
1045
  export interface WaSendMedia extends WaSend {
518
1046
  file: {
519
- kind: "photo" | "video" | "voice" | "document";
1047
+ kind: "photo" | "video" | "voice" | "document" | "sticker";
520
1048
  path: string;
521
1049
  name: string;
522
1050
  };
523
1051
  }
1052
+ /** Photos and videos sent as one album, `text` as the first one's caption. */
1053
+ export interface WaSendAlbum extends WaSend {
1054
+ files: WaSendMedia["file"][];
1055
+ }
524
1056
  /** A poll to send; `multiple` lets a voter pick any number of answers, else one. */
525
1057
  export interface WaNewPoll {
526
1058
  chat: string;
@@ -529,7 +1061,10 @@ export interface WaNewPoll {
529
1061
  answers: string[];
530
1062
  multiple: boolean;
531
1063
  }
532
- /** A stored message sent again, marked forwarded: its text and its one file, by the keys the store holds. */
1064
+ /**
1065
+ * A stored message sent again, marked forwarded: its text and its one file by the keys the store holds, or its place
1066
+ * or contact card as the store kept it.
1067
+ */
533
1068
  export interface WaForward {
534
1069
  chat: string;
535
1070
  id: string;
@@ -548,6 +1083,13 @@ export interface WaKey {
548
1083
  /** Who sent it; in a group, required for someone else's message. */
549
1084
  sender: string | null;
550
1085
  }
1086
+ /** A message key as the engine reads it from a request. */
1087
+ export declare const keyFields: ({ chat, id, fromMe, sender }: WaKey) => {
1088
+ chat: string;
1089
+ message: string;
1090
+ fromMe: boolean;
1091
+ sender?: string | undefined;
1092
+ };
551
1093
  /** The most messages one `older` request asks the phone for, as WhatsApp's own clients ask. */
552
1094
  export declare const OLDER_MAX = 50;
553
1095
  /** A stored message the phone counts back from: WhatsApp needs its id, whether it is the account's own, and its time. */
@@ -561,14 +1103,18 @@ export interface WaAnchor extends WaKey {
561
1103
  export declare class EngineError extends Error {
562
1104
  readonly code: EngineErrorCode;
563
1105
  readonly reason?: WaReason | undefined;
564
- constructor(code: EngineErrorCode, message: string, reason?: WaReason | undefined);
1106
+ /** When a temporary ban ends, if WhatsApp said. */
1107
+ readonly until?: string | undefined;
1108
+ constructor(code: EngineErrorCode, message: string, reason?: WaReason | undefined,
1109
+ /** When a temporary ban ends, if WhatsApp said. */
1110
+ until?: string | undefined);
565
1111
  }
566
1112
  /**
567
1113
  * The engine as the adapter sees it. `GoEngine` runs whatsmeow in a child process; `FakeEngine` serves tests.
568
1114
  * An event nobody listens for yet is kept and handed to the first listener of its kind, so a history push that
569
1115
  * comes right after connecting is not lost to a `feed` that started a moment after `watch`.
570
1116
  */
571
- export interface WhatsAppEngine extends GroupEngine {
1117
+ export interface WhatsAppEngine extends GroupEngine, PrivacyEngine, SettingsEngine, ChannelEngine {
572
1118
  /**
573
1119
  * The linked account, from the engine's own store: no request. `null` before a login. Always the user JID in LID
574
1120
  * form with no device part (`…@lid`, not `…:12@s.whatsapp.net`): the store keys the account by it, so a change of
@@ -592,12 +1138,28 @@ export interface WhatsAppEngine extends GroupEngine {
592
1138
  markRead(key: WaKey): Promise<void>;
593
1139
  /** Uploads the file, then sends it; a failed upload sent nothing. */
594
1140
  sendMedia(request: WaSendMedia): Promise<WaMessage>;
595
- /** Writes a stored file to `path`, which must not exist yet; the engine creates it readable by this user alone. */
596
- download(attachment: WaAttachment, path: string): Promise<void>;
1141
+ /**
1142
+ * Uploads every file, then sends the album and each file tied to it. The answer is the first file's message, under
1143
+ * the send id; the others carry ids derived from it, so a repeat sends the same ones.
1144
+ */
1145
+ sendAlbum(request: WaSendAlbum): Promise<WaMessage>;
1146
+ /**
1147
+ * Writes a stored file to `path`, which must not exist yet; the engine creates it readable by this user alone. A
1148
+ * file WhatsApp no longer keeps is asked of the owner's phone again, for the message `key` names, and fetched from
1149
+ * its new upload, and the answer is that upload's path; a phone that does not answer in time is a `timeout`.
1150
+ */
1151
+ download(attachment: WaAttachment, path: string, key: WaKey): Promise<WaDownloaded>;
597
1152
  forward(request: WaForward): Promise<WaMessage>;
598
1153
  createPoll(request: WaNewPoll): Promise<WaMessage>;
599
1154
  /** The account's vote in a poll, by the answers' texts; none takes it back. Everyone in the chat sees it. */
600
1155
  vote(key: WaKey, answers: string[]): Promise<void>;
1156
+ /**
1157
+ * Pins the message for everyone in the chat: WhatsApp has no pin only the account sees. `duration` is 86400,
1158
+ * 604800 or 2592000 seconds. cli-core always sends one; the engine pins for 7 days without one,
1159
+ * which keeps a wa built on cli-core before 0.339.0 working.
1160
+ */
1161
+ pin(key: WaKey, duration?: number): Promise<void>;
1162
+ unpin(key: WaKey): Promise<void>;
601
1163
  /**
602
1164
  * Asks the phone for up to `count` of the chat's messages sent before `anchor`, and waits for its answer. WhatsApp
603
1165
  * keeps no history on its servers: the phone answers only while it is online, and a phone that does not answer in
@@ -610,6 +1172,18 @@ export interface WhatsAppEngine extends GroupEngine {
610
1172
  */
611
1173
  link(request: WaLink, onCode: (code: LoginCode) => void): Promise<WaAccount>;
612
1174
  logout(): Promise<void>;
1175
+ /**
1176
+ * The store's one-to-one chats in phone form, once as `serve` or `watch` starts. One stored so before the engine kept
1177
+ * its table of them is known to it no other way: it goes out as a `rekey` event if its LID is known, and waits for the
1178
+ * paced lookups if not. `recipients` are recipient-list ids the store holds no chat for: one in phone form whose LID
1179
+ * the device knows goes out as a `rekey` event too, and none is looked up or recorded. Never connects.
1180
+ */
1181
+ storedChats(chats: string[], recipients?: string[]): Promise<void>;
1182
+ /**
1183
+ * The chat id the store keeps a typed one-to-one chat under: its LID when whatsmeow's map knows it, else the id as
1184
+ * typed. Reads the map only, never connects, and records nothing.
1185
+ */
1186
+ canonicalChat(jid: string): Promise<string>;
613
1187
  /** Events of the given kinds until the returned function is called. */
614
1188
  listen(kinds: readonly EngineEvent["event"][], onEvent: (event: EngineEvent) => void): () => void;
615
1189
  close(): Promise<void>;