Repository: wwebjs/whatsapp-web.js Branch: main Commit: b0e869317f30 Files: 185 Total size: 2.1 MB Directory structure: gitextract_wvtmvct8/ ├── .editorconfig ├── .eslintignore ├── .eslintrc.json ├── .gitattributes ├── .github/ │ ├── CODE_OF_CONDUCT.md │ ├── COMMIT_CONVENTION.md │ ├── CONTRIBUTING.md │ ├── DISCLAIMER.md │ ├── FUNDING.yml │ ├── ISSUE_TEMPLATE/ │ │ ├── 01-bug_report.yml │ │ ├── 02-feature_request.yml │ │ └── config.yml │ ├── SUPPORT.md │ ├── dependabot.yml │ ├── issue-labeler.yml │ ├── labels.yml │ ├── pr-labeler.yml │ ├── pull_request_template.md │ └── workflows/ │ ├── format-issue-bug.yml │ ├── issue-triage.yml │ ├── labels-sync.yml │ ├── lint.yml │ ├── pr-triage.yml │ ├── release.yml │ ├── stale.yml │ ├── tests.yml │ └── update.yml ├── .gitignore ├── .husky/ │ ├── commit-msg │ └── pre-commit ├── .jsdoc.json ├── .lintstagedrc.json ├── .npmignore ├── .prettierignore ├── .prettierrc.json ├── LICENSE ├── README.md ├── commitlint.config.js ├── docs/ │ ├── Base.html │ ├── BaseAuthStrategy.html │ ├── Broadcast.html │ ├── BusinessContact.html │ ├── Buttons.html │ ├── CNAME │ ├── Call.html │ ├── Channel.html │ ├── Chat.html │ ├── Client.html │ ├── Client.js.html │ ├── ClientInfo.html │ ├── Contact.html │ ├── GroupChat.html │ ├── GroupNotification.html │ ├── InterfaceController.html │ ├── Label.html │ ├── LegacySessionAuth.html │ ├── List.html │ ├── LocalAuth.html │ ├── LocalWebCache.html │ ├── Location.html │ ├── Message.html │ ├── MessageMedia.html │ ├── NoAuth.html │ ├── Order.html │ ├── Poll.html │ ├── PollVote.html │ ├── PrivateChat.html │ ├── PrivateContact.html │ ├── Product.html │ ├── Reaction.html │ ├── RemoteAuth.html │ ├── RemoteWebCache.html │ ├── ScheduledEvent.html │ ├── Util.html │ ├── WebCache.html │ ├── authStrategies_BaseAuthStrategy.js.html │ ├── authStrategies_LegacySessionAuth.js.html │ ├── authStrategies_LocalAuth.js.html │ ├── authStrategies_NoAuth.js.html │ ├── authStrategies_RemoteAuth.js.html │ ├── css/ │ │ └── baseline.css │ ├── global.html │ ├── index.html │ ├── scripts/ │ │ ├── jsdoc-toc.js │ │ ├── lang-css.js │ │ ├── linenumber.js │ │ ├── prettify.js │ │ ├── scrollanchor.js │ │ └── tree.jquery.js │ ├── structures_Base.js.html │ ├── structures_Broadcast.js.html │ ├── structures_BusinessContact.js.html │ ├── structures_Buttons.js.html │ ├── structures_Call.js.html │ ├── structures_Channel.js.html │ ├── structures_Chat.js.html │ ├── structures_ClientInfo.js.html │ ├── structures_Contact.js.html │ ├── structures_GroupChat.js.html │ ├── structures_GroupNotification.js.html │ ├── structures_Label.js.html │ ├── structures_List.js.html │ ├── structures_Location.js.html │ ├── structures_Message.js.html │ ├── structures_MessageMedia.js.html │ ├── structures_Order.js.html │ ├── structures_Payment.js.html │ ├── structures_Poll.js.html │ ├── structures_PollVote.js.html │ ├── structures_PrivateChat.js.html │ ├── structures_PrivateContact.js.html │ ├── structures_Product.js.html │ ├── structures_ProductMetadata.js.html │ ├── structures_Reaction.js.html │ ├── structures_ScheduledEvent.js.html │ ├── util_Constants.js.html │ ├── util_Injected.js.html │ ├── util_Injected_LegacyStore.js.html │ ├── util_Injected_Store.js.html │ ├── util_Injected_Utils.js.html │ ├── util_InterfaceController.js.html │ ├── util_Puppeteer.js.html │ ├── util_Util.js.html │ ├── webCache_LocalWebCache.js.html │ ├── webCache_RemoteWebCache.js.html │ └── webCache_WebCache.js.html ├── example.js ├── index.d.ts ├── index.js ├── package.json ├── shell.js ├── src/ │ ├── Client.js │ ├── authStrategies/ │ │ ├── BaseAuthStrategy.js │ │ ├── LocalAuth.js │ │ ├── NoAuth.js │ │ └── RemoteAuth.js │ ├── factories/ │ │ ├── ChatFactory.js │ │ └── ContactFactory.js │ ├── structures/ │ │ ├── Base.js │ │ ├── Broadcast.js │ │ ├── BusinessContact.js │ │ ├── Buttons.js │ │ ├── Call.js │ │ ├── Channel.js │ │ ├── Chat.js │ │ ├── ClientInfo.js │ │ ├── Contact.js │ │ ├── GroupChat.js │ │ ├── GroupNotification.js │ │ ├── Label.js │ │ ├── List.js │ │ ├── Location.js │ │ ├── Message.js │ │ ├── MessageMedia.js │ │ ├── Order.js │ │ ├── Payment.js │ │ ├── Poll.js │ │ ├── PollVote.js │ │ ├── PrivateChat.js │ │ ├── PrivateContact.js │ │ ├── Product.js │ │ ├── ProductMetadata.js │ │ ├── Reaction.js │ │ ├── ScheduledEvent.js │ │ └── index.js │ ├── util/ │ │ ├── Constants.js │ │ ├── Injected/ │ │ │ ├── AuthStore/ │ │ │ │ └── AuthStore.js │ │ │ └── Utils.js │ │ ├── InterfaceController.js │ │ ├── Puppeteer.js │ │ └── Util.js │ └── webCache/ │ ├── LocalWebCache.js │ ├── RemoteWebCache.js │ ├── WebCache.js │ └── WebCacheFactory.js ├── tests/ │ ├── README.md │ ├── client.js │ ├── helper.js │ └── structures/ │ ├── chat.js │ ├── group.js │ └── message.js └── tools/ ├── changelog.sh ├── publish └── version-checker/ ├── .version └── update-version ================================================ FILE CONTENTS ================================================ ================================================ FILE: .editorconfig ================================================ root = true [*] indent_style = space indent_size = 4 charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true end_of_line = lf [*.md] trim_trailing_whitespace = false ================================================ FILE: .eslintignore ================================================ node_modules dist coverage docs *.min.js .wa-version .wwebjs_auth .wwebjs_cache ================================================ FILE: .eslintrc.json ================================================ { "env": { "browser": true, "commonjs": true, "es6": true, "node": true }, "extends": [ "eslint:recommended", "plugin:mocha/recommended", "plugin:prettier/recommended" ], "globals": { "Atomics": "readonly", "SharedArrayBuffer": "readonly" }, "parserOptions": { "ecmaVersion": 2022 }, "plugins": ["mocha"] } ================================================ FILE: .gitattributes ================================================ * text=auto eol=lf package-lock.json linguist-generated=true text=auto eol=lf docs/* linguist-generated=true text=auto eol=lf ================================================ FILE: .github/CODE_OF_CONDUCT.md ================================================ # Contributor Covenant Code of Conduct ## Our Pledge We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. ## Our Standards Examples of behavior that contributes to a positive environment for our community include: - Demonstrating empathy and kindness toward other people - Being respectful of differing opinions, viewpoints, and experiences - Giving and gracefully accepting constructive feedback - Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience - Focusing on what is best not just for us as individuals, but for the overall community Examples of unacceptable behavior include: - The use of sexualized language or imagery, and sexual attention or advances of any kind - Trolling, insulting or derogatory comments, and personal or political attacks - Public or private harassment - Publishing others' private information, such as a physical or email address, without their explicit permission - Other conduct which could reasonably be considered inappropriate in a professional setting ## Enforcement Responsibilities Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. ## Scope This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [pedroslopez@me.com][email]. All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the reporter of any incident. ## Enforcement Guidelines Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: ### 1. Correction **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. ### 2. Warning **Community Impact**: A violation through a single incident or series of actions. **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. ### 3. Temporary Ban **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. ### 4. Permanent Ban **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. **Consequence**: A permanent ban from any sort of public interaction within the community. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at [https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0]. Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC]. For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations]. [email]: mailto:pedroslopez@me.com [homepage]: https://www.contributor-covenant.org [v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html [Mozilla CoC]: https://github.com/mozilla/diversity [FAQ]: https://www.contributor-covenant.org/faq [translations]: https://www.contributor-covenant.org/translations ================================================ FILE: .github/COMMIT_CONVENTION.md ================================================ # Git Commit Message Convention > This is adapted from [Angular's commit convention][angular-commit-convention]. Messages must be matched by the following regex (case-insensitive): ```ts /^(revert: )?(feat|fix|docs|style|refactor|perf|test|build|ci|chore|types|infra)(\(.+\))?!?: .{1,72}/i; ``` The commit type is **case-insensitive** — `feat`, `Feat`, and `FEAT` are all valid. ## Examples ### Features Appears under "Features" header, message subheader: ```txt feat(message): add 'downloadMedia' option ``` Additional examples: ```txt feat(chat): add ability to pin messages ``` ```txt feat(contact): add getProfilePicUrl method ``` ### Bug Fixes Appears under "Bug Fixes" header, client subheader, with a link to issue #28: ```txt fix(client): stop client breaking when QR code expires Closes #28 ``` Additional examples: ```txt fix(message): handle media messages without caption correctly ``` ```txt fix(auth): resolve authentication timeout on slow connections ``` ### Performance Improvements Appears under "Performance Improvements" header, and under "Breaking Changes" with the breaking change explanation: ```txt perf(message): remove legacyMode option BREAKING CHANGE: The legacyMode option has been removed. The new message handling is always used for performance reasons. ``` Additional example: ```txt perf(client): optimize event listener registration ``` ### Documentation ```txt docs(readme): update installation instructions ``` ```txt docs(api): add examples for message reactions ``` ### Code Refactoring ```txt refactor(client): simplify authentication flow ``` ```txt refactor(structures): extract common message properties ``` ### Tests ```txt test(message): add unit tests for media download ``` ```txt test(client): add integration tests for reconnection ``` ### Build System ```txt build(deps): update puppeteer to v21.0.0 ``` ```txt build(webpack): optimize bundle size ``` ### Continuous Integration ```txt ci(actions): add automated release workflow ``` ```txt ci(tests): run tests on multiple node versions ``` ### Chores ```txt chore(gitignore): ignore .vscode directory ``` ```txt chore(deps): bump dependencies to latest versions ``` ### Type Definitions ```txt types(message): add missing type for MessageMedia ``` ```txt types(client): improve ClientOptions interface ``` ### Code Style ```txt style(client): fix indentation and spacing ``` ### Reverts The following commit and commit `667ecc1` do not appear in the changelog if they are under the same release. If not, the revert commit appears under the "Reverts" header: ```txt revert: feat(message): add 'downloadMedia' option This reverts commit 667ecc1654a317a13331b17617d973392f415f02. ``` A commit message consists of a **header**, **body** and **footer**. The header has a **type**, **scope** and **subject**: ```txt ():