[core] waha

This commit is contained in:
devlikepro committed 2024-06-04 12:54:03 +07:00
1 parent e8bc59ff9e
commit 85707508ed
13 files changed
+110 -111

No files matched your search

+2 -2
View File
@@ -23,8 +23,8 @@ assignees: ''
```
> You can get the WAHA version by calling `GET /api/version` Try to update to
> [the latest version](https://github.com/devlikeapro/whatsapp-http-api/releases)
> before creating an issue!
> [the latest version](https://github.com/devlikeapro/waha/releases) before
> creating an issue!
**To Reproduce** Steps to reproduce the behavior:
+1 -1
View File
@@ -3,7 +3,7 @@
#
OWNER=devlikeapro
REPO=whatsapp-http-api-plus
REPO=waha-plus
# list workflows
gh api -X GET /repos/$OWNER/$REPO/actions/workflows | jq '.workflows[] | .name,.id'
+1 -1
View File
@@ -29,7 +29,7 @@ RUN yarn build && find ./dist -name "*.d.ts" -delete
FROM node:${NODE_VERSION} as release
ENV PUPPETEER_SKIP_DOWNLOAD=True
# Quick fix for memory potential memory leaks
# https://github.com/devlikeapro/whatsapp-http-api/issues/347
# https://github.com/devlikeapro/waha/issues/347
ENV NODE_OPTIONS="--max-old-space-size=16384"
ARG USE_BROWSER=chromium
+7 -7
View File
@@ -1,32 +1,32 @@
build:
docker build . -t devlikeapro/whatsapp-http-api
docker build . -t devlikeapro/waha
build-chrome:
docker build . -t devlikeapro/whatsapp-http-api-plus:chrome --build-arg USE_BROWSER=chrome
docker build . -t devlikeapro/waha-plus:chrome --build-arg USE_BROWSER=chrome
build-noweb:
docker build . -t devlikeapro/whatsapp-http-api:noweb --build-arg USE_BROWSER=none
docker build . -t devlikeapro/waha:noweb --build-arg USE_BROWSER=none
build-all: build build-chrome build-noweb
build-plus:
docker build . -t devlikeapro/whatsapp-http-api-plus
docker build . -t devlikeapro/waha-plus
build-ssh:
# check IMAGE provided
@[ "${IMAGE}" ] || ( echo "Add APP: make build-ssh image=devlikeapro/whatsapp-http-api"; exit 1 );
@[ "${IMAGE}" ] || ( echo "Add APP: make build-ssh image=devlikeapro/waha"; exit 1 );
eval $(ssh-agent) && \
ssh-add ~/.ssh/id_rsa && \
docker buildx build --ssh default=${SSH_AUTH_SOCK} . -t ${IMAGE} --build-arg USE_BROWSER=none
stop:
docker stop whatsapp-http-api
docker stop waha
clean: stop
sudo rm -rf .sessions
push:
docker push devlikeapro/whatsapp-http-api
docker push devlikeapro/waha
for-swagger:
WHATSAPP_SWAGGER_CONFIG_ADVANCED=true npm run start
+4 -4
View File
@@ -6,7 +6,7 @@
**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!
[![Docker Pulls](https://img.shields.io/docker/pulls/devlikeapro/whatsapp-http-api)](https://hub.docker.com/r/devlikeapro/whatsapp-http-api)
[![Docker Pulls](https://img.shields.io/docker/pulls/devlikeapro/waha)](https://hub.docker.com/r/devlikeapro/waha)
- Documentation: [https://waha.devlike.pro/](https://waha.devlike.pro/)
- Swagger Example: [https://waha.devlike.pro/swagger](https://waha.devlike.pro/swagger)
@@ -104,13 +104,13 @@ Assuming you have installed [Docker](https://docs.docker.com/get-docker/), let's
```bash
docker pull devlikeapro/whatsapp-http-api
docker pull devlikeapro/waha
```
```bash
docker login -u devlikeapro -p {KEY}
docker pull devlikeapro/whatsapp-http-api-plus
docker pull devlikeapro/waha-plus
docker logout
```
@@ -121,7 +121,7 @@ Read more about how to get `PASSWORD` for [Plus Version →]({{< relref "plus-ve
Run WhatsApp HTTP API:
```bash
docker run -it --rm -p 3000:3000/tcp --name whatsapp-http-api devlikeapro/whatsapp-http-api
docker run -it --rm -p 3000:3000/tcp --name waha devlikeapro/waha
# It prints logs and the last line must be
# WhatsApp HTTP API is running on: http://[::1]:3000
+9 -9
View File
@@ -1,10 +1,10 @@
version: '3'
services:
whatsapp-http-api:
waha:
# Check available Docker images:
# https://waha.devlike.pro/docs/how-to/engines/#docker-images
image: devlikeapro/whatsapp-http-api
container_name: whatsapp-http-api
image: devlikeapro/waha
container_name: waha
ports:
- '3000:3000/tcp'
environment:
@@ -14,11 +14,11 @@ services:
- WHATSAPP_DEFAULT_ENGINE=WEBJS
restart: always
whatsapp-http-api-plus:
waha-plus:
# Check available Docker images:
# https://waha.devlike.pro/docs/how-to/engines/#docker-images
image: devlikeapro/whatsapp-http-api-plus:chrome
container_name: whatsapp-http-api-plus
image: devlikeapro/waha-plus:chrome
container_name: waha-plus
ports:
- '3000:3000/tcp'
volumes:
@@ -43,11 +43,11 @@ services:
# - WAHA_WEBJS_WEB_VERSION=2.2412.54-videofix
restart: always
whatsapp-http-api-plus--mongodb:
waha-plus--mongodb:
# Check available Docker images:
# https://waha.devlike.pro/docs/how-to/engines/#docker-images
image: devlikeapro/whatsapp-http-api-plus:chrome
container_name: whatsapp-http-api-plus--mongodb
image: devlikeapro/waha-plus:chrome
container_name: waha-plus--mongodb
ports:
- '3000:3000/tcp'
volumes:
+12 -12
View File
@@ -19,9 +19,9 @@ Download and start WhatsApp HTTP API docker container
```bash
# Download the image
docker pull devlikeapro/whatsapp-http-api
docker pull devlikeapro/waha
# Run the docker container
docker run -it --rm --network=host -e WHATSAPP_HOOK_URL=http://localhost:5000/bot -e "WHATSAPP_HOOK_EVENTS=*" --name whatsapp-http-api devlikeapro/whatsapp-http-api
docker run -it --rm --network=host -e WHATSAPP_HOOK_URL=http://localhost:5000/bot -e "WHATSAPP_HOOK_EVENTS=*" --name waha devlikeapro/waha
# It prints logs and the last line must be
# WhatsApp HTTP API is running on: http://[::1]:3000
@@ -36,11 +36,11 @@ commands to download the image
```bash
# Download the image
docker pull devlikeapro/whatsapp-http-api:arm
# Rename it, so you can use devlikeapro/whatsapp-http-api image in other place
docker tag devlikeapro/whatsapp-http-api:arm devlikeapro/whatsapp-http-api
docker pull devlikeapro/waha:arm
# Rename it, so you can use devlikeapro/waha image in other place
docker tag devlikeapro/waha:arm devlikeapro/waha
# Run the docker container
docker run -it --rm --network=host -e WHATSAPP_HOOK_URL=http://localhost:5000/bot -e "WHATSAPP_HOOK_EVENTS=*" --name whatsapp-http-api devlikeapro/whatsapp-http-api
docker run -it --rm --network=host -e WHATSAPP_HOOK_URL=http://localhost:5000/bot -e "WHATSAPP_HOOK_EVENTS=*" --name waha devlikeapro/waha
# It prints logs and the last line must be
# WhatsApp HTTP API is running on: http://[::1]:3000
@@ -79,9 +79,9 @@ set up webhooks and reply to incoming messages.
```bash
# Clone the git repository with example
git clone https://github.com/devlikeapro/whatsapp-http-api.git
git clone https://github.com/devlikeapro/waha.git
# Open python example folder
cd whatsapp-http-api/examples/python
cd waha/examples/python
# Install requirements
python -mpip install -r requirements.txt
# Run the bot
@@ -106,18 +106,18 @@ Download **WAHA Plus** version:
```bash
# Download the image
docker pull devlikeapro/whatsapp-http-api-plus
docker pull devlikeapro/waha-plus
# Run the docker container
docker run -it --rm --network=host -e WHATSAPP_HOOK_URL=http://localhost:5000/bot -e "WHATSAPP_HOOK_EVENTS=*" --name whatsapp-http-api devlikeapro/whatsapp-http-api-plus
docker run -it --rm --network=host -e WHATSAPP_HOOK_URL=http://localhost:5000/bot -e "WHATSAPP_HOOK_EVENTS=*" --name waha devlikeapro/waha-plus
```
Run the WhatsApp Download Files bot:
```bash
# Clone the git repository with example
git clone https://github.com/devlikeapro/whatsapp-http-api.git
git clone https://github.com/devlikeapro/waha.git
# Open python example folder
cd whatsapp-http-api/examples/python
cd waha/examples/python
# Install requirements
python -mpip install -r requirements.txt
# Run the bot
+1 -1
View File
@@ -1,5 +1,5 @@
{
"name": "whatsapp-http-api",
"name": "waha",
"version": "0.0.1",
"description": "",
"author": "",
+1 -1
View File
@@ -31,7 +31,7 @@ export class AllExceptionsFilter implements ExceptionFilter {
/**
* If file not found - we get weird 500 error
* So we convert that exception manually to 404 and send appropriate JSON response
* @issue https://github.com/devlikeapro/whatsapp-http-api/issues/134
* @issue https://github.com/devlikeapro/waha/issues/134
* @solution https://github.com/nestjs/serve-static/issues/139#issuecomment-612429557
*/
if (exception.code === 'ENOENT') {
+2 -2
View File
@@ -21,8 +21,8 @@ export class SwaggerConfiguratorCore {
'<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
'<li><a href="https://github.com/devlikeapro/waha" target="_blank">GitHub - WAHA Core</a></li>' +
'<li><a href="https://github.com/devlikeapro/waha-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>' +
+1 -1
View File
@@ -804,7 +804,7 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
let body = message.message.conversation;
if (!body) {
// Some of the messages have no conversation, but instead have text in extendedTextMessage
// https://github.com/devlikeapro/whatsapp-http-api/issues/90
// https://github.com/devlikeapro/waha/issues/90
body = message.message.extendedTextMessage?.text;
}
if (!body) {
+3 -4
View File
@@ -20,7 +20,7 @@ export class RemoteFile {
@ApiProperty({
example:
'https://github.com/devlikeapro/whatsapp-http-api/raw/core/examples/dev.likeapro.jpg',
'https://github.com/devlikeapro/waha/raw/core/examples/dev.likeapro.jpg',
})
url: string;
}
@@ -73,7 +73,7 @@ export class VoiceRemoteFile {
@ApiProperty({
example:
'https://github.com/devlikeapro/whatsapp-http-api/raw/core/examples/dev.likeapro.opus',
'https://github.com/devlikeapro/waha/raw/core/examples/dev.likeapro.opus',
})
url: string;
}
@@ -109,8 +109,7 @@ export class VideoRemoteFile {
filename = 'video.mp4';
@ApiProperty({
example:
'https://github.com/devlikeapro/whatsapp-http-api/raw/core/examples/video.mp4',
example: 'https://github.com/devlikeapro/waha/raw/core/examples/video.mp4',
})
url: string;
}
+66 -66
View File
@@ -12433,6 +12433,72 @@ __metadata:
languageName: node
linkType: hard
"waha@workspace:.":
version: 0.0.0-use.local
resolution: "waha@workspace:."
dependencies:
"@adiwajshing/baileys": "github:WhiskeySockets/Baileys"
"@adiwajshing/keyed-db": ^0.2.4
"@nestjs/axios": ^3.0.2
"@nestjs/cli": ^9.0.0
"@nestjs/common": ^9.0.9
"@nestjs/config": ^0.5.0
"@nestjs/core": ^9.0.9
"@nestjs/passport": ^9.0.0
"@nestjs/platform-express": ^9.0.9
"@nestjs/schematics": ^9.0.1
"@nestjs/serve-static": ^2.1.3
"@nestjs/swagger": ^7.1.11
"@nestjs/terminus": ^10.2.3
"@nestjs/testing": ^9.0.9
"@types/express": ^4.17.3
"@types/jest": 26.0.10
"@types/lodash": ^4.14.194
"@types/node": ^18.14.2
"@types/supertest": ^2.0.8
"@types/ws": ^8.5.4
"@typescript-eslint/eslint-plugin": 3.9.1
"@typescript-eslint/parser": 3.9.1
async-lock: ^1.4.1
check-disk-space: ^3.4.0
class-validator: ^0.12.2
del: ^6.0.0
eslint: 7.7.0
eslint-config-prettier: ^6.10.0
eslint-plugin-import: ^2.20.1
eslint-plugin-simple-import-sort: ^10.0.0
express-basic-auth: ^1.2.1
file-type: 16.5.4
https-proxy-agent: ^7.0.0
jest: ^29.7.0
libphonenumber-js: ^1.10.36
link-preview-js: ^3.0.4
lodash: ^4.17.21
mime-types: ^2.1.27
mongodb: ^6.3.0
passport: ^0.6.0
passport-headerapikey: ^1.2.2
prettier: ^1.19.1
puppeteer: ^21.0.0
qrcode: ^1.5.1
qrcode-terminal: ^0.12.0
reflect-metadata: ^0.1.13
request: ^2.88.2
requestretry: ^4.1.1
rimraf: ^3.0.2
rxjs: ^7.1.0
supertest: ^4.0.2
swagger-ui-express: ^4.1.4
ts-jest: ^29.1.3
ts-loader: ^6.2.1
ts-node: ^10.9.1
tsconfig-paths: ^4.1.0
typescript: ^4.8.4
venom-bot: 5.0.1
whatsapp-web.js: "https://github.com/devlikeapro/whatsapp-web.js#main-fork-update"
languageName: unknown
linkType: soft
"walker@npm:^1.0.8":
version: 1.0.8
resolution: "walker@npm:1.0.8"
@@ -12526,72 +12592,6 @@ __metadata:
languageName: node
linkType: hard
"whatsapp-http-api@workspace:.":
version: 0.0.0-use.local
resolution: "whatsapp-http-api@workspace:."
dependencies:
"@adiwajshing/baileys": "github:WhiskeySockets/Baileys"
"@adiwajshing/keyed-db": ^0.2.4
"@nestjs/axios": ^3.0.2
"@nestjs/cli": ^9.0.0
"@nestjs/common": ^9.0.9
"@nestjs/config": ^0.5.0
"@nestjs/core": ^9.0.9
"@nestjs/passport": ^9.0.0
"@nestjs/platform-express": ^9.0.9
"@nestjs/schematics": ^9.0.1
"@nestjs/serve-static": ^2.1.3
"@nestjs/swagger": ^7.1.11
"@nestjs/terminus": ^10.2.3
"@nestjs/testing": ^9.0.9
"@types/express": ^4.17.3
"@types/jest": 26.0.10
"@types/lodash": ^4.14.194
"@types/node": ^18.14.2
"@types/supertest": ^2.0.8
"@types/ws": ^8.5.4
"@typescript-eslint/eslint-plugin": 3.9.1
"@typescript-eslint/parser": 3.9.1
async-lock: ^1.4.1
check-disk-space: ^3.4.0
class-validator: ^0.12.2
del: ^6.0.0
eslint: 7.7.0
eslint-config-prettier: ^6.10.0
eslint-plugin-import: ^2.20.1
eslint-plugin-simple-import-sort: ^10.0.0
express-basic-auth: ^1.2.1
file-type: 16.5.4
https-proxy-agent: ^7.0.0
jest: ^29.7.0
libphonenumber-js: ^1.10.36
link-preview-js: ^3.0.4
lodash: ^4.17.21
mime-types: ^2.1.27
mongodb: ^6.3.0
passport: ^0.6.0
passport-headerapikey: ^1.2.2
prettier: ^1.19.1
puppeteer: ^21.0.0
qrcode: ^1.5.1
qrcode-terminal: ^0.12.0
reflect-metadata: ^0.1.13
request: ^2.88.2
requestretry: ^4.1.1
rimraf: ^3.0.2
rxjs: ^7.1.0
supertest: ^4.0.2
swagger-ui-express: ^4.1.4
ts-jest: ^29.1.3
ts-loader: ^6.2.1
ts-node: ^10.9.1
tsconfig-paths: ^4.1.0
typescript: ^4.8.4
venom-bot: 5.0.1
whatsapp-web.js: "https://github.com/devlikeapro/whatsapp-web.js#main-fork-update"
languageName: unknown
linkType: soft
"whatsapp-web.js@https://github.com/devlikeapro/whatsapp-web.js#main-fork-update":
version: 1.23.1-alpha.6
resolution: "whatsapp-web.js@https://github.com/devlikeapro/whatsapp-web.js.git#commit=d6eff450edf3e8d292cf70eb4243fd32ace61182"