@vinzsocket/baileys 3.2.5 → 3.2.7

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.
@@ -24,154 +24,6 @@ export interface ExtendedMessageUtils {
24
24
  generateMessageID: () => string;
25
25
  }
26
26
 
27
- // ─── Native Flow V7 Button Types ─────────────────────────────────────────────
28
-
29
- export interface NFButtonUrlOptions {
30
- id?: string;
31
- displayText: string;
32
- url: string;
33
- merchantUrl?: string;
34
- }
35
- export interface NFButtonCallOptions {
36
- id?: string;
37
- displayText: string;
38
- phoneNumber: string;
39
- }
40
- export interface NFButtonCopyOptions {
41
- id?: string;
42
- displayText: string;
43
- copyCode: string;
44
- }
45
- export interface NFButtonReminderOptions {
46
- id?: string;
47
- displayText: string;
48
- title: string;
49
- notes: string;
50
- startTime: number;
51
- endTime: number;
52
- timezone?: string;
53
- }
54
- export interface NFButtonCancelReminderOptions {
55
- id?: string;
56
- displayText: string;
57
- reminderKey: string;
58
- }
59
- export interface NFButtonAddressOptions {
60
- id?: string;
61
- displayText: string;
62
- label?: string;
63
- }
64
- export interface NFButtonLocationOptions {
65
- id?: string;
66
- displayText: string;
67
- }
68
- export interface NFButtonQuickReplyOptions {
69
- id?: string;
70
- displayText: string;
71
- payload?: string;
72
- }
73
- export interface NFButtonSingleSelectRow {
74
- id: string;
75
- title: string;
76
- description?: string;
77
- }
78
- export interface NFButtonSingleSelectSection {
79
- title?: string;
80
- highlight_label?: string;
81
- rows: NFButtonSingleSelectRow[];
82
- }
83
- export interface NFButtonSingleSelectOptions {
84
- id?: string;
85
- displayText: string;
86
- sections: NFButtonSingleSelectSection[];
87
- }
88
- export interface NFButtonReviewPayOptions {
89
- id?: string;
90
- currency?: string;
91
- totalAmount1000: number;
92
- subtotal?: any;
93
- tax?: any;
94
- items?: any[];
95
- merchant?: any;
96
- }
97
- export interface NFButtonReviewOrderOptions {
98
- id?: string;
99
- referenceId: string;
100
- type?: string;
101
- orderId: string;
102
- }
103
- export interface NFButtonMPMSection {
104
- title?: string;
105
- productItems: Array<{ productId: string } | { product_id: string }>;
106
- }
107
- export interface NFButtonMPMOptions {
108
- id?: string;
109
- sections: NFButtonMPMSection[];
110
- }
111
-
112
- /** Buka URL */
113
- export declare function nfButtonUrl(opts: NFButtonUrlOptions): proto.Message.InteractiveMessage.INativeFlowButton;
114
- /** Telepon */
115
- export declare function nfButtonCall(opts: NFButtonCallOptions): proto.Message.InteractiveMessage.INativeFlowButton;
116
- /** Salin teks/kode */
117
- export declare function nfButtonCopy(opts: NFButtonCopyOptions): proto.Message.InteractiveMessage.INativeFlowButton;
118
- /** Set reminder */
119
- export declare function nfButtonReminder(opts: NFButtonReminderOptions): proto.Message.InteractiveMessage.INativeFlowButton;
120
- /** Batalkan reminder */
121
- export declare function nfButtonCancelReminder(opts: NFButtonCancelReminderOptions): proto.Message.InteractiveMessage.INativeFlowButton;
122
- /** Isi alamat */
123
- export declare function nfButtonAddress(opts: NFButtonAddressOptions): proto.Message.InteractiveMessage.INativeFlowButton;
124
- /** Kirim lokasi */
125
- export declare function nfButtonLocation(opts: NFButtonLocationOptions): proto.Message.InteractiveMessage.INativeFlowButton;
126
- /** Quick reply dengan payload */
127
- export declare function nfButtonQuickReply(opts: NFButtonQuickReplyOptions): proto.Message.InteractiveMessage.INativeFlowButton;
128
- /** Dropdown single-select (bottom sheet) */
129
- export declare function nfButtonSingleSelect(opts: NFButtonSingleSelectOptions): proto.Message.InteractiveMessage.INativeFlowButton;
130
- /** Review & bayar */
131
- export declare function nfButtonReviewPay(opts: NFButtonReviewPayOptions): proto.Message.InteractiveMessage.INativeFlowButton;
132
- /** Review order */
133
- export declare function nfButtonReviewOrder(opts: NFButtonReviewOrderOptions): proto.Message.InteractiveMessage.INativeFlowButton;
134
- /** Multi-Product Message (katalog) */
135
- export declare function nfButtonMPM(opts: NFButtonMPMOptions): proto.Message.InteractiveMessage.INativeFlowButton;
136
-
137
- // ─── Nested List ──────────────────────────────────────────────────────────────
138
-
139
- export interface FlatListRow {
140
- rowId?: string;
141
- id?: string;
142
- title: string;
143
- description?: string;
144
- }
145
-
146
- export interface NestedListRow {
147
- title: string;
148
- rows: FlatListRow[];
149
- }
150
-
151
- export type ListRow = FlatListRow | NestedListRow;
152
-
153
- export interface ListSection {
154
- title?: string;
155
- rows: ListRow[];
156
- }
157
-
158
- export interface NestedListMessageOptions {
159
- title: string;
160
- buttonText: string;
161
- footer?: string;
162
- sections: ListSection[];
163
- }
164
-
165
- /**
166
- * Build raw `listMessage` proto payload dengan dukungan nested section.
167
- * Rows yang punya sub-rows di-flatten jadi section tersendiri.
168
- */
169
- export declare function buildNestedListMessage(opts: NestedListMessageOptions): {
170
- listMessage: proto.Message.IListMessage;
171
- };
172
-
173
- // ─── Message Interfaces ───────────────────────────────────────────────────────
174
-
175
27
  export interface StickerMessage {
176
28
  url: string;
177
29
  fileSha256: Buffer | string;
@@ -310,19 +162,10 @@ export interface ExtendedMessageContent {
310
162
  eventMessage?: EventMessage;
311
163
  pollResultMessage?: PollResultMessage;
312
164
  groupStatusMessage?: GroupStatusMessage;
313
- nestedListMessage?: NestedListMessageOptions;
314
165
  sender?: string;
315
166
  }
316
167
 
317
- export type ExtendedMessageType =
318
- | 'PAYMENT'
319
- | 'PRODUCT'
320
- | 'INTERACTIVE'
321
- | 'ALBUM'
322
- | 'EVENT'
323
- | 'POLL_RESULT'
324
- | 'GROUP_STORY'
325
- | 'NESTED_LIST';
168
+ export type ExtendedMessageType = 'PAYMENT' | 'PRODUCT' | 'INTERACTIVE' | 'ALBUM' | 'EVENT' | 'POLL_RESULT' | 'GROUP_STORY';
326
169
 
327
170
  export declare class ExtendedMessageBuilder {
328
171
  utils: ExtendedMessageUtils;
@@ -334,20 +177,28 @@ export declare class ExtendedMessageBuilder {
334
177
  getContentType: (msg: any) => string;
335
178
  };
336
179
 
337
- constructor(
338
- utils: ExtendedMessageUtils,
339
- waUploadToServer: WAMediaUploadFunction,
340
- relayMessageFn: (jid: string, content: any, options?: any) => Promise<any>
341
- );
180
+ constructor(utils: ExtendedMessageUtils, waUploadToServer: WAMediaUploadFunction, relayMessageFn: (jid: string, content: any, options?: any) => Promise<any>);
342
181
 
343
182
  detectType(content: ExtendedMessageContent): ExtendedMessageType | null;
344
- handlePayment(content: { requestPaymentMessage: PaymentMessage }, quoted?: proto.IWebMessageInfo | null): Promise<{ requestPaymentMessage: proto.Message.RequestPaymentMessage }>;
345
- handleProduct(content: { productMessage: ProductMessage }, jid: string, quoted?: proto.IWebMessageInfo | null): Promise<{ viewOnceMessage: { message: { interactiveMessage: any } } }>;
346
- handleInteractive(content: { interactiveMessage: InteractiveMessage }, jid: string, quoted?: proto.IWebMessageInfo | null, options?: { mentions?: string[] }): Promise<{ interactiveMessage: any }>;
347
- handleNestedList(content: { nestedListMessage: NestedListMessageOptions }, jid: string, quoted?: proto.IWebMessageInfo | null): Promise<any>;
183
+
184
+ handlePayment(content: { requestPaymentMessage: PaymentMessage }, quoted?: proto.IWebMessageInfo | null): Promise<{
185
+ requestPaymentMessage: proto.Message.RequestPaymentMessage;
186
+ }>;
187
+
188
+ handleProduct(content: { productMessage: ProductMessage }, jid: string, quoted?: proto.IWebMessageInfo | null): Promise<{
189
+ viewOnceMessage: { message: { interactiveMessage: any } };
190
+ }>;
191
+
192
+ handleInteractive(content: { interactiveMessage: InteractiveMessage }, jid: string, quoted?: proto.IWebMessageInfo | null, options?: { mentions?: string[] }): Promise<{
193
+ interactiveMessage: any;
194
+ }>;
195
+
348
196
  handleAlbum(content: { albumMessage: AlbumItem[] }, jid: string, quoted?: proto.IWebMessageInfo | null): Promise<any>;
197
+
349
198
  handleEvent(content: { eventMessage: EventMessage }, jid: string, quoted?: proto.IWebMessageInfo | null): Promise<any>;
199
+
350
200
  handlePollResult(content: { pollResultMessage: PollResultMessage }, jid: string, quoted?: proto.IWebMessageInfo | null): Promise<any>;
201
+
351
202
  handleGroupStory(content: { groupStatusMessage: GroupStatusMessage }, jid: string, quoted?: proto.IWebMessageInfo | null): Promise<any>;
352
203
  }
353
204