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

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: authStrategies/LocalAuth.js</title>
<title>whatsapp-web.js 1.34.7 &raquo; Source: authStrategies/LocalAuth.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>
@ -39,16 +39,18 @@ const BaseAuthStrategy &#x3D; require(&#x27;./BaseAuthStrategy&#x27;);
* Local directory-based authentication
* @param {object} options - options
* @param {string} options.clientId - Client id to distinguish instances if you are using multiple, otherwise keep null if you are using only one instance
* @param {string} options.dataPath - Change the default path for saving session files, default is: &quot;./.wwebjs_auth/&quot;
* @param {string} options.dataPath - Change the default path for saving session files, default is: &quot;./.wwebjs_auth/&quot;
* @param {number} options.rmMaxRetries - Sets the maximum number of retries for removing the session directory
*/
*/
class LocalAuth extends BaseAuthStrategy {
constructor({ clientId, dataPath, rmMaxRetries }&#x3D;{}) {
constructor({ clientId, dataPath, rmMaxRetries } &#x3D; {}) {
super();
const idRegex &#x3D; /^[-_\w]+$/i;
if(clientId &amp;amp;&amp;amp; !idRegex.test(clientId)) {
throw new Error(&#x27;Invalid clientId. Only alphanumeric characters, underscores and hyphens are allowed.&#x27;);
if (clientId &amp;amp;&amp;amp; !idRegex.test(clientId)) {
throw new Error(
&#x27;Invalid clientId. Only alphanumeric characters, underscores and hyphens are allowed.&#x27;,
);
}
this.dataPath &#x3D; path.resolve(dataPath || &#x27;./.wwebjs_auth/&#x27;);
@ -58,18 +60,25 @@ class LocalAuth extends BaseAuthStrategy {
async beforeBrowserInitialized() {
const puppeteerOpts &#x3D; this.client.options.puppeteer;
const sessionDirName &#x3D; this.clientId ? &#x60;session-${this.clientId}&#x60; : &#x27;session&#x27;;
const sessionDirName &#x3D; this.clientId
? &#x60;session-${this.clientId}&#x60;
: &#x27;session&#x27;;
const dirPath &#x3D; path.join(this.dataPath, sessionDirName);
if(puppeteerOpts.userDataDir &amp;amp;&amp;amp; puppeteerOpts.userDataDir !&#x3D;&#x3D; dirPath) {
throw new Error(&#x27;LocalAuth is not compatible with a user-supplied userDataDir.&#x27;);
if (
puppeteerOpts.userDataDir &amp;amp;&amp;amp;
puppeteerOpts.userDataDir !&#x3D;&#x3D; dirPath
) {
throw new Error(
&#x27;LocalAuth is not compatible with a user-supplied userDataDir.&#x27;,
);
}
fs.mkdirSync(dirPath, { recursive: true });
this.client.options.puppeteer &#x3D; {
...puppeteerOpts,
userDataDir: dirPath
userDataDir: dirPath,
};
this.userDataDir &#x3D; dirPath;
@ -77,13 +86,17 @@ class LocalAuth extends BaseAuthStrategy {
async logout() {
if (this.userDataDir) {
await fs.promises.rm(this.userDataDir, { recursive: true, force: true, maxRetries: this.rmMaxRetries })
await fs.promises
.rm(this.userDataDir, {
recursive: true,
force: true,
maxRetries: this.rmMaxRetries,
})
.catch((e) &#x3D;&gt; {
throw new Error(e);
});
}
}
}
module.exports &#x3D; LocalAuth;
@ -97,7 +110,7 @@ module.exports &#x3D; LocalAuth;
<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>