miaw-core 0.9.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.
- package/CHANGELOG.md +305 -0
- package/LICENSE +21 -0
- package/README.md +134 -0
- package/USAGE.md +1399 -0
- package/babel.config.js +5 -0
- package/dist/client/MiawClient.d.ts +580 -0
- package/dist/client/MiawClient.d.ts.map +1 -0
- package/dist/client/MiawClient.js +2637 -0
- package/dist/client/MiawClient.js.map +1 -0
- package/dist/handlers/AuthHandler.d.ts +21 -0
- package/dist/handlers/AuthHandler.d.ts.map +1 -0
- package/dist/handlers/AuthHandler.js +30 -0
- package/dist/handlers/AuthHandler.js.map +1 -0
- package/dist/handlers/MessageHandler.d.ts +45 -0
- package/dist/handlers/MessageHandler.d.ts.map +1 -0
- package/dist/handlers/MessageHandler.js +185 -0
- package/dist/handlers/MessageHandler.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/types/index.d.ts +632 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +44 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/storage.d.ts +25 -0
- package/dist/utils/storage.d.ts.map +1 -0
- package/dist/utils/storage.js +60 -0
- package/dist/utils/storage.js.map +1 -0
- package/package.json +44 -0
- package/tsconfig.json +24 -0
- package/tsconfig.test.json +13 -0
|
@@ -0,0 +1,632 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration options for MiawClient
|
|
3
|
+
*/
|
|
4
|
+
export interface MiawClientOptions {
|
|
5
|
+
/** Unique identifier for this WhatsApp instance */
|
|
6
|
+
instanceId: string;
|
|
7
|
+
/** Directory path where session data will be stored (default: './sessions') */
|
|
8
|
+
sessionPath?: string;
|
|
9
|
+
/** Enable verbose logging (default: false) */
|
|
10
|
+
debug?: boolean;
|
|
11
|
+
/** Custom logger instance (default: pino) */
|
|
12
|
+
logger?: any;
|
|
13
|
+
/** Auto-reconnect on connection loss (default: true) */
|
|
14
|
+
autoReconnect?: boolean;
|
|
15
|
+
/** Maximum reconnection attempts (default: Infinity) */
|
|
16
|
+
maxReconnectAttempts?: number;
|
|
17
|
+
/** Delay between reconnection attempts in ms (default: 3000) */
|
|
18
|
+
reconnectDelay?: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Media metadata extracted from media messages
|
|
22
|
+
*/
|
|
23
|
+
export interface MediaInfo {
|
|
24
|
+
/** MIME type of the media (e.g., 'image/jpeg', 'video/mp4') */
|
|
25
|
+
mimetype?: string;
|
|
26
|
+
/** File size in bytes */
|
|
27
|
+
fileSize?: number;
|
|
28
|
+
/** Original filename (for documents) */
|
|
29
|
+
fileName?: string;
|
|
30
|
+
/** Width in pixels (for images/videos) */
|
|
31
|
+
width?: number;
|
|
32
|
+
/** Height in pixels (for images/videos) */
|
|
33
|
+
height?: number;
|
|
34
|
+
/** Duration in seconds (for audio/video) */
|
|
35
|
+
duration?: number;
|
|
36
|
+
/** Whether this is a voice note / PTT (for audio) */
|
|
37
|
+
ptt?: boolean;
|
|
38
|
+
/** Whether this is a GIF playback video */
|
|
39
|
+
gifPlayback?: boolean;
|
|
40
|
+
/** Whether this is a view-once message */
|
|
41
|
+
viewOnce?: boolean;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Normalized message structure - simplified from Baileys
|
|
45
|
+
*/
|
|
46
|
+
export interface MiawMessage {
|
|
47
|
+
/** Unique message ID */
|
|
48
|
+
id: string;
|
|
49
|
+
/**
|
|
50
|
+
* Sender's WhatsApp JID (Jabber ID)
|
|
51
|
+
*
|
|
52
|
+
* Possible formats:
|
|
53
|
+
* - Standard: '1234567890@s.whatsapp.net' (traditional phone number)
|
|
54
|
+
* - Link ID: '1234567890@lid' (privacy-enhanced, used when phone number is hidden)
|
|
55
|
+
* - Group: '123456789@g.us' (group chats)
|
|
56
|
+
*
|
|
57
|
+
* Note: @lid format was introduced by WhatsApp for enhanced privacy.
|
|
58
|
+
* You can send messages to @lid addresses directly - no conversion needed.
|
|
59
|
+
*/
|
|
60
|
+
from: string;
|
|
61
|
+
/** Sender's phone number (if available, extracted from Baileys message key) */
|
|
62
|
+
senderPhone?: string;
|
|
63
|
+
/** Sender's display name (pushName from WhatsApp) */
|
|
64
|
+
senderName?: string;
|
|
65
|
+
/** Message text content (text or caption for media) */
|
|
66
|
+
text?: string;
|
|
67
|
+
/** Timestamp when message was sent (Unix timestamp in seconds) */
|
|
68
|
+
timestamp: number;
|
|
69
|
+
/** Whether this message is from a group chat */
|
|
70
|
+
isGroup: boolean;
|
|
71
|
+
/** If isGroup is true, this contains the participant's ID who sent the message */
|
|
72
|
+
participant?: string;
|
|
73
|
+
/** Whether this message was sent by the bot itself */
|
|
74
|
+
fromMe: boolean;
|
|
75
|
+
/** Message type */
|
|
76
|
+
type: 'text' | 'image' | 'video' | 'audio' | 'document' | 'sticker' | 'unknown';
|
|
77
|
+
/** Media metadata (only present for media messages: image, video, audio, document, sticker) */
|
|
78
|
+
media?: MediaInfo;
|
|
79
|
+
/** Original raw message from Baileys (for advanced use) */
|
|
80
|
+
raw?: any;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Connection states
|
|
84
|
+
*/
|
|
85
|
+
export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting' | 'qr_required';
|
|
86
|
+
/**
|
|
87
|
+
* Message edit notification
|
|
88
|
+
*/
|
|
89
|
+
export interface MessageEdit {
|
|
90
|
+
/** The message ID that was edited */
|
|
91
|
+
messageId: string;
|
|
92
|
+
/** The chat/conversation JID where the message was edited */
|
|
93
|
+
chatId: string;
|
|
94
|
+
/** New text content after edit */
|
|
95
|
+
newText?: string;
|
|
96
|
+
/** Timestamp of the edit (Unix timestamp in milliseconds) */
|
|
97
|
+
editTimestamp: number;
|
|
98
|
+
/** Original raw Baileys message for advanced use */
|
|
99
|
+
raw?: any;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Message delete notification
|
|
103
|
+
*/
|
|
104
|
+
export interface MessageDelete {
|
|
105
|
+
/** The message ID that was deleted */
|
|
106
|
+
messageId: string;
|
|
107
|
+
/** The chat/conversation JID where the message was deleted */
|
|
108
|
+
chatId: string;
|
|
109
|
+
/** Whether the message was deleted by the sender (true) or recipient (false) */
|
|
110
|
+
fromMe: boolean;
|
|
111
|
+
/** Participant who deleted (for group chats) */
|
|
112
|
+
participant?: string;
|
|
113
|
+
/** Original raw Baileys message for advanced use */
|
|
114
|
+
raw?: any;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Reaction to a message
|
|
118
|
+
*/
|
|
119
|
+
export interface MessageReaction {
|
|
120
|
+
/** The message ID that received the reaction */
|
|
121
|
+
messageId: string;
|
|
122
|
+
/** The chat/conversation JID */
|
|
123
|
+
chatId: string;
|
|
124
|
+
/** The reactor's JID (who sent the reaction) */
|
|
125
|
+
reactorId: string;
|
|
126
|
+
/** Emoji reaction text (empty string means reaction was removed) */
|
|
127
|
+
emoji: string;
|
|
128
|
+
/** Whether the reaction was removed (emoji will be empty) */
|
|
129
|
+
isRemoval: boolean;
|
|
130
|
+
/** Original raw Baileys reaction for advanced use */
|
|
131
|
+
raw?: any;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Events emitted by MiawClient
|
|
135
|
+
*/
|
|
136
|
+
export interface MiawClientEvents {
|
|
137
|
+
/** Emitted when QR code needs to be scanned */
|
|
138
|
+
qr: (qrCode: string) => void;
|
|
139
|
+
/** Emitted when client is ready to send/receive messages */
|
|
140
|
+
ready: () => void;
|
|
141
|
+
/** Emitted when a new message is received */
|
|
142
|
+
message: (message: MiawMessage) => void;
|
|
143
|
+
/** Emitted when a message is edited */
|
|
144
|
+
message_edit: (edit: MessageEdit) => void;
|
|
145
|
+
/** Emitted when a message is deleted/revoked */
|
|
146
|
+
message_delete: (deletion: MessageDelete) => void;
|
|
147
|
+
/** Emitted when a message receives a reaction */
|
|
148
|
+
message_reaction: (reaction: MessageReaction) => void;
|
|
149
|
+
/** Emitted when a contact's presence changes (online/offline/typing) */
|
|
150
|
+
presence: (update: PresenceUpdate) => void;
|
|
151
|
+
/** Emitted when connection state changes */
|
|
152
|
+
connection: (state: ConnectionState) => void;
|
|
153
|
+
/** Emitted when client is disconnected */
|
|
154
|
+
disconnected: (reason?: string) => void;
|
|
155
|
+
/** Emitted when client is attempting to reconnect */
|
|
156
|
+
reconnecting: (attempt: number) => void;
|
|
157
|
+
/** Emitted on errors */
|
|
158
|
+
error: (error: Error) => void;
|
|
159
|
+
/** Emitted when session is saved */
|
|
160
|
+
session_saved: () => void;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Options for sending text messages
|
|
164
|
+
*/
|
|
165
|
+
export interface SendTextOptions {
|
|
166
|
+
/** Quote/reply to a specific message (pass the MiawMessage to reply to) */
|
|
167
|
+
quoted?: MiawMessage;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Media source - can be a file path, URL, or Buffer
|
|
171
|
+
*/
|
|
172
|
+
export type MediaSource = string | Buffer;
|
|
173
|
+
/**
|
|
174
|
+
* Options for sending image messages
|
|
175
|
+
*/
|
|
176
|
+
export interface SendImageOptions {
|
|
177
|
+
/** Image caption */
|
|
178
|
+
caption?: string;
|
|
179
|
+
/** Quote/reply to a specific message (pass the MiawMessage to reply to) */
|
|
180
|
+
quoted?: MiawMessage;
|
|
181
|
+
/** Send as view-once message (disappears after viewing) */
|
|
182
|
+
viewOnce?: boolean;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Options for sending document messages
|
|
186
|
+
*/
|
|
187
|
+
export interface SendDocumentOptions {
|
|
188
|
+
/** Document caption */
|
|
189
|
+
caption?: string;
|
|
190
|
+
/** Custom filename to display (e.g., 'report.pdf') */
|
|
191
|
+
fileName?: string;
|
|
192
|
+
/** MIME type (e.g., 'application/pdf'). Auto-detected from fileName if not provided */
|
|
193
|
+
mimetype?: string;
|
|
194
|
+
/** Quote/reply to a specific message (pass the MiawMessage to reply to) */
|
|
195
|
+
quoted?: MiawMessage;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Options for sending video messages
|
|
199
|
+
*/
|
|
200
|
+
export interface SendVideoOptions {
|
|
201
|
+
/** Video caption */
|
|
202
|
+
caption?: string;
|
|
203
|
+
/** Quote/reply to a specific message (pass the MiawMessage to reply to) */
|
|
204
|
+
quoted?: MiawMessage;
|
|
205
|
+
/** Send as view-once message (disappears after viewing) */
|
|
206
|
+
viewOnce?: boolean;
|
|
207
|
+
/** Play as GIF (loops, no audio) */
|
|
208
|
+
gifPlayback?: boolean;
|
|
209
|
+
/** Send as video note (circular video, like Telegram) */
|
|
210
|
+
ptv?: boolean;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Options for sending audio messages
|
|
214
|
+
*/
|
|
215
|
+
export interface SendAudioOptions {
|
|
216
|
+
/** Quote/reply to a specific message (pass the MiawMessage to reply to) */
|
|
217
|
+
quoted?: MiawMessage;
|
|
218
|
+
/** Send as voice note (PTT - push to talk). Shows as voice message instead of audio file */
|
|
219
|
+
ptt?: boolean;
|
|
220
|
+
/** MIME type (e.g., 'audio/mp4', 'audio/ogg; codecs=opus'). Auto-detected if not provided */
|
|
221
|
+
mimetype?: string;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Result of sending a message
|
|
225
|
+
*/
|
|
226
|
+
export interface SendMessageResult {
|
|
227
|
+
/** Whether the message was sent successfully */
|
|
228
|
+
success: boolean;
|
|
229
|
+
/** Message ID if successful */
|
|
230
|
+
messageId?: string;
|
|
231
|
+
/** Error message if failed */
|
|
232
|
+
error?: string;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Result of checking if a phone number is on WhatsApp
|
|
236
|
+
*/
|
|
237
|
+
export interface CheckNumberResult {
|
|
238
|
+
/** Whether the number exists on WhatsApp */
|
|
239
|
+
exists: boolean;
|
|
240
|
+
/** The JID if the number exists */
|
|
241
|
+
jid?: string;
|
|
242
|
+
/** Error message if check failed */
|
|
243
|
+
error?: string;
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Contact information
|
|
247
|
+
*/
|
|
248
|
+
export interface ContactInfo {
|
|
249
|
+
/** Contact's JID */
|
|
250
|
+
jid: string;
|
|
251
|
+
/** Contact's display name (if available) */
|
|
252
|
+
name?: string;
|
|
253
|
+
/** Contact's phone number */
|
|
254
|
+
phone?: string;
|
|
255
|
+
/** Contact's status/about text */
|
|
256
|
+
status?: string;
|
|
257
|
+
/** Whether this is a business account */
|
|
258
|
+
isBusiness?: boolean;
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Business profile information
|
|
262
|
+
*/
|
|
263
|
+
export interface BusinessProfile {
|
|
264
|
+
/** Business description */
|
|
265
|
+
description?: string;
|
|
266
|
+
/** Business category */
|
|
267
|
+
category?: string;
|
|
268
|
+
/** Business website */
|
|
269
|
+
website?: string;
|
|
270
|
+
/** Business email */
|
|
271
|
+
email?: string;
|
|
272
|
+
/** Business address */
|
|
273
|
+
address?: string;
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Group participant information
|
|
277
|
+
*/
|
|
278
|
+
export interface GroupParticipant {
|
|
279
|
+
/** Participant's JID */
|
|
280
|
+
jid: string;
|
|
281
|
+
/** Participant's role in the group */
|
|
282
|
+
role: 'admin' | 'superadmin' | 'member';
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Group metadata information
|
|
286
|
+
*/
|
|
287
|
+
export interface GroupInfo {
|
|
288
|
+
/** Group JID */
|
|
289
|
+
jid: string;
|
|
290
|
+
/** Group name/subject */
|
|
291
|
+
name: string;
|
|
292
|
+
/** Group description */
|
|
293
|
+
description?: string;
|
|
294
|
+
/** Group owner JID */
|
|
295
|
+
owner?: string;
|
|
296
|
+
/** Group creation timestamp */
|
|
297
|
+
createdAt?: number;
|
|
298
|
+
/** Number of participants */
|
|
299
|
+
participantCount: number;
|
|
300
|
+
/** List of participants */
|
|
301
|
+
participants: GroupParticipant[];
|
|
302
|
+
/** Whether only admins can send messages */
|
|
303
|
+
announce?: boolean;
|
|
304
|
+
/** Whether only admins can edit group info */
|
|
305
|
+
restrict?: boolean;
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Presence status types
|
|
309
|
+
*/
|
|
310
|
+
export type PresenceStatus = 'available' | 'unavailable';
|
|
311
|
+
/**
|
|
312
|
+
* Presence update from a contact
|
|
313
|
+
*/
|
|
314
|
+
export interface PresenceUpdate {
|
|
315
|
+
/** Contact's JID */
|
|
316
|
+
jid: string;
|
|
317
|
+
/** Last known presence status */
|
|
318
|
+
status: 'available' | 'unavailable' | 'composing' | 'recording' | 'paused';
|
|
319
|
+
/** Last seen timestamp (if available) */
|
|
320
|
+
lastSeen?: number;
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Result of a group participant operation (add, remove, promote, demote)
|
|
324
|
+
*/
|
|
325
|
+
export interface ParticipantOperationResult {
|
|
326
|
+
/** Participant JID */
|
|
327
|
+
jid: string;
|
|
328
|
+
/**
|
|
329
|
+
* Operation status code:
|
|
330
|
+
* - '200' = Success
|
|
331
|
+
* - '403' = Not authorized (not admin)
|
|
332
|
+
* - '408' = User left group / doesn't exist
|
|
333
|
+
* - '409' = Already in group (add) / Not in group (remove)
|
|
334
|
+
*/
|
|
335
|
+
status: string;
|
|
336
|
+
/** Whether the operation was successful */
|
|
337
|
+
success: boolean;
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Result of creating a group
|
|
341
|
+
*/
|
|
342
|
+
export interface CreateGroupResult {
|
|
343
|
+
/** Whether the group was created successfully */
|
|
344
|
+
success: boolean;
|
|
345
|
+
/** Group JID if successful */
|
|
346
|
+
groupJid?: string;
|
|
347
|
+
/** Group info if successful */
|
|
348
|
+
groupInfo?: GroupInfo;
|
|
349
|
+
/** Error message if failed */
|
|
350
|
+
error?: string;
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Result of a group operation (generic)
|
|
354
|
+
*/
|
|
355
|
+
export interface GroupOperationResult {
|
|
356
|
+
/** Whether the operation was successful */
|
|
357
|
+
success: boolean;
|
|
358
|
+
/** Error message if failed */
|
|
359
|
+
error?: string;
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* Group invite information (preview before joining)
|
|
363
|
+
*/
|
|
364
|
+
export interface GroupInviteInfo {
|
|
365
|
+
/** Group JID */
|
|
366
|
+
jid: string;
|
|
367
|
+
/** Group name */
|
|
368
|
+
name: string;
|
|
369
|
+
/** Group description */
|
|
370
|
+
description?: string;
|
|
371
|
+
/** Number of participants */
|
|
372
|
+
participantCount: number;
|
|
373
|
+
/** Group creation timestamp */
|
|
374
|
+
createdAt?: number;
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Result of a profile operation (update picture, name, status)
|
|
378
|
+
*/
|
|
379
|
+
export interface ProfileOperationResult {
|
|
380
|
+
/** Whether the operation was successful */
|
|
381
|
+
success: boolean;
|
|
382
|
+
/** Error message if failed */
|
|
383
|
+
error?: string;
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* WhatsApp predefined label IDs
|
|
387
|
+
*/
|
|
388
|
+
export declare enum PredefinedLabelId {
|
|
389
|
+
NewCustomer = 1,
|
|
390
|
+
NewOrder = 2,
|
|
391
|
+
PendingPayment = 3,
|
|
392
|
+
Paid = 4,
|
|
393
|
+
Shipped = 5
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* Label color options (WhatsApp has 20 predefined colors)
|
|
397
|
+
*/
|
|
398
|
+
export declare enum LabelColor {
|
|
399
|
+
Color1 = 0,
|
|
400
|
+
Color2 = 1,
|
|
401
|
+
Color3 = 2,
|
|
402
|
+
Color4 = 3,
|
|
403
|
+
Color5 = 4,
|
|
404
|
+
Color6 = 5,
|
|
405
|
+
Color7 = 6,
|
|
406
|
+
Color8 = 7,
|
|
407
|
+
Color9 = 8,
|
|
408
|
+
Color10 = 9,
|
|
409
|
+
Color11 = 10,
|
|
410
|
+
Color12 = 11,
|
|
411
|
+
Color13 = 12,
|
|
412
|
+
Color14 = 13,
|
|
413
|
+
Color15 = 14,
|
|
414
|
+
Color16 = 15,
|
|
415
|
+
Color17 = 16,
|
|
416
|
+
Color18 = 17,
|
|
417
|
+
Color19 = 18,
|
|
418
|
+
Color20 = 19
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* Label information
|
|
422
|
+
*/
|
|
423
|
+
export interface Label {
|
|
424
|
+
/** Unique label ID */
|
|
425
|
+
id: string;
|
|
426
|
+
/** Label name */
|
|
427
|
+
name: string;
|
|
428
|
+
/** Label color (0-19) */
|
|
429
|
+
color: LabelColor;
|
|
430
|
+
/** Whether this label is deleted */
|
|
431
|
+
deleted?: boolean;
|
|
432
|
+
/** Predefined label ID (if applicable) */
|
|
433
|
+
predefinedId?: PredefinedLabelId;
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* Result of a label operation
|
|
437
|
+
*/
|
|
438
|
+
export interface LabelOperationResult {
|
|
439
|
+
/** Whether the operation was successful */
|
|
440
|
+
success: boolean;
|
|
441
|
+
/** Error message if failed */
|
|
442
|
+
error?: string;
|
|
443
|
+
/** Label ID if successful (for create operations) */
|
|
444
|
+
labelId?: string;
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* Product image URL
|
|
448
|
+
*/
|
|
449
|
+
export interface ProductImage {
|
|
450
|
+
/** Image URL */
|
|
451
|
+
url: string;
|
|
452
|
+
/** Optional image caption */
|
|
453
|
+
caption?: string;
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* Product information
|
|
457
|
+
*/
|
|
458
|
+
export interface Product {
|
|
459
|
+
/** Unique product ID (from WhatsApp) */
|
|
460
|
+
id?: string;
|
|
461
|
+
/** Product name/URL (for images) or product data */
|
|
462
|
+
productUrl?: string;
|
|
463
|
+
/** Product name */
|
|
464
|
+
name?: string;
|
|
465
|
+
/** Product description */
|
|
466
|
+
description?: string;
|
|
467
|
+
/** Product price in cents (multiply by 100) */
|
|
468
|
+
priceAmount1000?: number;
|
|
469
|
+
/** Product images */
|
|
470
|
+
images?: ProductImage[];
|
|
471
|
+
/** Whether product is hidden */
|
|
472
|
+
isHidden?: boolean;
|
|
473
|
+
/** Product retailer ID (your internal SKU) */
|
|
474
|
+
retailerId?: string;
|
|
475
|
+
/** Product URL */
|
|
476
|
+
url?: string;
|
|
477
|
+
/** Product count (for collections) */
|
|
478
|
+
count?: number;
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* Product collection
|
|
482
|
+
*/
|
|
483
|
+
export interface ProductCollection {
|
|
484
|
+
/** Collection ID */
|
|
485
|
+
id: string;
|
|
486
|
+
/** Collection name */
|
|
487
|
+
name: string;
|
|
488
|
+
/** Products in collection */
|
|
489
|
+
products?: Product[];
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* Product catalog result
|
|
493
|
+
*/
|
|
494
|
+
export interface ProductCatalog {
|
|
495
|
+
/** Whether the request was successful */
|
|
496
|
+
success: boolean;
|
|
497
|
+
/** Products in the catalog */
|
|
498
|
+
products?: Product[];
|
|
499
|
+
/** Pagination cursor */
|
|
500
|
+
nextCursor?: string;
|
|
501
|
+
/** Error message if failed */
|
|
502
|
+
error?: string;
|
|
503
|
+
}
|
|
504
|
+
/**
|
|
505
|
+
* Product operation result (create, update, delete)
|
|
506
|
+
*/
|
|
507
|
+
export interface ProductOperationResult {
|
|
508
|
+
/** Whether the operation was successful */
|
|
509
|
+
success: boolean;
|
|
510
|
+
/** Product ID if successful */
|
|
511
|
+
productId?: string;
|
|
512
|
+
/** Number of products deleted (for delete operations) */
|
|
513
|
+
deletedCount?: number;
|
|
514
|
+
/** Error message if failed */
|
|
515
|
+
error?: string;
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* Options for creating/updating a product
|
|
519
|
+
*/
|
|
520
|
+
export interface ProductOptions {
|
|
521
|
+
/** Product name */
|
|
522
|
+
name: string;
|
|
523
|
+
/** Product description */
|
|
524
|
+
description?: string;
|
|
525
|
+
/** Product price in smallest currency unit (e.g., cents for USD) */
|
|
526
|
+
price: number;
|
|
527
|
+
/** Product image URLs */
|
|
528
|
+
imageUrls?: string[];
|
|
529
|
+
/** Whether product is hidden from catalog */
|
|
530
|
+
isHidden?: boolean;
|
|
531
|
+
/** Your internal product ID/SKU */
|
|
532
|
+
retailerId?: string;
|
|
533
|
+
/** Product landing page URL */
|
|
534
|
+
url?: string;
|
|
535
|
+
}
|
|
536
|
+
/**
|
|
537
|
+
* Newsletter metadata
|
|
538
|
+
*/
|
|
539
|
+
export interface NewsletterMetadata {
|
|
540
|
+
/** Newsletter JID */
|
|
541
|
+
id: string;
|
|
542
|
+
/** Newsletter name */
|
|
543
|
+
name: string;
|
|
544
|
+
/** Newsletter description */
|
|
545
|
+
description?: string;
|
|
546
|
+
/** Newsletter picture URL */
|
|
547
|
+
pictureUrl?: string;
|
|
548
|
+
/** Subscriber count */
|
|
549
|
+
subscribers?: number;
|
|
550
|
+
/** Whether this is a newsletter you created */
|
|
551
|
+
isCreator?: boolean;
|
|
552
|
+
/** Whether you're subscribed to this newsletter */
|
|
553
|
+
isFollowing?: boolean;
|
|
554
|
+
/** Whether newsletter is muted */
|
|
555
|
+
isMuted?: boolean;
|
|
556
|
+
/** Newsletter creation timestamp */
|
|
557
|
+
createdAt?: number;
|
|
558
|
+
/** Newsletter update timestamp */
|
|
559
|
+
updatedAt?: number;
|
|
560
|
+
}
|
|
561
|
+
/**
|
|
562
|
+
* Newsletter message
|
|
563
|
+
*/
|
|
564
|
+
export interface NewsletterMessage {
|
|
565
|
+
/** Message ID */
|
|
566
|
+
id: string;
|
|
567
|
+
/** Newsletter JID */
|
|
568
|
+
newsletterId: string;
|
|
569
|
+
/** Message content (text or media) */
|
|
570
|
+
content?: string;
|
|
571
|
+
/** Message timestamp */
|
|
572
|
+
timestamp: number;
|
|
573
|
+
/** Media URL (if applicable) */
|
|
574
|
+
mediaUrl?: string;
|
|
575
|
+
/** Media type */
|
|
576
|
+
mediaType?: string;
|
|
577
|
+
}
|
|
578
|
+
/**
|
|
579
|
+
* Newsletter messages result
|
|
580
|
+
*/
|
|
581
|
+
export interface NewsletterMessagesResult {
|
|
582
|
+
/** Whether the request was successful */
|
|
583
|
+
success: boolean;
|
|
584
|
+
/** Messages fetched */
|
|
585
|
+
messages?: NewsletterMessage[];
|
|
586
|
+
/** Next pagination cursor */
|
|
587
|
+
nextCursor?: string;
|
|
588
|
+
/** Error message if failed */
|
|
589
|
+
error?: string;
|
|
590
|
+
}
|
|
591
|
+
/**
|
|
592
|
+
* Newsletter operation result
|
|
593
|
+
*/
|
|
594
|
+
export interface NewsletterOperationResult {
|
|
595
|
+
/** Whether the operation was successful */
|
|
596
|
+
success: boolean;
|
|
597
|
+
/** Newsletter ID if created */
|
|
598
|
+
newsletterId?: string;
|
|
599
|
+
/** Error message if failed */
|
|
600
|
+
error?: string;
|
|
601
|
+
}
|
|
602
|
+
/**
|
|
603
|
+
* Newsletter subscription info
|
|
604
|
+
*/
|
|
605
|
+
export interface NewsletterSubscriptionInfo {
|
|
606
|
+
/** Subscriber count */
|
|
607
|
+
subscribers?: number;
|
|
608
|
+
/** Admin count */
|
|
609
|
+
adminCount?: number;
|
|
610
|
+
}
|
|
611
|
+
/**
|
|
612
|
+
* Contact information for adding/editing
|
|
613
|
+
*/
|
|
614
|
+
export interface ContactData {
|
|
615
|
+
/** Contact's phone number (with country code) */
|
|
616
|
+
phone: string;
|
|
617
|
+
/** Contact's display name */
|
|
618
|
+
name: string;
|
|
619
|
+
/** Additional contact info (for advanced use) */
|
|
620
|
+
firstName?: string;
|
|
621
|
+
lastName?: string;
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* Contact operation result
|
|
625
|
+
*/
|
|
626
|
+
export interface ContactOperationResult {
|
|
627
|
+
/** Whether the operation was successful */
|
|
628
|
+
success: boolean;
|
|
629
|
+
/** Error message if failed */
|
|
630
|
+
error?: string;
|
|
631
|
+
}
|
|
632
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,mDAAmD;IACnD,UAAU,EAAE,MAAM,CAAC;IAEnB,+EAA+E;IAC/E,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,8CAA8C;IAC9C,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,6CAA6C;IAC7C,MAAM,CAAC,EAAE,GAAG,CAAC;IAEb,wDAAwD;IACxD,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB,wDAAwD;IACxD,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAE9B,gEAAgE;IAChE,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,yBAAyB;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,2CAA2C;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,qDAAqD;IACrD,GAAG,CAAC,EAAE,OAAO,CAAC;IAEd,2CAA2C;IAC3C,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,wBAAwB;IACxB,EAAE,EAAE,MAAM,CAAC;IAEX;;;;;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AAC;CAChB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LabelColor = exports.PredefinedLabelId = void 0;
|
|
4
|
+
// ============================================
|
|
5
|
+
// Label Types (v0.9.0) - WhatsApp Business only
|
|
6
|
+
// ============================================
|
|
7
|
+
/**
|
|
8
|
+
* WhatsApp predefined label IDs
|
|
9
|
+
*/
|
|
10
|
+
var PredefinedLabelId;
|
|
11
|
+
(function (PredefinedLabelId) {
|
|
12
|
+
PredefinedLabelId[PredefinedLabelId["NewCustomer"] = 1] = "NewCustomer";
|
|
13
|
+
PredefinedLabelId[PredefinedLabelId["NewOrder"] = 2] = "NewOrder";
|
|
14
|
+
PredefinedLabelId[PredefinedLabelId["PendingPayment"] = 3] = "PendingPayment";
|
|
15
|
+
PredefinedLabelId[PredefinedLabelId["Paid"] = 4] = "Paid";
|
|
16
|
+
PredefinedLabelId[PredefinedLabelId["Shipped"] = 5] = "Shipped";
|
|
17
|
+
})(PredefinedLabelId || (exports.PredefinedLabelId = PredefinedLabelId = {}));
|
|
18
|
+
/**
|
|
19
|
+
* Label color options (WhatsApp has 20 predefined colors)
|
|
20
|
+
*/
|
|
21
|
+
var LabelColor;
|
|
22
|
+
(function (LabelColor) {
|
|
23
|
+
LabelColor[LabelColor["Color1"] = 0] = "Color1";
|
|
24
|
+
LabelColor[LabelColor["Color2"] = 1] = "Color2";
|
|
25
|
+
LabelColor[LabelColor["Color3"] = 2] = "Color3";
|
|
26
|
+
LabelColor[LabelColor["Color4"] = 3] = "Color4";
|
|
27
|
+
LabelColor[LabelColor["Color5"] = 4] = "Color5";
|
|
28
|
+
LabelColor[LabelColor["Color6"] = 5] = "Color6";
|
|
29
|
+
LabelColor[LabelColor["Color7"] = 6] = "Color7";
|
|
30
|
+
LabelColor[LabelColor["Color8"] = 7] = "Color8";
|
|
31
|
+
LabelColor[LabelColor["Color9"] = 8] = "Color9";
|
|
32
|
+
LabelColor[LabelColor["Color10"] = 9] = "Color10";
|
|
33
|
+
LabelColor[LabelColor["Color11"] = 10] = "Color11";
|
|
34
|
+
LabelColor[LabelColor["Color12"] = 11] = "Color12";
|
|
35
|
+
LabelColor[LabelColor["Color13"] = 12] = "Color13";
|
|
36
|
+
LabelColor[LabelColor["Color14"] = 13] = "Color14";
|
|
37
|
+
LabelColor[LabelColor["Color15"] = 14] = "Color15";
|
|
38
|
+
LabelColor[LabelColor["Color16"] = 15] = "Color16";
|
|
39
|
+
LabelColor[LabelColor["Color17"] = 16] = "Color17";
|
|
40
|
+
LabelColor[LabelColor["Color18"] = 17] = "Color18";
|
|
41
|
+
LabelColor[LabelColor["Color19"] = 18] = "Color19";
|
|
42
|
+
LabelColor[LabelColor["Color20"] = 19] = "Color20";
|
|
43
|
+
})(LabelColor || (exports.LabelColor = LabelColor = {}));
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;AAwgBA,+CAA+C;AAC/C,gDAAgD;AAChD,+CAA+C;AAE/C;;GAEG;AACH,IAAY,iBAMX;AAND,WAAY,iBAAiB;IAC3B,uEAAe,CAAA;IACf,iEAAY,CAAA;IACZ,6EAAkB,CAAA;IAClB,yDAAQ,CAAA;IACR,+DAAW,CAAA;AACb,CAAC,EANW,iBAAiB,iCAAjB,iBAAiB,QAM5B;AAED;;GAEG;AACH,IAAY,UAqBX;AArBD,WAAY,UAAU;IACpB,+CAAU,CAAA;IACV,+CAAM,CAAA;IACN,+CAAM,CAAA;IACN,+CAAM,CAAA;IACN,+CAAM,CAAA;IACN,+CAAM,CAAA;IACN,+CAAM,CAAA;IACN,+CAAM,CAAA;IACN,+CAAM,CAAA;IACN,iDAAO,CAAA;IACP,kDAAO,CAAA;IACP,kDAAO,CAAA;IACP,kDAAO,CAAA;IACP,kDAAO,CAAA;IACP,kDAAO,CAAA;IACP,kDAAO,CAAA;IACP,kDAAO,CAAA;IACP,kDAAO,CAAA;IACP,kDAAO,CAAA;IACP,kDAAO,CAAA;AACT,CAAC,EArBW,UAAU,0BAAV,UAAU,QAqBrB"}
|