@oxidezap/baileyrs 0.3.15 → 0.3.18
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/Socket/transport.js +6 -1
- package/lib/Utils/optional-peer.js +1 -1
- package/package.json +10 -10
package/lib/Socket/transport.js
CHANGED
|
@@ -153,7 +153,8 @@ export const makeTransport = (config) => {
|
|
|
153
153
|
};
|
|
154
154
|
export const makeHttpClient = (config) => ({
|
|
155
155
|
async execute(url, method, headers, body) {
|
|
156
|
-
|
|
156
|
+
// Workers supports manual redirects. Keep the bridge on the original authority.
|
|
157
|
+
const fetchOpts = { method, headers, redirect: 'manual' };
|
|
157
158
|
if (body)
|
|
158
159
|
fetchOpts.body = body;
|
|
159
160
|
if (config.options?.dispatcher)
|
|
@@ -162,6 +163,10 @@ export const makeHttpClient = (config) => ({
|
|
|
162
163
|
if (resp.status === 0 || resp.type === 'opaqueredirect') {
|
|
163
164
|
throw new Error('HTTP adapter received an unobservable redirect or network response');
|
|
164
165
|
}
|
|
166
|
+
if (resp.status >= 300 && resp.status < 400) {
|
|
167
|
+
await resp.body?.cancel();
|
|
168
|
+
throw new TypeError(`HTTP adapter rejected redirect (HTTP ${resp.status})`);
|
|
169
|
+
}
|
|
165
170
|
const buf = new Uint8Array(await resp.arrayBuffer());
|
|
166
171
|
return { statusCode: resp.status, body: buf };
|
|
167
172
|
}
|
|
@@ -24,7 +24,7 @@ const isAbsent = (error) => error?.code === 'MODULE_NOT_FOUND';
|
|
|
24
24
|
export const loadOptionalPeer = (specifier, loader) => {
|
|
25
25
|
const effectiveLoader = loader ??
|
|
26
26
|
(typeof globalThis.process
|
|
27
|
-
?.getBuiltinModule === 'function'
|
|
27
|
+
?.getBuiltinModule === 'function' && import.meta.url
|
|
28
28
|
? nodePeerLoader(import.meta.url)
|
|
29
29
|
: undefined);
|
|
30
30
|
if (!effectiveLoader)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxidezap/baileyrs",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.18",
|
|
5
5
|
"description": "A Rust-powered WhatsApp Web library for JavaScript, with a Baileys-compatible API",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"whatsapp",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"dependencies": {
|
|
99
99
|
"@oxidezap/whatsapp-rust-bridge": "0.26.8",
|
|
100
100
|
"events": "^3.3.0",
|
|
101
|
-
"fs-native-extensions": "1.5.
|
|
101
|
+
"fs-native-extensions": "1.5.4",
|
|
102
102
|
"long": "^5.3.2"
|
|
103
103
|
},
|
|
104
104
|
"devDependencies": {
|
|
@@ -108,21 +108,21 @@
|
|
|
108
108
|
"@types/node": "^26.1.1",
|
|
109
109
|
"baileys": "7.0.0-rc14",
|
|
110
110
|
"jimp": "^1.6.0",
|
|
111
|
-
"link-preview-js": "^
|
|
111
|
+
"link-preview-js": "^6.0.0",
|
|
112
112
|
"music-metadata": "^12.2.2",
|
|
113
|
-
"oxfmt": "^0.
|
|
114
|
-
"oxlint": "1.
|
|
113
|
+
"oxfmt": "^0.79.0",
|
|
114
|
+
"oxlint": "1.94.0",
|
|
115
115
|
"pino": "^10.3.1",
|
|
116
116
|
"pino-pretty": "^13.1.3",
|
|
117
|
-
"pkg-pr-new": "^0.0.
|
|
117
|
+
"pkg-pr-new": "^0.0.94",
|
|
118
118
|
"protobufjs": "^8.8.0",
|
|
119
119
|
"tsc-esm-fix": "^3.1.2",
|
|
120
120
|
"typescript": "^7.0.2",
|
|
121
121
|
"typescript-compat-auditor": "npm:typescript@6.0.3",
|
|
122
|
-
"undici": "7.30.
|
|
123
|
-
"vite": "8.3.
|
|
124
|
-
"vitest": "5.1.
|
|
125
|
-
"wrangler": "4.
|
|
122
|
+
"undici": "7.30.2",
|
|
123
|
+
"vite": "8.3.8",
|
|
124
|
+
"vitest": "5.1.1",
|
|
125
|
+
"wrangler": "4.166.0"
|
|
126
126
|
},
|
|
127
127
|
"peerDependencies": {
|
|
128
128
|
"@hapi/boom": "^9.1.0 || ^10.0.0",
|