chore(v1.34.7): bump version and generate docs

This commit is contained in:
WWebJS Bot 2026-04-24 20:10:36 +00:00
commit f935b50011
77 changed files with 5207 additions and 2669 deletions

View file

@ -4,7 +4,7 @@
<head>
<meta name="generator" content="JSDoc 3.6.11">
<meta charset="utf-8">
<title>whatsapp-web.js 1.34.6 &raquo; Source: structures/MessageMedia.js</title>
<title>whatsapp-web.js 1.34.7 &raquo; Source: structures/MessageMedia.js</title>
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
@ -15,7 +15,7 @@
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
<div id="jsdoc-navbar-container">
<div id="jsdoc-navbar-content">
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>34.<wbr>6</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>34.<wbr>7</a>
</div>
</div>
</nav>
@ -63,7 +63,7 @@ class MessageMedia {
* @type {?string}
*/
this.filename &#x3D; filename;
/**
* Document file size in bytes. Value can be null
* @type {?number}
@ -73,12 +73,12 @@ class MessageMedia {
/**
* Creates a MessageMedia instance from a local file path
* @param {string} filePath
* @param {string} filePath
* @returns {MessageMedia}
*/
static fromFilePath(filePath) {
const b64data &#x3D; fs.readFileSync(filePath, {encoding: &#x27;base64&#x27;});
const mimetype &#x3D; mime.getType(filePath);
const b64data &#x3D; fs.readFileSync(filePath, { encoding: &#x27;base64&#x27; });
const mimetype &#x3D; mime.getType(filePath);
const filename &#x3D; path.basename(filePath);
return new MessageMedia(mimetype, b64data, filename);
@ -100,16 +100,25 @@ class MessageMedia {
let mimetype &#x3D; mime.getType(pUrl.pathname);
if (!mimetype &amp;amp;&amp;amp; !options.unsafeMime)
throw new Error(&#x27;Unable to determine MIME type using URL. Set unsafeMime to true to download it anyway.&#x27;);
throw new Error(
&#x27;Unable to determine MIME type using URL. Set unsafeMime to true to download it anyway.&#x27;,
);
async function fetchData (url, options) {
const reqOptions &#x3D; Object.assign({ headers: { accept: &#x27;image/* video/* text/* audio/*&#x27; } }, options);
async function fetchData(url, options) {
const reqOptions &#x3D; Object.assign(
{ headers: { accept: &#x27;image/* video/* text/* audio/*&#x27; } },
options,
);
const response &#x3D; await fetch(url, reqOptions);
const mime &#x3D; response.headers.get(&#x27;Content-Type&#x27;);
const size &#x3D; response.headers.get(&#x27;Content-Length&#x27;);
const contentDisposition &#x3D; response.headers.get(&#x27;Content-Disposition&#x27;);
const name &#x3D; contentDisposition ? contentDisposition.match(/((?&amp;lt;&#x3D;filename&#x3D;&quot;)(.*)(?&#x3D;&quot;))/) : null;
const contentDisposition &#x3D; response.headers.get(
&#x27;Content-Disposition&#x27;,
);
const name &#x3D; contentDisposition
? contentDisposition.match(/((?&amp;lt;&#x3D;filename&#x3D;&quot;)(.*)(?&#x3D;&quot;))/)
: null;
let data &#x3D; &#x27;&#x27;;
if (response.buffer) {
@ -121,19 +130,23 @@ class MessageMedia {
});
data &#x3D; btoa(data);
}
return { data, mime, name, size };
}
const res &#x3D; options.client
? (await options.client.pupPage.evaluate(fetchData, url, options.reqOptions))
: (await fetchData(url, options.reqOptions));
? await options.client.pupPage.evaluate(
fetchData,
url,
options.reqOptions,
)
: await fetchData(url, options.reqOptions);
const filename &#x3D; options.filename ||
(res.name ? res.name[0] : (pUrl.pathname.split(&#x27;/&#x27;).pop() || &#x27;file&#x27;));
if (!mimetype)
mimetype &#x3D; res.mime;
const filename &#x3D;
options.filename ||
(res.name ? res.name[0] : pUrl.pathname.split(&#x27;/&#x27;).pop() || &#x27;file&#x27;);
if (!mimetype) mimetype &#x3D; res.mime;
return new MessageMedia(mimetype, res.data, filename, res.size || null);
}
@ -150,7 +163,7 @@ module.exports &#x3D; MessageMedia;
<footer id="jsdoc-footer" class="jsdoc-footer">
<div id="jsdoc-footer-container">
<p>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.11 on January 30, 2026.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.11 on April 24, 2026.
</p>
</div>
</footer>