chore(): generate docs
This commit is contained in:
parent
6f5a34b7d0
commit
d26d87507d
73 changed files with 273 additions and 234 deletions
|
|
@ -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 » Source: authStrategies/RemoteAuth.js</title>
|
||||
<title>whatsapp-web.js 1.27.0 » 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 = require('./BaseAuthStrategy');
|
|||
* @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: "./.wwebjs_auth/"
|
||||
* @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 } = {}) {
|
||||
constructor({ clientId, dataPath, store, backupSyncIntervalMs, rmMaxRetries } = {}) {
|
||||
if (!fs &amp;&amp; !unzipper &amp;&amp; !archiver) throw new Error('Optional Dependencies [fs-extra, unzipper, archiver] are required to use RemoteAuth. Make sure to run npm install correctly and remove the --no-optional flag');
|
||||
super();
|
||||
|
||||
|
|
@ -74,6 +75,7 @@ class RemoteAuth extends BaseAuthStrategy {
|
|||
this.dataPath = path.resolve(dataPath || './.wwebjs_auth/');
|
||||
this.tempDir = `${this.dataPath}/wwebjs_temp_session_${this.clientId}`;
|
||||
this.requiredDirs = ['Default', 'IndexedDB', 'Local Storage']; /* => Required Files &amp; Dirs in WWebJS to restore session */
|
||||
this.rmMaxRetries = 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(() => {});
|
||||
}
|
||||
clearInterval(this.backupSync);
|
||||
|
|
@ -138,7 +141,8 @@ class RemoteAuth extends BaseAuthStrategy {
|
|||
await fs.promises.unlink(`${this.sessionName}.zip`);
|
||||
await fs.promises.rm(`${this.tempDir}`, {
|
||||
recursive: true,
|
||||
force: true
|
||||
force: true,
|
||||
maxRetries: this.rmMaxRetries,
|
||||
}).catch(() => {});
|
||||
if(options &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(() => {});
|
||||
}
|
||||
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(() => {});
|
||||
} else {
|
||||
await fs.promises.unlink(dirElement).catch(() => {});
|
||||
|
|
@ -243,7 +249,7 @@ module.exports = 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>
|
||||
|
|
|
|||
Loading…
Reference in a new issue