Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d1a579372d | ||
|
|
16cd247db8 | ||
|
|
872d6d9880 | ||
|
|
79fe322d69 | ||
|
|
fe6f1cb547 | ||
|
|
8d7fcd0b84 | ||
|
|
46b0c3cee2 | ||
|
|
1ad9c3017c | ||
|
|
5d320fa22f | ||
|
|
5e1d9b6463 | ||
|
|
175dfde0b8 | ||
|
|
87717ae214 | ||
|
|
111c8f3160 | ||
|
|
6c756352cf | ||
|
|
97a5d11c1f | ||
|
|
44415d824e | ||
|
|
286e8f3afe | ||
|
|
4c2e3db2d5 | ||
|
|
6faf699fcc | ||
|
|
80b765e56a | ||
|
|
3f9ebe5c8c | ||
|
|
481371fd03 | ||
|
|
36c2165fc3 | ||
|
|
36402626e0 | ||
|
|
40c39e61e1 | ||
|
|
4e1b13e776 | ||
|
|
7f355ff43a | ||
|
|
22df449013 | ||
|
|
68303f5124 | ||
|
|
33babfef6b | ||
|
|
910a9185c7 | ||
|
|
f5bd74dfa1 | ||
|
|
b982640c85 | ||
|
|
245bcc46ed | ||
|
|
08a346bfa1 | ||
|
|
0cb4dd6d63 | ||
|
|
1a7a78cc51 | ||
|
|
9b69875b78 | ||
|
|
999ae4782b | ||
|
|
3c61ca8c94 | ||
|
|
0790e0a0ef | ||
|
|
0a2d77b699 | ||
|
|
051ada3f21 |
No files matched your search
@@ -4,7 +4,7 @@
|
||||
<img src="./docs/site/static/images/logo.png" alt="Image" />
|
||||
</p>
|
||||
|
||||
**WAHA** - **W**hats**A**pp **H**TTP **A**PI that you can install on your own server and run in less than 5 minutes!
|
||||
**WAHA** - **W**hats**A**pp **H**TTP **A**PI (REST API) that you can install on your own server and run in less than 5 minutes!
|
||||
|
||||
- Documentation: [https://waha.devlike.pro/](https://waha.devlike.pro/)
|
||||
- Swagger Example: [https://waha.devlike.pro/swagger](https://waha.devlike.pro/swagger)
|
||||
|
||||
+3
-2
@@ -32,8 +32,9 @@ services:
|
||||
- WHATSAPP_SWAGGER_PASSWORD=admin
|
||||
# Username and password for WAHA Dashboard
|
||||
# you can use the same username and password for both Swagger and Dashboard
|
||||
- WAHA_DASHBOARD_USERNAME=dashboard
|
||||
- WAHA_DASHBOARD_PASSWORD=admin
|
||||
# Default - waha / waha
|
||||
- WAHA_DASHBOARD_USERNAME=waha
|
||||
- WAHA_DASHBOARD_PASSWORD=waha
|
||||
restart: always
|
||||
|
||||
whatsapp-http-api-plus--mongodb:
|
||||
|
||||
@@ -73,7 +73,7 @@ copyRight = "Copyright (c) 2021-2023 Dev Like A Pro"
|
||||
# Alert
|
||||
alert = true
|
||||
alertDismissable = true
|
||||
alertText = "<a class=\"alert-link stretched-link\" href=\"https://waha.devlike.pro/docs/how-to/plus-version/\">Support the project and get WAHA Plus version! -></a>"
|
||||
alertText = "📢 <a class=\"alert-link stretched-link\" href=\"https://waha.devlike.pro/docs/how-to/waha-dashboard/\">WAHA Dashboard - UI to manage your WhatsApp sessions!</a> 📢"
|
||||
|
||||
# Edit Page
|
||||
# repoHost [Github | Gitea | GitLab | Bitbucket | BitbucketServer ] is used for building the edit link based on git hoster
|
||||
@@ -81,8 +81,8 @@ repoHost = "GitHub"
|
||||
#repoHost = "Gitea"
|
||||
docsRepo = "https://github.com/devlikeapro/whatsapp-http-api"
|
||||
docsRepoBranch = "core"
|
||||
docsRepoSubPath = ""
|
||||
editPage = false
|
||||
docsRepoSubPath = "docs/site"
|
||||
editPage = true
|
||||
lastMod = false
|
||||
|
||||
[sections]
|
||||
@@ -95,7 +95,7 @@ lastMod = false
|
||||
flexSearch = true
|
||||
searchSectionsShow = []
|
||||
searchSectionsIndex = []
|
||||
darkMode = true
|
||||
darkMode = false
|
||||
bootStrapJs = true
|
||||
breadCrumb = false
|
||||
highLight = true
|
||||
|
||||
@@ -49,7 +49,7 @@ The following environment variables can be used to configure the WAHA.
|
||||
- `WHATSAPP_SWAGGER_USERNAME=admin` and `WHATSAPP_SWAGGER_PASSWORD=admin` - these variables can be used to protect the Swagger panel
|
||||
with `admin / admin` credentials. This does not affect API access. Available in **WAHA Plus** only.
|
||||
|
||||
Read more about security settings for Swagger and API on [**Security page** ->]({{< relref "/docs/how-to/security" >}}).
|
||||
Read more about Swagger configuration on [**Swagger page** ->]({{< relref "/docs/how-to/swagger" >}}).
|
||||
|
||||
### Proxy
|
||||
#### Global proxy configuration
|
||||
|
||||
@@ -75,7 +75,7 @@ The more you support the project - the more you get!
|
||||
| [MongoDB support ->]({{< relref "/docs/how-to/storages" >}}) | ✔️ |
|
||||
| Access to **WAHA Plus** docker image with a personal key. | ✔️ |
|
||||
| [](https://waha.devlike.pro/docs/how-to/plus-version/#tiers) badge and `patron:PLUS` label on [project's issues, PRs and Discussion](https://github.com/devlikeapro/whatsapp-http-api) to highlight your support to the project! | ✔️ |
|
||||
| Built-in [WAHA Dashboard]({{< relref "/docs/how-to/waha-dashboard" >}}) - UI to manage your sessions! | ✔️ |
|
||||
| Built-in [Dashboard]({{< relref "/docs/how-to/waha-dashboard" >}}) - UI to manage your sessions! | ✔️ |
|
||||
| Access to the **WAHA Plus** **source code** (in a private Github repository). | ➖ |
|
||||
| Membership to the **WAHA Discord server** for receiving personal support, and sharing your experiences with other professionals. | ➖ |
|
||||
| [WAHA Hub]({{< relref "/docs/waha-hub/introduction" >}}) - a single place to manage multiple servers! | ➖ |
|
||||
|
||||
@@ -6,7 +6,7 @@ date: 2020-10-06T08:48:45+00:00
|
||||
lastmod: 2020-10-06T08:48:45+00:00
|
||||
draft: false
|
||||
images: []
|
||||
weight: 110
|
||||
weight: 115
|
||||
---
|
||||
|
||||
We consider that you've run docker container and authenticated the session with QR code.
|
||||
@@ -87,7 +87,7 @@ To reply on a message - use `POST /api/reply` with example payload.
|
||||
}
|
||||
```
|
||||
|
||||
#### Reply files 
|
||||
#### Reply files 
|
||||
WAHA does not support reply with files (images, voice, etc.). If you're interested in it - please create an issue in GitHub.
|
||||
|
||||
|
||||
|
||||
@@ -334,7 +334,9 @@ See the list of engines [**that support the feature ->**]({{< relref "/docs/how-
|
||||
The `session.status` event is triggered when the session status changes.
|
||||
- `STOPPED` - session is stopped
|
||||
- `STARTING` - session is starting
|
||||
- `SCAN_QR_CODE` - session is required to scan QR code or login via phone number
|
||||
- `SCAN_QR_CODE` - session is required to scan QR code or login via phone number.
|
||||
- When you receive the `session.status` event with `SCAN_QR_CODE` status, you can [**fetch updated QR ->**]({{< relref "/docs/how-to/sessions#get-qr" >}})
|
||||
- The `SCAN_QR_CODE` is issued every time when QR updated (WhatsApp requirements)
|
||||
- `WORKING` - session is working and ready to use
|
||||
- `FAILED` - session is failed due to some error. It's likely that authorization is required again or device has been disconnected from that account.
|
||||
Try to restart the session and if it doesn't help - logout and start the session again.
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
---
|
||||
title: "Swagger (OpenAPI)"
|
||||
description: "Swagger (OpenAPI)"
|
||||
lead: ""
|
||||
date: 2020-10-06t08:48:45+00:00
|
||||
lastmod: 2020-10-06t08:48:45+00:00
|
||||
draft: false
|
||||
images: [ ]
|
||||
weight: 111
|
||||
---
|
||||
|
||||
## Overview
|
||||
The project provides HTTP API (REST), which is documented with OpenAPI specification and Swagger UI.
|
||||
|
||||
<video autoplay loop muted playsinline controls='noremoteplayback' width="100%" poster='/images/swagger.png'>
|
||||
<source src="/videos/swagger-overview.webm" type="video/webm" />
|
||||
Download the <a href="/videos/swagger-overview.webm">Swagger Overview video</a> .
|
||||
</video>
|
||||
|
||||
You can see all available endpoints, request/response examples, and even execute them directly from the Swagger UI.
|
||||
|
||||
Later version:
|
||||
- [OpenAPI specification ->](/swagger/openapi.json)
|
||||
- [Swagger documentation ->](/swagger)
|
||||
|
||||
You can find Swagger documentation on the following url after you
|
||||
[install and started]( {{< relref "/docs/how-to/install" >}}) it:
|
||||
- Swagger: [http://localhost:3000](http://localhost:3000).
|
||||
- OpenAPI: [http://localhost:3000/-json](http://localhost:3000/-json).
|
||||
|
||||
## Configuration
|
||||
- `WHATSAPP_SWAGGER_CONFIG_ADVANCED=true` - enables advanced configuration options for Swagger documentation - you can customize host, port and base URL for the requests.
|
||||
Disabled by default.
|
||||
- `WHATSAPP_SWAGGER_ENABLED=false` - disables Swagger documentation. Enabled by default. Available in **WAHA Plus** only.
|
||||
- `WHATSAPP_SWAGGER_USERNAME=admin` and `WHATSAPP_SWAGGER_PASSWORD=admin` - these variables can be used to protect the Swagger panel
|
||||
with `admin / admin` credentials. This does not affect API access. Available in **WAHA Plus** only.
|
||||
|
||||
Read more about security settings for Swagger and API on [**Security page** ->]({{< relref "/docs/how-to/security" >}}).
|
||||
|
||||
### White label
|
||||
You can show your own brand in the Swagger documentation.
|
||||
|
||||
<img src="swagger-white-label.png" onclick="window.open(this.src)" style="cursor: pointer;">
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
👉 Swagger White Label is available in [**WAHA Plus**]({{< relref "plus-version#plus" >}})  version only.
|
||||
|
||||
Use the following environment variables to customize the Swagger documentation:
|
||||
- `WHATSAPP_SWAGGER_TITLE` - the title of the Swagger documentation and some other places.
|
||||
- `WHATSAPP_SWAGGER_DESCRIPTION` - Markdown formatted description of your API.
|
||||
- `WHATSAPP_SWAGGER_EXTERNAL_DOC_URL` - URL to the external documentation.
|
||||
|
||||
**Example** (consider using [docker-compose](https://github.com/devlikeapro/whatsapp-http-api/blob/core/docker-compose.yaml#L15-L38) or other methods to store these settings):
|
||||
```bash
|
||||
docker run -it -p 3000:3000 -e WHATSAPP_SWAGGER_TITLE="AwesomeCRM" -e 'WHATSAPP_SWAGGER_DESCRIPTION=<p>FantasticFindz - Discover unique treasures from around the world at unbelievable prices!<br/> <a href='https://google.com'>Read more about us!</a></p>' -e "WHATSAPP_SWAGGER_EXTERNAL_DOC_URL=https://google.com" devlikeapro/whatsapp-http-api-plus
|
||||
```
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 89 KiB |
@@ -11,18 +11,16 @@ weight: 110
|
||||
|
||||
## Overview
|
||||
|
||||
**WAHA Dashboard** is a UI to manage your WhatsApp sessions!
|
||||
**Dashboard** is a UI to manage your WhatsApp sessions!
|
||||
|
||||
<video autoplay loop muted playsinline controls='noremoteplayback' width="100%" poster='/images/waha-dashboard.png'>
|
||||
<source src="/videos/waha-dashboard-overview.webm" type="video/webm" />
|
||||
Download the <a href="/videos/waha-dashboard-overview.webm">Dashboard Overview video</a> .
|
||||
</video>
|
||||
|
||||

|
||||
<div class="text-center">
|
||||
<a href="./waha-dashboard.png" target="_blank">See full size image</a>
|
||||
</div>
|
||||
<br/>
|
||||
👉 **Dashboard** is available in [**WAHA Plus**]({{< relref "plus-version#plus" >}})  version only.
|
||||
|
||||
👉 **WAHA Dashboard** is available in [**WAHA Plus**]({{< relref "plus-version#plus" >}})  version only.
|
||||
|
||||
You can access **WAHA Dashboard** by running the project and opening
|
||||
You can access **Dashboard** by running the project and opening
|
||||
<a href="http://localhost:3000/dashboard" target="_blank">http://localhost:3000/dashboard</a>
|
||||
(or similar, but with <a href="/dashboard" target="_blank">/dashboard</a> at the end).
|
||||
|
||||
@@ -34,11 +32,7 @@ docker run -it -p 3000:3000/tcp devlikeapro/whatsapp-http-api-plus
|
||||
|
||||
If you're using [API Key]({{< relref "security" >}}), remember to set up the key in the dashboard.
|
||||
|
||||

|
||||
<div class="text-center">
|
||||
<a href="./waha-dashboard-key.png" target="_blank">See full size image</a>
|
||||
</div>
|
||||
<br/>
|
||||

|
||||
|
||||
## Configuration
|
||||
|
||||
|
||||
@@ -123,6 +123,8 @@ The `session.status` event is triggered when the session status changes.
|
||||
- `STOPPED` - session is stopped
|
||||
- `STARTING` - session is starting
|
||||
- `SCAN_QR_CODE` - session is required to scan QR code or login via phone number
|
||||
- When you receive the `session.status` event with `SCAN_QR_CODE` status, you can [**fetch updated QR ->**]({{< relref "/docs/how-to/sessions#get-qr" >}})
|
||||
- The `SCAN_QR_CODE` is issued every time when QR updated (WhatsApp requirements)
|
||||
- `WORKING` - session is working and ready to use
|
||||
- `FAILED` - session is failed due to some error. It's likely that authorization is required again or device has been disconnected from that account.
|
||||
Try to restart the session and if it doesn't help - logout and start the session again.
|
||||
|
||||
@@ -17,12 +17,52 @@ If you wish to get and read Release Notes - read them on one of our platforms, *
|
||||
- [**Boosty ->**](https://boosty.to/wa-http-api)
|
||||
- [**Patreon ->**](patreon.com/wa_http_api)
|
||||
|
||||
You even can **subscribe to get new updates** there!
|
||||
**Subscribe for FREE to get new updates** there!
|
||||
|
||||
----
|
||||
|
||||
## 2024.5
|
||||
### 🎉 New
|
||||
----
|
||||
|
||||
[Swagger White Label]({{< relref "/docs/how-to/swagger#white-label" >}}) - show your own brand in the Swagger documentation!
|
||||
- Read more about [Swagger White Label]({{< relref "/docs/how-to/swagger#white-label" >}})
|
||||
- Issue: [#305](https://github.com/devlikeapro/whatsapp-http-api/issues/305)
|
||||
- Build: `2024.5.4`
|
||||
- Engine: **ALL**
|
||||
|
||||
----
|
||||
|
||||
### 🐛 Fixes
|
||||
----
|
||||
|
||||
Use local cache for **WEBJS** engine (versions file).
|
||||
- Issue: [#316](https://github.com/devlikeapro/whatsapp-http-api/issues/316)
|
||||
- Build: `2024.5.4`
|
||||
- Engine: **WEBJS**
|
||||
|
||||
----
|
||||
|
||||
Don't allow to start two sessions with the same name.
|
||||
|
||||
Before API allowed to start two sessions with the same name, which could lead to potential problems (no way to stop the first, abandoned session).
|
||||
- Issue: [#315](https://github.com/devlikeapro/whatsapp-http-api/issues/315)
|
||||
- Read more about [start a session](https://waha.devlike.pro/docs/how-to/sessions/#start)
|
||||
- Build: `2024.5.3`
|
||||
- Engine: **ALL**
|
||||
|
||||
----
|
||||
|
||||
## 2024.4
|
||||
### 🎉 New
|
||||
----
|
||||
|
||||
Add **WAHA Dashboard** - UI to manage your WhatsApp sessions!
|
||||
- Read more about [Dashboard]({{< relref "/docs/how-to/waha-dashboard" >}})
|
||||
- Open [screenshot](/images/waha-dashboard.png)
|
||||
|
||||
----
|
||||
|
||||
Add `GET /api/sessions/{session}` endpoint to get information about a specific session.
|
||||
- Read more about [Get session information]({{< relref "/docs/how-to/sessions#get-session" >}})
|
||||
- Issue: [#300](https://github.com/devlikeapro/whatsapp-http-api/issues/300)
|
||||
@@ -30,6 +70,7 @@ Add `GET /api/sessions/{session}` endpoint to get information about a specific s
|
||||
----
|
||||
|
||||
Implement `GET /api/contacts/profile-picture` for **NOWEB** engine.
|
||||
- Read more about [Get contact profile picture](https://waha.devlike.pro/docs/how-to/contacts/#get-contact-profile-picture)
|
||||
- Issue: [#298](https://github.com/devlikeapro/whatsapp-http-api/issues/298)
|
||||
|
||||
----
|
||||
|
||||
@@ -25,12 +25,16 @@ toc: true
|
||||
We will guide you through the necessary steps to successfully send your first text message using WhatsApp HTTP API in
|
||||
[**Quick Start →**]({{< relref "quick-start" >}}).
|
||||
|
||||
## Features
|
||||
WAHA is distributed in two versions:
|
||||
- Core  - the basic version that meet almost 80% people's needs. 100% free and [open source ->](https://github.com/devlikeapro/whatsapp-http-api).
|
||||
- Plus  - the version with advanced messages, security, and reliability features. Donations, no license expiration, quick updates, read more about [Plus Version →]({{< relref "plus-version" >}})
|
||||
## Disclaimer
|
||||
This project is not affiliated, associated, authorized, endorsed by, or in any way officially connected with WhatsApp or any of its subsidiaries or its affiliates. The official WhatsApp website can be found at [whatsapp.com](https://whatsapp.com).
|
||||
|
||||
See the list of engines [**that support the features ->**]({{< relref "/docs/how-to/engines#features" >}}).
|
||||
"WhatsApp" as well as related names, marks, emblems and images are registered trademarks of their respective owners. Also it is not guaranteed you will not be blocked by using this method. WhatsApp does not allow bots or unofficial clients on their platform, so this shouldn't be considered totally safe.
|
||||
|
||||
For any businesses looking to integrate with WhatsApp for critical applications, we highly recommend using officially supported methods, such as Twilio's solution or other alternatives. You might also consider [the official API ->](https://developers.facebook.com/docs/whatsapp/).
|
||||
|
||||
|
||||
|
||||
## Features
|
||||
|
||||
Here's the available features:
|
||||
|
||||
@@ -67,7 +71,7 @@ Here's the available features:
|
||||
- Single WhatsApp account running inside one container
|
||||
- Multiple WhatsApp account running inside one container 
|
||||
- Session saving (don't have to scan QR on every restart) 
|
||||
- Session saving on remote storage (database, redis) 
|
||||
- Session saving on remote storage (mongodb) 
|
||||
|
||||
### Security
|
||||
- API authentication 
|
||||
@@ -76,3 +80,12 @@ Here's the available features:
|
||||
### Updates
|
||||
- Bug fixes and updates come as soon as they are implemented.
|
||||
|
||||
## Engines
|
||||
Not all Engines support all Features, see [**the feature supported by engines ->**]({{< relref "/docs/how-to/engines#features" >}}).
|
||||
|
||||
|
||||
## Versions
|
||||
WAHA is distributed in two versions:
|
||||
- Core  - the basic version that meet almost 80% people's needs. **100% free and [open source ->](https://github.com/devlikeapro/whatsapp-http-api)**.
|
||||
- Plus  - the version with advanced messages, security, and reliability features. Donations, no license expiration, quick updates, read more about [**Plus Version →**]({{< relref "plus-version" >}})
|
||||
|
||||
@@ -189,7 +189,7 @@ curl -d "{\"chatId\": \"${PHONE}@c.us\", \"text\": \"Hello from WhatsApp HTTP AP
|
||||
```
|
||||
|
||||
## What is next?
|
||||
- Learn about the easiest way to manage your WhatsApp sessions - [WAHA Dashboard ->]({{< relref "/docs/how-to/waha-dashboard" >}})
|
||||
- Learn about the easiest way to manage your WhatsApp sessions - [Dashboard ->]({{< relref "/docs/how-to/waha-dashboard" >}})
|
||||
- Right now you've sent simple text message, but you can send more! [Send messages ->]({{< relref "/docs/how-to/send-messages" >}})
|
||||
- Read how to receive and response to messages [Receive messages ->]({{< relref "/docs/how-to/receive-messages" >}})
|
||||
- [Save session information, so you don't have to scan QR after container restart ->]({{< relref "/docs/how-to/sessions" >}})
|
||||
|
||||
@@ -9,12 +9,22 @@ images: [ ]
|
||||
menu:
|
||||
docs:
|
||||
parent: "overview"
|
||||
weight: 100
|
||||
weight: 301
|
||||
toc: true
|
||||
---
|
||||
|
||||
⚠️ The project in **DEVELOPMENT** yet... Subscribe to [**WAHA PRO**]({{< relref "plus-version#pro" >}}) to speed up the
|
||||
development!
|
||||
|
||||
---
|
||||
|
||||
⚠️
|
||||
|
||||
**WAHA Hub** in **DEVELOPMENT** yet...
|
||||
|
||||
Consider using [Dashboard]({{< relref "/docs/how-to/waha-dashboard" >}}) for managing your sessions.
|
||||
|
||||
Subscribe to [**WAHA PRO**]({{< relref "plus-version#pro" >}}) to speed up the development!
|
||||
|
||||
⚠️
|
||||
|
||||
---
|
||||
|
||||
@@ -22,13 +32,13 @@ development!
|
||||
|
||||
**WAHA Hub** - central management solution to help your build reliable infrastructure with multiple WAHA servers!
|
||||
|
||||
While [WAHA Dashboard]({{< relref "/docs/how-to/waha-dashboard" >}}) is a UI to manage your WhatsApp sessions on
|
||||
While [Dashboard]({{< relref "/docs/how-to/waha-dashboard" >}}) is a UI to manage your WhatsApp sessions on
|
||||
**single server**, **WAHA Hub** is a central management server to control and manage **multiple servers** in a single
|
||||
place.
|
||||
|
||||
👉 **WAHA Hub** is available in [**WAHA PRO**]({{< relref "plus-version#pro" >}}) version only.
|
||||
|
||||

|
||||

|
||||
<div class="text-center">
|
||||
<a href="waha-dashboard.png" target="_blank">See full size image</a>
|
||||
</div>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
</div>
|
||||
<div class='col-lg-9 col-xl-9 text-center'>
|
||||
<div class='mb-4'>
|
||||
<img src='/images/logo.svg' title='WhatsApp HTTP API' alt='logo' width='100' style='border-radius: 50%'/>
|
||||
<img src='/images/logo.svg' title='WhatsApp HTTP API' alt='logo' style='border-radius: 50%; width: 10rem' />
|
||||
</div>
|
||||
<p class='lead'>{{ .Params.lead | safeHTML }}</p>
|
||||
<div class='code-block highlight'>
|
||||
@@ -35,10 +35,10 @@
|
||||
<h2 class='h4 color-accent'>Send and Receive<br />Messages</h2>
|
||||
<p>
|
||||
You can
|
||||
<a href='https://waha.devlike.pro/docs/how-to/send-messages/'>send</a>
|
||||
<a href='/docs/how-to/send-messages/'>send messages to</a>
|
||||
and
|
||||
<a href='https://waha.devlike.pro/docs/how-to/receive-messages/'>receive</a>
|
||||
messages from WhatsApp using HTTP API.
|
||||
<a href='/docs/how-to/receive-messages/'>receive messages from</a>
|
||||
WhatsApp using HTTP API (REST API).
|
||||
</p>
|
||||
|
||||
<div class='code-block highlight' style='text-align: left'>
|
||||
@@ -60,10 +60,10 @@
|
||||
<h2 class='h4'>Send and Receive<br />Files</h2>
|
||||
<p>
|
||||
You can
|
||||
<a href='https://waha.devlike.pro/docs/how-to/send-messages/'>send</a>
|
||||
<a href='/docs/how-to/send-messages/'>send files to</a>
|
||||
and
|
||||
<a href='https://waha.devlike.pro/docs/how-to/receive-messages/'>receive</a>
|
||||
files from WhatsApp using HTTP API.
|
||||
<a href='/docs/how-to/receive-messages/'>receive files from</a>
|
||||
WhatsApp using HTTP API (REST API).
|
||||
</p>
|
||||
|
||||
<div class='code-block highlight' style='text-align: left'>
|
||||
@@ -86,7 +86,7 @@
|
||||
</h2>
|
||||
<p>
|
||||
Check out
|
||||
<a href='https://waha.devlike.pro/docs/overview/introduction/#features'>
|
||||
<a href='/docs/overview/introduction/#features'>
|
||||
the documentation
|
||||
</a>
|
||||
to see all the features.
|
||||
@@ -107,37 +107,43 @@
|
||||
</div>
|
||||
|
||||
<div class='col-12 pros-card' style='width: 80%'>
|
||||
<h2 class='h4 color-accent'>Swagger documentation and OpenApi schema!</h2>
|
||||
<h2 class='h4 color-accent'>Swagger documentation and OpenAPI Specification!</h2>
|
||||
<p>
|
||||
<a href='https://waha.devlike.pro/docs/how-to/plus-version/#core' target='_blank'>
|
||||
<a href='/docs/how-to/plus-version/#core' target='_blank'>
|
||||
<b>WAHA Core</b>
|
||||
</a>
|
||||
and
|
||||
<a href='https://waha.devlike.pro/docs/how-to/plus-version/#plus' target='_blank'>
|
||||
<a href='/docs/how-to/plus-version/#plus' target='_blank'>
|
||||
<b>WAHA Plus</b>
|
||||
</a>
|
||||
provide
|
||||
<a href='https://waha.devlike.pro/swagger' target='_blank'>
|
||||
<a href='/docs/how-to/swagger/' target='_blank'>
|
||||
Swagger documentation and OpenApi schema.
|
||||
</a>
|
||||
<br>
|
||||
</p>
|
||||
<img src='/images/swagger.png' alt='Swagger' style='max-width: 100%'>
|
||||
<video autoplay loop muted playsinline controls='noremoteplayback' width="100%" poster='/images/swagger.png'>
|
||||
<source src="/videos/swagger-overview.webm" type="video/webm" />
|
||||
Download the <a href="/videos/swagger-overview.webm">Swagger Overview video</a> .
|
||||
</video>
|
||||
</div>
|
||||
|
||||
<div class='col-12 pros-card' style='width: 80%'>
|
||||
<h2 class='h4 color-accent'>WAHA Dashboard</h2>
|
||||
<h2 class='h4 color-accent'>Built-in Dashboard</h2>
|
||||
<p>
|
||||
<a href='https://waha.devlike.pro/docs/how-to/plus-version/#plus' target='_blank'>
|
||||
<a href='/docs/how-to/plus-version/#plus' target='_blank'>
|
||||
<b>WAHA Plus</b>
|
||||
</a>
|
||||
provides
|
||||
<a href='https://waha.devlike.pro/docs/how-to/waha-dashboard' target='_blank'>
|
||||
WAHA Dashboard
|
||||
<a href='/docs/how-to/waha-dashboard' target='_blank'>
|
||||
Dashboard
|
||||
</a> - a web interface to easily manage your WhatsApp sessions!
|
||||
<br>
|
||||
</p>
|
||||
<img src='/images/waha-dashboard.png' alt='WAHA Dashboard' style='max-width: 100%'>
|
||||
<video autoplay loop muted playsinline controls='noremoteplayback' width="100%" poster='/images/waha-dashboard.png'>
|
||||
<source src="/videos/waha-dashboard-overview.webm" type="video/webm" />
|
||||
Download the <a href="/videos/waha-dashboard-overview.webm">Dashboard Overview video</a> .
|
||||
</video>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -154,12 +160,12 @@
|
||||
<img src='/images/icons/free-green.png' alt='Free' style='width: 5rem'>
|
||||
<h2 class='h4 color-accent'>It's free!</h2>
|
||||
<p>
|
||||
<a href='https://waha.devlike.pro/docs/how-to/plus-version/#tiers' target='_blank'>
|
||||
<a href='/docs/how-to/plus-version/#tiers' target='_blank'>
|
||||
<b>WAHA Core</b>
|
||||
</a>
|
||||
version is always free, <b>no limits in messages</b> or time!
|
||||
<br>
|
||||
<a href='https://waha.devlike.pro/docs/how-to/plus-version/#tiers' target='_blank'>
|
||||
<a href='/docs/how-to/plus-version/#tiers' target='_blank'>
|
||||
<b>WAHA Plus</b>
|
||||
</a>
|
||||
version have no licence expiration!
|
||||
@@ -169,7 +175,7 @@
|
||||
<img src='/images/icons/servers-green.png' alt='Servers' style='width: 5rem'>
|
||||
<h2 class='h4'>Self-hosted solution</h2>
|
||||
<p>
|
||||
<a href='https://waha.devlike.pro/docs/how-to/plus-version/#why-waha' target='_blank'>
|
||||
<a href='/docs/how-to/plus-version/#why-waha' target='_blank'>
|
||||
No strings to suspicious SaaS WhatsApp HTTP API solutions.
|
||||
</a>
|
||||
Install it on your own server!
|
||||
@@ -177,7 +183,7 @@
|
||||
</div>
|
||||
<div class='col-12 col-lg-4 pros-card'>
|
||||
<img src='/images/icons/api-green.png' alt='API' style='width: 5rem'>
|
||||
<h2 class='h4'>HTTP API</h2>
|
||||
<h2 class='h4'>HTTP / REST API</h2>
|
||||
<p>
|
||||
Use your own favorite language - Python, JavaScript, PHP, C#, Clojure, or PowerShell.
|
||||
<br />
|
||||
@@ -192,7 +198,7 @@
|
||||
<img src='/images/icons/document-green.png' alt='Document' style='width: 5rem'>
|
||||
<h2 class='h4'>Well documented</h2>
|
||||
<p>
|
||||
<a href='https://waha.devlike.pro/docs/overview/introduction/' target='_blank'>
|
||||
<a href='/docs/overview/introduction/' target='_blank'>
|
||||
Documentation
|
||||
</a>
|
||||
has a lof examples and how-to guides.</p>
|
||||
@@ -202,7 +208,7 @@
|
||||
<h2 class='h4'>Quick installation</h2>
|
||||
<p>
|
||||
You need to install Docker and
|
||||
<a href='https://waha.devlike.pro/docs/how-to/install/' target='_blank'>
|
||||
<a href='/docs/how-to/install/' target='_blank'>
|
||||
run the API in a click!
|
||||
</a>
|
||||
<br />
|
||||
@@ -215,7 +221,7 @@
|
||||
<img src='/images/icons/checked-green.png' alt='Checked' style='width: 5rem'>
|
||||
<h2 class='h4'>No blocking</h2>
|
||||
<p>
|
||||
<a href='https://waha.devlike.pro/docs/how-to/engines/' target='_blank'>
|
||||
<a href='/docs/how-to/engines/' target='_blank'>
|
||||
Under the hood
|
||||
</a>
|
||||
it runs a real instance of Whatsapp Web to avoid getting blocked.
|
||||
@@ -235,10 +241,10 @@
|
||||
<div class='container hr'>
|
||||
<div class='text-center mt-4'>
|
||||
<h2>
|
||||
Try it now!
|
||||
Give it a try!
|
||||
</h2>
|
||||
<div class='mb-4'>
|
||||
<img src='/images/logo.png' title='WhatsApp HTTP API' alt='logo' width='100' />
|
||||
<img src='/images/logo.svg' title='WhatsApp HTTP API' alt='logo' style='border-radius: 50%; width: 10rem' />
|
||||
</div>
|
||||
<a class='btn btn-primary btn-lg px-4 mb-2'
|
||||
href='/docs/{{ if .Site.Params.options.docsVersioning }}{{ .Site.Params.docsVersion }}/{{ end }}overview/introduction/'
|
||||
|
||||
@@ -270,7 +270,7 @@
|
||||
<a
|
||||
href="https://waha.devlike.pro/docs/how-to/waha-dashboard"
|
||||
target="_blank"
|
||||
>WAHA Dashboard</a
|
||||
>Dashboard</a
|
||||
>
|
||||
is not available in <strong>WAHA Core</strong> version.
|
||||
<br />
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"openapi":"3.1.0","paths":{"/api/{session}/auth/qr":{"get":{"operationId":"AuthController_getQR","summary":"Get QR code for pairing WhatsApp Web.","parameters":[{"name":"session","required":true,"in":"path","schema":{"default":"default"},"description":"WhatsApp session name"},{"name":"format","required":true,"in":"query","schema":{"default":"image","enum":["image","raw"],"type":"string"}}],"responses":{"200":{"content":{"image/png":{"schema":{"type":"string","format":"binary"}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Base64File"},{"$ref":"#/components/schemas/QRCodeValue"}]}}},"description":""}},"tags":["auth"],"security":[{"api_key":[]}]}},"/api/{session}/auth/request-code":{"post":{"operationId":"AuthController_requestCode","summary":"Request authentication code.","parameters":[{"name":"session","required":true,"in":"path","schema":{"default":"default"},"description":"WhatsApp session name"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestCodeRequest"}}}},"responses":{"201":{"description":""}},"tags":["auth"],"security":[{"api_key":[]}]}},"/api/{session}/auth/authorize-code":{"post":{"operationId":"AuthController_authorizeCode","summary":"Send OTP authentication code.","parameters":[{"name":"session","required":true,"in":"path","schema":{"default":"default"},"description":"WhatsApp session name"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OTPRequest"}}}},"responses":{"201":{"description":""}},"tags":["auth"],"security":[{"api_key":[]}]}},"/api/{session}/auth/captcha":{"get":{"operationId":"AuthController_getCaptcha","summary":"Get captcha image.","parameters":[{"name":"session","required":true,"in":"path","schema":{"default":"default"},"description":"WhatsApp session name"}],"responses":{"200":{"content":{"image/png":{"schema":{"type":"string","format":"binary"}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Base64File"}]}}},"description":""}},"tags":["auth"],"security":[{"api_key":[]}]},"post":{"operationId":"AuthController_saveCaptcha","summary":"Enter captcha code.","parameters":[{"name":"session","required":true,"in":"path","schema":{"default":"default"},"description":"WhatsApp session name"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaptchaBody"}}}},"responses":{"201":{"description":""}},"tags":["auth"],"security":[{"api_key":[]}]}},"/api/sessions/start":{"post":{"operationId":"SessionsController_start","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionStartRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionDTO"}}}}},"tags":["sessions"],"security":[{"api_key":[]}]}},"/api/sessions/stop":{"post":{"operationId":"SessionsController_stop","summary":"Stop session","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionStopRequest"}}}},"responses":{"201":{"description":""}},"tags":["sessions"],"security":[{"api_key":[]}]}},"/api/sessions/logout":{"post":{"operationId":"SessionsController_clean","summary":"Logout from session.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionLogoutRequest"}}}},"responses":{"201":{"description":""}},"tags":["sessions"],"security":[{"api_key":[]}]}},"/api/sessions":{"get":{"operationId":"SessionsController_list","parameters":[{"name":"all","required":false,"in":"query","example":false,"description":"Return all sessions, including those that are in the STOPPED state.","schema":{"type":"boolean"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SessionInfo"}}}}}},"tags":["sessions"],"security":[{"api_key":[]}]}},"/api/sessions/{session}":{"get":{"operationId":"SessionsController_get","parameters":[{"name":"session","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionInfo"}}}}},"tags":["sessions"],"security":[{"api_key":[]}]}},"/api/sessions/{session}/me":{"get":{"operationId":"SessionController_getMe","summary":"Get information about the authenticated account","parameters":[{"name":"session","required":true,"in":"path","schema":{"default":"default"},"description":"WhatsApp session name"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeInfo"}}}}},"tags":["sessions"],"security":[{"api_key":[]}]}},"/api/checkNumberStatus":{"get":{"operationId":"ChattingController_checkNumberStatus","summary":"Check number status","parameters":[{"name":"phone","required":true,"in":"query","schema":{"type":"string"}},{"nLine truncated
|
||||
{"openapi":"3.1.0","paths":{"/api/{session}/auth/qr":{"get":{"operationId":"AuthController_getQR","summary":"Get QR code for pairing WhatsApp Web.","parameters":[{"name":"session","required":true,"in":"path","schema":{"default":"default"},"description":"WhatsApp session name"},{"name":"format","required":true,"in":"query","schema":{"default":"image","enum":["image","raw"],"type":"string"}}],"responses":{"200":{"content":{"image/png":{"schema":{"type":"string","format":"binary"}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Base64File"},{"$ref":"#/components/schemas/QRCodeValue"}]}}},"description":""}},"tags":["auth"],"security":[{"api_key":[]}]}},"/api/{session}/auth/request-code":{"post":{"operationId":"AuthController_requestCode","summary":"Request authentication code.","parameters":[{"name":"session","required":true,"in":"path","schema":{"default":"default"},"description":"WhatsApp session name"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestCodeRequest"}}}},"responses":{"201":{"description":""}},"tags":["auth"],"security":[{"api_key":[]}]}},"/api/{session}/auth/authorize-code":{"post":{"operationId":"AuthController_authorizeCode","summary":"Send OTP authentication code.","parameters":[{"name":"session","required":true,"in":"path","schema":{"default":"default"},"description":"WhatsApp session name"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OTPRequest"}}}},"responses":{"201":{"description":""}},"tags":["auth"],"security":[{"api_key":[]}]}},"/api/{session}/auth/captcha":{"get":{"operationId":"AuthController_getCaptcha","summary":"Get captcha image.","parameters":[{"name":"session","required":true,"in":"path","schema":{"default":"default"},"description":"WhatsApp session name"}],"responses":{"200":{"content":{"image/png":{"schema":{"type":"string","format":"binary"}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Base64File"}]}}},"description":""}},"tags":["auth"],"security":[{"api_key":[]}]},"post":{"operationId":"AuthController_saveCaptcha","summary":"Enter captcha code.","parameters":[{"name":"session","required":true,"in":"path","schema":{"default":"default"},"description":"WhatsApp session name"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaptchaBody"}}}},"responses":{"201":{"description":""}},"tags":["auth"],"security":[{"api_key":[]}]}},"/api/sessions/start":{"post":{"operationId":"SessionsController_start","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionStartRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionDTO"}}}}},"tags":["sessions"],"security":[{"api_key":[]}]}},"/api/sessions/stop":{"post":{"operationId":"SessionsController_stop","summary":"Stop session","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionStopRequest"}}}},"responses":{"201":{"description":""}},"tags":["sessions"],"security":[{"api_key":[]}]}},"/api/sessions/logout":{"post":{"operationId":"SessionsController_clean","summary":"Logout from session.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionLogoutRequest"}}}},"responses":{"201":{"description":""}},"tags":["sessions"],"security":[{"api_key":[]}]}},"/api/sessions":{"get":{"operationId":"SessionsController_list","parameters":[{"name":"all","required":false,"in":"query","example":false,"description":"Return all sessions, including those that are in the STOPPED state.","schema":{"type":"boolean"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SessionInfo"}}}}}},"tags":["sessions"],"security":[{"api_key":[]}]}},"/api/sessions/{session}":{"get":{"operationId":"SessionsController_get","parameters":[{"name":"session","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionInfo"}}}}},"tags":["sessions"],"security":[{"api_key":[]}]}},"/api/sessions/{session}/me":{"get":{"operationId":"SessionController_getMe","summary":"Get information about the authenticated account","parameters":[{"name":"session","required":true,"in":"path","schema":{"default":"default"},"description":"WhatsApp session name"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeInfo"}}}}},"tags":["sessions"],"security":[{"api_key":[]}]}},"/api/checkNumberStatus":{"get":{"operationId":"ChattingController_checkNumberStatus","summary":"Check number status","parameters":[{"name":"phone","required":true,"in":"query","schema":{"type":"string"}},{"nLine truncated
|
||||
Binary file not shown.
Binary file not shown.
+1
-1
@@ -3,7 +3,7 @@
|
||||
"sourceRoot": "src",
|
||||
"compilerOptions": {
|
||||
"plugins": ["@nestjs/swagger"],
|
||||
"assets": ["dashboard/**"],
|
||||
"assets": ["dashboard/**", "core/engines/webjs/*"],
|
||||
"watchAssets": true
|
||||
}
|
||||
}
|
||||
@@ -9,21 +9,10 @@ import { getEngineName } from './version';
|
||||
@Injectable()
|
||||
export class WhatsappConfigService {
|
||||
public filesUri = '/api/files';
|
||||
public dashboardUri = '/dashboard';
|
||||
public schema = 'http';
|
||||
|
||||
constructor(private configService: ConfigService) {}
|
||||
|
||||
static noSlash(value: string): string {
|
||||
if (!value) {
|
||||
return value;
|
||||
}
|
||||
if (value.startsWith('/')) {
|
||||
return value.slice(1);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
get filesURL(): string {
|
||||
return `${this.schema}://${this.hostname}:${this.port}${this.filesUri}/`;
|
||||
}
|
||||
@@ -142,27 +131,6 @@ export class WhatsappConfigService {
|
||||
return this.configService.get('WHATSAPP_API_KEY', '');
|
||||
}
|
||||
|
||||
getSwaggerEnabled(): boolean {
|
||||
const value = this.configService.get('WHATSAPP_SWAGGER_ENABLED', 'true');
|
||||
return parseBool(value);
|
||||
}
|
||||
|
||||
getSwaggerUsernamePassword(): [string, string] | undefined {
|
||||
const user = this.configService.get('WHATSAPP_SWAGGER_USERNAME', undefined);
|
||||
const password = this.configService.get(
|
||||
'WHATSAPP_SWAGGER_PASSWORD',
|
||||
undefined,
|
||||
);
|
||||
if (!user && !password) {
|
||||
console.log(
|
||||
'Please set up both WHATSAPP_SWAGGER_USERNAME and WHATSAPP_SWAGGER_PASSWORD ' +
|
||||
'to enable swagger authentication.',
|
||||
);
|
||||
return undefined;
|
||||
}
|
||||
return [user, password];
|
||||
}
|
||||
|
||||
getDashboardEnabled(): boolean {
|
||||
const value = this.configService.get('WAHA_DASHBOARD_ENABLED', 'true');
|
||||
return parseBool(value);
|
||||
@@ -184,10 +152,6 @@ export class WhatsappConfigService {
|
||||
return [user, password];
|
||||
}
|
||||
|
||||
getSwaggerAdvancedConfigEnabled(): boolean {
|
||||
return this.configService.get('WHATSAPP_SWAGGER_CONFIG_ADVANCED', false);
|
||||
}
|
||||
|
||||
getHealthMediaFilesThreshold(): number {
|
||||
return this.configService.get<number>(
|
||||
'WHATSAPP_HEALTH_MEDIA_FILES_THRESHOLD_MB',
|
||||
|
||||
@@ -4,36 +4,52 @@ import { DECORATORS } from '@nestjs/swagger/dist/constants';
|
||||
|
||||
import { WhatsappConfigService } from '../config.service';
|
||||
import { VERSION } from '../version';
|
||||
import { SwaggerConfigServiceCore } from './config/SwaggerConfigServiceCore';
|
||||
|
||||
export class SwaggerModuleCore {
|
||||
configure(app: INestApplication, webhooks: any[]) {
|
||||
export class SwaggerConfiguratorCore {
|
||||
constructor(protected app: INestApplication) {}
|
||||
|
||||
get title() {
|
||||
return 'WAHA - WhatsApp HTTP API';
|
||||
}
|
||||
|
||||
get description() {
|
||||
return (
|
||||
'WhatsApp HTTP API that you can run in a click!<br/>' +
|
||||
'<br/>' +
|
||||
'Learn more:' +
|
||||
'<ul>' +
|
||||
'<li><a href="https://waha.devlike.pro/" target="_blank">Documentation</a></li>' +
|
||||
'<li><a href="https://waha.devlike.pro/docs/how-to/engines/#features" target="_blank">Supported features in engines</a></li>' +
|
||||
'<li><a href="https://github.com/devlikeapro/whatsapp-http-api" target="_blank">GitHub - WAHA Core</a></li>' +
|
||||
'<li><a href="https://github.com/devlikeapro/whatsapp-http-api-plu' + // Separate line to pass pre-commit check
|
||||
's" target="_blank">GitHub - WAHA Plus</a></li>' +
|
||||
'<li><b>NEW!</b> - <a href="/dashboard">WAHA Dashboard</a></li>' +
|
||||
'<li><b>NEW!</b> - <a href="https://waha.devlike.pro/docs/how-to/waha-dashboard">WAHA Dashboard Documentation</a></li>' +
|
||||
'</ul>' +
|
||||
'<p>Support the project and get WAHA Plus version!</p>' +
|
||||
'<ul>' +
|
||||
'<li><a href="https://waha.devlike.pro/docs/how-to/plu' + // Separate line to pass pre-commit check
|
||||
's-version/" target="_blank">WAHA Plus</a></li>' +
|
||||
'<li><a href="https://patreon.com/wa_http_api/" target="_blank">Patreon</a></li>' +
|
||||
'<li><a href="https://boosty.to/wa-http-api/" target="_blank">Boosty</a></li>' +
|
||||
'<li><a href="https://portal.devlike.pro/" target="_blank">Patron Portal</a></li>' +
|
||||
'</ul>'
|
||||
);
|
||||
}
|
||||
|
||||
get externalDocUrl() {
|
||||
return 'https://waha.devlike.pro/';
|
||||
}
|
||||
|
||||
configure(webhooks: any[]) {
|
||||
const app = this.app;
|
||||
const builder = new DocumentBuilder();
|
||||
|
||||
builder
|
||||
.setTitle('WAHA - WhatsApp HTTP API')
|
||||
.setDescription(
|
||||
'WhatsApp HTTP API that you can run in a click!<br/>' +
|
||||
'<br/>' +
|
||||
'Learn more:' +
|
||||
'<ul>' +
|
||||
'<li><a href="https://waha.devlike.pro/" target="_blank">Documentation</a></li>' +
|
||||
'<li><a href="https://waha.devlike.pro/docs/how-to/engines/#features" target="_blank">Supported features in engines</a></li>' +
|
||||
'<li><a href="https://github.com/devlikeapro/whatsapp-http-api" target="_blank">GitHub - WAHA Core</a></li>' +
|
||||
'<li><a href="https://github.com/devlikeapro/whatsapp-http-api-plu' + // Separate line to pass pre-commit check
|
||||
's" target="_blank">GitHub - WAHA Plus</a></li>' +
|
||||
'<li><b>NEW!</b> - <a href="/dashboard">WAHA Dashboard</a></li>' +
|
||||
'<li><b>NEW!</b> - <a href="https://waha.devlike.pro/docs/how-to/waha-dashboard">WAHA Dashboard Documentation</a></li>' +
|
||||
'</ul>' +
|
||||
'<p>Support the project and get WAHA Plus version!</p>' +
|
||||
'<ul>' +
|
||||
'<li><a href="https://waha.devlike.pro/docs/how-to/plu' + // Separate line to pass pre-commit check
|
||||
's-version/" target="_blank">WAHA Plus</a></li>' +
|
||||
'<li><a href="https://patreon.com/wa_http_api/" target="_blank">Patreon</a></li>' +
|
||||
'<li><a href="https://boosty.to/wa-http-api/" target="_blank">Boosty</a></li>' +
|
||||
'<li><a href="https://portal.devlike.pro/" target="_blank">Patron Portal</a></li>' +
|
||||
'</ul>',
|
||||
)
|
||||
.setExternalDoc('WAHA', 'https://waha.devlike.pro/')
|
||||
.setTitle(this.title)
|
||||
.setDescription(this.description)
|
||||
.setExternalDoc(this.title, this.externalDocUrl)
|
||||
.setVersion(VERSION.version)
|
||||
.addTag('sessions', 'Control WhatsApp sessions')
|
||||
.addTag('auth', 'Authentication')
|
||||
@@ -60,7 +76,8 @@ export class SwaggerModuleCore {
|
||||
});
|
||||
|
||||
const config = app.get(WhatsappConfigService);
|
||||
if (config.getSwaggerAdvancedConfigEnabled()) {
|
||||
const swaggerConfig = app.get(SwaggerConfigServiceCore);
|
||||
if (swaggerConfig.advancedConfigEnabled) {
|
||||
builder.addServer('{protocol}://{host}:{port}/{baseUrl}', '', {
|
||||
protocol: {
|
||||
default: 'http',
|
||||
@@ -95,7 +112,7 @@ export class SwaggerModuleCore {
|
||||
);
|
||||
document = this.configureWebhooks(document, webhooks);
|
||||
SwaggerModule.setup('', app, document, {
|
||||
customSiteTitle: 'WAHA - WhatsApp HTTP API',
|
||||
customSiteTitle: this.title,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -22,6 +22,8 @@ import { VersionController } from '../api/version.controller';
|
||||
import { WhatsappConfigService } from '../config.service';
|
||||
import { SessionManager } from './abc/manager.abc';
|
||||
import { WAHAHealthCheckService } from './abc/WAHAHealthCheckService';
|
||||
import { DashboardConfigServiceCore } from './config/DashboardConfigServiceCore';
|
||||
import { SwaggerConfigServiceCore } from './config/SwaggerConfigServiceCore';
|
||||
import { WAHAHealthCheckServiceCore } from './health/WAHAHealthCheckServiceCore';
|
||||
import { SessionManagerCore } from './manager.core';
|
||||
|
||||
@@ -31,9 +33,12 @@ export const IMPORTS = [
|
||||
}),
|
||||
ServeStaticModule.forRootAsync({
|
||||
imports: [],
|
||||
extraProviders: [WhatsappConfigService],
|
||||
inject: [WhatsappConfigService],
|
||||
useFactory: (config: WhatsappConfigService) => {
|
||||
extraProviders: [WhatsappConfigService, DashboardConfigServiceCore],
|
||||
inject: [WhatsappConfigService, DashboardConfigServiceCore],
|
||||
useFactory: (
|
||||
config: WhatsappConfigService,
|
||||
dashboardConfig: DashboardConfigServiceCore,
|
||||
) => {
|
||||
const options = [
|
||||
// Serve files (media)
|
||||
{
|
||||
@@ -41,10 +46,10 @@ export const IMPORTS = [
|
||||
serveRoot: config.filesUri,
|
||||
},
|
||||
];
|
||||
if (config.getDashboardEnabled()) {
|
||||
if (dashboardConfig.enabled) {
|
||||
options.push({
|
||||
rootPath: join(__dirname, '..', 'dashboard'),
|
||||
serveRoot: config.dashboardUri,
|
||||
serveRoot: dashboardConfig.dashboardUri,
|
||||
});
|
||||
}
|
||||
return options;
|
||||
@@ -76,6 +81,8 @@ const PROVIDERS = [
|
||||
provide: WAHAHealthCheckService,
|
||||
useClass: WAHAHealthCheckServiceCore,
|
||||
},
|
||||
DashboardConfigServiceCore,
|
||||
SwaggerConfigServiceCore,
|
||||
WhatsappConfigService,
|
||||
ConsoleLogger,
|
||||
];
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
|
||||
import { parseBool } from '../../helpers';
|
||||
|
||||
@Injectable()
|
||||
export class DashboardConfigServiceCore {
|
||||
public dashboardUri = '/dashboard';
|
||||
|
||||
constructor(protected configService: ConfigService) {}
|
||||
|
||||
get enabled(): boolean {
|
||||
const value = this.configService.get('WAHA_DASHBOARD_ENABLED', 'true');
|
||||
return parseBool(value);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
|
||||
import { parseBool } from '../../helpers';
|
||||
|
||||
@Injectable()
|
||||
export class SwaggerConfigServiceCore {
|
||||
constructor(protected configService: ConfigService) {}
|
||||
|
||||
get advancedConfigEnabled(): boolean {
|
||||
const value = this.configService.get(
|
||||
'WHATSAPP_SWAGGER_CONFIG_ADVANCED',
|
||||
false,
|
||||
);
|
||||
return parseBool(value);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,535 @@
|
||||
<!doctype html>
|
||||
<html class="no-js" dir="ltr" loc="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<title>WhatsApp Web</title>
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<meta name="google" content="notranslate" />
|
||||
<meta name="format-detection" content="telephone=no" />
|
||||
<meta
|
||||
name="description"
|
||||
content="Quickly send and receive WhatsApp messages right from your computer."
|
||||
/>
|
||||
<meta
|
||||
name="og:description"
|
||||
content="Quickly send and receive WhatsApp messages right from your computer."
|
||||
/>
|
||||
<meta name="og:url" content="https://web.whatsapp.com/" />
|
||||
<meta name="og:title" content="WhatsApp Web" />
|
||||
<meta
|
||||
name="og:image"
|
||||
content="https://static.facebook.com/images/whatsapp/www/whatsapp-promo.png"
|
||||
/>
|
||||
<link
|
||||
id="favicon"
|
||||
rel="shortcut icon"
|
||||
href="/img/favicon/1x/favicon.png"
|
||||
type="image/png"
|
||||
/>
|
||||
<link
|
||||
rel="apple-touch-icon"
|
||||
sizes="192x192"
|
||||
href="/apple-touch-icon.png"
|
||||
type="image/png"
|
||||
/>
|
||||
<meta
|
||||
name="theme-color"
|
||||
content="#111b21"
|
||||
media="(prefers-color-scheme: dark)"
|
||||
/>
|
||||
<meta name="theme-color" content="#f0f2f5" />
|
||||
<link
|
||||
id="whatsapp-pwa-manifest-link"
|
||||
rel="manifest"
|
||||
href="/manifest.json"
|
||||
crossorigin="use-credentials"
|
||||
/>
|
||||
<style>
|
||||
#initial_startup {
|
||||
--startup-background: #f0f2f5;
|
||||
--startup-background-rgb: 240, 242, 245;
|
||||
--startup-icon: #bbc5cb;
|
||||
--secondary-lighter: #8696a0;
|
||||
--primary-title: #41525d;
|
||||
--progress-primary: #00c298;
|
||||
--progress-background: #e9edef;
|
||||
}
|
||||
.dark #initial_startup {
|
||||
--startup-background: #111b21;
|
||||
--startup-background-rgb: 17, 27, 33;
|
||||
--startup-icon: #676f73;
|
||||
--primary-title: rgba(233, 237, 239, 0.88);
|
||||
--secondary-lighter: #667781;
|
||||
--progress-primary: #0b846d;
|
||||
--progress-background: #233138;
|
||||
}
|
||||
#app,
|
||||
body,
|
||||
html {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
#app {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
#initial_startup {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
user-select: none;
|
||||
background-color: var(--startup-background);
|
||||
}
|
||||
#initial_startup .graphic {
|
||||
margin-top: -40px;
|
||||
color: var(--startup-icon);
|
||||
}
|
||||
#initial_startup .graphic .resume-logo {
|
||||
transform: translateX(calc(50% - 52px / 2));
|
||||
}
|
||||
#initial_startup .graphic::after {
|
||||
position: relative;
|
||||
top: -100%;
|
||||
left: calc(50% - 72px * 2 - 72px / 2);
|
||||
display: block;
|
||||
width: calc(72px * 3);
|
||||
height: 100%;
|
||||
content: '';
|
||||
background: linear-gradient(
|
||||
to right,
|
||||
rgba(var(--startup-background-rgb), 0.5) 0,
|
||||
rgba(var(--startup-background-rgb), 0.5) 33.33%,
|
||||
rgba(var(--startup-background-rgb), 0) 44.1%,
|
||||
rgba(var(--startup-background-rgb), 0) 55.8%,
|
||||
rgba(var(--startup-background-rgb), 0.5) 66.66%,
|
||||
rgba(var(--startup-background-rgb), 0.5) 100%
|
||||
);
|
||||
opacity: 1;
|
||||
animation: shimmer 1.5s linear 0.6s infinite;
|
||||
}
|
||||
html[dir='rtl'] #initial_startup .graphic::after {
|
||||
animation-direction: reverse;
|
||||
}
|
||||
@keyframes shimmer {
|
||||
from {
|
||||
left: calc(50% - 72px * 2 - 72px / 2);
|
||||
}
|
||||
to {
|
||||
left: calc(50% - 72px / 2);
|
||||
}
|
||||
}
|
||||
#initial_startup .progress {
|
||||
position: relative;
|
||||
width: 420px;
|
||||
height: 3px;
|
||||
margin-top: 40px;
|
||||
}
|
||||
#initial_startup .progress progress {
|
||||
vertical-align: top;
|
||||
}
|
||||
#initial_startup .main {
|
||||
margin-top: 40px;
|
||||
font-size: 17px;
|
||||
color: var(--primary-title);
|
||||
}
|
||||
#initial_startup .secondary {
|
||||
margin-top: 12px;
|
||||
font-size: 14px;
|
||||
color: var(--secondary-lighter);
|
||||
}
|
||||
#initial_startup .secondary span {
|
||||
display: inline-block;
|
||||
margin-bottom: 2px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
progress {
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
width: 100%;
|
||||
height: 3px;
|
||||
margin: 0;
|
||||
color: var(--progress-primary);
|
||||
background-color: var(--progress-background);
|
||||
border: none;
|
||||
}
|
||||
progress[value]::-webkit-progress-bar {
|
||||
background-color: var(--progress-background);
|
||||
}
|
||||
progress[value]::-moz-progress-bar,
|
||||
progress[value]::-webkit-progress-value {
|
||||
background-color: var(--progress-primary);
|
||||
transition: width 0.45s ease;
|
||||
}
|
||||
</style>
|
||||
<link
|
||||
href="/stylex-f0601c57714fe972a8c4d2c2562f8082.css"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
<link href="/app-6113f1562d101247269b.css" rel="stylesheet" />
|
||||
</head>
|
||||
<body class="web">
|
||||
<script
|
||||
data-binary-transparency-hash-key="inline-js-d11c72a06542fc3b43af600028cf0f996e4b9b178dfa047e18730efaf74aab0b"
|
||||
>
|
||||
try {
|
||||
var systemThemeDark,
|
||||
theme = window.localStorage.getItem('theme'),
|
||||
systemThemeMode = window.localStorage.getItem('system-theme-mode');
|
||||
if (('true' === systemThemeMode || !theme) && window.matchMedia) {
|
||||
var systemTheme = window.matchMedia('(prefers-color-scheme: dark)');
|
||||
systemThemeDark = systemTheme && systemTheme.matches;
|
||||
}
|
||||
var darkTheme = '"dark"' === theme || Boolean(systemThemeDark);
|
||||
darkTheme && document.body.classList.add('dark');
|
||||
} catch (e) {}
|
||||
</script>
|
||||
<div id="app"></div>
|
||||
<div id="hard_expire_time" data-time="1719543128.405"></div>
|
||||
<div id="initial_startup">
|
||||
<div class="graphic">
|
||||
<span
|
||||
><svg width="250" height="52" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
class="resume-logo"
|
||||
d="M37.7 31.2c-.6-.4-3.8-2-4.4-2.1-.6-.2-1-.4-1.4.3l-2 2.5c-.4.4-.8.5-1.5.2-.6-.3-2.7-1-5.1-3.2-2-1.7-3.2-3.8-3.6-4.5-.4-.6 0-1 .3-1.3l1-1.1.6-1.1c.2-.4 0-.8 0-1.1l-2-4.8c-.6-1.3-1.1-1-1.5-1.1h-1.2c-.5 0-1.2.1-1.8.8-.5.6-2.2 2.2-2.2 5.3 0 3.2 2.3 6.3 2.6 6.7.3.4 4.6 7 11 9.7l3.7 1.4c1.5.5 3 .4 4 .2 1.3-.1 3.9-1.5 4.4-3 .5-1.5.5-2.8.4-3-.2-.4-.6-.5-1.3-.8M26 47.2c-3.9 0-7.6-1-11-3l-.7-.4-8.1 2L8.4 38l-.6-.8A21.4 21.4 0 0126 4.4a21.3 21.3 0 0121.4 21.4c0 11.8-9.6 21.4-21.4 21.4M44.2 7.6a25.8 25.8 0 00-40.6 31L0 52l13.7-3.6A25.8 25.8 0 0044.3 7.5"
|
||||
fill="currentColor"
|
||||
></path></svg
|
||||
></span>
|
||||
</div>
|
||||
<div class="progress">
|
||||
<progress value="0" max="100" dir="ltr"></progress>
|
||||
</div>
|
||||
<div class="main">WhatsApp</div>
|
||||
<div class="secondary">
|
||||
<span
|
||||
><svg width="10" height="12" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M5 1.6c1.4 0 2.5 1 2.6 2.4v1.5h.2c.5 0 1 .4 1 1V10c0 .6-.5 1-1 1H2.3a1 1 0 01-1.1-1V6.5c0-.6.5-1 1-1h.2V4.2c0-1.4 1-2.5 2.4-2.6H5zm0 1.2c-.7 0-1.3.6-1.3 1.3v1.4h2.6V4.2c0-.7-.4-1.2-1-1.3H5z"
|
||||
fill="currentColor"
|
||||
></path>
|
||||
</svg> </span
|
||||
> End-to-end encrypted
|
||||
</div>
|
||||
</div>
|
||||
<link
|
||||
rel="preload"
|
||||
crossorigin="anonymous"
|
||||
as="fetch"
|
||||
href="/binary-transparency-manifest-2.2412.54.json"
|
||||
id="binary-transparency-manifest-preload"
|
||||
/>
|
||||
<script src="/libsignal-protocol-ee5b8ba.min.js"></script>
|
||||
<script defer="defer" src="/runtime.295f0230b6dbd8983513.js"></script>
|
||||
<script
|
||||
data-binary-transparency-hash-key="inline-js-cdf06293c99d00ee0c1bc0fcfdbd76a7ae9aef6290926dbff0cba3a7994b7fca"
|
||||
>
|
||||
/*! Copyright (c) 2024 WhatsApp Inc. All Rights Reserved. */
|
||||
(self.webpackChunkwhatsapp_web_client =
|
||||
self.webpackChunkwhatsapp_web_client || []).push([
|
||||
[5617],
|
||||
{
|
||||
307914: (e) => {
|
||||
e.exports = function (e) {
|
||||
return e && e.__esModule ? e : { default: e };
|
||||
};
|
||||
},
|
||||
595318: (e) => {
|
||||
(e.exports = function (e) {
|
||||
return e && e.__esModule ? e : { default: e };
|
||||
}),
|
||||
(e.exports.default = e.exports),
|
||||
(e.exports.__esModule = !0);
|
||||
},
|
||||
415227: (e, t) => {
|
||||
'use strict';
|
||||
Object.defineProperty(t, '__esModule', { value: !0 }),
|
||||
(t.default = function (e) {
|
||||
const t = new Error(e);
|
||||
if (void 0 === t.stack)
|
||||
try {
|
||||
throw t;
|
||||
} catch (e) {}
|
||||
return t;
|
||||
});
|
||||
},
|
||||
670983: (e, t, r) => {
|
||||
'use strict';
|
||||
var n = r(307914);
|
||||
Object.defineProperty(t, '__esModule', { value: !0 }),
|
||||
(t.default = function (e) {
|
||||
let t =
|
||||
arguments.length > 1 && void 0 !== arguments[1]
|
||||
? arguments[1]
|
||||
: '?';
|
||||
if (null == e)
|
||||
throw (0, o.default)('Unexpected null or undefined: ' + t);
|
||||
return e;
|
||||
});
|
||||
var o = n(r(415227));
|
||||
},
|
||||
250473: (e, t, r) => {
|
||||
'use strict';
|
||||
Object.defineProperty(t, '__esModule', { value: !0 }),
|
||||
(t.UNIQUE_UPLOADS_ALLOWED_BEFORE_THROTTLE =
|
||||
t.TICKET_URL =
|
||||
t.CLB_URL =
|
||||
t.CLB_TOKEN =
|
||||
t.CLB_CHECK_URL =
|
||||
void 0);
|
||||
var n = r(508247);
|
||||
(t.CLB_CHECK_URL =
|
||||
'https://crashlogs.whatsapp.net/wa_fls_upload_check'),
|
||||
(t.CLB_TOKEN =
|
||||
'1063127757113399|745146ffa34413f9dbb5469f5370b7af'),
|
||||
(t.CLB_URL = 'https://crashlogs.whatsapp.net/wa_clb_data');
|
||||
const o = n.DYN_ORIGIN + 'web-contact-us';
|
||||
(t.TICKET_URL = o), (t.UNIQUE_UPLOADS_ALLOWED_BEFORE_THROTTLE = 0);
|
||||
},
|
||||
207024: (e, t, r) => {
|
||||
'use strict';
|
||||
var n = r(595318);
|
||||
Object.defineProperty(t, '__esModule', { value: !0 }),
|
||||
(t.getDistribution = function () {
|
||||
let e = 'unknown';
|
||||
return (e = 'prod'), 'web_prod';
|
||||
}),
|
||||
(t.getLogUserAgent = function (e) {
|
||||
let t,
|
||||
{ appVersion: r, browser: n, device: o } = e;
|
||||
return (t = 'Web/' + n), `WhatsApp/${r} ${t} Device/${o}`;
|
||||
}),
|
||||
n(r(472514)),
|
||||
n(r(556869));
|
||||
},
|
||||
794858: (e, t, r) => {
|
||||
'use strict';
|
||||
var n = r(595318),
|
||||
o = n(r(670983)),
|
||||
a = r(508247),
|
||||
s = r(250473),
|
||||
c = r(207024),
|
||||
_ = n(r(174285)),
|
||||
u = r(425017);
|
||||
function i(e) {
|
||||
!(function (e, t) {
|
||||
const r = window.navigator.userAgent;
|
||||
if (r === p && e.includes('getElementsByTagName')) return;
|
||||
const n = new FormData(),
|
||||
i = new Blob([e], { type: 'text/plain' });
|
||||
n.append(
|
||||
'from_jid',
|
||||
(function () {
|
||||
if (f) return f;
|
||||
try {
|
||||
(f = JSON.parse(
|
||||
(0, o.default)(_.default, 'localStorage').getItem(
|
||||
d.UNKNOWN_ID,
|
||||
),
|
||||
)),
|
||||
f && (f = f.replace('-', ''));
|
||||
} catch (e) {}
|
||||
if (!f) {
|
||||
f = 'unknown' + Math.floor(1e10 * Math.random());
|
||||
const e = f;
|
||||
try {
|
||||
(0, o.default)(_.default, 'localStorage').setItem(
|
||||
d.UNKNOWN_ID,
|
||||
JSON.stringify(e),
|
||||
);
|
||||
} catch (e) {}
|
||||
}
|
||||
return (0, o.default)(f, 'id');
|
||||
})(),
|
||||
),
|
||||
n.append(
|
||||
'agent',
|
||||
(0, c.getLogUserAgent)(
|
||||
(0, u.parseUASimple)(r, a.VERSION_BASE),
|
||||
),
|
||||
),
|
||||
n.append('file', i, 'logs.txt'),
|
||||
n.append('tags', 'load');
|
||||
const l = new XMLHttpRequest(),
|
||||
I =
|
||||
s.CLB_URL +
|
||||
'?access_token=' +
|
||||
encodeURIComponent(s.CLB_TOKEN);
|
||||
l.open('POST', I, !0), l.send(n);
|
||||
})(e);
|
||||
}
|
||||
function l(e) {
|
||||
let { error: t, reason: r, stack: n } = e;
|
||||
const o = new Date().toISOString();
|
||||
return `${o}: error: ${t}\n${o}: reason for logs: ${r}\n${o}: userAgent: ${window.navigator.userAgent}\n${n}`;
|
||||
}
|
||||
null == window.onerror &&
|
||||
(window.onerror = function (e, t, r) {
|
||||
const n = t.split('?')[0];
|
||||
return "Uncaught SyntaxError: Unexpected token '<'" === e
|
||||
? ((function (e) {
|
||||
i(
|
||||
l({
|
||||
error: 'failed to load a js or css bundle',
|
||||
reason: `failed to load [${e
|
||||
.split('/')[3]
|
||||
.replace(/^\//, '')}]`,
|
||||
stack: '',
|
||||
}),
|
||||
);
|
||||
})(n),
|
||||
!0)
|
||||
: (i(
|
||||
l({
|
||||
error: e,
|
||||
reason: `Error at [${n}:${r}]`,
|
||||
stack: '',
|
||||
}),
|
||||
),
|
||||
!1);
|
||||
});
|
||||
const d = { UNKNOWN_ID: a.UNKNOWN_ID },
|
||||
p =
|
||||
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36';
|
||||
let f;
|
||||
},
|
||||
425017: (e, t) => {
|
||||
'use strict';
|
||||
function r(e) {
|
||||
return e.includes('windows')
|
||||
? 'Windows'
|
||||
: e.includes('mac')
|
||||
? 'Mac OS'
|
||||
: e.includes('linux')
|
||||
? 'Linux'
|
||||
: 'Unparsed';
|
||||
}
|
||||
Object.defineProperty(t, '__esModule', { value: !0 }),
|
||||
(t.parseUASimple = function (e, t) {
|
||||
const n = e.toLowerCase();
|
||||
return { browser: s(n), device: r(n), appVersion: t };
|
||||
});
|
||||
const n = /(chrome|firefox)\/([\w\.]+)/i,
|
||||
o = /(edge|opr)\/([\w\.]+)/i,
|
||||
a = {
|
||||
chrome: 'Chrome',
|
||||
edge: 'Edge',
|
||||
opr: 'Opera',
|
||||
firefox: 'Firefox',
|
||||
};
|
||||
function s(e) {
|
||||
const t = e.match(o) || e.match(n);
|
||||
return null == t ? 'Unparsed' : `${a[t[1]]} ${t[2]}`;
|
||||
}
|
||||
},
|
||||
174285: (e, t) => {
|
||||
'use strict';
|
||||
let r;
|
||||
Object.defineProperty(t, '__esModule', { value: !0 }),
|
||||
(t.default = void 0);
|
||||
try {
|
||||
r = window.localStorage;
|
||||
} catch (e) {}
|
||||
var n = r;
|
||||
t.default = n;
|
||||
},
|
||||
508247: (e, t) => {
|
||||
'use strict';
|
||||
Object.defineProperty(t, '__esModule', { value: !0 }),
|
||||
(t.WS_ORIGIN =
|
||||
t.WEB_PUBLIC_PATH =
|
||||
t.VERSION_TERTIARY =
|
||||
t.VERSION_STR =
|
||||
t.VERSION_SECONDARY =
|
||||
t.VERSION_PRIMARY =
|
||||
t.VERSION_BASE =
|
||||
t.USER_TIMINGS =
|
||||
t.UNKNOWN_ID =
|
||||
t.LOCALHOST_ENV_CONFIG =
|
||||
t.HASH_PLACEHOLDER =
|
||||
t.FLB_PLATFORM =
|
||||
t.FB_APP_ID =
|
||||
t.DYN_ORIGIN =
|
||||
t.DIFF_VERSION =
|
||||
t.DIFF_ID =
|
||||
t.BUILD_URL =
|
||||
t.BUILD_TIMESTAMP =
|
||||
t.BUILD_ID =
|
||||
void 0);
|
||||
t.DIFF_ID = '';
|
||||
(t.DIFF_VERSION = ''),
|
||||
(t.LOCALHOST_ENV_CONFIG = !1),
|
||||
(t.HASH_PLACEHOLDER = '507042ed75b89fb00e8ef35da3541122cbc261e6'),
|
||||
(t.VERSION_PRIMARY = '2'),
|
||||
(t.VERSION_SECONDARY = '2412'),
|
||||
(t.VERSION_TERTIARY = '54'),
|
||||
(t.VERSION_BASE = '2.2412.54'),
|
||||
(t.VERSION_STR = '2.2412.54'),
|
||||
(t.DYN_ORIGIN = 'https://web.whatsapp.com/'),
|
||||
(t.WS_ORIGIN = ''),
|
||||
(t.FLB_PLATFORM = 'web'),
|
||||
(t.FB_APP_ID = ''),
|
||||
(t.UNKNOWN_ID = 'WAUnknownID'),
|
||||
(t.BUILD_ID = '583059957'),
|
||||
(t.BUILD_TIMESTAMP = 'March 29, 2024'),
|
||||
(t.WEB_PUBLIC_PATH = '/'),
|
||||
(t.BUILD_URL = 'https://web.whatsapp.com/'),
|
||||
(t.USER_TIMINGS = !1);
|
||||
},
|
||||
472514: (e, t) => {
|
||||
'use strict';
|
||||
Object.defineProperty(t, '__esModule', { value: !0 }),
|
||||
(t.default = function (e) {
|
||||
return e.default;
|
||||
});
|
||||
},
|
||||
556869: (e, t) => {
|
||||
'use strict';
|
||||
Object.defineProperty(t, '__esModule', { value: !0 }),
|
||||
(t.default = function e(t) {
|
||||
const r = new Error(t);
|
||||
if (void 0 === r.stack)
|
||||
try {
|
||||
throw e;
|
||||
} catch (e) {}
|
||||
return r;
|
||||
});
|
||||
},
|
||||
},
|
||||
(e) => {
|
||||
'use strict';
|
||||
e((e.s = 794858));
|
||||
},
|
||||
]);
|
||||
</script>
|
||||
<script defer="defer" src="/vendor1~app.264a01b6133c4a120327.js"></script>
|
||||
<script defer="defer" src="/app.2c7f8dd150ae88037cde.js"></script>
|
||||
<script
|
||||
data-binary-transparency-hash-key="inline-js-9c8cd3d0f4d5af8c7f5cd1c45208edd308bfe472e353a50e4cbacbf6cb58627c"
|
||||
>
|
||||
((i) => {
|
||||
const l = document.getElementById(i);
|
||||
l &&
|
||||
fetch(l.href)
|
||||
.then((b) => b.text())
|
||||
.then((code) => {
|
||||
const script = document.createElement('script');
|
||||
script.id = 'binary-transparency-manifest';
|
||||
script.type = 'application/json';
|
||||
script.innerHTML = code;
|
||||
document.body.append(script);
|
||||
});
|
||||
})('binary-transparency-manifest-preload');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -74,6 +74,8 @@ export class WhatsappSessionWebJSCore extends WhatsappSession {
|
||||
}
|
||||
|
||||
protected getClientOptions(): ClientOptions {
|
||||
// Folder with current file
|
||||
const path = __dirname;
|
||||
return {
|
||||
puppeteer: {
|
||||
headless: true,
|
||||
@@ -82,9 +84,9 @@ export class WhatsappSessionWebJSCore extends WhatsappSession {
|
||||
},
|
||||
webVersion: '2.2412.54',
|
||||
webVersionCache: {
|
||||
type: 'remote',
|
||||
remotePath:
|
||||
'https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/{version}.html',
|
||||
type: 'local',
|
||||
path: path,
|
||||
strict: true,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -105,6 +105,11 @@ export class SessionManagerCore extends SessionManager {
|
||||
//
|
||||
async start(request: SessionStartRequest): Promise<SessionDTO> {
|
||||
this.onlyDefault(request.name);
|
||||
if (this.session) {
|
||||
throw new UnprocessableEntityException(
|
||||
`Session '${this.DEFAULT}' is already started.`,
|
||||
);
|
||||
}
|
||||
|
||||
const name = request.name;
|
||||
this.log.log(`'${name}' - starting session...`);
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import { LogLevel } from '@nestjs/common';
|
||||
|
||||
function parseBool(value: any): boolean {
|
||||
if (typeof value === 'boolean') {
|
||||
return value;
|
||||
}
|
||||
|
||||
if (!value) {
|
||||
return false;
|
||||
}
|
||||
|
||||
+11
-8
@@ -4,28 +4,31 @@ import { json, urlencoded } from 'express';
|
||||
import { AllExceptionsFilter } from './api/exception.filter';
|
||||
import { WhatsappConfigService } from './config.service';
|
||||
import { AppModuleCore } from './core/app.module.core';
|
||||
import { SwaggerModuleCore } from './core/swagger.module.core';
|
||||
import { SwaggerConfiguratorCore } from './core/SwaggerConfiguratorCore';
|
||||
import { getLogLevels } from './helpers';
|
||||
import { WAHA_WEBHOOKS } from './structures/webhooks.dto';
|
||||
import { getWAHAVersion, VERSION, WAHAVersion } from './version';
|
||||
|
||||
async function loadModules(): Promise<
|
||||
[typeof AppModuleCore, typeof SwaggerModuleCore]
|
||||
[typeof AppModuleCore, typeof SwaggerConfiguratorCore]
|
||||
> {
|
||||
const version = getWAHAVersion();
|
||||
console.log(`WAHA (WhatsApp HTTP API) - Running ${version} version...`);
|
||||
|
||||
if (version === WAHAVersion.CORE) {
|
||||
const { AppModuleCore } = await import('./core/app.module.core');
|
||||
const { SwaggerModuleCore } = await import('./core/swagger.module.core');
|
||||
return [AppModuleCore, SwaggerModuleCore];
|
||||
const { SwaggerConfiguratorCore } = await import(
|
||||
'./core/SwaggerConfiguratorCore'
|
||||
);
|
||||
return [AppModuleCore, SwaggerConfiguratorCore];
|
||||
}
|
||||
// Ignore if it's core version - there's no plus module
|
||||
// @ts-ignore
|
||||
const { AppModulePlus } = await import('./plus/app.module.plus');
|
||||
// @ts-ignore
|
||||
const { SwaggerModulePlus } = await import('./plus/swagger.module.plus');
|
||||
return [AppModulePlus, SwaggerModulePlus];
|
||||
const { SwaggerConfiguratorPlus } = await import('./plus/SwaggerConfiguratorPlus'); // prettier-ignore
|
||||
// @ts-ignore
|
||||
return [AppModulePlus, SwaggerConfiguratorPlus];
|
||||
}
|
||||
|
||||
async function bootstrap() {
|
||||
@@ -43,8 +46,8 @@ async function bootstrap() {
|
||||
app.use(urlencoded({ limit: '50mb', extended: false }));
|
||||
|
||||
// Configure swagger
|
||||
const swagger = new SwaggerModule();
|
||||
swagger.configure(app, WAHA_WEBHOOKS);
|
||||
const swaggerConfigurator = new SwaggerModule(app);
|
||||
swaggerConfigurator.configure(WAHA_WEBHOOKS);
|
||||
|
||||
const config = app.get(WhatsappConfigService);
|
||||
await app.listen(config.port);
|
||||
|
||||
@@ -222,8 +222,8 @@ class WAHAWebhookPollVote extends WAHAWebhook {
|
||||
class WAHAWebhookPollVoteFailed extends WAHAWebhook {
|
||||
@ApiProperty({
|
||||
description:
|
||||
'There may be cases when WAHA fails to decrypt a vote from the user. ' +
|
||||
'Read more about how to handle such events: https://waha.devlike.pro/docs/how-to/polls/#pollvotefailed',
|
||||
'There may be cases when it fails to decrypt a vote from the user. ' +
|
||||
'Read more about how to handle such events in the documentations.',
|
||||
})
|
||||
event = WAHAEvents.POLL_VOTE_FAILED;
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
export function noSlashAtTheEnd(value: string): string {
|
||||
if (!value) {
|
||||
return value;
|
||||
}
|
||||
if (value.startsWith('/')) {
|
||||
return value.slice(1);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
+1
-1
@@ -33,7 +33,7 @@ export function getEngineName(): string {
|
||||
}
|
||||
|
||||
export const VERSION: WAHAEnvironment = {
|
||||
version: '2024.5.2',
|
||||
version: '2024.5.4',
|
||||
engine: getEngineName(),
|
||||
tier: getWAHAVersion(),
|
||||
browser: getBrowserExecutablePath(),
|
||||
|
||||
Reference in new issue
Block a user