chore(): generate docs

This commit is contained in:
WWebJS Bot 2025-11-06 19:30:13 +00:00
commit 28a2d3630c
76 changed files with 890 additions and 313 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.1 &raquo; Source: Client.js</title>
<title>whatsapp-web.js 1.34.2 &raquo; Source: Client.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>1</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>34.<wbr>2</a>
</div>
</div>
</nav>
@ -1256,11 +1256,18 @@ class Client extends EventEmitter {
const msgs &#x3D; await window.Store.PinnedMsgUtils.getTable().equals([&#x27;chatId&#x27;], chatWid.toString());
const pinnedMsgs &#x3D; msgs.map((msg) &#x3D;&gt; window.Store.Msg.get(msg.parentMsgKey));
const pinnedMsgs &#x3D; (
await Promise.all(
msgs.filter(msg &#x3D;&gt; msg.pinType &#x3D;&#x3D; 1).map(async (msg) &#x3D;&gt; {
const res &#x3D; await window.Store.Msg.getMessagesById([msg.parentMsgKey]);
return res?.messages?.[0];
})
)
).filter(Boolean);
return !pinnedMsgs.length
? []
: pinnedMsgs.map((msg) &#x3D;&gt; window.WWebJS.getMessageModel(msg));
: await Promise.all(pinnedMsgs.map((msg) &#x3D;&gt; window.WWebJS.getMessageModel(msg)));
}, chatId);
return pinnedMsgs.map((msg) &#x3D;&gt; new Message(this, msg));
@ -1555,7 +1562,7 @@ class Client extends EventEmitter {
const commonGroups &#x3D; await this.pupPage.evaluate(async (contactId) &#x3D;&gt; {
let contact &#x3D; window.Store.Contact.get(contactId);
if (!contact) {
const wid &#x3D; window.Store.WidFactory.createUserWid(contactId);
const wid &#x3D; window.Store.WidFactory.createWid(contactId);
const chatConstructor &#x3D; window.Store.Contact.getModelsArray().find(c&#x3D;&gt;!c.isGroup).constructor;
contact &#x3D; new chatConstructor({id: wid});
}
@ -2341,13 +2348,15 @@ class Client extends EventEmitter {
* @param {string} firstName
* @param {string} lastName
* @param {boolean} [syncToAddressbook &#x3D; false] If set to true, the contact will also be saved to the user&#x27;s address book on their phone. False by default
* @returns {Promise&amp;lt;import(&#x27;..&#x27;).ChatId&gt;} Object in a wid format
* @returns {Promise&amp;lt;void&gt;}
*/
async saveOrEditAddressbookContact(phoneNumber, firstName, lastName, syncToAddressbook &#x3D; false)
{
return await this.pupPage.evaluate(async (phoneNumber, firstName, lastName, syncToAddressbook) &#x3D;&gt; {
return await window.Store.AddressbookContactUtils.saveContactAction(
phoneNumber,
phoneNumber,
null,
null,
firstName,
lastName,
@ -2387,6 +2396,83 @@ class Client extends EventEmitter {
}));
}, userIds);
}
/**
* Add or edit a customer note
* @see https://faq.whatsapp.com/1433099287594476
* @param {string} userId The ID of a customer to add a note to
* @param {string} note The note to add
* @returns {Promise&amp;lt;void&gt;}
*/
async addOrEditCustomerNote(userId, note) {
return await this.pupPage.evaluate(async (userId, note) &#x3D;&gt; {
if (!window.Store.BusinessGatingUtils.smbNotesV1Enabled()) return;
return window.Store.CustomerNoteUtils.noteAddAction(
&#x27;unstructured&#x27;,
window.Store.WidToJid.widToUserJid(window.Store.WidFactory.createWid(userId)),
note
);
}, userId, note);
}
/**
* Get a customer note
* @see https://faq.whatsapp.com/1433099287594476
* @param {string} userId The ID of a customer to get a note from
* @returns {Promise&amp;lt;{
* chatId: string,
* content: string,
* createdAt: number,
* id: string,
* modifiedAt: number,
* type: string
* }&gt;}
*/
async getCustomerNote(userId) {
return await this.pupPage.evaluate(async (userId) &#x3D;&gt; {
if (!window.Store.BusinessGatingUtils.smbNotesV1Enabled()) return null;
const note &#x3D; await window.Store.CustomerNoteUtils.retrieveOnlyNoteForChatJid(
window.Store.WidToJid.widToUserJid(window.Store.WidFactory.createWid(userId))
);
let serialized &#x3D; note?.serialize();
if (!serialized) return null;
serialized.chatId &#x3D; window.Store.JidToWid.userJidToUserWid(serialized.chatJid)._serialized;
delete serialized.chatJid;
return serialized;
}, userId);
}
/**
* Get Poll Votes
* @param {string} messageId
* @return {Promise&amp;lt;Array&amp;lt;PollVote&gt;&gt;}
*/
async getPollVotes(messageId) {
const msg &#x3D; await this.getMessageById(messageId);
if (!msg) return [];
if (msg.type !&#x3D; &#x27;poll_creation&#x27;) throw &#x27;Invalid usage! Can only be used with a pollCreation message&#x27;;
const pollVotes &#x3D; await this.pupPage.evaluate( async (msg) &#x3D;&gt; {
const msgKey &#x3D; window.Store.MsgKey.fromString(msg.id._serialized);
let pollVotes &#x3D; await window.Store.PollsVotesSchema.getTable().equals([&#x27;parentMsgKey&#x27;], msgKey.toString());
return pollVotes.map(item &#x3D;&gt; {
const typedArray &#x3D; new Uint8Array(item.selectedOptionLocalIds);
return {
...item,
selectedOptionLocalIds: Array.from(typedArray)
};
});
}, msg);
return pollVotes.map((pollVote) &#x3D;&gt; new PollVote(this.client, {...pollVote, parentMessage: msg}));
}
}
module.exports &#x3D; Client;
@ -2400,7 +2486,7 @@ module.exports &#x3D; Client;
<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 September 10, 2025.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.11 on November 6, 2025.
</p>
</div>
</footer>