chore(): generate docs

This commit is contained in:
WWebJS Bot 2025-03-27 07:51:22 +00:00
commit d26d87507d
73 changed files with 273 additions and 234 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.26.1-alpha.3 &raquo; Source: authStrategies/RemoteAuth.js</title>
<title>whatsapp-web.js 1.27.0 &raquo; Source: authStrategies/RemoteAuth.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>26.<wbr>1-alpha.<wbr>3</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>27.<wbr>0</a>
</div>
</div>
</nav>
@ -53,9 +53,10 @@ const BaseAuthStrategy &#x3D; require(&#x27;./BaseAuthStrategy&#x27;);
* @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 {number} options.backupSyncIntervalMs - Sets the time interval for periodic session backups. Accepts values starting from 60000ms {1 minute}
* @param {number} options.rmMaxRetries - Sets the maximum number of retries for removing the session directory
*/
class RemoteAuth extends BaseAuthStrategy {
constructor({ clientId, dataPath, store, backupSyncIntervalMs } &#x3D; {}) {
constructor({ clientId, dataPath, store, backupSyncIntervalMs, rmMaxRetries } &#x3D; {}) {
if (!fs &amp;amp;&amp;amp; !unzipper &amp;amp;&amp;amp; !archiver) throw new Error(&#x27;Optional Dependencies [fs-extra, unzipper, archiver] are required to use RemoteAuth. Make sure to run npm install correctly and remove the --no-optional flag&#x27;);
super();
@ -74,6 +75,7 @@ class RemoteAuth extends BaseAuthStrategy {
this.dataPath &#x3D; path.resolve(dataPath || &#x27;./.wwebjs_auth/&#x27;);
this.tempDir &#x3D; &#x60;${this.dataPath}/wwebjs_temp_session_${this.clientId}&#x60;;
this.requiredDirs &#x3D; [&#x27;Default&#x27;, &#x27;IndexedDB&#x27;, &#x27;Local Storage&#x27;]; /* &#x3D;&gt; Required Files &amp;amp; Dirs in WWebJS to restore session */
this.rmMaxRetries &#x3D; rmMaxRetries ?? 4;
}
async beforeBrowserInitialized() {
@ -111,7 +113,8 @@ class RemoteAuth extends BaseAuthStrategy {
if (pathExists) {
await fs.promises.rm(this.userDataDir, {
recursive: true,
force: true
force: true,
maxRetries: this.rmMaxRetries,
}).catch(() &#x3D;&gt; {});
}
clearInterval(this.backupSync);
@ -138,7 +141,8 @@ class RemoteAuth extends BaseAuthStrategy {
await fs.promises.unlink(&#x60;${this.sessionName}.zip&#x60;);
await fs.promises.rm(&#x60;${this.tempDir}&#x60;, {
recursive: true,
force: true
force: true,
maxRetries: this.rmMaxRetries,
}).catch(() &#x3D;&gt; {});
if(options &amp;amp;&amp;amp; options.emit) this.client.emit(Events.REMOTE_SESSION_SAVED);
}
@ -151,7 +155,8 @@ class RemoteAuth extends BaseAuthStrategy {
if (pathExists) {
await fs.promises.rm(this.userDataDir, {
recursive: true,
force: true
force: true,
maxRetries: this.rmMaxRetries,
}).catch(() &#x3D;&gt; {});
}
if (sessionExists) {
@ -208,7 +213,8 @@ class RemoteAuth extends BaseAuthStrategy {
if (stats.isDirectory()) {
await fs.promises.rm(dirElement, {
recursive: true,
force: true
force: true,
maxRetries: this.rmMaxRetries,
}).catch(() &#x3D;&gt; {});
} else {
await fs.promises.unlink(dirElement).catch(() &#x3D;&gt; {});
@ -243,7 +249,7 @@ module.exports &#x3D; RemoteAuth;
<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 November 22, 2024.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.11 on March 27, 2025.
</p>
</div>
</footer>