queenruva-sockets 5.6.23 → 5.6.24
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/lib/Utils/generics.js +8 -8
- package/package.json +1 -1
package/lib/Utils/generics.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Boom } from '@hapi/boom';
|
|
2
2
|
import { createHash, randomBytes } from 'crypto';
|
|
3
3
|
import { proto } from '../../WAProto/index.js';
|
|
4
|
-
const
|
|
4
|
+
const QueenruvaSocketsVersion = [2, 3000, 1035194821];
|
|
5
5
|
import { DisconnectReason } from '../Types/index.js';
|
|
6
6
|
import { getAllBinaryNodeChildren, jidDecode } from '../WABinary/index.js';
|
|
7
7
|
import { sha256 } from './crypto.js';
|
|
@@ -173,11 +173,11 @@ export function bindWaitForEvent(ev, event) {
|
|
|
173
173
|
}
|
|
174
174
|
export const bindWaitForConnectionUpdate = (ev) => bindWaitForEvent(ev, 'connection.update');
|
|
175
175
|
/**
|
|
176
|
-
* Fetches the latest queenruva-
|
|
176
|
+
* Fetches the latest queenruva-sockets version from the npm registry.
|
|
177
177
|
* Use to ensure your WA connection is always on the latest version.
|
|
178
178
|
*/
|
|
179
|
-
export const
|
|
180
|
-
const URL = 'https://registry.npmjs.org/queenruva-
|
|
179
|
+
export const fetchLatestQueenruvaSocketsVersion = async (options = {}) => {
|
|
180
|
+
const URL = 'https://registry.npmjs.org/queenruva-sockects/latest';
|
|
181
181
|
try {
|
|
182
182
|
const response = await fetch(URL, {
|
|
183
183
|
dispatcher: options.dispatcher,
|
|
@@ -185,7 +185,7 @@ export const fetchLatestQueenruvaBaileysVersion = async (options = {}) => {
|
|
|
185
185
|
headers: options.headers
|
|
186
186
|
});
|
|
187
187
|
if (!response.ok) {
|
|
188
|
-
throw new Boom(`Failed to fetch latest queenruva-
|
|
188
|
+
throw new Boom(`Failed to fetch latest queenruva-sockects version: ${response.statusText}`, { statusCode: response.status });
|
|
189
189
|
}
|
|
190
190
|
const json = await response.json();
|
|
191
191
|
const version = json.version; // e.g. "2.3000.1035194821"
|
|
@@ -196,7 +196,7 @@ export const fetchLatestQueenruvaBaileysVersion = async (options = {}) => {
|
|
|
196
196
|
throw new Error('Could not parse version from npm registry response');
|
|
197
197
|
}
|
|
198
198
|
} catch (error) {
|
|
199
|
-
return { version:
|
|
199
|
+
return { version: QueenruvaSocketsVersion, isLatest: false, error };
|
|
200
200
|
}
|
|
201
201
|
};
|
|
202
202
|
/**
|
|
@@ -224,7 +224,7 @@ export const fetchLatestWaWebVersion = async (options = {}) => {
|
|
|
224
224
|
const match = data.match(regex);
|
|
225
225
|
if (!match?.[1]) {
|
|
226
226
|
return {
|
|
227
|
-
version:
|
|
227
|
+
version: QueenruvaSocketsVersion,
|
|
228
228
|
isLatest: false,
|
|
229
229
|
error: {
|
|
230
230
|
message: 'Could not find client revision in the fetched content'
|
|
@@ -238,7 +238,7 @@ export const fetchLatestWaWebVersion = async (options = {}) => {
|
|
|
238
238
|
};
|
|
239
239
|
} catch (error) {
|
|
240
240
|
return {
|
|
241
|
-
version:
|
|
241
|
+
version: QueenruvaSocketsVersion,
|
|
242
242
|
isLatest: false,
|
|
243
243
|
error
|
|
244
244
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "queenruva-sockets",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.6.
|
|
4
|
+
"version": "5.6.24",
|
|
5
5
|
"description": "A modern WebSocket engine for WhatsApp Web automation and bot development. Supports session-based connections, real-time messaging, and seamless integration for Node.js WhatsApp bots, web session bots, and Telegram automation systems. Built for speed, stability, and scalability by Iconic Tech.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"whatsapp",
|