mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-19 20:19:14 +00:00
Compare commits
10 Commits
v1.18.0-al
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2486ee2ab7 | ||
|
|
55f75b8f69 | ||
|
|
b1e0fce504 | ||
|
|
62623347e8 | ||
|
|
705d4d31fd | ||
|
|
3ef400e813 | ||
|
|
bd4df4cf75 | ||
|
|
7fe3574730 | ||
|
|
09a81d0e1e | ||
|
|
c09a22c533 |
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -14,6 +14,8 @@ jobs:
|
||||
if: ${{ github.repository == 'pedroslopez/whatsapp-web.js' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
token: ${{ secrets.RELEASE_GITHUB_TOKEN }}
|
||||
- run: git config --global user.email "hello@wwebjs.dev"
|
||||
- run: git config --global user.name "WWebJS Bot"
|
||||
- name: Bump version and publish to NPM
|
||||
|
||||
10
index.d.ts
vendored
10
index.d.ts
vendored
@@ -1,7 +1,7 @@
|
||||
|
||||
import { EventEmitter } from 'events'
|
||||
import { RequestInit } from 'node-fetch'
|
||||
import puppeteer from 'puppeteer'
|
||||
import * as puppeteer from 'puppeteer'
|
||||
|
||||
declare namespace WAWebJS {
|
||||
|
||||
@@ -399,10 +399,10 @@ declare namespace WAWebJS {
|
||||
* Remote store interface
|
||||
*/
|
||||
export interface Store {
|
||||
sessionExists: ({session: string}) => Promise<boolean> | boolean,
|
||||
delete: ({session: string}) => Promise<any> | any,
|
||||
save: ({session: string}) => Promise<any> | any,
|
||||
extract: ({session: string, path: string}) => Promise<any> | any,
|
||||
sessionExists: (options: { session: string }) => Promise<boolean> | boolean,
|
||||
delete: (options: { session: string }) => Promise<any> | any,
|
||||
save: (options: { session: string }) => Promise<any> | any,
|
||||
extract: (options: { session: string, path: string }) => Promise<any> | any,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "whatsapp-web.js",
|
||||
"version": "1.17.1",
|
||||
"version": "1.18.0-alpha.1",
|
||||
"description": "Library for interacting with the WhatsApp Web API ",
|
||||
"main": "./index.js",
|
||||
"typings": "./index.d.ts",
|
||||
@@ -47,7 +47,7 @@
|
||||
"jsdoc": "^3.6.4",
|
||||
"jsdoc-baseline": "^0.1.5",
|
||||
"mocha": "^9.0.2",
|
||||
"sinon": "^13.0.1"
|
||||
"sinon": "^14.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
|
||||
@@ -989,7 +989,13 @@ class Client extends EventEmitter {
|
||||
*/
|
||||
async getCommonGroups(contactId) {
|
||||
const commonGroups = await this.pupPage.evaluate(async (contactId) => {
|
||||
const contact = window.Store.Contact.get(contactId);
|
||||
let contact = window.Store.Contact.get(contactId);
|
||||
if (!contact) {
|
||||
const wid = window.Store.WidFactory.createUserWid(contactId);
|
||||
const chatConstructor = window.Store.Contact.getModelsArray().find(c=>!c.isGroup).constructor;
|
||||
contact = new chatConstructor({id: wid});
|
||||
}
|
||||
|
||||
if (contact.commonGroups) {
|
||||
return contact.commonGroups.serialize();
|
||||
}
|
||||
|
||||
@@ -178,9 +178,9 @@ class RemoteAuth extends BaseAuthStrategy {
|
||||
await fs.promises.rm(dirElement, {
|
||||
recursive: true,
|
||||
force: true
|
||||
});
|
||||
}).catch(() => {});
|
||||
} else {
|
||||
await fs.promises.unlink(dirElement);
|
||||
await fs.promises.unlink(dirElement).catch(() => {});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -430,14 +430,14 @@ class Message extends Base {
|
||||
|
||||
/**
|
||||
* Deletes a message from the chat
|
||||
* @param {?boolean} everyone If true and the message is sent by the current user, will delete it for everyone in the chat.
|
||||
* @param {?boolean} everyone If true and the message is sent by the current user or the user is an admin, will delete it for everyone in the chat.
|
||||
*/
|
||||
async delete(everyone) {
|
||||
await this.client.pupPage.evaluate((msgId, everyone) => {
|
||||
let msg = window.Store.Msg.get(msgId);
|
||||
|
||||
if (everyone && msg.id.fromMe && msg._canRevoke()) {
|
||||
return window.Store.Cmd.sendRevokeMsgs(msg.chat, [msg], {type: 'Sender'});
|
||||
if (everyone && msg._canRevoke()) {
|
||||
return window.Store.Cmd.sendRevokeMsgs(msg.chat, [msg], { type: msg.id.fromMe ? 'Sender' : 'Admin' });
|
||||
}
|
||||
|
||||
return window.Store.Cmd.sendDeleteMsgs(msg.chat, [msg], true);
|
||||
|
||||
@@ -57,7 +57,7 @@ echo "-----> BUMP VERSION"
|
||||
echo ""
|
||||
|
||||
npm version $VERSION_ARGS || exit 1
|
||||
git push && git push --tags
|
||||
git push && git push --tags || exit 1
|
||||
|
||||
NEW_VERSION=`cat package.json | jq -r .version`
|
||||
echo "New Version: $NEW_VERSION"
|
||||
@@ -77,4 +77,4 @@ echo ""
|
||||
echo "::set-output name=NEW_VERSION::$NEW_VERSION"
|
||||
echo "::set-output name=PRERELEASE::$PRERELEASE"
|
||||
|
||||
exit 0
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user