@arcaelas/whatsapp 6.2.0 → 7.0.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 (42) hide show
  1. package/README.md +19 -15
  2. package/build/cjs/index.d.ts +9 -5
  3. package/build/cjs/index.js +8 -7
  4. package/build/cjs/lib/bot/decorator.d.ts +2 -9
  5. package/build/cjs/lib/bot/decorator.js +0 -1
  6. package/build/cjs/lib/bot/decorators.d.ts +48 -4
  7. package/build/cjs/lib/bot/decorators.js +2 -2
  8. package/build/cjs/lib/chat/index.d.ts +132 -152
  9. package/build/cjs/lib/chat/index.js +138 -219
  10. package/build/cjs/lib/contact/index.d.ts +114 -80
  11. package/build/cjs/lib/contact/index.js +187 -94
  12. package/build/cjs/lib/message/index.d.ts +400 -321
  13. package/build/cjs/lib/message/index.js +425 -913
  14. package/build/cjs/lib/status/index.d.ts +22 -33
  15. package/build/cjs/lib/status/index.js +52 -93
  16. package/build/cjs/lib/store/index.d.ts +16 -0
  17. package/build/cjs/lib/store/index.js +29 -3
  18. package/build/cjs/lib/whatsapp/index.d.ts +44 -212
  19. package/build/cjs/lib/whatsapp/index.js +473 -1099
  20. package/build/esm/index.d.ts +9 -5
  21. package/build/esm/index.js +6 -4
  22. package/build/esm/lib/bot/decorator.d.ts +2 -9
  23. package/build/esm/lib/bot/decorator.js +1 -1
  24. package/build/esm/lib/bot/decorators.d.ts +48 -4
  25. package/build/esm/lib/bot/decorators.js +2 -2
  26. package/build/esm/lib/chat/index.d.ts +132 -152
  27. package/build/esm/lib/chat/index.js +139 -219
  28. package/build/esm/lib/contact/index.d.ts +114 -80
  29. package/build/esm/lib/contact/index.js +186 -94
  30. package/build/esm/lib/message/index.d.ts +400 -321
  31. package/build/esm/lib/message/index.js +422 -913
  32. package/build/esm/lib/status/index.d.ts +22 -33
  33. package/build/esm/lib/status/index.js +49 -93
  34. package/build/esm/lib/store/index.d.ts +16 -0
  35. package/build/esm/lib/store/index.js +25 -0
  36. package/build/esm/lib/whatsapp/index.d.ts +44 -212
  37. package/build/esm/lib/whatsapp/index.js +476 -1101
  38. package/package.json +1 -1
  39. package/build/cjs/lib/internal.d.ts +0 -40
  40. package/build/cjs/lib/internal.js +0 -38
  41. package/build/esm/lib/internal.d.ts +0 -40
  42. package/build/esm/lib/internal.js +0 -34
package/package.json CHANGED
@@ -72,7 +72,7 @@
72
72
  "release": "npm publish --access public"
73
73
  },
74
74
  "types": "./build/esm/index.d.ts",
75
- "version": "6.2.0",
75
+ "version": "7.0.0",
76
76
  "engines": {
77
77
  "node": ">=20"
78
78
  },
@@ -1,40 +0,0 @@
1
- /**
2
- * @file internal.ts
3
- * @description Canal privado entre el cliente y sus entidades. Vive en un `WeakMap` fuera de
4
- * la instancia, así el socket de baileys y la resolución de JIDs quedan disponibles para
5
- * `Contact`, `Chat`, `Message` y `Feed` sin exponerse en la superficie pública de `WhatsApp`:
6
- * el consumidor sólo ve `on`/`once`/`off`/`emit` y los métodos documentados.
7
- * Private channel between the client and its entities. It lives in a `WeakMap` outside the
8
- * instance, so the baileys socket and JID resolution stay available to `Contact`, `Chat`,
9
- * `Message` and `Feed` without surfacing on `WhatsApp`'s public API: consumers only see
10
- * `on`/`once`/`off`/`emit` and the documented methods.
11
- */
12
- import type { WASocket } from 'baileys';
13
- /**
14
- * Estado que el cliente comparte con sus entidades.
15
- * State the client shares with its entities.
16
- */
17
- export interface Internals {
18
- /** Socket vivo de baileys, o null mientras no hay conexión. / Live baileys socket, or null while disconnected. */
19
- socket: WASocket | null;
20
- /** Normaliza cualquier identificador (JID, LID o teléfono) a JID canónico. / Normalizes any identifier (JID, LID or phone) into a canonical JID. */
21
- resolve_jid(uid: string): Promise<string | null>;
22
- }
23
- /**
24
- * Publica el estado interno de un cliente para las entidades de la librería.
25
- * Publishes a client's internal state for the library entities.
26
- *
27
- * @param owner - Cliente dueño del estado / Client owning the state
28
- * @param state - Estado compartido, mutable por el cliente / Shared state, mutated by the client
29
- */
30
- export declare function bind(owner: object, state: Internals): void;
31
- /**
32
- * Estado interno del cliente. Sólo lo resuelven los módulos de la librería: el objeto
33
- * nunca se expone al consumidor.
34
- * A client's internal state. Only library modules resolve it: the object is never exposed
35
- * to the consumer.
36
- *
37
- * @param owner - Cliente construido por la librería / Client built by the library
38
- * @returns Estado compartido / Shared state
39
- */
40
- export declare function internals(owner: object): Internals;
@@ -1,38 +0,0 @@
1
- "use strict";
2
- /**
3
- * @file internal.ts
4
- * @description Canal privado entre el cliente y sus entidades. Vive en un `WeakMap` fuera de
5
- * la instancia, así el socket de baileys y la resolución de JIDs quedan disponibles para
6
- * `Contact`, `Chat`, `Message` y `Feed` sin exponerse en la superficie pública de `WhatsApp`:
7
- * el consumidor sólo ve `on`/`once`/`off`/`emit` y los métodos documentados.
8
- * Private channel between the client and its entities. It lives in a `WeakMap` outside the
9
- * instance, so the baileys socket and JID resolution stay available to `Contact`, `Chat`,
10
- * `Message` and `Feed` without surfacing on `WhatsApp`'s public API: consumers only see
11
- * `on`/`once`/`off`/`emit` and the documented methods.
12
- */
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.bind = bind;
15
- exports.internals = internals;
16
- const channel = new WeakMap();
17
- /**
18
- * Publica el estado interno de un cliente para las entidades de la librería.
19
- * Publishes a client's internal state for the library entities.
20
- *
21
- * @param owner - Cliente dueño del estado / Client owning the state
22
- * @param state - Estado compartido, mutable por el cliente / Shared state, mutated by the client
23
- */
24
- function bind(owner, state) {
25
- channel.set(owner, state);
26
- }
27
- /**
28
- * Estado interno del cliente. Sólo lo resuelven los módulos de la librería: el objeto
29
- * nunca se expone al consumidor.
30
- * A client's internal state. Only library modules resolve it: the object is never exposed
31
- * to the consumer.
32
- *
33
- * @param owner - Cliente construido por la librería / Client built by the library
34
- * @returns Estado compartido / Shared state
35
- */
36
- function internals(owner) {
37
- return channel.get(owner);
38
- }
@@ -1,40 +0,0 @@
1
- /**
2
- * @file internal.ts
3
- * @description Canal privado entre el cliente y sus entidades. Vive en un `WeakMap` fuera de
4
- * la instancia, así el socket de baileys y la resolución de JIDs quedan disponibles para
5
- * `Contact`, `Chat`, `Message` y `Feed` sin exponerse en la superficie pública de `WhatsApp`:
6
- * el consumidor sólo ve `on`/`once`/`off`/`emit` y los métodos documentados.
7
- * Private channel between the client and its entities. It lives in a `WeakMap` outside the
8
- * instance, so the baileys socket and JID resolution stay available to `Contact`, `Chat`,
9
- * `Message` and `Feed` without surfacing on `WhatsApp`'s public API: consumers only see
10
- * `on`/`once`/`off`/`emit` and the documented methods.
11
- */
12
- import type { WASocket } from 'baileys';
13
- /**
14
- * Estado que el cliente comparte con sus entidades.
15
- * State the client shares with its entities.
16
- */
17
- export interface Internals {
18
- /** Socket vivo de baileys, o null mientras no hay conexión. / Live baileys socket, or null while disconnected. */
19
- socket: WASocket | null;
20
- /** Normaliza cualquier identificador (JID, LID o teléfono) a JID canónico. / Normalizes any identifier (JID, LID or phone) into a canonical JID. */
21
- resolve_jid(uid: string): Promise<string | null>;
22
- }
23
- /**
24
- * Publica el estado interno de un cliente para las entidades de la librería.
25
- * Publishes a client's internal state for the library entities.
26
- *
27
- * @param owner - Cliente dueño del estado / Client owning the state
28
- * @param state - Estado compartido, mutable por el cliente / Shared state, mutated by the client
29
- */
30
- export declare function bind(owner: object, state: Internals): void;
31
- /**
32
- * Estado interno del cliente. Sólo lo resuelven los módulos de la librería: el objeto
33
- * nunca se expone al consumidor.
34
- * A client's internal state. Only library modules resolve it: the object is never exposed
35
- * to the consumer.
36
- *
37
- * @param owner - Cliente construido por la librería / Client built by the library
38
- * @returns Estado compartido / Shared state
39
- */
40
- export declare function internals(owner: object): Internals;
@@ -1,34 +0,0 @@
1
- /**
2
- * @file internal.ts
3
- * @description Canal privado entre el cliente y sus entidades. Vive en un `WeakMap` fuera de
4
- * la instancia, así el socket de baileys y la resolución de JIDs quedan disponibles para
5
- * `Contact`, `Chat`, `Message` y `Feed` sin exponerse en la superficie pública de `WhatsApp`:
6
- * el consumidor sólo ve `on`/`once`/`off`/`emit` y los métodos documentados.
7
- * Private channel between the client and its entities. It lives in a `WeakMap` outside the
8
- * instance, so the baileys socket and JID resolution stay available to `Contact`, `Chat`,
9
- * `Message` and `Feed` without surfacing on `WhatsApp`'s public API: consumers only see
10
- * `on`/`once`/`off`/`emit` and the documented methods.
11
- */
12
- const channel = new WeakMap();
13
- /**
14
- * Publica el estado interno de un cliente para las entidades de la librería.
15
- * Publishes a client's internal state for the library entities.
16
- *
17
- * @param owner - Cliente dueño del estado / Client owning the state
18
- * @param state - Estado compartido, mutable por el cliente / Shared state, mutated by the client
19
- */
20
- export function bind(owner, state) {
21
- channel.set(owner, state);
22
- }
23
- /**
24
- * Estado interno del cliente. Sólo lo resuelven los módulos de la librería: el objeto
25
- * nunca se expone al consumidor.
26
- * A client's internal state. Only library modules resolve it: the object is never exposed
27
- * to the consumer.
28
- *
29
- * @param owner - Cliente construido por la librería / Client built by the library
30
- * @returns Estado compartido / Shared state
31
- */
32
- export function internals(owner) {
33
- return channel.get(owner);
34
- }