Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
81f9df000a | ||
|
|
0dcb31c108 | ||
|
|
cd4140fda9 | ||
|
|
117cc25cdb | ||
|
|
832ad26151 | ||
|
|
5a344cd8ad | ||
|
|
0b0a67cdad | ||
|
|
a326a240f0 | ||
|
|
dfdb033769 | ||
|
|
a31af45d97 | ||
|
|
cae955c483 | ||
|
|
0bfff5259e | ||
|
|
0fa83e603b | ||
|
|
906b03804f | ||
|
|
1ed7a61bea | ||
|
|
ad6ae7ab05 | ||
|
|
5e2de1d47d | ||
|
|
591ca51104 | ||
|
|
b210841158 | ||
|
|
a223a3985b | ||
|
|
8baa6a73cd | ||
|
|
508efac2ea | ||
|
|
b6eed9e228 | ||
|
|
b62cad07f0 | ||
|
|
6d552d27ac | ||
|
|
39d0f2a060 | ||
|
|
0b03abee91 | ||
|
|
b4fb69d0ee | ||
|
|
5b9ed029b3 | ||
|
|
c29397371b | ||
|
|
fe47e27788 | ||
|
|
a14c702c79 | ||
|
|
fe4246036d | ||
|
|
074063b814 | ||
|
|
0271a8b721 | ||
|
|
08617383be | ||
|
|
3840459b0a | ||
|
|
aee7ac28bc | ||
|
|
9e6cd39b2d | ||
|
|
8898429046 | ||
|
|
a74def6dbd | ||
|
|
9f783cd35e | ||
|
|
9d2f061d81 | ||
|
|
a6045b2d54 | ||
|
|
6142b2b564 | ||
|
|
ed53ccb919 | ||
|
|
1ab45c6cfd | ||
|
|
c2fdb090e1 | ||
|
|
a10b47eb7e | ||
|
|
7b234e2e37 | ||
|
|
90d45a4698 | ||
|
|
5e40b70e19 | ||
|
|
a27d0c3efb | ||
|
|
46ed506b35 | ||
|
|
0ad813a1fe | ||
|
|
e57e42f47a | ||
|
|
cc58157d37 | ||
|
|
9b5bb0a339 | ||
|
|
84ebbea287 | ||
|
|
1c2021f54b | ||
|
|
98a7f00d7d | ||
|
|
60d97d0e67 | ||
|
|
03f4a07cbe | ||
|
|
3fbe526793 | ||
|
|
a892f03382 | ||
|
|
8db69f6e69 | ||
|
|
f9037ff9fc | ||
|
|
366ddffa2b | ||
|
|
b8468588de | ||
|
|
62dd6f7f4a | ||
|
|
858202f1bb | ||
|
|
db7900dc26 | ||
|
|
aa87e437dc | ||
|
|
741e5e86f8 | ||
|
|
390a171891 | ||
|
|
1fc5e2b47c | ||
|
|
8926dc7cc6 | ||
|
|
5c3d3c0d70 | ||
|
|
41b29cbf60 | ||
|
|
44463c199a | ||
|
|
9071adcdcc | ||
|
|
21cd92ca13 | ||
|
|
d8a3e8dc43 | ||
|
|
3f5707952c | ||
|
|
38a9590be0 | ||
|
|
a7ce117b87 | ||
|
|
c3b24a243c | ||
|
|
cb2c11df43 | ||
|
|
98f88dcf68 | ||
|
|
9fb12e0e23 | ||
|
|
0ca106f16b | ||
|
|
33210c6374 | ||
|
|
045ab67f5d | ||
|
|
19259c93ea | ||
|
|
9b6784a018 | ||
|
|
2fe3706e9c | ||
|
|
a4e310a7f8 | ||
|
|
802da9f3b2 | ||
|
|
0692979b19 | ||
|
|
fb8b146bc4 | ||
|
|
fdbaa43ec9 | ||
|
|
4a807530c1 | ||
|
|
84784faa1e | ||
|
|
bd40978dee | ||
|
|
d4d94ffe0e | ||
|
|
d984382a33 | ||
|
|
02d05812d2 | ||
|
|
1dbf568bac | ||
|
|
6bc3aed348 | ||
|
|
c1e8e0f09c | ||
|
|
8f8bcfc474 | ||
|
|
b386df982d | ||
|
|
fa846ddf9b | ||
|
|
16685ed8ea | ||
|
|
4addccbd55 | ||
|
|
e9a20c4326 | ||
|
|
f073aeef13 | ||
|
|
eb08739eea | ||
|
|
aff3b01e39 | ||
|
|
2d64b26e86 | ||
|
|
7b7bd02503 | ||
|
|
7904516c97 | ||
|
|
6e0bafdd89 | ||
|
|
2b1e605e5f | ||
|
|
f454310a09 | ||
|
|
b6579b5b96 | ||
|
|
4ef06d7b92 | ||
|
|
e0c594a71b | ||
|
|
a48d386d8b | ||
|
|
d592858a90 | ||
|
|
a3cb3e983a | ||
|
|
4eb9029b2c | ||
|
|
b3835b0aa0 | ||
|
|
b2db58a922 | ||
|
|
acb6b8e0d3 | ||
|
|
21c6e1e860 | ||
|
|
571b65c423 | ||
|
|
1631a62abe | ||
|
|
e88a7ca8ce | ||
|
|
d54f64a9cc | ||
|
|
03dbd5db82 | ||
|
|
2446c292bf | ||
|
|
5ab99dfd69 | ||
|
|
605f46fda8 | ||
|
|
e53f1eafe8 | ||
|
|
1457185e84 | ||
|
|
ad43bec18d | ||
|
|
c0a4b223ea | ||
|
|
65917e1957 | ||
|
|
a19cede60d | ||
|
|
a3ead95ea4 | ||
|
|
c46bc1b923 | ||
|
|
b327212cbe | ||
|
|
4f348c7e48 | ||
|
|
f2d0001b11 | ||
|
|
66a224a0e3 | ||
|
|
1fa1206568 | ||
|
|
87eea28ac2 | ||
|
|
29ca0217b3 | ||
|
|
306f75ff3b | ||
|
|
6ecb203570 | ||
|
|
2e7a3a6b61 | ||
|
|
86bc4a92ba | ||
|
|
f652277e18 | ||
|
|
14a3535439 | ||
|
|
edce7424de | ||
|
|
0fa121bbe2 | ||
|
|
9c046a92be | ||
|
|
e4506e14da | ||
|
|
515a00346c | ||
|
|
399e27e24e | ||
|
|
9413376138 | ||
|
|
3caec14783 | ||
|
|
6e427a0a34 | ||
|
|
40c5e95d93 | ||
|
|
ab70e27266 | ||
|
|
301b6f57d3 | ||
|
|
4c9f5ed907 | ||
|
|
04d65150ed | ||
|
|
d29165c9a5 | ||
|
|
30db175d52 | ||
|
|
5c666c0dd4 | ||
|
|
3ccc0469c0 | ||
|
|
5ab3244d6a | ||
|
|
05bc8abbee | ||
|
|
8e9056a0cd | ||
|
|
ea75b357a7 | ||
|
|
2b607e9b44 | ||
|
|
57d3528a96 | ||
|
|
660a04aa52 | ||
|
|
d0a408001d | ||
|
|
48391533a6 | ||
|
|
f2113adbbc | ||
|
|
abfcbc7397 | ||
|
|
96f2982325 | ||
|
|
3a521bc06c | ||
|
|
6fbaec0083 | ||
|
|
cae94c7b5c | ||
|
|
bce012f692 | ||
|
|
b23b639a8b | ||
|
|
5a628907ed | ||
|
|
6da479c0d7 | ||
|
|
cbb321df6d | ||
|
|
0a7beb6909 | ||
|
|
2105094ac3 | ||
|
|
d8fee686f8 | ||
|
|
75fc1fd7e0 | ||
|
|
e718652491 | ||
|
|
bcb49f2be7 | ||
|
|
dab63e4060 | ||
|
|
3fdacbb6ac | ||
|
|
f02b62e620 | ||
|
|
51acce14a0 | ||
|
|
b63f6ac39e | ||
|
|
9e107a8a76 | ||
|
|
8c083242d3 | ||
|
|
2a068d561f | ||
|
|
ef96fbf8c5 | ||
|
|
2c381a0b9c | ||
|
|
fef2bcb6e2 | ||
|
|
2f6ed2fb58 | ||
|
|
4eb23d2c09 | ||
|
|
ec3de8dbcf | ||
|
|
f6f09747dc | ||
|
|
27a534a605 | ||
|
|
3cbd940843 | ||
|
|
e728eec01a | ||
|
|
d06d2b78a8 | ||
|
|
5878a9196e | ||
|
|
85dd061f96 | ||
|
|
8381c3e946 | ||
|
|
6ff8a9705d | ||
|
|
fb5819b966 | ||
|
|
5cc1af3f82 | ||
|
|
c279de694c | ||
|
|
f7a1787f1f | ||
|
|
5442fd6e93 | ||
|
|
b8c8ca7653 | ||
|
|
5ca7dbc84b | ||
|
|
d836c9706f | ||
|
|
318be43a4f | ||
|
|
95bebce731 | ||
|
|
27b8c9d058 | ||
|
|
10d4d24526 | ||
|
|
b19917bd3d | ||
|
|
4b6774b1db | ||
|
|
360e0a7951 | ||
|
|
171f516eee | ||
|
|
01943f6970 | ||
|
|
953d48ee1f | ||
|
|
2b6028bcb1 | ||
|
|
79b7b7d2a2 | ||
|
|
93a6a7b87f | ||
|
|
3b499d6af5 | ||
|
|
6481919597 | ||
|
|
228f6ec8c5 | ||
|
|
6723f201b7 | ||
|
|
c250bb49f0 | ||
|
|
3b607662e5 | ||
|
|
f2d7041cb0 | ||
|
|
afc06794c2 | ||
|
|
33eaafcff1 | ||
|
|
e5a8743b9a | ||
|
|
3322c4e2a5 | ||
|
|
aa39aaf489 | ||
|
|
a238581f44 | ||
|
|
00814ef64e | ||
|
|
6362d2966b | ||
|
|
4e181a82b6 | ||
|
|
374199905d | ||
|
|
642079ab1f | ||
|
|
215c9d96b9 | ||
|
|
5369eda705 | ||
|
|
5e42bbe1eb | ||
|
|
79dd2ee03e | ||
|
|
78d3eae44b | ||
|
|
a9ee68fe1a | ||
|
|
ee5678ccfb | ||
|
|
248a675c1a | ||
|
|
6b1d84cf38 | ||
|
|
c0977538ff | ||
|
|
c8727e8b2f | ||
|
|
55a41e19f4 | ||
|
|
6096c0b158 | ||
|
|
161c6dfd95 | ||
|
|
078bcf7652 | ||
|
|
57c6df3970 | ||
|
|
1130ee1b21 | ||
|
|
c9c0a29740 | ||
|
|
e60d972bff | ||
|
|
3c4a139f52 | ||
|
|
bf615efa96 | ||
|
|
2af3940be7 | ||
|
|
64e145909e | ||
|
|
e90f34cc96 | ||
|
|
a23cf2dd26 | ||
|
|
7b623d0faa | ||
|
|
14788b1d53 | ||
|
|
e1bf8cf735 | ||
|
|
2117731b46 | ||
|
|
74f8fe1caf | ||
|
|
9388a3b277 | ||
|
|
13e7a05e1b | ||
|
|
885fa25c0c | ||
|
|
966b35094f | ||
|
|
65607bf3b3 | ||
|
|
5fcba7a7db | ||
|
|
f9ec3cb753 | ||
|
|
bf6ffd65a9 | ||
|
|
d680b6b43a | ||
|
|
3ead3a0ba3 | ||
|
|
4c5c977310 | ||
|
|
89a9ce87da | ||
|
|
52e469f6ac | ||
|
|
4f275de8d4 | ||
|
|
d9de41e350 | ||
|
|
a4c279ba25 | ||
|
|
e68282a9e4 | ||
|
|
8613206c3a | ||
|
|
31b8cde8bf | ||
|
|
2f2f9520db | ||
|
|
2501ae836e | ||
|
|
2c8bf91e77 | ||
|
|
0ac063498e | ||
|
|
2bf672f0cd | ||
|
|
ca209adca0 | ||
|
|
dd10c82c5e | ||
|
|
c3ad2a0931 | ||
|
|
30aacc8946 | ||
|
|
723a644937 | ||
|
|
165eeb5bf2 | ||
|
|
f1776d4a26 | ||
|
|
2f2a1b3182 | ||
|
|
0477cf7db5 | ||
|
|
2d7c7986aa | ||
|
|
bf84ea8fca | ||
|
|
f3ef8a7f96 | ||
|
|
ec214f610a | ||
|
|
013fd46722 | ||
|
|
32d583b9ef | ||
|
|
df6e201ba5 | ||
|
|
789b613b82 | ||
|
|
b698342db4 | ||
|
|
d853f2fe99 | ||
|
|
20d66b5b31 | ||
|
|
da7264c5e8 | ||
|
|
f3299f78d9 | ||
|
|
7ef0805c91 | ||
|
|
ba1afa2569 | ||
|
|
936e2d0863 | ||
|
|
166410f66a |
No files matched your search
@@ -1,5 +1,5 @@
|
||||
Dockerfile
|
||||
.sessions
|
||||
.*sessions
|
||||
files
|
||||
venv
|
||||
.wwebjs_auth
|
||||
@@ -11,6 +11,7 @@ examples
|
||||
# compiled output
|
||||
/dist
|
||||
/node_modules
|
||||
.yarn
|
||||
|
||||
# Logs
|
||||
logs
|
||||
|
||||
@@ -1,27 +1,36 @@
|
||||
module.exports = {
|
||||
parser: '@typescript-eslint/parser',
|
||||
parserOptions: {
|
||||
project: 'tsconfig.json',
|
||||
sourceType: 'module',
|
||||
},
|
||||
plugins: ['@typescript-eslint/eslint-plugin'],
|
||||
extends: [
|
||||
'plugin:@typescript-eslint/eslint-recommended',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'prettier',
|
||||
'prettier/@typescript-eslint',
|
||||
parser: '@typescript-eslint/parser',
|
||||
parserOptions: {
|
||||
project: 'tsconfig.json',
|
||||
sourceType: 'module',
|
||||
},
|
||||
plugins: ['@typescript-eslint/eslint-plugin', 'simple-import-sort'],
|
||||
extends: [
|
||||
'plugin:@typescript-eslint/eslint-recommended',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'prettier',
|
||||
'prettier/@typescript-eslint',
|
||||
],
|
||||
root: true,
|
||||
env: {
|
||||
node: true,
|
||||
jest: true,
|
||||
},
|
||||
rules: {
|
||||
'simple-import-sort/imports': 'error',
|
||||
'simple-import-sort/exports': 'error',
|
||||
'@typescript-eslint/interface-name-prefix': 'off',
|
||||
'@typescript-eslint/explicit-function-return-type': 'off',
|
||||
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
||||
'@typescript-eslint/no-inferrable-types': 'off',
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'@typescript-eslint/ban-ts-ignore': 'off',
|
||||
'@typescript-eslint/ban-ts-comment': 'off',
|
||||
'@typescript-eslint/no-unused-vars': 'off',
|
||||
'lines-between-class-members': [
|
||||
'error',
|
||||
'always',
|
||||
{ exceptAfterSingleLine: true },
|
||||
],
|
||||
root: true,
|
||||
env: {
|
||||
node: true,
|
||||
jest: true,
|
||||
},
|
||||
rules: {
|
||||
'@typescript-eslint/interface-name-prefix': 'off',
|
||||
'@typescript-eslint/explicit-function-return-type': 'off',
|
||||
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
"@typescript-eslint/ban-ts-ignore": "off",
|
||||
"@typescript-eslint/ban-ts-comment": "off"
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,61 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: '[BUG][WEBJS] - '
|
||||
labels: bug
|
||||
assignees: ''
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
|
||||
> A clear and concise description of what the bug is. Feel free to remove
|
||||
> sections that you don't feel to make the text shorter!
|
||||
|
||||
**Version**
|
||||
|
||||
```json
|
||||
{
|
||||
"version": "2023.11.1",
|
||||
"engine": "NOWEB",
|
||||
"tier": "PLUS",
|
||||
"browser": "/usr/bin/google-chrome-stable"
|
||||
}
|
||||
```
|
||||
|
||||
> 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!
|
||||
|
||||
**To Reproduce** Steps to reproduce the behavior:
|
||||
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
|
||||
> A clear and concise description of what you expected to happen.
|
||||
|
||||
**Engine** I'm using **WEBJS** engine.
|
||||
|
||||
> If you set `WHATSAPP_DEFAULT_ENGINE` explicitly to
|
||||
> [one of the engine](https://waha.devlike.pro/docs/how-to/engines/) - please
|
||||
> provide that information here and in the issue title.
|
||||
|
||||
**Requests - Responses**
|
||||
|
||||
> Please attach all sent requests, responses that you sent.
|
||||
|
||||
**Docker Logs**
|
||||
|
||||
> Collect and attach related docker logs if you have any
|
||||
> https://waha.devlike.pro/docs/how-to/deploy/#viewing-the-logs
|
||||
|
||||
**Screenshots**
|
||||
|
||||
> If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Additional context**
|
||||
|
||||
> Add any other context about the problem here.
|
||||
@@ -0,0 +1,24 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: '[Feature Request]'
|
||||
labels: ''
|
||||
assignees: ''
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.** I'm always
|
||||
frustrated when [...]
|
||||
|
||||
> A clear and concise description of what the problem is. Ex.
|
||||
|
||||
**Describe the solution you'd like**
|
||||
|
||||
> A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
|
||||
> A clear and concise description of any alternative solutions or features
|
||||
> you've considered.
|
||||
|
||||
**Additional context** Add any other context or screenshots about the feature
|
||||
request here.
|
||||
@@ -0,0 +1,18 @@
|
||||
# Idea from
|
||||
# https://stackoverflow.com/a/65539398/6753144
|
||||
#
|
||||
|
||||
OWNER=devlikeapro
|
||||
REPO=whatsapp-http-api-plus
|
||||
|
||||
# list workflows
|
||||
gh api -X GET /repos/$OWNER/$REPO/actions/workflows | jq '.workflows[] | .name,.id'
|
||||
|
||||
# copy the ID of the workflow you want to clear and set it
|
||||
WORKFLOW_ID=40218610
|
||||
|
||||
# list runs
|
||||
gh api -X GET /repos/$OWNER/$REPO/actions/workflows/$WORKFLOW_ID/runs --paginate | jq '.workflow_runs[] | .id'
|
||||
|
||||
# delete runs
|
||||
gh api -X GET /repos/$OWNER/$REPO/actions/workflows/$WORKFLOW_ID/runs --paginate | jq '.workflow_runs[] | .id' | xargs -I{} gh api -X DELETE /repos/$OWNER/$REPO/actions/runs/{} --silent
|
||||
@@ -0,0 +1,15 @@
|
||||
ignore:
|
||||
teams:
|
||||
- no-labels
|
||||
users:
|
||||
- allburov
|
||||
teamLabels:
|
||||
- team: waha-patrons-pro
|
||||
label: patron:PRO
|
||||
comment: '[](https://waha.devlike.pro/docs/how-to/plus-version/#tiers)'
|
||||
- team: waha-patrons-advanced
|
||||
label: patron:ADVANCED
|
||||
comment: '[](https://waha.devlike.pro/docs/how-to/plus-version/#tiers)'
|
||||
- team: waha-patrons-plus
|
||||
label: patron:PLUS
|
||||
comment: '[](https://waha.devlike.pro/docs/how-to/plus-version/#tiers)'
|
||||
@@ -3,16 +3,47 @@ name: Release
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "*"
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
deploy-docker:
|
||||
runs-on: ubuntu-latest
|
||||
docker-build:
|
||||
runs-on: ${{ matrix.runner }}
|
||||
name: ${{ matrix.platform }} - ${{ matrix.browser }} - ${{ matrix.tag }}
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
# Chromium
|
||||
- runner: 'buildjet-4vcpu-ubuntu-2204'
|
||||
tag: 'latest'
|
||||
platform: 'amd64'
|
||||
browser: 'chromium'
|
||||
- runner: 'buildjet-4vcpu-ubuntu-2204-arm'
|
||||
tag: 'arm'
|
||||
platform: 'linux/arm64'
|
||||
browser: 'chromium'
|
||||
# Chrome
|
||||
- runner: 'buildjet-4vcpu-ubuntu-2204'
|
||||
tag: 'chrome'
|
||||
platform: 'amd64'
|
||||
browser: 'chrome'
|
||||
# Chrome is not supported on arm64
|
||||
# - runner: "buildjet-4vcpu-ubuntu-2204-arm"
|
||||
# tag: "chrome-arm"
|
||||
# platform: "linux/arm64"
|
||||
# browser: "chrome"
|
||||
# No browser
|
||||
- runner: 'buildjet-4vcpu-ubuntu-2204'
|
||||
tag: 'noweb'
|
||||
platform: 'amd64'
|
||||
browser: 'none'
|
||||
- runner: 'buildjet-4vcpu-ubuntu-2204-arm'
|
||||
tag: 'noweb-arm'
|
||||
platform: 'linux/arm64'
|
||||
browser: 'none'
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
@@ -21,9 +52,10 @@ jobs:
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: ${{ secrets.DOCKER_IMAGE }}
|
||||
flavor: latest=true
|
||||
flavor: latest=false
|
||||
tags: |
|
||||
type=semver,pattern={{version}}
|
||||
type=raw,value=${{ matrix.tag }}
|
||||
type=raw,value={{tag}}-${{ matrix.tag }}
|
||||
|
||||
- name: Login to image repository
|
||||
if: github.ref_type == 'tag'
|
||||
@@ -33,10 +65,13 @@ jobs:
|
||||
password: ${{ secrets.DOCKER_TOKEN }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v3
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile
|
||||
platforms: ${{ matrix.platform }}
|
||||
build-args: |
|
||||
USE_BROWSER=${{ matrix.browser }}
|
||||
push: ${{ github.ref_type == 'tag' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
@@ -31,6 +31,7 @@ jobs:
|
||||
with:
|
||||
path: docs/site/public
|
||||
name: public
|
||||
retention-days: 5
|
||||
|
||||
deploy-github-pages:
|
||||
needs: build
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
.sessions
|
||||
.yarn
|
||||
example.ts
|
||||
.*sessions
|
||||
tokens
|
||||
files
|
||||
venv
|
||||
.wwebjs_auth
|
||||
test.js
|
||||
.wwebjs_cache
|
||||
|
||||
# compiled output
|
||||
/dist
|
||||
|
||||
@@ -1,4 +1,25 @@
|
||||
repos:
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: lint
|
||||
name: lint
|
||||
language: system
|
||||
entry: bash -c '$HOME/.nvm/nvm-exec npm run lint'
|
||||
pass_filenames: false
|
||||
files: |
|
||||
(?x)^(
|
||||
src/.*|
|
||||
)$
|
||||
|
||||
- repo: https://github.com/pre-commit/mirrors-prettier
|
||||
rev: 'v3.1.0'
|
||||
hooks:
|
||||
- id: prettier
|
||||
exclude: |
|
||||
(?x)^(
|
||||
docs/.*|
|
||||
README.md|
|
||||
)$
|
||||
- repo: https://github.com/Lucas-C/pre-commit-hooks-nodejs
|
||||
rev: v1.1.2
|
||||
hooks:
|
||||
@@ -12,9 +33,9 @@ repos:
|
||||
language: pygrep
|
||||
entry: 'plus'
|
||||
files: |
|
||||
(?x)^(
|
||||
src/api/.*|
|
||||
src/core/.*|
|
||||
src/structures/.*|
|
||||
src/config.service.ts|
|
||||
)$
|
||||
(?x)^(
|
||||
src/api/.*|
|
||||
src/core/.*|
|
||||
src/structures/.*|
|
||||
src/config.service.ts|
|
||||
)$
|
||||
@@ -1,4 +1,13 @@
|
||||
{
|
||||
"singleQuote": true,
|
||||
"trailingComma": "all"
|
||||
}
|
||||
"trailingComma": "all",
|
||||
"endOfLine": "auto",
|
||||
"arrowParens": "always",
|
||||
"bracketSpacing": true,
|
||||
"useTabs": false,
|
||||
"tabWidth": 2,
|
||||
"semi": true,
|
||||
"quoteProps": "as-needed",
|
||||
"proseWrap": "always",
|
||||
"printWidth": 80
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
nodeLinker: node-modules
|
||||
|
||||
yarnPath: .yarn/releases/yarn-3.6.3.cjs
|
||||
@@ -1,2 +1,4 @@
|
||||
# Changelog
|
||||
You'll find changelog on [the changelog page](https://waha.devlike.pro/docs/help/changelog/)
|
||||
|
||||
You can find changelog on
|
||||
[the changelog page](https://waha.devlike.pro/docs/help/changelog/)
|
||||
@@ -1,33 +1,64 @@
|
||||
#
|
||||
# Build
|
||||
#
|
||||
FROM node:18 as build
|
||||
FROM node:20-bullseye as build
|
||||
ENV PUPPETEER_SKIP_DOWNLOAD=True
|
||||
|
||||
# npm packages
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y openssh-client
|
||||
RUN apt install openssh-client
|
||||
RUN mkdir -p -m 0700 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts
|
||||
|
||||
WORKDIR /src
|
||||
COPY package.json .
|
||||
COPY package-lock.json .
|
||||
RUN npm install
|
||||
COPY yarn.lock .
|
||||
RUN yarn set version 3.6.3
|
||||
RUN --mount=type=ssh yarn install
|
||||
|
||||
# App
|
||||
WORKDIR /src
|
||||
ADD . /src
|
||||
RUN npm run build && find ./dist -name "*.d.ts" -delete
|
||||
RUN --mount=type=ssh yarn install
|
||||
RUN yarn build && find ./dist -name "*.d.ts" -delete
|
||||
|
||||
#
|
||||
# Final
|
||||
#
|
||||
FROM node:18 as release
|
||||
FROM node:20-bullseye as release
|
||||
ENV PUPPETEER_SKIP_DOWNLOAD=True
|
||||
ARG USE_BROWSER=chromium
|
||||
|
||||
RUN echo "USE_BROWSER=$USE_BROWSER"
|
||||
|
||||
# Install fonts if using either chromium or chrome
|
||||
RUN if [ "$USE_BROWSER" = "chromium" ] || [ "$USE_BROWSER" = "chrome" ]; then \
|
||||
apt-get update \
|
||||
&& apt-get install -y fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf \
|
||||
--no-install-recommends \
|
||||
&& rm -rf /var/lib/apt/lists/*; \
|
||||
fi
|
||||
|
||||
# Install Chromium
|
||||
RUN if [ "$USE_BROWSER" = "chromium" ]; then \
|
||||
apt-get update \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y chromium \
|
||||
--no-install-recommends \
|
||||
&& rm -rf /var/lib/apt/lists/*; \
|
||||
fi
|
||||
|
||||
# Install Chrome
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y wget gnupg \
|
||||
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
|
||||
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf \
|
||||
--no-install-recommends \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
RUN if [ "$USE_BROWSER" = "chrome" ]; then \
|
||||
apt-get update \
|
||||
&& apt-get install -y wget gnupg \
|
||||
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
|
||||
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y google-chrome-stable \
|
||||
--no-install-recommends \
|
||||
&& rm -rf /var/lib/apt/lists/*; \
|
||||
fi
|
||||
|
||||
# Attach sources, install packages
|
||||
WORKDIR /app
|
||||
@@ -37,4 +68,4 @@ COPY --from=build /src/dist ./dist
|
||||
|
||||
# Run command, etc
|
||||
EXPOSE 3000
|
||||
CMD npm run start:prod
|
||||
CMD yarn start:prod
|
||||
@@ -1,26 +1,23 @@
|
||||
build:
|
||||
docker build . -t devlikeapro/whatsapp-http-api
|
||||
|
||||
run-webjs:
|
||||
docker run \
|
||||
--rm -d \
|
||||
-p 127.0.0.1:3000:3000/tcp \
|
||||
-v `pwd`/.sessions:/app/.sessions \
|
||||
-e WHATSAPP_HOOK_URL=https://httpbin.org/post \
|
||||
-e WHATSAPP_HOOK_EVENTS=* \
|
||||
-e WHATSAPP_API_KEY=321 \
|
||||
--name whatsapp-http-api devlikeapro/whatsapp-http-api
|
||||
build-chrome:
|
||||
docker build . -t devlikeapro/whatsapp-http-api:chrome --build-arg USE_BROWSER=chrome
|
||||
|
||||
run-venom:
|
||||
docker run \
|
||||
--rm -d \
|
||||
-p 127.0.0.1:3000:3000/tcp \
|
||||
-v `pwd`/.sessions:/app/.sessions \
|
||||
-e WHATSAPP_HOOK_URL=https://httpbin.org/post \
|
||||
-e WHATSAPP_HOOK_EVENTS=* \
|
||||
-e WHATSAPP_DEFAULT_ENGINE=VENOM \
|
||||
-e WHATSAPP_API_KEY=321 \
|
||||
--name whatsapp-http-api devlikeapro/whatsapp-http-api
|
||||
build-noweb:
|
||||
docker build . -t devlikeapro/whatsapp-http-api:noweb --build-arg USE_BROWSER=none
|
||||
|
||||
build-all: build build-chrome build-noweb
|
||||
|
||||
build-plus:
|
||||
docker build . -t devlikeapro/whatsapp-http-api-plus
|
||||
|
||||
build-ssh:
|
||||
# check IMAGE provided
|
||||
@[ "${IMAGE}" ] || ( echo "Add APP: make build-ssh image=devlikeapro/whatsapp-http-api"; 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
|
||||
@@ -31,8 +28,16 @@ clean: stop
|
||||
push:
|
||||
docker push devlikeapro/whatsapp-http-api
|
||||
|
||||
for-swagger:
|
||||
WHATSAPP_SWAGGER_CONFIG_ADVANCED=true npm run start
|
||||
|
||||
update-swagger:
|
||||
wget http://localhost:3000/-json -O ./docs/site/static/swagger/openapi.json
|
||||
|
||||
update-dependencies:
|
||||
. ${NVM_DIR}/nvm.sh && nvm exec npm install venom-bot whatsapp-web.js --save
|
||||
. ${NVM_DIR}/nvm.sh && nvm exec yarn up whatsapp-web.js@https://github.com/devlikeapro/whatsapp-web.js#main-fork
|
||||
. ${NVM_DIR}/nvm.sh && nvm exec yarn up @adiwajshing/baileys@github:WhiskeySockets/Baileys
|
||||
. ${NVM_DIR}/nvm.sh && nvm exec yarn up venom-bot
|
||||
|
||||
start-proxy:
|
||||
docker run --rm -d --name squid-container -e TZ=UTC -p 3128:3128 ubuntu/squid:5.2-22.04_beta
|
||||
@@ -18,8 +18,8 @@
|
||||
* [Sessions](#sessions)
|
||||
* [Security](#security)
|
||||
* [Updates](#updates)
|
||||
* [Groups [soon]](#groups-soon)
|
||||
* [Contacts [soon]](#contacts-soon)
|
||||
* [Groups](#groups)
|
||||
* [Contacts](#contacts)
|
||||
- [Quick start](#quick-start)
|
||||
* [Requirements](#requirements)
|
||||
* [Send your first message](#send-your-first-message)
|
||||
@@ -40,7 +40,6 @@
|
||||
- Receive messages
|
||||
- Message replies
|
||||
- Send location
|
||||
- Send buttons
|
||||
- Receive location
|
||||
- React to messages
|
||||
- Send media (images/documents/files)
|
||||
@@ -61,25 +60,21 @@
|
||||
|
||||
## Updates
|
||||
- Bug fixes and updates come as soon as they are implemented.
|
||||
- One month delay in bug fixes and updates.
|
||||
|
||||
|
||||
## Groups [soon]
|
||||
- Join groups by invite
|
||||
## Groups
|
||||
- Create a group
|
||||
- Get invite for group
|
||||
- Modify group info (subject, description)
|
||||
- Modify group settings (send messages, edit info)
|
||||
- Add group participants
|
||||
- Kick group participants
|
||||
- Promote/demote group participants
|
||||
|
||||
## Contacts [soon]
|
||||
- Mention users
|
||||
## Contacts
|
||||
- Mute/unmute chats
|
||||
- Block/unblock contacts
|
||||
- Get contact info
|
||||
- Get profile pictures
|
||||
- Set user status message
|
||||
- Get presence (online\offline\typing) status
|
||||
|
||||
# Quick start
|
||||
|
||||
@@ -114,7 +109,7 @@ docker pull devlikeapro/whatsapp-http-api
|
||||
 For Plus version, we use login to get the image before:
|
||||
|
||||
```bash
|
||||
docker login -u devlikeapro -p {PASSWORD}
|
||||
docker login -u devlikeapro -p {KEY}
|
||||
docker pull devlikeapro/whatsapp-http-api-plus
|
||||
docker logout
|
||||
```
|
||||
@@ -126,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 127.0.0.1:3000:3000/tcp --name whatsapp-http-api devlikeapro/whatsapp-http-api
|
||||
docker run -it --rm -p 3000:3000/tcp --name whatsapp-http-api devlikeapro/whatsapp-http-api
|
||||
|
||||
# It prints logs and the last line must be
|
||||
# WhatsApp HTTP API is running on: http://[::1]:3000
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
version: '3'
|
||||
services:
|
||||
whatsapp-http-api:
|
||||
image: devlikeapro/whatsapp-http-api
|
||||
container_name: whatsapp-http-api
|
||||
ports:
|
||||
- '3000:3000/tcp'
|
||||
environment:
|
||||
# Environment variables from https://waha.devlike.pro/docs/how-to/config/
|
||||
- WHATSAPP_HOOK_URL=https://httpbin.org/post
|
||||
- WHATSAPP_HOOK_EVENTS=message
|
||||
- WHATSAPP_DEFAULT_ENGINE=WEBJS
|
||||
restart: always
|
||||
|
||||
whatsapp-http-api-plus:
|
||||
image: devlikeapro/whatsapp-http-api-plus
|
||||
container_name: whatsapp-http-api-plus
|
||||
ports:
|
||||
- '3000:3000/tcp'
|
||||
volumes:
|
||||
- './.sessions:/app/.sessions'
|
||||
environment:
|
||||
# Environment variables from https://waha.devlike.pro/docs/how-to/config/
|
||||
- WHATSAPP_RESTART_ALL_SESSIONS=True
|
||||
- WHATSAPP_HOOK_URL=https://httpbin.org/post
|
||||
- WHATSAPP_HOOK_EVENTS=message
|
||||
- WHATSAPP_DEFAULT_ENGINE=WEBJS
|
||||
- WHATSAPP_API_KEY=321
|
||||
- WHATSAPP_SWAGGER_USERNAME=admin
|
||||
- WHATSAPP_SWAGGER_PASSWORD=123
|
||||
- WHATSAPP_API_HOSTNAME=localhost
|
||||
restart: always
|
||||
|
||||
mongodb:
|
||||
image: mongo
|
||||
container_name: mongodb
|
||||
ports:
|
||||
- '27017:27017/tcp'
|
||||
volumes:
|
||||
- mongodb_data:/data/db
|
||||
restart: always
|
||||
|
||||
volumes:
|
||||
mongodb_data: {}
|
||||
@@ -19,42 +19,94 @@
|
||||
|
||||
[[main]]
|
||||
name = "Documentation"
|
||||
identifier = "docs"
|
||||
url = "/docs/overview/introduction/"
|
||||
# url = "/docs/1.0/overview/introduction/"
|
||||
weight = 10
|
||||
|
||||
#[[main]]
|
||||
# name = "Blog"
|
||||
# url = "/blog/"
|
||||
# weight = 20
|
||||
[[main]]
|
||||
name = "Introduction"
|
||||
weight = 11
|
||||
url = "/docs/overview/introduction"
|
||||
parent = "docs"
|
||||
|
||||
[[main]]
|
||||
name = "Get Plus"
|
||||
weight = 30
|
||||
identifier = "get-plus"
|
||||
url = ""
|
||||
name = "Quick Start"
|
||||
weight = 12
|
||||
url = "/docs/overview/introduction"
|
||||
parent = "docs"
|
||||
|
||||
|
||||
[[main]]
|
||||
name = "Send messages"
|
||||
weight = 14
|
||||
url = "/docs/how-to/send-messages"
|
||||
parent = "docs"
|
||||
|
||||
[[main]]
|
||||
name = "Receive Messages"
|
||||
weight = 15
|
||||
url = "/docs/how-to/receive-messages"
|
||||
parent = "docs"
|
||||
|
||||
[[main]]
|
||||
name = "How to guides"
|
||||
weight = 20
|
||||
url = "/docs/how-to"
|
||||
parent = "docs"
|
||||
|
||||
[[main]]
|
||||
name = "Swagger ->"
|
||||
weight = 98
|
||||
url = "https://waha.devlike.pro/swagger"
|
||||
parent = "docs"
|
||||
|
||||
[[main]]
|
||||
name = "OpenAPI JSON ->"
|
||||
weight = 99
|
||||
url = "https://waha.devlike.pro/swagger/openapi.json"
|
||||
parent = "docs"
|
||||
|
||||
[[main]]
|
||||
name = "WAHA Plus"
|
||||
weight = 30
|
||||
identifier = "waha-plus"
|
||||
|
||||
[[main]]
|
||||
name = "About WAHA Plus"
|
||||
weight = 40
|
||||
identifier = "plus-version"
|
||||
weight = 10
|
||||
url = "/docs/how-to/plus-version"
|
||||
parent = "get-plus"
|
||||
parent = "waha-plus"
|
||||
|
||||
[[main]]
|
||||
name = "Get on Boosty ->"
|
||||
weight = 50
|
||||
identifier = "boosty"
|
||||
url = "https://boosty.to/wa-http-api"
|
||||
parent = "get-plus"
|
||||
name = "Patron Portal ->"
|
||||
weight = 20
|
||||
url = "https://portal.devlike.pro/"
|
||||
parent = "waha-plus"
|
||||
|
||||
[[main]]
|
||||
name = "Get on Patreon ->"
|
||||
weight = 60
|
||||
identifier = "patreon"
|
||||
weight = 50
|
||||
url = "https://patreon.com/wa_http_api"
|
||||
parent = "get-plus"
|
||||
parent = "waha-plus"
|
||||
|
||||
[[main]]
|
||||
name = "Get on Boosty ->"
|
||||
weight = 60
|
||||
url = "https://boosty.to/wa-http-api"
|
||||
parent = "waha-plus"
|
||||
|
||||
|
||||
[[main]]
|
||||
name = "Examples"
|
||||
weight = 20
|
||||
identifier = "examples"
|
||||
|
||||
[[main]]
|
||||
name = "Python ->"
|
||||
weight = 21
|
||||
url = "https://github.com/devlikeapro/whatsapp-http-api/tree/core/examples/python"
|
||||
parent = "examples"
|
||||
|
||||
|
||||
[[social]]
|
||||
name = "GitHub"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
title = "WAHA"
|
||||
titleSeparator = "-"
|
||||
titleAddition = "WhatsApp HTTP API"
|
||||
description = "WAHA - WhatsApp HTTP API that you can configure in a click!"
|
||||
description = "WAHA - WhatsApp HTTP API that you can run in a click!"
|
||||
|
||||
## Documentation
|
||||
# docsVersion = "0.3"
|
||||
@@ -72,9 +72,8 @@ copyRight = "Copyright (c) 2021-2023 Dev Like A Pro"
|
||||
|
||||
# Alert
|
||||
alert = true
|
||||
alertDismissable = false
|
||||
# alertText = "Introducing the Doks child theme, several DX + UX updates, and more! <a class=\"alert-link stretched-link\" href=\"https://getdoks.org/blog/doks-v0.2/\" target=\"_blank\" rel=\"noopener\">Check out Doks v0.2</a>"
|
||||
alertText = "Enjoy Core version or want to get WAHA Plus verison? You can <a class=\"alert-link stretched-link\" href=\"https://waha.devlike.pro/docs/how-to/plus-version/\">support the project -></a>"
|
||||
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>"
|
||||
|
||||
# Edit Page
|
||||
# repoHost [Github | Gitea | GitLab | Bitbucket | BitbucketServer ] is used for building the edit link based on git hoster
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title : "WAHA"
|
||||
description: "WAHA - WhatsApp HTTP API that you can configure in a click!"
|
||||
lead: "WAHA - WhatsApp HTTP API that you can configure in a click!"
|
||||
description: "WAHA - WhatsApp HTTP API that you can run in a click!"
|
||||
lead: "WAHA - <b>WhatsApp HTTP API</b> that you can run in a click!"
|
||||
date: 2020-10-06T08:47:36+00:00
|
||||
lastmod: 2020-10-06T08:47:36+00:00
|
||||
draft: false
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: "Python"
|
||||
description: "WhatsApp HTTP API Python example."
|
||||
lead: "WhatsApp HTTP API Python example."
|
||||
description: "WhatsApp HTTP API Python examples."
|
||||
lead: "WhatsApp HTTP API Python examples."
|
||||
date: 2020-10-06T08:49:31+00:00
|
||||
lastmod: 2020-10-06T08:49:31+00:00
|
||||
draft: false
|
||||
@@ -12,41 +12,7 @@ parent: "help"
|
||||
weight: 630
|
||||
toc: true
|
||||
---
|
||||
We've created a few examples on how to interact with WAHA WhatsApp HTTP API with Python.
|
||||
|
||||
To show how to receive messages we've created a simple "echo" server with two functions:
|
||||
You can find the examples in [examples folder on GitHub with detailed instructions in README.md](https://github.com/devlikeapro/whatsapp-http-api/tree/core/examples/python)
|
||||
|
||||
1. When we receive a text message - just send the text back
|
||||
2. When we receive a message with a file (an image, a voice message) - download it and send the path back 
|
||||
|
||||
In order to send you messages we use **Webhooks** and configure them via environments variables. So
|
||||
what you need to
|
||||
create "echo" server is HTTP server that will receive JSON POST request and then call back WhatsApp HTTP API
|
||||
via `POST /api/sendText` endpoint with JSON body.
|
||||
|
||||
## Python echo server
|
||||
|
||||
We use Python. Feel free to create your favorite language example and contribute to the project!
|
||||
|
||||
Run "echo" server in one terminal and leave it working:
|
||||
|
||||
```bash
|
||||
# if you haven't already
|
||||
git clone https://github.com/devlikeapro/whatsapp-http-api.git
|
||||
cd whatsapp-http-api
|
||||
python -mpip install -r examples/requirements.txt
|
||||
export FLASK_APP=examples/echo.py
|
||||
flask run
|
||||
```
|
||||
|
||||
Visit [http://localhost:5000](http://localhost:5000) and check that we are good to go further.
|
||||
|
||||
Let's start WhatsApp HTTP API and configure the "on message" webhook and point it on our "http://localhost:5000/message"
|
||||
endpoint:
|
||||
|
||||
```bash
|
||||
docker run -it --network=host -e WHATSAPP_HOOK_URL=http://localhost:5000/message -e WHATSAPP_HOOK_EVENTS=* devlikeapro/whatsapp-http-api
|
||||
```
|
||||
|
||||
Now go ahead, open the second whatsapp and send to our WhatsApp HTTP API a text message! It must reply the same text.
|
||||
|
||||
 If you try to send an image the "echo server" will send a path to the downloaded file.
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
title: "Help"
|
||||
description: "Help Doks."
|
||||
lead: ""
|
||||
date: 2020-10-06T08:49:15+00:00
|
||||
lastmod: 2020-10-06T08:49:15+00:00
|
||||
draft: false
|
||||
images: []
|
||||
weight: 800
|
||||
---
|
||||
@@ -1,73 +0,0 @@
|
||||
---
|
||||
title: "Changelog"
|
||||
description: "WAHA's changelog"
|
||||
lead: "Changelog"
|
||||
date: 2020-10-06T08:49:31+00:00
|
||||
lastmod: 2020-10-06T08:49:31+00:00
|
||||
draft: false
|
||||
images: []
|
||||
menu:
|
||||
docs:
|
||||
parent: "help"
|
||||
weight: 600
|
||||
toc: true
|
||||
---
|
||||
## 2021.1
|
||||
- Added [contacts API]({{< relref "/docs/how-to/contacts" >}})
|
||||
- Get all contacts
|
||||
- Get a contact
|
||||
- Get contact "about" (status)
|
||||
- Get contact profile picture
|
||||
- Check number exists (is registered in WhatsApp) - works even if the number is not in the contact list
|
||||
- Block and unblock contact
|
||||
|
||||
## 2022.12
|
||||
- Added `GET /messages/` endpoint to get chat messages [#31](https://github.com/devlikeapro/whatsapp-http-api/issues/31)
|
||||
|
||||
### Security 
|
||||
- Added `WHATSAPP_SWAGGER_USERNAME` and `WHATSAPP_SWAGGER_PASSWORD` to hide and protect swagger panel.
|
||||
|
||||
## 2022.11
|
||||
**Please test changes in test environment before update production!!**
|
||||
|
||||
### Engine  
|
||||
1. WAHA has changed its underlying engine from Venom to Whatsapp Web.JS. It might change the response and webhook's payloads.
|
||||
2. Optimize CPU and memory consumption.
|
||||
|
||||
|
||||
### Requests  
|
||||
- For all `/api/session/` requests use `name` field instead of `sessionName`.
|
||||
- For all "chatting" requests use `session` field instead of `sessionName`.
|
||||
|
||||
### Sessions 
|
||||
Now you don't have to scan QR code each time you run WAHA, WAHA saves it for you! Available only in Plus version.
|
||||
|
||||
### Authentication 
|
||||
Now you can authenticate all requests for WAHA - use `WHATSAPP_API_KEY=secret` environment variable to set "secret key".
|
||||
|
||||
If `WHATSAPP_API_KEY` is set - requests must have `X-Api-Key` header with `secret` value, where `secret` - any random secret key.
|
||||
|
||||
### Webhooks  
|
||||
#### Configuration
|
||||
|
||||
Instead of setting each webhook via environment variables - we use two environments variables:
|
||||
|
||||
- `WHATSAPP_HOOK_URL` - to set a URL
|
||||
- `WHATSAPP_HOOK_EVENTS` - to set events that are sent to the URL
|
||||
|
||||
| Previous | Current |
|
||||
|----------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------|
|
||||
| <pre>WHATSAPP_HOOK_ONMESSAGE=https://httpbin.org/post <br>WHATSAPP_HOOK_ONANYMESSAGE=https://httpbin.org/post </pre> | <pre>WHATSAPP_HOOK_URL=https://httpbin.org/post <br>WHATSAPP_HOOK_EVENTS=message,message.any</pre> |
|
||||
|
||||
#### Payload
|
||||
|
||||
The data for webhooks are wrapped inside a new `WAWebhook` object with `event` and `payload` fields to help you identify
|
||||
which handler you should call based on `event`.
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "message.any",
|
||||
"payload": {
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -1,34 +0,0 @@
|
||||
---
|
||||
title: "How to Update"
|
||||
description: "Regularly update the installed WAHA to keep your bot stable, usable, and secure."
|
||||
lead: "Regularly update the installed WAHA to keep your bot stable, usable, and secure."
|
||||
date: 2020-11-12T13:26:54+01:00
|
||||
lastmod: 2020-11-12T13:26:54+01:00
|
||||
draft: false
|
||||
images: []
|
||||
menu:
|
||||
docs:
|
||||
parent: "help"
|
||||
weight: 610
|
||||
toc: true
|
||||
---
|
||||
|
||||
{{< alert icon="💡" text="Please test all new versions in the development environment before updating production!" />}}
|
||||
|
||||
## Core
|
||||
 For Core version the command is
|
||||
|
||||
```bash
|
||||
docker pull devlikeapro/whatsapp-http-api
|
||||
```
|
||||
|
||||
## Plus
|
||||
 For Plus version, we use login to get the image before:
|
||||
|
||||
```bash
|
||||
docker login -u devlikeapro -p {PASSWORD}
|
||||
docker pull devlikeapro/whatsapp-http-api-plus
|
||||
docker logout
|
||||
```
|
||||
|
||||
Read more about how to get `PASSWORD` for [Plus Version →]({{< relref "plus-version" >}})
|
||||
@@ -0,0 +1,43 @@
|
||||
---
|
||||
title : "Chats"
|
||||
description: "Chats"
|
||||
lead: ""
|
||||
date: 2020-10-06T08:48:45+00:00
|
||||
lastmod: 2020-10-06T08:48:45+00:00
|
||||
draft: false
|
||||
images: []
|
||||
weight: 127
|
||||
---
|
||||
|
||||
Chats methods.
|
||||
|
||||
Parameters in path that you can find in below endpoints:
|
||||
- `{session}` - use the session name for Whatsapp instance that you created with `POST /api/session/start` endpoint
|
||||
- `{chatId}` - chat id in format `123123123123@[c.us|g.us]`, `c.us` for direct chats and `g.us` for groups.
|
||||
|
||||
## Endpoints
|
||||
See the list of engines [**that support the feature ->**]({{< relref "/docs/how-to/engines#features" >}}).
|
||||
|
||||
### Get all chats
|
||||
Get all chats
|
||||
`GET /api/{session}/chats`
|
||||
|
||||
### Get messages from chat
|
||||
Get 100 messages from the chat
|
||||
|
||||
`GET /api/{session}/chats/{chatId}/messages?limit=100`
|
||||
|
||||
|
||||
Get 100 messages from the chat, skip downloading media (images, files)
|
||||
|
||||
`GET /api/{session}/chats/{chatId}/messages?limit=100&downloadMedia=false`
|
||||
|
||||
### Delete chat
|
||||
Use the method to delete chat
|
||||
|
||||
`DELETE /api/{session}/chats/{chatId}`
|
||||
|
||||
### Clear messages
|
||||
Use the method to clear all messages from the chat
|
||||
|
||||
`DELETE /api/{session}/chats/{chatId}/messages`
|
||||
@@ -1,58 +1,206 @@
|
||||
---
|
||||
title : "Configuration"
|
||||
title: "Configuration"
|
||||
description: "Configuration"
|
||||
lead: ""
|
||||
date: 2020-10-06T08:48:45+00:00
|
||||
lastmod: 2020-10-06T08:48:45+00:00
|
||||
draft: false
|
||||
images: []
|
||||
images: [ ]
|
||||
weight: 800
|
||||
---
|
||||
|
||||
You can configure WhatsApp HTTP API behaviour via environment variables, by adding `-e WHATSAPP_VARNAME=value` at the
|
||||
begging of the command line or by using [other options](https://docs.docker.com/engine/reference/commandline/run/)
|
||||
|
||||
```bash
|
||||
docker run -it -e WHATSAPP_HOOK_EVENTS=* -e WHATSAPP_HOOK_URL=https://httpbin.org/post devlikeapro/whatsapp-http-api
|
||||
docker run -it -e "WHATSAPP_HOOK_EVENTS=*" -e WHATSAPP_HOOK_URL=https://httpbin.org/post devlikeapro/whatsapp-http-api
|
||||
```
|
||||
|
||||
It's not necessary to always run such a long command - you can save all data in
|
||||
[docker-compose.yaml](https://github.com/devlikeapro/whatsapp-http-api/blob/core/docker-compose.yaml)
|
||||
file as described on [How to deploy page ->]({{< relref "/docs/how-to/deploy" >}}).
|
||||
|
||||
## Environment variables
|
||||
|
||||
- `DEBUG=1` - show debug and verbose logs, set in any value
|
||||
- `WHATSAPP_API_PORT=3000` - listen port for HTTP server (default: `3000`)
|
||||
- `WHATSAPP_API_HOSTNAME=localhost` - Hostname for HTTP server (default: `localhost`)
|
||||
- `WHATSAPP_API_KEY=mysecret` - protect the api with a secret code. If you set it - add `X-Api-Key: mysecret` to all
|
||||
requests.
|
||||
- `WHATSAPP_SWAGGER_USERNAME=admin` + `WHATSAPP_SWAGGER_PASSWORD=admin` - protect the Swagger panel with `admin / admin`
|
||||
credentials. It doesn't affect api access!
|
||||
- `WHATSAPP_START_SESSION=default` - start session with the name right after launching the app
|
||||
The following environment variables can be used to configure the WAHA.
|
||||
|
||||
## File storage 
|
||||
### Common
|
||||
- `DEBUG=1`: Set this variable to any value to enable debug and verbose logs.
|
||||
- `WHATSAPP_API_PORT=3000`: The port number that the HTTP server will listen on. The default value is `3000`.
|
||||
- `WHATSAPP_API_HOSTNAME=localhost`: The hostname for the HTTP server. The default value is `localhost`.
|
||||
|
||||
- `WHATSAPP_FILES_MIMETYPES` - download only these mimetypes from messages (download all files be default). Mimetypes
|
||||
must be separated by a comma, without spaces: `audio,image/png,image/gif`. In order to choose type use prefix (
|
||||
like `audio,image`).
|
||||
- `WHATSAPP_FILES_LIFETIME`- to keep free space files will be removed after this time (default: `180`, in seconds)
|
||||
- `WHATSAPP_FILES_FOLDER` - folder where will be stored files from chats (images, voice messages) (
|
||||
default: `/tmp/whatsapp-files`)
|
||||
### Sessions
|
||||
- `WHATSAPP_RESTART_ALL_SESSIONS=True`: Set this variable to `True` to start all **STOPPED** sessions after container
|
||||
restarts. By default, this variable is set to `False`.
|
||||
- Please note that this will start all **STOPPED** sessions, not just the sessions that were working before the restart. You can maintain the session list by
|
||||
using `POST /api/session/stop` with the `logout: True` parameter or by calling `POST /api/session/logout` to remove
|
||||
**STOPPED** sessions. You can see all sessions, including **STOPPED** sessions, in the `GET /api/sessions/all=True`
|
||||
response.
|
||||
- `WHATSAPP_START_SESSION=session1,session2`: This variable can be used to start sessions with the specified names right
|
||||
after launching the API. Separate session names with a comma.
|
||||
- Also read more about [Sessions ->]({{< relref "/docs/how-to/sessions" >}})
|
||||
- Also read more about [Session Storages on the dedicated page ->]({{< relref "/docs/how-to/storages#sessions" >}})
|
||||
|
||||
## Engines
|
||||
### Swagger
|
||||
- `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.
|
||||
|
||||
Under the hood **WAHA** allows you to use two different engines. You can control what you want to run by settings
|
||||
`WHATSAPP_DEFAULT_ENGINE` environment variables.
|
||||
Read more about security settings for Swagger and API on [**Security page** ->]({{< relref "/docs/how-to/security" >}}).
|
||||
|
||||
If you have any problems with one engine - try another!
|
||||
### Proxy
|
||||
#### Global proxy configuration
|
||||
If you need to use a proxy, you can set the following environment variables:
|
||||
|
||||
{{< alert icon="👉" text="API responses and webhook payloads may differ significantly! We do our best to keep requests body stable between engines." />}}
|
||||
- `WHATSAPP_PROXY_SERVER=localhost:3128`: Use this variable to set the proxy server in the format `host:port`, without http or https.
|
||||
- `WHATSAPP_PROXY_SERVER_USERNAME=username` and `WHATSAPP_PROXY_SERVER_PASSWORD=password`: Use these variables to set up credentials for the proxy.
|
||||
- `WHATSAPP_PROXY_SERVER_LIST=host1.example.com:3138,host2.example.com:3138`: Use this variable to set a comma-separated list of addresses to use, using a round-robin algorithm to choose the server for the session.
|
||||
- `WHATSAPP_PROXY_SERVER_INDEX_PREFIX=proxy-`: Use this variable to parse the session name for the prefix and find the appropriate session.
|
||||
For example, if you have set `WHATSAPP_PROXY_SERVER_LIST=host-first:80,host-second:80,host-third:80` and `WHATSAPP_PROXY_SERVER_INDEX_PREFIX=proxy-` and you run `proxy-3` session, the `host-third:80` proxy will be chosen for that session.
|
||||
This is a way to select a proxy from while you start session.
|
||||
|
||||
### WhatsApp WebJS 
|
||||
#### Session proxy configuration
|
||||
You can configure proxy when you start session by setting `config.proxy` fields.
|
||||
Read more about it on [**Session page** ->]({{< relref "/docs/how-to/sessions#configure-proxy" >}}).
|
||||
|
||||
**WAHA** uses **WhatsApp WebJS** engine by default
|
||||
Keep in mind that session's proxy configuration takes precedence over proxy configuration set by environment variables!
|
||||
|
||||
- https://github.com/pedroslopez/whatsapp-web.js
|
||||
- `WHATSAPP_DEFAULT_ENGINE=WEBJS`
|
||||
|
||||
### Venom 
|
||||
### Security
|
||||
<b>Security is available in [WAHA Plus ]({{< relref "/docs/how-to/plus-version" >}}) only.</b>
|
||||
|
||||
- https://github.com/orkestral/venom
|
||||
- `WHATSAPP_DEFAULT_ENGINE=VENOM`
|
||||
- `WHATSAPP_API_KEY=mysecret`: If you set this variable, you must include the `X-Api-Key: mysecret` header in all
|
||||
requests to the API. This will protect the API with a secret code.
|
||||
- `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.
|
||||
|
||||
Read more about security settings for Swagger and API on [**Security page** ->]({{< relref "/docs/how-to/security" >}}).
|
||||
|
||||
### Files
|
||||
<b>Files configuration is available in [WAHA Plus ]({{< relref "/docs/how-to/plus-version" >}}) only.</b>
|
||||
|
||||
The following environment variables can be used to configure the file storage options for the WAHA:
|
||||
|
||||
- `WHATSAPP_FILES_MIMETYPES`: This variable can be used to download only specific mimetypes from messages.
|
||||
By default, all files are downloaded. The mimetypes must be separated by a comma, without spaces.
|
||||
For example: `audio,image/png,image/gif`. To choose a specific type, use a prefix (like `audio,image`). See usage below.
|
||||
- `WHATSAPP_DOWNLOAD_MEDIA=true` - this variable can be used to **completely** disable downloading media files. By default, all files are downloaded.
|
||||
Set this variable to `WHATSAPP_DOWNLOAD_MEDIA=false` to disable downloading media files.
|
||||
- Under the hood, it sets `WHATSAPP_FILES_MIMETYPES=mimetype/ignore-all-media` to ignore all media files.
|
||||
- `WHATSAPP_FILES_LIFETIME`: This variable can be used to set the time (in seconds) after which files will be removed to
|
||||
free up space. The default value is `180`.
|
||||
- Set this variable to `0` to disable the file lifetime.
|
||||
- `WHATSAPP_FILES_FOLDER`: This variable can be used to set the folder where files from chats (images, voice messages)
|
||||
will be stored. The default value is `/tmp/whatsapp-files`.
|
||||
- The folder must be mounted to the host machine to keep the files between container restarts. [ Read more about how to persist files ->]({{< relref "/docs/how-to/storages#media" >}})
|
||||
- Also read more about [Media Storages on the dedicated page ->]({{< relref "/docs/how-to/storages#media" >}})
|
||||
|
||||
💡 Even if WAHA doesn't process the message media because of `WHATSAPP_FILES_MIMETYPES` or `WHATSAPP_DOWNLOAD_MEDIA`
|
||||
you'll get a webhook event with `hasMedia: True` field, but with no `media.url`.
|
||||
```json
|
||||
{
|
||||
"event": "message",
|
||||
"session": "default",
|
||||
"payload": {
|
||||
"hasMedia": true,
|
||||
"media": {
|
||||
"url": null,
|
||||
"mimetype": "video/mp4",
|
||||
"filename": null
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Health Check
|
||||
<b>Health check is available in [WAHA Plus ]({{< relref "/docs/how-to/plus-version" >}}) only.</b>
|
||||
|
||||
The following environment variables can be used to configure the [Health Check ->]({{< relref "/docs/how-to/other" >}}):
|
||||
- `WHATSAPP_HEALTH_MEDIA_FILES_THRESHOLD_MB` - the threshold in MB for the media files storage. The default value is `100`.
|
||||
- `WHATSAPP_HEALTH_SESSIONS_FILES_THRESHOLD_MB` - the threshold in MB for the sessions files storage. The default value is `100`.
|
||||
- `WHATSAPP_HEALTH_MONGODB_TIMEOUT` - the timeout in milliseconds for the MongoDB health check. The default value is `5000`.
|
||||
|
||||
## Examples
|
||||
|
||||
#### Debug Mode
|
||||
|
||||
To enable debug mode, set the `DEBUG` environment variable to any value:
|
||||
|
||||
```
|
||||
DEBUG=1
|
||||
```
|
||||
|
||||
#### Protecting the API with a Secret Code
|
||||
|
||||
To protect the API with a secret code, set the `WHATSAPP_API_KEY` environment variable to your secret code:
|
||||
|
||||
```
|
||||
WHATSAPP_API_KEY=mysecret
|
||||
```
|
||||
|
||||
You must include the `X-Api-Key: mysecret` header in all requests to the API.
|
||||
|
||||
#### Starting Sessions Automatically
|
||||
|
||||
To start sessions automatically when the API is launched, set the `WHATSAPP_START_SESSION` environment variable to a
|
||||
comma-separated list of session names:
|
||||
|
||||
```
|
||||
WHATSAPP_START_SESSION=session1,session2
|
||||
```
|
||||
|
||||
#### Restarting All Sessions
|
||||
|
||||
To start all **STOPPED** sessions after container restarts, set the `WHATSAPP_RESTART_ALL_SESSIONS` environment variable
|
||||
to `True`:
|
||||
|
||||
```
|
||||
WHATSAPP_RESTART_ALL_SESSIONS=True
|
||||
```
|
||||
|
||||
#### Protecting the Swagger Panel
|
||||
|
||||
To protect the Swagger panel with `admin / admin` credentials, set the `WHATSAPP_SWAGGER_USERNAME`
|
||||
and `WHATSAPP_SWAGGER_PASSWORD` environment variables:
|
||||
|
||||
```
|
||||
WHATSAPP_SWAGGER_USERNAME=admin
|
||||
WHATSAPP_SWAGGER_PASSWORD=admin
|
||||
```
|
||||
|
||||
|
||||
#### Downloading Specific Mimetypes
|
||||
|
||||
To download only specific mimetypes from messages, set the `WHATSAPP_FILES_MIMETYPES` environment variable to a
|
||||
comma-separated list of mimetypes:
|
||||
|
||||
```
|
||||
WHATSAPP_FILES_MIMETYPES=audio,image/png,image/gif
|
||||
```
|
||||
|
||||
#### Disable Downloading Media Files
|
||||
To disable downloading media files, set the `WHATSAPP_DOWNLOAD_MEDIA` environment variable to `false`:
|
||||
|
||||
```
|
||||
WHATSAPP_DOWNLOAD_MEDIA=false
|
||||
```
|
||||
|
||||
#### Setting the File Lifetime
|
||||
|
||||
To set the time (in seconds) after which files will be removed to free up space, set the `WHATSAPP_FILES_LIFETIME`
|
||||
environment variable:
|
||||
|
||||
```
|
||||
WHATSAPP_FILES_LIFETIME=300
|
||||
```
|
||||
|
||||
#### Setting the File Storage Folder
|
||||
|
||||
To set the folder where files from chats (images, voice messages) will be stored, set the `WHATSAPP_FILES_FOLDER`
|
||||
environment variable:
|
||||
|
||||
```
|
||||
WHATSAPP_FILES_FOLDER=/home/user/whatsapp-files
|
||||
```
|
||||
@@ -13,7 +13,10 @@ Methods for contacts.
|
||||
|
||||
{{< alert icon="👉" text="WhatsApp Web does not support adding contacts, so the API doesn't support it too." />}}
|
||||
|
||||
## Get all contacts
|
||||
## Endpoints
|
||||
See the list of engines [**that support the feature ->**]({{< relref "/docs/how-to/engines#features" >}}).
|
||||
|
||||
### Get all contacts
|
||||
|
||||
Get your contacts - `GET /api/contacts/all`
|
||||
|
||||
@@ -34,7 +37,7 @@ Get your contacts - `GET /api/contacts/all`
|
||||
]
|
||||
```
|
||||
|
||||
## Get contact
|
||||
### Get contact
|
||||
|
||||
Get contact
|
||||
|
||||
@@ -56,19 +59,32 @@ Get contact
|
||||
}
|
||||
```
|
||||
|
||||
## Check phone number exists
|
||||
### Check phone number exists
|
||||
|
||||
If you want to check if phone number is registered in WhatsApp (even if the number is not in your contact list) - use
|
||||
this endpoint for that.
|
||||
- `GET /api/contacts/check-exists?phone=11231231231&session=default`
|
||||
```bash
|
||||
GET /api/contacts/check-exists?phone=11231231231&session=default
|
||||
```
|
||||
It returns `numberExists` field with `true` or `false` value and `chatId` field with chat ID of the number (if exists).
|
||||
|
||||
```json
|
||||
{
|
||||
"numberExists": true
|
||||
"numberExists": true,
|
||||
"chatId": "123123123@c.us"
|
||||
}
|
||||
```
|
||||
**Note for Brazilian Phone Numbers**
|
||||
|
||||
## Get "about" contact
|
||||
You should use the `GET /api/contacts/check-exists` endpoint **before sending a message to a new phone number**
|
||||
to get the correct chatId because of the additional 9-digit number added after 2012.
|
||||
|
||||
Read more about
|
||||
[error sending text to half of Brazilian numbers (every number registered before 2012) ->](https://github.com/devlikeapro/whatsapp-http-api/issues/238)
|
||||
|
||||
It's fine to send the response to `chatId` for incoming messages, though - the payload already has the correct `chatId`.
|
||||
|
||||
### Get "about" contact
|
||||
|
||||
- `GET /api/contacts/about?contactId=11231231231&session=default`
|
||||
|
||||
@@ -78,7 +94,7 @@ this endpoint for that.
|
||||
}
|
||||
```
|
||||
|
||||
## Get contact profile picture
|
||||
### Get contact profile picture
|
||||
|
||||
- `GET /api/contacts/profile-picture?contactId=11231231231&session=default`
|
||||
|
||||
@@ -88,7 +104,7 @@ this endpoint for that.
|
||||
}
|
||||
```
|
||||
|
||||
## Block (unblock) contact
|
||||
### Block (unblock) contact
|
||||
- To block contact - `POST /api/contacts/block`
|
||||
- To unblock contact - `POST /api/contacts/unblock`
|
||||
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
---
|
||||
title: "Deploy"
|
||||
description: "How to deploy WAHA"
|
||||
lead: ""
|
||||
date: 2020-10-06T08:48:45+00:00
|
||||
lastmod: 2020-10-06T08:48:45+00:00
|
||||
draft: false
|
||||
images: [ ]
|
||||
weight: 899
|
||||
---
|
||||
|
||||
This page provides useful information to assist you in deploying the project.
|
||||
It includes tips on how to avoid running long command lines, how to view logs, and other helpful advice.
|
||||
|
||||
## How to Use Docker Compose
|
||||
|
||||
Docker Compose is a tool that allows you to define and run multi-container Docker applications. It simplifies the
|
||||
process of managing multiple containers and their dependencies. In this topic, we will walk you through how to use
|
||||
Docker Compose with the WhatsApp HTTP API.
|
||||
|
||||
### Prerequisites
|
||||
|
||||
Before you start, you need to have Docker and Docker Compose installed on your machine. You can download Docker from the
|
||||
official website [here](https://www.docker.com/products/docker-desktop). Docker Compose is included with Docker Desktop
|
||||
for Windows and macOS, but for Linux, you need to install it separately. You can find the installation
|
||||
instructions [here](https://docs.docker.com/compose/install/).
|
||||
|
||||
### Getting Started
|
||||
|
||||
To get started, you need to clone the [docker-compose.yaml](https://github.com/devlikeapro/whatsapp-http-api/blob/core/docker-compose.yaml) file to your local machine.
|
||||
Open your terminal and run the following command:
|
||||
|
||||
```
|
||||
wget https://raw.githubusercontent.com/devlikeapro/whatsapp-http-api/core/docker-compose.yaml
|
||||
```
|
||||
|
||||
### Running the WhatsApp HTTP API Service
|
||||
|
||||
To start the `whatsapp-http-api` service, run the following command:
|
||||
|
||||
```
|
||||
docker-compose up -d whatsapp-http-api
|
||||
```
|
||||
|
||||
This will start the container in detached mode and map port 3000 to 3000 on the host machine.
|
||||
|
||||
To stop the service, run the command:
|
||||
|
||||
```
|
||||
docker-compose down
|
||||
```
|
||||
|
||||
This will stop and remove the container.
|
||||
|
||||
To restart the service, run the command:
|
||||
|
||||
```
|
||||
docker-compose restart whtasapp-http-api
|
||||
```
|
||||
|
||||
This will restart the container.
|
||||
|
||||
### Viewing the Logs
|
||||
|
||||
To view the logs for the `whatsapp-http-api` service, run the command:
|
||||
|
||||
```
|
||||
docker-compose logs -f whatsapp-http-api
|
||||
```
|
||||
|
||||
This will show the logs in real-time. To view the logs for the `whatsapp-http-api-plus` service,
|
||||
replace `whatsapp-http-api` with `whatsapp-http-api-plus`.
|
||||
|
||||
To view the logs for a specific period, run the command:
|
||||
|
||||
```
|
||||
docker-compose logs --since <time>
|
||||
```
|
||||
|
||||
Replace `<time>` with the time period you want to view the logs for. For example, `docker-compose logs --since 1h` will
|
||||
show the logs for the past hour.
|
||||
|
||||
### Using the WhatsApp HTTP API Services
|
||||
|
||||
There are two services provided in the `docker-compose.yml` file - `whatsapp-http-api` and `whatsapp-http-api-plus`.
|
||||
It is important to note that these services must not be run at the same time.
|
||||
By default, the `whatsapp-http-api` service will be used.
|
||||
|
||||
To use the `whatsapp-http-api-plus` service, you need to specify it in the command.
|
||||
|
||||
@@ -0,0 +1,206 @@
|
||||
---
|
||||
title: "Engines"
|
||||
description: "Engines"
|
||||
lead: ""
|
||||
date: 2020-10-06T08:48:45+00:00
|
||||
lastmod: 2020-10-06T08:48:45+00:00
|
||||
draft: false
|
||||
images: [ ]
|
||||
weight: 800
|
||||
---
|
||||
|
||||
## Engines
|
||||
|
||||
Under the hood **WAHA** allows you to use different engines. You can control what you want to run by settings
|
||||
`WHATSAPP_DEFAULT_ENGINE` environment variables.
|
||||
|
||||
```bash
|
||||
docker run -it -e "WHATSAPP_DEFAULT_ENGINE=WEBJS" devlikeapro/whatsapp-http-api
|
||||
```
|
||||
|
||||
If you have any problems with one engine - try another!
|
||||
|
||||
{{< alert icon="👉" text="API responses and webhook payloads may differ significantly, test everything before changing the engine" />}}
|
||||
|
||||
All engines are available in both
|
||||
Core  and
|
||||
[Plus  versions]({{< relref "/docs/how-to/plus-version" >}}).
|
||||
|
||||
### WEBJS
|
||||
|
||||
- `WHATSAPP_DEFAULT_ENGINE=WEBJS`
|
||||
- [https://github.com/pedroslopez/whatsapp-web.js](https://github.com/pedroslopez/whatsapp-web.js)
|
||||
|
||||
A WhatsApp API client that connects through the WhatsApp Web browser app.
|
||||
It uses Puppeteer to run a real instance of Whatsapp Web to avoid getting blocked.
|
||||
|
||||
**WAHA** uses **WhatsApp WebJS** engine by default.
|
||||
|
||||
### NOWEB
|
||||
|
||||
- `WHATSAPP_DEFAULT_ENGINE=NOWEB`
|
||||
- [https://github.com/WhiskeySockets/Baileys](https://github.com/WhiskeySockets/Baileys)
|
||||
|
||||
**NOWEB** engine **does not require a browser** to work with WhatsApp Web, it does so directly using a WebSocket.
|
||||
Not running Chromium saves you CPU and Memory, so you can run more instances on a single server!
|
||||
|
||||
️Working with the engine requires more attention, because it's easy to be blocked with it!
|
||||
|
||||
⚠ Read the article before using **NOWEB** engine
|
||||
[How to avoid blocking ->]({{< relref " /docs/overview/how-to-avoid-blocking" >}}).
|
||||
|
||||
### VENOM
|
||||
|
||||
- `WHATSAPP_DEFAULT_ENGINE=VENOM`
|
||||
- [https://github.com/orkestral/venom](https://github.com/orkestral/venom)
|
||||
|
||||
It's a high-performance system developed with JavaScript to create a bot for WhatsApp.
|
||||
It uses Puppeteer to run a real instance of Whatsapp Web to avoid getting blocked.
|
||||
|
||||
## Docker images
|
||||
WAHA provides few docker images with different setup.
|
||||
{{< alert icon="👉" text="Use `devlikeapro/whatsapp-http-api` instead of `devlikeapro/whatsapp-http-api-plus` to get **WAHA Plus** version." />}}
|
||||
|
||||
For **x86** processors use following images:
|
||||
- `devlikeapro/whatsapp-http-api:latest` - latest version of WAHA, using **Chromium** (does not support video receiving and receiving in Plus version)
|
||||
- `devlikeapro/whatsapp-http-api:chrome` - latest version of WAHA, using **Chrome** (supports video receiving and receiving in Plus version)
|
||||
- `devlikeapro/whatsapp-http-api:noweb`- latest version of WAHA, **no browser installed** - use it only for **NOWEB** engine
|
||||
|
||||
For **ARM** processors use following images:
|
||||
- `devlikeapro/whatsapp-http-api:arm` - **Chromium**
|
||||
- `devlikeapro/whatsapp-http-api:noweb-arm`- **no browser installed**
|
||||
|
||||
{{< alert icon="💡" text="Chrome version is not available in ARM" />}}
|
||||
|
||||
## Features
|
||||
|
||||
Some engines may not support certain features.
|
||||
Here, you will find a list of supported endpoints and webhooks per engine.
|
||||
|
||||
| Symbol | Meaning |
|
||||
|:------------------------------:|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| ✔️ | The engines supports the feature. |
|
||||
| ➖ | The engine does **not** support this feature. <br/>Please search for the issue about the endpoint in [the project's issue](https://github.com/devlikeapro/whatsapp-http-api/issues) and upvote it by using the "👍" reaction on the issue's description. This will help us determine the level of interest in the feature. <br/>If you are unable to find the issue, please create a new one. |
|
||||
|  | The feature available in [WAHA Plus]({{< relref "/docs/how-to/plus-version" >}}). |
|
||||
|
||||
If you don't specify `WHATSAPP_DEFAULT_ENGINE` environment variable - look at **WEBJS** engine,
|
||||
it's the engine WAHA runs by default.
|
||||
|
||||
### Protocols
|
||||
|
||||
| | WEBJS | NOWEB | VENOM |
|
||||
|--------------------------------------------------------------|:-----:|:-----:|:-----:|
|
||||
| Run a browser (chromium\chrome) to communicate with WhatsApp | ✔️ | ➖ | ✔️ |
|
||||
| Communicate with WhatsApp via websocket (no browser) | ➖ | ✔️ | ➖ |
|
||||
|
||||
### Endpoints
|
||||
|
||||
If you find any inconsistency with actual endpoints -
|
||||
please [create an issue](https://github.com/devlikeapro/whatsapp-http-api/issues/new?title=Error+in+engine+features )
|
||||
|
||||
| | WEBJS | NOWEB | VENOM |
|
||||
|-------------------------------------------------------------------|:-----:|:-------------------------------------------------------------------------:|:-----:|
|
||||
| **Session** | | | |
|
||||
| `POST /api/sessions/start` | ✔️ | ✔️ | ✔️ |
|
||||
| `POST /api/sessions/stop` | ✔️ | ✔️ | ✔️ |
|
||||
| `POST /api/sessions/logout` | ✔️ | ✔️ | ✔️ |
|
||||
| `GET /api/sessions/` | ✔️ | ✔️ | ✔️ |
|
||||
| `GET /api/sessions/{session}/me` | ✔️ | ✔️ | ➖ |
|
||||
| **Authentication** | | | |
|
||||
| `POST /api/{session}/auth/qr` | ✔️ | ✔️ | ✔️ |
|
||||
| `POST /api/{session}/auth/request-code` | ➖ | ✔️ | ➖ |
|
||||
| `POST /api/{session}/auth/authorize-code` | ➖ | ➖️<br>[#113](https://github.com/devlikeapro/whatsapp-http-api/issues/113) | ➖ |
|
||||
| `GET /api/{session}/auth/captcha` <br>Only in **MOBILE** engine | ➖ | ➖ | ➖ |
|
||||
| `POST /api/{session}/auth/captcha` <br>Only in **MOBILE** engine | ➖ | ➖ | ➖ |
|
||||
| **Screenshot** | | | |
|
||||
| `POST /api/screenshot` | ✔️ | ➖ | ✔️ |
|
||||
|
||||
| **Chatting** | WEBJS | NOWEB | VENOM |
|
||||
|------------------------------------------------------|:-----:|:-----:|:-----:|
|
||||
| `GET /api/checkNumberStatus` | ✔️ | ✔️ | ✔️ |
|
||||
| `GET /api/sendContactVcard` | ➖ | ➖ | ✔️ |
|
||||
| `GET /api/sendText` | ✔️ | ✔️ | ✔️ |
|
||||
| `POST /api/sendText` | ✔️ | ✔️ | ✔️ |
|
||||
| `POST /api/sendPoll` | ➖ | ✔️ | ➖ |
|
||||
| `POST /api/sendLocation` | ✔️ | ✔️ | ✔️ |
|
||||
| `POST /api/sendLinkPreview` | ➖ | ✔️ | ✔️ |
|
||||
| `POST /api/sendImage`  | ✔️ | ✔️ | ✔️ |
|
||||
| `POST /api/sendFile`  | ✔️ | ✔️ | ✔️ |
|
||||
| `POST /api/sendVoice`  | ✔️ | ✔️ | ✔️ |
|
||||
| `POST /api/sendVideo`  | ✔️ | ✔️ | ➖ |
|
||||
| `POST /api/reply` | ✔️ | ✔️ | ✔️ |
|
||||
| `POST /api/sendSeen` | ✔️ | ✔️ | ✔️ |
|
||||
| `POST /api/startTyping` | ✔️ | ✔️ | ✔️ |
|
||||
| `POST /api/stopTyping` | ✔️ | ✔️ | ➖ |
|
||||
| `POST /api/reaction` | ✔️ | ✔️ | ➖ |
|
||||
| `GET /api/messages` | ✔️ | ➖ | ✔️ |
|
||||
|
||||
| | WEBJS | NOWEB | VENOM |
|
||||
|-------------------------------------------------------------------|:-----:|:-----:|:-----:|
|
||||
| **Status** | | | |
|
||||
| `POST /api/{session}/status/text` | ➖ | ✔️ | ➖ |
|
||||
| `POST /api/{session}/status/image`  | ➖ | ✔️ | ➖ |
|
||||
| `POST /api/{session}/status/voice`  | ➖ | ✔️ | ➖ |
|
||||
| `POST /api/{session}/status/video`  | ➖ | ✔️ | ➖ |
|
||||
| **Chats** | | | |
|
||||
| `GET /api/{session}/chats` | ✔️ | ➖ | ➖ |
|
||||
| `DELETE /api/{session}/chats/{chatId}` | ✔️ | ➖ | ➖ |
|
||||
| `GET /api/{session}/chats/{chatId}/messages` | ✔️ | ➖ | ✔️ |
|
||||
| `DELETE /api/{session}/chats/{chatId}/messages` | ✔️ | ➖ | ➖ |
|
||||
| **Contacts** | | | |
|
||||
| `GET /api/contacts` | ✔️ | ➖ | ➖ |
|
||||
| `GET /api/contacts/all` | ✔️ | ➖ | ➖ |
|
||||
| `GET /api/contacts/check-exists` | ✔️ | ✔️ | ✔️ |
|
||||
| `GET /api/contacts/about` | ✔️ | ➖ | ➖ |
|
||||
| `GET /api/contacts/profile-picture` | ✔️ | ➖ | ➖ |
|
||||
| `POST /api/contacts/block` | ✔️ | ➖ | ➖ |
|
||||
| `POST /api/contacts/unblock` | ✔️ | ➖ | ➖ |
|
||||
|
||||
| **Groups** | WEBJS | NOWEB | VENOM |
|
||||
|------------------------------------------------------------------------|:-----:|:-----:|:-----:|
|
||||
| `POST /api/{session}/groups` | ✔️ | ✔️ | ➖ |
|
||||
| `GET /api/{session}/groups` | ✔️ | ✔️ | ➖ |
|
||||
| `GET /api/{session}/groups/{id}` | ✔️ | ✔️ | ➖ |
|
||||
| `DELETE /api/{session}/groups/{id}` | ✔️ | ➖ | ➖ |
|
||||
| `GET /api/{session}/groups/{id}/settings/security/info-admin-only` | ✔️ | ➖ | ➖ |
|
||||
| `PUT /api/{session}/groups/{id}/settings/security/info-admin-only` | ✔️ | ➖ | ➖ |
|
||||
| `GET /api/{session}/groups/{id}/settings/security/messages-admin-only` | ✔️ | ➖ | ➖ |
|
||||
| `PUT /api/{session}/groups/{id}/settings/security/messages-admin-only` | ✔️ | ➖ | ➖ |
|
||||
| `POST /api/{session}/groups/{id}/leave` | ✔️ | ✔️ | ➖ |
|
||||
| `PUT /api/{session}/groups/{id}/description` | ✔️ | ✔️ | ➖ |
|
||||
| `PUT /api/{session}/groups/{id}/subject` | ✔️ | ✔️ | ➖ |
|
||||
| `GET /api/{session}/groups/{id}/invite-code` | ✔️ | ✔️ | ➖ |
|
||||
| `POST /api/{session}/groups/{id}/invite-code/revoke` | ✔️ | ✔️ | ➖ |
|
||||
| `GET /api/{session}/groups/{id}/participants` | ✔️ | ✔️ | ➖ |
|
||||
| `POST /api/{session}/groups/{id}/participants/add` | ✔️ | ✔️ | ➖ |
|
||||
| `POST /api/{session}/groups/{id}/participants/remove` | ✔️ | ✔️ | ➖ |
|
||||
| `POST /api/{session}/groups/{id}/admin/promote` | ✔️ | ✔️ | ➖ |
|
||||
| `POST /api/{session}/groups/{id}/admin/demote` | ✔️ | ✔️ | ➖ |
|
||||
|
||||
| | WEBJS | NOWEB | VENOM |
|
||||
|---------------------------------------------------|:-----:|:-----:|:-----:|
|
||||
| **Presence** | | | |
|
||||
| `POST /api/{session}/presence` | ✔️ | ✔️ | ➖ |
|
||||
| `GET /api/{session}/presence` | ➖ | ✔️ | ➖ |
|
||||
| `GET /api/{session}/presence/{chatId}` | ➖ | ✔️ | ➖ |
|
||||
| `POST /api/{session}/presence/{chatId}/subscribe` | ➖ | ✔️ | ➖ |
|
||||
| **Other** | | | |
|
||||
| `GET /api/version` | ➖ | ✔️ | ➖ |
|
||||
| `GET /health`  | ✔️ | ✔️ | ✔️ |
|
||||
|
||||
### Webhooks
|
||||
|
||||
| **Webhooks** | WEBJS | NOWEB | VENOM |
|
||||
|-----------------------------------------------------|:-----:|:-----:|:-----:|
|
||||
| `message` | ✔️ | ✔️ | ✔️ |
|
||||
| `message` with files  | ✔️ | ✔️ | ✔️ |
|
||||
| `message.reaction` | ✔️ | ✔️ | ➖ |
|
||||
| `message.any` | ✔️ | ✔️ | ✔️ |
|
||||
| `message.ack` | ✔️ | ✔️ | ✔️ |
|
||||
| `message.revoked` | ✔️ | ➖ | ➖ |
|
||||
| `state.change` | ✔️ | ✔️ | ✔️ |
|
||||
| `group.join` | ✔️ | ✔️ | ✔️ |
|
||||
| `group.leave` | ✔️ | ➖ | ➖ |
|
||||
| `presence.update` | ➖ | ✔️ | ➖ |
|
||||
| `poll.vote` | ➖ | ✔️ | ➖ |
|
||||
| `poll.vote.failed` | ➖ | ✔️ | ➖ |
|
||||
@@ -0,0 +1,240 @@
|
||||
---
|
||||
title : "Groups"
|
||||
description: "Groups"
|
||||
lead: ""
|
||||
date: 2020-10-06T08:48:45+00:00
|
||||
lastmod: 2020-10-06T08:48:45+00:00
|
||||
draft: false
|
||||
images: []
|
||||
weight: 140
|
||||
---
|
||||
|
||||
## Endpoints
|
||||
See the list of engines [**that support the feature ->**]({{< relref "/docs/how-to/engines#features" >}}).
|
||||
|
||||
Endpoints for groups. Please look at swagger for details.
|
||||
|
||||
- `{session}` - use the session name for Whatsapp instance that you created with `POST /api/session/start` endpoint
|
||||
- `{groupId}` - group id in format `123123123123@g.us`. You can get the id in a few ways:
|
||||
- By [handling incoming message webhook]({{< relref "/docs/how-to/receive-messages" >}}).
|
||||
- By getting all groups (see below).
|
||||
- By creating a new group and saving the id.
|
||||
|
||||
### Create a new group
|
||||
|
||||
`POST /api/{session}/groups`
|
||||
|
||||
Request:
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "Group name",
|
||||
"participants": [
|
||||
{
|
||||
"id": "123123123123@c.us"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Get all groups
|
||||
|
||||
`GET /api/{session}/groups`
|
||||
|
||||
### Get the group
|
||||
|
||||
`GET /api/{session}/groups/{groupId}`
|
||||
|
||||
### Delete the group
|
||||
|
||||
`DELETE /api/{session}/groups/{groupId}`
|
||||
|
||||
### Leave the group
|
||||
|
||||
`POST /api/{session}/groups/{groupId}/leave`
|
||||
|
||||
### Set group subject
|
||||
|
||||
Updates the group subject.
|
||||
|
||||
Returns `true` if the subject was properly updated. This can return false if the user does not have the necessary
|
||||
permissions.
|
||||
|
||||
`PUT /api/{session}/groups/{groupId}/subject`
|
||||
|
||||
Request:
|
||||
|
||||
```json
|
||||
{
|
||||
"subject": "Group name"
|
||||
}
|
||||
```
|
||||
|
||||
### Set group description
|
||||
|
||||
Updates the group description.
|
||||
|
||||
Returns `true` if the subject was properly updated. This can return false if the user does not have the necessary
|
||||
permissions.
|
||||
|
||||
`PUT /api/{session}/groups/{groupId}/description`
|
||||
|
||||
Request:
|
||||
|
||||
```json
|
||||
{
|
||||
"description": "Group description"
|
||||
}
|
||||
```
|
||||
|
||||
### Security - update group info
|
||||
Updates the group settings to only allow admins to edit group info (title, description, photo).
|
||||
`PUT /api/{session}/groups/{groupId}/settings/security/info-admin-only`
|
||||
```json
|
||||
{
|
||||
"adminsOnly": true
|
||||
}
|
||||
```
|
||||
|
||||
Get the group settings to only allow admins to edit group info (title, description, photo).
|
||||
|
||||
`GET /api/{session}/groups/{groupId}/settings/security/info-admin-only`
|
||||
```json
|
||||
{
|
||||
"adminsOnly": true
|
||||
}
|
||||
```
|
||||
|
||||
Returns `true` if the setting was properly updated. This can return false if the user does not have the necessary permissions.
|
||||
|
||||
|
||||
### Security - who can send messages
|
||||
Updates the group settings to only allow admins to send messages.
|
||||
|
||||
`PUT /api/{session}/groups/{groupId}/settings/security/messages-admin-only`
|
||||
```json
|
||||
{
|
||||
"adminsOnly": true
|
||||
}
|
||||
```
|
||||
Returns `true` if the setting was properly updated. This can return false if the user does not have the necessary permissions.
|
||||
|
||||
Get the group settings to only allow admins to send messages.
|
||||
|
||||
`GET /api/{session}/groups/{groupId}/settings/security/messages-admin-only`
|
||||
```json
|
||||
{
|
||||
"adminsOnly": true
|
||||
}
|
||||
```
|
||||
|
||||
### Participants
|
||||
|
||||
#### Get participants
|
||||
|
||||
`GET /api/{session}/groups/{groupId}/participants`
|
||||
|
||||
#### Add participants
|
||||
|
||||
`POST /api/{session}/groups/{groupId}/participants/add`
|
||||
|
||||
```json
|
||||
{
|
||||
"participants": [
|
||||
{
|
||||
"id": "123123123123@c.us"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
#### Remove participants
|
||||
|
||||
`POST /api/{session}/groups/{groupId}/participants/remove`
|
||||
|
||||
```json
|
||||
{
|
||||
"participants": [
|
||||
{
|
||||
"id": "123123123123@c.us"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Admin
|
||||
|
||||
#### Promote to admin
|
||||
|
||||
Promote participants to admin users.
|
||||
|
||||
`POST /api/{session}/groups/{groupId}/admin/promote`
|
||||
|
||||
```json
|
||||
{
|
||||
"participants": [
|
||||
{
|
||||
"id": "123123123123@c.us"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
#### Demote to regular users
|
||||
|
||||
Demote participants by to regular users.
|
||||
|
||||
`POST /api/{session}/groups/{groupId}/admin/demote`
|
||||
|
||||
```json
|
||||
{
|
||||
"participants": [
|
||||
{
|
||||
"id": "123123123123@c.us"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Invite code
|
||||
|
||||
#### Get invite code
|
||||
|
||||
`GET /api/{session}/groups/{groupId}/invite-code`
|
||||
|
||||
Then you can put it in the url `https://chat.whatsapp.com/{inviteCode}` and send it to contacts.
|
||||
|
||||
#### Revoke invite code
|
||||
|
||||
Invalidates the current group invite code and generates a new one.
|
||||
|
||||
`POST /api/{session}/groups/{groupId}/invite-code/revoke`
|
||||
|
||||
## Webhooks
|
||||
See the list of engines [**that support the feature ->**]({{< relref "/docs/how-to/engines#features" >}}).
|
||||
|
||||
### group.join
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "group.join",
|
||||
"session": "default",
|
||||
"engine": "WEBJS",
|
||||
"payload": {
|
||||
...
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### group.leave
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "group.left",
|
||||
"session": "default",
|
||||
"engine": "WEBJS",
|
||||
"payload": {
|
||||
...
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,115 @@
|
||||
---
|
||||
title : "Install"
|
||||
description: "How to install and update WAHA"
|
||||
lead: ""
|
||||
date: 2020-10-06T08:48:45+00:00
|
||||
lastmod: 2020-10-06T08:48:45+00:00
|
||||
draft: false
|
||||
images: []
|
||||
weight: 109
|
||||
---
|
||||
|
||||
On the page you'll find answers on how to install WAHA.
|
||||
|
||||
If you wish to read a quick start guide which show you how to send you first message via HTTP API
|
||||
please go to [**Quick Start ->**]({{< relref "/docs/overview/quick-start" >}}).
|
||||
|
||||
WAHA is distributed in two versions, that have a similar installation instructions.
|
||||
- WAHA Core  - the basic version that meet almost 80% people's needs. 100% free and [open source ->](https://github.com/devlikeapro/whatsapp-http-api).
|
||||
- WAHA Plus  - the version with advanced messages, security, and reliability features. Donations, no license expiration, quick updates, read more about [Plus Version →]({{< relref "plus-version" >}})
|
||||
|
||||
## Requirements
|
||||
|
||||
Only thing that you must have - installed docker. Please follow the original
|
||||
instruction <a href="https://docs.docker.com/get-docker/" target="_blank" rel="noopener">how to install docker -></a>.
|
||||
|
||||
{{< details "Why Docker?" >}}
|
||||
Docker makes it easy to ship all-in-one solution with the runtime and dependencies. You don't have to worry about
|
||||
language-specific libraries or chrome installation.
|
||||
|
||||
Also, Docker makes installation and update processes so simple, just one command!
|
||||
{{< /details >}}
|
||||
|
||||
## WAHA Core
|
||||
Download the image:
|
||||
```bash
|
||||
docker pull devlikeapro/whatsapp-http-api
|
||||
```
|
||||
|
||||
Run the container:
|
||||
```bash
|
||||
docker run -it -p 3000:3000/tcp devlikeapro/whatsapp-http-api
|
||||
```
|
||||
|
||||
Open API documentation [http://localhost:3000](http://localhost:3000).
|
||||
|
||||
## WAHA Plus
|
||||
Before installing WAHA Plus version you need to get a key, `{KEY}` in below commands, in format `dckr_pat_1111`
|
||||
|
||||
We distribute the key via two platforms (Boosty and Patreon) and you'll find the active key **in the latest post**.
|
||||
Keep in mind that we publish new key every month, so you must get the latest active key in order to download
|
||||
the latest image.
|
||||
|
||||
Read more about [**Plus Version →**]({{< relref "plus-version" >}})
|
||||
|
||||
{{< alert icon="👉" text="Subscribe as **PRO** level and get your personal key which won't expire every month while you're supporting the project" />}}
|
||||
|
||||
Download the image:
|
||||
```bash
|
||||
docker login -u devlikeapro -p {KEY}
|
||||
docker pull devlikeapro/whatsapp-http-api-plus
|
||||
docker logout
|
||||
```
|
||||
|
||||
Run the container:
|
||||
```bash
|
||||
docker run -it -p 3000:3000/tcp devlikeapro/whatsapp-http-api-plus
|
||||
```
|
||||
|
||||
Open API documentation [http://localhost:3000](http://localhost:3000).
|
||||
|
||||
## ARM
|
||||
If you’re using **ARM** processor (like Apple Silicon, Apple M1, etc.) - add `:arm` tag at the end of the image name in the above commands.
|
||||
- **WAHA Core** - `devlikeapro/whatsapp-http-api:arm`
|
||||
- **WAHA Plus** - `devlikeapro/whatsapp-http-api-plus:arm`
|
||||
|
||||
You can also rename the image after you downloaded it with `docker tag` command,
|
||||
so you can use the same image names in commands:
|
||||
```bash
|
||||
# Rename WAHA Core ARM
|
||||
docker tag devlikeapro/whatsapp-http-api:arm devlikeapro/whatsapp-http-api
|
||||
|
||||
# Rename WAHA Plus ARM
|
||||
docker tag devlikeapro/whatsapp-http-api-plus:arm devlikeapro/whatsapp-http-api-plus
|
||||
```
|
||||
|
||||
|
||||
## Update WAHA
|
||||
{{< alert icon="💡" text="Please test all new versions in the development environment before updating production!" />}}
|
||||
|
||||
The commands are the same as for downloading, expected you need to restart **all working containers** after you download new image.
|
||||
|
||||
**WAHA Core** - download new image
|
||||
```bash
|
||||
# Download the image
|
||||
docker pull devlikeapro/whatsapp-http-api
|
||||
|
||||
# Restart all containers
|
||||
docker stop whatsapp-http-api
|
||||
docker rm whatsapp-http-api
|
||||
docker run -it --rm -p 3000:3000/tcp --name whatsapp-http-api devlikeapro/whatsapp-http-api
|
||||
```
|
||||
|
||||
**WAHA Plus** - download new image (please use **the latest key** from Boosty or Patreon)
|
||||
```bash
|
||||
# Download the image
|
||||
docker login -u devlikeapro -p {KEY}
|
||||
docker pull devlikeapro/whatsapp-http-api-plus
|
||||
docker logout
|
||||
docker stop whatsapp-http-api
|
||||
|
||||
# Restart all containers
|
||||
docker stop whatsapp-http-api
|
||||
docker rm whatsapp-http-api
|
||||
docker run -it --rm -p 3000:3000/tcp --name whatsapp-http-api devlikeapro/whatsapp-http-api
|
||||
```
|
||||
@@ -0,0 +1,192 @@
|
||||
---
|
||||
title: "Other"
|
||||
description: "Other features and API"
|
||||
lead: ""
|
||||
date: 2020-10-06T08:48:45+00:00
|
||||
lastmod: 2020-10-06T08:48:45+00:00
|
||||
draft: false
|
||||
images: [ ]
|
||||
weight: 802
|
||||
---
|
||||
|
||||
This page provides useful information about other features and API that are not covered in the other sections.
|
||||
|
||||
## Health Check
|
||||
<b>Health check is available in [WAHA Plus ]({{< relref "/docs/how-to/plus-version" >}}) only.</b>
|
||||
|
||||
The health check endpoint is used to determine the health of the service.
|
||||
|
||||
```
|
||||
GET /health
|
||||
```
|
||||
|
||||
It returns a **200 OK** status code if the service is healthy.
|
||||
|
||||
The response format:
|
||||
```json
|
||||
{
|
||||
"status": "ok",
|
||||
"info": {
|
||||
"metric1": {
|
||||
"field": "value"
|
||||
},
|
||||
"metric2": {
|
||||
"field": "value"
|
||||
}
|
||||
},
|
||||
"error": {},
|
||||
"details": {}
|
||||
}
|
||||
```
|
||||
|
||||
Where:
|
||||
- `status`: `'error' | 'ok' | 'shutting_down'` - If any health indicator failed the status will be `'error'`. If the app is shutting down but still accepting HTTP requests, the health check will have the `'shutting_down'` status.
|
||||
- `info`: Object containing information of each health indicator which is of status `'up'`, or in other words "healthy".
|
||||
- `error`: Object containing information of each health indicator which is of status `'down'`, or in other words "unhealthy".
|
||||
- `details`: Object containing detailed information of each health indicator.
|
||||
|
||||
### Health Check Indicators
|
||||
Few things we check in the health check:
|
||||
- Media files storage space - `mediaFiles.space`
|
||||
- Sessions files storage space - `sessionsFiles.space`
|
||||
- MongoDB connection - `mongodb`
|
||||
|
||||
### Configuration
|
||||
The following environment variables can be used to configure the health check:
|
||||
- `WHATSAPP_HEALTH_MEDIA_FILES_THRESHOLD_MB` - the threshold in MB for the media files storage. The default value is `100`.
|
||||
- `WHATSAPP_HEALTH_SESSIONS_FILES_THRESHOLD_MB` - the threshold in MB for the sessions files storage. The default value is `100`.
|
||||
- `WHATSAPP_HEALTH_MONGODB_TIMEOUT` - the timeout in milliseconds for the MongoDB health check. The default value is `5000`.
|
||||
|
||||
### Examples
|
||||
**Healthy response** when you use [Local Storage]({{< relref "/docs/how-to/storages#sessions" >}}) for session authentication:
|
||||
|
||||
**200 OK**
|
||||
```json
|
||||
{
|
||||
"status": "ok",
|
||||
"info": {
|
||||
"mediaFiles.space": {
|
||||
"status": "up",
|
||||
"path": "/tmp/whatsapp-files",
|
||||
"diskPath": "/",
|
||||
"free": 132979355648,
|
||||
"threshold": 104857600
|
||||
},
|
||||
"sessionsFiles.space": {
|
||||
"status": "up",
|
||||
"path": "/app/.sessions",
|
||||
"diskPath": "/",
|
||||
"free": 132979355648,
|
||||
"threshold": 104857600
|
||||
}
|
||||
},
|
||||
"error": {},
|
||||
"details": {
|
||||
"mediaFiles.space": {
|
||||
"status": "up",
|
||||
"path": "/tmp/whatsapp-files",
|
||||
"diskPath": "/",
|
||||
"free": 132979355648,
|
||||
"threshold": 104857600
|
||||
},
|
||||
"sessionsFiles.space": {
|
||||
"status": "up",
|
||||
"path": "/app/.sessions",
|
||||
"diskPath": "/",
|
||||
"free": 132979355648,
|
||||
"threshold": 104857600
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Healthy response** when you use [MongoDB Storage]({{< relref "/docs/how-to/storages#sessions" >}}) for session authentication:
|
||||
|
||||
**200 OK**
|
||||
```json
|
||||
{
|
||||
"status": "ok",
|
||||
"info": {
|
||||
"mediaFiles.space": {
|
||||
"status": "up",
|
||||
"path": "/tmp/whatsapp-files",
|
||||
"diskPath": "/",
|
||||
"free": 132977496064,
|
||||
"threshold": 104857600
|
||||
},
|
||||
"mongodb": {
|
||||
"status": "up",
|
||||
"message": "Up and running"
|
||||
}
|
||||
},
|
||||
"error": {},
|
||||
"details": {
|
||||
"mediaFiles.space": {
|
||||
"status": "up",
|
||||
"path": "/tmp/whatsapp-files",
|
||||
"diskPath": "/",
|
||||
"free": 132977496064,
|
||||
"threshold": 104857600
|
||||
},
|
||||
"mongodb": {
|
||||
"status": "up",
|
||||
"message": "Up and running"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Unhealthy response example**
|
||||
|
||||
**503 Service Unavailable**
|
||||
```json
|
||||
{
|
||||
"status": "error",
|
||||
"info": {
|
||||
"mediaFiles.space": {
|
||||
"status": "up",
|
||||
"path": "/tmp/whatsapp-files",
|
||||
"diskPath": "/",
|
||||
"free": 132976623616,
|
||||
"threshold": 104857600
|
||||
}
|
||||
},
|
||||
"error": {
|
||||
"mongodb": {
|
||||
"status": "down",
|
||||
"error": "Timeout"
|
||||
}
|
||||
},
|
||||
"details": {
|
||||
"mediaFiles.space": {
|
||||
"status": "up",
|
||||
"path": "/tmp/whatsapp-files",
|
||||
"diskPath": "/",
|
||||
"free": 132976623616,
|
||||
"threshold": 104857600
|
||||
},
|
||||
"mongodb": {
|
||||
"status": "down",
|
||||
"error": "Timeout"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Get version
|
||||
Returns the version of the installed docker image.
|
||||
```
|
||||
GET /api/version
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"version": "2024.2.3",
|
||||
"engine": "NOWEB",
|
||||
"tier": "PLUS",
|
||||
"browser": "/usr/bin/google-chrome-stable"
|
||||
}
|
||||
```
|
||||
|
||||
|
Before Width: | Height: | Size: 301 KiB |
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><svg width="145px" height="40px" viewBox="0 0 145 40" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><linearGradient x1="61.5370404%" y1="13%" x2="34.2376801%" y2="129.365079%" id="linearGradient-1"><stop stop-color="#EF7829" offset="0%"/><stop stop-color="#F0692A" offset="28%"/><stop stop-color="#F15E2C" offset="63%"/><stop stop-color="#F15A2C" offset="100%"/></linearGradient></defs><g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Blocks/Header_Unlogged" transform="translate(-15.000000, -15.000000)"><g id="icons/boosty_logo" transform="translate(15.000000, 15.000000)"><g id="Shape"><path d="M138.119363,13.14856 L132.002653,22.63144 L131.397878,13.14856 L122.575597,13.14856 C123.384615,10.366 124.037135,8.13256 124.037135,8.13256 L124.381963,7.01848 L117.6313,7.01848 L117.312997,8.13256 L115.851459,13.14856 L108.660477,13.14856 C102.750663,13.14856 99.4244032,14.8276 98.0503979,18.00352 C97.2546419,15.09952 94.6206897,13.14856 90.5782493,13.14856 C87.2902077,13.135208 84.1128672,14.3300173 81.6551724,16.504 C80.464191,14.45536 78.1061008,13.1512 74.8116711,13.1512 C71.2975199,13.1360778 67.9189855,14.5000837 65.4084881,16.94752 C64.3103448,14.656 61.8541114,13.14856 58.3262599,13.14856 C57.1586378,13.1510938 55.9961737,13.302814 54.867374,13.6 L55.397878,11.77312 C55.4066092,11.7439195 55.4181572,11.7156279 55.4323607,11.68864 L56.7904509,7 L50.066313,7 L45.7798408,21.73384 C45.668435,22.02952 45.5676393,22.32784 45.4801061,22.63144 C45.2902336,23.2752559 45.1623364,23.9355911 45.0981432,24.60352 C44.5384615,28.714 46.3474801,31.816 51.3660477,32.0272 C51.8475451,32.0843575 52.332067,32.1125687 52.8169761,32.11168 C56.2925823,32.0722669 59.6211655,30.7100879 62.1193634,28.3048 C63.1564987,30.6148 65.5676393,32.11168 69.2970822,32.11168 C72.5436452,32.0790306 75.6705362,30.8873894 78.1087533,28.7536 C79.2493369,30.80488 81.5862069,32.11168 85.061008,32.11168 L101.917772,32.11168 C107.143236,32.11168 110.095491,31.08472 111.6313,28.85392 C111.6313,30.98176 112.851459,32.11168 115.941645,32.11168 C118.437666,32.11168 121.777188,31.5652 126.366048,30.43792 L119.687003,39.9208 L126.411141,39.9208 L144.846154,13.14856 L138.119363,13.14856 Z M58.9310345,22.63144 C58.3023873,24.79096 56.2785146,26.53336 54.4217507,26.53336 C52.5649867,26.53336 51.5676393,24.79096 52.1962865,22.63144 C52.8249337,20.47192 54.8488064,18.72688 56.6923077,18.72688 C58.535809,18.72688 59.5596817,20.464 58.9310345,22.63144 Z M75.4164456,22.63144 C74.7877984,24.79096 72.7639257,26.53336 70.9071618,26.53336 C69.0503979,26.53336 68.0769231,24.79096 68.6923077,22.63144 C69.3076923,20.47192 71.3448276,18.72688 73.2015915,18.72688 C75.0583554,18.72688 76.0344828,20.464 75.4164456,22.63144 Z M84.4562334,22.63144 C85.0848806,20.46928 87.1087533,18.72688 88.9522546,18.72688 C90.795756,18.72688 91.8090186,20.46928 91.1803714,22.63144 C90.5517241,24.7936 88.5941645,26.4832 86.7586207,26.536 L86.6074271,26.536 C84.801061,26.4832 83.8355438,24.76192 84.4562334,22.63144 Z M106.127321,25.85752 C105.787798,26.64952 103.132626,26.53072 102.466844,26.54128 L95.928382,26.536 C96.8103436,25.360374 97.4758216,24.0383816 97.8938992,22.63144 C97.9363395,22.48888 97.9734748,22.34896 98.0079576,22.20904 C98.7108753,23.2096 100.201592,24.11248 103.100796,24.68536 C105.864721,25.216 106.3687,25.05496 106.127321,25.85752 Z M112.777188,23.7244 C112.204244,21.49624 109.721485,20.6224 106.241379,20.2 C104.785146,20.02576 103.965517,19.95712 104.148541,19.3288 C104.289125,18.8404 105.018568,18.73744 106.586207,18.73744 L114.230769,18.73744 L112.777188,23.7244 Z M119.496021,23.74552 C119.496021,23.70064 120.151194,21.4804 120.952255,18.72952 L125.217507,18.72952 L125.915119,25.8364 C118.888594,27.328 118.713528,26.92672 119.496021,23.74552 L119.496021,23.74552 Z" fill="#242B2C" fill-rule="nonzero"/><path d="M1.03841146,23.8920635 L7.81508464,0 L18.2158138,0 L16.1119922,7.40740741 C16.0897554,7.44994435 16.0716695,7.49460291 16.0579948,7.54074074 L10.5357227,27.1005291 L15.6903971,27.1005291 C13.537424,32.5848325 11.8524284,36.8846561 10.6354102,40 C1.12771484,39.8920635 -1.53892578,32.9481481 0.795423177,24.7322751 L1.03841146,23.8920635 Z M10.672793,40 L23.2084961,21.6 L17.8897526,21.6 L22.5169141,9.81375661 C30.4586849,10.6603175 34.1824284,17.0285714 31.993457,24.7301587 C29.6424935,33.015873 20.1285677,40 10.8659375,40 L10.672793,40 Z" fill="url(#linearGradient-1)" fill-rule="nonzero"/></g></g></g></g></svg>
|
||||
|
After Width: | Height: | Size: 4.4 KiB |
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title : "Plus version"
|
||||
description: "Plus version"
|
||||
title : "WAHA Plus"
|
||||
description: "WAHA Plus"
|
||||
lead: ""
|
||||
date: 2020-10-06T08:48:45+00:00
|
||||
lastmod: 2020-10-06T08:48:45+00:00
|
||||
@@ -16,39 +16,21 @@ weight: 900
|
||||
1. Core  the basic version that meet almost 80% people’s needs. 100% free and open source.
|
||||
2. Plus  the version with advanced messages, security, and reliability features.
|
||||
|
||||
**If you enjoy Core  version and would like to support the project** - you can subscribe on Core level.
|
||||
It's not expensive, but it supports the project a lot!
|
||||
- [Boosty ->](https://boosty.to/wa-http-api)
|
||||
- [Patreon ->](https://patreon.com/wa_http_api)
|
||||
You support the project and get **WAHA Plus** on
|
||||
<a href="https://patreon.com/wa_http_api" target="_blank">
|
||||
<b>
|
||||
Patreon ->
|
||||
</b>
|
||||
</a>
|
||||
or
|
||||
<a href="https://boosty.to/wa-http-api" target="_blank">
|
||||
<b>
|
||||
Boosty ->
|
||||
</b>
|
||||
</a>
|
||||
.
|
||||
|
||||
|
||||
## Features
|
||||
|
||||
The Plus additional features are:
|
||||
|
||||
1. [**Send images\files\voices** →]({{< relref "/docs/how-to/send-messages" >}})
|
||||
2. [**Receive images\files\voices** →]({{< relref "/docs/how-to/receive-messages" >}})
|
||||
3. [**Webhook retries** →]({{< relref "/docs/how-to/receive-messages#retries" >}})
|
||||
4. [**Security** →]({{< relref "/docs/how-to/security" >}})
|
||||
5. [**Saving sessions** →]({{< relref "/docs/how-to/sessions" >}})
|
||||
6. [**Support multiple sessions** →]({{< relref "/docs/how-to/sessions" >}})
|
||||
7. **Instant updates** - no one month delay in getting bugfixes or new features
|
||||
8. **Priority in support** - on both bugs and features
|
||||
|
||||
## Differences
|
||||
|
||||
What is the difference between **WAHA Plus** and other SaaS solutions for WhatsApp HTTP API?
|
||||
|
||||
| | WAHA Plus | Others |
|
||||
|--------------------|:-------------------------------------------------:|----------------------------------------------------------------------------------:|
|
||||
| **Sessions** | ✔️ No limits on **accounts** or **servers**! | ➖ One account for $50/month. |
|
||||
| **Infrastructure** | ✔️ On-Premise - your server, your infrastructure! | ➖ Insecure cloud solution. |
|
||||
| **Security** | ✔️ No data leaks! | ➖ You have to give access to customers' data - phone number, name, your messages. |
|
||||
| **License Term** | ✔️ No license checks! | ➖ One month |
|
||||
| **Message price** | ✔️ All messages are Free! | ➖ Some solutions have a price for messages - $1/100 messages. |
|
||||
| **Expenses** | ✔️ $19 **donation**! | ➖ Monthly payment starts from $50 |
|
||||
|
||||
## Donations
|
||||
### Donations
|
||||
|
||||
WAHA Plus version is available through **donations** (subscriptions).
|
||||
|
||||
@@ -67,36 +49,90 @@ Treat **WAHA Plus** it as an additional episode, behind-the-scenes videos, our n
|
||||
We donate most of the donations down to the stream to the underlying libraries and tools - JS-community, Node, other libraries authors, personal contributors.
|
||||
By donating to the **WAHA** you donate to the Open Source world!
|
||||
|
||||
## Get Plus 
|
||||
### Tiers
|
||||
|
||||
For $19 one-time donation you get:
|
||||
The more you support the project - the more you get!
|
||||
|
||||
| | Core | Plus | Advanced | Pro |
|
||||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------|---------|:--------:|:-------:|
|
||||
| Messages limit | **∞** | **∞** | **∞** | **∞** |
|
||||
| [Send and receive text messages ->]({{< relref "/docs/how-to/send-messages" >}}) | ✔️ | ✔️ | ✔️ | ✔️ |
|
||||
| No license checks on installed instances | ✔️ | ✔️ | ✔️ | ✔️ |
|
||||
| [Sessions limit ->]({{< relref "/docs/how-to/sessions" >}}) | **1** | **∞** | **∞** | **∞** |
|
||||
| [Send and receive files ->]({{< relref "/docs/how-to/send-messages" >}}) | ➖️ | ✔️ | ✔️ | ✔️ |
|
||||
| [Built-in Security ->]({{< relref "/docs/how-to/security" >}}) | ➖️ | ✔️ | ✔️ | ✔️ |
|
||||
| [**Webhook retries** →]({{< relref "/docs/how-to/receive-messages#retries" >}}) | ➖️ | ✔️ | ✔️ | ✔️ |
|
||||
| [MongoDB support ->]({{< relref "/docs/how-to/storages" >}}) | ➖️ | ✔️ | ✔️ | ✔️ |
|
||||
| Access to **WAHA Plus**  docker image with a personal key. | ➖️ | ✔️ | ✔️ | ✔️ |
|
||||
| Special badge ([](https://waha.devlike.pro/docs/how-to/plus-version/#tiers)) and labels (`patron:TIER`) on [project's issues, PRs and Discussion](https://github.com/devlikeapro/whatsapp-http-api) to highlight your support to the project! | | ✔️ | ✔️ | ✔️ |
|
||||
| An invitation to **a private Github repository** so you have the **WAHA Plus** source code. | ➖️ | ➖️ | ✔️ | ✔️️ |
|
||||
| Access to a Telegram group where we provide support and assistance. | ➖️ | ➖️ | ➖ | ✔️ |
|
||||
| Access to an [experimental MOBILE engine]({{< relref "/docs/how-to/plus-version#tiers" >}})!. | ➖️ | ➖️ | ➖ | ✔️ |
|
||||
| **Donation** | **FREE** | **$19** | **$39** | **$99** |
|
||||
|
||||
For **$19** donation you get:
|
||||
1. **Secret password** for Docker Hub to download Plus image: `devlikeapro/whatsapp-http-api-plus`.
|
||||
2. **All updates for one month** for the Plus image.
|
||||
3. **NO LICENSE CHECKS** on installed instances!
|
||||
4. **NO LICENSE EXPIRATION** on installed instances! We repeated it twice to make sure that you've got it 😊
|
||||
|
||||
{{< alert icon="👉" text="We don't mind if you stay subscribed with us after one month :)" />}}
|
||||
|
||||
### Boosty
|
||||
We use Boosty to get donations (Patreon analogue) - [https://boosty.to/wa-http-api](https://boosty.to/wa-http-api).
|
||||
|
||||
Go ahead and get your monthly password to get no license expiration WhatsApp HTTP API!
|
||||
|
||||
{{< alert icon="💡" text="If you stay subscribed - the donation amount will never change for you and always be $19 to get monthly updates!" />}}
|
||||
|
||||

|
||||
|
||||
### Why WAHA?
|
||||
|
||||
What is the difference between **WAHA Plus** and **other SaaS solutions** for WhatsApp HTTP API?
|
||||
|
||||
| | WAHA Plus | Others |
|
||||
|--------------------|:-------------------------------------------------:|----------------------------------------------------------------------------------:|
|
||||
| **Sessions** | ✔️ No limits on **accounts** or **servers**! | ➖ One account for $50/month. |
|
||||
| **Infrastructure** | ✔️ On-Premise - your server, your infrastructure! | ➖ Insecure cloud solution. |
|
||||
| **Security** | ✔️ No data leaks! | ➖ You have to give access to customers' data - phone number, name, your messages. |
|
||||
| **License Term** | ✔️ No license checks! | ➖ One month |
|
||||
| **Message price** | ✔️ All messages are Free! | ➖ Some solutions have a price for messages - $1/100 messages. |
|
||||
| **Expenses** | ✔️ $19 **donation**! | ➖ Monthly payment starts from $50 |
|
||||
|
||||
|
||||
## Get Plus 
|
||||
|
||||
|
||||
### Patreon
|
||||
You can support the project and get WAHA Plus version on Patreon: [https://patreon.com/wa_http_api](https://patreon.com/wa_http_api)
|
||||
<p align="center">
|
||||
<img src="patreon.png" alt="Patreon" />
|
||||
</p>
|
||||
|
||||
{{< alert icon="💡" text="Please look at Boosty - we prefer it because of lower fees, so we can donate more to the projects!" />}}
|
||||
Support the project and get WAHA Plus version on
|
||||
<a href="https://patreon.com/wa_http_api" target="_blank">
|
||||
<b>
|
||||
Patreon ->
|
||||
</b>
|
||||
</a>
|
||||
|
||||
Go ahead and get your own WhatsApp HTTP API!
|
||||
|
||||
### Install Plus
|
||||
After you get the password, use it to login and download docker image:
|
||||
### Boosty
|
||||
<p align="center">
|
||||
<img src="boosty.svg" alt="Patreon" />
|
||||
<br/>
|
||||
<br/>
|
||||
</p>
|
||||
|
||||
Support the project and get WAHA Plus version on
|
||||
<a href="https://boosty.to/wa-http-api" target="_blank">
|
||||
<b>
|
||||
Boosty ->
|
||||
</b>
|
||||
</a>
|
||||
|
||||
Go ahead and get your own WhatsApp HTTP API!
|
||||
|
||||
## Install Plus
|
||||
After you get the password, get your login to Docker Hub in [Patron Portal ->](https://portal.devlike.pro/)
|
||||
and run the commands:
|
||||
```bash
|
||||
docker login -u devlikeapro -p {PASSWORD}
|
||||
docker login -u devlikeapro -p {KEY}
|
||||
docker pull devlikeapro/whatsapp-http-api-plus
|
||||
docker logout
|
||||
```
|
||||
Then in all commands use **Plus** image `devlikeapro/whatsapp-http-api-plus` instead of Core `devlikeapro/whatsapp-http-api`.
|
||||
|
||||
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 44 KiB |
@@ -0,0 +1,220 @@
|
||||
---
|
||||
title: "Polls"
|
||||
description: "How to send polls and receive votes"
|
||||
lead: ""
|
||||
date: 2020-10-06T08:48:45+00:00
|
||||
lastmod: 2020-10-06T08:48:45+00:00
|
||||
draft: false
|
||||
images: [ ]
|
||||
weight: 126
|
||||
---
|
||||
|
||||
|
||||
Waiting for WEBJS engine to support it, and we'll add it ASAP!
|
||||
|
||||

|
||||
|
||||
## Endpoints
|
||||
See the list of engines [**that support the feature ->**]({{< relref "/docs/how-to/engines#features" >}}).
|
||||
|
||||
### Send poll
|
||||
|
||||
Use the endpoint to send a poll!
|
||||
|
||||
```bash
|
||||
POST /api/sendPoll
|
||||
```
|
||||
|
||||
The request body is pretty simple:
|
||||
```json
|
||||
{
|
||||
"session": "default",
|
||||
"chatId": "123123123@c.us",
|
||||
"poll": {
|
||||
"name": "How are you?",
|
||||
"options": [
|
||||
"Awesome!",
|
||||
"Good!",
|
||||
"Not bad!"
|
||||
],
|
||||
"multipleAnswers": false
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The response you get back:
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "true_321321321@c.us_83ACBAAAAAAAAAAAAAAAAAAAA",
|
||||
"other-fields-here": "value"
|
||||
}
|
||||
```
|
||||
|
||||
You must save the `id` field from the response in your database so that you can identify the poll for which you receive
|
||||
a vote (see webhook events below).
|
||||
|
||||
## Webhooks
|
||||
See the list of engines [**that support the feature ->**]({{< relref "/docs/how-to/engines#features" >}}).
|
||||
|
||||
### poll.vote
|
||||
|
||||
With this event, you receive new votes for the poll sent.
|
||||
|
||||
#### Vote from a user in direct messages.
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "poll.vote",
|
||||
"session": "default",
|
||||
"payload": {
|
||||
"vote": {
|
||||
"id": "false_1111111111@c.us_83ACBE602A05C79B234B54415E95EE8A",
|
||||
"to": "me",
|
||||
"from": "1111111@c.us",
|
||||
"fromMe": false,
|
||||
"selectedOptions": [
|
||||
"Awesome!"
|
||||
],
|
||||
"timestamp": 1692861427
|
||||
},
|
||||
"poll": {
|
||||
"id": "true_1111111111@c.us_BAE5F2EF5C69001E",
|
||||
"to": "1111111111@c.us",
|
||||
"from": "me",
|
||||
"fromMe": true
|
||||
}
|
||||
},
|
||||
"engine": "NOWEB"
|
||||
}
|
||||
```
|
||||
|
||||
#### Do I receive votes only for my polls?
|
||||
|
||||
No, you receive all votes. Keep in mind that you'll get all votes with this event, even from other polls. To identify
|
||||
that it's your poll, look at the `poll.fromMe` field.
|
||||
|
||||
#### How to handle multiple-answer votes
|
||||
|
||||
For `multipleAnswers: true`, you receive the `selectedOptions` with all the selected values at a certain moment. So if a
|
||||
user has chosen 3 options from the poll, you will receive **3** `poll.vote` events:
|
||||
|
||||
1. `selectedOptions: ["First"]`
|
||||
2. `selectedOptions: ["First", "Second"]`
|
||||
3. `selectedOptions: ["First", "Second", "Third"]`
|
||||
|
||||
#### Timestamp
|
||||
|
||||
If a user clicks on the poll multiple times, you will receive multiple `poll.vote` events. This is true for
|
||||
both `multipleAnswers: false` (when a user changes their mind about answers) and `multipleAnswers: true` (when a user
|
||||
selects two or more options) events.
|
||||
|
||||
There is a little chance that you may receive votes in the wrong order (due to the nature of HTTP and Webhooks),
|
||||
like `1-3-2` instead of `1-2-3`. To determine the right order, look at the `timestamp` field. The event with a
|
||||
higher `timestamp` value is more recent.
|
||||
|
||||
👉 It's important to save the `timestamp` for each vote in your database and compare them as numbers, without converting to
|
||||
internal datetime. Right now, the `timestamp` shows the timestamp in seconds, but it may be changed to milliseconds in
|
||||
the future.
|
||||
|
||||
#### Vote from a user in a group
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "poll.vote",
|
||||
"session": "default",
|
||||
"payload": {
|
||||
"vote": {
|
||||
"id": "false_3333333333333@g.us_1C18A7EAADD2A8D0324755D241C4238A",
|
||||
"to": "3333333333333@g.us",
|
||||
"from": "1111111111@c.us",
|
||||
"fromMe": false,
|
||||
"selectedOptions": [
|
||||
"Awesome!"
|
||||
],
|
||||
"timestamp": 1692861427
|
||||
},
|
||||
"poll": {
|
||||
"id": "true_3333333333333@g.us_BAE5304BA1ECF704",
|
||||
"to": "33333333333333@g.us",
|
||||
"from": "222222222@c.us",
|
||||
"fromMe": true
|
||||
}
|
||||
},
|
||||
"engine": "NOWEB"
|
||||
}
|
||||
```
|
||||
|
||||
### poll.vote.failed
|
||||
|
||||
There may be cases when WAHA fails to decrypt a vote from the user. In such cases, you will receive
|
||||
a `poll.vote.failed` event on your webhook.
|
||||
|
||||
The payload for `poll.vote.failed` is the same as for `poll.vote`, but with an empty list in `selectedOptions`.
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "poll.vote.failed",
|
||||
"session": "default",
|
||||
"payload": {
|
||||
"vote": {
|
||||
"id": "false_11111111111@c.us_2E8C4CDA89EDE3BC0BC7F605364B8451",
|
||||
"to": "me",
|
||||
"from": "111111111@c.us",
|
||||
"fromMe": false,
|
||||
"selectedOptions": [],
|
||||
"timestamp": 1692956972
|
||||
},
|
||||
"poll": {
|
||||
"id": "true_1111111111@c.us_BAE595F4E0A2042C",
|
||||
"to": "111111111@c.us",
|
||||
"from": "me",
|
||||
"fromMe": true
|
||||
}
|
||||
},
|
||||
"engine": "NOWEB"
|
||||
}
|
||||
```
|
||||
|
||||
#### How should I handle poll.vote.failed events?
|
||||
|
||||
When you send a poll, save the poll configuration (question and options) in your database with the `id` field from the
|
||||
response you received from `POST /api/sendPoll`.
|
||||
|
||||
Later, when you receive a `poll.vote.failed` event, find the `id` for the poll in the database and repeat the same
|
||||
question to the user, apologizing for the inconvenience.
|
||||
For example, you can say:
|
||||
|
||||
> Sorry, we don't understand your choice 😞
|
||||
>
|
||||
> Please click one more time on the message below 👇
|
||||
|
||||
After the user clicks on the poll again, you will receive a `poll.vote` event with their choice.
|
||||
|
||||

|
||||
|
||||
#### How to test poll.vote.failed events?
|
||||
|
||||
To receive `poll.vote.failed` events, follow these steps:
|
||||
|
||||
1. Start a session and authorize it with a QR code.
|
||||
2. Send a poll to a chat.
|
||||
3. Stop the session (logout is not required).
|
||||
4. Start the session again.
|
||||
5. Vote on the poll.
|
||||
6. You will receive a `poll.vote.failed` event.
|
||||
|
||||
#### Why does the poll.vote.failed event occur and when will it be fixed?
|
||||
|
||||
The issue occurs because WAHA does not have a proper storage system, but polls require proper storage in order to
|
||||
decrypt votes later.
|
||||
|
||||
There will be two fixes for this:
|
||||
|
||||
1. In the short term, a [local file storage](https://github.com/devlikeapro/whatsapp-http-api/issues/188) will be used
|
||||
to save poll keys.
|
||||
2. In the long term, work is being done
|
||||
on [remote storages](https://github.com/devlikeapro/whatsapp-http-api/issues/41).
|
||||
|
||||
Even after these fixes are implemented, it's better to handle `poll.vote.failed` events anyway, so your application is
|
||||
prepared for such cases!
|
||||
|
After Width: | Height: | Size: 50 KiB |
@@ -0,0 +1,157 @@
|
||||
---
|
||||
title: "Presence"
|
||||
description: "Presence"
|
||||
lead: ""
|
||||
date: 2020-10-06T08:48:45+00:00
|
||||
lastmod: 2020-10-06T08:48:45+00:00
|
||||
draft: false
|
||||
images: [ ]
|
||||
weight: 801
|
||||
---
|
||||
|
||||
You can get presence information (online, offline with last seen, typing status) for a contact if they share their
|
||||
presence information.
|
||||
|
||||
Possible presence statuses that you can set or get for chats:
|
||||
- `online`
|
||||
- `offline`
|
||||
- `typing`
|
||||
- `recording`
|
||||
- `paused` resets the chat presence after you were `typing`
|
||||
|
||||
|
||||
## Endpoints
|
||||
See the list of engines [**that support the feature ->**]({{< relref "/docs/how-to/engines#features" >}}).
|
||||
|
||||
### Set presence
|
||||
You can set your global or chat-related presence with `POST /api/{session}/presence` endpoint
|
||||
|
||||
Start typing to a chat (you can use `POST /startTyping` instead)
|
||||
```
|
||||
POST /api/{session}/presence
|
||||
{
|
||||
"chatId": "111111111@c.us",
|
||||
"presence": "typing"
|
||||
}
|
||||
```
|
||||
|
||||
Clear "typing" state (you can use `POST /stopTyping` instead)
|
||||
```
|
||||
POST /api/{session}/presence
|
||||
{
|
||||
"chatId": "111111111@c.us",
|
||||
"presence": "paused"
|
||||
}
|
||||
```
|
||||
|
||||
Set global "online", all contacts will see it
|
||||
```
|
||||
POST /api/{session}/presence
|
||||
{
|
||||
"presence": "online"
|
||||
}
|
||||
```
|
||||
|
||||
💡 In the multi-device version of WhatsApp - if a desktop client is active, WhatsApp doesn't send push notifications
|
||||
to the device.
|
||||
If you would like to receive said notifications - you need to mark a session's presence as `offline`.
|
||||
|
||||
```
|
||||
POST /api/{session}/presence
|
||||
{
|
||||
"presence": "offline"
|
||||
}
|
||||
```
|
||||
|
||||
### Get all chats presence
|
||||
|
||||
Here's few notes about fields:
|
||||
|
||||
- `chatId` - either contact id (`213213213@c.us`) or group chat id (`1111111111111@g.us`).
|
||||
- `lastSeen` - contains Unix timestamps indicating when a participant was last online
|
||||
- `lastKnownPresence` - contains the last known presence status, which can be
|
||||
`offline`, `online`, `typing`, `recording`, or `paused`
|
||||
|
||||
|
||||
You can get all presence information available for a session by calling `GET /api/{session}/presence/`.
|
||||
It returns both groups' and personal chats' presence information.
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"id": "2132132130@c.us",
|
||||
"presences": [
|
||||
{
|
||||
"participant": "2132132130@c.us",
|
||||
"lastKnownPresence": "offline",
|
||||
"lastSeen": 1686719326
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "11111111111111111111111@g.us",
|
||||
"presences": [
|
||||
{
|
||||
"participant": "11111111111111111111111@g.us",
|
||||
"lastKnownPresence": "online",
|
||||
"lastSeen": null
|
||||
},
|
||||
{
|
||||
"participant": "2132132130@c.us",
|
||||
"lastKnownPresence": "offline",
|
||||
"lastSeen": 1686719326
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
### Get chat presence
|
||||
|
||||
To get presence information for a single chat - call `GET /api/{session}/presence/{chatId}`.
|
||||
For a group, you'll get participants' statuses.
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "2132132130@c.us",
|
||||
"presences": [
|
||||
{
|
||||
"participant": "2132132130@c.us",
|
||||
"lastKnownPresence": "online",
|
||||
"lastSeen": null
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Subscribe to presence
|
||||
|
||||
You can subscribe to presence information by calling `POST /api/{session}/presence/{chatId}/subscribe` request
|
||||
(no body required).
|
||||
You can get later presence information for the chat with above `GET` endpoints or by listening to `presence.update`
|
||||
webhook.
|
||||
|
||||
## Webhooks
|
||||
See the list of engines [**that support the feature ->**]({{< relref "/docs/how-to/engines#features" >}}).
|
||||
|
||||
### presence.update
|
||||
|
||||
You can subscribe to `presence.update` webhook event to get the most recent presence information.
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "presence.update",
|
||||
"session": "default",
|
||||
"payload": {
|
||||
"id": "111111111111111111@g.us",
|
||||
"presences": [
|
||||
{
|
||||
"participant": "11111111111@c.us",
|
||||
"lastKnownPresence": "typing",
|
||||
"lastSeen": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"engine": "NOWEB"
|
||||
}
|
||||
```
|
||||
@@ -8,54 +8,37 @@ draft: false
|
||||
images: []
|
||||
weight: 120
|
||||
---
|
||||
We consider that you've run docker container and authenticated the session with QR code.
|
||||
|
||||
The project uses [Webhooks](https://en.wikipedia.org/wiki/Webhook) to send the messages or events from WhatsApp to your
|
||||
application.
|
||||
If you haven't yet - please follow the steps from [**Quick Start →**]({{< relref "/docs/overview/quick-start" >}}).
|
||||
|
||||
## Webhooks  
|
||||
|
||||
You can configure where you want to receive events in environment variables:
|
||||
|
||||
- `WHATSAPP_HOOK_URL=https://httpbin.org/post` - to set up a URL for the webhook
|
||||
- `WHATSAPP_HOOK_EVENTS=message,message.any,state.change,group.join,group.leave` - specify events. DO NOT specify all of
|
||||
them, it's too heavy payload, choose the right for you.
|
||||
- `WHATSAPP_HOOK_EVENTS=*` - subscribe to all events. It's not recommended for production, but it's fine for
|
||||
development.
|
||||
|
||||
On the URL that you set via `WHATSAPP_HOOK_URL` you receive JSON-data with following format:
|
||||
You must use [Webhooks]({{< relref "/docs/how-to/webhooks" >}}) to receive messages from WhatsApp to your application.
|
||||
|
||||
Start a new session with configured `message` event in webhooks - call `POST /api/sessions/start` with the payload:
|
||||
```json
|
||||
{
|
||||
"event": "message",
|
||||
"payload": {}
|
||||
"name": "default",
|
||||
"config": {
|
||||
"webhooks": [
|
||||
{
|
||||
"url": "https://httpbin.org/post",
|
||||
"events": [
|
||||
"message"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Where `event` value helps you identify the incoming event with `payload` for that events.
|
||||
|
||||
Below the list of all events that WhatsApp HTTP API sends to your.
|
||||
|
||||
{{< alert icon="👉" text="If you want to look at a webhook body - use the url `https://httpbin.org/post`" />}}
|
||||
|
||||
Run the bellow command and see look at the logs - it prints body request for all events that happen in your WhatsApp!
|
||||
|
||||
```bash
|
||||
docker run -it -e WHATSAPP_HOOK_EVENTS=* -e WHATSAPP_HOOK_URL=https://httpbin.org/post devlikeapro/whatsapp-http-api
|
||||
```
|
||||
|
||||
### Examples
|
||||
Here's few examples of how to handle webhook in different languages:
|
||||
1. [Python guide]({{< relref "/docs/examples/python" >}})
|
||||
|
||||
**Do you use another language?**
|
||||
|
||||
Please create a short guide how to handle webhook and send message after you finish your setup!
|
||||
You can create a pull request with your favorite language in the [GitHub, in examples folder](https://github.com/devlikeapro/whatsapp-http-api/tree/core/examples).
|
||||
|
||||
Just put the code and **README.md** file in the folder - we'll do the rest!
|
||||
After that WAHA'll send events (see below) about new messages to an endpoint you provided.
|
||||
|
||||
|
||||
## Events  
|
||||
## Webhooks
|
||||
See the list of engines [**that support the feature ->**]({{< relref "/docs/how-to/engines#features" >}}).
|
||||
|
||||
Here's examples of message-related events.
|
||||
Read [Webhooks ->]({{< relref "/docs/how-to/webhooks" >}}) to find how to set them up.
|
||||
|
||||
### message
|
||||
|
||||
@@ -64,6 +47,7 @@ Incoming message (text/audio/files)
|
||||
```json
|
||||
{
|
||||
"event": "message",
|
||||
"session": "default",
|
||||
"payload": {
|
||||
"id": "true_11111111111@c.us_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
|
||||
"timestamp": 1667561485,
|
||||
@@ -126,79 +110,122 @@ Fired on all message creations, including your own. The payload is the same as f
|
||||
```json
|
||||
{
|
||||
"event": "message.any",
|
||||
"session": "default",
|
||||
"payload": {}
|
||||
}
|
||||
```
|
||||
|
||||
### message.ack
|
||||
Receive events when server or recipient gets the message, read or played it.
|
||||
|
||||
[See details on Webhooks page ->]({{< relref "webhooks#messageack" >}}).
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "message.ack",
|
||||
"session": "default",
|
||||
"payload": {}
|
||||
}
|
||||
```
|
||||
|
||||
### state.change
|
||||
### message.revoked
|
||||
|
||||
[See details on Webhooks page ->]({{< relref "webhooks#messageack" >}}).
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "state.change",
|
||||
"payload": {}
|
||||
"event": "message.ack",
|
||||
"session": "default",
|
||||
"payload": {
|
||||
"before": {
|
||||
"id": "some-id-here",
|
||||
"timestamp": "some-timestamp-here",
|
||||
"body": "Hi there!"
|
||||
},
|
||||
"after": {
|
||||
"id": "some-id-here",
|
||||
"timestamp": "some-timestamp-here",
|
||||
"body": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### group.join
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "group.join",
|
||||
"payload": {}
|
||||
}
|
||||
```
|
||||
|
||||
### group.leave
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "group.left",
|
||||
"payload": {}
|
||||
}
|
||||
```
|
||||
|
||||
## Files 
|
||||
|
||||
When people send you files - images, voice messages, and documents - WAHA saves it in the file storage.
|
||||
In your application you must download it and use it as you want to. You can find the URL in `mediaUrl` field
|
||||
When people send you media - images, voice messages, and documents - WAHA saves it in the file storage.
|
||||
In your application you must download it and use it as you want to. You can find the URL in `media.url` field.
|
||||
|
||||
For example, you can get the webhook like this with `mediaUrl` value (we've skipped other fields):
|
||||
For example, you can get the webhook like this with `media` value (we've skipped other fields):
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "message",
|
||||
"session": "default",
|
||||
"payload": {
|
||||
"id": "true_11111111111@c.us_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
|
||||
"timestamp": 1667561485,
|
||||
"from": "11111111111@c.us",
|
||||
"mediaUrl": "http://localhost:3000/api/files/true_11111111111@c.us_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.jpg"
|
||||
"hasMedia": true,
|
||||
"media": {
|
||||
"url": "http://localhost:3000/api/files/true_11111111111@c.us_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.jpg",
|
||||
"mimetype": "image/jpeg",
|
||||
"filename": null
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
Then you can use the link to download the file `http://localhost:3000/api/files/true_11111111111@c.us_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.jpg`.
|
||||
|
||||
For documents (file attachments) there's also `filename` field with the original file name.
|
||||
```json
|
||||
{
|
||||
"event": "message",
|
||||
"session": "default",
|
||||
"payload": {
|
||||
"id": "true_11111111111@c.us_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
|
||||
"timestamp": 1667561485,
|
||||
"from": "11111111111@c.us",
|
||||
"media": {
|
||||
"url": "http://localhost:3000/api/files/true_11111111111@c.us_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.pdf",
|
||||
"filename": "some-file.pdf",
|
||||
"mimetype": "application/pdf"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
To configure the url you can use environment variables `WHATSAPP_API_HOSTNAME` and `WHATSAPP_API_PORT`.
|
||||
|
||||
[Read more about file storage configuration and variables ->]({{< relref "config" >}}).
|
||||
By default, WAHA download all files that the account receive.
|
||||
If you want to limit files lifetime, specify file types for download or change directory for files -
|
||||
[read more about file storage configuration and variables ->]({{< relref "config" >}}).
|
||||
|
||||
## Webhook retries 
|
||||
## Endpoints
|
||||
See the list of engines [**that support the feature ->**]({{< relref "/docs/how-to/engines#features" >}}).
|
||||
|
||||
**WAHA** retries to reach your webhook URL 15 times and with 2 seconds delay between attempts.
|
||||
### Get messages
|
||||
Read messages from the history - use `GET /api/messages` endpoint.
|
||||
|
||||
## Get messages
|
||||
You can read messages from the history by using `GET /api/messages` endpoint.
|
||||
You also can get messages for chats by using
|
||||
[**Get messages from chat ->**]({{< relref "/docs/how-to/chats" >}}) endpoint.
|
||||
|
||||
{{< alert icon="👉" text="We do not recommend using this method in production, consider using webhooks instead!" />}}
|
||||
|
||||
```bash
|
||||
curl -X 'GET' \
|
||||
'http://localhost:3000/api/messages?chatId=11111111111%40c.us&limit=1000&session=default' \
|
||||
-H 'accept: application/json'
|
||||
```
|
||||
|
||||
## Examples
|
||||
Here's few examples of how to receive messages in different languages:
|
||||
1. [Python guide ->]({{< relref "/docs/examples/python" >}})
|
||||
|
||||
**Do you use another language?**
|
||||
|
||||
Please create a short guide how to handle webhook and send message after you finish your setup!
|
||||
You can create a pull request with your favorite language in the
|
||||
[GitHub, in examples folder ->](https://github.com/devlikeapro/whatsapp-http-api/tree/core/examples).
|
||||
|
||||
@@ -16,6 +16,7 @@ Either protect the API with [Api Key](https://www.fortinet.com/resources/cybergl
|
||||
firewalls.
|
||||
|
||||
## Swagger Security 
|
||||
### Username and password
|
||||
If you want to hide the project Swagger panel under the password - run the following command to hide under `admin/admin`
|
||||
login and password.
|
||||
|
||||
@@ -29,6 +30,12 @@ Open http://localhost:3000/ and enter `admin / admin` in the inputs:
|
||||
|
||||
{{< alert icon="👉" text="Protecting Swagger under the password does not protect your API from other request! Use both techniques to protect your API and Swagger!" />}}
|
||||
|
||||
### Disable Swagger
|
||||
You also can hide swagger completely by setting `WHATSAPP_SWAGGER_ENABLED=false` environment variable.
|
||||
|
||||
{{< alert icon="👉" text="Disabling Swagger does not protect the API, please use API security as well" />}}
|
||||
|
||||
|
||||
## API security 
|
||||
|
||||
You can protect the API by requiring Api Key in a request's headers.
|
||||
@@ -65,3 +72,7 @@ headers = {
|
||||
requests.get("http://localhost:3000/api/sessions", headers=headers)
|
||||
```
|
||||
|
||||
## Webhook security 
|
||||
To make sure that you get a webhook from your WAHA instance - you can use **HMAC authentication**.
|
||||
Read more about it on [Webhooks page ->]({{< relref "/docs/how-to/webhooks#hmac-authentication" >}})
|
||||
|
||||
@@ -8,27 +8,47 @@ draft: false
|
||||
images: []
|
||||
weight: 110
|
||||
---
|
||||
On your swagger documentation [http://localhost:3000/](http://localhost:3000/)
|
||||
or in [the example swagger](/swagger) you can find:
|
||||
1. List of all supported methods - we have not documented all of them on the page
|
||||
1. Requests JSON schemas
|
||||
1. Responses JSON schemas
|
||||
1. **Try it** button - no additional setup to play around with a method
|
||||
|
||||
We consider that you've run docker container and authenticated the session with QR code.
|
||||
|
||||
If you haven't yet - please follow the steps from [**Quick Start →**]({{< relref "/docs/overview/quick-start" >}}).
|
||||
|
||||
## Fields
|
||||
There are common fields that you can find in almost all requests:
|
||||
- `session` - a session name from which account you're sending the message. We use `default` in the examples.
|
||||
- Core  version supports only `default` session.
|
||||
- Plus  allows you to run multiple sessions inside one container to save your memory and CPU resources!
|
||||
```json
|
||||
{
|
||||
"session": "default",
|
||||
"chatId": "12132132130@c.us",
|
||||
"file": "..."
|
||||
}
|
||||
```
|
||||
|
||||
### session
|
||||
`session` - a session name from which account you're sending the message. We use `default` in the examples.
|
||||
- Core  version supports only `default` session.
|
||||
- Plus  allows you to run multiple sessions inside one container to save your memory and CPU resources!
|
||||
|
||||
Read more about [multiple sessions →]({{< relref "/docs/how-to/sessions" >}})
|
||||
|
||||
- `chatId` - it's a phone number or Group identifier where you're sending the message.
|
||||
- **Phone numbers** accounts use international phone number without + at the start and add `@c.us` at the end.
|
||||
For phone number `12132132131` the `chatId` is `12132132131@c.us`.
|
||||
- **Groups** use random number with `@g.us` at the end.
|
||||
### chatId
|
||||
`chatId` - it's a phone number or Group identifier where you're sending the message.
|
||||
- **Phone numbers** accounts use international phone number without + at the start and add `@c.us` at the end.
|
||||
For phone number `12132132131` the `chatId` is `12132132131@c.us`.
|
||||
- **Groups** use random number with `@g.us` at the end.
|
||||
|
||||
## Send text  
|
||||
> To get the actual `chatId` for **Brazilian phone number** - use `chatId` field from
|
||||
> [Check phone number exists ->]({{< relref "/docs/how-to/contacts#check-phone-number-exists" >}})
|
||||
> response.
|
||||
|
||||
### file
|
||||
When sending media (images, voice, files) you can either use:
|
||||
- `file.data` field [with base64 encoded file](https://base64.guru/converter/encode/file)
|
||||
- `file.url` field with public available URL for that file
|
||||
|
||||
## Endpoints
|
||||
See the list of engines [**that support the feature ->**]({{< relref "/docs/how-to/engines#features" >}}).
|
||||
|
||||
### Send text
|
||||
To send text message - use `POST /api/sendText` with example payload.
|
||||
```json
|
||||
{
|
||||
@@ -37,8 +57,30 @@ To send text message - use `POST /api/sendText` with example payload.
|
||||
"text": "Hi there!"
|
||||
}
|
||||
```
|
||||
#### Mention contact
|
||||
If you send a message in a group and want to mention a participant in the message -
|
||||
use `mentions` field for that in `POST /api/sendText` request.
|
||||
|
||||
## Reply on message  
|
||||
Please note that you MUST mention a number in the text as well in the format `@2132132130` and
|
||||
also mention it in `mentions` in format `2132132130@c.us`
|
||||
|
||||
```json
|
||||
{
|
||||
"session": "default",
|
||||
"chatId": "12132132130@c.us",
|
||||
"text": "Hi there! @2132132130",
|
||||
"mentions": [
|
||||
"2132132130@c.us"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Send poll
|
||||
We have a dedicated page [how to send polls and receive votes]({{< relref "/docs/how-to/polls" >}})!
|
||||
|
||||

|
||||
|
||||
### Reply on message
|
||||
To reply on a message - use `POST /api/reply` with example payload.
|
||||
```json
|
||||
{
|
||||
@@ -49,10 +91,10 @@ To reply on a message - use `POST /api/reply` with example payload.
|
||||
}
|
||||
```
|
||||
|
||||
### Reply files 
|
||||
WAHA does not support reply with files (images, voice, etc). If you're interested in it - please create an issue in GitHub.
|
||||
#### Reply files 
|
||||
WAHA does not support reply with files (images, voice, etc.). If you're interested in it - please create an issue in GitHub.
|
||||
|
||||
## Add a reaction  
|
||||
### Add a reaction
|
||||
Use `PUT /api/reaction` method to set reaction to a message.
|
||||
|
||||
{{< alert icon="👉" text="Reaction API uses PUT, not POST request! Please make sure you send right request." />}}
|
||||
@@ -74,14 +116,14 @@ To remove reaction from a message - send empty string in the reaction request.
|
||||
}
|
||||
```
|
||||
|
||||
## Send image 
|
||||
### Send image 
|
||||
Use `POST /api/sendImage` to send images.
|
||||
|
||||
You can send images in two ways:
|
||||
1. Provide a URL for the image.
|
||||
2. Encode the whole file content into base64 and send it in the request body.
|
||||
|
||||
### URL
|
||||
#### URL
|
||||
```json
|
||||
{
|
||||
"session": "default",
|
||||
@@ -95,7 +137,7 @@ You can send images in two ways:
|
||||
}
|
||||
```
|
||||
|
||||
### Base64
|
||||
#### Base64
|
||||
```json
|
||||
{
|
||||
"session": "default",
|
||||
@@ -109,14 +151,14 @@ You can send images in two ways:
|
||||
}
|
||||
```
|
||||
|
||||
## Send voice 
|
||||
### Send voice 
|
||||
Use `POST /api/sendVoice` to send voice messages.
|
||||
|
||||
You can send voice messages in two ways:
|
||||
1. Provide a URL for the voice.
|
||||
2. Encode the whole file content into base64 and send it in the request body.
|
||||
|
||||
### URL
|
||||
#### URL
|
||||
```json
|
||||
{
|
||||
"session": "default",
|
||||
@@ -130,7 +172,7 @@ You can send voice messages in two ways:
|
||||
}
|
||||
```
|
||||
|
||||
### Base64
|
||||
#### Base64
|
||||
```json
|
||||
{
|
||||
"chatId": "11111111111@c.us",
|
||||
@@ -142,14 +184,53 @@ You can send voice messages in two ways:
|
||||
"session": "default"
|
||||
}
|
||||
```
|
||||
## Send file 
|
||||
|
||||
### Send video 
|
||||
Use `POST /api/sendVideo` to send a message with a video attached.
|
||||
|
||||
For **WEBJS** engine please use `devlikeapro/whatsapp-http-api-plus:chrome` docker image.
|
||||
Read more about [**Docker images and engines →**]({{< relref "/docs/how-to/engines" >}}).
|
||||
|
||||
You can send voice messages in two ways:
|
||||
1. Provide a URL for the file and the API will download it and send it in the request body.
|
||||
2. Provide the file as a base64 string in the request body.
|
||||
|
||||
#### URL
|
||||
```json
|
||||
{
|
||||
"session": "default",
|
||||
"chatId": "11111111111@c.us",
|
||||
"caption": "Watch this video!",
|
||||
"file": {
|
||||
"mimetype": "video/mp4",
|
||||
"filename": "video.mp4",
|
||||
"url": "https://github.com/devlikeapro/whatsapp-http-api/raw/core/examples/dev.likeapro.mp3"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Base64
|
||||
```json
|
||||
{
|
||||
"chatId": "11111111111@c.us",
|
||||
"caption": "Watch this video!",
|
||||
"file": {
|
||||
"mimetype": "video/mp4",
|
||||
"filename": "video.mp4",
|
||||
"data": "AAAAGGZ0eXBtcDQyAAAAAGlzb21tcDQyAAAHEW1vb3YAAABsbXZoZAAAAADgAUTa4AFE2gAAdTAAAHe6AAEAAAEAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAANzdHJhawAAAFx0a2hkAAAAA+ABRNrgAUTaAAAAAQAAAAAAAHVOAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAUAAAAC0AAAAAAAJGVkdHMAAAAcZWxzdAAAAAAAAAABAAB1TgAAA+kAAQAAAAAC621kaWEAAAAgbWRoZAAAAADgAUTa4AFE2gAAdTAAAHVOVcQAAAAAAF9oZGxyAAAAAAAAAAB2aWRlAAAAAAAAAAAAAAAASVNPIE1lZGlhIGZpbGUgcHJvZHVjZWQgYnkgR29vZ2xlIEluYy4gQ3JlYXRlZCBvbjogMDIvMDIvMjAyMy4AAAACZG1pbmY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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALine truncated
|
||||
},
|
||||
"session": "default"
|
||||
}
|
||||
```
|
||||
|
||||
### Send file 
|
||||
Use `POST /api/sendFile` to send a file as a document.
|
||||
|
||||
You can send files in two ways:
|
||||
1. Provide a URL for the file.
|
||||
2. Encode the whole file content into base64 and send it in the request body.
|
||||
|
||||
### URL
|
||||
#### URL
|
||||
```json
|
||||
{
|
||||
"chatId": "11111111111@c.us",
|
||||
@@ -162,7 +243,7 @@ You can send files in two ways:
|
||||
}
|
||||
```
|
||||
|
||||
### Base64
|
||||
#### Base64
|
||||
```json
|
||||
{
|
||||
"session": "default",
|
||||
@@ -176,3 +257,73 @@ You can send files in two ways:
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Send status (aka stories)
|
||||
You can send statuses (aka stories)!
|
||||
|
||||
It is always necessary to inform the list of `contacts` that will have access to the posted status!
|
||||
|
||||
|
||||
#### Send text status
|
||||
`POST /api/{session}/status/text`
|
||||
```json
|
||||
{
|
||||
"contacts": [
|
||||
"55xxxxxxxxxxx@c.us"
|
||||
],
|
||||
"text": "Have a look! https://waha.devlike.pro/",
|
||||
"backgroundColor": "#38b42f",
|
||||
"font": 1
|
||||
}
|
||||
```
|
||||
|
||||
#### Send image status 
|
||||
`POST /api/{session}/status/image`
|
||||
|
||||
```json
|
||||
{
|
||||
"contacts": [
|
||||
"55xxxxxxxxxxx@c.us"
|
||||
],
|
||||
"file": {
|
||||
"mimetype": "image/jpeg",
|
||||
"filename": "filename.jpeg",
|
||||
"data": "/9j/4AAQSkZJRgABAQAAAQABAAD/4gIoSUNDX1BST0ZJTEUAAQEAAAIYAAAAAAQwAABtbnRyUkdCIFhZWiAAAAAAAAAAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAA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otq7Yia4m2OOB5cUAdKnBrSvXfA/Kh263F63sW56a4u3R1FbMYgdLajvZHnzs/nTHdG6B9LulwnR4sedNckR4iPZxm1gaZRx8I19g7+ldM3i6M2hdobnu/RCle09zUApCVb3tOxtPPPHz9aj90boJyw5bkmOslixXuRFjEkiOoJcbST30lQOvwpvesgvV/WF3+6yZ+t9KHCAhG+/SkaAqL3RugszOfZmxbU29nJJaYqU9CT0pLqU+gc11fjvdREy7XK4oit3Oe/MRFT7Nj2xBLaOON9z2HJphujdBq3iZ4gXmNl7pxHJvq5UZkaYKHmgvR6tbBAPbeqzKbMl3CW7Luct6bMe/ePPK6lK9B8h8hTRAShOkAJHoK63QP7jdbjdXW3btNcmOtNhptTgAKUDska8hs1zbLncLRORNs05+DMQOkOtHun/KodiPkaZbo3QTt/wAvyXI2UsX68vSoySFewSlLbaiOxUEgb/GobqpPdG6BTqoqyYFh9xy28x48aO6IQWDIklJCG0b5581EcACig//Z"
|
||||
},
|
||||
"caption": "string"
|
||||
}
|
||||
```
|
||||
|
||||
#### Send voice status 
|
||||
`POST /api/{session}/status/voice`
|
||||
|
||||
```json
|
||||
{
|
||||
"contacts": [
|
||||
"55xxxxxxxxxxx@c.us"
|
||||
],
|
||||
"file": {
|
||||
"mimetype": "audio/mp4",
|
||||
"filename": "voice-message.mp3",
|
||||
"data": "T2dnUwACAAAAAAAAAAASgxpgAAAAAHB8DlwBE09wdXNIZWFkAQE4AcBdAAAAAABPZ2dTAAAAAAAAAAAAABKDGmABAAAATyrcUQE/T3B1c1RhZ3MNAAAATGF2ZjU4Ljc2LjEwMAEAAAAeAAAAZW5jb2Rlcj1MYXZjNTguMTM0LjEwMCBsaWJvcHVzT2dnUwAAgLsAAAAAAAASgxpgAgAAAAf0Bgo2/yaH/z2Gh/8igOHzzHp6fnvM/wqzs7S+uMGztre4wdfY+ciBeXvde3z8gndxbmxsbW1tbW1t2H/6wQbxCPBuFb1e6D6/STKCS8mcmYDGsEpkNj5o/3Dk0mzldZfsr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AC2VlJM3Um6psHbyn+02KmnDHJxjHpsQBnlaxc6DfDPmuNl63ntD8nxv7lvEFA0cFafqSIb/9J2SY5OSBs1OXBSgpP29fIRtBx7oKUmNVMk36/iAT7uMPML4YnCPk+53HrH6zLIOGY2Rd8wj5FJwNvAUw+UG9DrB3x5z4QuMGQX+nDtlcjCAqFIbzx/CLPho0cDNvY2PMtbYlqG7AUBaiEHqilSX1pgByRFgpE3RAdc8wSmHLNy4DKBlhz9JxuVMyExYg9lZx4kzrsnqwe7nKUcCH3J7I0qchP09c8nooyx2ByD93laIS+cuu1UQCkK3P0hk/gBXLine truncated
|
||||
},
|
||||
"backgroundColor": "#38b42f"
|
||||
}
|
||||
```
|
||||
|
||||
#### Send video status 
|
||||
`POST /api/{session}/status/video`
|
||||
|
||||
```json
|
||||
{
|
||||
"contacts": [
|
||||
"55xxxxxxxxxxx@c.us"
|
||||
],
|
||||
"file": {
|
||||
"mimetype": "audio/mp4",
|
||||
"filename": "video-message.mp3",
|
||||
"data": "T2dnUwACAAAAAAAAAAASgxpgAAAAAHB8DlwBE09wdXNIZWFkAQE4AcBdAAAAAABPZ2dTAAAAAAAAAAAAABKDGmABAAAATyrcUQE/T3B1c1RhZ3MNAAAATGF2ZjU4Ljc2LjEwMAEAAAAeAAAAZW5jb2Rlcj1MYXZjNTguMTM0LjEwMCBsaWJvcHVzT2dnUwAAgLsAAAAAAAASgxpgAgAAAAf0Bgo2/yaH/z2Gh/8igOHzzHp6fnvM/wqzs7S+uMGztre4wdfY+ciBeXvde3z8gndxbmxsbW1tbW1t2H/6wQbxCPBuFb1e6D6/STKCS8mcmYDGsEpkNj5o/3Dk0mzldZfsrMle4pNoErj35KH2YRHOly89zdCPPTyYOt814n+9gEBwC8B4cpoXpL6k/4GtX/b544TdyIThnpSSAtWdKEAkasngrAwGTxNVjxHWPjjf3cKN5pjU5zN1KJAvdXxxcpeL7rknh0+0d1t1WJyiqXwo6EK1FyXEwg1qhD/lnhAEXvrBYvodfLgAAAAA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cjCAqFIbzx/CLPho0cDNvY2PMtbYlqG7AUBaiEHqilSX1pgByRFgpE3RAdc8wSmHLNy4DKBlhz9JxuVMyExYg9lZx4kzrsnqwe7nKUcCH3J7I0qchP09c8nooyx2ByD93laIS+cuu1UQCkK3P0hk/gBXLine truncated
|
||||
},
|
||||
"backgroundColor": "#38b42f"
|
||||
}
|
||||
```
|
||||
|
After Width: | Height: | Size: 50 KiB |
@@ -1,44 +1,16 @@
|
||||
---
|
||||
title : "Sessions"
|
||||
title: "Sessions"
|
||||
description: "Sessions"
|
||||
lead: ""
|
||||
date: 2020-10-06T08:48:45+00:00
|
||||
lastmod: 2020-10-06T08:48:45+00:00
|
||||
draft: false
|
||||
images: []
|
||||
weight: 200
|
||||
images: [ ]
|
||||
weight: 125
|
||||
---
|
||||
|
||||
## Saving session 
|
||||
|
||||
Plus  version allows you to save "session" state and avoid scanning QR code everytime when
|
||||
you start a container.
|
||||
|
||||
### File storage
|
||||
|
||||
If you want to save your session and do not scan QR code everytime when you launch WAHA - connect a local file storage
|
||||
to the container. WAHA stores authentication information in the directory and reuses it after restart.
|
||||
|
||||
[Attach volume](https://docs.docker.com/storage/volumes/) part to the command:
|
||||
```bash
|
||||
-v `pwd`/.sessions:/app/.sessions
|
||||
```
|
||||
|
||||
The full command would be:
|
||||
```bash
|
||||
docker run --rm -d -v `pwd`/.sessions:/app/.sessions -p 127.0.0.1:3000:3000/tcp --name whatsapp-http-api devlikeapro/whatsapp-http-api
|
||||
```
|
||||
|
||||
### Remote storage 
|
||||
|
||||
If you're interested in using some "remote" storage (like Redis or other Databases) to save sessions - please create an
|
||||
issue on GitHub.
|
||||
|
||||
For instances, it may be useful if you run WAHA in a cluster of servers and do not have shared file storage
|
||||
|
||||
## Multiple sessions 
|
||||
|
||||
If you want to save server's CPU and Memory - run multiple sessions inside one docker container!
|
||||
## Endpoints
|
||||
See the list of engines [**that support the features ->**]({{< relref "/docs/how-to/engines#features" >}}).
|
||||
|
||||
### Start
|
||||
|
||||
@@ -49,6 +21,68 @@ In order to start a new session - call `POST /api/sessions/start`
|
||||
"name": "default"
|
||||
}
|
||||
```
|
||||
#### Configure webhooks
|
||||
You can configure webhooks for a session:
|
||||
```json
|
||||
{
|
||||
"name": "default",
|
||||
"config": {
|
||||
"webhooks": [
|
||||
{
|
||||
"url": "https://httpbin.org/post",
|
||||
"events": [
|
||||
"message"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Read more about available options on [**Webhooks page ->**]({{< relref "/docs/how-to/webhooks#hmac-authentication" >}})
|
||||
|
||||
The configuration is saved and will be applied if the docker container restarts,
|
||||
and you set `WHATSAPP_RESTART_ALL_SESSIONS` environment variables.
|
||||
Read more about it in [Autostart section](#autostart).
|
||||
|
||||
#### Configure proxy
|
||||
You can configure proxy for a session by setting `config.proxy` fields:
|
||||
- `server` - proxy server address, without `http://` or `https://` prefixes
|
||||
- `username` and `password` - set this if the proxy requires authentication
|
||||
|
||||
|
||||
**No authentication**
|
||||
```json
|
||||
{
|
||||
"name": "default",
|
||||
"config": {
|
||||
"proxy": {
|
||||
"server": "localhost:3128"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Proxy with authentication**
|
||||
```json
|
||||
{
|
||||
"name": "default",
|
||||
"config": {
|
||||
"proxy": {
|
||||
"server": "localhost:3128",
|
||||
"username": "username",
|
||||
"password": "P@ssw0rd"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The configuration is saved and will be applied if the docker container restarts,
|
||||
and you set `WHATSAPP_RESTART_ALL_SESSIONS` environment variables.
|
||||
Read more about it in [Autostart section](#autostart).
|
||||
|
||||
You can configure proxy when for all sessions by set up environment variables.
|
||||
Read more about it on [**Configuration page** ->]({{< relref "/docs/how-to/config#proxy" >}}).
|
||||
|
||||
### List
|
||||
|
||||
@@ -65,15 +99,224 @@ The response:
|
||||
]
|
||||
```
|
||||
|
||||
You can add `?all=true` parameter to the request `GET /api/session?all=True` it'll show you ALL session,
|
||||
including **STOPPED**,
|
||||
so you can know which one will be restarted if you set `WHATSAPP_RESTART_ALL_SESSIONS=True` environment variable.
|
||||
|
||||
### Stop
|
||||
|
||||
In order to stop a new session - call `POST /api/sessions/stop`
|
||||
|
||||
{{< alert icon="👉" text="The stop request does not log out the account. Manually remove the session storage." />}}
|
||||
{{< alert icon="👉" text="The stop request does not log out the account by default. Set 'logout' field to 'true'." />}}
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "default"
|
||||
"name": "default",
|
||||
"logout": true
|
||||
}
|
||||
```
|
||||
|
||||
### Logout
|
||||
|
||||
In order to log out the session - call `POST /api/sessions/logout`
|
||||
|
||||
{{< alert icon="👉" text="You must stop session first." />}}
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "default",
|
||||
"logout": true
|
||||
}
|
||||
```
|
||||
### Get screenshot
|
||||
Get screenshot of the session's screen.
|
||||
|
||||
```bash
|
||||
GET /api/screenshot?session=default
|
||||
```
|
||||
|
||||
#### Get screenshot in Base64
|
||||
You can get screenshot in base64 format by adding `Accept: application/json` header to the request.
|
||||
|
||||
```bash
|
||||
GET /api/screenshot?session=default
|
||||
Accept: application/json
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"mimetype": "image/png",
|
||||
"data": "base64-encoded-data"
|
||||
}
|
||||
```
|
||||
|
||||
You can change it in Swagger by clicking on **Media Type** dropdown and selecting **application/json**:
|
||||
|
||||

|
||||
|
||||
|
||||
### Get me
|
||||
|
||||
Get information about the associated account for that session (if any).
|
||||
```bash
|
||||
GET /api/sessions/{session}/me
|
||||
```
|
||||
|
||||
**Authenticated and working** session's response:
|
||||
```json
|
||||
{
|
||||
"id": "11111111111@c.us",
|
||||
"pushName": "string"
|
||||
}
|
||||
```
|
||||
|
||||
**Stopped** or **not authenticated** session returns null:
|
||||
```json
|
||||
null
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Get QR
|
||||
See the list of engines [**that support the features ->**]({{< relref "/docs/how-to/engines#features" >}}).
|
||||
|
||||
The simplest way to authenticate a new session - get QR code and scan it on your device.
|
||||
```bash
|
||||
GET /api/{session}/auth/qr
|
||||
```
|
||||
You'll get QR image that you can scan and get authenticated
|
||||
|
||||
#### QR formats
|
||||
You can get QR in different formats:
|
||||
1. **binary image** - `GET /api/{session}/auth/qr`
|
||||
2. **base64 image** - `GET /api/{session}/auth/qr` and set `Accept: application/json` header
|
||||
3. **raw** - `GET /api/{session}/auth/qr?format=raw`
|
||||
|
||||
Here's detailed information about each format:
|
||||
|
||||
1. **binary image**, binary image - **default** format, you'll get image in response
|
||||
```bash
|
||||
# Get image - binary
|
||||
GET /api/{session}/auth/qr
|
||||
|
||||
# OR
|
||||
GET /api/{session}/auth/qr?format=image
|
||||
|
||||
# OR specify Accept header as well
|
||||
GET /api/{session}/auth/qr?format=image
|
||||
Accept: image/png
|
||||
```
|
||||
|
||||
2. **base64 image** - you'll get image in base64 format in response if you set `Accept: application/json` header.
|
||||
```bash
|
||||
GET /api/{session}/auth/qr?format=image
|
||||
Accept: application/json
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"mimetype": "image/png",
|
||||
"data": "base64-encoded-data"
|
||||
}
|
||||
```
|
||||
|
||||
You can change it in Swagger by clicking on **Media Type** dropdown and selecting **application/json**:
|
||||
|
||||

|
||||
|
||||
3. **raw** - you'll get raw data in response, you can use it to generate QR code on your side
|
||||
```bash
|
||||
GET /api/{session}/auth/qr?format=raw
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"value": "value-that-you-need-to-use-to-generate-qr-code"
|
||||
}
|
||||
```
|
||||
|
||||
### Get pairing code
|
||||
See the list of engines [**that support the features ->**]({{< relref "/docs/how-to/engines#features" >}}).
|
||||
|
||||
You can [link a session with phone number](https://faq.whatsapp.com/1324084875126592) - make a request to the endpoint.
|
||||
```bash
|
||||
POST /api/{session}/auth/request-code
|
||||
```
|
||||
|
||||
Body example:
|
||||
```json
|
||||
{
|
||||
"phoneNumber": "12132132130"
|
||||
}
|
||||
```
|
||||
|
||||
You'll get code in the response that you can use on your WhatsApp app to connect the session:
|
||||
```json
|
||||
{
|
||||
"code": "ABCD-ABCD"
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## Webhooks
|
||||
See the list of engines [**that support the feature ->**]({{< relref "/docs/how-to/engines#features" >}}).
|
||||
|
||||
### session.status
|
||||
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
|
||||
- `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.
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "session.status",
|
||||
"session": "default",
|
||||
"me": {
|
||||
"id": "7911111@c.us",
|
||||
"pushName": "~"
|
||||
},
|
||||
"payload": {
|
||||
"status": "WORKING"
|
||||
},
|
||||
"engine": "WEBJS",
|
||||
"environment": {
|
||||
"version": "2023.10.12",
|
||||
"engine": "WEBJS",
|
||||
"tier": "PLUS"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## Advanced sessions 
|
||||
|
||||
With [WAHA Plus version]({{< relref "plus-version" >}}) you can save session state to avoid scanning QR code everytime,
|
||||
configure autostart options so when the docker container restarts - it restores all previously run sessions!
|
||||
|
||||
### Session persistent
|
||||
|
||||
If you want to save your session and do not scan QR code everytime when you launch WAHA -
|
||||
[connect the session storage to the container ->]({{< relref "/docs/how-to/storages#sessions" >}})
|
||||
|
||||
### Autostart
|
||||
If you don't want to call `POST /api/sessions/start` for every session each time when the container restart -
|
||||
you can use set of these environment variables to start sessions for you:
|
||||
|
||||
- `WHATSAPP_RESTART_ALL_SESSIONS=True`: Set this variable to `True` to start all **STOPPED** sessions after container
|
||||
restarts. By default, this variable is set to `False`.
|
||||
- Please note that this will start all **STOPPED** sessions, not just the sessions that were working before the restart. You can maintain the session list by
|
||||
using `POST /api/session/stop` with the `logout: True` parameter or by calling `POST /api/session/logout` to remove
|
||||
**STOPPED** sessions. You can see all sessions, including **STOPPED** sessions, in the `GET /api/sessions/all=True`
|
||||
response.
|
||||
- `WHATSAPP_START_SESSION=session1,session2`: This variable can be used to start sessions with the specified names right
|
||||
after launching the API. Separate session names with a comma.
|
||||
|
||||
|
||||
### Multiple sessions
|
||||
|
||||
If you want to save server's CPU and Memory - run multiple sessions inside one docker container!
|
||||
[Plus version]({{< relref "plus-version" >}}) supports multiple sessions in one container.
|
||||
|
||||
@@ -0,0 +1,149 @@
|
||||
---
|
||||
title: "Storages"
|
||||
description: "Storages"
|
||||
lead: ""
|
||||
date: 2020-10-06T08:48:45+00:00
|
||||
lastmod: 2020-10-06T08:48:45+00:00
|
||||
draft: false
|
||||
images: [ ]
|
||||
weight: 700
|
||||
---
|
||||
There are several storages that are used by the WAHA, below you can find the list of them and the way to configure them.
|
||||
1. [Sessions](#sessions) - used to store the session data, such as authentication information, configuration, and other data that is required to keep the session alive and connected to WhatsApp.
|
||||
2. [Media](#media) - used to store the media files, such as images, videos, and other files that are received from the WhatsApp instance.
|
||||
|
||||
<b>Storages are available in [WAHA Plus ]({{< relref "/docs/how-to/plus-version" >}}) only.</b>
|
||||
|
||||
## Sessions
|
||||
The "Sessions" storage is used to store the session data, such as authentication information, configuration,
|
||||
and other data that is required to keep the session alive and connected to WhatsApp.
|
||||
|
||||
If you want to save your session and do not scan QR code everytime when you launch WAHA -
|
||||
connect the session storage to the container.
|
||||
|
||||
For the session storage, you can use the following options:
|
||||
1. [Local (files)](#local-files) - the default option, stores the session data in the local storage using files.
|
||||
2. [MongoDB](#mongodb) - stores the session data in the MongoDB database.
|
||||
|
||||
The following table shows the compatibility of the session storage with the engines:
|
||||
|
||||
| | WEBJS | NOWEB | VENOM |
|
||||
|---------------|:-----:|:-----:|:-----:|
|
||||
| Local (files) | ✔️ | ✔️ | ✔️ |
|
||||
| MongoDB | ✔️ | ✔️ | ➖ |
|
||||
|
||||
## Sessions - Local (files)
|
||||
By default, the WAHA uses the **local storage (files)** to store the session data.
|
||||
|
||||
{{< alert icon="💡" text="It's <b>well tested solution</b> even for production" />}}
|
||||
|
||||
In order to use the local storage and save the session data between the container restarts,
|
||||
you need to mount the volume to the `/app/.sessions` directory using the `-v` option in `docker run` command:
|
||||
|
||||
```bash
|
||||
-v /path/to/on/host/.sessions:/app/.sessions
|
||||
```
|
||||
|
||||
The full command to run the WAHA with the local storage and save the session data
|
||||
in the current directory and `.sessions` directory:
|
||||
```bash
|
||||
docker run -v `pwd`/.sessions:/app/.sessions -p 3000:3000/tcp devlikeapro/whatsapp-http-api-plus
|
||||
```
|
||||
This is the only action you need to do to use the local storage - all session data will be available between the container restarts.
|
||||
|
||||
### How it works
|
||||
In the host machine, the session data will be stored in the current directory in the `.sessions` directory.
|
||||
|
||||
Under the hood, the WAHA stores the session data in the following directory structure:
|
||||
```
|
||||
.sessions/{engine}/{sessionName}/...
|
||||
```
|
||||
when you "logout" the session using [POST /api/sessions/logout]({{< relref "/docs/how-to/sessions#logout">}}) or providing `logout: True` in [POST /api/sessions/stop]({{< relref "/docs/how-to/sessions#stop">}})
|
||||
it removes the directory with the session data.
|
||||
|
||||
### Health Check
|
||||
The [WAHA Plus ]({{< relref "/docs/how-to/plus-version" >}}) provides [the health check endpoint]({{< relref "/docs/how-to/other" >}}) that checks the local storage.
|
||||
|
||||
## Sessions - MongoDB
|
||||
If you want to use the MongoDB to store the session data, you need to:
|
||||
1. Start the MongoDB server (using docker or any other way). You can either start your own MongoDB server or use the one of cloud providers, like [MongoDB Atlas](https://www.mongodb.com/atlas/database).
|
||||
2. Set `WHATSAPP_SESSIONS_MONGO_URL=mongodb://user:password@host:port/` environment variable to connect to the MongoDB server.
|
||||
|
||||
|
||||
**We recommend using your own MongoDB server as close as possible to WAHA server** for the best performance and security reasons.
|
||||
|
||||
{{< alert icon="💡" text="For <b>WEBJS</b> engine it can take up to 1 minute to save credentials in Mongo Database" />}}
|
||||
|
||||
### Example
|
||||
First, you need to start MongoDB server:
|
||||
```bash
|
||||
docker run -d -p 27017:27017 --name mongodb mongo
|
||||
```
|
||||
|
||||
Then, you need to run the WAHA with the `WHATSAPP_SESSIONS_MONGO_URL` environment variable (please note using `--network host` option as well)
|
||||
```bash
|
||||
docker run -e WHATSAPP_SESSIONS_MONGO_URL=mongodb://localhost:27017/ --network host devlikeapro/whatsapp-http-api-plus
|
||||
```
|
||||
|
||||
This is the only action you need to do to use the MongoDB storage -
|
||||
all session authentication data will be stored in the MongoDB database.
|
||||
|
||||
### How it works
|
||||
When you start a session, it stores the session data in the MongoDB database in two databases:
|
||||
1. `waha_{engine}` - it saves the session configuration in `sessions` collection with `name: {sessionName}` field.
|
||||
2. `waha_{engine}_{sessionName}` - it saves the WhatsApp authentication data and other session data. Each engine saves different data in this database.
|
||||
|
||||
When you "logout" the session using [POST /api/sessions/logout]({{< relref "/docs/how-to/sessions#logout">}}) or providing `logout: True` in [POST /api/sessions/stop]({{< relref "/docs/how-to/sessions#stop">}}) it removes those databases or elements from them.
|
||||
|
||||
For dealing and troubleshooting with the MongoDB, we recommend using [MongoDB Compass](https://www.mongodb.com/products/tools/compass).
|
||||
|
||||

|
||||
|
||||
### MongoDB Atlas
|
||||
If you use the [MongoDB Atlas](https://www.mongodb.com/atlas/database) you must grant
|
||||
`Atlas Admin` role in **Security => Database Access** before you connect to the database.
|
||||
|
||||
For production please consider running the MongoDB server close to the WAHA server for the best performance and security reasons.
|
||||
|
||||
### Health Check
|
||||
The [WAHA Plus ]({{< relref "/docs/how-to/plus-version" >}}) provides [the health check endpoint]({{< relref "/docs/how-to/other" >}}) that checks the MongoDB connection.
|
||||
|
||||
## Media
|
||||
When your WhatsApp instance receives media files, it stores them in the media storage.
|
||||
|
||||
You can use the following options to store the media files:
|
||||
1. [Local](#local) - the default option, stores the media files in the local storage using files.
|
||||
2. [S3](#s3) - stores the media files in the S3 storage.
|
||||
|
||||
Read more about [available configuration options ->]({{<relref "/docs/how-to/config#files">}}).
|
||||
|
||||
The following table shows the compatibility of the storage with the engines:
|
||||
|
||||
| | WEBJS | NOWEB | VENOM |
|
||||
|-------|:-----:|:-----:|:-----:|
|
||||
| Local | ✔️ | ✔️ | ✔️ |
|
||||
| S3 | 🕒 | 🕒 | ➖ |
|
||||
|
||||
## Media - Local
|
||||
By default, the WAHA uses the **local file storage** to store the media files and those files has a short lifetime (180 seconds).
|
||||
So it's your app responsibility to download and store them in a safe persistent place during this time.
|
||||
|
||||
### Save media files between the container restarts
|
||||
If you want to use the local storage and **save the media files between the container restarts for a long time** - you need to:
|
||||
1. Specify a dedicated folder to store the media files using `WHATSAPP_FILES_FOLDER=/app/.media` environment variable
|
||||
2. Disable automatic media files cleanup using `WHATSAPP_FILES_LIFETIME=0` environment variable
|
||||
3. Connect the volume to the specified folder using the `-v /path/to/files/on/host:/app/.media` option in `docker run` command to the folder specified in `WHATSAPP_FILES_FOLDER` environment variable.
|
||||
|
||||
Read more about [available configuration options ->]({{<relref "/docs/how-to/config#files">}}).
|
||||
|
||||
Here's all the steps in one command:
|
||||
```bash
|
||||
docker run -v /path/to/on/host/.media:/app/.media -e WHATSAPP_FILES_FOLDER=/app/.media -e WHATSAPP_FILES_LIFETIME=0 -p 3000:3000/tcp devlikeapro/whatsapp-http-api-plus
|
||||
```
|
||||
|
||||
### Health Check
|
||||
The [WAHA Plus ]({{< relref "/docs/how-to/plus-version" >}}) provides [the health check endpoint]({{< relref "/docs/how-to/other" >}}) that checks the local storage.
|
||||
|
||||
## Media - S3
|
||||
If you're interested in using the S3 storage or any other cloud storage (like [self-hosted S3 - Minio](https://min.io/)),
|
||||
please create an issue or vote for the S3 issue in [the GitHub repository](https://github.com/devlikeapro/whatsapp-http-api/issues?q=is%3Aissue+is%3Aopen+S3).
|
||||
|
After Width: | Height: | Size: 72 KiB |
@@ -0,0 +1,549 @@
|
||||
---
|
||||
title : "Webhooks"
|
||||
description: "Webhooks"
|
||||
lead: ""
|
||||
date: 2020-10-06T08:48:45+00:00
|
||||
lastmod: 2020-10-06T08:48:45+00:00
|
||||
draft: false
|
||||
images: []
|
||||
weight: 121
|
||||
---
|
||||
|
||||
The project uses [Webhooks](https://en.wikipedia.org/wiki/Webhook) to send the messages and events from WhatsApp to your
|
||||
application.
|
||||
|
||||
Webhooks are a way for two different applications to communicate with each other in real-time.
|
||||
When a certain event happens in one application, it sends a message to another application through a webhook URL.
|
||||
The receiving application can then take action based on the information received.
|
||||
|
||||
## Setup webhooks
|
||||
### Session webhooks
|
||||
You can define webhooks configuration per session when you start it with `POST /api/sessions/start` request data.
|
||||
|
||||
Here's a simple example:
|
||||
```json
|
||||
{
|
||||
"name": "default",
|
||||
"config": {
|
||||
"webhooks": [
|
||||
{
|
||||
"url": "https://httpbin.org/post",
|
||||
"events": [
|
||||
"message"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
Here's available configuration options for webhooks
|
||||
```json
|
||||
{
|
||||
"name": "default",
|
||||
"config": {
|
||||
"webhooks": [
|
||||
{
|
||||
"url": "https://httpbin.org/post",
|
||||
"events": [
|
||||
"message"
|
||||
],
|
||||
"hmac": {
|
||||
"key": "your-secret-key"
|
||||
},
|
||||
"retries": {
|
||||
"delaySeconds": 2,
|
||||
"attempts": 15
|
||||
},
|
||||
"customHeaders": [
|
||||
{
|
||||
"name": "X-My-Custom-Header",
|
||||
"value": "Value"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Global webhooks
|
||||
There's a way how you can configure webhooks for ALL sessions - by settings these environment variables:
|
||||
|
||||
- `WHATSAPP_HOOK_URL=https://httpbin.org/post` - to set up a URL for the webhook
|
||||
- `WHATSAPP_HOOK_EVENTS=message,message.any,state.change` - specify events. Do not specify all of
|
||||
them, it's too heavy payload, choose the right for you.
|
||||
- `WHATSAPP_HOOK_EVENTS=*` - subscribe to all events. It's not recommended for production, but it's fine for
|
||||
development.
|
||||
|
||||
That webhook configuration **does not appear** in `session.config` field in `GET /api/sessions/` request.
|
||||
|
||||
## Webhook payload
|
||||
|
||||
On the URL that you set you'll receive **HTTP POST** request with a JSON string with following format:
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "message",
|
||||
"session": "default",
|
||||
"engine": "WEBJS",
|
||||
"environment": {
|
||||
"tier": "PLUS",
|
||||
"version": "2023.10.12"
|
||||
},
|
||||
"me": {
|
||||
"id": "71111111111@c.us",
|
||||
"pushName": "~"
|
||||
},
|
||||
"payload": {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Where `event` value helps you identify the incoming event with `payload` for that events.
|
||||
|
||||
Below the list of all events that WhatsApp HTTP API sends to your.
|
||||
|
||||
{{< alert icon="👉" text="If you want to look at a webhook body - use the url https://httpbin.org/post" />}}
|
||||
|
||||
Run the bellow command and see look at the logs - it prints body request for all events that happen in your WhatsApp!
|
||||
|
||||
```bash
|
||||
docker run -it -e "WHATSAPP_HOOK_EVENTS=*" -e WHATSAPP_HOOK_URL=https://httpbin.org/post -p 3000:3000 devlikeapro/whatsapp-http-api
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Webhooks
|
||||
See the list of engines [**that support the features ->**]({{< relref "/docs/how-to/engines#features" >}}).
|
||||
|
||||
### session.status
|
||||
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
|
||||
- `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.
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "session.status",
|
||||
"session": "default",
|
||||
"me": {
|
||||
"id": "7911111@c.us",
|
||||
"pushName": "~"
|
||||
},
|
||||
"payload": {
|
||||
"status": "WORKING"
|
||||
},
|
||||
"engine": "WEBJS",
|
||||
"environment": {
|
||||
"version": "2023.10.12",
|
||||
"engine": "WEBJS",
|
||||
"tier": "PLUS"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### message
|
||||
|
||||
Incoming message (text/audio/files)
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "message",
|
||||
"session": "default",
|
||||
"engine": "WEBJS",
|
||||
"payload": {
|
||||
"id": "true_11111111111@c.us_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
|
||||
"timestamp": 1667561485,
|
||||
"from": "11111111111@c.us",
|
||||
"fromMe": true,
|
||||
"to": "11111111111@c.us",
|
||||
"body": "Hi there!",
|
||||
"hasMedia": false,
|
||||
"ack": 1,
|
||||
"vCards": [],
|
||||
"_data": {
|
||||
"id": {
|
||||
"fromMe": true,
|
||||
"remote": "11111111111@c.us",
|
||||
"id": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
|
||||
"_serialized": "true_11111111111@c.us_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
|
||||
},
|
||||
"body": "Hi there!",
|
||||
"type": "chat",
|
||||
"t": 1667561485,
|
||||
"notifyName": "MyName",
|
||||
"from": "11111111111@c.us",
|
||||
"to": "11111111111@c.us",
|
||||
"self": "in",
|
||||
"ack": 1,
|
||||
"isNewMsg": true,
|
||||
"star": false,
|
||||
"kicNotified": false,
|
||||
"recvFresh": true,
|
||||
"isFromTemplate": false,
|
||||
"pollInvalidated": false,
|
||||
"latestEditMsgKey": null,
|
||||
"latestEditSenderTimestampMs": null,
|
||||
"broadcast": false,
|
||||
"mentionedJidList": [],
|
||||
"isVcardOverMmsDocument": false,
|
||||
"isForwarded": false,
|
||||
"hasReaction": false,
|
||||
"ephemeralOutOfSync": false,
|
||||
"productHeaderImageRejected": false,
|
||||
"lastPlaybackProgress": 0,
|
||||
"isDynamicReplyButtonsMsg": false,
|
||||
"isMdHistoryMsg": false,
|
||||
"stickerSentTs": 0,
|
||||
"isAvatar": false,
|
||||
"requiresDirectConnection": false,
|
||||
"pttForwardedFeaturesEnabled": true,
|
||||
"isEphemeral": false,
|
||||
"isStatusV3": false,
|
||||
"links": []
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### message.any
|
||||
|
||||
Fired on all message creations, including your own. The payload is the same as for [message](#message) event.
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "message.any",
|
||||
"session": "default",
|
||||
"engine": "WEBJS",
|
||||
"payload": {
|
||||
...
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### message.reaction
|
||||
Receive events when a message is reacted to by a user (or **yourself** reacting to a message).
|
||||
- `payload.reaction.text` - emoji that was used to react to the message. It'll be an empty string if the reaction was removed.
|
||||
- `payload.reaction.messageId` - id of the message that was reacted to.
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "message.reaction",
|
||||
"session": "default",
|
||||
"me": {
|
||||
"id": "79222222222@c.us",
|
||||
"pushName": "WAHA"
|
||||
},
|
||||
"payload": {
|
||||
"id": "false_79111111@c.us_11111111111111111111111111111111",
|
||||
"from": "79111111@c.us",
|
||||
"fromMe": false,
|
||||
"participant": "79111111@c.us",
|
||||
"to": "79111111@c.us",
|
||||
"timestamp": 1710481111.853,
|
||||
"reaction": {
|
||||
"text": "🙏",
|
||||
"messageId": "true_79111111@c.us_11111111111111111111111111111111"
|
||||
}
|
||||
},
|
||||
"engine": "WEBJS",
|
||||
"environment": {
|
||||
"version": "2024.3.3",
|
||||
"engine": "WEBJS",
|
||||
"tier": "PLUS",
|
||||
"browser": "/usr/bin/google-chrome-stable"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
{{< alert icon="👉" text="NOWEB engine note - reactions were sent in 'message' and 'message.any' events, not it's available only in 'message.reaction'!" />}}
|
||||
|
||||
### message.ack
|
||||
Receive events when server or recipient gets the message, read or played it.
|
||||
|
||||
`ackName` field contains message status (`ack` has the same meaning, but show the value in int, but we keep it for backward compatability, they much to each other)
|
||||
|
||||
Possible message ack statuses:
|
||||
- `ackName: ERROR, ack: -1`
|
||||
- `ackName: PENDING, ack: 0`
|
||||
- `ackName: SERVER, ack: 1`
|
||||
- `ackName: DEVICE, ack: 2`
|
||||
- `ackName: READ, ack: 3`
|
||||
- `ackName: PLAYED, ack: 4`
|
||||
|
||||
|
||||
The payload may have more fields, it depends on the engine you use, but here's a minimum amount that all engines send:
|
||||
```json
|
||||
{
|
||||
"event": "message.ack",
|
||||
"session": "default",
|
||||
"engine": "WEBJS",
|
||||
"payload": {
|
||||
"id":"true_11111111111@c.us_4CC5EDD64BC22EBA6D639F2AF571346C",
|
||||
"from":"11111111111@c.us",
|
||||
"participant": null,
|
||||
"fromMe":true,
|
||||
"ack":3,
|
||||
"ackName":"READ"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### message.revoked
|
||||
The `message.revoked` event is triggered when a user, whether it be you or any other participant,
|
||||
revokes a previously sent message.
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "message.revoked",
|
||||
"session": "default",
|
||||
"payload": {
|
||||
"before": {
|
||||
"id": "some-id-here",
|
||||
"timestamp": "some-timestamp-here",
|
||||
"body": "Hi there!"
|
||||
},
|
||||
"after": {
|
||||
"id": "some-id-here",
|
||||
"timestamp": "some-timestamp-here",
|
||||
"body": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Important notes**:
|
||||
1. The above messages' ids don't match any of the ids you'll receive in the `message` event, it's a different id.
|
||||
2. In order to find the message that was revoked, you'll need to search for the message with
|
||||
the same timestamp and chat id as the one in the `after` object.
|
||||
3. `before` field can be null in some cases.
|
||||
|
||||
### state.change
|
||||
|
||||
It's an internal engine's state, not **session** `status`.
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "state.change",
|
||||
"session": "default",
|
||||
"engine": "WEBJS",
|
||||
"payload": {
|
||||
...
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### group.join
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "group.join",
|
||||
"session": "default",
|
||||
"engine": "WEBJS",
|
||||
"payload": {
|
||||
...
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### group.leave
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "group.left",
|
||||
"session": "default",
|
||||
"engine": "WEBJS",
|
||||
"payload": {
|
||||
...
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### presence.update
|
||||
|
||||
- `payload.id` indicates the chat - either direct chat with a contact or a group chat.
|
||||
- `payload.id.[].participant` - certain participant presence status. For a direct chat there's only one participant.
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "presence.update",
|
||||
"session": "default",
|
||||
"engine": "NOWEB",
|
||||
"payload": {
|
||||
"id": "111111111111111111@g.us",
|
||||
"presences": [
|
||||
{
|
||||
"participant": "11111111111@c.us",
|
||||
"lastKnownPresence": "typing",
|
||||
"lastSeen": null
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### poll.vote
|
||||
We have a dedicated page [how to send polls and receive votes]({{< relref "/docs/how-to/polls" >}})!
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "poll.vote",
|
||||
"session": "default",
|
||||
"payload": {
|
||||
"vote": {
|
||||
"id": "false_1111111111@c.us_83ACBE602A05C79B234B54415E95EE8A",
|
||||
"to": "me",
|
||||
"from": "1111111@c.us",
|
||||
"fromMe": false,
|
||||
"selectedOptions": ["Awesome!"],
|
||||
"timestamp": 1692861427
|
||||
},
|
||||
"poll": {
|
||||
"id": "true_1111111111@c.us_BAE5F2EF5C69001E",
|
||||
"to": "1111111111@c.us",
|
||||
"from": "me",
|
||||
"fromMe": true
|
||||
}
|
||||
},
|
||||
"engine": "NOWEB"
|
||||
}
|
||||
```
|
||||
|
||||
### poll.vote.failed
|
||||
We have a dedicated page [how to send polls and receive votes]({{< relref "/docs/how-to/polls" >}})!
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "poll.vote.failed",
|
||||
"session": "default",
|
||||
"payload": {
|
||||
"vote": {
|
||||
"id": "false_11111111111@c.us_2E8C4CDA89EDE3BC0BC7F605364B8451",
|
||||
"to": "me",
|
||||
"from": "111111111@c.us",
|
||||
"fromMe": false,
|
||||
"selectedOptions": [],
|
||||
"timestamp": 1692956972
|
||||
},
|
||||
"poll": {
|
||||
"id": "true_1111111111@c.us_BAE595F4E0A2042C",
|
||||
"to": "111111111@c.us",
|
||||
"from": "me",
|
||||
"fromMe": true
|
||||
}
|
||||
},
|
||||
"engine": "NOWEB"
|
||||
}
|
||||
```
|
||||
|
||||
## Webhooks Advanced 
|
||||
### HMAC authentication
|
||||
|
||||
You can authenticate webhook sender by using [HMAC Authentication](https://www.okta.com/identity-101/hmac/).
|
||||
|
||||
1. Define you secret key in `config.hmac.key` field when you start session with `POST /api/sessions/start`:
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "default",
|
||||
"config": {
|
||||
"webhooks": [
|
||||
{
|
||||
"url": "https://httpbin.org/post",
|
||||
"events": [
|
||||
"message"
|
||||
],
|
||||
"hmac": {
|
||||
"key": "your-secret-key"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
2. After that you'll receive all webhooks payload with two additional headers:
|
||||
- `X-Webhook-Hmac` - message authentication code for the raw **body** in HTTP POST request that send to your endpoint.
|
||||
- `X-Webhook-Hmac-Algorithm` - `sha512` - algorithm that have been used to create `X-Webhook-Hmac` value.
|
||||
|
||||
3. Implement the authentication algorithm by hashing body and using secret key and then verifying it with `X-Webhook-Hmac`
|
||||
value. Please [check your implementation here ->](https://www.devglan.com/online-tools/hmac-sha256-online)
|
||||
|
||||
Here's example for
|
||||
```
|
||||
# Full body
|
||||
{"event":"message","session":"default","engine":"WEBJS"}
|
||||
# Secret key
|
||||
my-secret-key
|
||||
# X-Webhook-Hmac-Algorithm
|
||||
sha512
|
||||
# X-Webhook-Hmac
|
||||
208f8a55dde9e05519e898b10b89bf0d0b3b0fdf11fdbf09b6b90476301b98d8097c462b2b17a6ce93b6b47a136cf2e78a33a63f6752c2c1631777076153fa89
|
||||
```
|
||||
|
||||
|
||||
### Retries
|
||||
**WAHA** retries to reach your webhook URL **15 times** with **2 seconds delay** between attempts by default in
|
||||
[Plus Version →]({{< relref "plus-version" >}})
|
||||
|
||||
You can configure those parameters by settings `config.retries` structure when `POST /api/sessions/start`:
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "default",
|
||||
"config": {
|
||||
"webhooks": [
|
||||
{
|
||||
"url": "https://httpbin.org/post",
|
||||
"events": [
|
||||
"message"
|
||||
],
|
||||
"retries": {
|
||||
"delaySeconds": 2,
|
||||
"attempts": 15
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
### Custom Headers
|
||||
You can send any customer headers by defining `config.webhooks.customHeaders` fields this way:
|
||||
```json
|
||||
{
|
||||
"name": "default",
|
||||
"config": {
|
||||
"webhooks": [
|
||||
{
|
||||
"url": "https://httpbin.org/post",
|
||||
"events": [
|
||||
"message"
|
||||
],
|
||||
"customHeaders": [
|
||||
{
|
||||
"name": "X-My-Custom-Header",
|
||||
"value": "Value"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Examples
|
||||
Here's few examples of how to handle webhook in different languages:
|
||||
1. [Python guide]({{< relref "/docs/examples/python" >}})
|
||||
|
||||
**Do you use another language?**
|
||||
|
||||
Please create a short guide how to handle webhook and send message after you finish your setup!
|
||||
You can create a pull request with your favorite language in the
|
||||
[GitHub, in examples folder ->](https://github.com/devlikeapro/whatsapp-http-api/tree/core/examples).
|
||||
@@ -0,0 +1,251 @@
|
||||
---
|
||||
title: "Changelog"
|
||||
description: "WAHA's changelog"
|
||||
lead: "You can find here the list of changes made to WAHA."
|
||||
date: 2020-10-06T08:49:31+00:00
|
||||
lastmod: 2020-10-06T08:49:31+00:00
|
||||
draft: false
|
||||
images: [ ]
|
||||
menu:
|
||||
docs:
|
||||
parent: "help"
|
||||
weight: 199
|
||||
toc: true
|
||||
---
|
||||
|
||||
If you wish to get and read Release Notes - read them on one of our platforms, **these posts are FREE**.
|
||||
- [**Boosty ->**](https://boosty.to/wa-http-api)
|
||||
- [**Patreon ->**](patreon.com/wa_http_api)
|
||||
|
||||
You even can **subscribe to get new updates** there!
|
||||
|
||||
## 2024.3
|
||||
- Add [message.reaction]({{< relref "/docs/how-to/webhooks#messagereaction" >}}) webhook in **WEBJS** and **NOWEB** engines ([#275](https://github.com/devlikeapro/whatsapp-http-api/issues/275)).
|
||||
- **NOWEB** engine note - reactions were sent in `'message'` and `'message.any'` events, not it's available **only** in `'message.reaction'`!
|
||||
- Add security settings [Security - who can send messages]({{< relref "/docs/how-to/groups##security---who-can-send-messages" >}}) `PUT /api/{session}/groups/{groupId}/settings/security/messages-admin-only` ([#274](https://github.com/devlikeapro/whatsapp-http-api/issues/274))
|
||||
|
||||
### 👉 Breaking changes
|
||||
- **NOWEB** - reactions were sent in `'message'` and `'message.any'` events, not it's available **only** in `'message.reaction'`!
|
||||
- Add **required body** in `PUT /api/{session}/groups/{groupId}/settings/security/info-admin-only` endpoint.
|
||||
```json
|
||||
{
|
||||
"adminsOnly": false
|
||||
}
|
||||
```
|
||||
|
||||
## 2024.2
|
||||
- Add support for [MongoDB as storage for Session data]({{< relref "/docs/how-to/storages" >}})
|
||||
- Support persistent file storage for media files - [now you can save media files between container restarts]({{< relref "/docs/how-to/storages#media" >}})
|
||||
- If you set `WHATSAPP_FILES_LIFETIME=0` environment variable - media files will be never deleted.
|
||||
- Add `GET /api/health` endpoint to [check the health of the service](https://waha.devlike.pro/docs/how-to/other/)
|
||||
|
||||
## 2024.1
|
||||
- Implement [Patron Portal](https://portal.devlike.pro/) where you can get your personal API key and manage your perks.
|
||||
- Read more on [Patreon ->](https://www.patreon.com/posts/waha-patron-97637416)
|
||||
- Read more on [Boosty ->](https://boosty.to/wa-http-api/posts/8319079f-dac1-4179-b954-fcc559097c76)
|
||||
|
||||
## 2024.2
|
||||
- Listen for browser disconnected and page close events in **WEBJS** engine [#262](https://github.com/devlikeapro/whatsapp-http-api/issues/262)
|
||||
|
||||
## 2023.12
|
||||
December 2023
|
||||
- Add `chatId` field to `GET /api/contacts/check-exists` to help get the right `chatId` for Brazilian numbers.
|
||||
Read more about
|
||||
[error sending text to half of Brazilian numbers (every number registered before 2012) ->](https://github.com/devlikeapro/whatsapp-http-api/issues/238)
|
||||
|
||||
## 2023.11
|
||||
November 2023
|
||||
- Add different formats for QR code:
|
||||
1. **binary image** - `GET /api/{session}/auth/qr`
|
||||
2. **base64 image** - `GET /api/{session}/auth/qr` and set `Accept: application/json` header
|
||||
3. **raw** - `GET /api/{session}/auth/qr?format=raw`
|
||||
- Add different formats for the screenshot:
|
||||
1. **binary image** - `GET /api/{session}/screenshot`
|
||||
2. **base64 image** - `GET /api/{session}/screenshot` and set `Accept: application/json` header
|
||||
- Add `WHATSAPP_SWAGGER_ENABLED=false` so you can hide Swagger documentation (available only in Plus version). [#185](https://github.com/devlikeapro/whatsapp-http-api/issues/185)
|
||||
- Add dedicated `media` field in webhook payload - now you can know which media is attached to the message.
|
||||
```json
|
||||
{
|
||||
"event": "message",
|
||||
"session": "default",
|
||||
"payload": {
|
||||
"hasMedia": true,
|
||||
"media": {
|
||||
"url": "http://localhost:3000/api/files/true_11111111111@c.us_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.pdf",
|
||||
"mimetype": "application/pdf",
|
||||
"filename": "file.pdf"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
- Add `WHATSAPP_DOWNLOAD_MEDIA` environment variable to control media download. Available only in Plus version.
|
||||
- `WHATSAPP_DOWNLOAD_MEDIA=True` - download media
|
||||
- `WHATSAPP_DOWNLOAD_MEDIA=False` - do not download media at all.
|
||||
- Add `filename` field for document (file attachments) - the original filename of the document.
|
||||
- Add `/api/sendVideo` endpoint to **NOWEB** and **WEBJS** engines. Available only in Plus version.
|
||||
- Add security settings for edit group info `GET /api/{session}/groups/{groupId}/settings/security/info-admin-only` - updates the group settings to only allow admins to edit group info (title, description, photo).
|
||||
|
||||
## 2023.10
|
||||
October 2023
|
||||
- Add `session.status` event for all engines! Now you can get the latest session's status immediately after it changes.
|
||||
- Add `message.revoked` event in **WEBJS** engine
|
||||
- Add `me` field in webhook payload - now you can know which number is associated with the session
|
||||
- Add `enviroment` field in webhook payload - now you can know which environment is used for the session
|
||||
|
||||
## 2023.9
|
||||
September 2023
|
||||
- Add `GET /api/sessions/{session/me` endpoint so you [can get the phone number associated with the session](https://waha.devlike.pro/docs/how-to/sessions/#get-me)
|
||||
- Add [polls support in NOWEB engine](https://waha.devlike.pro/docs/how-to/polls)
|
||||
- Add dedicated [Get QR](https://waha.devlike.pro/docs/how-to/sessions/#get-qr) endpoint!
|
||||
- Support [pairing method (NOWEB)](https://waha.devlike.pro/docs/how-to/sessions/#get-pairing-code) - you can connect with a code instead of QR.
|
||||
- Add string field `ackName: DEVICE|READ|...` in [message.ack payload](https://waha.devlike.pro/docs/how-to/webhooks/#messageack)
|
||||
- Support `message.ack` event webhook in **NOWEB** engine
|
||||
|
||||
## 2023.8
|
||||
August 2023
|
||||
- Added [stories (aka status) endpoints](https://waha.devlike.pro/docs/how-to/send-messages/#send-status-aka-stories) to **NOWEB** engine!
|
||||
- `POST /api/{session}/status/text|image|voice|video` - choose one that suites your!
|
||||
- Added [chats endpoints](https://waha.devlike.pro/docs/how-to/chats)
|
||||
- Get all chats - `GET /api/{session/chats`
|
||||
- Delete chat - `DELETE /api/{session/chats/{chatId}`
|
||||
- Get messages from chat - `GET /api/{session/chats/{chatId}/messages?limit=1000?downloadMedia=true`
|
||||
- Clear messages in the chat `DELETE /api/{session/chats/{chatId}/messages`
|
||||
- Added `downloadMedia` flag to speed up `GET /api/messages` and `GET /api/{session/chats/{chatId}/messages` performance.
|
||||
- Added [set presence endpoint](https://waha.devlike.pro/docs/how-to/presence)!
|
||||
- With `online` presence you can show your status as online [#121](https://github.com/devlikeapro/whatsapp-http-api/issues/121)
|
||||
- With `offline` presence you can get notifications for your device [#28](https://github.com/devlikeapro/whatsapp-http-api/issues/28)
|
||||
- Added security settings for edit group info `PUT /api/{session}/groups/{groupId}/settings/security/info-admin-only` - updates the group settings to only allow admins to edit group info (title, description, photo).
|
||||
|
||||
## 2023.7
|
||||
July 2023
|
||||
- Now session can have their own [Webhooks](https://waha.devlike.pro/docs/how-to/webhooks) -
|
||||
you can define webhook configuration when you start a session with `POST /api/session/start`!
|
||||
- Add HMAC authentication for webhooks
|
||||
- Configure retries
|
||||
- Add you custom headers
|
||||
- Added [proxy configuration](https://waha.devlike.pro/docs/how-to/config/#proxy) with supporting proxy authentication.
|
||||
Thanks **puntolino** for the contribution!
|
||||
You can control proxy's settings per session with `POST /api/session/start` or globally with environment variables.
|
||||
- Added [presence information](https://waha.devlike.pro/docs/how-to/presence) - now you can get online status for
|
||||
a contact by calling endpoints or receiving a webhook event!
|
||||
- Now you can mention contact in groups by settings `mentions` field in `POST /api/sendText`
|
||||
[read more about it in Send Messages ->]({{< relref "/docs/how-to/send-messages" >}})
|
||||
|
||||
## 2023.6
|
||||
June 2023
|
||||
|
||||
Improvements on session management, restarting sessions and more:
|
||||
|
||||
- Added `WHATSAPP_RESTART_ALL_SESSIONS=True`: Set this variable to `True` to start all **STOPPED** sessions after
|
||||
container restarts. By default, this variable is set to `False`.
|
||||
- Please note that this will start all **STOPPED** sessions, not just the sessions that were working before the
|
||||
restart. You can maintain the session list by
|
||||
using `POST /api/session/stop` with the `logout: True` parameter or by calling `POST /api/session/logout` to remove
|
||||
**STOPPED** sessions. You can see all sessions, including **STOPPED** sessions, in the `GET /api/sessions/all=True`
|
||||
response.
|
||||
- `WHATSAPP_START_SESSION` now support more than one session! Separate session names by command, and it'll start them
|
||||
ALWAYS after container restart `WHATSAPP_START_SESSION=session1,session2`
|
||||
- `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.
|
||||
- Added `?all=true` parameter to `GET /api/session?all=True` endpoint - it'll show you ALL session, included **STOPPED
|
||||
**, so you can know which one will be restarted if you set `WHATSAPP_RESTART_ALL_SESSIONS=True` environment variable.
|
||||
- Added `POST /api/sessions/logout` that allow you to logout from session - remove saved credentials.
|
||||
- Added `logout` boolean parameter to `POST /api/sessions/stop` request that allow you to stop the session AND logout at
|
||||
the same time.
|
||||
- Added [How to deploy page ->]({{< relref "/docs/how-to/deploy" >}}) with
|
||||
[docker-compose.yaml](https://github.com/devlikeapro/whatsapp-http-api/blob/core/docker-compose.yaml) example
|
||||
- Added `engine` field in webhook payload
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "message",
|
||||
"session": "default",
|
||||
"engine": "WEBJS",
|
||||
"payload": {}
|
||||
}
|
||||
```
|
||||
|
||||
## 2023.5
|
||||
May 2023
|
||||
|
||||
- Added new [NOWEB engine]({{< relref "/docs/how-to/engines" >}}). **NOWEB** engine does not require a browser to work
|
||||
with
|
||||
WhatsApp Web, it does so directly using a WebSocket.
|
||||
- Less CPU and RAM usage!
|
||||
- Send Locations API works!
|
||||
- Send Link Preview API works!
|
||||
- ⚠ Read the article before using it [How to avoid blocking ->]({{< relref "/docs/overview/how-to-avoid-blocking" >}}).
|
||||
|
||||
## 2023.4
|
||||
March 2023
|
||||
|
||||
- Add [Groups API]({{< relref "/docs/how-to/groups" >}})
|
||||
- Use Chromium by default instead of Chrome
|
||||
|
||||
## 2023.1
|
||||
January 2023
|
||||
|
||||
- Added [Contacts API]({{< relref "/docs/how-to/contacts" >}})
|
||||
- Get all contacts
|
||||
- Get a contact
|
||||
- Get contact "about" (status)
|
||||
- Get contact profile picture
|
||||
- Check number exists (is registered in WhatsApp) - works even if the number is not in the contact list
|
||||
- Block and unblock contact
|
||||
|
||||
## 2022.12
|
||||
December 2023
|
||||
|
||||
- Added `GET /messages/` endpoint to get chat messages [#31](https://github.com/devlikeapro/whatsapp-http-api/issues/31)
|
||||
- Added `WHATSAPP_SWAGGER_USERNAME` and `WHATSAPP_SWAGGER_PASSWORD` to hide and protect swagger panel.
|
||||
|
||||
## 2022.11
|
||||
|
||||
**Please test changes in test environment before update production!!**
|
||||
|
||||
**Engine** 
|
||||
|
||||
1. WAHA has changed its underlying engine from Venom to Whatsapp Web.JS. It might change the response and webhook's
|
||||
payloads.
|
||||
2. Optimize CPU and memory consumption.
|
||||
|
||||
**Requests** 
|
||||
|
||||
- For all `/api/session/` requests use `name` field instead of `sessionName`.
|
||||
- For all "chatting" requests use `session` field instead of `sessionName`.
|
||||
|
||||
**Sessions** 
|
||||
|
||||
Now you don't have to scan QR code each time you run WAHA, WAHA saves it for you! Available only in Plus version.
|
||||
|
||||
**Authentication** 
|
||||
|
||||
Now you can authenticate all requests for WAHA - use `WHATSAPP_API_KEY=secret` environment variable to set "secret key".
|
||||
|
||||
If `WHATSAPP_API_KEY` is set - requests must have `X-Api-Key` header with `secret` value, where `secret` - any random
|
||||
secret key.
|
||||
|
||||
**Webhooks** 
|
||||
|
||||
Instead of setting each webhook via environment variables - we use two environments variables:
|
||||
|
||||
- `WHATSAPP_HOOK_URL` - to set a URL
|
||||
- `WHATSAPP_HOOK_EVENTS` - to set events that are sent to the URL
|
||||
|
||||
| Previous | Current |
|
||||
|----------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------|
|
||||
| <pre>WHATSAPP_HOOK_ONMESSAGE=https://httpbin.org/post <br>WHATSAPP_HOOK_ONANYMESSAGE=https://httpbin.org/post </pre> | <pre>WHATSAPP_HOOK_URL=https://httpbin.org/post <br>WHATSAPP_HOOK_EVENTS=message,message.any</pre> |
|
||||
|
||||
** Webhook payload**
|
||||
|
||||
The data for webhooks are wrapped inside a new `WAWebhook` object with `event` and `payload` fields to help you identify
|
||||
which handler you should call based on `event`.
|
||||
|
||||
```json
|
||||
{
|
||||
"event": "message.any",
|
||||
"payload": {
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -5,15 +5,17 @@ lead: "Answers to frequently asked questions."
|
||||
date: 2020-10-06T08:49:31+00:00
|
||||
lastmod: 2020-10-06T08:49:31+00:00
|
||||
draft: false
|
||||
images: []
|
||||
images: [ ]
|
||||
menu:
|
||||
docs:
|
||||
parent: "help"
|
||||
weight: 630
|
||||
weight: 130
|
||||
toc: true
|
||||
---
|
||||
|
||||
## How much CPU and Memory does WhatsApp HTTP API consume?
|
||||
### WEBJS
|
||||
|
||||
The benchmark has been made on **Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz**.
|
||||
It may differ from case to case, it depends on usage pattern - how many messages you get, how many send, etc.
|
||||
|
||||
@@ -22,6 +24,13 @@ It may differ from case to case, it depends on usage pattern - how many messages
|
||||
| 1 | 30% | 400MB |
|
||||
| 10 | 270% | 1.5GB |
|
||||
|
||||
|
||||
The nature of WhatsApp HTTP API and its underlying engines - is to run **real** WhatsApp Web version in Chrome and
|
||||
communicate with it to prevent blocking from WhatsApp. It's the reason why it's so demanding on resources.
|
||||
|
||||
### NOWEB
|
||||
If you're looking for less resource demanded engine - [have a look at **NOWEB** engine ->]({{< relref "/docs/how-to/engines" >}})
|
||||
|
||||
The quote from the user:
|
||||
> The server has 2 CPU and 8GB of memory.
|
||||
> Today we have 85 session in this instance.
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
---
|
||||
title: "How to Avoid Blocking"
|
||||
description: "How to Avoid Blocking From Whatsapp"
|
||||
date: 2020-11-12T13:26:54+01:00
|
||||
lastmod: 2020-11-12T13:26:54+01:00
|
||||
draft: false
|
||||
images: [ ]
|
||||
menu:
|
||||
docs:
|
||||
parent: "help"
|
||||
weight: 120
|
||||
toc: true
|
||||
---
|
||||
|
||||
How to Avoid Blocking in WhatsApp when developing bots.
|
||||
|
||||
It's important to keep in mind that WhatsApp has strict policies in place to prevent spamming and abuse of their
|
||||
platform.
|
||||
|
||||
If you're developing a bot for WhatsApp, it's crucial to follow these guidelines to avoid getting blocked.
|
||||
|
||||
## Guidelines to Follow
|
||||
|
||||
### 1. Only Reply to Messages
|
||||
|
||||
When developing a bot for WhatsApp, you **should never initiate a conversation**.
|
||||
Instead, your bot **should only reply** to messages that it receives.
|
||||
This will prevent your bot from being flagged as spam by WhatsApp's users and algorithms.
|
||||
|
||||
> You can use a short link http://wa.me/7911111111?text=Hi
|
||||
> so a user can click on it and start the dialog with the bot first
|
||||
|
||||
### 2. Avoid Spamming and Sending Unnecessary Content
|
||||
|
||||
Sending too many messages or sending content that the user did not request can also lead to your bot being blocked. Make
|
||||
sure to only send relevant and useful information to the user.
|
||||
Additionally, do not send too many messages at once, as this can also trigger spam filters.
|
||||
|
||||
### 3. Other Considerations
|
||||
|
||||
There are other guidelines to follow when developing a bot for WhatsApp, such as avoiding the use of banned words and
|
||||
not sharing sensitive or inappropriate content.
|
||||
Make sure to read WhatsApp's policies thoroughly to ensure that your bot complies with all of their rules.
|
||||
|
||||
## How to Process Messages
|
||||
|
||||
When processing messages in your bot, it's important to follow certain steps to avoid being flagged as spam.
|
||||
Here's a recommended process to follow:
|
||||
|
||||
1. **Send seen** before processing the message. This can be done by sending a `POST /api/sendSeen/` request to
|
||||
the WAHA API.
|
||||
|
||||
2. **Start typing** before sending a message and wait for a random interval depending on the size of the message. This can
|
||||
be done by sending a `POST /api/startTyping/` request.
|
||||
|
||||
3. **Stop typing** before sending the message. This can be done by sending a `POST /api/stopTyping/` request.
|
||||
|
||||
4. **Send the text message** using the `POST /api/sendText` request.
|
||||
|
||||
By following these steps, you can ensure that your bot processes messages in a way that's compliant with WhatsApp's
|
||||
guidelines and reduces the risk of being blocked.
|
||||
|
||||
## How to not get Banned?
|
||||
|
||||
WhatsApp knows that it's uncommon for someone to send so many messages or bulk messages to people they've never talked to each other before so it is considered spam/marketing junk pretty fast. There are some tips before sending a message to WhatsApp
|
||||
|
||||
**Dos and Don'ts:**
|
||||
|
||||
1. Important: Do NOT send messages which get you a report. As long as you don't get reports from users who you sent a message, your account will be mostly fine.
|
||||
2. Having real content, a survey that the person agreed with is different from a marketing message on a Saturday night.
|
||||
3. Send messages written in different ways, you could make a script that places spacebars randomly on your string AND includes the person's (first) name
|
||||
4. Never use fixed times, always go for sending the first message, wait a random time between 30 ~ and 60 seconds and then send the second message
|
||||
5. Always try to group contacts by their area code, WhatsApp expects a regular person to talk mostly with contacts that are within the same area of your phone number.
|
||||
6. Have a profile picture, this is not related to WhatsApp Bots Catcher® but sending a new message for someone not having a picture/name/status will elevate your chances of being manually tagged as spam.
|
||||
7. Send "seen" confirmation to messages or disable it on WhatsApp
|
||||
8. Avoid sending links that were previously marked as spam on WhatsApp or non-HTTPS. A URL shortener is a good idea
|
||||
9. IMPORTANT: It's terrible if you send messages 24/7 without giving it some time to wait. Random delays between messages are not enough, send a reasonable amount of messages keeping in mind your conversion rate, For example: for one hour send a maximum of 4 messages per contact that have replied to your message, and stop sending messages for one hour, then start again. Again, don't send messages without stopping for a while between every "package"
|
||||
10. Send only one short message when starting a conversation, one should not send long texts or multiple messages without the user consenting
|
||||
|
||||
**Have in mind:**
|
||||
|
||||
1. For every one you send a message that doesn't have your number on their contact list asked if it's spam, being tagged as spam a few times (5 - 10) will get you banned
|
||||
2. WhatsApp records every movement you do, you can even check the logs when sending simple support email, it contains all kinds of information, this said: act as human as possible
|
||||
3. Try to engage in conversations, as long as you send a message and the person doesn't automatically block you it'll be quite okay. People constantly talking to you and adding you to their contact list will make your number stronger against a ban
|
||||
4. Think about that like a points system, you start with zero points (negative if your device was previously blacklisted), if you reach below zero you are out, if you engage in conversations you get a point, if you are tagged as spam you lose some points, if you are blocked you may lose more points
|
||||
5. Finally, If your content is spam, it doesn't matter if you are using a broadcast list, group, or direct contact, you will still be banned
|
||||
|
||||
As API, we say all that's left to do right now is to agree with WhatsApp's policy, not send spam messages, and always wait for the other person to contact you first.
|
||||
|
||||
You could make it by sending an SMS to the person with a link to start a chat on WhatsApp with you by link [https://wa.me/12132132131?text=Hi](https://wa.me/12132132131?text=Hi).
|
||||
|
||||
|
||||
@@ -22,58 +22,57 @@ toc: true
|
||||
|
||||
{{< alert icon="👉" text="Run WhatsApp HTTP API in less than 5 minutes!" />}}
|
||||
|
||||
Go straight to the [Quick Start →]({{< relref "quick-start" >}})
|
||||
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. One-time donation, no license expiration, quick updates, read more about [Plus Version →]({{< relref "plus-version" >}})
|
||||
- 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" >}})
|
||||
|
||||
See the list of engines [**that support the features ->**]({{< relref "/docs/how-to/engines#features" >}}).
|
||||
|
||||
Here's the available features:
|
||||
|
||||
### Messages
|
||||
- Send messages  
|
||||
- Receive messages  
|
||||
- Message replies  
|
||||
- Send location  
|
||||
- Send buttons  
|
||||
- Receive location  
|
||||
- React to messages  
|
||||
- Send messages
|
||||
- Receive messages
|
||||
- Message replies
|
||||
- Send location
|
||||
- Receive location
|
||||
- React to messages
|
||||
- Send media (images/documents/files) 
|
||||
- Send voice messages 
|
||||
- Receive media (images/audio/video/documents) 
|
||||
- Receive messages - webhook retries 
|
||||
|
||||
### Sessions
|
||||
- Multi Device  
|
||||
- Get the screenshot  
|
||||
- Session saving (don't have to scan QR on every restart) 
|
||||
- Session saving on remote storage (database, redis) 
|
||||
- Single WhatsApp account running inside one container 
|
||||
- Multiple WhatsApp account running inside one container 
|
||||
|
||||
### Security
|
||||
- API authentication 
|
||||
- Swagger panel authentication 
|
||||
|
||||
### Updates
|
||||
- Bug fixes and updates come as soon as they are implemented. 
|
||||
- One month delay in bug fixes and updates. 
|
||||
|
||||
|
||||
### Groups 
|
||||
- Join groups by invite
|
||||
### Groups
|
||||
- Create a group
|
||||
- Get invite for group
|
||||
- Modify group info (subject, description)
|
||||
- Modify group settings (send messages, edit info)
|
||||
- Add group participants
|
||||
- Kick group participants
|
||||
- Promote/demote group participants
|
||||
|
||||
### Contacts 
|
||||
- Mention users
|
||||
### Contacts
|
||||
- Mute/unmute chats
|
||||
- Block/unblock contacts
|
||||
- Get contact info
|
||||
- Get profile pictures
|
||||
- Set user status message
|
||||
- Get presence (online\offline\typing) status
|
||||
|
||||
### Sessions
|
||||
- Multi Device
|
||||
- Get the screenshot
|
||||
- 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) 
|
||||
|
||||
### Security
|
||||
- API authentication 
|
||||
- Swagger panel authentication 
|
||||
|
||||
### Updates
|
||||
- Bug fixes and updates come as soon as they are implemented.
|
||||
|
||||
@@ -13,7 +13,10 @@ weight: 110
|
||||
toc: true
|
||||
---
|
||||
|
||||
On this page you're going to install WAHA, run it, authenticate the client using QR code and send the first text message to WhatsApp!
|
||||
On this page you're going to install WAHA, run it, authenticate the client using QR code and send the first text message
|
||||
to WhatsApp!
|
||||
|
||||

|
||||
|
||||
## Requirements
|
||||
|
||||
@@ -26,12 +29,26 @@ When you are ready - come back and follows the below steps to send the first tex
|
||||
Docker makes it easy to ship all-in-one solution with the runtime and dependencies. You don't have to worry about
|
||||
language-specific libraries or chrome installation.
|
||||
|
||||
Also Docker makes installation and update processes so simple, just one command!
|
||||
Also, Docker makes installation and update processes so simple, just one command!
|
||||
{{< /details >}}
|
||||
|
||||
## Send your first message
|
||||
|
||||
Let's go over steps that allow you to send your first text message via WhatsApp HTTP API!
|
||||
We will guide you through the necessary steps to successfully send your first text message using WhatsApp HTTP API.
|
||||
|
||||
**If you find it easier to follow a video** tutorial, we've got you covered!
|
||||
A 3-minute video tutorial is available to help you navigate WhatsApp HTTP API smoothly.
|
||||
|
||||
<div class="d-flex justify-content-center my-4">
|
||||
<iframe
|
||||
width="560" height="315"
|
||||
src="https://www.youtube.com/embed/RFerMyAUPRg"
|
||||
title="YouTube video player"
|
||||
frameborder="0"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
||||
allowfullscreen
|
||||
></iframe>
|
||||
</div>
|
||||
|
||||
### 1. Download image
|
||||
|
||||
@@ -46,19 +63,41 @@ docker pull devlikeapro/whatsapp-http-api
|
||||
 For Plus version, we use login to get the image before:
|
||||
|
||||
```bash
|
||||
docker login -u devlikeapro -p {PASSWORD}
|
||||
docker login -u devlikeapro -p {KEY}
|
||||
docker pull devlikeapro/whatsapp-http-api-plus
|
||||
docker logout
|
||||
```
|
||||
|
||||
Read more about how to get `PASSWORD` for [Plus Version →]({{< relref "plus-version" >}})
|
||||
|
||||
#### 1.1 Download image on ARM
|
||||
|
||||
If you're using ARM (like Apple Silicon, Apple M1, etc.) - use following commands to download the image
|
||||
|
||||
 For Core version the command is
|
||||
```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
|
||||
```
|
||||
|
||||
 For Plus version the command is:
|
||||
```bash
|
||||
docker login -u devlikeapro -p {KEY}
|
||||
docker pull devlikeapro/whatsapp-http-api-plus:arm
|
||||
docker logout
|
||||
|
||||
# Rename it, so you can use devlikeapro/whatsapp-http-api image in other place
|
||||
docker tag devlikeapro/whatsapp-http-api-plus:arm devlikeapro/whatsapp-http-api-plus
|
||||
```
|
||||
|
||||
### 2. Run WhatsApp HTTP API
|
||||
|
||||
Run WhatsApp HTTP API:
|
||||
|
||||
```bash
|
||||
docker run -it --rm -p 127.0.0.1:3000:3000/tcp --name whatsapp-http-api devlikeapro/whatsapp-http-api
|
||||
docker run -it --rm -p 3000:3000/tcp --name whatsapp-http-api devlikeapro/whatsapp-http-api
|
||||
|
||||
# It prints logs and the last line must be
|
||||
# WhatsApp HTTP API is running on: http://[::1]:3000
|
||||
@@ -83,8 +122,8 @@ How to log in - the instruction on WhatsApp site
|
||||
|
||||
When your ready - find `POST /api/session/start`, click on **Try it out**, then **Execute** a bit below.
|
||||
|
||||
|
||||
The example payload:
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "default"
|
||||
@@ -93,7 +132,8 @@ The example payload:
|
||||
|
||||

|
||||
|
||||
By using the request with `name` values you can start multiple session (WhatsApp accounts) inside the single docker container in Plus
|
||||
By using the request with `name` values you can start multiple session (WhatsApp accounts) inside the single docker
|
||||
container in Plus
|
||||
 version and only one account in Core  version.
|
||||
|
||||
Read more about [multiple sessions →]({{< relref "/docs/how-to/sessions" >}})
|
||||
@@ -123,6 +163,7 @@ way: use a phone international phone number without `+` symbol and add `@c.us` a
|
||||
For phone number `12132132131` the `chatId` is `12132132131@c.us`.
|
||||
|
||||
The example payload:
|
||||
|
||||
```json
|
||||
{
|
||||
"chatId": "12132132130@c.us",
|
||||
@@ -144,5 +185,6 @@ curl -d "{\"chatId\": \"${PHONE}@c.us\", \"text\": \"Hello from WhatsApp HTTP AP
|
||||
## What is next?
|
||||
- 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" >}})
|
||||
- Make sure your [API is properly protected ->]({{< relref "/docs/how-to/security" >}})
|
||||
|
||||
@@ -1,77 +1,105 @@
|
||||
{{ define "main" }}
|
||||
<section class="section container-fluid mt-n3 pb-3">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-lg-12 text-center">
|
||||
<h1 class="mt-0">{{ .Title }}</h1>
|
||||
<section class='section container-fluid mt-n3 pb-3'>
|
||||
<div class='row justify-content-center'>
|
||||
<div class='col-lg-12 text-center'>
|
||||
<h1 class='mt-0'>{{ .Title }}</h1>
|
||||
</div>
|
||||
<div class="col-lg-9 col-xl-8 text-center">
|
||||
<div class="mb-4">
|
||||
<img src="/images/logo.png" title="WhatsApp HTTP API" alt="logo" width="100"/>
|
||||
<div class='col-lg-9 col-xl-9 text-center'>
|
||||
<div class='mb-4'>
|
||||
<img src='/images/logo.png' title='WhatsApp HTTP API' alt='logo' width='100' />
|
||||
</div>
|
||||
<p class="lead">{{ .Params.lead | safeHTML }}</p>
|
||||
<a class="btn btn-primary btn-lg px-4 mb-2"
|
||||
href="/docs/{{ if .Site.Params.options.docsVersioning }}{{ .Site.Params.docsVersion }}/{{ end }}overview/introduction/"
|
||||
role="button">Get Started</a>
|
||||
<p class="meta"><a href="https://github.com/devlikeapro/whatsapp-http-api">Source code in GitHub.</a></p>
|
||||
<p class='lead'>{{ .Params.lead | safeHTML }}</p>
|
||||
<div class="code-block highlight d-none d-md-block">
|
||||
<pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash" style='padding: 0'>docker run -it -p 3000:3000/tcp devlikeapro/whatsapp-http-api</code></pre>
|
||||
</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/'
|
||||
role='button'>Get Started</a>
|
||||
<p class='meta'><a href='https://github.com/devlikeapro/whatsapp-http-api'>Source code in GitHub.</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{{ end }}
|
||||
|
||||
{{ define "sidebar-prefooter" }}
|
||||
<section class="section section-sm">
|
||||
<div class="container">
|
||||
<div class="row justify-content-center text-center">
|
||||
<div class="col-lg-5">
|
||||
<h2 class="h4">Language agnostic</h2>
|
||||
<section class='section section-sm'>
|
||||
<div class='container'>
|
||||
<div class='row justify-content-center text-center'>
|
||||
<div class='col-lg-5'>
|
||||
<img src='/images/icons/free.png' alt='Free' style='width: 5rem'>
|
||||
<h2 class='h4'>It's free!</h2>
|
||||
<p>
|
||||
<a href='https://waha.devlike.pro/docs/how-to/plus-version/#tiers' target='_blank'>
|
||||
<b>WAHA Core</b>
|
||||
</a>
|
||||
version is always free!
|
||||
<br>
|
||||
Even
|
||||
<a href='https://waha.devlike.pro/docs/how-to/plus-version/#tiers' target='_blank'>
|
||||
<b>WAHA Plus</b>
|
||||
</a>
|
||||
version have no licence expiration!
|
||||
</p>
|
||||
</div>
|
||||
<div class='col-lg-5'>
|
||||
<img src='/images/icons/api.png' alt='API' style='width: 5rem'>
|
||||
<h2 class='h4'>Language agnostic</h2>
|
||||
<p>
|
||||
Use your own favorite language - Python, JavaScript, PHP, C#, Clojure, or PowerShell.
|
||||
<br/>
|
||||
<small class="text-muted">
|
||||
<br />
|
||||
<small class='text-muted'>
|
||||
PowerShell, really? Are you insane?! Choose another language, dude.
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-lg-5">
|
||||
<h2 class="h4">Well documented</h2>
|
||||
<p>Documentation has a lof examples and how-to guides.</p>
|
||||
</div>
|
||||
<div class="col-lg-5">
|
||||
<h2 class="h4">No blocking</h2>
|
||||
<div class='col-lg-5'>
|
||||
<img src='/images/icons/document.png' alt='Document' style='width: 5rem'>
|
||||
<h2 class='h4'>Well documented</h2>
|
||||
<p>
|
||||
Under the hood it runs a real instance of Whatsapp Web to avoid getting blocked.
|
||||
<br/>
|
||||
<small class="text-muted">
|
||||
WhatsApp does not allow bots or unofficial clients on their platform, so this shouldn't be considered
|
||||
totally safe.
|
||||
</small>
|
||||
</p>
|
||||
<a href='https://waha.devlike.pro/docs/overview/introduction/' target='_blank'>
|
||||
Documentation
|
||||
</a>
|
||||
has a lof examples and how-to guides.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row justify-content-center text-center">
|
||||
<div class="col-lg-5">
|
||||
<h2 class="h4">Self hosted</h2>
|
||||
<div class='row justify-content-center text-center'>
|
||||
<div class='col-lg-5'>
|
||||
<img src='/images/icons/servers.png' alt='Servers' style='width: 5rem'>
|
||||
<h2 class='h4'>Self-hosted solution</h2>
|
||||
<p>
|
||||
No strings to suspicious SaaS WhatsApp HTTP API solutions. Install it on your own server!
|
||||
<a href='https://waha.devlike.pro/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!
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-lg-5">
|
||||
<h2 class="h4">Easy installation</h2>
|
||||
<div class='col-lg-5'>
|
||||
<img src='/images/icons/easy.png' alt='Easy' style='width: 5rem'>
|
||||
<h2 class='h4'>Quick installation</h2>
|
||||
<p>
|
||||
You need to install <a href="https://docs.docker.com/engine/install/">Docker</a> and can run the API in a
|
||||
click!
|
||||
<br/>
|
||||
<small class="text-muted">
|
||||
You need to install Docker and
|
||||
<a href='https://waha.devlike.pro/docs/how-to/install/' target='_blank'>
|
||||
run the API in a click!
|
||||
</a>
|
||||
<br />
|
||||
<small class='text-muted'>
|
||||
It's actually "a command", not a click.
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-lg-5">
|
||||
<h2 class="h4">It's free!</h2>
|
||||
<div class='col-lg-5'>
|
||||
<img src='/images/icons/checked.png' alt='Checked' style='width: 5rem'>
|
||||
<h2 class='h4'>No blocking</h2>
|
||||
<p>
|
||||
<b>WAHA Core</b> version is always free!
|
||||
<br>
|
||||
Even <b>WAHA Plus</b> version does not require monthly donations and have no licence expiration!
|
||||
<a href='https://waha.devlike.pro/docs/how-to/engines/' target='_blank'>
|
||||
Under the hood
|
||||
</a>
|
||||
it runs a real instance of Whatsapp Web to avoid getting blocked.
|
||||
<br />
|
||||
<small class='text-muted'>
|
||||
WhatsApp does not allow bots or unofficial clients on their platform, so this shouldn't be considered
|
||||
totally safe.
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -80,9 +108,9 @@
|
||||
{{ end }}
|
||||
|
||||
{{ define "sidebar-footer" }}
|
||||
<section class="section section-sm container-fluid">
|
||||
<div class="row justify-content-center text-center">
|
||||
<div class="col-lg-9">
|
||||
<section class='section section-sm container-fluid'>
|
||||
<div class='row justify-content-center text-center'>
|
||||
<div class='col-lg-9'>
|
||||
{{- .Content -}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 7.4 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 49 KiB |
@@ -0,0 +1,16 @@
|
||||
html {
|
||||
box-sizing: border-box;
|
||||
overflow: -moz-scrollbars-vertical;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
*,
|
||||
*:before,
|
||||
*:after {
|
||||
box-sizing: inherit;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
background: #fafafa;
|
||||
}
|
||||
@@ -1,57 +1,19 @@
|
||||
<!-- HTML for static distribution bundle build -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>devlikeapro/whatsapp-http-api</title>
|
||||
<link href="./swagger-ui.css" rel="stylesheet" type="text/css">
|
||||
<link href="./favicon-32x32.png" rel="icon" sizes="32x32" type="image/png"/>
|
||||
<link href="./favicon-16x16.png" rel="icon" sizes="16x16" type="image/png"/>
|
||||
<style>
|
||||
html {
|
||||
box-sizing: border-box;
|
||||
overflow: -moz-scrollbars-vertical;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
<title>WAHA | Swagger UI</title>
|
||||
<link rel="stylesheet" type="text/css" href="./swagger-ui.css" />
|
||||
<link rel="stylesheet" type="text/css" href="index.css" />
|
||||
<link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32" />
|
||||
<link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16" />
|
||||
</head>
|
||||
|
||||
*,
|
||||
*:before,
|
||||
*:after {
|
||||
box-sizing: inherit;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
background: #fafafa;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="swagger-ui"></div>
|
||||
|
||||
<script charset="UTF-8" src="./swagger-ui-bundle.js"></script>
|
||||
<script charset="UTF-8" src="./swagger-ui-standalone-preset.js"></script>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
// Begin Swagger UI call region
|
||||
const ui = SwaggerUIBundle({
|
||||
url: "openapi.json",
|
||||
dom_id: '#swagger-ui',
|
||||
deepLinking: true,
|
||||
presets: [
|
||||
SwaggerUIBundle.presets.apis,
|
||||
SwaggerUIStandalonePreset
|
||||
],
|
||||
plugins: [
|
||||
SwaggerUIBundle.plugins.DownloadUrl
|
||||
],
|
||||
layout: "StandaloneLayout"
|
||||
})
|
||||
// End Swagger UI call region
|
||||
|
||||
window.ui = ui
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
<body>
|
||||
<div id="swagger-ui"></div>
|
||||
<script src="./swagger-ui-bundle.js" charset="UTF-8"> </script>
|
||||
<script src="./swagger-ui-standalone-preset.js" charset="UTF-8"> </script>
|
||||
<script src="./swagger-initializer.js" charset="UTF-8"> </script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -4,45 +4,41 @@
|
||||
<title>Swagger UI: OAuth2 Redirect</title>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
function run() {
|
||||
function run () {
|
||||
var oauth2 = window.opener.swaggerUIRedirectOauth2;
|
||||
var sentState = oauth2.state;
|
||||
var redirectUrl = oauth2.redirectUrl;
|
||||
var isValid, qp, arr;
|
||||
|
||||
if (/code|token|error/.test(window.location.hash)) {
|
||||
qp = window.location.hash.substring(1);
|
||||
qp = window.location.hash.substring(1).replace('?', '&');
|
||||
} else {
|
||||
qp = location.search.substring(1);
|
||||
}
|
||||
|
||||
arr = qp.split("&")
|
||||
arr.forEach(function (v, i, _arr) {
|
||||
_arr[i] = '"' + v.replace('=', '":"') + '"';
|
||||
})
|
||||
arr = qp.split("&");
|
||||
arr.forEach(function (v,i,_arr) { _arr[i] = '"' + v.replace('=', '":"') + '"';});
|
||||
qp = qp ? JSON.parse('{' + arr.join() + '}',
|
||||
function (key, value) {
|
||||
return key === "" ? value : decodeURIComponent(value)
|
||||
}
|
||||
) : {}
|
||||
function (key, value) {
|
||||
return key === "" ? value : decodeURIComponent(value);
|
||||
}
|
||||
) : {};
|
||||
|
||||
isValid = qp.state === sentState
|
||||
isValid = qp.state === sentState;
|
||||
|
||||
if ((
|
||||
oauth2.auth.schema.get("flow") === "accessCode" ||
|
||||
oauth2.auth.schema.get("flow") === "authorizationCode"
|
||||
oauth2.auth.schema.get("flow") === "accessCode" ||
|
||||
oauth2.auth.schema.get("flow") === "authorizationCode" ||
|
||||
oauth2.auth.schema.get("flow") === "authorization_code"
|
||||
) && !oauth2.auth.code) {
|
||||
if (!isValid) {
|
||||
oauth2.errCb({
|
||||
authId: oauth2.auth.name,
|
||||
source: "auth",
|
||||
level: "warning",
|
||||
message: "Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server"
|
||||
message: "Authorization may be unsafe, passed state was changed in server. The passed state wasn't returned from auth server."
|
||||
});
|
||||
}
|
||||
|
||||
@@ -51,18 +47,18 @@
|
||||
oauth2.auth.code = qp.code;
|
||||
oauth2.callback({auth: oauth2.auth, redirectUrl: redirectUrl});
|
||||
} else {
|
||||
let oauthErrorMsg
|
||||
let oauthErrorMsg;
|
||||
if (qp.error) {
|
||||
oauthErrorMsg = "[" + qp.error + "]: " +
|
||||
(qp.error_description ? qp.error_description + ". " : "no accessCode received from the server. ") +
|
||||
(qp.error_uri ? "More info: " + qp.error_uri : "");
|
||||
oauthErrorMsg = "["+qp.error+"]: " +
|
||||
(qp.error_description ? qp.error_description+ ". " : "no accessCode received from the server. ") +
|
||||
(qp.error_uri ? "More info: "+qp.error_uri : "");
|
||||
}
|
||||
|
||||
oauth2.errCb({
|
||||
authId: oauth2.auth.name,
|
||||
source: "auth",
|
||||
level: "error",
|
||||
message: oauthErrorMsg || "[Authorization failed]: no accessCode received from the server"
|
||||
message: oauthErrorMsg || "[Authorization failed]: no accessCode received from the server."
|
||||
});
|
||||
}
|
||||
} else {
|
||||
@@ -71,7 +67,13 @@
|
||||
window.close();
|
||||
}
|
||||
|
||||
window.addEventListener('DOMContentLoaded', function () {
|
||||
if (document.readyState !== 'loading') {
|
||||
run();
|
||||
});
|
||||
} else {
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
run();
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1 +1 @@
|
||||
{"openapi":"3.0.0","paths":{"/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","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionStopRequest"}}}},"responses":{"201":{"description":""}},"tags":["sessions"],"security":[{"api_key":[]}]}},"/api/sessions":{"get":{"operationId":"SessionsController_list","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SessionDTO"}}}}}},"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"}},{"name":"session","required":true,"in":"query","schema":{"default":"default","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WANumberExistResult"}}}}},"tags":["chatting"],"security":[{"api_key":[]}]}},"/api/sendContactVcard":{"post":{"operationId":"ChattingController_sendContactVcard","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageContactVcardRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["chatting"],"security":[{"api_key":[]}]}},"/api/sendText":{"get":{"operationId":"ChattingController_sendTextGet","summary":"Send a text message","parameters":[{"name":"phone","required":true,"in":"query","schema":{"type":"string"}},{"name":"text","required":true,"in":"query","schema":{"type":"string"}},{"name":"session","required":true,"in":"query","schema":{"default":"default","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["chatting"],"security":[{"api_key":[]}]},"post":{"operationId":"ChattingController_sendText","summary":"Send a text message","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageTextRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WAMessage"}}}}},"tags":["chatting"],"security":[{"api_key":[]}]}},"/api/sendTextButtons":{"post":{"operationId":"ChattingController_sendTextButtons","summary":"Send a text message with buttons","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageTextButtonsRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["chatting"],"security":[{"api_key":[]}]}},"/api/sendLocation":{"post":{"operationId":"ChattingController_sendLocation","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageLocationRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["chatting"],"security":[{"api_key":[]}]}},"/api/sendLinkPreview":{"post":{"operationId":"ChattingController_sendLinkPreview","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageLinkPreviewRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["chatting"],"security":[{"api_key":[]}]}},"/api/sendImage":{"post":{"operationId":"ChattingController_sendImage","summary":"Send an image. Either from an URL or base64 data - look at the request schemas for details.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageImageRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["chatting"],"security":[{"api_key":[]}]}},"/api/sendFile":{"post":{"operationId":"ChattingController_sendFile","summary":"Send a file. Either from an URL or base64 data - look at the request schemas for details.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageFileRequest"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["chatting"],"security":[{"api_key":[]}]}},"/api/sendVoice":{"post":{"operationId":"ChattingController_sendVoice","summary":"Send an voice message. Either from an URL or basLine 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/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}/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"}},{"name":"session","required":true,"in":"query","schema":{"default":"default","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WANumberExistResult"}}}}},"tags":["chatting"],"security":[{"api_key":[]}]}},"/api/sendContactVcard":{"post":{"operationId":"ChattingController_sendContactVcard","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageContactVcardRequest"}}}},"responses":{"201":{"description":""}},"tags":["chatting"],"security":[{"api_key":[]}]}},"/api/sendText":{"get":{"operationId":"ChattingController_sendTextGet","summary":"Send a text message","parameters":[{"name":"phone","required":true,"in":"query","schema":{"type":"string"}},{"name":"text","required":true,"in":"query","schema":{"type":"string"}},{"name":"session","required":true,"in":"query","schema":{"default":"default","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["chatting"],"security":[{"api_key":[]}]},"post":{"operationId":"ChattingController_sendText","summary":"Send a text message","parameters":[],"requestBody":{"required":true,Line truncated
|
||||
@@ -0,0 +1,20 @@
|
||||
window.onload = function() {
|
||||
//<editor-fold desc="Changeable Configuration Block">
|
||||
|
||||
// the following lines will be replaced by docker/configurator, when it runs in a docker-container
|
||||
window.ui = SwaggerUIBundle({
|
||||
url: "openapi.json",
|
||||
dom_id: '#swagger-ui',
|
||||
deepLinking: true,
|
||||
presets: [
|
||||
SwaggerUIBundle.presets.apis,
|
||||
SwaggerUIStandalonePreset
|
||||
],
|
||||
plugins: [
|
||||
SwaggerUIBundle.plugins.DownloadUrl
|
||||
],
|
||||
layout: "StandaloneLayout"
|
||||
});
|
||||
|
||||
//</editor-fold>
|
||||
};
|
||||
@@ -1,3 +1,3 @@
|
||||
/*! For license information please see swagger-ui-bundle.js.LICENSE.txt */
|
||||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(function(){try{return require("esprima")}catch(e){}}()):"function"==typeof define&&define.amd?define(["esprima"],t):"object"==typeof exports?exports.SwaggerUIBundle=t(function(){try{return require("esprima")}catch(e){}}()):e.SwaggerUIBundle=t(e.esprima)}(this,(function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist",n(n.s=544)}([function(e,t,n){"use strict";e.exports=n(129)},function(e,t,n){e.exports=function(){"use strict";var e=Array.prototype.slice;function t(e,t){t&&(e.prototype=Object.create(t.prototype)),e.prototype.constructor=e}function n(e){return i(e)?e:J(e)}function r(e){return s(e)?e:K(e)}function o(e){return u(e)?e:Y(e)}function a(e){return i(e)&&!c(e)?e:G(e)}function i(e){return!(!e||!e[p])}function s(e){return!(!e||!e[f])}function u(e){return!(!e||!e[h])}function c(e){return s(e)||u(e)}function l(e){return!(!e||!e[d])}t(r,n),t(o,n),t(a,n),n.isIterable=i,n.isKeyed=s,n.isIndexed=u,n.isAssociative=c,n.isOrdered=l,n.Keyed=r,n.Indexed=o,n.Set=a;var p="@@__IMMUTABLE_ITERABLE__@@",f="@@__IMMUTABLE_KEYED__@@",h="@@__IMMUTABLE_INDEXED__@@",d="@@__IMMUTABLE_ORDERED__@@",m="delete",v=5,g=1<<v,y=g-1,b={},_={value:!1},w={value:!1};function x(e){return e.value=!1,e}function E(e){e&&(e.value=!0)}function S(){}function C(e,t){t=t||0;for(var n=Math.max(0,e.length-t),r=new Array(n),o=0;o<n;o++)r[o]=e[o+t];return r}function A(e){return void 0===e.size&&(e.size=e.__iterate(O)),e.size}function k(e,t){if("number"!=typeof t){var n=t>>>0;if(""+n!==t||4294967295===n)return NaN;t=n}return t<0?A(e)+t:t}function O(){return!0}function j(e,t,n){return(0===e||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function T(e,t){return N(e,t,0)}function I(e,t){return N(e,t,t)}function N(e,t,n){return void 0===e?n:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}var P=0,M=1,R=2,D="function"==typeof Symbol&&Symbol.iterator,L="@@iterator",B=D||L;function F(e){this.next=e}function U(e,t,n,r){var o=0===e?t:1===e?n:[t,n];return r?r.value=o:r={value:o,done:!1},r}function q(){return{value:void 0,done:!0}}function z(e){return!!H(e)}function V(e){return e&&"function"==typeof e.next}function W(e){var t=H(e);return t&&t.call(e)}function H(e){var t=e&&(D&&e[D]||e[L]);if("function"==typeof t)return t}function $(e){return e&&"number"==typeof e.length}function J(e){return null==e?ie():i(e)?e.toSeq():ce(e)}function K(e){return null==e?ie().toKeyedSeq():i(e)?s(e)?e.toSeq():e.fromEntrySeq():se(e)}function Y(e){return null==e?ie():i(e)?s(e)?e.entrySeq():e.toIndexedSeq():ue(e)}function G(e){return(null==e?ie():i(e)?s(e)?e.entrySeq():e:ue(e)).toSetSeq()}F.prototype.toString=function(){return"[Iterator]"},F.KEYS=P,F.VALUES=M,F.ENTRIES=R,F.prototype.inspect=F.prototype.toSource=function(){return this.toString()},F.prototype[B]=function(){return this},t(J,n),J.of=function(){return J(arguments)},J.prototype.toSeq=function(){return this},J.prototype.toString=function(){return this.__toString("Seq {","}")},J.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},J.prototype.__iterate=function(e,t){return pe(this,e,t,!0)},J.prototype.__iterator=function(e,t){return fe(this,e,t,!0)},t(K,J),K.prototype.toKeyedSeq=function(){return this},t(Y,J),Y.of=function(){return Y(arguments)},Y.prototype.toIndexedSeq=function(){return this},Y.prototype.toString=function(){return this.__toString("Seq [","]")},Y.prototype.__iterate=function(e,t){return pe(this,e,t,!1)},Y.prototype.__iterator=function(e,t){return fe(this,e,t,!1)},t(G,J),G.of=function(){return G(arguments)},G.prototype.toSetSeq=function(){return this},J.isSeq=ae,J.Keyed=K,J.Set=G,J.Indexed=Y;var Z,X,Q,ee="@@__IMMUTABLE_SEQ__@@";function te(e){this._array=e,this.size=e.length}function ne(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}function re(e){this._iterable=e,this.size=e.length||e.size}function oe(e){this._iterator=e,this._iteratorCache=[]}function ae(e){return!(!e||!e[ee])}function ie(){return Z||(Z=new te([]))}function se(e){var t=Array.isArray(Line truncated
|
||||
//# sourceMappingURL=swagger-ui-bundle.js.map
|
||||
!function webpackUniversalModuleDefinition(i,s){"object"==typeof exports&&"object"==typeof module?module.exports=s():"function"==typeof define&&define.amd?define([],s):"object"==typeof exports?exports.SwaggerUIBundle=s():i.SwaggerUIBundle=s()}(this,(()=>(()=>{var i={17967:(i,s)=>{"use strict";s.Nm=s.Rq=void 0;var u=/^([^\w]*)(javascript|data|vbscript)/im,m=/&#(\w+)(^\w|;)?/g,v=/&(newline|tab);/gi,_=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,j=/^.+(:|:)/gim,M=[".","/"];s.Rq="about:blank",s.Nm=function sanitizeUrl(i){if(!i)return s.Rq;var $=function decodeHtmlCharacters(i){return i.replace(_,"").replace(m,(function(i,s){return String.fromCharCode(s)}))}(i).replace(v,"").replace(_,"").trim();if(!$)return s.Rq;if(function isRelativeUrlWithoutProtocol(i){return M.indexOf(i[0])>-1}($))return $;var W=$.match(j);if(!W)return $;var X=W[0];return u.test(X)?s.Rq:$}},79742:(i,s)=>{"use strict";s.byteLength=function byteLength(i){var s=getLens(i),u=s[0],m=s[1];return 3*(u+m)/4-m},s.toByteArray=function toByteArray(i){var s,u,_=getLens(i),j=_[0],M=_[1],$=new v(function _byteLength(i,s,u){return 3*(s+u)/4-u}(0,j,M)),W=0,X=M>0?j-4:j;for(u=0;u<X;u+=4)s=m[i.charCodeAt(u)]<<18|m[i.charCodeAt(u+1)]<<12|m[i.charCodeAt(u+2)]<<6|m[i.charCodeAt(u+3)],$[W++]=s>>16&255,$[W++]=s>>8&255,$[W++]=255&s;2===M&&(s=m[i.charCodeAt(u)]<<2|m[i.charCodeAt(u+1)]>>4,$[W++]=255&s);1===M&&(s=m[i.charCodeAt(u)]<<10|m[i.charCodeAt(u+1)]<<4|m[i.charCodeAt(u+2)]>>2,$[W++]=s>>8&255,$[W++]=255&s);return $},s.fromByteArray=function fromByteArray(i){for(var s,m=i.length,v=m%3,_=[],j=16383,M=0,$=m-v;M<$;M+=j)_.push(encodeChunk(i,M,M+j>$?$:M+j));1===v?(s=i[m-1],_.push(u[s>>2]+u[s<<4&63]+"==")):2===v&&(s=(i[m-2]<<8)+i[m-1],_.push(u[s>>10]+u[s>>4&63]+u[s<<2&63]+"="));return _.join("")};for(var u=[],m=[],v="undefined"!=typeof Uint8Array?Uint8Array:Array,_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",j=0;j<64;++j)u[j]=_[j],m[_.charCodeAt(j)]=j;function getLens(i){var s=i.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var u=i.indexOf("=");return-1===u&&(u=s),[u,u===s?0:4-u%4]}function encodeChunk(i,s,m){for(var v,_,j=[],M=s;M<m;M+=3)v=(i[M]<<16&16711680)+(i[M+1]<<8&65280)+(255&i[M+2]),j.push(u[(_=v)>>18&63]+u[_>>12&63]+u[_>>6&63]+u[63&_]);return j.join("")}m["-".charCodeAt(0)]=62,m["_".charCodeAt(0)]=63},48764:(i,s,u)=>{"use strict";const m=u(79742),v=u(80645),_="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;s.Buffer=Buffer,s.SlowBuffer=function SlowBuffer(i){+i!=i&&(i=0);return Buffer.alloc(+i)},s.INSPECT_MAX_BYTES=50;const j=2147483647;function createBuffer(i){if(i>j)throw new RangeError('The value "'+i+'" is invalid for option "size"');const s=new Uint8Array(i);return Object.setPrototypeOf(s,Buffer.prototype),s}function Buffer(i,s,u){if("number"==typeof i){if("string"==typeof s)throw new TypeError('The "string" argument must be of type string. Received type number');return allocUnsafe(i)}return from(i,s,u)}function from(i,s,u){if("string"==typeof i)return function fromString(i,s){"string"==typeof s&&""!==s||(s="utf8");if(!Buffer.isEncoding(s))throw new TypeError("Unknown encoding: "+s);const u=0|byteLength(i,s);let m=createBuffer(u);const v=m.write(i,s);v!==u&&(m=m.slice(0,v));return m}(i,s);if(ArrayBuffer.isView(i))return function fromArrayView(i){if(isInstance(i,Uint8Array)){const s=new Uint8Array(i);return fromArrayBuffer(s.buffer,s.byteOffset,s.byteLength)}return fromArrayLike(i)}(i);if(null==i)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i);if(isInstance(i,ArrayBuffer)||i&&isInstance(i.buffer,ArrayBuffer))return fromArrayBuffer(i,s,u);if("undefined"!=typeof SharedArrayBuffer&&(isInstance(i,SharedArrayBuffer)||i&&isInstance(i.buffer,SharedArrayBuffer)))return fromArrayBuffer(i,s,u);if("number"==typeof i)throw new TypeError('The "value" argument must not be of type number. Received type number');const m=i.valueOf&&i.valueOf();if(null!=m&&m!==i)return Buffer.from(m,s,u);const v=function fromObject(i){if(Buffer.isBuffer(i)){const s=0|checked(i.length),u=createBuffer(s);return 0===u.length||i.copy(u,0,0,s),u}if(void 0!==i.length)return"number"!=typeof i.length||numberIsNaN(i.length)?createBuffer(0):fromArrayLike(i);if("Buffer"===i.type&&Array.isArray(i.data))return fromArrayLike(i.data)}(i);if(v)return v;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof i[Symbol.toPrimitive])return Buffer.from(i[Symbol.toPrimitive]("string"),s,u);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i)}function assertSize(i){if("number"!=typeof i)throw new TypeError('"size" argument must be of type number');if(i<0)throw new RangeError('The value "'+i+'" is invalid for option "size"')}function allocUnsafe(i){return assertSize(i),createBuffer(i<0Line truncated
|
||||
//# sourceMappingURL=swagger-ui-bundle.js.map
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"sources":["webpack://SwaggerUIBundle/webpack/universalModuleDefinition","webpack://SwaggerUIBundle/webpack/bootstrap","webpack://SwaggerUIBundle/./node_modules/react/react.js","webpack://SwaggerUIBundle/./node_modules/immutable/dist/immutable.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/concat.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/defineProperty.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/map.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/createClass.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/classCallCheck.js","webpack://SwaggerUIBundle/./src/core/utils.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/inherits.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/createSuper.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/assertThisInitialized.js","webpack://SwaggerUIBundle/./node_modules/prop-types/index.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/filter.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/index-of.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/array/is-array.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/slicedToArray.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/object/keys.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/toConsumableArray.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/for-each.js","webpack://SwaggerUIBundle/./node_modules/reselect/es/index.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/typeof.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/object/assign.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/reduce.js","webpack://SwaggerUIBundle/./node_modules/core-js-pure/internals/export.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/slice.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/objectSpread2.js","webpack://SwaggerUIBundle/./node_modules/fbjs/lib/invariant.js","webpack://SwaggerUIBundle/./src/core/window.js","webpack://SwaggerUIBundle/./node_modules/react-immutable-proptypes/dist/ImmutablePropTypes.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/extends.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/bind.js","webpack://SwaggerUIBundle/./node_modules/react-dom/lib/reactProdInvariant.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/json/stringify.js","webpack://SwaggerUIBundle/./node_modules/core-js-pure/internals/path.js","webpack://SwaggerUIBundle/./node_modules/fbjs/lib/warning.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/some.js","webpack://SwaggerUIBundle/./node_modules/core-js-pure/internals/fails.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/includes.js","webpack://SwaggerUIBundle/./src/core/plugins/oas3/helpers.jsx","webpack://SwaggerUIBundle/./node_modules/core-js-pure/internals/well-known-symbol.js","webpack://SwaggerUIBundle/./node_modules/object-assign/index.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/regenerator/index.js","webpack://SwaggerUIBundle/./node_modules/core-js-pure/internals/global.js","webpack://SwaggerUIBundle/./node_modules/core-js-pure/internals/entry-virtual.js","webpack://SwaggerUIBundle/./node_modules/react-dom/lib/ReactDOMComponentTree.js","webpack://SwaggerUIBundle/./node_modules/core-js-pure/internals/is-object.js","webpack://SwaggerUIBundle/./node_modules/lodash/get.js","webpack://SwaggerUIBundle/./src/core/plugins/spec/actions.js","webpack://SwaggerUIBundle/./node_modules/core-js-pure/internals/descriptors.js","webpack://SwaggerUIBundle/./node_modules/core-js-pure/internals/define-well-known-symbol.js","webpack://SwaggerUIBundle/./node_modules/js-yaml/lib/js-yaml/type.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/createForOfIteratorHelper.js","webpack://SwaggerUIBundle/./node_modules/core-js-pure/internals/has.js","webpack://SwaggerUIBundle/./node_modules/lodash/isArray.js","webpack://SwaggerUIBundle/(webpack)/buildin/global.js","webpack://SwaggerUIBundle/./node_modules/core-js-pure/internals/an-object.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/objectWithoutProperties.js","webpack://SwaggerUIBundle/./node_modules/fbjs/lib/ExecutionEnvironment.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3Line truncated
|
||||
{"version":3,"file":"swagger-ui-bundle.js","mappings":";CAAA,SAAUA,iCAAiCC,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAyB,gBAAID,IAE7BD,EAAsB,gBAAIC,GAC3B,CATD,CASGK,MAAM,4CCPTJ,EAAQ,GAAcA,EAAQ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qC,EACT,MAAM,IAAIH,UACR,yEAIJ,MAAMsB,EAAUnB,EAAMmB,SAAWnB,EAAMmB,UACvC,GAAe,MAAXA,GAAmBA,IAAYnB,EACjC,OAAOhB,OAAOe,KAAKoB,EAASvB,EAAkBjC,GAGhD,MAAMyD,EAkJR,SAASC,WAAYC,GACnB,GAAItC,OAAOuC,SAASD,GAAM,CACxB,MAAMhE,EAA4B,EAAtBkE,QAAQF,EAAI3D,QAClB4B,EAAMF,aAAa/B,GAEzB,OAAmB,IAAfiC,EAAI5B,QAIR2D,EAAIT,KAAKtB,EAAK,EAAG,EAAGjC,GAHXiC,CAKX,CAEA,QAAmBkC,IAAfH,EAAI3D,OACN,MAA0B,iBAAf2D,EAAI3D,QAAuB+D,YAAYJ,EAAI3D,QAC7C0B,aAAa,GAEf4B,cAAcK,GAGvB,GAAiB,WAAbA,EAAIK,MAAqBtD,MAAMuD,QAAQN,EAAIO,MAC7C,OAAOZ,cAAcK,EAAIO,KAE7B,CAzKYR,CAAWrB,GLine truncated
|
||||
@@ -1,3 +1,3 @@
|
||||
/*! For license information please see swagger-ui-es-bundle-core.js.LICENSE.txt */
|
||||
module.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist",n(n.s=410)}([function(e,t){e.exports=require("react")},function(e,t){e.exports=require("immutable")},function(e,t,n){e.exports=n(449)},function(e,t,n){var r=n(191);e.exports=function(e,t,n){return t in e?r(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){e.exports=n(452)},function(e,t,n){var r=n(191);function a(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),r(e,a.key,a)}}e.exports=function(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),e}},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){"use strict";(function(e){n.d(t,"t",(function(){return me})),n.d(t,"A",(function(){return ve})),n.d(t,"i",(function(){return ge})),n.d(t,"w",(function(){return ye})),n.d(t,"r",(function(){return be})),n.d(t,"u",(function(){return Ee})),n.d(t,"s",(function(){return xe})),n.d(t,"p",(function(){return Se})),n.d(t,"v",(function(){return we})),n.d(t,"y",(function(){return je})),n.d(t,"z",(function(){return Ce})),n.d(t,"K",(function(){return Oe})),n.d(t,"f",(function(){return _e})),n.d(t,"n",(function(){return Ae})),n.d(t,"h",(function(){return ke})),n.d(t,"E",(function(){return Ie})),n.d(t,"L",(function(){return Fe})),n.d(t,"o",(function(){return Ye})),n.d(t,"D",(function(){return Ke})),n.d(t,"a",(function(){return Ge})),n.d(t,"I",(function(){return Ze})),n.d(t,"b",(function(){return Xe})),n.d(t,"H",(function(){return Qe})),n.d(t,"G",(function(){return et})),n.d(t,"F",(function(){return tt})),n.d(t,"k",(function(){return nt})),n.d(t,"d",(function(){return rt})),n.d(t,"g",(function(){return at})),n.d(t,"m",(function(){return ot})),n.d(t,"l",(function(){return it})),n.d(t,"e",(function(){return ct})),n.d(t,"J",(function(){return st})),n.d(t,"x",(function(){return ut})),n.d(t,"B",(function(){return lt})),n.d(t,"C",(function(){return pt})),n.d(t,"j",(function(){return ft})),n.d(t,"c",(function(){return dt})),n.d(t,"q",(function(){return mt}));var r=n(82),a=n.n(r),o=n(130),i=n.n(o),c=n(50),s=n.n(c),u=n(13),l=n.n(u),p=n(30),f=n.n(p),d=n(17),h=n.n(d),m=(n(34),n(32)),v=n.n(m),g=(n(24),n(15),n(157)),y=n.n(g),b=n(21),E=n.n(b),x=n(22),S=n.n(x),w=(n(29),n(16)),j=n.n(w),C=n(12),O=n.n(C),_=n(18),A=n.n(_),k=n(2),I=n.n(k),P=n(45),T=n.n(P),N=n(71),R=n.n(N),M=n(4),D=n.n(M),q=n(14),L=n.n(q),B=n(20),U=n.n(B),V=n(1),z=n.n(V),F=n(375),J=n(376),W=n.n(J),H=n(207),$=n.n(H),Y=n(208),K=n.n(Y),G=n(158),Z=n.n(G),X=n(266),Q=n.n(X),ee=n(102),te=n.n(ee),ne=n(58),re=n.n(ne),ae=n(112),oe=n(26),ie=n(378),ce=n.n(ie),se=n(114),ue=n(379),le=n.n(ue),pe=n(380),fe=n.n(pe),de="default",he=function(e){return z.a.Iterable.isIterable(e)};function me(e){try{var t=JSON.parse(e);if(t&&"object"===U()(t))return t}catch(e){}return!1}function ve(e){return Ee(e)?he(e)?e.toJS():e:{}}function ge(e){var t,n;if(he(e))return e;if(e instanceof oe.a.File)return e;if(!Ee(e))return e;if(L()(e))return D()(n=z.a.Seq(e)).call(n,ge).toList();if(re()(R()(e))){var r,a=function(e){if(!re()(R()(e)))return e;var t,n={},r="_**[]",a={},o=T()(R()(e).call(e));try{for(o.s();!(t=o.n()).done;){var i=t.value;if(n[i[0]]||a[i[0]]&&a[i[0]].containsMultiple){var c,s,u,l;if(!a[i[0]])a[i[0]]={containsMultiple:!0,length:1},n[I()(u=I()(l="".concat(i[0])).call(l,r)).call(u,a[i[0]].length)]=n[i[0]],delete n[i[0]];a[i[0]].length+=1,n[I()(c=I()(s="".concat(i[0])).call(s,r)).call(c,a[i[0]].length)]=i[1]}else n[i[0]]=i[1]}}catch(e){o.e(e)}finally{o.f()}return n}(e);return D()(r=z.a.OrderedMap(a)).call(r,ge)}return D()(t=z.a.OrderedMap(e)).call(t,ge)}function ye(e){return L()(e)?e:[e]}function be(e){return"function"==typeof e}function Ee(e){return!!e&&"object"===U()(e)}function xe(e){return"function"==typeof e}function Se(e){return L()(e)}var we=K.a;function je(e,t){var n;return S()(n=j()(e)).call(n,(function(n,r){return n[r]=t(e[r],r),n}),{})}function Ce(e,t){var n;return S()(n=j()(e)).call(n,(function(n,r){var a=t(e[r],r);return a&&"object"===U()(a)&&E()(n,a),n}),{})}function Oe(e){return function(t){t.dispatch,t.getStateLine truncated
|
||||
//# sourceMappingURL=swagger-ui-es-bundle-core.js.map
|
||||
import*as e from"base64-js";import*as t from"ieee754";import*as r from"repeat-string";import*as n from"react";import*as a from"redux";import*as o from"immutable";import*as s from"redux-immutable";import*as l from"serialize-error";import*as i from"lodash/merge";import*as c from"@braintree/sanitize-url";import*as u from"lodash/camelCase";import*as d from"lodash/upperFirst";import*as p from"lodash/memoize";import*as m from"lodash/find";import*as f from"lodash/some";import*as h from"lodash/eq";import*as g from"lodash/isFunction";import*as y from"css.escape";import*as v from"url-parse";import*as S from"reselect";import*as _ from"prop-types";import*as b from"lodash/omit";import*as w from"js-yaml";import*as C from"zenscroll";import*as x from"react-immutable-proptypes";import*as O from"lodash/reduce";import*as k from"lodash/get";import*as N from"@babel/runtime-corejs3/helpers/extends";import*as A from"react-copy-to-clipboard";import*as I from"react-syntax-highlighter/dist/esm/light";import*as R from"react-syntax-highlighter/dist/esm/languages/hljs/javascript";import*as T from"react-syntax-highlighter/dist/esm/languages/hljs/json";import*as B from"react-syntax-highlighter/dist/esm/languages/hljs/bash";import*as j from"react-syntax-highlighter/dist/esm/languages/hljs/yaml";import*as P from"react-syntax-highlighter/dist/esm/languages/hljs/http";import*as M from"react-syntax-highlighter/dist/esm/languages/hljs/powershell";import*as q from"react-syntax-highlighter/dist/esm/styles/hljs/agate";import*as L from"react-syntax-highlighter/dist/esm/styles/hljs/arta";import*as D from"react-syntax-highlighter/dist/esm/styles/hljs/monokai";import*as U from"react-syntax-highlighter/dist/esm/styles/hljs/nord";import*as $ from"react-syntax-highlighter/dist/esm/styles/hljs/obsidian";import*as J from"react-syntax-highlighter/dist/esm/styles/hljs/tomorrow-night";import*as V from"react-syntax-highlighter/dist/esm/styles/hljs/idea";import*as K from"randexp";import*as z from"lodash/isEmpty";import*as F from"lodash/isString";import*as W from"lodash/debounce";import*as H from"lodash/set";import*as G from"lodash/fp/assocPath";import*as X from"lodash/constant";import*as Y from"swagger-client/es/resolver/strategies/generic";import*as Q from"swagger-client/es/resolver/strategies/openapi-2";import*as Z from"swagger-client/es/resolver/strategies/openapi-3-0";import*as ee from"swagger-client/es/resolver/strategies/openapi-3-1-apidom";import*as te from"swagger-client/es/resolver";import*as re from"swagger-client/es/execute";import*as ne from"swagger-client/es/http";import*as ae from"swagger-client/es/subtree-resolver";import*as oe from"swagger-client/es/helpers";import*as se from"react-dom";import*as le from"react-redux";import*as ie from"lodash/identity";import*as ce from"lodash/zipObject";import*as ue from"lodash/toString";import*as de from"classnames";import*as pe from"js-file-download";import*as me from"lodash/toLower";import*as fe from"react-immutable-pure-component";import*as he from"remarkable";import*as ge from"remarkable/linkify";import*as ye from"dompurify";import*as Ee from"react-debounce-input";import*as ve from"lodash/isPlainObject";var Se={764:function(e,t,r){const n=r(780),a=r(294),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=Buffer,t.SlowBuffer=function SlowBuffer(e){+e!=e&&(e=0);return Buffer.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function createBuffer(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,Buffer.prototype),t}function Buffer(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return allocUnsafe(e)}return from(e,t,r)}function from(e,t,r){if("string"==typeof e)return function fromString(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!Buffer.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|byteLength(e,t);let n=createBuffer(r);const a=n.write(e,t);a!==r&&(n=n.slice(0,a));return n}(e,t);if(ArrayBuffer.isView(e))return function fromArrayView(e){if(isInstance(e,Uint8Array)){const t=new Uint8Array(e);return fromArrayBuffer(t.buffer,t.byteOffset,t.byteLength)}return fromArrayLike(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(isInstance(e,ArrayBuffer)||e&&isInstance(e.buffer,ArrayBuffer))return fromArrayBuffer(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(isInstance(e,SharedArrayBuffer)||e&&isInstance(e.buffer,SharedArrayBuffer)))return fromArrayBuffer(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return Buffer.from(n,t,r);const a=function fromObject(e){if(Buffer.isBuffer(e)){const t=0|checked(e.length),r=creaLine truncated
|
||||
//# sourceMappingURL=swagger-ui-es-bundle-core.js.map
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"sources":["webpack://SwaggerUIBundle/webpack/bootstrap","webpack://SwaggerUIBundle/external \"react\"","webpack://SwaggerUIBundle/external \"immutable\"","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/concat.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/defineProperty.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/map.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/createClass.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/classCallCheck.js","webpack://SwaggerUIBundle/./src/core/utils.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/inherits.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/createSuper.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/assertThisInitialized.js","webpack://SwaggerUIBundle/external \"prop-types\"","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/filter.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/index-of.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/array/is-array.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/slicedToArray.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/object/keys.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/toConsumableArray.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/for-each.js","webpack://SwaggerUIBundle/external \"reselect\"","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/typeof.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/object/assign.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/reduce.js","webpack://SwaggerUIBundle/./node_modules/core-js-pure/internals/export.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/slice.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/objectSpread2.js","webpack://SwaggerUIBundle/./src/core/window.js","webpack://SwaggerUIBundle/external \"react-immutable-proptypes\"","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/extends.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/bind.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/json/stringify.js","webpack://SwaggerUIBundle/./node_modules/core-js-pure/internals/path.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/some.js","webpack://SwaggerUIBundle/./node_modules/core-js-pure/internals/fails.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/includes.js","webpack://SwaggerUIBundle/./src/core/plugins/oas3/helpers.jsx","webpack://SwaggerUIBundle/./node_modules/core-js-pure/internals/well-known-symbol.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/regenerator/index.js","webpack://SwaggerUIBundle/./node_modules/core-js-pure/internals/global.js","webpack://SwaggerUIBundle/./node_modules/core-js-pure/internals/entry-virtual.js","webpack://SwaggerUIBundle/./node_modules/core-js-pure/internals/is-object.js","webpack://SwaggerUIBundle/./node_modules/lodash/get.js","webpack://SwaggerUIBundle/./src/core/plugins/spec/actions.js","webpack://SwaggerUIBundle/./node_modules/core-js-pure/internals/descriptors.js","webpack://SwaggerUIBundle/./node_modules/core-js-pure/internals/define-well-known-symbol.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/createForOfIteratorHelper.js","webpack://SwaggerUIBundle/./node_modules/core-js-pure/internals/has.js","webpack://SwaggerUIBundle/./node_modules/lodash/isArray.js","webpack://SwaggerUIBundle/./node_modules/core-js-pure/internals/an-object.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/objectWithoutProperties.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/find.js","webpack://SwaggerUIBundle/./src/core/plugins/oas3/actions.js","webpack://SwaggerUIBundle/./node_modules/lodash/isObject.js","webpack://SwaggerUIBundle/./node_modules/swagger-client/es/helpers.js","webpack://SwaggerUIBundle/./src/core/plugins/err/actions.js","webpack://SwaggerUIBundle/./node_modules/core-js-pure/internals/object-define-property.js","webpack://SwaggerUIBundle/./node_modules/core-js-pure/internals/array-method-uses-to-length.js","webpack://SwaggerUIBundle/external \"classnames\"","webpack://SwaggerUIBundle/./node_modules/lodash/isFunction.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/promise.js","webpack://SwagLine truncated
|
||||
{"version":3,"file":"swagger-ui-es-bundle-core.js","mappings":";snGAUA,MAAMA,EAAS,EAAQ,KACjBC,EAAU,EAAQ,KAClBC,EACe,mBAAXC,QAAkD,mBAAlBA,OAAY,IAChDA,OAAY,IAAE,8BACd,KAENC,EAAQC,OAASA,OACjBD,EAAQE,WAyTR,SAASA,WAAYC,IACdA,GAAUA,IACbA,EAAS,GAEX,OAAOF,OAAOG,OAAOD,EACvB,EA7TAH,EAAQK,kBAAoB,GAE5B,MAAMC,EAAe,WAwDrB,SAASC,aAAcJ,GACrB,GAAIA,EAASG,EACX,MAAM,IAAIE,WAAW,cAAgBL,EAAS,kCAGhD,MAAMM,EAAM,IAAIC,WAAWP,GAE3B,OADAQ,OAAOC,eAAeH,EAAKR,OAAOY,WAC3BJ,CACT,CAYA,SAASR,OAAQa,EAAKC,EAAkBZ,GAEtC,GAAmB,iBAARW,EAAkB,CAC3B,GAAgC,iBAArBC,EACT,MAAM,IAAIC,UACR,sEAGJ,OAAOC,YAAYH,EACrB,CACA,OAAOI,KAAKJ,EAAKC,EAAkBZ,EACrC,CAIA,SAASe,KAAMC,EAAOJ,EAAkBZ,GACtC,GAAqB,iBAAVgB,EACT,OAqHJ,SAASC,WAAYC,EAAQC,GACH,iBAAbA,GAAsC,KAAbA,IAClCA,EAAW,QAGb,IAAKrB,OAAOsB,WAAWD,GACrB,MAAM,IAAIN,UAAU,qBAAuBM,GAG7C,MAAMnB,EAAwC,EAA/BqB,WAAWH,EAAQC,GAClC,IAAIb,EAAMF,aAAaJ,GAEvB,MAAMsB,EAAShB,EAAIiB,MAAML,EAAQC,GAE7BG,IAAWtB,IAIbM,EAAMA,EAAIkB,MAAM,EAAGF,IAGrB,OAAOhB,CACT,CA3IWW,CAAWD,EAAOJ,GAG3B,GAAIa,YAAYC,OAAOV,GACrB,OAkJJ,SAASW,cAAeC,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AOC,GAEnC,QACE,GAAIN,EAAa,MAAM,IAAI5C,UAAU,qBAAuBM,GAC5DA,GAAYA,EAAW,IAAIyC,cAC3BH,GAAc,EAGtB,CAUA,SAASc,KAAMlC,EAAGmC,EAAGC,GACnB,MAAMpB,EAAIhB,EAAEmC,GACZnC,EAAEmC,GAAKnC,EAAEoC,GACTpC,EAAEoC,GAAKpB,CACT,CA2IA,SAASqB,qBAAsB1C,EAAQ2C,EAAK1C,EAAYd,EAAUyD,GAEhE,GAAsB,IAAlB5C,EAAOhC,OAAc,OAAQ,EAmBjC,GAhB0B,iBAAfiC,GACTd,EAAWc,EACXA,EAAa,GACJA,EAAa,WACtBA,EAAa,WACJA,GAAc,aACvBA,GAAc,YAGZW,YADJX,GAAcA,KAGZA,EAAa2C,EAAM,EAAK5C,EAAOhC,OAAS,GAItCiC,EAAa,IAAGA,EAAaD,EAAOhC,OAASiC,GAC7CA,GAAcD,EAAOhC,OAAQ,CAC/B,GAAI4E,EAAK,OAAQ,EACZ3C,EAAaD,EAAOhC,OAAS,CACpC,MAAO,GAAIiC,EAAa,EAAG,CACzB,IAAI2C,EACC,OAAQ,EADJ3C,EAAa,CAExB,CAQA,GALmB,iBAAR0C,IACTA,EAAM7E,OAAOiB,KAAK4D,EAAKxD,IAIrBrB,OAAO0C,SAASmC,GAElB,OAAmB,IAAfA,EAAI3E,QACE,EAEH6E,aAAa7C,EAAQ2C,EAAK1C,EAAYd,EAAUyD,GAClD,GAAmB,iBAARD,EAEhB,OADAA,GAAY,IACgC,mBAAjCpE,WAAWLine truncated
|
||||
@@ -1,3 +1,3 @@
|
||||
/*! For license information please see swagger-ui-es-bundle.js.LICENSE.txt */
|
||||
module.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist",n(n.s=544)}([function(e,t,n){"use strict";e.exports=n(129)},function(e,t,n){e.exports=function(){"use strict";var e=Array.prototype.slice;function t(e,t){t&&(e.prototype=Object.create(t.prototype)),e.prototype.constructor=e}function n(e){return i(e)?e:J(e)}function r(e){return s(e)?e:K(e)}function o(e){return u(e)?e:Y(e)}function a(e){return i(e)&&!c(e)?e:G(e)}function i(e){return!(!e||!e[p])}function s(e){return!(!e||!e[f])}function u(e){return!(!e||!e[h])}function c(e){return s(e)||u(e)}function l(e){return!(!e||!e[d])}t(r,n),t(o,n),t(a,n),n.isIterable=i,n.isKeyed=s,n.isIndexed=u,n.isAssociative=c,n.isOrdered=l,n.Keyed=r,n.Indexed=o,n.Set=a;var p="@@__IMMUTABLE_ITERABLE__@@",f="@@__IMMUTABLE_KEYED__@@",h="@@__IMMUTABLE_INDEXED__@@",d="@@__IMMUTABLE_ORDERED__@@",m="delete",v=5,g=1<<v,y=g-1,b={},_={value:!1},w={value:!1};function x(e){return e.value=!1,e}function E(e){e&&(e.value=!0)}function S(){}function C(e,t){t=t||0;for(var n=Math.max(0,e.length-t),r=new Array(n),o=0;o<n;o++)r[o]=e[o+t];return r}function A(e){return void 0===e.size&&(e.size=e.__iterate(O)),e.size}function k(e,t){if("number"!=typeof t){var n=t>>>0;if(""+n!==t||4294967295===n)return NaN;t=n}return t<0?A(e)+t:t}function O(){return!0}function j(e,t,n){return(0===e||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function T(e,t){return N(e,t,0)}function I(e,t){return N(e,t,t)}function N(e,t,n){return void 0===e?n:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}var P=0,M=1,R=2,D="function"==typeof Symbol&&Symbol.iterator,L="@@iterator",B=D||L;function F(e){this.next=e}function U(e,t,n,r){var o=0===e?t:1===e?n:[t,n];return r?r.value=o:r={value:o,done:!1},r}function q(){return{value:void 0,done:!0}}function z(e){return!!H(e)}function V(e){return e&&"function"==typeof e.next}function W(e){var t=H(e);return t&&t.call(e)}function H(e){var t=e&&(D&&e[D]||e[L]);if("function"==typeof t)return t}function $(e){return e&&"number"==typeof e.length}function J(e){return null==e?ie():i(e)?e.toSeq():ce(e)}function K(e){return null==e?ie().toKeyedSeq():i(e)?s(e)?e.toSeq():e.fromEntrySeq():se(e)}function Y(e){return null==e?ie():i(e)?s(e)?e.entrySeq():e.toIndexedSeq():ue(e)}function G(e){return(null==e?ie():i(e)?s(e)?e.entrySeq():e:ue(e)).toSetSeq()}F.prototype.toString=function(){return"[Iterator]"},F.KEYS=P,F.VALUES=M,F.ENTRIES=R,F.prototype.inspect=F.prototype.toSource=function(){return this.toString()},F.prototype[B]=function(){return this},t(J,n),J.of=function(){return J(arguments)},J.prototype.toSeq=function(){return this},J.prototype.toString=function(){return this.__toString("Seq {","}")},J.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},J.prototype.__iterate=function(e,t){return pe(this,e,t,!0)},J.prototype.__iterator=function(e,t){return fe(this,e,t,!0)},t(K,J),K.prototype.toKeyedSeq=function(){return this},t(Y,J),Y.of=function(){return Y(arguments)},Y.prototype.toIndexedSeq=function(){return this},Y.prototype.toString=function(){return this.__toString("Seq [","]")},Y.prototype.__iterate=function(e,t){return pe(this,e,t,!1)},Y.prototype.__iterator=function(e,t){return fe(this,e,t,!1)},t(G,J),G.of=function(){return G(arguments)},G.prototype.toSetSeq=function(){return this},J.isSeq=ae,J.Keyed=K,J.Set=G,J.Indexed=Y;var Z,X,Q,ee="@@__IMMUTABLE_SEQ__@@";function te(e){this._array=e,this.size=e.length}function ne(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}function re(e){this._iterable=e,this.size=e.length||e.size}function oe(e){this._iterator=e,this._iteratorCache=[]}function ae(e){return!(!e||!e[ee])}function ie(){return Z||(Z=new te([]))}function se(e){var t=Array.isArray(e)?new te(e).fromEntrySeq():V(e)?new oe(e).fromEntrySeq():z(e)?new re(e).fromEntrySeq():"object"==typeof e?new ne(e):void 0;if(!t)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+e);return t}function ue(e){var t=le(e);if(!t)throw new TypeError("Expected Array or iterable object of values: "+e);return tLine truncated
|
||||
//# sourceMappingURL=swagger-ui-es-bundle.js.map
|
||||
(()=>{var i={17967:(i,s)=>{"use strict";s.Nm=s.Rq=void 0;var u=/^([^\w]*)(javascript|data|vbscript)/im,m=/&#(\w+)(^\w|;)?/g,v=/&(newline|tab);/gi,_=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,j=/^.+(:|:)/gim,M=[".","/"];s.Rq="about:blank",s.Nm=function sanitizeUrl(i){if(!i)return s.Rq;var $=function decodeHtmlCharacters(i){return i.replace(_,"").replace(m,(function(i,s){return String.fromCharCode(s)}))}(i).replace(v,"").replace(_,"").trim();if(!$)return s.Rq;if(function isRelativeUrlWithoutProtocol(i){return M.indexOf(i[0])>-1}($))return $;var W=$.match(j);if(!W)return $;var X=W[0];return u.test(X)?s.Rq:$}},79742:(i,s)=>{"use strict";s.byteLength=function byteLength(i){var s=getLens(i),u=s[0],m=s[1];return 3*(u+m)/4-m},s.toByteArray=function toByteArray(i){var s,u,_=getLens(i),j=_[0],M=_[1],$=new v(function _byteLength(i,s,u){return 3*(s+u)/4-u}(0,j,M)),W=0,X=M>0?j-4:j;for(u=0;u<X;u+=4)s=m[i.charCodeAt(u)]<<18|m[i.charCodeAt(u+1)]<<12|m[i.charCodeAt(u+2)]<<6|m[i.charCodeAt(u+3)],$[W++]=s>>16&255,$[W++]=s>>8&255,$[W++]=255&s;2===M&&(s=m[i.charCodeAt(u)]<<2|m[i.charCodeAt(u+1)]>>4,$[W++]=255&s);1===M&&(s=m[i.charCodeAt(u)]<<10|m[i.charCodeAt(u+1)]<<4|m[i.charCodeAt(u+2)]>>2,$[W++]=s>>8&255,$[W++]=255&s);return $},s.fromByteArray=function fromByteArray(i){for(var s,m=i.length,v=m%3,_=[],j=16383,M=0,$=m-v;M<$;M+=j)_.push(encodeChunk(i,M,M+j>$?$:M+j));1===v?(s=i[m-1],_.push(u[s>>2]+u[s<<4&63]+"==")):2===v&&(s=(i[m-2]<<8)+i[m-1],_.push(u[s>>10]+u[s>>4&63]+u[s<<2&63]+"="));return _.join("")};for(var u=[],m=[],v="undefined"!=typeof Uint8Array?Uint8Array:Array,_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",j=0;j<64;++j)u[j]=_[j],m[_.charCodeAt(j)]=j;function getLens(i){var s=i.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var u=i.indexOf("=");return-1===u&&(u=s),[u,u===s?0:4-u%4]}function encodeChunk(i,s,m){for(var v,_,j=[],M=s;M<m;M+=3)v=(i[M]<<16&16711680)+(i[M+1]<<8&65280)+(255&i[M+2]),j.push(u[(_=v)>>18&63]+u[_>>12&63]+u[_>>6&63]+u[63&_]);return j.join("")}m["-".charCodeAt(0)]=62,m["_".charCodeAt(0)]=63},48764:(i,s,u)=>{"use strict";const m=u(79742),v=u(80645),_="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;s.Buffer=Buffer,s.SlowBuffer=function SlowBuffer(i){+i!=i&&(i=0);return Buffer.alloc(+i)},s.INSPECT_MAX_BYTES=50;const j=2147483647;function createBuffer(i){if(i>j)throw new RangeError('The value "'+i+'" is invalid for option "size"');const s=new Uint8Array(i);return Object.setPrototypeOf(s,Buffer.prototype),s}function Buffer(i,s,u){if("number"==typeof i){if("string"==typeof s)throw new TypeError('The "string" argument must be of type string. Received type number');return allocUnsafe(i)}return from(i,s,u)}function from(i,s,u){if("string"==typeof i)return function fromString(i,s){"string"==typeof s&&""!==s||(s="utf8");if(!Buffer.isEncoding(s))throw new TypeError("Unknown encoding: "+s);const u=0|byteLength(i,s);let m=createBuffer(u);const v=m.write(i,s);v!==u&&(m=m.slice(0,v));return m}(i,s);if(ArrayBuffer.isView(i))return function fromArrayView(i){if(isInstance(i,Uint8Array)){const s=new Uint8Array(i);return fromArrayBuffer(s.buffer,s.byteOffset,s.byteLength)}return fromArrayLike(i)}(i);if(null==i)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i);if(isInstance(i,ArrayBuffer)||i&&isInstance(i.buffer,ArrayBuffer))return fromArrayBuffer(i,s,u);if("undefined"!=typeof SharedArrayBuffer&&(isInstance(i,SharedArrayBuffer)||i&&isInstance(i.buffer,SharedArrayBuffer)))return fromArrayBuffer(i,s,u);if("number"==typeof i)throw new TypeError('The "value" argument must not be of type number. Received type number');const m=i.valueOf&&i.valueOf();if(null!=m&&m!==i)return Buffer.from(m,s,u);const v=function fromObject(i){if(Buffer.isBuffer(i)){const s=0|checked(i.length),u=createBuffer(s);return 0===u.length||i.copy(u,0,0,s),u}if(void 0!==i.length)return"number"!=typeof i.length||numberIsNaN(i.length)?createBuffer(0):fromArrayLike(i);if("Buffer"===i.type&&Array.isArray(i.data))return fromArrayLike(i.data)}(i);if(v)return v;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof i[Symbol.toPrimitive])return Buffer.from(i[Symbol.toPrimitive]("string"),s,u);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i)}function assertSize(i){if("number"!=typeof i)throw new TypeError('"size" argument must be of type number');if(i<0)throw new RangeError('The value "'+i+'" is invalid for option "size"')}function allocUnsafe(i){return assertSize(i),createBuffer(i<0?0:0|checked(i))}function fromArrayLike(i){const s=i.length<0?0:0|checked(i.length),u=createBuffer(s);for(let m=0;m<s;m+=1)u[m]=255&i[m];return u}function fromArrayBuffer(i,s,u){if(s<0||i.byteLength<s)throw new RangeError('"offset" is outside of buffer bLine truncated
|
||||
//# sourceMappingURL=swagger-ui-es-bundle.js.map
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"sources":["webpack://SwaggerUIBundle/webpack/bootstrap","webpack://SwaggerUIBundle/./node_modules/react/react.js","webpack://SwaggerUIBundle/./node_modules/immutable/dist/immutable.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/concat.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/defineProperty.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/map.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/createClass.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/classCallCheck.js","webpack://SwaggerUIBundle/./src/core/utils.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/inherits.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/createSuper.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/assertThisInitialized.js","webpack://SwaggerUIBundle/./node_modules/prop-types/index.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/filter.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/index-of.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/array/is-array.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/slicedToArray.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/object/keys.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/toConsumableArray.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/for-each.js","webpack://SwaggerUIBundle/./node_modules/reselect/es/index.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/typeof.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/object/assign.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/reduce.js","webpack://SwaggerUIBundle/./node_modules/core-js-pure/internals/export.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/slice.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/objectSpread2.js","webpack://SwaggerUIBundle/./node_modules/fbjs/lib/invariant.js","webpack://SwaggerUIBundle/./src/core/window.js","webpack://SwaggerUIBundle/./node_modules/react-immutable-proptypes/dist/ImmutablePropTypes.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/extends.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/bind.js","webpack://SwaggerUIBundle/./node_modules/react-dom/lib/reactProdInvariant.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/json/stringify.js","webpack://SwaggerUIBundle/./node_modules/core-js-pure/internals/path.js","webpack://SwaggerUIBundle/./node_modules/fbjs/lib/warning.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/some.js","webpack://SwaggerUIBundle/./node_modules/core-js-pure/internals/fails.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/includes.js","webpack://SwaggerUIBundle/./src/core/plugins/oas3/helpers.jsx","webpack://SwaggerUIBundle/./node_modules/core-js-pure/internals/well-known-symbol.js","webpack://SwaggerUIBundle/./node_modules/object-assign/index.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/regenerator/index.js","webpack://SwaggerUIBundle/./node_modules/core-js-pure/internals/global.js","webpack://SwaggerUIBundle/./node_modules/core-js-pure/internals/entry-virtual.js","webpack://SwaggerUIBundle/./node_modules/react-dom/lib/ReactDOMComponentTree.js","webpack://SwaggerUIBundle/./node_modules/core-js-pure/internals/is-object.js","webpack://SwaggerUIBundle/./node_modules/lodash/get.js","webpack://SwaggerUIBundle/./src/core/plugins/spec/actions.js","webpack://SwaggerUIBundle/./node_modules/core-js-pure/internals/descriptors.js","webpack://SwaggerUIBundle/./node_modules/core-js-pure/internals/define-well-known-symbol.js","webpack://SwaggerUIBundle/./node_modules/js-yaml/lib/js-yaml/type.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/createForOfIteratorHelper.js","webpack://SwaggerUIBundle/./node_modules/core-js-pure/internals/has.js","webpack://SwaggerUIBundle/./node_modules/lodash/isArray.js","webpack://SwaggerUIBundle/(webpack)/buildin/global.js","webpack://SwaggerUIBundle/./node_modules/core-js-pure/internals/an-object.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/objectWithoutProperties.js","webpack://SwaggerUIBundle/./node_modules/fbjs/lib/ExecutionEnvironment.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/find.js","webpack://SwaggerUIBundle/.Line truncated
|
||||
{"version":3,"file":"swagger-ui-es-bundle.js","mappings":";wCAEAA,EAAQ,GAAcA,EAAQ,QAAY,EAC1C,IAAIC,EAAuB,wCACvBC,EAAoB,mBACpBC,EAAsB,oBACtBC,EAAsB,qDACtBC,EAAiB,oBACjBC,EAA0B,CAAC,IAAK,KACpCN,EAAQ,GAAY,cAmCpBA,EAAQ,GAxBR,SAASO,YAAYC,GACjB,IAAKA,EACD,OAAOR,EAAQ,GAEnB,IAAIS,EAVR,SAASC,qBAAqBC,GAE1B,OADsBA,EAAIC,QAAQ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AAI3D,QAClB4B,EAAMF,aAAa/B,GAEzB,OAAmB,IAAfiC,EAAI5B,QAIR2D,EAAIT,KAAKtB,EAAK,EAAG,EAAGjC,GAHXiC,CAKX,CAEA,QAAmBkC,IAAfH,EAAI3D,OACN,MAA0B,iBAAf2D,EAAI3D,QAAuB+D,YAAYJ,EAAI3D,QAC7C0B,aAAa,GAEf4B,cAAcK,GAGvB,GAAiB,WAAbA,EAAIK,MAAqBtD,MAAMuD,QAAQN,EAAIO,MAC7C,OAAOZ,cAAcK,EAAIO,KAE7B,CAzKYR,CAAWrB,GACrB,GAAIoB,EAAG,OAAOA,EAEd,GAAsB,oBAAXrC,QAAgD,MAAtBA,OAAO+C,aACH,mBAA9B9B,EAAMjB,OAAO+C,aACtB,OAAO9C,OAAOe,KAAKC,EAAMjB,OAAO+C,aAAa,UAAWlC,EAAkBjC,GAG5E,MAAM,IAAIkC,UACR,yHACiDG,EAELine truncated
|
||||
@@ -1,3 +1,3 @@
|
||||
/*! For license information please see swagger-ui-standalone-preset.js.LICENSE.txt */
|
||||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(function(){try{return require("esprima")}catch(t){}}()):"function"==typeof define&&define.amd?define(["esprima"],e):"object"==typeof exports?exports.SwaggerUIStandalonePreset=e(function(){try{return require("esprima")}catch(t){}}()):t.SwaggerUIStandalonePreset=e(t.esprima)}(this,(function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist",n(n.s=241)}([function(t,e,n){t.exports=function(){"use strict";var t=Array.prototype.slice;function e(t,e){e&&(t.prototype=Object.create(e.prototype)),t.prototype.constructor=t}function n(t){return u(t)?t:J(t)}function r(t){return s(t)?t:Z(t)}function i(t){return a(t)?t:V(t)}function o(t){return u(t)&&!c(t)?t:X(t)}function u(t){return!(!t||!t[l])}function s(t){return!(!t||!t[p])}function a(t){return!(!t||!t[h])}function c(t){return s(t)||a(t)}function f(t){return!(!t||!t[d])}e(r,n),e(i,n),e(o,n),n.isIterable=u,n.isKeyed=s,n.isIndexed=a,n.isAssociative=c,n.isOrdered=f,n.Keyed=r,n.Indexed=i,n.Set=o;var l="@@__IMMUTABLE_ITERABLE__@@",p="@@__IMMUTABLE_KEYED__@@",h="@@__IMMUTABLE_INDEXED__@@",d="@@__IMMUTABLE_ORDERED__@@",y="delete",v=5,g=1<<v,w=g-1,M={},m={value:!1},_={value:!1};function L(t){return t.value=!1,t}function x(t){t&&(t.value=!0)}function b(){}function j(t,e){e=e||0;for(var n=Math.max(0,t.length-e),r=new Array(n),i=0;i<n;i++)r[i]=t[i+e];return r}function N(t){return void 0===t.size&&(t.size=t.__iterate(D)),t.size}function S(t,e){if("number"!=typeof e){var n=e>>>0;if(""+n!==e||4294967295===n)return NaN;e=n}return e<0?N(t)+e:e}function D(){return!0}function I(t,e,n){return(0===t||void 0!==n&&t<=-n)&&(void 0===e||void 0!==n&&e>=n)}function A(t,e){return C(t,e,0)}function E(t,e){return C(t,e,e)}function C(t,e,n){return void 0===t?n:t<0?Math.max(0,e+t):void 0===e?t:Math.min(e,t)}var O=0,T=1,z=2,k="function"==typeof Symbol&&Symbol.iterator,U="@@iterator",Y=k||U;function P(t){this.next=t}function R(t,e,n,r){var i=0===t?e:1===t?n:[e,n];return r?r.value=i:r={value:i,done:!1},r}function Q(){return{value:void 0,done:!0}}function F(t){return!!W(t)}function B(t){return t&&"function"==typeof t.next}function G(t){var e=W(t);return e&&e.call(t)}function W(t){var e=t&&(k&&t[k]||t[U]);if("function"==typeof e)return e}function q(t){return t&&"number"==typeof t.length}function J(t){return null==t?ut():u(t)?t.toSeq():ct(t)}function Z(t){return null==t?ut().toKeyedSeq():u(t)?s(t)?t.toSeq():t.fromEntrySeq():st(t)}function V(t){return null==t?ut():u(t)?s(t)?t.entrySeq():t.toIndexedSeq():at(t)}function X(t){return(null==t?ut():u(t)?s(t)?t.entrySeq():t:at(t)).toSetSeq()}P.prototype.toString=function(){return"[Iterator]"},P.KEYS=O,P.VALUES=T,P.ENTRIES=z,P.prototype.inspect=P.prototype.toSource=function(){return this.toString()},P.prototype[Y]=function(){return this},e(J,n),J.of=function(){return J(arguments)},J.prototype.toSeq=function(){return this},J.prototype.toString=function(){return this.__toString("Seq {","}")},J.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},J.prototype.__iterate=function(t,e){return lt(this,t,e,!0)},J.prototype.__iterator=function(t,e){return pt(this,t,e,!0)},e(Z,J),Z.prototype.toKeyedSeq=function(){return this},e(V,J),V.of=function(){return V(arguments)},V.prototype.toIndexedSeq=function(){return this},V.prototype.toString=function(){return this.__toString("Seq [","]")},V.prototype.__iterate=function(t,e){return lt(this,t,e,!1)},V.prototype.__iterator=function(t,e){return pt(this,t,e,!1)},e(X,J),X.of=function(){return X(arguments)},X.prototype.toSetSeq=function(){return this},J.isSeq=ot,J.Keyed=Z,J.Set=X,J.Indexed=V;var H,K,$,tt="@@__IMMUTABLE_SEQ__@@";function et(t){this._array=t,this.size=t.length}function nt(t){var e=Object.keys(t);this._object=t,this._keys=e,this.size=e.length}function rt(t){this._iterable=t,this.size=t.length||t.size}function it(t){this._iterator=t,this._iteratorCache=[]}function ot(t){return!(!t||!t[tt])}function ut(){return H||(H=new et([]))}function st(t){var e=Array.isArray(t)?new et(t).fromEntrySeq()Line truncated
|
||||
//# sourceMappingURL=swagger-ui-standalone-preset.js.map
|
||||
!function webpackUniversalModuleDefinition(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.SwaggerUIStandalonePreset=t():e.SwaggerUIStandalonePreset=t()}(this,(()=>(()=>{var e={7967:(e,t)=>{"use strict";t.Rq=void 0;var r=/^([^\w]*)(javascript|data|vbscript)/im,n=/&#(\w+)(^\w|;)?/g,i=/&(newline|tab);/gi,o=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,a=/^.+(:|:)/gim,s=[".","/"];t.Rq="about:blank"},9742:(e,t)=>{"use strict";t.byteLength=function byteLength(e){var t=getLens(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function toByteArray(e){var t,r,o=getLens(e),a=o[0],s=o[1],u=new i(function _byteLength(e,t,r){return 3*(t+r)/4-r}(0,a,s)),c=0,f=s>0?a-4:a;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],u[c++]=t>>16&255,u[c++]=t>>8&255,u[c++]=255&t;2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[c++]=255&t);1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t);return u},t.fromByteArray=function fromByteArray(e){for(var t,n=e.length,i=n%3,o=[],a=16383,s=0,u=n-i;s<u;s+=a)o.push(encodeChunk(e,s,s+a>u?u:s+a));1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=o[a],n[o.charCodeAt(a)]=a;function getLens(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function encodeChunk(e,t,n){for(var i,o,a=[],s=t;s<n;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},8764:(e,t,r)=>{"use strict";const n=r(9742),i=r(645),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=Buffer,t.SlowBuffer=function SlowBuffer(e){+e!=e&&(e=0);return Buffer.alloc(+e)},t.INSPECT_MAX_BYTES=50;const a=2147483647;function createBuffer(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,Buffer.prototype),t}function Buffer(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return allocUnsafe(e)}return from(e,t,r)}function from(e,t,r){if("string"==typeof e)return function fromString(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!Buffer.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|byteLength(e,t);let n=createBuffer(r);const i=n.write(e,t);i!==r&&(n=n.slice(0,i));return n}(e,t);if(ArrayBuffer.isView(e))return function fromArrayView(e){if(isInstance(e,Uint8Array)){const t=new Uint8Array(e);return fromArrayBuffer(t.buffer,t.byteOffset,t.byteLength)}return fromArrayLike(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(isInstance(e,ArrayBuffer)||e&&isInstance(e.buffer,ArrayBuffer))return fromArrayBuffer(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(isInstance(e,SharedArrayBuffer)||e&&isInstance(e.buffer,SharedArrayBuffer)))return fromArrayBuffer(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return Buffer.from(n,t,r);const i=function fromObject(e){if(Buffer.isBuffer(e)){const t=0|checked(e.length),r=createBuffer(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||numberIsNaN(e.length)?createBuffer(0):fromArrayLike(e);if("Buffer"===e.type&&Array.isArray(e.data))return fromArrayLike(e.data)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return Buffer.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function assertSize(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function allocUnsafe(e){return assertSize(e),createBuffer(e<0?0:0|checked(e))}function fromArrayLike(e){const t=e.length<0?0:0|checked(e.length),r=createBuffer(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function fromArrayBuffer(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=voiLine truncated
|
||||
//# sourceMappingURL=swagger-ui-standalone-preset.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"sources":["webpack://SwaggerUIStandalonePreset/webpack/universalModuleDefinition","webpack://SwaggerUIStandalonePreset/webpack/bootstrap","webpack://SwaggerUIStandalonePreset/./node_modules/immutable/dist/immutable.js","webpack://SwaggerUIStandalonePreset/./node_modules/core-js-pure/internals/export.js","webpack://SwaggerUIStandalonePreset/./node_modules/react/react.js","webpack://SwaggerUIStandalonePreset/./node_modules/core-js-pure/internals/define-well-known-symbol.js","webpack://SwaggerUIStandalonePreset/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/concat.js","webpack://SwaggerUIStandalonePreset/./node_modules/core-js-pure/internals/fails.js","webpack://SwaggerUIStandalonePreset/./node_modules/core-js-pure/internals/well-known-symbol.js","webpack://SwaggerUIStandalonePreset/./node_modules/js-yaml/lib/js-yaml/type.js","webpack://SwaggerUIStandalonePreset/./node_modules/@babel/runtime-corejs3/core-js-stable/array/is-array.js","webpack://SwaggerUIStandalonePreset/./node_modules/core-js-pure/internals/entry-virtual.js","webpack://SwaggerUIStandalonePreset/./node_modules/core-js-pure/internals/path.js","webpack://SwaggerUIStandalonePreset/./node_modules/@babel/runtime-corejs3/helpers/typeof.js","webpack://SwaggerUIStandalonePreset/./node_modules/@babel/runtime-corejs3/helpers/defineProperty.js","webpack://SwaggerUIStandalonePreset/./node_modules/core-js-pure/internals/global.js","webpack://SwaggerUIStandalonePreset/./node_modules/core-js-pure/internals/is-object.js","webpack://SwaggerUIStandalonePreset/./node_modules/inherits/inherits_browser.js","webpack://SwaggerUIStandalonePreset/./node_modules/safe-buffer/index.js","webpack://SwaggerUIStandalonePreset/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/map.js","webpack://SwaggerUIStandalonePreset/./node_modules/core-js-pure/internals/has.js","webpack://SwaggerUIStandalonePreset/./src/core/utils.js","webpack://SwaggerUIStandalonePreset/(webpack)/buildin/global.js","webpack://SwaggerUIStandalonePreset/./node_modules/core-js-pure/internals/descriptors.js","webpack://SwaggerUIStandalonePreset/./node_modules/core-js-pure/internals/to-object.js","webpack://SwaggerUIStandalonePreset/./node_modules/lodash/isArray.js","webpack://SwaggerUIStandalonePreset/./node_modules/core-js-pure/internals/create-non-enumerable-property.js","webpack://SwaggerUIStandalonePreset/./node_modules/core-js-pure/internals/array-method-uses-to-length.js","webpack://SwaggerUIStandalonePreset/./node_modules/lodash/_root.js","webpack://SwaggerUIStandalonePreset/./node_modules/@babel/runtime-corejs3/helpers/assertThisInitialized.js","webpack://SwaggerUIStandalonePreset/./node_modules/@babel/runtime-corejs3/core-js-stable/object/keys.js","webpack://SwaggerUIStandalonePreset/./node_modules/core-js-pure/internals/an-object.js","webpack://SwaggerUIStandalonePreset/./node_modules/es5-ext/object/valid-callable.js","webpack://SwaggerUIStandalonePreset/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/for-each.js","webpack://SwaggerUIStandalonePreset/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/filter.js","webpack://SwaggerUIStandalonePreset/./node_modules/core-js-pure/internals/to-indexed-object.js","webpack://SwaggerUIStandalonePreset/./node_modules/core-js-pure/internals/object-define-property.js","webpack://SwaggerUIStandalonePreset/./node_modules/core-js-pure/internals/to-length.js","webpack://SwaggerUIStandalonePreset/./node_modules/core-js-pure/internals/iterators.js","webpack://SwaggerUIStandalonePreset/./node_modules/process/browser.js","webpack://SwaggerUIStandalonePreset/./node_modules/readable-stream/lib/_stream_duplex.js","webpack://SwaggerUIStandalonePreset/./node_modules/es5-ext/object/is-value.js","webpack://SwaggerUIStandalonePreset/./node_modules/es5-ext/number/to-pos-integer.js","webpack://SwaggerUIStandalonePreset/./node_modules/core-js-pure/internals/require-object-coercible.js","webpack://SwaggerUIStandalonePreset/./node_modules/core-js-pure/internals/classof.js","webpack://SwaggerUIStandalonePreset/./node_modules/core-js-pure/modules/web.dom-collections.iterator.js","webpack://SwaggerUIStandalonePreset/./node_modules/core-js-pure/internals/array-iteration.js","webpack://SwaggerUIStandalonePreset/./node_modules/react/lib/ReactElement.js","webpack://SwaggerUIStandalonePreset/./node_modules/lodash/_getNative.js","webpack://SwaggerUIStandalonePreset/./node_modules/es5-ext/object/valid-value.js","webpack://SwaggerUIStandalonePreset/./node_modules/sha.js/hash.js","webpack://SwaggerUIStandalonePreset/./node_modules/js-yaml/lib/js-yaml/common.js","webpack://SwaggerUIStandalonePreset/./node_modules/js-yaml/lib/js-yaml/schema.js","webpack://SwaggerUIStandalonePreset/./node_modules/lodash/eq.js","webpack://SwaggerUIStandalonePreset/./node_modules/lodash/isEmpty.js","webpack://SwaggerUIStandalonePreset/./node_modules/core-js-pure/internals/create-property-descriptor.js","webpack://SwaggerUIStandalonePreset/./node_moduLine truncated
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"sources":["webpack:///./src/style/main.scss","webpack:///./node_modules/tachyons-sass/scss/_normalize.scss","webpack:///./src/style/_type.scss","webpack:///./node_modules/tachyons-sass/scss/_debug-children.scss","webpack:///./node_modules/tachyons-sass/scss/_debug-grid.scss","webpack:///./node_modules/tachyons-sass/scss/_box-sizing.scss","webpack:///./node_modules/tachyons-sass/scss/_aspect-ratios.scss","webpack:///./node_modules/tachyons-sass/scss/_images.scss","webpack:///./node_modules/tachyons-sass/scss/_background-size.scss","webpack:///./node_modules/tachyons-sass/scss/_background-position.scss","webpack:///./node_modules/tachyons-sass/scss/_outlines.scss","webpack:///./node_modules/tachyons-sass/scss/_borders.scss","webpack:///./node_modules/tachyons-sass/scss/_border-colors.scss","webpack:///./node_modules/tachyons-sass/scss/_border-radius.scss","webpack:///./node_modules/tachyons-sass/scss/_border-style.scss","webpack:///./node_modules/tachyons-sass/scss/_border-widths.scss","webpack:///./node_modules/tachyons-sass/scss/_box-shadow.scss","webpack:///./node_modules/tachyons-sass/scss/_code.scss","webpack:///./node_modules/tachyons-sass/scss/_coordinates.scss","webpack:///./node_modules/tachyons-sass/scss/_clears.scss","webpack:///./node_modules/tachyons-sass/scss/_flexbox.scss","webpack:///./node_modules/tachyons-sass/scss/_display.scss","webpack:///./node_modules/tachyons-sass/scss/_floats.scss","webpack:///./node_modules/tachyons-sass/scss/_font-family.scss","webpack:///./node_modules/tachyons-sass/scss/_font-style.scss","webpack:///./node_modules/tachyons-sass/scss/_font-weight.scss","webpack:///./node_modules/tachyons-sass/scss/_forms.scss","webpack:///./node_modules/tachyons-sass/scss/_heights.scss","webpack:///./node_modules/tachyons-sass/scss/_letter-spacing.scss","webpack:///./node_modules/tachyons-sass/scss/_line-height.scss","webpack:///./node_modules/tachyons-sass/scss/_links.scss","webpack:///./node_modules/tachyons-sass/scss/_lists.scss","webpack:///./node_modules/tachyons-sass/scss/_max-widths.scss","webpack:///./node_modules/tachyons-sass/scss/_widths.scss","webpack:///./node_modules/tachyons-sass/scss/_overflow.scss","webpack:///./node_modules/tachyons-sass/scss/_position.scss","webpack:///./node_modules/tachyons-sass/scss/_opacity.scss","webpack:///./node_modules/tachyons-sass/scss/_rotations.scss","webpack:///./node_modules/tachyons-sass/scss/_skins.scss","webpack:///./node_modules/tachyons-sass/scss/_skins-pseudo.scss","webpack:///./node_modules/tachyons-sass/scss/_spacing.scss","webpack:///./node_modules/tachyons-sass/scss/_variables.scss","webpack:///./node_modules/tachyons-sass/scss/_negative-margins.scss","webpack:///./node_modules/tachyons-sass/scss/_tables.scss","webpack:///./node_modules/tachyons-sass/scss/_text-decoration.scss","webpack:///./node_modules/tachyons-sass/scss/_text-align.scss","webpack:///./node_modules/tachyons-sass/scss/_text-transform.scss","webpack:///./node_modules/tachyons-sass/scss/_type-scale.scss","webpack:///./node_modules/tachyons-sass/scss/_typography.scss","webpack:///./node_modules/tachyons-sass/scss/_utilities.scss","webpack:///./node_modules/tachyons-sass/scss/_visibility.scss","webpack:///./node_modules/tachyons-sass/scss/_white-space.scss","webpack:///./node_modules/tachyons-sass/scss/_vertical-align.scss","webpack:///./node_modules/tachyons-sass/scss/_hovers.scss","webpack:///./node_modules/tachyons-sass/scss/_z-index.scss","webpack:///./node_modules/tachyons-sass/scss/_nested.scss","webpack:///./src/style/_layout.scss","webpack:///./src/style/_variables.scss","webpack:///./src/style/_buttons.scss","webpack:///./src/style/_mixins.scss","webpack:///./src/style/_form.scss","webpack:///./src/style/_modal.scss","webpack:///./src/style/_models.scss","webpack:///./src/style/_servers.scss","webpack:///./src/style/_table.scss","webpack:///./src/style/_topbar.scss","webpack:///./src/style/_information.scss","webpack:///./src/style/_authorize.scss","webpack:///./src/style/_errors.scss","webpack:///./src/style/_split-pane-mode.scss","webpack:///./src/style/_markdown.scss"],"names":[],"mappings":"AAAA;ECOA,4ECLI,sBAAuB,CAEvB,aFmhCJ,CAvhCA,iBCmBE,gBAAiB,CACjB,yBAA0B,CAC1B,6BD2gCF,CAhiCA,iBCgCE,QDogCF,CApiCA,gHC6CE,aDggCF,CA7iCA,eCsDE,aAAc,CACd,cD2/BF,CAljCA,2DCqEE,aDo/BF,CAzjCA,mBC6EE,eDg/BF,CA7jCA,eCsFE,sBAAuB,CACvB,QAAS,CACT,gBD8+BF,CAtkCA,gBCiGE,+BAAiC,CACjC,aD2+BF,CA7kCA,cC8GE,4BAA6B,CAC7B,oCDq+BF,CAplCA,wBCwHE,kBAAmB,CACnB,yBAA0B,CAC1B,wCAAiC,CAAjC,gCDm+BF,CA7lCA,iCCmIE,mBAAoB,CASpB,kBDs9BF,CAlmCA,kDCuJE,+BAAiC,CACjC,aDw9BF,CAhnCA,gBCgKE,iBDo9BF,CApnCA,iBCwKE,qBAAsB,CACtB,UDg9BF,CAznCA,kBCiLE,aD48BF,CA7nCA,gCC2LE,aAAc,CACd,aAAc,CACd,iBAAkB,CAClB,uBDu8BF,CAroCA,gBCkME,aDu8BF,CAzoCA,gBCsME,SDu8BF,CA7oCA,oCCkNE,oBDg8BF,CAlpCA,kCC0NE,YAAa,CACb,QD47BF,CAvpCA,gBCmOE,iBDw7BF,CA3pCA,2BC2OE,eDo7BF,CA/pCA,kGC2PE,sBAAuB,CACvB,cAAe,CACf,gBAAiB,CACjB,QDg7BF,CA9qCA,qCCwQE,gBD46BF,CAprCA,sCCkRE,mBDw6BF,CA1rCA,qGC+RE,yBDm6BF,CAlsCA,wKC0SE,iBAAkB,CACLine truncated
|
||||
{"version":3,"file":"swagger-ui.css","mappings":"AAAA,YCII,aCYU,CDdV,sBEKJ,4EDSc,CCEd,iBAEE,0BACA,8BAFA,gBAEA,CAUF,iBACE,SAOF,gHAME,cAQF,eACE,cACA,eAWF,2DAGE,cAOF,mBACE,gBAQF,eACE,uBACA,SACA,iBAQF,gBACE,gCACA,cAWF,cAEE,qCADA,4BACA,CAQF,wBACE,mBAEA,oGAOF,iCAEE,oBASA,kBATA,CAiBF,kDAGE,gCACA,cAOF,gBACE,kBAOF,iBACE,sBACA,WAOF,kBACE,cAQF,gCAEE,cACA,cACA,kBACA,wBAGF,gBACE,cAGF,gBACE,UAUF,oCAEE,qBAOF,kCACE,aACA,SAOF,gBACE,kBAOF,2BACE,gBAWF,kGAKE,uBACA,eACA,iBACA,SAQF,qCAEE,iBAQF,sCAEE,oBASF,qGAIE,0BAOF,wKAIE,kBACA,UAOF,4JAIE,8BAOF,qBACE,2BAUF,mBACE,sBACA,cACA,cACA,eACA,UACA,mBAQF,qBACE,qBACA,wBAOF,qBACE,cAQF,qDAEE,sBACA,UAOF,0GAEE,YAQF,0BACE,6BACA,oBAOF,6GAEE,wBAQF,yCACE,0BACA,aAWF,qCAEE,cAOF,oBACE,kBAUF,mBACE,qBAkBF,0CACE,aCnbF,4CACA,kDACA,kDCDA,wBACE,0EAGF,2BACE,0EAGF,gCACE,mEAGF,iCACE,mEClBF,0tBAkCE,sBCrBF,0BACE,SACA,kBAGF,sDACA,uDAEA,kDACA,sDAEA,oDACA,mDAEA,oDACA,mDAEA,qDACA,mDAEA,mDAEA,kCAII,SAGA,YAFA,OAJA,kBAEA,QADA,MAIA,WAEA,YAGJ,mCACI,6BACE,SACA,kBAEF,yDACA,0DACA,qDACA,yDACA,uDACA,sDACA,uDACA,sDACA,wDACA,sDACA,sDACA,qCAII,SAGA,YAFA,OAJA,kBAEA,QADA,MAIA,WAEA,aAIR,uDACI,4BACE,SACA,kBAEF,wDACA,yDACA,oDACA,wDACA,sDACA,qDACA,sDACA,q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,2DJ8Ce,CI7Cf,2DJ8Ce,CI7Cf,+DJ8Ce,CI7Cf,6DJ8Ce,CI7Cf,6DJ8Ce,CI5Cf,mCACE,8DJuCa,CItCb,8DJuCa,CItCb,kEJuCa,CItCb,gEJuCa,CItCb,gEJuCa,EIpCf,uDACE,6DJ+Ba,CI9Bb,6DJ+Ba,CI9Bb,iEJ+Ba,CI9Bb,+DJ+Ba,CI9Bb,+DJ+Ba,EI5Bf,mCACE,6DJuBa,CItBb,6DJuBa,CItBb,iEJuBa,CItBb,+DJuBa,CItBb,+DJuBa,EKxDf,iBACE,gBACA,kBACA,gBCkBF,yBACA,6BACA,+BACA,2BAEA,4BACA,gCACA,kCACA,8BAEA,4BACA,gCACA,kCACA,8BAEA,8BACA,kCACA,oCACA,gCAEA,8BACA,kCACA,oCACA,gCAGA,4BAGE,SACA,OAFA,QADA,KAGA,CAGF,mCACE,4BACA,8BACA,gCACA,kCACA,+BACA,iCACA,mCACA,qCACA,+BACA,iCACA,mCACA,qCACA,iCACA,qCACA,uCACA,mCACA,iCACA,qCACA,uCACA,mCACA,+BAGE,SACA,OAFA,QADA,KAGA,EAIJ,uDACE,2BACA,6BACA,+BACA,iLine truncated
|
||||
@@ -1,3 +1,2 @@
|
||||
/*! For license information please see swagger-ui.js.LICENSE.txt */
|
||||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.SwaggerUICore=t():e.SwaggerUICore=t()}(this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist",n(n.s=410)}([function(e,t){e.exports=require("react")},function(e,t){e.exports=require("immutable")},function(e,t,n){e.exports=n(449)},function(e,t,n){var r=n(191);e.exports=function(e,t,n){return t in e?r(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){e.exports=n(452)},function(e,t,n){var r=n(191);function a(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),r(e,a.key,a)}}e.exports=function(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),e}},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){"use strict";(function(e){n.d(t,"t",(function(){return me})),n.d(t,"A",(function(){return ve})),n.d(t,"i",(function(){return ge})),n.d(t,"w",(function(){return ye})),n.d(t,"r",(function(){return be})),n.d(t,"u",(function(){return Ee})),n.d(t,"s",(function(){return xe})),n.d(t,"p",(function(){return Se})),n.d(t,"v",(function(){return we})),n.d(t,"y",(function(){return je})),n.d(t,"z",(function(){return Ce})),n.d(t,"K",(function(){return Oe})),n.d(t,"f",(function(){return _e})),n.d(t,"n",(function(){return Ae})),n.d(t,"h",(function(){return ke})),n.d(t,"E",(function(){return Ie})),n.d(t,"L",(function(){return Fe})),n.d(t,"o",(function(){return Ye})),n.d(t,"D",(function(){return Ke})),n.d(t,"a",(function(){return Ge})),n.d(t,"I",(function(){return Ze})),n.d(t,"b",(function(){return Xe})),n.d(t,"H",(function(){return Qe})),n.d(t,"G",(function(){return et})),n.d(t,"F",(function(){return tt})),n.d(t,"k",(function(){return nt})),n.d(t,"d",(function(){return rt})),n.d(t,"g",(function(){return at})),n.d(t,"m",(function(){return ot})),n.d(t,"l",(function(){return it})),n.d(t,"e",(function(){return ct})),n.d(t,"J",(function(){return st})),n.d(t,"x",(function(){return ut})),n.d(t,"B",(function(){return lt})),n.d(t,"C",(function(){return pt})),n.d(t,"j",(function(){return ft})),n.d(t,"c",(function(){return dt})),n.d(t,"q",(function(){return mt}));var r=n(82),a=n.n(r),o=n(130),i=n.n(o),c=n(50),s=n.n(c),u=n(13),l=n.n(u),p=n(30),f=n.n(p),d=n(17),h=n.n(d),m=(n(34),n(32)),v=n.n(m),g=(n(24),n(15),n(157)),y=n.n(g),b=n(21),E=n.n(b),x=n(22),S=n.n(x),w=(n(29),n(16)),j=n.n(w),C=n(12),O=n.n(C),_=n(18),A=n.n(_),k=n(2),I=n.n(k),P=n(45),T=n.n(P),N=n(71),R=n.n(N),M=n(4),D=n.n(M),q=n(14),L=n.n(q),B=n(20),U=n.n(B),V=n(1),z=n.n(V),F=n(375),J=n(376),W=n.n(J),H=n(207),$=n.n(H),Y=n(208),K=n.n(Y),G=n(158),Z=n.n(G),X=n(266),Q=n.n(X),ee=n(102),te=n.n(ee),ne=n(58),re=n.n(ne),ae=n(112),oe=n(26),ie=n(378),ce=n.n(ie),se=n(114),ue=n(379),le=n.n(ue),pe=n(380),fe=n.n(pe),de="default",he=function(e){return z.a.Iterable.isIterable(e)};function me(e){try{var t=JSON.parse(e);if(t&&"object"===U()(t))return t}catch(e){}return!1}function ve(e){return Ee(e)?he(e)?e.toJS():e:{}}function ge(e){var t,n;if(he(e))return e;if(e instanceof oe.a.File)return e;if(!Ee(e))return e;if(L()(e))return D()(n=z.a.Seq(e)).call(n,ge).toList();if(re()(R()(e))){var r,a=function(e){if(!re()(R()(e)))return e;var t,n={},r="_**[]",a={},o=T()(R()(e).call(e));try{for(o.s();!(t=o.n()).done;){var i=t.value;if(n[i[0]]||a[i[0]]&&a[i[0]].containsMultiple){var c,s,u,l;if(!a[i[0]])a[i[0]]={containsMultiple:!0,length:1},n[I()(u=I()(l="".concat(i[0])).call(l,r)).call(u,a[i[0]].length)]=n[i[0]],delete n[i[0]];a[i[0]].length+=1,n[I()(c=I()(s="".concat(i[0])).call(s,r)).call(c,a[i[0]].length)]=i[1]}else n[i[0]]=i[1]}}catch(e){o.e(e)}finally{o.f()}return n}(e);return D()(r=z.a.OrderedMap(a)).call(r,ge)}return D()(t=z.a.OrderedMap(e)).call(t,ge)}function ye(e){return L()(e)?e:[e]}function be(e){return"function"==typeof e}function Ee(e){return!!e&&"object"===U()(e)}function xe(e){return"function"==typeof e}function Se(e){return L()(e)}var we=K.a;function je(e,t){var n;return S()(n=j()(e)).call(n,(function(n,Line truncated
|
||||
//# sourceMappingURL=swagger-ui.js.map
|
||||
!function webpackUniversalModuleDefinition(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.SwaggerUICore=t():e.SwaggerUICore=t()}(this,(()=>(()=>{"use strict";var e={871:e=>{e.exports=require("buffer")}},t={};function __webpack_require__(r){var n=t[r];if(void 0!==n)return n.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,__webpack_require__),a.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{__webpack_require__.d(r,{default:()=>Do});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{CLEAR:()=>D,CLEAR_BY:()=>L,NEW_AUTH_ERR:()=>K,NEW_SPEC_ERR:()=>$,NEW_SPEC_ERR_BATCH:()=>V,NEW_THROWN_ERR:()=>T,NEW_THROWN_ERR_BATCH:()=>J,clear:()=>clear,clearBy:()=>clearBy,newAuthErr:()=>newAuthErr,newSpecErr:()=>newSpecErr,newSpecErrBatch:()=>newSpecErrBatch,newThrownErr:()=>newThrownErr,newThrownErrBatch:()=>newThrownErrBatch});var t={};__webpack_require__.r(t),__webpack_require__.d(t,{AUTHORIZE:()=>ge,AUTHORIZE_OAUTH2:()=>Se,CONFIGURE_AUTH:()=>ve,LOGOUT:()=>ye,PRE_AUTHORIZE_OAUTH2:()=>fe,RESTORE_AUTHORIZATION:()=>_e,SHOW_AUTH_POPUP:()=>he,VALIDATE:()=>Ee,authPopup:()=>authPopup,authorize:()=>authorize,authorizeAccessCodeWithBasicAuthentication:()=>authorizeAccessCodeWithBasicAuthentication,authorizeAccessCodeWithFormParams:()=>authorizeAccessCodeWithFormParams,authorizeApplication:()=>authorizeApplication,authorizeOauth2:()=>authorizeOauth2,authorizeOauth2WithPersistOption:()=>authorizeOauth2WithPersistOption,authorizePassword:()=>authorizePassword,authorizeRequest:()=>authorizeRequest,authorizeWithPersistOption:()=>authorizeWithPersistOption,configureAuth:()=>configureAuth,logout:()=>logout,logoutWithPersistOption:()=>logoutWithPersistOption,persistAuthorizationIfNeeded:()=>persistAuthorizationIfNeeded,preAuthorizeImplicit:()=>preAuthorizeImplicit,restoreAuthorization:()=>restoreAuthorization,showDefinitions:()=>showDefinitions});var n={};__webpack_require__.r(n),__webpack_require__.d(n,{authorized:()=>Oe,definitionsForRequirements:()=>definitionsForRequirements,definitionsToAuthorize:()=>xe,getConfigs:()=>Ne,getDefinitionsByNames:()=>getDefinitionsByNames,isAuthorized:()=>isAuthorized,shownDefinitions:()=>Ce});var a={};__webpack_require__.r(a),__webpack_require__.d(a,{TOGGLE_CONFIGS:()=>Je,UPDATE_CONFIGS:()=>Te,loaded:()=>actions_loaded,toggle:()=>toggle,update:()=>update});var s={};__webpack_require__.r(s),__webpack_require__.d(s,{downloadConfig:()=>downloadConfig,getConfigByUrl:()=>getConfigByUrl});var o={};__webpack_require__.r(o),__webpack_require__.d(o,{get:()=>get});var l={};__webpack_require__.r(l),__webpack_require__.d(l,{transform:()=>transform});var c={};__webpack_require__.r(c),__webpack_require__.d(c,{transform:()=>parameter_oneof_transform});var i={};__webpack_require__.r(i),__webpack_require__.d(i,{allErrors:()=>Ze,lastError:()=>et});var p={};__webpack_require__.r(p),__webpack_require__.d(p,{SHOW:()=>dt,UPDATE_FILTER:()=>mt,UPDATE_LAYOUT:()=>pt,UPDATE_MODE:()=>ut,changeMode:()=>changeMode,show:()=>actions_show,updateFilter:()=>updateFilter,updateLayout:()=>updateLayout});var m={};__webpack_require__.r(m),__webpack_require__.d(m,{current:()=>current,currentFilter:()=>currentFilter,isShown:()=>isShown,showSummary:()=>gt,whatMode:()=>whatMode});var u={};__webpack_require__.r(u),__webpack_require__.d(u,{taggedOperations:()=>taggedOperations});var d={};__webpack_require__.r(d),__webpack_require__.d(d,{requestSnippetGenerator_curl_bash:()=>requestSnippetGenerator_curl_bash,requestSnippetGenerator_curl_cmd:()=>requestSnippetGenerator_curl_cmd,requestSnippetGenerator_curl_powershell:()=>requestSnippetGenerator_curl_powershell});var h={};__webpack_require__.r(h),__webpack_require__.d(h,{getActiveLanguage:()=>St,getDefaultExpanded:()=>Et,getGenerators:()=>ft,getSnippetGenerators:()=>getSnippetGenerators});var g={};__webpack_require__.r(g),__webpack_require__.d(g,{allowTryItOutFor:()=>allowTryItOutFor,basePath:()=>$r,canExecuteScheme:()=>canExecuteScheme,consumes:()=>Pr,consumesOptionsFor:()=>consumesOptionsFor,contentTypeValues:()=>contentTypeValues,currentProducesFor:()=>currentProducesFor,definitions:()=>Jr,externalDocs:()=>Nr,findDefinition:()=>findDefinition,getOAS3RequiredRequestBodyContentType:()=>getOAS3RequiredRequestBodyContentType,getParameter:()=>getParameter,hasHost:()=>Wr,host:()=>Vr,info:()=>Or,isMediaTypeSchemaPropertiesEqual:()=>isMediaTypeSchemaPropertiesEqual,isOAS3:()=>xr,lastError:()Line truncated
|
||||
//# sourceMappingURL=swagger-ui.js.map
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"sources":["webpack://SwaggerUICore/webpack/universalModuleDefinition","webpack://SwaggerUICore/webpack/bootstrap","webpack://SwaggerUICore/external \"react\"","webpack://SwaggerUICore/external \"immutable\"","webpack://SwaggerUICore/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/concat.js","webpack://SwaggerUICore/./node_modules/@babel/runtime-corejs3/helpers/defineProperty.js","webpack://SwaggerUICore/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/map.js","webpack://SwaggerUICore/./node_modules/@babel/runtime-corejs3/helpers/createClass.js","webpack://SwaggerUICore/./node_modules/@babel/runtime-corejs3/helpers/classCallCheck.js","webpack://SwaggerUICore/./src/core/utils.js","webpack://SwaggerUICore/./node_modules/@babel/runtime-corejs3/helpers/inherits.js","webpack://SwaggerUICore/./node_modules/@babel/runtime-corejs3/helpers/createSuper.js","webpack://SwaggerUICore/./node_modules/@babel/runtime-corejs3/helpers/assertThisInitialized.js","webpack://SwaggerUICore/external \"prop-types\"","webpack://SwaggerUICore/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/filter.js","webpack://SwaggerUICore/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/index-of.js","webpack://SwaggerUICore/./node_modules/@babel/runtime-corejs3/core-js-stable/array/is-array.js","webpack://SwaggerUICore/./node_modules/@babel/runtime-corejs3/helpers/slicedToArray.js","webpack://SwaggerUICore/./node_modules/@babel/runtime-corejs3/core-js-stable/object/keys.js","webpack://SwaggerUICore/./node_modules/@babel/runtime-corejs3/helpers/toConsumableArray.js","webpack://SwaggerUICore/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/for-each.js","webpack://SwaggerUICore/external \"reselect\"","webpack://SwaggerUICore/./node_modules/@babel/runtime-corejs3/helpers/typeof.js","webpack://SwaggerUICore/./node_modules/@babel/runtime-corejs3/core-js-stable/object/assign.js","webpack://SwaggerUICore/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/reduce.js","webpack://SwaggerUICore/./node_modules/core-js-pure/internals/export.js","webpack://SwaggerUICore/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/slice.js","webpack://SwaggerUICore/./node_modules/@babel/runtime-corejs3/helpers/objectSpread2.js","webpack://SwaggerUICore/./src/core/window.js","webpack://SwaggerUICore/external \"react-immutable-proptypes\"","webpack://SwaggerUICore/./node_modules/@babel/runtime-corejs3/helpers/extends.js","webpack://SwaggerUICore/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/bind.js","webpack://SwaggerUICore/./node_modules/@babel/runtime-corejs3/core-js-stable/json/stringify.js","webpack://SwaggerUICore/./node_modules/core-js-pure/internals/path.js","webpack://SwaggerUICore/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/some.js","webpack://SwaggerUICore/./node_modules/core-js-pure/internals/fails.js","webpack://SwaggerUICore/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/includes.js","webpack://SwaggerUICore/./src/core/plugins/oas3/helpers.jsx","webpack://SwaggerUICore/./node_modules/core-js-pure/internals/well-known-symbol.js","webpack://SwaggerUICore/./node_modules/@babel/runtime-corejs3/regenerator/index.js","webpack://SwaggerUICore/./node_modules/core-js-pure/internals/global.js","webpack://SwaggerUICore/./node_modules/core-js-pure/internals/entry-virtual.js","webpack://SwaggerUICore/./node_modules/core-js-pure/internals/is-object.js","webpack://SwaggerUICore/./node_modules/lodash/get.js","webpack://SwaggerUICore/./src/core/plugins/spec/actions.js","webpack://SwaggerUICore/./node_modules/core-js-pure/internals/descriptors.js","webpack://SwaggerUICore/./node_modules/core-js-pure/internals/define-well-known-symbol.js","webpack://SwaggerUICore/./node_modules/@babel/runtime-corejs3/helpers/createForOfIteratorHelper.js","webpack://SwaggerUICore/./node_modules/core-js-pure/internals/has.js","webpack://SwaggerUICore/./node_modules/lodash/isArray.js","webpack://SwaggerUICore/./node_modules/core-js-pure/internals/an-object.js","webpack://SwaggerUICore/./node_modules/@babel/runtime-corejs3/helpers/objectWithoutProperties.js","webpack://SwaggerUICore/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/find.js","webpack://SwaggerUICore/./src/core/plugins/oas3/actions.js","webpack://SwaggerUICore/./node_modules/lodash/isObject.js","webpack://SwaggerUICore/./node_modules/swagger-client/es/helpers.js","webpack://SwaggerUICore/./src/core/plugins/err/actions.js","webpack://SwaggerUICore/./node_modules/core-js-pure/internals/object-define-property.js","webpack://SwaggerUICore/./node_modules/core-js-pure/internals/array-method-uses-to-length.js","webpack://SwaggerUICore/external \"classnames\"","webpack://SwaggerUICore/./node_modules/lodash/isFunction.js","webpack://SwaggerUICore/./node_modules/@babel/runtime-corejs3/core-js-stable/promise.js","webpack://SwaggerUICore/./node_modules/core-js-pure/internals/to-indexed-objLine truncated
|
||||
{"version":3,"file":"swagger-ui.js","mappings":"CAAA,SAAUA,iCAAiCC,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAuB,cAAID,IAE3BD,EAAoB,cAAIC,GACzB,CATD,CASGK,MAAM,I,kCCTTH,EAAOD,QAAUK,QAAQ,S,GCCrBC,EAA2B,CAAC,EAGhC,SAASC,oBAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaT,QAGrB,IAAIC,EAASK,EAAyBE,GAAY,CAGjDR,QAAS,CAAC,GAOX,OAHAW,EAAoBH,GAAUP,EAAQA,EAAOD,QAASO,qBAG/CN,EAAOD,OACf,CCrBAO,oBAAoBK,EAAKX,IACxB,IAAIY,EAASZ,GAAUA,EAAOa,WAC7B,IAAOb,EAAiB,QACxB,IAAM,EAEP,OAD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CAyOA,SAASC,sBAAsB/F,EAAO0C,EAAQsD,EAAiBC,EAAqBtD,GAClF,IAAID,EAAQ,MAAO,GACnB,IAAI5B,EAAS,GACToF,EAAWxD,EAAOnD,IAAI,YACtB4G,EAAmBzD,EAAOnD,IAAI,YAC9B6G,EAAU1D,EAAOnD,IAAI,WACrB8G,EAAU3D,EAAOnD,IAAI,WACrBmB,EAAOgC,ELine truncated
|
||||
@@ -0,0 +1,128 @@
|
||||
# WAHA (WhatsApp HTTP API) Python examples
|
||||
|
||||
## Installation
|
||||
|
||||
We assume that you have installed software:
|
||||
|
||||
1. Python 3
|
||||
2. Docker
|
||||
|
||||
### Download and start image
|
||||
|
||||
First of all, you must run WhatsApp HTTP API locally (which under the hood it
|
||||
runs real WhatsApp Web instance and expose HTTP API for interaction).
|
||||
|
||||
Here are the steps from
|
||||
[Quick Start](https://waha.devlike.pro/docs/overview/quick-start/):
|
||||
|
||||
Download and start WhatsApp HTTP API docker container
|
||||
|
||||
```bash
|
||||
# Download the image
|
||||
docker pull devlikeapro/whatsapp-http-api
|
||||
# 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
|
||||
|
||||
# It prints logs and the last line must be
|
||||
# WhatsApp HTTP API is running on: http://[::1]:3000
|
||||
```
|
||||
|
||||
#### Download image - ARM
|
||||
|
||||
If you're using ARM (like Apple Silicon, Apple M1, etc.) - use following
|
||||
commands to download the image
|
||||
|
||||
 For Core version the command is
|
||||
|
||||
```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
|
||||
# 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
|
||||
|
||||
# It prints logs and the last line must be
|
||||
# WhatsApp HTTP API is running on: http://[::1]:3000
|
||||
```
|
||||
|
||||
### Start session and scan QR
|
||||
|
||||
2. Open Swagger API in the browser http://localhost:3000/
|
||||
3. Start session and scan QR code in swagger
|
||||
1. Find `POST /api/session/start` request press **Try it out** and
|
||||
**Execute** it with `default` session name
|
||||
2. Find `GET /api/screenshot` and execute it - it must show QR code
|
||||
3. Scan QR code on your mobile WhatsApp application (that installed on your
|
||||
phone)
|
||||
4. Execute `GET /api/screenshot` once again - it must show the screenshot
|
||||
from WhatsApp Web.
|
||||
4. Send test text message - find `POST /api/sendText` and execute it with
|
||||
payload (change `12132132130` in the `chatId` to phone number that is
|
||||
registered in WhatsApp).
|
||||
|
||||
```json
|
||||
{
|
||||
"chatId": "12132132130@c.us",
|
||||
"text": "Hi there!",
|
||||
"session": "default"
|
||||
}
|
||||
```
|
||||
|
||||
If you see **Hi there!** message then you're ready to run bots!
|
||||
|
||||
## WhatsApp Echo Bot
|
||||
|
||||
The WhatsApp Echo Bot is a sample flask webhook server application that echoes
|
||||
back to you whatever you send it. It can serve as a basic reference for how to
|
||||
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
|
||||
# Open python example folder
|
||||
cd whatsapp-http-api/examples/python
|
||||
# Install requirements
|
||||
python -mpip install -r requirements.txt
|
||||
# Run the bot
|
||||
FLASK_APP=whatsapp_echo_bot.py flask run
|
||||
```
|
||||
|
||||
Open http://127.0.0.1:5000/bot - if you see **WhatsApp Echo Bot is ready!** then
|
||||
the bot is ready to receive message!
|
||||
|
||||
Send message to the WhatsApp (that you used to scan QR code) and it'll echo text
|
||||
back to you!
|
||||
|
||||
## WhatsApp Download Files Bot
|
||||
|
||||
The WhatsApp Download Image Bot downloads all files people send to your WhatsApp
|
||||
and log the path for the file.
|
||||
|
||||
**The bot works only with WAHA Plus version** available with donations. Visit
|
||||
[read more about difference between Core and Plus versions](https://waha.devlike.pro/docs/how-to/plus-version/).
|
||||
|
||||
Download **WAHA Plus** version:
|
||||
|
||||
```bash
|
||||
# Download the image
|
||||
docker pull devlikeapro/whatsapp-http-api-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
|
||||
```
|
||||
|
||||
Run the WhatsApp Download Files bot:
|
||||
|
||||
```bash
|
||||
# Clone the git repository with example
|
||||
git clone https://github.com/devlikeapro/whatsapp-http-api.git
|
||||
# Open python example folder
|
||||
cd whatsapp-http-api/examples/python
|
||||
# Install requirements
|
||||
python -mpip install -r requirements.txt
|
||||
# Run the bot
|
||||
FLASK_APP=whatsapp_download_files_bot.py flask run
|
||||
```
|
||||
|
||||
Open http://127.0.0.1:5000/bot - if you see **WhatsApp Download Files Bot!**
|
||||
then the bot is ready to receive message with files!
|
||||
@@ -1,44 +0,0 @@
|
||||
from pprint import pprint
|
||||
|
||||
import requests
|
||||
from flask import Flask
|
||||
from flask import request
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
|
||||
@app.route("/")
|
||||
def whatsapp_echo():
|
||||
return "WhatsApp HTTP API Echo server is ready!"
|
||||
|
||||
|
||||
@app.route("/message", methods=["GET", "POST"])
|
||||
def whatsapp_webhook():
|
||||
data = request.get_json()
|
||||
if not data:
|
||||
return "WhatsApp HTTP API Echo server is ready!"
|
||||
pprint(data)
|
||||
if data['event'] != "message":
|
||||
return f"Unknown event {data['event']}"
|
||||
|
||||
payload = data["payload"]
|
||||
# The text
|
||||
text = payload["body"]
|
||||
# Number in format 791111111@c.us
|
||||
from_ = payload["from"]
|
||||
|
||||
if payload.get("mediaUrl", None):
|
||||
# Download file and set text to path
|
||||
client_url = payload["mediaUrl"]
|
||||
filename = client_url.split("/")[-1]
|
||||
path = "/tmp/" + filename
|
||||
r = requests.get(client_url)
|
||||
open(path, "wb").write(r.content)
|
||||
text = f"We have downloaded file here: {path}"
|
||||
|
||||
# Send a text back via WhatsApp HTTP API
|
||||
response = requests.post(
|
||||
"http://localhost:3000/api/sendText", json={"chatId": from_, "text": text}
|
||||
)
|
||||
response.raise_for_status()
|
||||
return "OK"
|
||||
@@ -1,2 +1,3 @@
|
||||
flask
|
||||
requests
|
||||
flask~=1.0
|
||||
requests~=2.0
|
||||
markupsafe==2.0.1
|
||||
@@ -0,0 +1,84 @@
|
||||
from os.path import abspath
|
||||
from pprint import pprint
|
||||
|
||||
import requests
|
||||
from flask import Flask
|
||||
from flask import request
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
|
||||
def send_message(chat_id, text):
|
||||
"""
|
||||
Send message to chat_id.
|
||||
:param chat_id: Phone number + "@c.us" suffix - 1231231231@c.us
|
||||
:param text: Message for the recipient
|
||||
"""
|
||||
# Send a text back via WhatsApp HTTP API
|
||||
response = requests.post(
|
||||
"http://localhost:3000/api/sendText",
|
||||
json={
|
||||
"chatId": chat_id,
|
||||
"text": text,
|
||||
"session": "default",
|
||||
},
|
||||
)
|
||||
response.raise_for_status()
|
||||
|
||||
def send_seen(chat_id, message_id, participant):
|
||||
response = requests.post(
|
||||
"http://localhost:3000/api/sendSeen",
|
||||
json={
|
||||
"session": "default",
|
||||
"chatId": chat_id,
|
||||
"messageId": message_id,
|
||||
"participant": participant,
|
||||
},
|
||||
)
|
||||
response.raise_for_status()
|
||||
|
||||
@app.route("/")
|
||||
def whatsapp_echo():
|
||||
return "WhatsApp Download Files Bot is ready!"
|
||||
|
||||
|
||||
@app.route("/bot", methods=["GET", "POST"])
|
||||
def whatsapp_webhook():
|
||||
if request.method == "GET":
|
||||
return "WhatsApp Download Files Bot is ready!"
|
||||
|
||||
data = request.get_json()
|
||||
pprint(data)
|
||||
if data["event"] != "message":
|
||||
# We can't process other event yet
|
||||
return f"Unknown event {data['event']}"
|
||||
|
||||
payload = data["payload"]
|
||||
# Ignore messages without files
|
||||
if not payload.get("mediaUrl", None):
|
||||
return "No files in the message"
|
||||
|
||||
# Number in format 791111111@c.us
|
||||
chat_id = payload["from"]
|
||||
# Message ID - false_11111111111@c.us_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
message_id = payload['id']
|
||||
# For groups - who sent the message
|
||||
participant = payload.get('participant')
|
||||
# IMPORTANT - Always send seen before sending new message
|
||||
send_seen(chat_id=chat_id, message_id=message_id, participant=participant)
|
||||
|
||||
# Download the file and download it to the current folder
|
||||
client_url = payload["mediaUrl"]
|
||||
filename = client_url.split("/")[-1]
|
||||
path = abspath("./" + filename)
|
||||
r = requests.get(client_url)
|
||||
with open(path, "wb") as f:
|
||||
f.write(r.content)
|
||||
|
||||
# Send a text back via WhatsApp HTTP API
|
||||
text = f"We have downloaded file here: {path}"
|
||||
print(text)
|
||||
send_message(chat_id=chat_id, text=text)
|
||||
|
||||
# Send OK back
|
||||
return "OK"
|
||||
@@ -0,0 +1,123 @@
|
||||
import random
|
||||
from pprint import pprint
|
||||
from time import sleep
|
||||
|
||||
import requests
|
||||
from flask import Flask
|
||||
from flask import request
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
|
||||
def send_message(chat_id, text):
|
||||
"""
|
||||
Send message to chat_id.
|
||||
:param chat_id: Phone number + "@c.us" suffix - 1231231231@c.us
|
||||
:param text: Message for the recipient
|
||||
"""
|
||||
# Send a text back via WhatsApp HTTP API
|
||||
response = requests.post(
|
||||
"http://localhost:3000/api/sendText",
|
||||
json={
|
||||
"chatId": chat_id,
|
||||
"text": text,
|
||||
"session": "default",
|
||||
},
|
||||
)
|
||||
response.raise_for_status()
|
||||
|
||||
def reply(chat_id, message_id, text):
|
||||
response = requests.post(
|
||||
"http://localhost:3000/api/reply",
|
||||
json={
|
||||
"chatId": chat_id,
|
||||
"text": text,
|
||||
"reply_to": message_id,
|
||||
"session": "default",
|
||||
},
|
||||
)
|
||||
response.raise_for_status()
|
||||
|
||||
|
||||
def send_seen(chat_id, message_id, participant):
|
||||
response = requests.post(
|
||||
"http://localhost:3000/api/sendSeen",
|
||||
json={
|
||||
"session": "default",
|
||||
"chatId": chat_id,
|
||||
"messageId": message_id,
|
||||
"participant": participant,
|
||||
},
|
||||
)
|
||||
response.raise_for_status()
|
||||
|
||||
def start_typing(chat_id):
|
||||
response = requests.post(
|
||||
"http://localhost:3000/api/startTyping",
|
||||
json={
|
||||
"session": "default",
|
||||
"chatId": chat_id,
|
||||
},
|
||||
)
|
||||
response.raise_for_status()
|
||||
|
||||
def stop_typing(chat_id):
|
||||
response = requests.post(
|
||||
"http://localhost:3000/api/stopTyping",
|
||||
json={
|
||||
"session": "default",
|
||||
"chatId": chat_id,
|
||||
},
|
||||
)
|
||||
response.raise_for_status()
|
||||
|
||||
def typing(chat_id, seconds):
|
||||
start_typing(chat_id=chat_id)
|
||||
sleep(seconds)
|
||||
stop_typing(chat_id=chat_id)
|
||||
|
||||
@app.route("/")
|
||||
def whatsapp_echo():
|
||||
return "WhatsApp Echo Bot is ready!"
|
||||
|
||||
|
||||
@app.route("/bot", methods=["GET", "POST"])
|
||||
def whatsapp_webhook():
|
||||
if request.method == "GET":
|
||||
return "WhatsApp Echo Bot is ready!"
|
||||
|
||||
data = request.get_json()
|
||||
pprint(data)
|
||||
if data["event"] != "message":
|
||||
# We can't process other event yet
|
||||
return f"Unknown event {data['event']}"
|
||||
|
||||
# Payload that we've got
|
||||
payload = data["payload"]
|
||||
# The text
|
||||
text = payload.get("body")
|
||||
if not text:
|
||||
# We can't process non-text messages yet
|
||||
print("No text in message")
|
||||
print(payload)
|
||||
return "OK"
|
||||
# Number in format 1231231231@c.us or @g.us for group
|
||||
chat_id = payload["from"]
|
||||
# Message ID - false_11111111111@c.us_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
message_id = payload['id']
|
||||
# For groups - who sent the message
|
||||
participant = payload.get('participant')
|
||||
# IMPORTANT - Always send seen before sending new message
|
||||
send_seen(chat_id=chat_id, message_id=message_id, participant=participant)
|
||||
|
||||
|
||||
# Send a text back via WhatsApp HTTP API
|
||||
typing(chat_id=chat_id, seconds=random.random() * 3)
|
||||
send_message(chat_id=chat_id, text=text)
|
||||
|
||||
# OR reply on the message
|
||||
typing(chat_id=chat_id, seconds=random.random() * 3)
|
||||
reply(chat_id=chat_id, message_id=message_id, text=text)
|
||||
|
||||
# Send OK back
|
||||
return "OK"
|
||||
@@ -2,8 +2,6 @@
|
||||
"collection": "@nestjs/schematics",
|
||||
"sourceRoot": "src",
|
||||
"compilerOptions": {
|
||||
"plugins": [
|
||||
"@nestjs/swagger"
|
||||
]
|
||||
"plugins": ["@nestjs/swagger"]
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@
|
||||
"start:debug": "nest start --debug --watch",
|
||||
"start:prod": "node --unhandled-rejections=none dist/main",
|
||||
"start:prod-exit": "node dist/main",
|
||||
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
|
||||
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix --max-warnings=0",
|
||||
"test": "jest",
|
||||
"test:watch": "jest --watch",
|
||||
"test:cov": "jest --coverage",
|
||||
@@ -22,19 +22,33 @@
|
||||
"test:e2e": "jest --config ./test/jest-e2e.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@adiwajshing/baileys": "github:WhiskeySockets/Baileys",
|
||||
"@adiwajshing/keyed-db": "^0.2.4",
|
||||
"@nestjs/axios": "^3.0.2",
|
||||
"@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/serve-static": "^2.1.3",
|
||||
"@nestjs/swagger": "^6.0.5",
|
||||
"@nestjs/swagger": "^7.1.11",
|
||||
"@nestjs/terminus": "^10.2.3",
|
||||
"@types/lodash": "^4.14.194",
|
||||
"@types/ws": "^8.5.4",
|
||||
"check-disk-space": "^3.4.0",
|
||||
"class-validator": "^0.12.2",
|
||||
"del": "^6.0.0",
|
||||
"express-basic-auth": "^1.2.1",
|
||||
"file-type": "16.5.4",
|
||||
"https-proxy-agent": "^7.0.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",
|
||||
"qrcode": "^1.5.1",
|
||||
"qrcode-terminal": "^0.12.0",
|
||||
"reflect-metadata": "^0.1.13",
|
||||
"request": "^2.88.2",
|
||||
@@ -42,8 +56,8 @@
|
||||
"rimraf": "^3.0.2",
|
||||
"rxjs": "^7.1.0",
|
||||
"swagger-ui-express": "^4.1.4",
|
||||
"venom-bot": "^4.3.7",
|
||||
"whatsapp-web.js": "^1.19.3"
|
||||
"venom-bot": "5.0.1",
|
||||
"whatsapp-web.js": "https://github.com/devlikeapro/whatsapp-web.js#main-fork"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nestjs/cli": "^9.0.0",
|
||||
@@ -51,13 +65,14 @@
|
||||
"@nestjs/testing": "^9.0.9",
|
||||
"@types/express": "^4.17.3",
|
||||
"@types/jest": "26.0.10",
|
||||
"@types/node": "^13.9.1",
|
||||
"@types/node": "^18.14.2",
|
||||
"@types/supertest": "^2.0.8",
|
||||
"@typescript-eslint/eslint-plugin": "3.9.1",
|
||||
"@typescript-eslint/parser": "3.9.1",
|
||||
"eslint": "7.7.0",
|
||||
"eslint-config-prettier": "^6.10.0",
|
||||
"eslint-plugin-import": "^2.20.1",
|
||||
"eslint-plugin-simple-import-sort": "^10.0.0",
|
||||
"jest": "26.4.2",
|
||||
"prettier": "^1.19.1",
|
||||
"supertest": "^4.0.2",
|
||||
@@ -65,7 +80,7 @@
|
||||
"ts-loader": "^6.2.1",
|
||||
"ts-node": "^10.9.1",
|
||||
"tsconfig-paths": "^4.1.0",
|
||||
"typescript": "4.7.4"
|
||||
"typescript": "^4.8.4"
|
||||
},
|
||||
"jest": {
|
||||
"moduleFileExtensions": [
|
||||
@@ -80,5 +95,6 @@
|
||||
},
|
||||
"coverageDirectory": "../coverage",
|
||||
"testEnvironment": "node"
|
||||
}
|
||||
},
|
||||
"packageManager": "yarn@3.6.3"
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
import {
|
||||
CallHandler,
|
||||
ExecutionContext,
|
||||
Injectable,
|
||||
NestInterceptor,
|
||||
StreamableFile,
|
||||
} from '@nestjs/common';
|
||||
import { Request, Response } from 'express';
|
||||
import { Observable } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
import { Base64File } from '../structures/files.dto';
|
||||
|
||||
@Injectable()
|
||||
/**
|
||||
* Interceptor to convert Buffer response to Base64File or StreamableFile
|
||||
* based on Accept header.
|
||||
* It should go together with @ApiFileAcceptHeader in controller method
|
||||
* So we have proper Swagger documentation
|
||||
*/
|
||||
export class BufferResponseInterceptor<T>
|
||||
implements NestInterceptor<Buffer, Base64File | StreamableFile>
|
||||
{
|
||||
intercept(
|
||||
context: ExecutionContext,
|
||||
next: CallHandler,
|
||||
): Observable<Base64File | StreamableFile> {
|
||||
const ctx = context.switchToHttp();
|
||||
const request = ctx.getRequest<Request>();
|
||||
const response = ctx.getResponse<Response>();
|
||||
return next.handle().pipe(map(processBuffer));
|
||||
|
||||
function processBuffer(buffer: Buffer) {
|
||||
// Check buffer is Buffer
|
||||
if (!Buffer.isBuffer(buffer)) {
|
||||
return buffer;
|
||||
}
|
||||
|
||||
const accept = request.headers['accept'];
|
||||
if (accept == 'application/json') {
|
||||
return {
|
||||
mimetype: 'image/png',
|
||||
data: buffer.toString('base64'),
|
||||
};
|
||||
}
|
||||
const file = new StreamableFile(buffer);
|
||||
response.set({
|
||||
'Content-Type': 'image/png',
|
||||
'Content-Length': buffer.length,
|
||||
});
|
||||
return file;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
import {
|
||||
Body,
|
||||
Controller,
|
||||
Get,
|
||||
Post,
|
||||
Query,
|
||||
UseInterceptors,
|
||||
} from '@nestjs/common';
|
||||
import { UnprocessableEntityException } from '@nestjs/common/exceptions/unprocessable-entity.exception';
|
||||
import { ApiOperation, ApiSecurity, ApiTags } from '@nestjs/swagger';
|
||||
|
||||
import { SessionManager } from '../core/abc/manager.abc';
|
||||
import { WhatsappSession } from '../core/abc/session.abc';
|
||||
import {
|
||||
CaptchaBody,
|
||||
OTPRequest,
|
||||
QRCodeFormat,
|
||||
QRCodeQuery,
|
||||
QRCodeValue,
|
||||
RequestCodeRequest,
|
||||
} from '../structures/auth.dto';
|
||||
import { WAHASessionStatus } from '../structures/enums.dto';
|
||||
import { Base64File } from '../structures/files.dto';
|
||||
import { BufferResponseInterceptor } from './BufferResponseInterceptor';
|
||||
import { ApiFileAcceptHeader, SessionApiParam, SessionParam } from './helpers';
|
||||
|
||||
@ApiSecurity('api_key')
|
||||
@Controller('api/:session/auth')
|
||||
@ApiTags('auth')
|
||||
class AuthController {
|
||||
constructor(private manager: SessionManager) {}
|
||||
|
||||
@Get('qr')
|
||||
@ApiOperation({
|
||||
summary: 'Get QR code for pairing WhatsApp Web.',
|
||||
})
|
||||
@SessionApiParam
|
||||
@ApiFileAcceptHeader(Base64File, QRCodeValue)
|
||||
@UseInterceptors(new BufferResponseInterceptor())
|
||||
async getQR(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Query() query: QRCodeQuery,
|
||||
): Promise<Buffer | QRCodeValue> {
|
||||
if (session.status != WAHASessionStatus.SCAN_QR_CODE) {
|
||||
const err = `Can get QR code only in SCAN_QR_CODE status. The current status is '${session.status}'`;
|
||||
throw new UnprocessableEntityException(err);
|
||||
}
|
||||
const qr = session.getQR();
|
||||
if (query.format == QRCodeFormat.RAW) {
|
||||
return { value: qr.raw };
|
||||
}
|
||||
return qr.get();
|
||||
}
|
||||
|
||||
@Post('request-code')
|
||||
@SessionApiParam
|
||||
@ApiOperation({
|
||||
summary: 'Request authentication code.',
|
||||
})
|
||||
requestCode(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Body() request: RequestCodeRequest,
|
||||
) {
|
||||
return session.requestCode(request.phoneNumber, request.method, request);
|
||||
}
|
||||
|
||||
@Post('authorize-code')
|
||||
@SessionApiParam
|
||||
@ApiOperation({
|
||||
summary: 'Send OTP authentication code.',
|
||||
})
|
||||
authorizeCode(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Body() request: OTPRequest,
|
||||
) {
|
||||
return session.authorizeCode(request.code);
|
||||
}
|
||||
|
||||
@Get('captcha')
|
||||
@SessionApiParam
|
||||
@ApiFileAcceptHeader()
|
||||
@UseInterceptors(new BufferResponseInterceptor())
|
||||
@ApiOperation({
|
||||
summary: 'Get captcha image.',
|
||||
})
|
||||
async getCaptcha(@SessionParam session: WhatsappSession): Promise<Buffer> {
|
||||
const image = await session.getCaptcha();
|
||||
return image.get();
|
||||
}
|
||||
|
||||
@Post('captcha')
|
||||
@SessionApiParam
|
||||
@ApiOperation({
|
||||
summary: 'Enter captcha code.',
|
||||
})
|
||||
saveCaptcha(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Body() body: CaptchaBody,
|
||||
) {
|
||||
return session.saveCaptcha(body.code);
|
||||
}
|
||||
}
|
||||
|
||||
export { AuthController };
|
||||
@@ -0,0 +1,56 @@
|
||||
import { Controller, Delete, Get, Param, Post, Query } from '@nestjs/common';
|
||||
import { ApiOperation, ApiSecurity, ApiTags } from '@nestjs/swagger';
|
||||
|
||||
import { SessionManager } from '../core/abc/manager.abc';
|
||||
import { WhatsappSession } from '../core/abc/session.abc';
|
||||
import { parseBool } from '../helpers';
|
||||
import { GetChatMessagesQuery } from '../structures/chats.dto';
|
||||
import { SessionApiParam, SessionParam } from './helpers';
|
||||
|
||||
@ApiSecurity('api_key')
|
||||
@Controller('api/:session/chats')
|
||||
@ApiTags('chats')
|
||||
class ChatsController {
|
||||
constructor(private manager: SessionManager) {}
|
||||
|
||||
@Get('')
|
||||
@SessionApiParam
|
||||
@ApiOperation({ summary: 'Get all chats' })
|
||||
getAllChats(@SessionParam session: WhatsappSession) {
|
||||
return session.getChats();
|
||||
}
|
||||
|
||||
@Delete(':chatId')
|
||||
@SessionApiParam
|
||||
@ApiOperation({ summary: 'Deletes the chat' })
|
||||
deleteChat(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Param('chatId') chatId: string,
|
||||
) {
|
||||
return session.deleteChat(chatId);
|
||||
}
|
||||
|
||||
@Get(':chatId/messages')
|
||||
@SessionApiParam
|
||||
@ApiOperation({ summary: 'Gets messages in the chat' })
|
||||
getChatMessages(
|
||||
@Query() query: GetChatMessagesQuery,
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Param('chatId') chatId: string,
|
||||
) {
|
||||
const downloadMedia = parseBool(query.downloadMedia);
|
||||
return session.getChatMessages(chatId, query.limit, downloadMedia);
|
||||
}
|
||||
|
||||
@Delete(':chatId/messages')
|
||||
@SessionApiParam
|
||||
@ApiOperation({ summary: 'Clears all messages from the chat' })
|
||||
clearMessages(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Param('chatId') chatId: string,
|
||||
) {
|
||||
return session.clearMessages(chatId);
|
||||
}
|
||||
}
|
||||
|
||||
export { ChatsController };
|
||||
@@ -1,134 +1,166 @@
|
||||
import {Body, Controller, Get, Post, Put, Query} from '@nestjs/common';
|
||||
import {ApiOperation, ApiSecurity, ApiTags} from "@nestjs/swagger";
|
||||
import { Body, Controller, Get, Post, Put, Query } from '@nestjs/common';
|
||||
import { ApiOperation, ApiSecurity, ApiTags } from '@nestjs/swagger';
|
||||
|
||||
import { SessionManager } from '../core/abc/manager.abc';
|
||||
import {
|
||||
ChatRequest,
|
||||
CheckNumberStatusQuery,
|
||||
MessageContactVcardRequest,
|
||||
MessageFileRequest,
|
||||
MessageImageRequest,
|
||||
MessageLinkPreviewRequest,
|
||||
MessageLocationRequest,
|
||||
MessageReactionRequest,
|
||||
MessageReplyRequest,
|
||||
MessageTextButtonsRequest,
|
||||
MessageTextQuery,
|
||||
MessageTextRequest,
|
||||
MessageVoiceRequest
|
||||
} from "../structures/chatting.dto";
|
||||
import {WAMessage, WANumberExistResult} from "../structures/responses.dto";
|
||||
import {SessionManager} from "../core/abc/manager.abc";
|
||||
ChatRequest,
|
||||
CheckNumberStatusQuery,
|
||||
GetMessageQuery,
|
||||
MessageContactVcardRequest,
|
||||
MessageFileRequest,
|
||||
MessageImageRequest,
|
||||
MessageLinkPreviewRequest,
|
||||
MessageLocationRequest,
|
||||
MessagePollRequest,
|
||||
MessageReactionRequest,
|
||||
MessageReplyRequest,
|
||||
MessageTextQuery,
|
||||
MessageTextRequest,
|
||||
MessageVideoRequest,
|
||||
MessageVoiceRequest,
|
||||
SendSeenRequest,
|
||||
WANumberExistResult,
|
||||
} from '../structures/chatting.dto';
|
||||
import { WAMessage } from '../structures/responses.dto';
|
||||
|
||||
@ApiSecurity('api_key')
|
||||
@Controller('api')
|
||||
@ApiTags('chatting')
|
||||
export class ChattingController {
|
||||
constructor(private manager: SessionManager) {
|
||||
}
|
||||
constructor(private manager: SessionManager) {}
|
||||
|
||||
@Get('/checkNumberStatus')
|
||||
@ApiOperation({summary: 'Check number status'})
|
||||
async checkNumberStatus(@Query() request: CheckNumberStatusQuery): Promise<WANumberExistResult> {
|
||||
const whatsapp = this.manager.getSession(request.session)
|
||||
return whatsapp.checkNumberStatus(request)
|
||||
}
|
||||
@Get('/checkNumberStatus')
|
||||
@ApiOperation({ summary: 'Check number status' })
|
||||
async checkNumberStatus(
|
||||
@Query() request: CheckNumberStatusQuery,
|
||||
): Promise<WANumberExistResult> {
|
||||
const whatsapp = this.manager.getSession(request.session);
|
||||
return whatsapp.checkNumberStatus(request);
|
||||
}
|
||||
|
||||
@Post('/sendContactVcard')
|
||||
sendContactVcard(@Body() request: MessageContactVcardRequest) {
|
||||
const whatsapp = this.manager.getSession(request.session)
|
||||
return whatsapp.sendContactVCard(request)
|
||||
}
|
||||
@Post('/sendContactVcard')
|
||||
sendContactVcard(@Body() request: MessageContactVcardRequest) {
|
||||
const whatsapp = this.manager.getSession(request.session);
|
||||
return whatsapp.sendContactVCard(request);
|
||||
}
|
||||
|
||||
@Get('/sendText')
|
||||
@ApiOperation({summary: 'Send a text message'})
|
||||
sendTextGet(
|
||||
@Query() query: MessageTextQuery,
|
||||
) {
|
||||
const whatsapp = this.manager.getSession(query.session)
|
||||
const msg = new MessageTextRequest()
|
||||
msg.chatId = query.phone
|
||||
msg.text = query.text
|
||||
return whatsapp.sendText(msg)
|
||||
}
|
||||
@Get('/sendText')
|
||||
@ApiOperation({ summary: 'Send a text message' })
|
||||
sendTextGet(@Query() query: MessageTextQuery) {
|
||||
const whatsapp = this.manager.getSession(query.session);
|
||||
const msg = new MessageTextRequest();
|
||||
msg.chatId = query.phone;
|
||||
msg.text = query.text;
|
||||
return whatsapp.sendText(msg);
|
||||
}
|
||||
|
||||
@Post('/sendText')
|
||||
@ApiOperation({summary: 'Send a text message'})
|
||||
sendText(@Body() request: MessageTextRequest): Promise<WAMessage> {
|
||||
const whatsapp = this.manager.getSession(request.session)
|
||||
return whatsapp.sendText(request)
|
||||
}
|
||||
@Post('/sendText')
|
||||
@ApiOperation({ summary: 'Send a text message' })
|
||||
sendText(@Body() request: MessageTextRequest): Promise<WAMessage> {
|
||||
const whatsapp = this.manager.getSession(request.session);
|
||||
return whatsapp.sendText(request);
|
||||
}
|
||||
|
||||
@Post('/sendTextButtons')
|
||||
@ApiOperation({summary: 'Send a text message with buttons'})
|
||||
sendTextButtons(@Body() request: MessageTextButtonsRequest) {
|
||||
const whatsapp = this.manager.getSession(request.session)
|
||||
return whatsapp.sendTextButtons(request)
|
||||
}
|
||||
@Post('/sendPoll')
|
||||
@ApiOperation({
|
||||
summary: 'Send a poll with options. You can use it as buttons replace',
|
||||
})
|
||||
sendPoll(@Body() request: MessagePollRequest) {
|
||||
const whatsapp = this.manager.getSession(request.session);
|
||||
return whatsapp.sendPoll(request);
|
||||
}
|
||||
|
||||
@Post('/sendLocation')
|
||||
sendLocation(@Body() request: MessageLocationRequest) {
|
||||
const whatsapp = this.manager.getSession(request.session)
|
||||
return whatsapp.sendLocation(request)
|
||||
}
|
||||
@Post('/sendLocation')
|
||||
sendLocation(@Body() request: MessageLocationRequest) {
|
||||
const whatsapp = this.manager.getSession(request.session);
|
||||
return whatsapp.sendLocation(request);
|
||||
}
|
||||
|
||||
@Post('/sendLinkPreview')
|
||||
sendLinkPreview(@Body() request: MessageLinkPreviewRequest) {
|
||||
const whatsapp = this.manager.getSession(request.session)
|
||||
return whatsapp.sendLinkPreview(request)
|
||||
}
|
||||
@Post('/sendLinkPreview')
|
||||
sendLinkPreview(@Body() request: MessageLinkPreviewRequest) {
|
||||
const whatsapp = this.manager.getSession(request.session);
|
||||
return whatsapp.sendLinkPreview(request);
|
||||
}
|
||||
|
||||
@Post('/sendImage')
|
||||
@ApiOperation({summary: "Send an image. Either from an URL or base64 data - look at the request schemas for details."})
|
||||
sendImage(@Body() request: MessageImageRequest) {
|
||||
const whatsapp = this.manager.getSession(request.session)
|
||||
return whatsapp.sendImage(request)
|
||||
}
|
||||
@Post('/sendImage')
|
||||
@ApiOperation({
|
||||
summary:
|
||||
'Send an image. Either from an URL or base64 data - look at the request schemas for details.',
|
||||
})
|
||||
sendImage(@Body() request: MessageImageRequest) {
|
||||
const whatsapp = this.manager.getSession(request.session);
|
||||
return whatsapp.sendImage(request);
|
||||
}
|
||||
|
||||
@Post('/sendFile')
|
||||
@ApiOperation({summary: "Send a file. Either from an URL or base64 data - look at the request schemas for details."})
|
||||
sendFile(@Body() request: MessageFileRequest) {
|
||||
const whatsapp = this.manager.getSession(request.session)
|
||||
return whatsapp.sendFile(request)
|
||||
}
|
||||
@Post('/sendFile')
|
||||
@ApiOperation({
|
||||
summary:
|
||||
'Send a file. Either from an URL or base64 data - look at the request schemas for details.',
|
||||
})
|
||||
sendFile(@Body() request: MessageFileRequest) {
|
||||
const whatsapp = this.manager.getSession(request.session);
|
||||
return whatsapp.sendFile(request);
|
||||
}
|
||||
|
||||
@Post('/sendVoice')
|
||||
@ApiOperation({summary: "Send an voice message. Either from an URL or base64 data - look at the request schemas for details."})
|
||||
sendVoice(@Body() request: MessageVoiceRequest) {
|
||||
const whatsapp = this.manager.getSession(request.session)
|
||||
return whatsapp.sendVoice(request)
|
||||
}
|
||||
@Post('/sendVoice')
|
||||
@ApiOperation({
|
||||
summary:
|
||||
'Send an voice message. Either from an URL or base64 data - look at the request schemas for details.',
|
||||
})
|
||||
sendVoice(@Body() request: MessageVoiceRequest) {
|
||||
const whatsapp = this.manager.getSession(request.session);
|
||||
return whatsapp.sendVoice(request);
|
||||
}
|
||||
|
||||
@Post('/reply')
|
||||
@ApiOperation({summary: 'Reply to a text message'})
|
||||
reply(@Body() request: MessageReplyRequest) {
|
||||
const whatsapp = this.manager.getSession(request.session)
|
||||
return whatsapp.reply(request)
|
||||
}
|
||||
@Post('/sendVideo')
|
||||
@ApiOperation({
|
||||
summary:
|
||||
'Send a video. Either from an URL or base64 data - look at the request schemas for details.',
|
||||
})
|
||||
sendVideo(@Body() request: MessageVideoRequest) {
|
||||
const whatsapp = this.manager.getSession(request.session);
|
||||
return whatsapp.sendVideo(request);
|
||||
}
|
||||
|
||||
@Post('/sendSeen')
|
||||
sendSeen(@Body() chat: ChatRequest) {
|
||||
const whatsapp = this.manager.getSession(chat.session)
|
||||
return whatsapp.sendSeen(chat)
|
||||
}
|
||||
@Post('/reply')
|
||||
@ApiOperation({ summary: 'Reply to a text message' })
|
||||
reply(@Body() request: MessageReplyRequest) {
|
||||
const whatsapp = this.manager.getSession(request.session);
|
||||
return whatsapp.reply(request);
|
||||
}
|
||||
|
||||
@Post('/startTyping')
|
||||
async startTyping(@Body() chat: ChatRequest) {
|
||||
// It's infinitive action
|
||||
const whatsapp = this.manager.getSession(chat.session)
|
||||
await whatsapp.startTyping(chat)
|
||||
return {result: true}
|
||||
}
|
||||
@Post('/sendSeen')
|
||||
sendSeen(@Body() chat: SendSeenRequest) {
|
||||
const whatsapp = this.manager.getSession(chat.session);
|
||||
return whatsapp.sendSeen(chat);
|
||||
}
|
||||
|
||||
@Post('/stopTyping')
|
||||
async stopTyping(@Body() chat: ChatRequest) {
|
||||
const whatsapp = this.manager.getSession(chat.session)
|
||||
await whatsapp.stopTyping(chat)
|
||||
return {result: true}
|
||||
}
|
||||
@Post('/startTyping')
|
||||
async startTyping(@Body() chat: ChatRequest) {
|
||||
// It's infinitive action
|
||||
const whatsapp = this.manager.getSession(chat.session);
|
||||
await whatsapp.startTyping(chat);
|
||||
return { result: true };
|
||||
}
|
||||
|
||||
@Put('/reaction')
|
||||
@ApiOperation({summary: 'React to a message with an emoji'})
|
||||
setReaction(@Body() request: MessageReactionRequest) {
|
||||
const whatsapp = this.manager.getSession(request.session)
|
||||
return whatsapp.setReaction(request)
|
||||
}
|
||||
@Post('/stopTyping')
|
||||
async stopTyping(@Body() chat: ChatRequest) {
|
||||
const whatsapp = this.manager.getSession(chat.session);
|
||||
await whatsapp.stopTyping(chat);
|
||||
return { result: true };
|
||||
}
|
||||
|
||||
@Put('/reaction')
|
||||
@ApiOperation({ summary: 'React to a message with an emoji' })
|
||||
setReaction(@Body() request: MessageReactionRequest) {
|
||||
const whatsapp = this.manager.getSession(request.session);
|
||||
return whatsapp.setReaction(request);
|
||||
}
|
||||
|
||||
@Get('/messages')
|
||||
@ApiOperation({ summary: 'Get messages in a chat' })
|
||||
getMessages(@Query() query: GetMessageQuery) {
|
||||
const whatsapp = this.manager.getSession(query.session);
|
||||
return whatsapp.getMessages(query);
|
||||
}
|
||||
}
|
||||
@@ -1,63 +1,77 @@
|
||||
import {Body, Controller, Get, Post, Query} from '@nestjs/common';
|
||||
import {ApiOperation, ApiSecurity, ApiTags} from "@nestjs/swagger";
|
||||
import {SessionManager} from "../core/abc/manager.abc";
|
||||
import {ContactQuery, ContactRequest} from "../structures/contacts.dto";
|
||||
import {SessionQuery} from "../structures/base.dto";
|
||||
import {CheckNumberStatusQuery} from "../structures/chatting.dto";
|
||||
import {WANumberExistResult} from "../structures/responses.dto";
|
||||
import { Body, Controller, Get, Post, Query } from '@nestjs/common';
|
||||
import { ApiOperation, ApiSecurity, ApiTags } from '@nestjs/swagger';
|
||||
|
||||
import { SessionManager } from '../core/abc/manager.abc';
|
||||
import { SessionQuery } from '../structures/base.dto';
|
||||
import {
|
||||
CheckNumberStatusQuery,
|
||||
WANumberExistResult,
|
||||
} from '../structures/chatting.dto';
|
||||
import { ContactQuery, ContactRequest } from '../structures/contacts.dto';
|
||||
|
||||
@ApiSecurity('api_key')
|
||||
@Controller('api/contacts')
|
||||
@ApiTags('contacts')
|
||||
export class ContactsController {
|
||||
constructor(private manager: SessionManager) {
|
||||
}
|
||||
constructor(private manager: SessionManager) {}
|
||||
|
||||
@Get('/')
|
||||
@ApiOperation({summary: 'Get contact basic info. The method always return result, even if the phone number is not registered in WhatsApp. For that - use /check-exists endpoint below.'})
|
||||
get(@Query() query: ContactQuery) {
|
||||
const whatsapp = this.manager.getSession(query.session)
|
||||
return whatsapp.getContact(query)
|
||||
}
|
||||
@Get('/')
|
||||
@ApiOperation({
|
||||
summary:
|
||||
'Get contact basic info. The method always return result, even if the phone number is not registered in WhatsApp. For that - use /check-exists endpoint below.',
|
||||
})
|
||||
get(@Query() query: ContactQuery) {
|
||||
const whatsapp = this.manager.getSession(query.session);
|
||||
return whatsapp.getContact(query);
|
||||
}
|
||||
|
||||
@Get('/all')
|
||||
@ApiOperation({summary: 'Get all contacts'})
|
||||
getAll(@Query() query: SessionQuery) {
|
||||
const whatsapp = this.manager.getSession(query.session)
|
||||
return whatsapp.getContacts()
|
||||
}
|
||||
@Get('/all')
|
||||
@ApiOperation({ summary: 'Get all contacts' })
|
||||
getAll(@Query() query: SessionQuery) {
|
||||
const whatsapp = this.manager.getSession(query.session);
|
||||
return whatsapp.getContacts();
|
||||
}
|
||||
|
||||
@Get('/check-exists')
|
||||
@ApiOperation({summary: 'Check phone number is registered in WhatsApp.'})
|
||||
async checkExists(@Query() request: CheckNumberStatusQuery): Promise<WANumberExistResult> {
|
||||
const whatsapp = this.manager.getSession(request.session)
|
||||
return whatsapp.checkNumberStatus(request)
|
||||
}
|
||||
@Get('/check-exists')
|
||||
@ApiOperation({ summary: 'Check phone number is registered in WhatsApp.' })
|
||||
async checkExists(
|
||||
@Query() request: CheckNumberStatusQuery,
|
||||
): Promise<WANumberExistResult> {
|
||||
const whatsapp = this.manager.getSession(request.session);
|
||||
return whatsapp.checkNumberStatus(request);
|
||||
}
|
||||
|
||||
@Get('/about')
|
||||
@ApiOperation({summary: 'Gets the Contact\'s current "about" info. Returns null if you don\'t have permission to read their status.'})
|
||||
getAbout(@Query() query: ContactQuery) {
|
||||
const whatsapp = this.manager.getSession(query.session)
|
||||
return whatsapp.getContactAbout(query)
|
||||
}
|
||||
@Get('/about')
|
||||
@ApiOperation({
|
||||
summary:
|
||||
'Gets the Contact\'s current "about" info. Returns null if you don\'t have permission to read their status.',
|
||||
})
|
||||
getAbout(@Query() query: ContactQuery) {
|
||||
const whatsapp = this.manager.getSession(query.session);
|
||||
return whatsapp.getContactAbout(query);
|
||||
}
|
||||
|
||||
@Get('/profile-picture')
|
||||
@ApiOperation({summary: 'Returns the contact\'s profile picture URL, if privacy settings allow it.'})
|
||||
getProfilePicture(@Query() query: ContactQuery) {
|
||||
const whatsapp = this.manager.getSession(query.session)
|
||||
return whatsapp.getContactProfilePicture(query)
|
||||
}
|
||||
@Get('/profile-picture')
|
||||
@ApiOperation({
|
||||
summary:
|
||||
"Returns the contact's profile picture URL, if privacy settings allow it.",
|
||||
})
|
||||
getProfilePicture(@Query() query: ContactQuery) {
|
||||
const whatsapp = this.manager.getSession(query.session);
|
||||
return whatsapp.getContactProfilePicture(query);
|
||||
}
|
||||
|
||||
@Post('/block')
|
||||
@ApiOperation({summary:"Block contact"})
|
||||
block(@Body() request: ContactRequest) {
|
||||
const whatsapp = this.manager.getSession(request.session)
|
||||
return whatsapp.blockContact(request)
|
||||
}
|
||||
@Post('/unblock')
|
||||
@ApiOperation({summary:"Unblock contact"})
|
||||
unblock(@Body() request: ContactRequest) {
|
||||
const whatsapp = this.manager.getSession(request.session)
|
||||
return whatsapp.unblockContact(request)
|
||||
}
|
||||
@Post('/block')
|
||||
@ApiOperation({ summary: 'Block contact' })
|
||||
block(@Body() request: ContactRequest) {
|
||||
const whatsapp = this.manager.getSession(request.session);
|
||||
return whatsapp.blockContact(request);
|
||||
}
|
||||
|
||||
@Post('/unblock')
|
||||
@ApiOperation({ summary: 'Unblock contact' })
|
||||
unblock(@Body() request: ContactRequest) {
|
||||
const whatsapp = this.manager.getSession(request.session);
|
||||
return whatsapp.unblockContact(request);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,13 @@
|
||||
import {ArgumentsHost, Catch, ExceptionFilter, HttpException, HttpStatus,} from '@nestjs/common';
|
||||
import {Request, Response} from 'express';
|
||||
import {VERSION} from "../version";
|
||||
import {
|
||||
ArgumentsHost,
|
||||
Catch,
|
||||
ExceptionFilter,
|
||||
HttpException,
|
||||
HttpStatus,
|
||||
} from '@nestjs/common';
|
||||
import { Request, Response } from 'express';
|
||||
|
||||
import { VERSION } from '../version';
|
||||
|
||||
/**
|
||||
* Serializer error to JSON.
|
||||
@@ -8,42 +15,62 @@ import {VERSION} from "../version";
|
||||
* Credits: https://stackoverflow.com/a/72707578/6753144
|
||||
*/
|
||||
export function serializeError(err: unknown) {
|
||||
const properties = Object.getOwnPropertyNames(err)
|
||||
// getOwnPropertyNames does not get 'name', like "ReferenceError"
|
||||
properties.push('name')
|
||||
return JSON.parse(JSON.stringify(err, properties))
|
||||
const properties = Object.getOwnPropertyNames(err);
|
||||
// getOwnPropertyNames does not get 'name', like "ReferenceError"
|
||||
properties.push('name');
|
||||
return JSON.parse(JSON.stringify(err, properties));
|
||||
}
|
||||
|
||||
@Catch()
|
||||
export class AllExceptionsFilter implements ExceptionFilter {
|
||||
catch(exception: HttpException | Error, host: ArgumentsHost): void {
|
||||
|
||||
const ctx = host.switchToHttp();
|
||||
const response = ctx.getResponse<Response>();
|
||||
const request = ctx.getRequest<Request>();
|
||||
|
||||
if (exception instanceof HttpException) {
|
||||
response
|
||||
.status(exception.getStatus())
|
||||
.json(exception.getResponse());
|
||||
return
|
||||
}
|
||||
|
||||
const httpStatus = HttpStatus.INTERNAL_SERVER_ERROR
|
||||
response
|
||||
.status(httpStatus)
|
||||
.json({
|
||||
statusCode: httpStatus,
|
||||
timestamp: new Date().toISOString(),
|
||||
exception: serializeError(exception),
|
||||
request: {
|
||||
path: request.url,
|
||||
method: request.method,
|
||||
body: request.body,
|
||||
query: request.query,
|
||||
},
|
||||
version: VERSION,
|
||||
});
|
||||
catch(exception: any | Error, host: ArgumentsHost): void {
|
||||
const ctx = host.switchToHttp();
|
||||
const response = ctx.getResponse<Response>();
|
||||
const request = ctx.getRequest<Request>();
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @solution https://github.com/nestjs/serve-static/issues/139#issuecomment-612429557
|
||||
*/
|
||||
if (exception.code === 'ENOENT') {
|
||||
response.status(HttpStatus.NOT_FOUND).json({
|
||||
error: {
|
||||
code: 404,
|
||||
key: 'FILE_NOT_FOUND',
|
||||
message: 'File not found',
|
||||
details: 'File not found or no longer available',
|
||||
},
|
||||
});
|
||||
response.send();
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* If it's HttpException - pass it as is
|
||||
*/
|
||||
if (exception instanceof HttpException) {
|
||||
response.status(exception.getStatus()).json(exception.getResponse());
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* If it's not HttpException - pass it as 500 error
|
||||
* And send JSON response with error details
|
||||
*/
|
||||
const httpStatus = HttpStatus.INTERNAL_SERVER_ERROR;
|
||||
response.status(httpStatus).json({
|
||||
statusCode: httpStatus,
|
||||
timestamp: new Date().toISOString(),
|
||||
exception: serializeError(exception),
|
||||
request: {
|
||||
path: request.url,
|
||||
method: request.method,
|
||||
body: request.body,
|
||||
query: request.query,
|
||||
},
|
||||
version: VERSION,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,229 @@
|
||||
import {
|
||||
Body,
|
||||
Controller,
|
||||
Delete,
|
||||
Get,
|
||||
Param,
|
||||
Post,
|
||||
Put,
|
||||
} from '@nestjs/common';
|
||||
import { ApiOperation, ApiSecurity, ApiTags } from '@nestjs/swagger';
|
||||
|
||||
import { SessionManager } from '../core/abc/manager.abc';
|
||||
import { WhatsappSession } from '../core/abc/session.abc';
|
||||
import { MessageContactVcardRequest } from '../structures/chatting.dto';
|
||||
import {
|
||||
CreateGroupRequest,
|
||||
DescriptionRequest,
|
||||
ParticipantsRequest,
|
||||
SettingsSecurityChangeInfo,
|
||||
SubjectRequest,
|
||||
} from '../structures/groups.dto';
|
||||
import { SessionApiParam, SessionParam } from './helpers';
|
||||
|
||||
@ApiSecurity('api_key')
|
||||
@Controller('api/:session/groups')
|
||||
@ApiTags('groups')
|
||||
export class GroupsController {
|
||||
constructor(private manager: SessionManager) {}
|
||||
|
||||
@Post('')
|
||||
@SessionApiParam
|
||||
@ApiOperation({ summary: 'Create a new group.' })
|
||||
createGroup(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Body() request: CreateGroupRequest,
|
||||
) {
|
||||
return session.createGroup(request);
|
||||
}
|
||||
|
||||
@Get('')
|
||||
@SessionApiParam
|
||||
@ApiOperation({ summary: 'Get all groups.' })
|
||||
getGroups(@SessionParam session: WhatsappSession) {
|
||||
return session.getGroups();
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
@SessionApiParam
|
||||
@ApiOperation({ summary: 'Get the group.' })
|
||||
getGroup(@SessionParam session: WhatsappSession, @Param('id') id: string) {
|
||||
return session.getGroup(id);
|
||||
}
|
||||
|
||||
@Put(':id/settings/security/info-admin-only')
|
||||
@SessionApiParam
|
||||
@ApiOperation({
|
||||
summary:
|
||||
'Updates the group settings to only allow admins to edit group info (title, description, photo).',
|
||||
})
|
||||
setInfoAdminOnly(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Param('id') id: string,
|
||||
@Body() request: SettingsSecurityChangeInfo,
|
||||
) {
|
||||
return session.setInfoAdminsOnly(id, request.adminsOnly);
|
||||
}
|
||||
|
||||
@Get(':id/settings/security/info-admin-only')
|
||||
@SessionApiParam
|
||||
@ApiOperation({
|
||||
summary:
|
||||
'Gets the group settings to only allow admins to edit group info (title, description, photo).',
|
||||
})
|
||||
getInfoAdminOnly(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Param('id') id: string,
|
||||
): Promise<SettingsSecurityChangeInfo> {
|
||||
return session.getInfoAdminsOnly(id);
|
||||
}
|
||||
|
||||
@Put(':id/settings/security/messages-admin-only')
|
||||
@SessionApiParam
|
||||
@ApiOperation({
|
||||
summary:
|
||||
'Updates the group settings to only allow admins to send messages.',
|
||||
})
|
||||
setMessagesAdminOnly(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Param('id') id: string,
|
||||
@Body() request: SettingsSecurityChangeInfo,
|
||||
) {
|
||||
return session.setMessagesAdminsOnly(id, request.adminsOnly);
|
||||
}
|
||||
|
||||
@Get(':id/settings/security/messages-admin-only')
|
||||
@SessionApiParam
|
||||
@ApiOperation({
|
||||
summary: 'Gets the group settings to only allow admins to send messages.',
|
||||
})
|
||||
getMessagesAdminOnly(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Param('id') id: string,
|
||||
): Promise<SettingsSecurityChangeInfo> {
|
||||
return session.getMessagesAdminsOnly(id);
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
@SessionApiParam
|
||||
@ApiOperation({ summary: 'Delete the group.' })
|
||||
deleteGroup(@SessionParam session: WhatsappSession, @Param('id') id: string) {
|
||||
return session.deleteGroup(id);
|
||||
}
|
||||
|
||||
@Post(':id/leave')
|
||||
@SessionApiParam
|
||||
@ApiOperation({ summary: 'Leave the group.' })
|
||||
leaveGroup(@SessionParam session: WhatsappSession, @Param('id') id: string) {
|
||||
return session.leaveGroup(id);
|
||||
}
|
||||
|
||||
@Put(':id/description')
|
||||
@ApiOperation({
|
||||
summary:
|
||||
'Updates the group description.\n' +
|
||||
'Returns true if the subject was properly updated. This can return false if the user does not have the necessary permissions.\n',
|
||||
})
|
||||
@SessionApiParam
|
||||
setDescription(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Param('id') id: string,
|
||||
@Body() request: DescriptionRequest,
|
||||
) {
|
||||
return session.setDescription(id, request.description);
|
||||
}
|
||||
|
||||
@Put(':id/subject')
|
||||
@SessionApiParam
|
||||
@ApiOperation({
|
||||
summary:
|
||||
'Updates the group subject.\n' +
|
||||
'Returns true if the subject was properly updated. This can return false if the user does not have the necessary permissions.\n',
|
||||
})
|
||||
setSubject(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Param('id') id: string,
|
||||
@Body() request: SubjectRequest,
|
||||
) {
|
||||
return session.setSubject(id, request.subject);
|
||||
}
|
||||
|
||||
@Get(':id/invite-code')
|
||||
@SessionApiParam
|
||||
@ApiOperation({ summary: 'Gets the invite code for a specific group.' })
|
||||
getInviteCode(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Param('id') id: string,
|
||||
): Promise<string> {
|
||||
return session.getInviteCode(id);
|
||||
}
|
||||
|
||||
@Post(':id/invite-code/revoke')
|
||||
@SessionApiParam
|
||||
@ApiOperation({
|
||||
summary:
|
||||
'Invalidates the current group invite code and generates a new one.',
|
||||
})
|
||||
revokeInviteCode(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Param('id') id: string,
|
||||
): Promise<string> {
|
||||
return session.revokeInviteCode(id);
|
||||
}
|
||||
|
||||
@Get(':id/participants/')
|
||||
@SessionApiParam
|
||||
@ApiOperation({ summary: 'Get a list of participants by in the group.' })
|
||||
getParticipants(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Param('id') id: string,
|
||||
) {
|
||||
return session.getParticipants(id);
|
||||
}
|
||||
|
||||
@Post(':id/participants/add')
|
||||
@SessionApiParam
|
||||
@ApiOperation({ summary: 'Adds a list of participants by ID to the group.' })
|
||||
addParticipants(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Param('id') id: string,
|
||||
@Body() request: ParticipantsRequest,
|
||||
) {
|
||||
return session.addParticipants(id, request);
|
||||
}
|
||||
|
||||
@Post(':id/participants/remove')
|
||||
@SessionApiParam
|
||||
@ApiOperation({
|
||||
summary: 'Removes a list of participants by ID to the group.',
|
||||
})
|
||||
removeParticipants(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Param('id') id: string,
|
||||
@Body() request: ParticipantsRequest,
|
||||
) {
|
||||
return session.removeParticipants(id, request);
|
||||
}
|
||||
|
||||
@Post(':id/admin/promote')
|
||||
@SessionApiParam
|
||||
@ApiOperation({ summary: 'Promote participants to admin users.' })
|
||||
promoteToAdmin(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Param('id') id: string,
|
||||
@Body() request: ParticipantsRequest,
|
||||
) {
|
||||
return session.promoteParticipantsToAdmin(id, request);
|
||||
}
|
||||
|
||||
@Post(':id/admin/demote')
|
||||
@SessionApiParam
|
||||
@ApiOperation({ summary: 'Demotes participants by to regular users.' })
|
||||
demoteToAdmin(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Param('id') id: string,
|
||||
@Body() request: ParticipantsRequest,
|
||||
) {
|
||||
return session.demoteParticipantsToUser(id, request);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { Controller, Get } from '@nestjs/common';
|
||||
import { ApiTags } from '@nestjs/swagger';
|
||||
import { HealthCheck } from '@nestjs/terminus';
|
||||
|
||||
import { WAHAHealthCheckService } from '../core/abc/WAHAHealthCheckService';
|
||||
|
||||
@Controller('health')
|
||||
@ApiTags('other')
|
||||
export class HealthController {
|
||||
constructor(private wahaHealth: WAHAHealthCheckService) {}
|
||||
|
||||
@Get()
|
||||
@HealthCheck()
|
||||
async check() {
|
||||
return this.wahaHealth.check();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
import {
|
||||
applyDecorators,
|
||||
Injectable,
|
||||
Param,
|
||||
PipeTransform,
|
||||
} from '@nestjs/common';
|
||||
import {
|
||||
ApiExtraModels,
|
||||
ApiParam,
|
||||
ApiResponse,
|
||||
getSchemaPath,
|
||||
} from '@nestjs/swagger';
|
||||
|
||||
import { SessionManager } from '../core/abc/manager.abc';
|
||||
import { WhatsappSession } from '../core/abc/session.abc';
|
||||
import { Base64File } from '../structures/files.dto';
|
||||
|
||||
/**
|
||||
* Get session name and return Whatsapp session back (if exists)
|
||||
* use it as
|
||||
@Param('session', SessionPipe) session: WhatsappSession,
|
||||
*/
|
||||
@Injectable()
|
||||
export class SessionPipe implements PipeTransform<WhatsappSession> {
|
||||
constructor(private manager: SessionManager) {}
|
||||
|
||||
async transform(value: any) {
|
||||
return this.manager.getSession(value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Decorator for a method that uses SessionPipe above
|
||||
*/
|
||||
export const SessionApiParam = ApiParam({
|
||||
name: 'session',
|
||||
required: true,
|
||||
type: 'string',
|
||||
schema: {
|
||||
default: 'default',
|
||||
},
|
||||
description: 'WhatsApp session name',
|
||||
});
|
||||
|
||||
/**
|
||||
* Session param
|
||||
@SessionParam session: WhatsappSession,
|
||||
*/
|
||||
export const SessionParam = Param('session', SessionPipe);
|
||||
|
||||
function getRefSchemaPaths(models) {
|
||||
return models.map((model) => {
|
||||
return { $ref: getSchemaPath(model) };
|
||||
});
|
||||
}
|
||||
|
||||
export function ApiFileAcceptHeader(...models) {
|
||||
models = models.length ? models : [Base64File];
|
||||
return applyDecorators(
|
||||
// Add extra models, otherwise it'll give a error
|
||||
// $ref not found
|
||||
ApiExtraModels(...models),
|
||||
ApiResponse({
|
||||
status: 200,
|
||||
content: {
|
||||
'image/png': {
|
||||
schema: {
|
||||
type: 'string',
|
||||
format: 'binary',
|
||||
},
|
||||
},
|
||||
'application/json': {
|
||||
schema: {
|
||||
oneOf: getRefSchemaPaths(models),
|
||||
},
|
||||
},
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
import {
|
||||
BadRequestException,
|
||||
Body,
|
||||
Controller,
|
||||
Get,
|
||||
Param,
|
||||
Post,
|
||||
} from '@nestjs/common';
|
||||
import { ApiOperation, ApiSecurity, ApiTags } from '@nestjs/swagger';
|
||||
|
||||
import { SessionManager } from '../core/abc/manager.abc';
|
||||
import { WhatsappSession } from '../core/abc/session.abc';
|
||||
import { WAHAPresenceStatus } from '../structures/enums.dto';
|
||||
import {
|
||||
WAHAChatPresences,
|
||||
WAHASessionPresence,
|
||||
} from '../structures/presence.dto';
|
||||
import { SessionApiParam, SessionParam } from './helpers';
|
||||
|
||||
@ApiSecurity('api_key')
|
||||
@Controller('api/:session/presence')
|
||||
@ApiTags('presence')
|
||||
export class PresenceController {
|
||||
constructor(private manager: SessionManager) {}
|
||||
|
||||
@Post('')
|
||||
@SessionApiParam
|
||||
@ApiOperation({ summary: 'Set session presence' })
|
||||
setPresence(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Body() request: WAHASessionPresence,
|
||||
) {
|
||||
// Validate request
|
||||
const presencesWithoutChatId = [
|
||||
WAHAPresenceStatus.ONLINE,
|
||||
WAHAPresenceStatus.OFFLINE,
|
||||
];
|
||||
const requiresNoChatId = presencesWithoutChatId.includes(request.presence);
|
||||
const requiresChatId = !requiresNoChatId;
|
||||
|
||||
if (requiresNoChatId && request.chatId) {
|
||||
const msg = {
|
||||
detail: `'${request.presence}' presence works on the global scope and doesn't require 'chatId' field.`,
|
||||
};
|
||||
throw new BadRequestException(msg);
|
||||
} else if (requiresChatId && !request.chatId) {
|
||||
const msg = {
|
||||
detail: `'${request.presence}' presence requires 'chatId' field.`,
|
||||
};
|
||||
throw new BadRequestException(msg);
|
||||
}
|
||||
|
||||
return session.setPresence(request.presence, request.chatId);
|
||||
}
|
||||
|
||||
@Get('')
|
||||
@SessionApiParam
|
||||
@ApiOperation({ summary: 'Get all subscribed presence information.' })
|
||||
getPresenceAll(
|
||||
@SessionParam session: WhatsappSession,
|
||||
): Promise<WAHAChatPresences[]> {
|
||||
return session.getPresences();
|
||||
}
|
||||
|
||||
@Get(':chatId')
|
||||
@SessionApiParam
|
||||
@ApiOperation({
|
||||
summary:
|
||||
"Get the presence for the chat id. If it hasn't been subscribed - it also subscribes to it.",
|
||||
})
|
||||
getPresence(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Param('chatId') chatId: string,
|
||||
): Promise<WAHAChatPresences> {
|
||||
return session.getPresence(chatId);
|
||||
}
|
||||
|
||||
@Post(':chatId/subscribe')
|
||||
@SessionApiParam
|
||||
@ApiOperation({
|
||||
summary: 'Subscribe to presence events for the chat.',
|
||||
})
|
||||
subscribe(
|
||||
@SessionParam session: WhatsappSession,
|
||||
@Param('chatId') chatId: string,
|
||||
): Promise<void> {
|
||||
return session.subscribePresence(chatId);
|
||||
}
|
||||
}
|
||||
@@ -1,34 +1,33 @@
|
||||
import {Controller, Get, Query, Res} from '@nestjs/common';
|
||||
import {ApiSecurity, ApiTags} from "@nestjs/swagger";
|
||||
import {Readable} from "stream";
|
||||
import {Response} from 'express';
|
||||
import {SessionManager} from "../core/abc/manager.abc";
|
||||
import {SessionQuery} from "../structures/base.dto";
|
||||
import {
|
||||
Controller,
|
||||
Get,
|
||||
Query,
|
||||
Res,
|
||||
StreamableFile,
|
||||
UseInterceptors,
|
||||
} from '@nestjs/common';
|
||||
import { ApiSecurity, ApiTags } from '@nestjs/swagger';
|
||||
import { Response } from 'express';
|
||||
|
||||
import { SessionManager } from '../core/abc/manager.abc';
|
||||
import { SessionQuery } from '../structures/base.dto';
|
||||
import { BufferResponseInterceptor } from './BufferResponseInterceptor';
|
||||
import { ApiFileAcceptHeader } from './helpers';
|
||||
|
||||
@ApiSecurity('api_key')
|
||||
@Controller('api')
|
||||
@ApiTags('screenshot')
|
||||
export class ScreenshotController {
|
||||
constructor(private manager: SessionManager) {
|
||||
}
|
||||
constructor(private manager: SessionManager) {}
|
||||
|
||||
@Get('/screenshot')
|
||||
async screenshot(
|
||||
@Res() res: Response,
|
||||
@Query() sessionQuery: SessionQuery,
|
||||
) {
|
||||
const whatsappService = this.manager.getSession(sessionQuery.session)
|
||||
const buffer = await whatsappService.getScreenshot();
|
||||
const stream = new Readable();
|
||||
stream.push(buffer);
|
||||
stream.push(null);
|
||||
|
||||
res.set({
|
||||
'Content-Type': 'image/png',
|
||||
'Content-Length': buffer.length,
|
||||
});
|
||||
stream.pipe(res)
|
||||
}
|
||||
@Get('/screenshot')
|
||||
@UseInterceptors(new BufferResponseInterceptor())
|
||||
@ApiFileAcceptHeader()
|
||||
async screenshot(
|
||||
@Res({ passthrough: true }) res: Response,
|
||||
@Query() sessionQuery: SessionQuery,
|
||||
) {
|
||||
const whatsappService = this.manager.getSession(sessionQuery.session);
|
||||
return await whatsappService.getScreenshot();
|
||||
}
|
||||
}
|
||||
|
||||