wa-multi-mongodb 3.10.3 → 3.10.6

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.
@@ -102,4 +102,163 @@ export declare const getGroupMetadata: (sessionId: string, jid: string, forceFet
102
102
  export declare const clearGroupMetadataCache: (sessionId: string, jid: string) => Promise<void>;
103
103
  export declare const clearSessionGroupMetadataCache: (sessionId: string) => Promise<void>;
104
104
  export declare const clearAllGroupMetadataCache: () => void;
105
+ /**
106
+ * Result type for LID to PN conversion
107
+ */
108
+ export interface LIDConversionResult {
109
+ success: boolean;
110
+ lid: string;
111
+ pn: string | null;
112
+ error?: string;
113
+ }
114
+ /**
115
+ * Result type for PN to LID conversion
116
+ */
117
+ export interface PNConversionResult {
118
+ success: boolean;
119
+ pn: string;
120
+ lid: string | null;
121
+ error?: string;
122
+ }
123
+ /**
124
+ * LID Mapping entry type
125
+ */
126
+ export interface LIDMappingEntry {
127
+ lid: string;
128
+ pn: string;
129
+ }
130
+ /**
131
+ * Convert LID (Linked ID) to Phone Number (PN/JID)
132
+ *
133
+ * This function uses Baileys' internal signalRepository.lidMapping to retrieve
134
+ * the phone number associated with a given LID.
135
+ *
136
+ * @param sessionId - Session ID to use for conversion
137
+ * @param lid - The LID to convert (e.g., "1524746986546@lid")
138
+ * @returns Promise<LIDConversionResult> - Result object with the phone number or null if not found
139
+ *
140
+ * @example
141
+ * ```typescript
142
+ * const result = await whatsapp.getPNForLID("mysession", "1524746986546@lid");
143
+ * if (result.success && result.pn) {
144
+ * console.log(`Phone number: ${result.pn}`);
145
+ * } else {
146
+ * console.log("Phone number not found for this LID");
147
+ * }
148
+ * ```
149
+ *
150
+ * @note This function may return null for new contacts or when WhatsApp
151
+ * hasn't provided the LID-PN mapping yet. Not all LIDs have known phone numbers.
152
+ */
153
+ export declare const getPNForLID: (sessionId: string, lid: string) => Promise<LIDConversionResult>;
154
+ /**
155
+ * Convert Phone Number (PN/JID) to LID (Linked ID)
156
+ *
157
+ * This function uses Baileys' internal signalRepository.lidMapping to retrieve
158
+ * the LID associated with a given phone number.
159
+ *
160
+ * @param sessionId - Session ID to use for conversion
161
+ * @param pn - The phone number/JID to convert (e.g., "6281234567890" or "6281234567890@s.whatsapp.net")
162
+ * @returns Promise<PNConversionResult> - Result object with the LID or null if not found
163
+ *
164
+ * @example
165
+ * ```typescript
166
+ * const result = await whatsapp.getLIDForPN("mysession", "6281234567890");
167
+ * if (result.success && result.lid) {
168
+ * console.log(`LID: ${result.lid}`);
169
+ * } else {
170
+ * console.log("LID not found for this phone number");
171
+ * }
172
+ * ```
173
+ *
174
+ * @note This function may return null for contacts that haven't been encountered
175
+ * with their LID mapping yet.
176
+ */
177
+ export declare const getLIDForPN: (sessionId: string, pn: string) => Promise<PNConversionResult>;
178
+ /**
179
+ * Get all known LID-PN mappings for a session
180
+ *
181
+ * This function retrieves all LID to phone number mappings that are currently
182
+ * stored in the session's signal repository.
183
+ *
184
+ * @param sessionId - Session ID to get mappings from
185
+ * @returns Promise<LIDMappingEntry[]> - Array of LID-PN mapping entries
186
+ *
187
+ * @example
188
+ * ```typescript
189
+ * const mappings = await whatsapp.getAllLIDMappings("mysession");
190
+ * for (const mapping of mappings) {
191
+ * console.log(`${mapping.lid} => ${mapping.pn}`);
192
+ * }
193
+ * ```
194
+ *
195
+ * @note This may return an empty array if no mappings are available yet.
196
+ */
197
+ export declare const getAllLIDMappings: (sessionId: string) => Promise<LIDMappingEntry[]>;
198
+ /**
199
+ * Check if a JID is in LID format
200
+ *
201
+ * @param jid - The JID to check
202
+ * @returns boolean - True if the JID is in LID format
203
+ *
204
+ * @example
205
+ * ```typescript
206
+ * if (whatsapp.isLIDFormat("1524746986546@lid")) {
207
+ * console.log("This is an LID");
208
+ * }
209
+ * ```
210
+ */
211
+ export declare const isLIDFormat: (jid: string) => boolean;
212
+ /**
213
+ * Check if a JID is in Phone Number format (@s.whatsapp.net)
214
+ *
215
+ * @param jid - The JID to check
216
+ * @returns boolean - True if the JID is in PN format
217
+ *
218
+ * @example
219
+ * ```typescript
220
+ * if (whatsapp.isPNFormat("6281234567890@s.whatsapp.net")) {
221
+ * console.log("This is a phone number JID");
222
+ * }
223
+ * ```
224
+ */
225
+ export declare const isPNFormat: (jid: string) => boolean;
226
+ /**
227
+ * Smart convert any JID to phone number
228
+ *
229
+ * Automatically detects if the input is an LID and converts it to PN,
230
+ * or returns the PN if already in PN format.
231
+ *
232
+ * @param sessionId - Session ID to use for conversion
233
+ * @param jid - Any JID (LID or PN format)
234
+ * @returns Promise<string | null> - Phone number or null if conversion failed
235
+ *
236
+ * @example
237
+ * ```typescript
238
+ * const pn = await whatsapp.toPhoneNumber("mysession", jid);
239
+ * if (pn) {
240
+ * console.log(`Phone number: ${pn}`);
241
+ * }
242
+ * ```
243
+ */
244
+ export declare const toPhoneNumber: (sessionId: string, jid: string) => Promise<string | null>;
245
+ /**
246
+ * Smart convert any JID to LID
247
+ *
248
+ * Automatically detects if the input is a PN and converts it to LID,
249
+ * or returns the LID if already in LID format.
250
+ *
251
+ * @param sessionId - Session ID to use for conversion
252
+ * @param jid - Any JID (LID or PN format)
253
+ * @returns Promise<string | null> - LID or null if conversion failed
254
+ *
255
+ * @example
256
+ * ```typescript
257
+ * const lid = await whatsapp.toLID("mysession", "6281234567890@s.whatsapp.net");
258
+ * if (lid) {
259
+ * console.log(`LID: ${lid}`);
260
+ * }
261
+ * ```
262
+ */
263
+ export declare const toLID: (sessionId: string, jid: string) => Promise<string | null>;
105
264
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Socket/index.ts"],"names":[],"mappings":"AAAA,OAAqB,EAInB,QAAQ,EACT,MAAM,SAAS,CAAC;AAMjB,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,kBAAkB,EAEnB,MAAM,UAAU,CAAC;AAiClB;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAU,KAAK,MAAM,kBAkB5C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,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,aAAa,GAAU,WAAW,MAAM,EAAE,KAAK,MAAM,KAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAoCzF,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,KAAK,GAAU,WAAW,MAAM,EAAE,KAAK,MAAM,KAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAkBjF,CAAC"}
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import makeWASocket, { Browsers, DisconnectReason, fetchLatestBaileysVersion, } from "baileys";
10
+ import makeWASocket, { Browsers, DisconnectReason, fetchLatestBaileysVersion, jidNormalizedUser } from "baileys";
11
11
  import path from "path";
12
12
  import fs from "fs";
13
13
  import QRCode from "qrcode";
@@ -21,6 +21,32 @@ import { MongoClient } from "mongodb";
21
21
  import { useMongoAuthState } from "../Utils/mongo-auth-state.js";
22
22
  import { createDelay } from "../Utils/create-delay.js";
23
23
  const sessions = new Map();
24
+ /**
25
+ * Helper function to generate browser configuration based on type and name
26
+ * @param browserType - Browser type (ubuntu, macOS, windows, appropriate)
27
+ * @param browserName - Custom browser/app name
28
+ * @returns Browser configuration tuple for Baileys
29
+ */
30
+ const getBrowserConfig = (browserType = "ubuntu", browserName = "Chrome") => {
31
+ let browserTuple;
32
+ switch (browserType) {
33
+ case "macOS":
34
+ browserTuple = Browsers.macOS(browserName);
35
+ break;
36
+ case "windows":
37
+ browserTuple = Browsers.windows(browserName);
38
+ break;
39
+ case "appropriate":
40
+ browserTuple = Browsers.appropriate(browserName);
41
+ break;
42
+ case "ubuntu":
43
+ default:
44
+ browserTuple = Browsers.ubuntu(browserName);
45
+ break;
46
+ }
47
+ // Convert readonly tuple to mutable tuple for Baileys compatibility
48
+ return [...browserTuple];
49
+ };
24
50
  const callback = new Map();
25
51
  const retryCount = new Map();
26
52
  // Tambahkan Map untuk melacak session yang menggunakan pairing code
@@ -85,7 +111,7 @@ export const startSession = (...args_1) => __awaiter(void 0, [...args_1], void 0
85
111
  auth: state,
86
112
  logger: P,
87
113
  markOnlineOnConnect: false,
88
- browser: Browsers.ubuntu("Chrome"),
114
+ browser: getBrowserConfig(options.browserType, options.browserName),
89
115
  // Configure caching group metadata using our hybrid implementation with session ID
90
116
  cachedGroupMetadata: (jid) => __awaiter(void 0, void 0, void 0, function* () {
91
117
  return yield groupCache.get(sessionId, jid);
@@ -94,7 +120,7 @@ export const startSession = (...args_1) => __awaiter(void 0, [...args_1], void 0
94
120
  sessions.set(sessionId, Object.assign({}, sock));
95
121
  try {
96
122
  sock.ev.process((events) => __awaiter(void 0, void 0, void 0, function* () {
97
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
123
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
98
124
  if (events["connection.update"]) {
99
125
  const update = events["connection.update"];
100
126
  const { connection, lastDisconnect } = update;
@@ -202,12 +228,19 @@ export const startSession = (...args_1) => __awaiter(void 0, [...args_1], void 0
202
228
  }
203
229
  const msg = rawMsg;
204
230
  msg.sessionId = sessionId;
231
+ // Get normalized sender phone number using toPhoneNumber
232
+ // For group messages, sender is in 'participant', for personal chats it's in 'remoteJid'
233
+ const isGroup = ((_r = (_q = msg.key) === null || _q === void 0 ? void 0 : _q.remoteJid) === null || _r === void 0 ? void 0 : _r.endsWith('@g.us')) || false;
234
+ const senderJid = isGroup
235
+ ? (((_s = msg.key) === null || _s === void 0 ? void 0 : _s.participant) || '')
236
+ : (((_t = msg.key) === null || _t === void 0 ? void 0 : _t.remoteJid) || '');
237
+ msg.sender = yield toPhoneNumber(sessionId, senderJid);
205
238
  msg.saveImage = (path) => saveImageHandler(msg, path);
206
239
  msg.saveVideo = (path) => saveVideoHandler(msg, path);
207
240
  msg.saveDocument = (path) => saveDocumentHandler(msg, path);
208
241
  msg.saveAudio = (path) => saveAudioHandler(msg, path);
209
- (_q = callback.get(CALLBACK_KEY.ON_MESSAGE_RECEIVED)) === null || _q === void 0 ? void 0 : _q(Object.assign({}, msg));
210
- (_r = options.onMessageReceived) === null || _r === void 0 ? void 0 : _r.call(options, msg);
242
+ (_u = callback.get(CALLBACK_KEY.ON_MESSAGE_RECEIVED)) === null || _u === void 0 ? void 0 : _u(Object.assign({}, msg));
243
+ (_v = options.onMessageReceived) === null || _v === void 0 ? void 0 : _v.call(options, msg);
211
244
  }
212
245
  }
213
246
  }));
@@ -244,7 +277,7 @@ export const startSessionWithPairingCode = (sessionId_1, phoneNumber_1, ...args_
244
277
  auth: state,
245
278
  logger: P,
246
279
  markOnlineOnConnect: false,
247
- browser: Browsers.ubuntu("Chrome"),
280
+ browser: getBrowserConfig(options.browserType, options.browserName),
248
281
  // Opsi tambahan untuk meningkatkan kompatibilitas
249
282
  linkPreviewImageThumbnailWidth: 300,
250
283
  generateHighQualityLinkPreview: true,
@@ -284,7 +317,7 @@ export const startSessionWithPairingCode = (sessionId_1, phoneNumber_1, ...args_
284
317
  }
285
318
  }
286
319
  sock.ev.process((events) => __awaiter(void 0, void 0, void 0, function* () {
287
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
320
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
288
321
  if (events["connection.update"]) {
289
322
  const update = events["connection.update"];
290
323
  const { connection, lastDisconnect } = update;
@@ -404,12 +437,19 @@ export const startSessionWithPairingCode = (sessionId_1, phoneNumber_1, ...args_
404
437
  }
405
438
  const msg = rawMsg;
406
439
  msg.sessionId = sessionId;
440
+ // Get normalized sender phone number using toPhoneNumber
441
+ // For group messages, sender is in 'participant', for personal chats it's in 'remoteJid'
442
+ const isGroup = ((_q = (_p = msg.key) === null || _p === void 0 ? void 0 : _p.remoteJid) === null || _q === void 0 ? void 0 : _q.endsWith('@g.us')) || false;
443
+ const senderJid = isGroup
444
+ ? (((_r = msg.key) === null || _r === void 0 ? void 0 : _r.participant) || '')
445
+ : (((_s = msg.key) === null || _s === void 0 ? void 0 : _s.remoteJid) || '');
446
+ msg.sender = yield toPhoneNumber(sessionId, senderJid);
407
447
  msg.saveImage = (path) => saveImageHandler(msg, path);
408
448
  msg.saveVideo = (path) => saveVideoHandler(msg, path);
409
449
  msg.saveDocument = (path) => saveDocumentHandler(msg, path);
410
450
  msg.saveAudio = (path) => saveAudioHandler(msg, path);
411
- (_p = callback.get(CALLBACK_KEY.ON_MESSAGE_RECEIVED)) === null || _p === void 0 ? void 0 : _p(Object.assign({}, msg));
412
- (_q = options.onMessageReceived) === null || _q === void 0 ? void 0 : _q.call(options, msg);
451
+ (_t = callback.get(CALLBACK_KEY.ON_MESSAGE_RECEIVED)) === null || _t === void 0 ? void 0 : _t(Object.assign({}, msg));
452
+ (_u = options.onMessageReceived) === null || _u === void 0 ? void 0 : _u.call(options, msg);
413
453
  }
414
454
  }
415
455
  }));
@@ -806,3 +846,316 @@ export const clearSessionGroupMetadataCache = (sessionId) => __awaiter(void 0, v
806
846
  export const clearAllGroupMetadataCache = () => {
807
847
  groupCache.flush();
808
848
  };
849
+ /**
850
+ * Convert LID (Linked ID) to Phone Number (PN/JID)
851
+ *
852
+ * This function uses Baileys' internal signalRepository.lidMapping to retrieve
853
+ * the phone number associated with a given LID.
854
+ *
855
+ * @param sessionId - Session ID to use for conversion
856
+ * @param lid - The LID to convert (e.g., "1524746986546@lid")
857
+ * @returns Promise<LIDConversionResult> - Result object with the phone number or null if not found
858
+ *
859
+ * @example
860
+ * ```typescript
861
+ * const result = await whatsapp.getPNForLID("mysession", "1524746986546@lid");
862
+ * if (result.success && result.pn) {
863
+ * console.log(`Phone number: ${result.pn}`);
864
+ * } else {
865
+ * console.log("Phone number not found for this LID");
866
+ * }
867
+ * ```
868
+ *
869
+ * @note This function may return null for new contacts or when WhatsApp
870
+ * hasn't provided the LID-PN mapping yet. Not all LIDs have known phone numbers.
871
+ */
872
+ export const getPNForLID = (sessionId, lid) => __awaiter(void 0, void 0, void 0, function* () {
873
+ var _a, _b;
874
+ const session = getSession(sessionId);
875
+ if (!session) {
876
+ return {
877
+ success: false,
878
+ lid,
879
+ pn: null,
880
+ error: Messages.sessionNotFound(sessionId)
881
+ };
882
+ }
883
+ try {
884
+ // Normalize LID format
885
+ let normalizedLid = lid;
886
+ if (!lid.includes('@lid')) {
887
+ normalizedLid = `${lid}@lid`;
888
+ }
889
+ // Access the signalRepository.lidMapping to get PN for LID
890
+ const signalRepo = session.signalRepository;
891
+ if (!signalRepo || !signalRepo.lidMapping) {
892
+ return {
893
+ success: false,
894
+ lid: normalizedLid,
895
+ pn: null,
896
+ error: "LID mapping not available in this session"
897
+ };
898
+ }
899
+ // Try to get the phone number for the LID (getPNForLID is async!)
900
+ const pn = (yield ((_b = (_a = signalRepo.lidMapping).getPNForLID) === null || _b === void 0 ? void 0 : _b.call(_a, normalizedLid))) || null;
901
+ return {
902
+ success: pn !== null,
903
+ lid: normalizedLid,
904
+ pn
905
+ };
906
+ }
907
+ catch (error) {
908
+ return {
909
+ success: false,
910
+ lid,
911
+ pn: null,
912
+ error: `Failed to convert LID to PN: ${error.message || String(error)}`
913
+ };
914
+ }
915
+ });
916
+ /**
917
+ * Convert Phone Number (PN/JID) to LID (Linked ID)
918
+ *
919
+ * This function uses Baileys' internal signalRepository.lidMapping to retrieve
920
+ * the LID associated with a given phone number.
921
+ *
922
+ * @param sessionId - Session ID to use for conversion
923
+ * @param pn - The phone number/JID to convert (e.g., "6281234567890" or "6281234567890@s.whatsapp.net")
924
+ * @returns Promise<PNConversionResult> - Result object with the LID or null if not found
925
+ *
926
+ * @example
927
+ * ```typescript
928
+ * const result = await whatsapp.getLIDForPN("mysession", "6281234567890");
929
+ * if (result.success && result.lid) {
930
+ * console.log(`LID: ${result.lid}`);
931
+ * } else {
932
+ * console.log("LID not found for this phone number");
933
+ * }
934
+ * ```
935
+ *
936
+ * @note This function may return null for contacts that haven't been encountered
937
+ * with their LID mapping yet.
938
+ */
939
+ export const getLIDForPN = (sessionId, pn) => __awaiter(void 0, void 0, void 0, function* () {
940
+ var _a, _b;
941
+ const session = getSession(sessionId);
942
+ if (!session) {
943
+ return {
944
+ success: false,
945
+ pn,
946
+ lid: null,
947
+ error: Messages.sessionNotFound(sessionId)
948
+ };
949
+ }
950
+ try {
951
+ // Normalize PN format
952
+ let normalizedPn = pn.replace(/\D/g, ''); // Remove non-digits
953
+ if (!pn.includes('@s.whatsapp.net')) {
954
+ normalizedPn = `${normalizedPn}@s.whatsapp.net`;
955
+ }
956
+ else {
957
+ normalizedPn = pn;
958
+ }
959
+ // Access the signalRepository.lidMapping to get LID for PN
960
+ const signalRepo = session.signalRepository;
961
+ if (!signalRepo || !signalRepo.lidMapping) {
962
+ return {
963
+ success: false,
964
+ pn: normalizedPn,
965
+ lid: null,
966
+ error: "LID mapping not available in this session"
967
+ };
968
+ }
969
+ // Try to get the LID for the phone number
970
+ const lid = ((_b = (_a = signalRepo.lidMapping).getLIDForPN) === null || _b === void 0 ? void 0 : _b.call(_a, normalizedPn)) || null;
971
+ return {
972
+ success: lid !== null,
973
+ pn: normalizedPn,
974
+ lid
975
+ };
976
+ }
977
+ catch (error) {
978
+ return {
979
+ success: false,
980
+ pn,
981
+ lid: null,
982
+ error: `Failed to convert PN to LID: ${error.message || String(error)}`
983
+ };
984
+ }
985
+ });
986
+ /**
987
+ * Get all known LID-PN mappings for a session
988
+ *
989
+ * This function retrieves all LID to phone number mappings that are currently
990
+ * stored in the session's signal repository.
991
+ *
992
+ * @param sessionId - Session ID to get mappings from
993
+ * @returns Promise<LIDMappingEntry[]> - Array of LID-PN mapping entries
994
+ *
995
+ * @example
996
+ * ```typescript
997
+ * const mappings = await whatsapp.getAllLIDMappings("mysession");
998
+ * for (const mapping of mappings) {
999
+ * console.log(`${mapping.lid} => ${mapping.pn}`);
1000
+ * }
1001
+ * ```
1002
+ *
1003
+ * @note This may return an empty array if no mappings are available yet.
1004
+ */
1005
+ export const getAllLIDMappings = (sessionId) => __awaiter(void 0, void 0, void 0, function* () {
1006
+ const session = getSession(sessionId);
1007
+ if (!session) {
1008
+ throw new WhatsappError(Messages.sessionNotFound(sessionId));
1009
+ }
1010
+ try {
1011
+ const signalRepo = session.signalRepository;
1012
+ if (!signalRepo || !signalRepo.lidMapping) {
1013
+ return [];
1014
+ }
1015
+ // Try to get all mappings if available
1016
+ const getAllMappings = signalRepo.lidMapping.getAll || signalRepo.lidMapping.getAllMappings;
1017
+ if (typeof getAllMappings === 'function') {
1018
+ const mappings = getAllMappings();
1019
+ if (Array.isArray(mappings)) {
1020
+ return mappings;
1021
+ }
1022
+ // If it's a Map or Object, convert to array
1023
+ if (mappings instanceof Map) {
1024
+ return Array.from(mappings.entries()).map(([lid, pn]) => ({ lid, pn: pn }));
1025
+ }
1026
+ if (typeof mappings === 'object') {
1027
+ return Object.entries(mappings).map(([lid, pn]) => ({ lid, pn: pn }));
1028
+ }
1029
+ }
1030
+ // Alternative: Try to access internal store directly
1031
+ const store = signalRepo.lidMapping.store || signalRepo.lidMapping._store;
1032
+ if (store) {
1033
+ if (store instanceof Map) {
1034
+ return Array.from(store.entries()).map(([lid, pn]) => ({ lid, pn: pn }));
1035
+ }
1036
+ if (typeof store === 'object') {
1037
+ return Object.entries(store).map(([lid, pn]) => ({ lid, pn: pn }));
1038
+ }
1039
+ }
1040
+ return [];
1041
+ }
1042
+ catch (error) {
1043
+ throw new WhatsappError(`Failed to get LID mappings: ${error.message || String(error)}`);
1044
+ }
1045
+ });
1046
+ /**
1047
+ * Check if a JID is in LID format
1048
+ *
1049
+ * @param jid - The JID to check
1050
+ * @returns boolean - True if the JID is in LID format
1051
+ *
1052
+ * @example
1053
+ * ```typescript
1054
+ * if (whatsapp.isLIDFormat("1524746986546@lid")) {
1055
+ * console.log("This is an LID");
1056
+ * }
1057
+ * ```
1058
+ */
1059
+ export const isLIDFormat = (jid) => {
1060
+ return jid.includes('@lid');
1061
+ };
1062
+ /**
1063
+ * Check if a JID is in Phone Number format (@s.whatsapp.net)
1064
+ *
1065
+ * @param jid - The JID to check
1066
+ * @returns boolean - True if the JID is in PN format
1067
+ *
1068
+ * @example
1069
+ * ```typescript
1070
+ * if (whatsapp.isPNFormat("6281234567890@s.whatsapp.net")) {
1071
+ * console.log("This is a phone number JID");
1072
+ * }
1073
+ * ```
1074
+ */
1075
+ export const isPNFormat = (jid) => {
1076
+ return jid.includes('@s.whatsapp.net');
1077
+ };
1078
+ /**
1079
+ * Smart convert any JID to phone number
1080
+ *
1081
+ * Automatically detects if the input is an LID and converts it to PN,
1082
+ * or returns the PN if already in PN format.
1083
+ *
1084
+ * @param sessionId - Session ID to use for conversion
1085
+ * @param jid - Any JID (LID or PN format)
1086
+ * @returns Promise<string | null> - Phone number or null if conversion failed
1087
+ *
1088
+ * @example
1089
+ * ```typescript
1090
+ * const pn = await whatsapp.toPhoneNumber("mysession", jid);
1091
+ * if (pn) {
1092
+ * console.log(`Phone number: ${pn}`);
1093
+ * }
1094
+ * ```
1095
+ */
1096
+ export const toPhoneNumber = (sessionId, jid) => __awaiter(void 0, void 0, void 0, function* () {
1097
+ // Handle null/undefined input
1098
+ if (!jid) {
1099
+ return null;
1100
+ }
1101
+ // If it's a group or broadcast, return null
1102
+ if (jid.includes('@g.us') || jid.includes('@broadcast')) {
1103
+ return null;
1104
+ }
1105
+ // If already in PN format, use jidNormalizedUser to remove device ID
1106
+ if (isPNFormat(jid)) {
1107
+ // Use jidNormalizedUser to normalize and remove device ID (e.g., :0, :1)
1108
+ const normalized = jidNormalizedUser(jid);
1109
+ return normalized || jid; // Fallback to original if normalization fails
1110
+ }
1111
+ // If it's an LID, try to convert
1112
+ if (isLIDFormat(jid)) {
1113
+ const lidResult = yield getPNForLID(sessionId, jid);
1114
+ if (lidResult.pn) {
1115
+ // Use jidNormalizedUser to normalize the result and remove device ID
1116
+ const normalized = jidNormalizedUser(lidResult.pn);
1117
+ return normalized || lidResult.pn; // Fallback to original if normalization fails
1118
+ }
1119
+ return null;
1120
+ }
1121
+ // If it's just a number, format it as PN (no device ID needed)
1122
+ const phoneNumber = jid.replace(/\D/g, '');
1123
+ if (phoneNumber.length >= 10) {
1124
+ return `${phoneNumber}@s.whatsapp.net`;
1125
+ }
1126
+ return null;
1127
+ });
1128
+ /**
1129
+ * Smart convert any JID to LID
1130
+ *
1131
+ * Automatically detects if the input is a PN and converts it to LID,
1132
+ * or returns the LID if already in LID format.
1133
+ *
1134
+ * @param sessionId - Session ID to use for conversion
1135
+ * @param jid - Any JID (LID or PN format)
1136
+ * @returns Promise<string | null> - LID or null if conversion failed
1137
+ *
1138
+ * @example
1139
+ * ```typescript
1140
+ * const lid = await whatsapp.toLID("mysession", "6281234567890@s.whatsapp.net");
1141
+ * if (lid) {
1142
+ * console.log(`LID: ${lid}`);
1143
+ * }
1144
+ * ```
1145
+ */
1146
+ export const toLID = (sessionId, jid) => __awaiter(void 0, void 0, void 0, function* () {
1147
+ // If already in LID format, return as-is
1148
+ if (isLIDFormat(jid)) {
1149
+ return jid;
1150
+ }
1151
+ // If it's a PN, try to convert
1152
+ if (isPNFormat(jid) || /^\d+$/.test(jid.replace(/\D/g, ''))) {
1153
+ const result = yield getLIDForPN(sessionId, jid);
1154
+ return result.lid;
1155
+ }
1156
+ // If it's a group or broadcast, return null
1157
+ if (jid.includes('@g.us') || jid.includes('@broadcast')) {
1158
+ return null;
1159
+ }
1160
+ return null;
1161
+ });
@@ -1,4 +1,12 @@
1
1
  import { WAMessageUpdate, proto } from "baileys";
2
+ /**
3
+ * Supported browser types for WhatsApp connection
4
+ * - ubuntu: Uses Ubuntu browser agent (default)
5
+ * - macOS: Uses macOS browser agent
6
+ * - windows: Uses Windows browser agent
7
+ * - appropriate: Uses appropriate browser based on platform
8
+ */
9
+ export type BrowserType = "ubuntu" | "macOS" | "windows" | "appropriate";
2
10
  export interface SendMessageTypes {
3
11
  to: string | number;
4
12
  text?: string;
@@ -27,6 +35,11 @@ export interface MessageReceived extends proto.IWebMessageInfo {
27
35
  * Your Session ID
28
36
  */
29
37
  sessionId: string;
38
+ /**
39
+ * Sender's phone number in normalized format (without device ID)
40
+ * @example "6281234567890@s.whatsapp.net"
41
+ */
42
+ sender: string | null;
30
43
  /**
31
44
  * @param path save image location path with extension
32
45
  * @example "./myimage.jpg"
@@ -53,6 +66,19 @@ export interface StartSessionParams {
53
66
  * Print QR Code into Terminal
54
67
  */
55
68
  printQR?: boolean;
69
+ /**
70
+ * Browser type for WhatsApp connection
71
+ * Options: "ubuntu" (default), "macOS", "windows", "appropriate"
72
+ * @default "ubuntu"
73
+ */
74
+ browserType?: BrowserType;
75
+ /**
76
+ * Custom browser/app name displayed in WhatsApp
77
+ * This name will appear in "Linked Devices" on your phone
78
+ * @default "Chrome"
79
+ * @example "My Bot App"
80
+ */
81
+ browserName?: string;
56
82
  onQRUpdated?: (qr: string) => void;
57
83
  onConnected?: () => void;
58
84
  onConnecting?: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEjD,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,KAAK,CAAC,eAAe,CAAC;CACnC;AAED,MAAM,WAAW,2BAA4B,SAAQ,gBAAgB;IACnE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,cAAe,SAAQ,gBAAgB;IACtD,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,IAAI,EAAE,OAAO,GAA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