zaileys 4.16.0 → 4.18.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.
@@ -78,4 +78,9 @@ export declare class MessageBuilder<State extends BuilderState> {
78
78
  /** Relay skips baileys' contextInfo pass, so mentions and mentionAll are applied to the unwrapped node here. */
79
79
  private applyRelayMentions;
80
80
  private sendRelay;
81
+ /**
82
+ * Re-sends the card as an edit of itself, which renders it without WhatsApp's download prompt. The edit
83
+ * must sit inside `botForwardedMessage` like the original, or it lands as its own broken message.
84
+ */
85
+ private relayIdenticalEdit;
81
86
  }
@@ -4,6 +4,8 @@ export declare const RELAY_CONTENT_KEY = "__zaileysRelayMessage";
4
4
  export declare const RELAY_MEDIA_KEY = "__zaileysHeaderMedia";
5
5
  /** Marks relay content that may only target a group jid; the value is the method label used in the error. */
6
6
  export declare const RELAY_REQUIRE_GROUP_KEY = "__zaileysRequireGroupJid";
7
+ /** Asks `sendRelay` to follow the message with an identical edit, which renders it without the download prompt. */
8
+ export declare const RELAY_BYPASS_DOWNLOAD_KEY = "__zaileysBypassDownload";
7
9
  /** Carries a downloaded media buffer that `sendRelay` re-uploads and injects into the status envelope. */
8
10
  export declare const RELAY_STATUS_MEDIA_KEY = "__zaileysStatusMedia";
9
11
  export type StatusMedia = {
@@ -13,6 +13,12 @@ export interface HtmlAppOptions {
13
13
  fallback?: string;
14
14
  /** Byte ceiling for the UTF-8 markup. Default 256 KB. */
15
15
  maxBytes?: number;
16
+ /**
17
+ * Follow the card with an identical edit so it renders without WhatsApp's Download prompt. Costs one extra
18
+ * relay, and the card reloads whenever the recipient opens the keyboard. Default `true`; `false` for pages
19
+ * that keep state, such as games.
20
+ */
21
+ bypassDownload?: boolean;
16
22
  }
17
23
  /** Builds an inline HTML card. WhatsApp renders it only on Android, with no network or storage access. */
18
24
  export declare const buildHtmlAppContent: (markup: string | SafeHtml, opts?: HtmlAppOptions) => AnyMessageContent;
@@ -161,7 +161,14 @@ export type ConnectionEventMap = {
161
161
  command: string;
162
162
  message: MessageContext;
163
163
  };
164
- /** Cloud provider: delivery lifecycle of outbound messages (sent/delivered/read/failed). */
164
+ /**
165
+ * Delivery lifecycle of outbound messages (sent/delivered/read/failed).
166
+ *
167
+ * Emitted by both transports. On the Cloud provider it comes from status
168
+ * webhooks; on a linked device it is decoded from Baileys acks. The payload
169
+ * is the same either way — `conversationId` and `error` are Cloud-only and
170
+ * simply absent on a linked device.
171
+ */
165
172
  'message-status': CloudStatusEvent;
166
173
  /** Cloud provider: template review lifecycle (APPROVED/REJECTED/PAUSED...). */
167
174
  'template-status': CloudTemplateStatusEvent;
@@ -1,4 +1,5 @@
1
1
  import { proto, type WAMessageKey } from 'baileys';
2
+ import type { CloudStatusEvent } from '../../cloud/translate/inbound.js';
2
3
  import type { DeletePayload, EditPayload, PollVotePayload, ReactionPayload } from '../types.js';
3
4
  import { type LongLike } from './_shared.js';
4
5
  export interface MutationContext {
@@ -24,3 +25,15 @@ export declare const decodeReaction: (item: ReactionItem, ctx: MutationContext)
24
25
  export declare const decodeEdit: (update: MessageUpdate, ctx: MutationContext) => EditPayload | null;
25
26
  export declare const decodeDelete: (update: MessageUpdate, ctx: MutationContext) => DeletePayload | null;
26
27
  export declare const decodePollVote: (update: MessageUpdate, ctx: MutationContext) => PollVotePayload | null;
28
+ /**
29
+ * Decodes a delivery receipt for a message **we** sent.
30
+ *
31
+ * `messages.update` carries every kind of change, including ones about messages
32
+ * other people sent. A receipt is only meaningful for our own outbound
33
+ * messages, so anything without `fromMe` is not ours to report.
34
+ *
35
+ * The payload shape matches `CloudStatusEvent` on purpose: a consumer should
36
+ * not need to know which transport a channel happens to use to learn whether
37
+ * its message arrived.
38
+ */
39
+ export declare const decodeReceipt: (update: MessageUpdate) => CloudStatusEvent | null;