zaileys 4.17.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.
@@ -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;