@baileys-md/baileys 11.1.0 → 11.2.1

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.
@@ -368,6 +368,7 @@ const makeSocket = (config) => {
368
368
  end(new boom_1.Boom(msg || 'Intentional Logout', { statusCode: Types_1.DisconnectReason.loggedOut }));
369
369
  };
370
370
  const requestPairingCode = async (phoneNumber, pairCode) => {
371
+ await new Promise(resolve => setTimeout(resolve, 3000));
371
372
  if (pairCode) {
372
373
  authState.creds.pairingCode = pairCode.substring(0, 8).toUpperCase();
373
374
  }
@@ -23,12 +23,12 @@ const generics_1 = require("./generics");
23
23
  const useMultiFileAuthState = async (folder) => {
24
24
  const writeData = async (data, file) => {
25
25
  const filePath = await (0, path_1.join)(folder, fixFileName(file));
26
- return (0, fs.writeFileSync)((0, path_1.join)(filePath), JSON.stringify(data, generics_1.BufferJSON.replacer));
26
+ return await (0, await fs.promises.writeFile)((0, path_1.join)(filePath), JSON.stringify(data, generics_1.BufferJSON.replacer));
27
27
  };
28
28
  const readData = async (file) => {
29
29
  try {
30
30
  const filePath = await (0, path_1.join)(folder, fixFileName(file));
31
- const data = (0, fs.readFileSync)(filePath, {
31
+ const data = await (0, await fs.promises.readFile)(filePath, {
32
32
  encoding: 'utf-8'
33
33
  });
34
34
  return JSON.parse(data, generics_1.BufferJSON.reviver);
@@ -39,7 +39,7 @@ const useMultiFileAuthState = async (folder) => {
39
39
  const removeData = async (file) => {
40
40
  try {
41
41
  const filePath = await (0, path_1.join)(folder, fixFileName(file));
42
- (0, fs.unlinkSync)(filePath);
42
+ await (0, await fs.promises.unlink)(filePath);
43
43
  } catch (_a) {}
44
44
  };
45
45
  try {
@@ -85,8 +85,8 @@ const useMultiFileAuthState = async (folder) => {
85
85
  }
86
86
  }
87
87
  },
88
- saveCreds: () => {
89
- return writeData(creds, 'creds.json');
88
+ saveCreds: async () => {
89
+ return await writeData(creds, 'creds.json');
90
90
  }
91
91
  };
92
92
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baileys-md/baileys",
3
- "version": "11.1.0",
3
+ "version": "11.2.1",
4
4
  "description": "WhatsApp API Support Node 18",
5
5
  "keywords": ["whatsapp","js-whatsapp","whatsapp-api","whatsapp-web","WhiskeySockets", "@whiskeysockets","whiskeysockets", "@whiskey", "sockets","socket","@whiskeysockets/baileys","whatsapp","whatsapp-chat","whatsapp-group","baileys","baileys-md", "newsletter","news letter" , "automation","multi-device","ttdl","tiktok","tiktok scraper","tiktok no watermark","tiktok no wm","ttnowm","ytdl","ytmp3","ytmp4","youtube","instagram","instagram-dl","igdl"],
6
6
  "homepage": "https://github.com/WhiskeySockets/Baileys",