aunubaileys 1.0.54 โ†’ 1.0.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -64,6 +64,10 @@ Everything else is pure upstream. When upstream moves, we rebase the patch layer
64
64
 
65
65
 
66
66
 
67
+ ### ๐Ÿงช What's new in 1.0.55 / Baru di 1.0.55 โ€” EXPERIMENTAL
68
+
69
+ - ๐Ÿ‘ป **`aunuVanish`** โ€” send any content with a **custom per-message disappearing timer**: `sock.aunuVanish(jid, content, '5m')` (raw seconds or `'30s'`/`'5m'`/`'2h'`/`'7d'`; the parser is exported as `parseVanishDuration`). This is WhatsApp's native expiry โ€” the receiving client removes the message **without a trace** when the timer ends. It is NOT delete-for-everyone: no "this message was deleted" tombstone. Enforcement is by the receiving client, exactly like built-in disappearing messages. The experimental API is now 16 methods. This release also ships the rewritten npm description + keywords.
70
+
67
71
  ### โœ‚๏ธ What's new in 1.0.54 / Baru di 1.0.54
68
72
 
69
73
  - **Pruning.** `aunuCountdown` and `aunuSplitText` (added in 1.0.53) are **removed**: the AunuBaileys experimental line keeps only the rare features, and those two were generic utilities. The experimental API is back to **15 methods**; `aunuSideText`, `aunuGhostMention` and `aunuFakeForward` stay.
@@ -114,5 +114,6 @@ export interface AunuExperimentalAPI {
114
114
  aunuSideText: (jid: string, options: AunuSideTextOptions) => Promise<any>;
115
115
  aunuGhostMention: (jid: string, content: Record<string, unknown>, options?: MiscMessageGenerationOptions) => Promise<any>;
116
116
  aunuFakeForward: (jid: string, content: Record<string, unknown>, options?: { score?: number; channelName?: string; channelJid?: string; serverMessageId?: number; messageOptions?: MiscMessageGenerationOptions }) => Promise<any>;
117
+ aunuVanish: (jid: string, content: AnyMessageContent, duration: number | string, options?: MiscMessageGenerationOptions) => Promise<any>;
117
118
  }
118
119
  export declare const attachAunuExperimental: <T>(sock: T) => T & AunuExperimentalAPI;
@@ -1,5 +1,5 @@
1
1
  import baileysVersion from '../Defaults/baileys-version.json' with { type: 'json' };
2
- import { appendWatermark, buildSideTextAdReply, computeTypingDuration, encodeWatermark, extractWatermark, getDeletedProfileImage, stripWatermark } from '../Utils/aunu-experimental.js';
2
+ import { appendWatermark, buildSideTextAdReply, computeTypingDuration, encodeWatermark, extractWatermark, getDeletedProfileImage, parseVanishDuration, stripWatermark } from '../Utils/aunu-experimental.js';
3
3
  import { isLidUser } from '../WABinary/jid-utils.js';
4
4
  import { prepareWAMessageMedia } from '../Utils/messages.js';
5
5
  import { randomBytes } from 'crypto';
@@ -50,6 +50,8 @@ const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
50
50
  * invisibly (notifications fire, no @ text shows).
51
51
  * 15. Fake forward โ€” `aunuFakeForward`: the forwarded look with a high
52
52
  * score and optional channel attribution.
53
+ * 16. Vanish โ€” `aunuVanish`: send with a custom per-message
54
+ * disappearing timer (native expiry, no tombstone).
53
55
  */
54
56
  export const attachAunuExperimental = (sock) => {
55
57
  const scheduled = new Map();
@@ -359,6 +361,20 @@ export const attachAunuExperimental = (sock) => {
359
361
  }
360
362
  return sock.sendMessage(jid, { ...content, contextInfo }, options.messageOptions);
361
363
  };
364
+ /**
365
+ * EXPERIMENTAL (1.0.55): vanish โ€” send any content with a CUSTOM
366
+ * per-message disappearing timer, using WhatsApp's native expiry
367
+ * (the message is stamped with an expiration and the receiving
368
+ * client removes it without a trace when the timer ends โ€” this is
369
+ * NOT a delete-for-everyone revoke and leaves no tombstone).
370
+ * `duration`: seconds, or '30s'/'5m'/'2h'/'7d'. Enforcement is by
371
+ * the receiving client, exactly like built-in disappearing
372
+ * messages; modded clients may ignore it.
373
+ */
374
+ sock.aunuVanish = async (jid, content, duration, options = {}) => {
375
+ const seconds = parseVanishDuration(duration);
376
+ return sock.sendMessage(jid, content, { ...options, ephemeralExpiration: seconds });
377
+ };
362
378
  return sock;
363
379
  };
364
380
  //# sourceMappingURL=aunu-experimental.js.map
@@ -47,6 +47,27 @@ export const buildSideTextAdReply = ({ title, body, thumbnail, url } = {}) => {
47
47
  }
48
48
  return ad;
49
49
  };
50
+ /**
51
+ * EXPERIMENTAL (1.0.55): parse a vanish duration into seconds. Accepts a
52
+ * number (seconds) or a string with an s/m/h/d suffix ('30s', '5m',
53
+ * '2h', '7d'); a bare numeric string means seconds. Throws on anything
54
+ * else and on non-positive values.
55
+ */
56
+ export const parseVanishDuration = (duration) => {
57
+ if (typeof duration === 'number') {
58
+ if (!Number.isFinite(duration) || duration < 1)
59
+ throw new Error('aunuVanish: duration must be at least 1 second');
60
+ return Math.floor(duration);
61
+ }
62
+ const match = /^\s*(\d+)\s*(s|m|h|d)?\s*$/i.exec(String(duration));
63
+ if (!match)
64
+ throw new Error(`aunuVanish: cannot parse duration ${JSON.stringify(duration)} (use seconds or '30s'/'5m'/'2h'/'7d')`);
65
+ const mult = { s: 1, m: 60, h: 3600, d: 86400 }[(match[2] || 's').toLowerCase()];
66
+ const seconds = parseInt(match[1], 10) * mult;
67
+ if (seconds < 1)
68
+ throw new Error('aunuVanish: duration must be at least 1 second');
69
+ return seconds;
70
+ };
50
71
  export const encodeWatermark = (payload) => {
51
72
  if (!payload) {
52
73
  return '';
package/package.json CHANGED
@@ -1,23 +1,34 @@
1
1
  {
2
2
  "name": "aunubaileys",
3
3
  "type": "module",
4
- "version": "1.0.54",
5
- "description": "AunuBaileys \u2014 a WhatsApp Web API for bots that never sleep. Full upstream power with the beloved in-memory store restored and pairing that just works. Forged by AunuCore.",
4
+ "version": "1.0.55",
5
+ "description": "AunuBaileys \u2014 the self-healing WhatsApp Web API for Node.js. Bad MAC and \"2000 messages into the future\" errors repair themselves, LID and phone-number identities stay in sync, anti-ban is built in, pairing codes are custom \u2014 plus 15 experimental features no other Baileys fork ships: invisible watermarks, per-person tag-all cards, side-profile text, ghost mentions and more. ESM, CJS and full TypeScript types.",
6
6
  "keywords": [
7
7
  "whatsapp",
8
8
  "whatsapp-web",
9
+ "whatsapp-api",
9
10
  "whatsapp-bot",
11
+ "whatsapp-automation",
12
+ "whatsapp-channel",
10
13
  "baileys",
11
14
  "aunubaileys",
12
15
  "aunucore",
13
16
  "bot",
14
17
  "chatbot",
15
- "websocket",
16
18
  "multi-device",
17
19
  "pairing-code",
18
- "api",
20
+ "websocket",
21
+ "nodejs",
22
+ "javascript",
23
+ "typescript",
24
+ "esm",
25
+ "lid",
26
+ "anti-ban",
27
+ "newsletter",
28
+ "sticker",
19
29
  "automation",
20
- "nodejs"
30
+ "api",
31
+ "unofficial"
21
32
  ],
22
33
  "homepage": "https://docsjs.aunucore.eu.cc",
23
34
  "repository": {