@arcaelas/whatsapp 3.0.2 → 3.1.1

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 (81) hide show
  1. package/package.json +1 -1
  2. package/build/cjs/decorators.d.ts +0 -9
  3. package/build/cjs/decorators.js +0 -26
  4. package/build/cjs/decorators.js.map +0 -1
  5. package/build/cjs/index.d.ts +0 -9
  6. package/build/cjs/index.js +0 -18
  7. package/build/cjs/index.js.map +0 -1
  8. package/build/cjs/lib/bot/decorator.d.ts +0 -77
  9. package/build/cjs/lib/bot/decorator.js +0 -219
  10. package/build/cjs/lib/bot/decorator.js.map +0 -1
  11. package/build/cjs/lib/bot/decorators.d.ts +0 -113
  12. package/build/cjs/lib/bot/decorators.js +0 -253
  13. package/build/cjs/lib/bot/decorators.js.map +0 -1
  14. package/build/cjs/lib/bot/index.d.ts +0 -3
  15. package/build/cjs/lib/bot/index.js +0 -20
  16. package/build/cjs/lib/bot/index.js.map +0 -1
  17. package/build/cjs/lib/chat/index.d.ts +0 -227
  18. package/build/cjs/lib/chat/index.js +0 -324
  19. package/build/cjs/lib/chat/index.js.map +0 -1
  20. package/build/cjs/lib/contact/index.d.ts +0 -203
  21. package/build/cjs/lib/contact/index.js +0 -226
  22. package/build/cjs/lib/contact/index.js.map +0 -1
  23. package/build/cjs/lib/message/index.d.ts +0 -237
  24. package/build/cjs/lib/message/index.js +0 -685
  25. package/build/cjs/lib/message/index.js.map +0 -1
  26. package/build/cjs/lib/store/engine/index.d.ts +0 -34
  27. package/build/cjs/lib/store/engine/index.js +0 -13
  28. package/build/cjs/lib/store/engine/index.js.map +0 -1
  29. package/build/cjs/lib/store/engine/lib/file_system/index.d.ts +0 -56
  30. package/build/cjs/lib/store/engine/lib/file_system/index.js +0 -160
  31. package/build/cjs/lib/store/engine/lib/file_system/index.js.map +0 -1
  32. package/build/cjs/lib/store/engine/lib/redis/index.d.ts +0 -82
  33. package/build/cjs/lib/store/engine/lib/redis/index.js +0 -132
  34. package/build/cjs/lib/store/engine/lib/redis/index.js.map +0 -1
  35. package/build/cjs/lib/store/index.d.ts +0 -22
  36. package/build/cjs/lib/store/index.js +0 -38
  37. package/build/cjs/lib/store/index.js.map +0 -1
  38. package/build/cjs/lib/whatsapp/index.d.ts +0 -179
  39. package/build/cjs/lib/whatsapp/index.js +0 -754
  40. package/build/cjs/lib/whatsapp/index.js.map +0 -1
  41. package/build/cjs/package.json +0 -1
  42. package/build/esm/decorators.d.ts +0 -9
  43. package/build/esm/decorators.js +0 -9
  44. package/build/esm/decorators.js.map +0 -1
  45. package/build/esm/index.d.ts +0 -9
  46. package/build/esm/index.js +0 -8
  47. package/build/esm/index.js.map +0 -1
  48. package/build/esm/lib/bot/decorator.d.ts +0 -77
  49. package/build/esm/lib/bot/decorator.js +0 -210
  50. package/build/esm/lib/bot/decorator.js.map +0 -1
  51. package/build/esm/lib/bot/decorators.d.ts +0 -113
  52. package/build/esm/lib/bot/decorators.js +0 -242
  53. package/build/esm/lib/bot/decorators.js.map +0 -1
  54. package/build/esm/lib/bot/index.d.ts +0 -3
  55. package/build/esm/lib/bot/index.js +0 -3
  56. package/build/esm/lib/bot/index.js.map +0 -1
  57. package/build/esm/lib/chat/index.d.ts +0 -227
  58. package/build/esm/lib/chat/index.js +0 -319
  59. package/build/esm/lib/chat/index.js.map +0 -1
  60. package/build/esm/lib/contact/index.d.ts +0 -203
  61. package/build/esm/lib/contact/index.js +0 -221
  62. package/build/esm/lib/contact/index.js.map +0 -1
  63. package/build/esm/lib/message/index.d.ts +0 -237
  64. package/build/esm/lib/message/index.js +0 -673
  65. package/build/esm/lib/message/index.js.map +0 -1
  66. package/build/esm/lib/store/engine/index.d.ts +0 -34
  67. package/build/esm/lib/store/engine/index.js +0 -8
  68. package/build/esm/lib/store/engine/index.js.map +0 -1
  69. package/build/esm/lib/store/engine/lib/file_system/index.d.ts +0 -56
  70. package/build/esm/lib/store/engine/lib/file_system/index.js +0 -156
  71. package/build/esm/lib/store/engine/lib/file_system/index.js.map +0 -1
  72. package/build/esm/lib/store/engine/lib/redis/index.d.ts +0 -82
  73. package/build/esm/lib/store/engine/lib/redis/index.js +0 -128
  74. package/build/esm/lib/store/engine/lib/redis/index.js.map +0 -1
  75. package/build/esm/lib/store/index.d.ts +0 -22
  76. package/build/esm/lib/store/index.js +0 -31
  77. package/build/esm/lib/store/index.js.map +0 -1
  78. package/build/esm/lib/whatsapp/index.d.ts +0 -179
  79. package/build/esm/lib/whatsapp/index.js +0 -714
  80. package/build/esm/lib/whatsapp/index.js.map +0 -1
  81. package/build/esm/package.json +0 -1
@@ -1,324 +0,0 @@
1
- "use strict";
2
- /**
3
- * @file chat/index.ts
4
- * @description Entidad Chat — conversaciones individuales y grupales.
5
- * Chat entity — individual and group conversations.
6
- */
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.Chat = void 0;
9
- exports.chat = chat;
10
- const store_1 = require("../../lib/store");
11
- /**
12
- * Duración usada cuando `chat.mute(true)` silencia "siempre".
13
- * Duration used when `chat.mute(true)` means "mute forever".
14
- */
15
- const MUTE_FOREVER_MS = 365 * 100 * 24 * 3_600 * 1_000;
16
- /**
17
- * Clase base del chat (forma pública, solo lectura).
18
- * Base Chat class (public shape, read-only).
19
- */
20
- class Chat {
21
- constructor(raw) {
22
- this._raw = raw;
23
- }
24
- /** JID del chat. / Chat JID. */
25
- get id() {
26
- return this._raw.id;
27
- }
28
- /** CID (alias). / CID (alias). */
29
- get cid() {
30
- return this._raw.id;
31
- }
32
- /** Tipo: contact o group. / Type: contact or group. */
33
- get type() {
34
- return this._raw.id.endsWith('@g.us') ? 'group' : 'contact';
35
- }
36
- /** Nombre del chat. / Chat name. */
37
- get name() {
38
- return this._raw.name ?? this._raw.display_name ?? this._raw.id.split('@')[0];
39
- }
40
- /** Descripción del grupo. / Group description. */
41
- get content() {
42
- return this._raw.description ?? '';
43
- }
44
- /** Si está fijado. / Whether it's pinned. */
45
- get pinned() {
46
- return this._raw.pinned != null;
47
- }
48
- /** Si está archivado. / Whether it's archived. */
49
- get archived() {
50
- return this._raw.archived ?? false;
51
- }
52
- /** true si el chat está silenciado y el silencio aún no expira. / true if chat is muted and the mute has not expired. */
53
- get muted() {
54
- const end = this._raw.mute_end_time;
55
- return end != null && end > Date.now();
56
- }
57
- /** Si está leído. / Whether it's read. */
58
- get read() {
59
- return !this._raw.unread_count && !this._raw.marked_as_unread;
60
- }
61
- /** Si es solo lectura. / Whether it's read-only. */
62
- get readonly() {
63
- return this._raw.read_only ?? false;
64
- }
65
- }
66
- exports.Chat = Chat;
67
- /**
68
- * Factoría de Chat ligada al contexto WhatsApp.
69
- * Context-bound Chat factory.
70
- *
71
- * @param wa - Instancia principal / Main WhatsApp instance
72
- */
73
- function chat(wa) {
74
- /**
75
- * Obtiene la key del último mensaje para operaciones de chatModify que la requieren.
76
- * Fetches the last message key required by chatModify operations.
77
- */
78
- async function last_messages(cid) {
79
- const [raw] = await wa.engine.list(`/chat/${cid}/message`, 0, 1);
80
- const parsed = (0, store_1.deserialize)(raw ?? null);
81
- return parsed
82
- ? [
83
- {
84
- key: { remoteJid: cid, id: parsed.id, fromMe: parsed.me },
85
- messageTimestamp: Math.floor(parsed.created_at / 1000),
86
- },
87
- ]
88
- : [];
89
- }
90
- return class _Chat extends Chat {
91
- /**
92
- * Obtiene un chat por CID. Si no está persistido, lo crea a partir del contacto.
93
- * Retrieves a chat by CID. If not persisted, creates it from the contact.
94
- */
95
- static async get(cid) {
96
- let result = null;
97
- const jid = await wa._resolve_jid(cid);
98
- if (jid) {
99
- const cached = (0, store_1.deserialize)(await wa.engine.get(`/chat/${jid}`));
100
- if (cached) {
101
- result = new _Chat(cached);
102
- }
103
- else {
104
- const c = await wa.Contact.get(jid);
105
- if (c) {
106
- const raw = { id: jid, name: c.name };
107
- await wa.engine.set(`/chat/${jid}`, (0, store_1.serialize)(raw));
108
- result = new _Chat(raw);
109
- }
110
- }
111
- }
112
- return result;
113
- }
114
- /** Pagina los chats persistidos por mtime DESC. / Paginates persisted chats by mtime DESC. */
115
- static async list(offset = 0, limit = 50) {
116
- const chats = [];
117
- for (const raw of await wa.engine.list('/chat', offset, limit)) {
118
- const parsed = (0, store_1.deserialize)(raw);
119
- if (parsed) {
120
- chats.push(new _Chat(parsed));
121
- }
122
- }
123
- return chats;
124
- }
125
- /** Fija/desfija un chat por CID. / Pins or unpins a chat by CID. */
126
- static async pin(cid, value) {
127
- const c = await _Chat.get(cid);
128
- return c ? c.pin(value) : false;
129
- }
130
- /** Archiva/desarchiva un chat por CID. / Archives or unarchives a chat by CID. */
131
- static async archive(cid, value) {
132
- const c = await _Chat.get(cid);
133
- return c ? c.archive(value) : false;
134
- }
135
- /** Silencia/des-silencia un chat por CID. / Mutes or unmutes a chat by CID. */
136
- static async mute(cid, value) {
137
- const c = await _Chat.get(cid);
138
- return c ? c.mute(value) : false;
139
- }
140
- /** Marca todos los mensajes del chat como leídos. / Marks all chat messages as read. */
141
- static async seen(cid) {
142
- const c = await _Chat.get(cid);
143
- return c ? c.seen() : false;
144
- }
145
- /** Vacía mensajes del chat (local). / Clears the chat's messages (local only). */
146
- static async clear(cid) {
147
- const c = await _Chat.get(cid);
148
- return c ? c.clear() : false;
149
- }
150
- /** Elimina el chat y sus mensajes. / Deletes the chat and its messages. */
151
- static async delete(cid) {
152
- const c = await _Chat.get(cid);
153
- return c ? c.delete() : false;
154
- }
155
- /** Re-hidrata metadata del chat desde el socket. / Re-hydrates chat metadata from the socket. */
156
- async refresh() {
157
- let ok = false;
158
- if (wa._socket) {
159
- if (this.type === 'group') {
160
- try {
161
- const meta = await wa._socket.groupMetadata(this.id);
162
- this._raw.name = meta.subject;
163
- this._raw.description = meta.desc ?? null;
164
- this._raw.participants = meta.participants.map((p) => ({
165
- id: p.id,
166
- admin: p.admin ?? null,
167
- }));
168
- this._raw.created_by = meta.owner ?? null;
169
- this._raw.created_at = meta.creation ?? null;
170
- }
171
- catch {
172
- /* group metadata may fail */
173
- }
174
- }
175
- else {
176
- const c = await wa.Contact.get(this.id);
177
- if (c) {
178
- await c.refresh();
179
- this._raw.name = c.name;
180
- }
181
- }
182
- await wa.engine.set(`/chat/${this.id}`, (0, store_1.serialize)(this._raw));
183
- ok = true;
184
- }
185
- return ok ? this : null;
186
- }
187
- /** Fija/desfija el chat. / Pins or unpins the chat. */
188
- async pin(value) {
189
- let ok = false;
190
- if (wa._socket) {
191
- await wa._socket.chatModify({ pin: value, lastMessages: await last_messages(this.id) }, this.id);
192
- this._raw.pinned = value ? Date.now() : null;
193
- await wa.engine.set(`/chat/${this.id}`, (0, store_1.serialize)(this._raw));
194
- ok = true;
195
- }
196
- return ok;
197
- }
198
- /** Archiva/desarchiva el chat. / Archives or unarchives the chat. */
199
- async archive(value) {
200
- let ok = false;
201
- if (wa._socket) {
202
- await wa._socket.chatModify({ archive: value, lastMessages: await last_messages(this.id) }, this.id);
203
- this._raw.archived = value;
204
- await wa.engine.set(`/chat/${this.id}`, (0, store_1.serialize)(this._raw));
205
- ok = true;
206
- }
207
- return ok;
208
- }
209
- /** Silencia/des-silencia el chat. / Mutes or unmutes the chat. */
210
- async mute(value) {
211
- let ok = false;
212
- if (wa._socket) {
213
- const mute_end = value === true ? Date.now() + MUTE_FOREVER_MS : null;
214
- await wa._socket.chatModify({ mute: mute_end, lastMessages: await last_messages(this.id) }, this.id);
215
- this._raw.mute_end_time = mute_end;
216
- await wa.engine.set(`/chat/${this.id}`, (0, store_1.serialize)(this._raw));
217
- ok = true;
218
- }
219
- return ok;
220
- }
221
- /** Marca todos los mensajes del chat como leídos. / Marks all chat messages as read. */
222
- async seen() {
223
- let ok = false;
224
- if (wa._socket) {
225
- const last = await last_messages(this.id);
226
- if (last.length > 0) {
227
- const msg = last[0];
228
- await wa._socket.readMessages([
229
- {
230
- remoteJid: this.id,
231
- id: msg.key.id,
232
- participant: msg.key.fromMe ? undefined : msg.key.remoteJid,
233
- },
234
- ]);
235
- this._raw.unread_count = 0;
236
- this._raw.marked_as_unread = false;
237
- await wa.engine.set(`/chat/${this.id}`, (0, store_1.serialize)(this._raw));
238
- ok = true;
239
- }
240
- }
241
- return ok;
242
- }
243
- /** Toggle "Escribiendo...". / Toggles the "typing..." indicator. */
244
- async typing(on) {
245
- let ok = false;
246
- if (wa._socket) {
247
- await wa._socket.sendPresenceUpdate(on ? 'composing' : 'paused', this.id);
248
- ok = true;
249
- }
250
- return ok;
251
- }
252
- /** Toggle "Grabando audio...". / Toggles the "recording audio..." indicator. */
253
- async recording(on) {
254
- let ok = false;
255
- if (wa._socket) {
256
- await wa._socket.sendPresenceUpdate(on ? 'recording' : 'paused', this.id);
257
- ok = true;
258
- }
259
- return ok;
260
- }
261
- /** Vacía mensajes del chat (engine local). / Clears chat messages (local engine). */
262
- async clear() {
263
- await wa.engine.unset(`/chat/${this.id}/message`);
264
- return true;
265
- }
266
- /** Elimina el chat y sus mensajes (remoto + local). / Deletes the chat and its messages (remote + local). */
267
- async delete() {
268
- if (wa._socket) {
269
- if (this.type === 'group') {
270
- try {
271
- await wa._socket.groupLeave(this.id);
272
- }
273
- catch {
274
- /* may fail */
275
- }
276
- }
277
- else {
278
- try {
279
- await wa._socket.chatModify({ delete: true, lastMessages: [] }, this.id);
280
- }
281
- catch {
282
- /* may fail */
283
- }
284
- }
285
- }
286
- await this.clear();
287
- await wa.engine.unset(`/chat/${this.id}`);
288
- return true;
289
- }
290
- /** Participantes del chat paginados (incluyéndome en grupos). / Chat participants paginated (self included in groups). */
291
- async members(offset = 0, limit = 50) {
292
- const result = [];
293
- if (this.type !== 'group') {
294
- if (offset === 0 && limit > 0) {
295
- const c = await wa.Contact.get(this.id);
296
- if (c) {
297
- result.push(c);
298
- }
299
- }
300
- }
301
- else if (wa._socket) {
302
- try {
303
- const meta = await wa._socket.groupMetadata(this.id);
304
- const slice = meta.participants.slice(offset, offset + limit);
305
- for (const p of slice) {
306
- const existing = await wa.Contact.get(p.id);
307
- if (existing) {
308
- result.push(existing);
309
- }
310
- }
311
- }
312
- catch {
313
- /* may fail */
314
- }
315
- }
316
- return result;
317
- }
318
- /** Mensajes del chat paginados por mtime DESC. / Chat messages paginated by mtime DESC. */
319
- async messages(offset = 0, limit = 50) {
320
- return wa.Message.list(this.id, offset, limit);
321
- }
322
- };
323
- }
324
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/chat/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAuGH,oBAkRC;AAtXD,uCAAqD;AAGrD;;;GAGG;AACH,MAAM,eAAe,GAAG,GAAG,GAAG,GAAG,GAAG,EAAE,GAAG,KAAK,GAAG,KAAK,CAAC;AAgCvD;;;GAGG;AACH,MAAa,IAAI;IAIf,YAAY,GAAa;QACvB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;IAClB,CAAC;IAED,gCAAgC;IAChC,IAAI,EAAE;QACJ,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;IACtB,CAAC;IACD,kCAAkC;IAClC,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;IACtB,CAAC;IACD,uDAAuD;IACvD,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IAC9D,CAAC;IACD,oCAAoC;IACpC,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAChF,CAAC;IACD,kDAAkD;IAClD,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,EAAE,CAAC;IACrC,CAAC;IACD,6CAA6C;IAC7C,IAAI,MAAM;QACR,OAAO,IA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QAED,2FAA2F;QAC3F,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,KAAK,GAAG,EAAE;YACnC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;QACjD,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,203 +0,0 @@
1
- /**
2
- * @file contact/index.ts
3
- * @description Entidad Contact — lectura/escritura documental sobre `wa.engine`.
4
- * Contact entity — documental read/write over `wa.engine`.
5
- */
6
- import { Chat } from '../../lib/chat';
7
- import type { WhatsApp } from '../../lib/whatsapp';
8
- /**
9
- * Shape persistido del contacto.
10
- * Persisted contact shape.
11
- */
12
- export interface IContactRaw {
13
- id: string;
14
- lid?: string | null;
15
- name?: string | null;
16
- notify?: string | null;
17
- verified_name?: string | null;
18
- img_url?: string | null;
19
- status?: string | null;
20
- }
21
- /**
22
- * Clase base del contacto (forma pública, solo lectura).
23
- * Base Contact class (public shape, read-only).
24
- */
25
- export declare class Contact {
26
- /** @internal Shape persistido. Uso interno (convención underscore). / Internal persisted shape. */
27
- readonly _raw: IContactRaw;
28
- /** Chat 1:1 asociado (hidratado). / Associated 1:1 chat (hydrated). */
29
- readonly chat: Chat;
30
- constructor(raw: IContactRaw, chat: Chat);
31
- /** JID único. / Unique JID. */
32
- get id(): string;
33
- /** JID (alias). / JID (alias). */
34
- get jid(): string;
35
- /** LID si está disponible. / LID when available. */
36
- get lid(): string | null;
37
- /** Nombre: local → push → teléfono. / Name: local → push → phone. */
38
- get name(): string;
39
- /** Número sin formato. / Raw phone number. */
40
- get phone(): string;
41
- /** URL de foto de perfil. / Profile picture URL. */
42
- get photo(): string | null;
43
- /** Bio del contacto. / Contact bio. */
44
- get content(): string;
45
- }
46
- /**
47
- * Factoría de Contact ligada al contexto WhatsApp.
48
- * Context-bound Contact factory.
49
- *
50
- * @param wa - Instancia principal / Main WhatsApp instance
51
- */
52
- export declare function contact(wa: WhatsApp): {
53
- new (raw: IContactRaw, chat: InstanceType<typeof wa.Chat>): {
54
- /** Chat 1:1 asociado como subclase enriquecida. / Associated 1:1 chat as enriched subclass. */
55
- readonly chat: InstanceType<typeof wa.Chat>;
56
- /** true si la instancia representa la cuenta autenticada. / true if this instance is the authenticated account. */
57
- get me(): boolean;
58
- /**
59
- * Renombra el contacto localmente (solo agenda del dispositivo).
60
- * Renames the contact locally (device address book only).
61
- */
62
- rename(name: string): Promise<boolean>;
63
- /**
64
- * Re-hidrata foto y bio desde el socket.
65
- * Re-hydrates profile picture and bio from the socket.
66
- */
67
- refresh(): Promise</*elided*/ any | null>;
68
- /** @internal Shape persistido. Uso interno (convención underscore). / Internal persisted shape. */
69
- readonly _raw: IContactRaw;
70
- /** JID único. / Unique JID. */
71
- get id(): string;
72
- /** JID (alias). / JID (alias). */
73
- get jid(): string;
74
- /** LID si está disponible. / LID when available. */
75
- get lid(): string | null;
76
- /** Nombre: local → push → teléfono. / Name: local → push → phone. */
77
- get name(): string;
78
- /** Número sin formato. / Raw phone number. */
79
- get phone(): string;
80
- /** URL de foto de perfil. / Profile picture URL. */
81
- get photo(): string | null;
82
- /** Bio del contacto. / Contact bio. */
83
- get content(): string;
84
- };
85
- /**
86
- * Obtiene un contacto. Dispatch inteligente:
87
- * - Si `uid` contiene `@` → se interpreta como JID (`@s.whatsapp.net` / `@g.us`) o LID (`@lid`) y se resuelve con el mapping.
88
- * - Si no contiene `@` → se limpian los dígitos y se consulta `socket.onWhatsApp(phone)` para obtener el JID canónico.
89
- *
90
- * Retrieves a contact. Smart dispatch:
91
- * - If `uid` contains `@` → treated as JID or LID, resolved via mapping.
92
- * - If `uid` lacks `@` → digits are extracted and `socket.onWhatsApp(phone)` resolves the canonical JID.
93
- */
94
- get(uid: string): Promise<{
95
- /** Chat 1:1 asociado como subclase enriquecida. / Associated 1:1 chat as enriched subclass. */
96
- readonly chat: InstanceType<typeof wa.Chat>;
97
- /** true si la instancia representa la cuenta autenticada. / true if this instance is the authenticated account. */
98
- get me(): boolean;
99
- /**
100
- * Renombra el contacto localmente (solo agenda del dispositivo).
101
- * Renames the contact locally (device address book only).
102
- */
103
- rename(name: string): Promise<boolean>;
104
- /**
105
- * Re-hidrata foto y bio desde el socket.
106
- * Re-hydrates profile picture and bio from the socket.
107
- */
108
- refresh(): Promise</*elided*/ any | null>;
109
- /** @internal Shape persistido. Uso interno (convención underscore). / Internal persisted shape. */
110
- readonly _raw: IContactRaw;
111
- /** JID único. / Unique JID. */
112
- get id(): string;
113
- /** JID (alias). / JID (alias). */
114
- get jid(): string;
115
- /** LID si está disponible. / LID when available. */
116
- get lid(): string | null;
117
- /** Nombre: local → push → teléfono. / Name: local → push → phone. */
118
- get name(): string;
119
- /** Número sin formato. / Raw phone number. */
120
- get phone(): string;
121
- /** URL de foto de perfil. / Profile picture URL. */
122
- get photo(): string | null;
123
- /** Bio del contacto. / Contact bio. */
124
- get content(): string;
125
- } | null>;
126
- /**
127
- * Pagina los contactos persistidos por mtime DESC, pre-cargando el chat de cada uno.
128
- * Paginates persisted contacts by mtime DESC, pre-loading the chat of each one.
129
- */
130
- list(offset?: number, limit?: number): Promise<{
131
- /** Chat 1:1 asociado como subclase enriquecida. / Associated 1:1 chat as enriched subclass. */
132
- readonly chat: InstanceType<typeof wa.Chat>;
133
- /** true si la instancia representa la cuenta autenticada. / true if this instance is the authenticated account. */
134
- get me(): boolean;
135
- /**
136
- * Renombra el contacto localmente (solo agenda del dispositivo).
137
- * Renames the contact locally (device address book only).
138
- */
139
- rename(name: string): Promise<boolean>;
140
- /**
141
- * Re-hidrata foto y bio desde el socket.
142
- * Re-hydrates profile picture and bio from the socket.
143
- */
144
- refresh(): Promise</*elided*/ any | null>;
145
- /** @internal Shape persistido. Uso interno (convención underscore). / Internal persisted shape. */
146
- readonly _raw: IContactRaw;
147
- /** JID único. / Unique JID. */
148
- get id(): string;
149
- /** JID (alias). / JID (alias). */
150
- get jid(): string;
151
- /** LID si está disponible. / LID when available. */
152
- get lid(): string | null;
153
- /** Nombre: local → push → teléfono. / Name: local → push → phone. */
154
- get name(): string;
155
- /** Número sin formato. / Raw phone number. */
156
- get phone(): string;
157
- /** URL de foto de perfil. / Profile picture URL. */
158
- get photo(): string | null;
159
- /** Bio del contacto. / Contact bio. */
160
- get content(): string;
161
- }[]>;
162
- /**
163
- * Renombra localmente un contacto por id.
164
- * Renames a contact locally by id.
165
- */
166
- rename(uid: string, name: string): Promise<boolean>;
167
- /**
168
- * Re-hidrata los datos del contacto por id desde el socket.
169
- * Re-hydrates contact data from the socket by id.
170
- */
171
- refresh(uid: string): Promise<{
172
- /** Chat 1:1 asociado como subclase enriquecida. / Associated 1:1 chat as enriched subclass. */
173
- readonly chat: InstanceType<typeof wa.Chat>;
174
- /** true si la instancia representa la cuenta autenticada. / true if this instance is the authenticated account. */
175
- get me(): boolean;
176
- /**
177
- * Renombra el contacto localmente (solo agenda del dispositivo).
178
- * Renames the contact locally (device address book only).
179
- */
180
- rename(name: string): Promise<boolean>;
181
- /**
182
- * Re-hidrata foto y bio desde el socket.
183
- * Re-hydrates profile picture and bio from the socket.
184
- */
185
- refresh(): Promise</*elided*/ any | null>;
186
- /** @internal Shape persistido. Uso interno (convención underscore). / Internal persisted shape. */
187
- readonly _raw: IContactRaw;
188
- /** JID único. / Unique JID. */
189
- get id(): string;
190
- /** JID (alias). / JID (alias). */
191
- get jid(): string;
192
- /** LID si está disponible. / LID when available. */
193
- get lid(): string | null;
194
- /** Nombre: local → push → teléfono. / Name: local → push → phone. */
195
- get name(): string;
196
- /** Número sin formato. / Raw phone number. */
197
- get phone(): string;
198
- /** URL de foto de perfil. / Profile picture URL. */
199
- get photo(): string | null;
200
- /** Bio del contacto. / Contact bio. */
201
- get content(): string;
202
- } | null>;
203
- };