@areumtecnologia/wasockets 2.2.3 → 2.3.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.
Files changed (31) hide show
  1. package/README.md +74 -16
  2. package/lib/Client/Builders/Buttons.js +127 -0
  3. package/lib/Client/Builders/EventBuilder.js +122 -0
  4. package/lib/Client/Builders/InteractiveMessage.js +150 -0
  5. package/lib/Client/Builders/Lists.js +78 -0
  6. package/lib/Client/Builders/PollBuilder.js +84 -0
  7. package/lib/Client/Builders/index.js +21 -0
  8. package/lib/Client/Constants.js +54 -0
  9. package/lib/Client/Context/CallContext.js +96 -0
  10. package/lib/Client/Context/MediaObject.js +155 -0
  11. package/lib/Client/Context/MessageContext.js +146 -0
  12. package/lib/Client/Modules/BusinessManager.js +155 -0
  13. package/lib/Client/Modules/ChannelManager.js +144 -0
  14. package/lib/Client/Modules/ChatManager.js +113 -0
  15. package/lib/Client/Modules/CommunityManager.js +136 -0
  16. package/lib/Client/Modules/GroupManager.js +194 -0
  17. package/lib/Client/Modules/LabelManager.js +123 -0
  18. package/lib/Client/Modules/MessageManager.js +198 -0
  19. package/lib/Client/Modules/PresenceManager.js +68 -0
  20. package/lib/Client/Modules/PrivacyManager.js +98 -0
  21. package/lib/Client/Modules/ProfileManager.js +92 -0
  22. package/lib/Client/Modules/UserManager.js +92 -0
  23. package/lib/Client/Modules/VoipManager.js +117 -0
  24. package/lib/Client/Modules/index.js +29 -0
  25. package/lib/Client/Normalizers/EventNormalizer.js +82 -0
  26. package/lib/Client/Normalizers/JidNormalizer.js +93 -0
  27. package/lib/Client/Normalizers/MessageNormalizer.js +134 -0
  28. package/lib/Client/WaClient.js +438 -0
  29. package/lib/Client/index.d.ts +464 -0
  30. package/lib/Client/index.js +76 -0
  31. package/package.json +29 -23
@@ -0,0 +1,464 @@
1
+ import { EventEmitter } from 'events'
2
+ import { Readable } from 'stream'
3
+ import { AuthenticationState, proto, AnyMessageContent, MiscMessageGenerationOptions, GroupMetadata } from '../Types'
4
+
5
+ export declare const Events: {
6
+ readonly STATUS_CHANGE: 'status.change'
7
+ readonly QR_CODE: 'qr'
8
+ readonly PAIRING_CODE: 'pairing.code'
9
+ readonly CONNECTED: 'connected'
10
+ readonly DISCONNECTED: 'disconnected'
11
+ readonly LOGGED_OUT: 'logged.out'
12
+ readonly MESSAGE_RECEIVED: 'message.received'
13
+ readonly MESSAGE_SENT: 'message.sent'
14
+ readonly MESSAGE_UPDATE: 'message.update'
15
+ readonly MESSAGE_DELETE: 'message.delete'
16
+ readonly PRESENCE_UPDATE: 'presence.update'
17
+ readonly CONTACTS_UPSERT: 'contacts.upsert'
18
+ readonly CALL_INCOMING: 'call.incoming'
19
+ readonly CALL_STATUS: 'call.status'
20
+ readonly GROUP_PARTICIPANTS_UPDATE: 'group.participants.update'
21
+ readonly ERROR: 'error'
22
+ }
23
+
24
+ export type EventNames = typeof Events[keyof typeof Events]
25
+
26
+ export declare const ConnectionStatus: {
27
+ readonly IDLE: 'idle'
28
+ readonly INITIALIZING: 'initializing'
29
+ readonly CONNECTING: 'connecting'
30
+ readonly QR_READY: 'qr_ready'
31
+ readonly PAIRING_READY: 'pairing_ready'
32
+ readonly CONNECTED: 'connected'
33
+ readonly RECONNECTING: 'reconnecting'
34
+ readonly LOGGED_OUT: 'logged_out'
35
+ readonly DISCONNECTED: 'disconnected'
36
+ }
37
+
38
+ export type ConnectionStatusType = typeof ConnectionStatus[keyof typeof ConnectionStatus]
39
+
40
+ export interface WaClientOptions {
41
+ sessionName?: string
42
+ dataPath?: string
43
+ auth?: { state: AuthenticationState; saveCreds: () => Promise<void> }
44
+ phoneNumber?: string
45
+ printQRInTerminal?: boolean
46
+ restartOnClose?: boolean
47
+ maxReconnectAttempts?: number
48
+ syncFullHistory?: boolean
49
+ markOnlineOnConnect?: boolean
50
+ socketOptions?: Record<string, any>
51
+ logger?: any
52
+ }
53
+
54
+ export declare class MediaObject {
55
+ mediaNode: any
56
+ rawType: string
57
+ mediaType: string
58
+ mimetype: string
59
+ fileLength: number
60
+ fileName: string
61
+ seconds: number
62
+ isVoice: boolean
63
+ isAnimated: boolean
64
+ extension: string
65
+
66
+ constructor(mediaNode: any, canonicalType: string)
67
+
68
+ toStream(options?: any): Promise<Readable>
69
+ toBuffer(options?: any): Promise<Buffer>
70
+ save(destinationPath: string, options?: any): Promise<string>
71
+ toBase64(options?: any): Promise<string>
72
+ toDataUri(options?: any): Promise<string>
73
+ toSharp(options?: any): Promise<any>
74
+ }
75
+
76
+ export declare class CallContext {
77
+ client: WaClient
78
+ raw: any
79
+ id: string
80
+ from: string
81
+ fromNumber: string
82
+ isVideo: boolean
83
+ status: string
84
+ startTime: number
85
+ instance: any | null
86
+
87
+ constructor(client: WaClient, callData: any, activeCallInstance?: any)
88
+
89
+ accept(options?: { isVideo?: boolean; durationMs?: number; audioSource?: any }): Promise<any>
90
+ reject(reason?: number | string): Promise<void>
91
+ hangup(): Promise<void>
92
+ playAudio(audioPathOrBuffer: string | Buffer): Promise<any>
93
+ }
94
+
95
+ export interface QuotedMessageContext {
96
+ id: string
97
+ sender: string
98
+ senderNumber: string
99
+ type: string
100
+ body: string
101
+ raw: proto.IMessage
102
+ }
103
+
104
+ export declare class MessageContext {
105
+ client: WaClient
106
+ raw: proto.IWebMessageInfo
107
+ id: string
108
+ chatId: string
109
+ isFromMe: boolean
110
+ isGroup: boolean
111
+ isChannel: boolean
112
+ isBroadcast: boolean
113
+ sender: string
114
+ senderNumber: string
115
+ senderName: string
116
+ type: string
117
+ body: string
118
+ mediaNode: any | null
119
+ hasMedia: boolean
120
+ media: MediaObject | null
121
+ timestamp: number
122
+ contextInfo: proto.IContextInfo | null
123
+ mentionedJids: string[]
124
+ quoted: QuotedMessageContext | null
125
+
126
+ constructor(client: WaClient, rawMessage: proto.IWebMessageInfo)
127
+
128
+ reply(content: string | AnyMessageContent, options?: MiscMessageGenerationOptions): Promise<proto.WebMessageInfo | undefined>
129
+ react(emoji: string): Promise<proto.WebMessageInfo | undefined>
130
+ removeReaction(): Promise<proto.WebMessageInfo | undefined>
131
+ delete(): Promise<proto.WebMessageInfo | undefined>
132
+ markRead(): Promise<void>
133
+ forward(targetJid: string, options?: MiscMessageGenerationOptions): Promise<proto.WebMessageInfo | undefined>
134
+ pin(durationInSeconds?: number): Promise<any>
135
+ unpin(): Promise<any>
136
+ }
137
+
138
+ export declare class QuickReplyButton {
139
+ displayText: string
140
+ id: string
141
+ constructor(displayText: string, id?: string)
142
+ build(): { name: string; buttonParamsJson: string }
143
+ }
144
+
145
+ export declare class UrlButton {
146
+ displayText: string
147
+ url: string
148
+ merchantUrl?: string
149
+ constructor(displayText: string, url: string, merchantUrl?: string)
150
+ build(): { name: string; buttonParamsJson: string }
151
+ }
152
+
153
+ export declare class CopyCodeButton {
154
+ displayText: string
155
+ copyCode: string
156
+ id?: string
157
+ constructor(displayText: string, copyCode: string, id?: string)
158
+ build(): { name: string; buttonParamsJson: string }
159
+ }
160
+
161
+ export declare class CallButton {
162
+ displayText: string
163
+ phoneNumber: string
164
+ constructor(displayText: string, phoneNumber: string)
165
+ build(): { name: string; buttonParamsJson: string }
166
+ }
167
+
168
+ export declare class PixButton {
169
+ displayText: string
170
+ pixKey: string
171
+ keyType: string
172
+ merchantName: string
173
+ constructor(displayText: string, pixKey: string, keyType?: 'CPF' | 'EMAIL' | 'PHONE' | 'EVP' | string, merchantName?: string)
174
+ build(): { name: string; buttonParamsJson: string }
175
+ }
176
+
177
+ export declare class ListRow {
178
+ title: string
179
+ description: string
180
+ rowId: string
181
+ constructor(title: string, description?: string, rowId?: string)
182
+ build(): { title: string; description: string; rowId: string }
183
+ }
184
+
185
+ export declare class ListSection {
186
+ title: string
187
+ rows: (ListRow | any)[]
188
+ constructor(title: string, rows?: ListRow[])
189
+ addRow(titleOrRow: string | ListRow, description?: string, rowId?: string): this
190
+ build(): { title: string; rows: any[] }
191
+ }
192
+
193
+ export declare class ListButton {
194
+ buttonText: string
195
+ sections: (ListSection | any)[]
196
+ constructor(buttonText: string, sections?: ListSection[])
197
+ addSection(titleOrSection: string | ListSection, rows?: ListRow[]): this
198
+ build(): { buttonText: string; sections: any[] }
199
+ }
200
+
201
+ export declare class InteractiveMessage {
202
+ setTitle(title: string): this
203
+ setSubtitle(subtitle: string): this
204
+ setText(text: string): this
205
+ setFooter(footer: string): this
206
+ setHeaderImage(image: string | Buffer | { url: string }): this
207
+ setHeaderVideo(video: string | Buffer | { url: string }): this
208
+ addButton(button: any): this
209
+ addButtons(buttons: any[]): this
210
+ build(): any
211
+ }
212
+
213
+ export declare class PollBuilder {
214
+ setName(name: string): this
215
+ addOption(option: string): this
216
+ addOptions(options: string[]): this
217
+ setSelectableCount(count: number): this
218
+ build(): { poll: { name: string; values: string[]; selectableCount: number } }
219
+ }
220
+
221
+ export declare class EventBuilder {
222
+ setName(name: string): this
223
+ setDescription(description: string): this
224
+ setStartDate(date: Date | number): this
225
+ setEndDate(date: Date | number): this
226
+ setLocation(name: string, degreesLatitude?: number, degreesLongitude?: number): this
227
+ setCall(callType?: 'voice' | 'video' | 1 | 2): this
228
+ build(): { event: any }
229
+ }
230
+
231
+ export declare class MessageManager {
232
+ constructor(client: WaClient)
233
+ sendText(jid: string, text: string, options?: any): Promise<proto.WebMessageInfo | undefined>
234
+ sendMedia(jid: string, type: 'image' | 'video' | 'audio' | 'document' | 'sticker', content: any, options?: any): Promise<proto.WebMessageInfo | undefined>
235
+ sendAlbum(jid: string, items: any[], options?: any): Promise<proto.WebMessageInfo | undefined>
236
+ sendVoice(jid: string, audioSource: any, options?: any): Promise<proto.WebMessageInfo | undefined>
237
+ sendContact(jid: string, name: string, phoneNumber: string, options?: any): Promise<proto.WebMessageInfo | undefined>
238
+ sendLocation(jid: string, coords: { latitude: number; longitude: number; name?: string; address?: string; live?: boolean }, options?: any): Promise<proto.WebMessageInfo | undefined>
239
+ forward(targetJid: string, message: any, options?: any): Promise<proto.WebMessageInfo | undefined>
240
+ delete(jid: string, messageKey: proto.IMessageKey): Promise<proto.WebMessageInfo | undefined>
241
+ edit(jid: string, messageKey: proto.IMessageKey, newText: string): Promise<proto.WebMessageInfo | undefined>
242
+ pin(jid: string, messageKey: proto.IMessageKey, durationSeconds?: number): Promise<any>
243
+ unpin(jid: string, messageKey: proto.IMessageKey): Promise<any>
244
+ react(jid: string, messageKey: proto.IMessageKey, emoji: string): Promise<proto.WebMessageInfo | undefined>
245
+ }
246
+
247
+ export declare class GroupManager {
248
+ constructor(client: WaClient)
249
+ create(subject: string, participants: string[]): Promise<GroupMetadata>
250
+ getMetadata(groupJid: string): Promise<GroupMetadata>
251
+ addMembers(groupJid: string, participants: string[]): Promise<any>
252
+ removeMembers(groupJid: string, participants: string[]): Promise<any>
253
+ promote(groupJid: string, participants: string[]): Promise<any>
254
+ demote(groupJid: string, participants: string[]): Promise<any>
255
+ getInviteCode(groupJid: string): Promise<string>
256
+ revokeInviteCode(groupJid: string): Promise<string>
257
+ joinWithCode(inviteCode: string): Promise<string>
258
+ setSubject(groupJid: string, subject: string): Promise<void>
259
+ setDescription(groupJid: string, description: string): Promise<void>
260
+ setAnnounceOnly(groupJid: string, announceOnly?: boolean): Promise<void>
261
+ setLocked(groupJid: string, locked?: boolean): Promise<void>
262
+ mentionAll(groupJid: string, textOrContent: string | any, options?: any): Promise<proto.WebMessageInfo | undefined>
263
+ }
264
+
265
+ export declare class ChannelManager {
266
+ constructor(client: WaClient)
267
+ create(name: string, description?: string): Promise<any>
268
+ getMetadata(channelJidOrInvite: string): Promise<any>
269
+ subscribe(channelJid: string): Promise<any>
270
+ unsubscribe(channelJid: string): Promise<any>
271
+ mute(channelJid: string): Promise<any>
272
+ unmute(channelJid: string): Promise<any>
273
+ listSubscribed(): Promise<any[]>
274
+ fetchMessages(channelJid: string, count?: number, sinceTimestamp?: number): Promise<proto.WebMessageInfo[]>
275
+ fetchReactions(channelJid: string, messageServerId: string): Promise<any>
276
+ setName(channelJid: string, name: string): Promise<any>
277
+ setDescription(channelJid: string, description: string): Promise<any>
278
+ }
279
+
280
+ export declare class PresenceManager {
281
+ constructor(client: WaClient)
282
+ startTyping(jid: string): { stop: () => Promise<void> }
283
+ startRecording(jid: string): { stop: () => Promise<void> }
284
+ setOnline(): Promise<void>
285
+ setOffline(): Promise<void>
286
+ subscribe(jid: string): Promise<void>
287
+ }
288
+
289
+ export declare class ProfileManager {
290
+ constructor(client: WaClient)
291
+ updateName(name: string): Promise<void>
292
+ updateAbout(aboutText: string): Promise<void>
293
+ getAbout(jid?: string): Promise<any>
294
+ updatePicture(jidOrSelf: string, imageSource: any): Promise<void>
295
+ removePicture(jidOrSelf?: string): Promise<void>
296
+ getPictureUrl(jid: string, highRes?: boolean): Promise<string | null>
297
+ }
298
+
299
+ export declare class PrivacyManager {
300
+ constructor(client: WaClient)
301
+ block(jid: string): Promise<void>
302
+ unblock(jid: string): Promise<void>
303
+ getBlocklist(): Promise<string[]>
304
+ setLastSeen(privacy: 'all' | 'contacts' | 'contact_blacklist' | 'none'): Promise<void>
305
+ setOnline(privacy: 'all' | 'match_last_seen'): Promise<void>
306
+ setProfilePicture(privacy: 'all' | 'contacts' | 'contact_blacklist' | 'none'): Promise<void>
307
+ setAbout(privacy: 'all' | 'contacts' | 'contact_blacklist' | 'none'): Promise<void>
308
+ setReadReceipts(enabled: boolean): Promise<void>
309
+ }
310
+
311
+ export declare class UserManager {
312
+ constructor(client: WaClient)
313
+ isOnWhatsApp(phoneOrJid: string): Promise<{ exists: boolean; jid: string } | null>
314
+ resolveJid(jidOrPhone: string, fetchIfMissing?: boolean): Promise<string>
315
+ getPnForLid(lidJid: string, fetchIfMissing?: boolean): Promise<string | null>
316
+ getLidForPn(pnJid: string, fetchIfMissing?: boolean): Promise<string | null>
317
+ getBusinessProfile(jid: string): Promise<any>
318
+ }
319
+
320
+ export declare class ChatManager {
321
+ constructor(client: WaClient)
322
+ pin(jid: string): Promise<void>
323
+ unpin(jid: string): Promise<void>
324
+ mute(jid: string, durationMs?: number): Promise<void>
325
+ unmute(jid: string): Promise<void>
326
+ archive(jid: string): Promise<void>
327
+ unarchive(jid: string): Promise<void>
328
+ setFavorite(jid: string, isFavorite?: boolean): Promise<void>
329
+ setChatNote(jid: string, note: string): Promise<void>
330
+ }
331
+
332
+ export declare class VoipManager {
333
+ constructor(client: WaClient)
334
+ call(phoneNumber: string, options?: any): Promise<CallContext>
335
+ callVideo(phoneNumber: string, options?: any): Promise<CallContext>
336
+ get activeCall(): CallContext | null
337
+ clearActiveCall(): void
338
+ acceptCall(callId: string, from: string, options?: any): Promise<any>
339
+ rejectCall(callId: string, from: string, reason?: number | string): Promise<void>
340
+ }
341
+
342
+ export declare class BusinessManager {
343
+ constructor(client: WaClient)
344
+ createProduct(product: {
345
+ name: string
346
+ description?: string
347
+ price: number
348
+ currency?: string
349
+ images?: (string | Buffer)[]
350
+ retailerId?: string
351
+ url?: string
352
+ isHidden?: boolean
353
+ }): Promise<any>
354
+ updateProduct(productId: string, update: any): Promise<any>
355
+ deleteProduct(productIds: string | string[]): Promise<{ deleted: number }>
356
+ getProduct(productId: string, merchantJid?: string): Promise<any>
357
+ getCatalog(options?: { jid?: string; limit?: number; cursor?: string }): Promise<any>
358
+ getCollections(merchantJid?: string, limit?: number): Promise<any>
359
+ getOrderDetails(orderId: string, orderToken: string): Promise<any>
360
+ }
361
+
362
+ export declare class CommunityManager {
363
+ constructor(client: WaClient)
364
+ create(subject: string, description?: string): Promise<any>
365
+ getMetadata(communityJid: string): Promise<any>
366
+ createSubgroup(communityJid: string, subject: string, participants?: string[]): Promise<any>
367
+ linkSubgroup(communityJid: string, groupJid: string): Promise<any>
368
+ unlinkSubgroup(communityJid: string, groupJid: string): Promise<any>
369
+ getSubgroups(communityJid: string): Promise<any>
370
+ leave(communityJid: string): Promise<any>
371
+ setName(communityJid: string, subject: string): Promise<any>
372
+ }
373
+
374
+ export declare class LabelManager {
375
+ constructor(client: WaClient)
376
+ create(name: string, color?: number, predefinedId?: number): Promise<any>
377
+ update(id: string, name: string, color?: number, predefinedId?: number): Promise<any>
378
+ delete(id: string): Promise<any>
379
+ addChat(jid: string, labelId: string): Promise<any>
380
+ removeChat(jid: string, labelId: string): Promise<any>
381
+ addMessage(jid: string, messageId: string, labelId: string): Promise<any>
382
+ removeMessage(jid: string, messageId: string, labelId: string): Promise<any>
383
+ }
384
+
385
+ export declare class JidNormalizer {
386
+ static toJid(input: string): string
387
+ static toPhoneNumber(jid: string): string
388
+ static isGroup(jid: string): boolean
389
+ static isNewsletter(jid: string): boolean
390
+ static isLid(jid: string): boolean
391
+ static isUser(jid: string): boolean
392
+ static isStatusBroadcast(jid: string): boolean
393
+ static isBroadcast(jid: string): boolean
394
+ }
395
+
396
+ export declare class MessageNormalizer {
397
+ static unwrapMessage(rawMessageContent: any): any
398
+ static extractType(messageContent: any): string
399
+ static extractBody(messageContent: any): string
400
+ static extractMediaNode(messageContent: any): any | null
401
+ static extractContextInfo(messageContent: any): proto.IContextInfo | null
402
+ }
403
+
404
+ export declare class WaClient extends EventEmitter {
405
+ options: WaClientOptions
406
+ status: ConnectionStatusType
407
+ sock: any
408
+ authState: AuthenticationState | null
409
+ saveCreds: (() => Promise<void>) | null
410
+ reconnectAttempts: number
411
+
412
+ // Specialized Domain Managers
413
+ messages: MessageManager
414
+ groups: GroupManager
415
+ channels: ChannelManager
416
+ presence: PresenceManager
417
+ profile: ProfileManager
418
+ privacy: PrivacyManager
419
+ users: UserManager
420
+ chat: ChatManager
421
+ voip: VoipManager
422
+ business: BusinessManager
423
+ communities: CommunityManager
424
+ labels: LabelManager
425
+
426
+ constructor(options?: WaClientOptions)
427
+
428
+ connect(): Promise<this>
429
+ disconnect(): Promise<void>
430
+ logout(): Promise<void>
431
+
432
+ sendMessage(jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions): Promise<proto.WebMessageInfo | undefined>
433
+ sendInteractive(jid: string, interactiveOrBuilder: InteractiveMessage | any, options?: MiscMessageGenerationOptions): Promise<proto.WebMessageInfo | undefined>
434
+ sendPoll(jid: string, pollOrBuilder: PollBuilder | any, options?: MiscMessageGenerationOptions): Promise<proto.WebMessageInfo | undefined>
435
+ sendEvent(jid: string, eventOrBuilder: EventBuilder | any, options?: MiscMessageGenerationOptions): Promise<proto.WebMessageInfo | undefined>
436
+
437
+ startTyping(jid: string): { stop: () => Promise<void> }
438
+ startRecording(jid: string): { stop: () => Promise<void> }
439
+ isOnWhatsApp(jidOrNumber: string): Promise<{ exists: boolean; jid: string } | null>
440
+
441
+ get user(): { id: string; name?: string } | null
442
+ get isConnected(): boolean
443
+ get rawSocket(): any
444
+
445
+ on(event: 'status.change', listener: (status: { current: ConnectionStatusType; previous: ConnectionStatusType }) => void): this
446
+ on(event: 'qr', listener: (data: { qr: string }) => void): this
447
+ on(event: 'pairing.code', listener: (data: { code: string }) => void): this
448
+ on(event: 'connected', listener: (data: { user: any }) => void): this
449
+ on(event: 'disconnected', listener: (data: { error?: any; willReconnect: boolean; attempt?: number; delayMs?: number }) => void): this
450
+ on(event: 'logged.out', listener: (data: { error?: any }) => void): this
451
+ on(event: 'call.incoming', listener: (call: CallContext) => void): this
452
+ on(event: 'call.status', listener: (calls: any[]) => void): this
453
+ on(event: 'message.received', listener: (ctx: MessageContext, raw: proto.IWebMessageInfo) => void): this
454
+ on(event: 'message.sent', listener: (ctx: MessageContext, raw: proto.IWebMessageInfo) => void): this
455
+ on(event: 'message.update', listener: (updates: any[]) => void): this
456
+ on(event: 'message.delete', listener: (item: any) => void): this
457
+ on(event: 'presence.update', listener: (presence: any) => void): this
458
+ on(event: 'contacts.upsert', listener: (contacts: any[]) => void): this
459
+ on(event: 'group.participants.update', listener: (update: any) => void): this
460
+ on(event: 'error', listener: (error: any) => void): this
461
+ on(event: string | symbol, listener: (...args: any[]) => void): this
462
+ }
463
+
464
+ export default WaClient
@@ -0,0 +1,76 @@
1
+ "use strict"
2
+
3
+ Object.defineProperty(exports, "__esModule", { value: true })
4
+
5
+ const { WaClient } = require("./WaClient")
6
+ const { Events, ConnectionStatus } = require("./Constants")
7
+ const { MessageContext } = require("./Context/MessageContext")
8
+ const { MediaObject } = require("./Context/MediaObject")
9
+ const { CallContext } = require("./Context/CallContext")
10
+ const { JidNormalizer } = require("./Normalizers/JidNormalizer")
11
+ const { MessageNormalizer } = require("./Normalizers/MessageNormalizer")
12
+ const {
13
+ InteractiveMessage,
14
+ QuickReplyButton,
15
+ UrlButton,
16
+ CopyCodeButton,
17
+ CallButton,
18
+ PixButton,
19
+ ListButton,
20
+ ListSection,
21
+ ListRow,
22
+ PollBuilder,
23
+ EventBuilder
24
+ } = require("./Builders")
25
+ const {
26
+ MessageManager,
27
+ GroupManager,
28
+ ChannelManager,
29
+ PresenceManager,
30
+ ProfileManager,
31
+ PrivacyManager,
32
+ UserManager,
33
+ ChatManager,
34
+ VoipManager,
35
+ BusinessManager,
36
+ CommunityManager,
37
+ LabelManager
38
+ } = require("./Modules")
39
+
40
+ exports.WaClient = WaClient
41
+ exports.Events = Events
42
+ exports.ConnectionStatus = ConnectionStatus
43
+ exports.MessageContext = MessageContext
44
+ exports.MediaObject = MediaObject
45
+ exports.CallContext = CallContext
46
+ exports.JidNormalizer = JidNormalizer
47
+ exports.MessageNormalizer = MessageNormalizer
48
+
49
+ // Builders
50
+ exports.InteractiveMessage = InteractiveMessage
51
+ exports.QuickReplyButton = QuickReplyButton
52
+ exports.UrlButton = UrlButton
53
+ exports.CopyCodeButton = CopyCodeButton
54
+ exports.CallButton = CallButton
55
+ exports.PixButton = PixButton
56
+ exports.ListButton = ListButton
57
+ exports.ListSection = ListSection
58
+ exports.ListRow = ListRow
59
+ exports.PollBuilder = PollBuilder
60
+ exports.EventBuilder = EventBuilder
61
+
62
+ // Domain Managers
63
+ exports.MessageManager = MessageManager
64
+ exports.GroupManager = GroupManager
65
+ exports.ChannelManager = ChannelManager
66
+ exports.PresenceManager = PresenceManager
67
+ exports.ProfileManager = ProfileManager
68
+ exports.PrivacyManager = PrivacyManager
69
+ exports.UserManager = UserManager
70
+ exports.ChatManager = ChatManager
71
+ exports.VoipManager = VoipManager
72
+ exports.BusinessManager = BusinessManager
73
+ exports.CommunityManager = CommunityManager
74
+ exports.LabelManager = LabelManager
75
+
76
+ exports.default = WaClient
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@areumtecnologia/wasockets",
3
- "version": "2.2.3",
3
+ "version": "2.3.0",
4
4
  "whatsappVersion": "2.3000.1053049953",
5
5
  "description": "Communication Library By areumtecnologia",
6
6
  "keywords": [],
@@ -38,8 +38,8 @@
38
38
  "changelog:last": "conventional-changelog -p angular -r 2",
39
39
  "changelog:preview": "conventional-changelog -p angular -u",
40
40
  "changelog:update": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
41
- "lint": "eslint lib --ext .js",
42
- "lint:fix": "yarn lint --fix",
41
+ "lint": "eslint lib",
42
+ "lint:fix": "eslint lib --fix",
43
43
  "preinstall": "node ./engine-requirements.js",
44
44
  "release": "release-it",
45
45
  "test": "jest --passWithNoTests"
@@ -50,34 +50,34 @@
50
50
  "@hapi/boom": "^10.0.1",
51
51
  "@itsukichan/libsignal-node": "^1.0.1",
52
52
  "async-mutex": "^0.5.0",
53
- "audio-decode": "^3.11.0",
53
+ "audio-decode": "^3.12.0",
54
54
  "cache-manager": "^7.2.9",
55
- "fflate": "^0.8.2",
56
- "lodash": "^4.17.21",
57
- "lru-cache": "^11.1.0",
58
- "music-metadata": "^12.3.4",
55
+ "fflate": "^0.8.3",
56
+ "lodash": "^4.18.1",
57
+ "lru-cache": "^11.5.3",
58
+ "music-metadata": "^12.5.0",
59
59
  "p-queue": "^10.0.0",
60
- "pino": "^10.3.1",
61
- "protobufjs": "^8.6.5",
60
+ "pino": "^10.4.0",
61
+ "protobufjs": "^8.8.1",
62
62
  "qrcode-terminal": "^0.12.0",
63
63
  "unfurl.js": "^6.4.0",
64
- "ws": "^8.13.0"
64
+ "ws": "^8.23.0"
65
65
  },
66
66
  "devDependencies": {
67
67
  "@itsukichan/eslint-config": "^1.0.0",
68
68
  "@types/jest": "^30.0.0",
69
- "@types/node": "^26.0.0",
70
- "@types/ws": "^8.0.0",
69
+ "@types/node": "^26.6.6",
70
+ "@types/ws": "^8.18.2",
71
71
  "conventional-changelog-cli": "^5.0.0",
72
- "eslint": "^10.14.0",
73
- "jest": "^30.1.1",
72
+ "eslint": "^10.15.0",
73
+ "jest": "^30.5.2",
74
74
  "jimp": "^1.6.1",
75
75
  "json": "^11.0.0",
76
76
  "open": "^11.0.4",
77
- "release-it": "^21.0.3",
78
- "ts-jest": "^29.4.1",
79
- "ts-node": "^10.8.1",
80
- "typedoc": "^0.28.19",
77
+ "release-it": "^21.1.2",
78
+ "ts-jest": "^29.4.15",
79
+ "ts-node": "^10.9.2",
80
+ "typedoc": "^0.28.20",
81
81
  "typedoc-plugin-markdown": "^4.14.1",
82
82
  "typescript": "^7.0.2"
83
83
  },
@@ -89,7 +89,7 @@
89
89
  "optional": true
90
90
  }
91
91
  },
92
- "packageManager": "yarn@1.22.19",
92
+ "packageManager": "yarn@1.22.22",
93
93
  "engines": {
94
94
  "node": ">=20.0.0"
95
95
  },
@@ -103,15 +103,21 @@
103
103
  "ip": "^2.0.1",
104
104
  "js-yaml": "^4.1.1",
105
105
  "undici": "^6.21.1",
106
- "protobufjs": "^8.6.5"
106
+ "protobufjs": "^8.8.1",
107
+ "ts-jest": {
108
+ "typescript": "$typescript"
109
+ },
110
+ "typedoc": {
111
+ "typescript": "$typescript"
112
+ }
107
113
  },
108
114
  "resolutions": {
109
115
  "ip": "^2.0.1",
110
116
  "js-yaml": "^4.1.1",
111
117
  "undici": "^6.21.1",
112
- "protobufjs": "^8.6.5"
118
+ "protobufjs": "^8.8.1"
113
119
  },
114
120
  "optionalDependencies": {
115
121
  "@roamhq/wrtc": "^0.10.0"
116
122
  }
117
- }
123
+ }