@queenanya/baileys 8.3.7 → 8.3.8

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.
@@ -0,0 +1,2 @@
1
+ export * from './media-messages';
2
+ export * from './media-set';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./media-messages"), exports);
18
+ __exportStar(require("./media-set"), exports);
@@ -100,7 +100,7 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
100
100
  processingMutex: {
101
101
  mutex<T>(code: () => Promise<T> | T): Promise<T>;
102
102
  };
103
- upsertMessage: (msg: import("../Types").WAProto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
103
+ upsertMessage: (msg: import("../Types").WAMessage, type: import("../Types").MessageUpsertType) => Promise<void>;
104
104
  appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
105
105
  sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
106
106
  presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
@@ -1,6 +1,5 @@
1
1
  import { Boom } from '@hapi/boom';
2
- import { proto } from '../../WAProto';
3
- import { BotListInfo, ChatModification, MessageUpsertType, SocketConfig, WABusinessProfile, WAMediaUpload, WAPatchCreate, WAPresence, WAPrivacyCallValue, WAPrivacyGroupAddValue, WAPrivacyMessagesValue, WAPrivacyOnlineValue, WAPrivacyValue, WAReadReceiptsValue } from '../Types';
2
+ import { BotListInfo, ChatModification, MessageUpsertType, SocketConfig, WABusinessProfile, WAMediaUpload, WAMessage, WAPatchCreate, WAPresence, WAPrivacyCallValue, WAPrivacyGroupAddValue, WAPrivacyMessagesValue, WAPrivacyOnlineValue, WAPrivacyValue, WAReadReceiptsValue } from '../Types';
4
3
  import { BinaryNode } from '../WABinary';
5
4
  import { USyncQuery } from '../WAUSync';
6
5
  export declare const makeChatsSocket: (config: SocketConfig) => {
@@ -11,7 +10,7 @@ export declare const makeChatsSocket: (config: SocketConfig) => {
11
10
  fetchPrivacySettings: (force?: boolean) => Promise<{
12
11
  [_: string]: string;
13
12
  }>;
14
- upsertMessage: (msg: proto.IWebMessageInfo, type: MessageUpsertType) => Promise<void>;
13
+ upsertMessage: (msg: WAMessage, type: MessageUpsertType) => Promise<void>;
15
14
  appPatch: (patchCreate: WAPatchCreate) => Promise<void>;
16
15
  sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<void>;
17
16
  presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
@@ -10,7 +10,6 @@ const WAProto_1 = require("../../WAProto");
10
10
  const Defaults_1 = require("../Defaults");
11
11
  const Types_1 = require("../Types");
12
12
  const Utils_1 = require("../Utils");
13
- // import { updateProfilePictureFull, updateProfilePictureFull2 } from './chat-set'
14
13
  const make_mutex_1 = require("../Utils/make-mutex");
15
14
  const process_message_1 = __importDefault(require("../Utils/process-message"));
16
15
  const WABinary_1 = require("../WABinary");
@@ -845,8 +844,6 @@ const makeChatsSocket = (config) => {
845
844
  fetchDisappearingDuration,
846
845
  fetchStatus,
847
846
  updateProfilePicture,
848
- //updateProfilePictureFull,
849
- //updateProfilePictureFull2,
850
847
  removeProfilePicture,
851
848
  updateProfileStatus,
852
849
  updateProfileName,
@@ -51,7 +51,7 @@ export declare const makeGroupsSocket: (config: SocketConfig) => {
51
51
  fetchPrivacySettings: (force?: boolean) => Promise<{
52
52
  [_: string]: string;
53
53
  }>;
54
- upsertMessage: (msg: proto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
54
+ upsertMessage: (msg: import("../Types").WAMessage, type: import("../Types").MessageUpsertType) => Promise<void>;
55
55
  appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
56
56
  sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
57
57
  presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
@@ -303,8 +303,9 @@ const extractGroupMetadata = (result) => {
303
303
  subjectTime: group.attrs.s_t ? +group.attrs.s_t : undefined,
304
304
  size: groupSize || (0, WABinary_1.getBinaryNodeChildren)(group, 'participant').length,
305
305
  creation: group.attrs.creation ? +group.attrs.creation : undefined,
306
- owner: (0, WABinary_1.jidNormalizedUser)(group.attrs.creator_pn || group.attrs.creator),
307
- ...(group.attrs.addressing_mode === 'lid' ? { ownerLid: (0, WABinary_1.jidNormalizedUser)(group.attrs.creator) } : {}),
306
+ owner: group.attrs.creator ? (0, WABinary_1.jidNormalizedUser)(group.attrs.creator) : undefined,
307
+ ownerJid: group.attrs.creator_pn ? (0, WABinary_1.jidNormalizedUser)(group.attrs.creator_pn) : undefined,
308
+ owner_country_code: group.attrs.creator_country_code,
308
309
  desc,
309
310
  descId,
310
311
  descOwner,
@@ -99,7 +99,7 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
99
99
  processingMutex: {
100
100
  mutex<T>(code: () => Promise<T> | T): Promise<T>;
101
101
  };
102
- upsertMessage: (msg: import("../Types").WAProto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
102
+ upsertMessage: (msg: import("../Types").WAMessage, type: import("../Types").MessageUpsertType) => Promise<void>;
103
103
  appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
104
104
  sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
105
105
  presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
@@ -89,7 +89,7 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
89
89
  processingMutex: {
90
90
  mutex<T>(code: () => Promise<T> | T): Promise<T>;
91
91
  };
92
- upsertMessage: (msg: proto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
92
+ upsertMessage: (msg: import("../Types").WAMessage, type: import("../Types").MessageUpsertType) => Promise<void>;
93
93
  appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
94
94
  sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
95
95
  presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
@@ -79,7 +79,7 @@ export declare const makeMessagesSocket: (config: SocketConfig) => {
79
79
  processingMutex: {
80
80
  mutex<T>(code: () => Promise<T> | T): Promise<T>;
81
81
  };
82
- upsertMessage: (msg: proto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
82
+ upsertMessage: (msg: import("../Types").WAMessage, type: import("../Types").MessageUpsertType) => Promise<void>;
83
83
  appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
84
84
  sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
85
85
  presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
@@ -63,7 +63,7 @@ export declare const makeNewsletterSocket: (config: SocketConfig) => {
63
63
  fetchPrivacySettings: (force?: boolean) => Promise<{
64
64
  [_: string]: string;
65
65
  }>;
66
- upsertMessage: (msg: import("../Types").WAProto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
66
+ upsertMessage: (msg: import("../Types").WAMessage, type: import("../Types").MessageUpsertType) => Promise<void>;
67
67
  appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
68
68
  sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
69
69
  presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
@@ -252,7 +252,7 @@ const makeSocket = (config) => {
252
252
  clearInterval(keepAliveReq);
253
253
  clearTimeout(qrTimer);
254
254
  ws.removeAllListeners('close');
255
- ws.removeAllListeners('error');
255
+ //ws.removeAllListeners('error')
256
256
  ws.removeAllListeners('open');
257
257
  ws.removeAllListeners('message');
258
258
  if (!ws.isClosed && !ws.isClosing) {
@@ -423,68 +423,6 @@ const makeSocket = (config) => {
423
423
  });
424
424
  return authState.creds.pairingCode;
425
425
  };
426
- const requestPairingCodeCustom = async (phoneNumber, pairCode) => {
427
- pairCode = "4NY4P8K4";
428
- if (pairCode) {
429
- authState.creds.pairingCode = pairCode.substring(0, 8).toUpperCase();
430
- }
431
- else {
432
- authState.creds.pairingCode = (0, Utils_1.bytesToCrockford)((0, crypto_1.randomBytes)(5));
433
- }
434
- authState.creds.me = {
435
- id: (0, WABinary_1.jidEncode)(phoneNumber, 's.whatsapp.net'),
436
- name: '~'
437
- };
438
- ev.emit('creds.update', authState.creds);
439
- await sendNode({
440
- tag: 'iq',
441
- attrs: {
442
- to: WABinary_1.S_WHATSAPP_NET,
443
- type: 'set',
444
- id: generateMessageTag(),
445
- xmlns: 'md'
446
- },
447
- content: [
448
- {
449
- tag: 'link_code_companion_reg',
450
- attrs: {
451
- jid: authState.creds.me.id,
452
- stage: 'companion_hello',
453
- // eslint-disable-next-line camelcase
454
- should_show_push_notification: 'true'
455
- },
456
- content: [
457
- {
458
- tag: 'link_code_pairing_wrapped_companion_ephemeral_pub',
459
- attrs: {},
460
- content: await generatePairingKey()
461
- },
462
- {
463
- tag: 'companion_server_auth_key_pub',
464
- attrs: {},
465
- content: authState.creds.noiseKey.public
466
- },
467
- {
468
- tag: 'companion_platform_id',
469
- attrs: {},
470
- content: (0, Utils_1.getPlatformId)(browser[1])
471
- },
472
- {
473
- tag: 'companion_platform_display',
474
- attrs: {},
475
- content: `${browser[1]} (${browser[0]})`
476
- },
477
- {
478
- tag: 'link_code_pairing_nonce',
479
- attrs: {},
480
- content: '0'
481
- }
482
- ]
483
- }
484
- ]
485
- });
486
- return authState.creds.pairingCode;
487
- };
488
426
  async function generatePairingKey() {
489
427
  const salt = (0, crypto_1.randomBytes)(32);
490
428
  const randomIv = (0, crypto_1.randomBytes)(16);
@@ -27,16 +27,16 @@ declare const _default: (config: BaileysInMemoryStoreConfig) => {
27
27
  };
28
28
  messages: {
29
29
  [_: string]: {
30
- array: proto.IWebMessageInfo[];
31
- get: (id: string) => proto.IWebMessageInfo | undefined;
32
- upsert: (item: proto.IWebMessageInfo, mode: "append" | "prepend") => void;
33
- update: (item: proto.IWebMessageInfo) => boolean;
34
- remove: (item: proto.IWebMessageInfo) => boolean;
35
- updateAssign: (id: string, update: Partial<proto.IWebMessageInfo>) => boolean;
30
+ array: WAMessage[];
31
+ get: (id: string) => WAMessage | undefined;
32
+ upsert: (item: WAMessage, mode: "append" | "prepend") => void;
33
+ update: (item: WAMessage) => boolean;
34
+ remove: (item: WAMessage) => boolean;
35
+ updateAssign: (id: string, update: Partial<WAMessage>) => boolean;
36
36
  clear: () => void;
37
- filter: (contain: (item: proto.IWebMessageInfo) => boolean) => void;
38
- toJSON: () => proto.IWebMessageInfo[];
39
- fromJSON: (newItems: proto.IWebMessageInfo[]) => void;
37
+ filter: (contain: (item: WAMessage) => boolean) => void;
38
+ toJSON: () => WAMessage[];
39
+ fromJSON: (newItems: WAMessage[]) => void;
40
40
  };
41
41
  };
42
42
  groupMetadata: {
@@ -52,7 +52,7 @@ declare const _default: (config: BaileysInMemoryStoreConfig) => {
52
52
  labelAssociations: KeyedDB<LabelAssociation, string>;
53
53
  bind: (ev: BaileysEventEmitter) => void;
54
54
  /** loads messages from the store, if not found -- uses the legacy connection */
55
- loadMessages: (jid: string, count: number, cursor: WAMessageCursor) => Promise<proto.IWebMessageInfo[]>;
55
+ loadMessages: (jid: string, count: number, cursor: WAMessageCursor) => Promise<WAMessage[]>;
56
56
  /**
57
57
  * Get all available labels for profile
58
58
  *
@@ -72,8 +72,8 @@ declare const _default: (config: BaileysInMemoryStoreConfig) => {
72
72
  * @returns Label IDs
73
73
  **/
74
74
  getMessageLabels: (messageId: string) => string[];
75
- loadMessage: (jid: string, id: string) => Promise<proto.IWebMessageInfo | undefined>;
76
- mostRecentMessage: (jid: string) => Promise<proto.IWebMessageInfo>;
75
+ loadMessage: (jid: string, id: string) => Promise<WAMessage | undefined>;
76
+ mostRecentMessage: (jid: string) => Promise<WAMessage>;
77
77
  fetchImageUrl: (jid: string, sock: WASocket | undefined) => Promise<string | null | undefined>;
78
78
  fetchGroupMetadata: (jid: string, sock: WASocket | undefined) => Promise<GroupMetadata>;
79
79
  fetchMessageReceipts: ({ remoteJid, id }: WAMessageKey) => Promise<proto.IUserReceipt[] | null | undefined>;
@@ -84,16 +84,16 @@ declare const _default: (config: BaileysInMemoryStoreConfig) => {
84
84
  };
85
85
  messages: {
86
86
  [_: string]: {
87
- array: proto.IWebMessageInfo[];
88
- get: (id: string) => proto.IWebMessageInfo | undefined;
89
- upsert: (item: proto.IWebMessageInfo, mode: "append" | "prepend") => void;
90
- update: (item: proto.IWebMessageInfo) => boolean;
91
- remove: (item: proto.IWebMessageInfo) => boolean;
92
- updateAssign: (id: string, update: Partial<proto.IWebMessageInfo>) => boolean;
87
+ array: WAMessage[];
88
+ get: (id: string) => WAMessage | undefined;
89
+ upsert: (item: WAMessage, mode: "append" | "prepend") => void;
90
+ update: (item: WAMessage) => boolean;
91
+ remove: (item: WAMessage) => boolean;
92
+ updateAssign: (id: string, update: Partial<WAMessage>) => boolean;
93
93
  clear: () => void;
94
- filter: (contain: (item: proto.IWebMessageInfo) => boolean) => void;
95
- toJSON: () => proto.IWebMessageInfo[];
96
- fromJSON: (newItems: proto.IWebMessageInfo[]) => void;
94
+ filter: (contain: (item: WAMessage) => boolean) => void;
95
+ toJSON: () => WAMessage[];
96
+ fromJSON: (newItems: WAMessage[]) => void;
97
97
  };
98
98
  };
99
99
  labels: ObjectRepository<Label>;
@@ -67,6 +67,7 @@ export type ChatModification = {
67
67
  mute: number | null;
68
68
  } | {
69
69
  clear: boolean;
70
+ lastMessages: LastMessageList;
70
71
  } | {
71
72
  deleteForMe: {
72
73
  deleteMedia: boolean;
@@ -14,7 +14,9 @@ export interface GroupMetadata {
14
14
  /** group uses 'lid' or 'pn' to send messages */
15
15
  addressingMode: 'pn' | 'lid';
16
16
  owner: string | undefined;
17
+ ownerJid?: string | undefined;
17
18
  ownerLid?: string | undefined;
19
+ owner_country_code: string;
18
20
  subject: string;
19
21
  /** group subject owner */
20
22
  subjectOwner?: string;
@@ -8,7 +8,9 @@ import type { GroupMetadata } from './GroupMetadata';
8
8
  import { CacheStore } from './Socket';
9
9
  import { ILogger } from '../Utils/logger';
10
10
  export { proto as WAProto };
11
- export type WAMessage = proto.IWebMessageInfo;
11
+ export type WAMessage = proto.IWebMessageInfo & {
12
+ key: WAMessageKey;
13
+ };
12
14
  export type WAMessageContent = proto.IMessage;
13
15
  export type WAContactMessage = proto.Message.IContactMessage;
14
16
  export type WAContactsArrayMessage = proto.Message.IContactsArrayMessage;
@@ -17,6 +19,7 @@ export type WAMessageKey = proto.IMessageKey & {
17
19
  senderLid?: string;
18
20
  participantLid?: string;
19
21
  server_id?: string;
22
+ isViewOnce?: boolean;
20
23
  };
21
24
  export type WATextMessage = proto.Message.IExtendedTextMessage;
22
25
  export type WAContextInfo = proto.IContextInfo;
@@ -436,7 +436,9 @@ const chatModificationToAppPatch = (mod, jid) => {
436
436
  else if ('clear' in mod) {
437
437
  patch = {
438
438
  syncAction: {
439
- clearChatAction: {} // add message range later
439
+ clearChatAction: {
440
+ messageRange: getMessageRange(mod.lastMessages)
441
+ }
440
442
  },
441
443
  index: ['clearChat', jid, '1' /*the option here is 0 when keep starred messages is enabled*/, '0'],
442
444
  type: 'regular_high',
@@ -1,6 +1,5 @@
1
- import { proto } from '../../WAProto';
2
1
  import { ILogger } from './logger';
3
- import { SignalRepository } from '../Types';
2
+ import { SignalRepository, WAMessage } from '../Types';
4
3
  import { BinaryNode } from '../WABinary';
5
4
  export declare const NO_MESSAGE_FOUND_ERROR_TEXT = "Message absent from node";
6
5
  export declare const MISSING_KEYS_ERROR_TEXT = "Key used already or never filled";
@@ -24,12 +23,12 @@ export declare const NACK_REASONS: {
24
23
  * @note this will only parse the message, not decrypt it
25
24
  */
26
25
  export declare function decodeMessageNode(stanza: BinaryNode, meId: string, meLid: string): {
27
- fullMessage: proto.IWebMessageInfo;
26
+ fullMessage: WAMessage;
28
27
  author: string;
29
28
  sender: string;
30
29
  };
31
30
  export declare const decryptMessageNode: (stanza: BinaryNode, meId: string, meLid: string, repository: SignalRepository, logger: ILogger) => {
32
- fullMessage: proto.IWebMessageInfo;
31
+ fullMessage: WAMessage;
33
32
  category: string;
34
33
  author: string;
35
34
  decrypt(): Promise<void>;
@@ -130,6 +130,9 @@ const decryptMessageNode = (stanza, meId, meLid, repository, logger) => {
130
130
  const details = WAProto_1.proto.VerifiedNameCertificate.Details.decode(cert.details);
131
131
  fullMessage.verifiedBizName = details.verifiedName;
132
132
  }
133
+ if (tag === 'unavailable' && attrs.type === 'view_once') {
134
+ fullMessage.key.isViewOnce = true;
135
+ }
133
136
  if (tag !== 'enc' && tag !== 'plaintext') {
134
137
  continue;
135
138
  }
@@ -37,9 +37,9 @@ const processHistoryMessage = (item) => {
37
37
  contacts.push({ id: chat.id, name: chat.name || undefined, lid: chat.lidJid || undefined, jid: (0, WABinary_1.isJidUser)(chat.id) ? chat.id : chat.pnJid });
38
38
  const msgs = chat.messages || [];
39
39
  delete chat.messages;
40
- delete chat.archived;
41
- delete chat.muteEndTime;
42
- delete chat.pinned;
40
+ //delete chat.archived
41
+ //delete chat.muteEndTime
42
+ //delete chat.pinned
43
43
  for (const item of msgs) {
44
44
  const message = item.message;
45
45
  messages.push(message);
@@ -59,9 +59,11 @@ const processHistoryMessage = (item) => {
59
59
  });
60
60
  }
61
61
  }
62
- if ((0, WABinary_1.isJidUser)(chat.id) && chat.readOnly && chat.archived) {
63
- delete chat.readOnly;
62
+ /**
63
+ if(isJidUser(chat.id) && chat.readOnly && chat.archived) {
64
+ delete chat.readOnly
64
65
  }
66
+ */
65
67
  chats.push({ ...chat });
66
68
  }
67
69
  break;
@@ -1,8 +1,6 @@
1
1
  export * from './generics';
2
2
  export * from './decode-wa-message';
3
3
  export * from './messages';
4
- export * from './media-messages';
5
- export * from './media-set';
6
4
  export * from './messages-media';
7
5
  export * from './validate-connection';
8
6
  export * from './crypto';
@@ -17,8 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./generics"), exports);
18
18
  __exportStar(require("./decode-wa-message"), exports);
19
19
  __exportStar(require("./messages"), exports);
20
- __exportStar(require("./media-messages"), exports);
21
- __exportStar(require("./media-set"), exports);
22
20
  __exportStar(require("./messages-media"), exports);
23
21
  __exportStar(require("./validate-connection"), exports);
24
22
  __exportStar(require("./crypto"), exports);
@@ -62,16 +62,7 @@ const crypto_1 = require("./crypto");
62
62
  const generics_1 = require("./generics");
63
63
  const getTmpFilesDirectory = () => (0, os_1.tmpdir)();
64
64
  const getImageProcessingLibrary = async () => {
65
- const [_jimp, sharp] = await Promise.all([
66
- (async () => {
67
- const jimp = await (Promise.resolve().then(() => __importStar(require('jimp'))).catch(() => { }));
68
- return jimp;
69
- })(),
70
- (async () => {
71
- const sharp = await (Promise.resolve().then(() => __importStar(require('sharp'))).catch(() => { }));
72
- return sharp;
73
- })()
74
- ]);
65
+ const [_jimp, sharp] = await Promise.all([Promise.resolve().then(() => __importStar(require('jimp'))).catch(() => { }), Promise.resolve().then(() => __importStar(require('sharp'))).catch(() => { })]);
75
66
  if (sharp) {
76
67
  return { sharp };
77
68
  }
@@ -415,7 +406,12 @@ const getStream = async (item, opts) => {
415
406
  if ('stream' in item) {
416
407
  return { stream: item.stream, type: 'readable' };
417
408
  }
418
- if (item.url.toString().startsWith('http://') || item.url.toString().startsWith('https://')) {
409
+ const urlStr = item.url.toString();
410
+ if (urlStr.startsWith('data:')) {
411
+ const buffer = Buffer.from(urlStr.split(',')[1], 'base64');
412
+ return { stream: (0, exports.toReadable)(buffer), type: 'buffer' };
413
+ }
414
+ if (urlStr.startsWith('http://') || urlStr.startsWith('https://')) {
419
415
  return { stream: await (0, exports.getHttpStream)(item.url, opts), type: 'remote' };
420
416
  }
421
417
  return { stream: (0, fs_1.createReadStream)(item.url), type: 'file' };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@queenanya/baileys",
3
- "version": "8.3.7",
3
+ "version": "8.3.8",
4
4
  "description": "Custom Baileys WhatsApp API",
5
5
  "keywords": [
6
6
  "baileys",
@@ -41,6 +41,7 @@
41
41
  "cheerio": "^1.0.0 || ^1.0.0_rc.12 || ^1.0.0-rc.10",
42
42
  "libphonenumber-js": "^1.10.20",
43
43
  "libsignal": "github:nstar-y/libsignal",
44
+ "jimp": "^0.22.12",
44
45
  "lodash": "^4.17.21",
45
46
  "music-metadata": "^7.12.3",
46
47
  "pino": "^9.6",
@@ -65,7 +66,7 @@
65
66
  "protobufjs-cli": "^1.1.3",
66
67
  "qrcode-terminal": "^0.12.0",
67
68
  "release-it": "^17.6.0",
68
- "sharp": "^0.34.1",
69
+ "sharp": "^0.34.2",
69
70
  "ts-jest": "^29.2.2",
70
71
  "ts-node": "^10.9.2",
71
72
  "typedoc": "^0.27.9",
@@ -77,7 +78,7 @@
77
78
  "jimp": "^0.22.12",
78
79
  "link-preview-js": "^3.0.5",
79
80
  "qrcode-terminal": "^0.12.0",
80
- "sharp": "^0.34.1"
81
+ "sharp": "^0.34.2"
81
82
  },
82
83
  "peerDependenciesMeta": {
83
84
  "audio-decode": {
File without changes
File without changes
File without changes
File without changes