Compare commits

...
662 Commits
Author SHA1 Message Date
devlikepro 27a86f0dc1 [core] waha
Release / amd64 - chrome - chrome (push) Waiting to run
Release / amd64 - chromium - latest (push) Waiting to run
Release / linux/arm64 - chromium - arm (push) Waiting to run
Release / amd64 - none - noweb (push) Waiting to run
Release / linux/arm64 - none - noweb-arm (push) Waiting to run
2024-06-04 12:55:58 +07:00
devlikepro 767ea23173 [core] bump 2024.6.2 2024-06-04 12:54:24 +07:00
devlikepro 85707508ed [core] waha 2024-06-04 12:54:03 +07:00
devlikepro e8bc59ff9e [core] Bump to 2024.6.1 2024-06-02 10:25:03 +07:00
devlikepro 7f9e622a64 [core] push version tags 2024-06-02 10:06:49 +07:00
devlikepro b22e37596b Revert "[core] Don't push each version"
This reverts commit 0e295bebde.
2024-06-02 10:04:12 +07:00
devlikepro 642e90b1c8 [core] poll response fix
fix #356
2024-06-02 10:01:40 +07:00
devlikepro 8402ab896a [core] Fix ack for status@broadcast
Release / amd64 - chrome - chrome (push) Waiting to run
Release / amd64 - chromium - latest (push) Waiting to run
Release / linux/arm64 - chromium - arm (push) Waiting to run
Release / amd64 - none - noweb (push) Waiting to run
Release / linux/arm64 - none - noweb-arm (push) Waiting to run
fix #329
2024-06-01 16:16:19 +07:00
devlikepro d6dc7edf66 [core] WEBJS enable io from chrome if debug enabled 2024-05-31 18:16:34 +07:00
devlikepro 8f6dbf70f7 [core] WEBJS auto restart on FAILED
fix #355
2024-05-31 18:16:34 +07:00
devlikepro bd14d9a71e [core] 2024.5.14 2024-05-31 13:32:57 +07:00
devlikepro 61a0a38dd2 [core] Restart NOWEB every 30 minutes 2024-05-31 12:50:38 +07:00
devlikepro 102f438a99 [core] NOWEB fix for creds.json
fix #347
2024-05-31 12:18:11 +07:00
devlikepro 586a2d1c79 [core] rm import 2024-05-31 11:54:49 +07:00
devlikepro 5b04c39107 [core] move get default engine to EngineConfigService.ts 2024-05-31 11:54:49 +07:00
devlikepro d96e91ea70 [core] Better logging 2024-05-31 11:54:49 +07:00
devlikepro 68ac209aae [core] 2024.5.13
Release / amd64 - chrome - chrome (push) Waiting to run
Release / amd64 - chromium - latest (push) Waiting to run
Release / linux/arm64 - chromium - arm (push) Waiting to run
Release / amd64 - none - noweb (push) Waiting to run
Release / linux/arm64 - none - noweb-arm (push) Waiting to run
2024-05-30 13:21:34 +07:00
devlikepro 90b961f900 [core] Disable QR in console
Fix #351
2024-05-30 13:21:33 +07:00
devlikepro 9945fe0fd8 [core] Remove unused vars 2024-05-30 13:21:33 +07:00
devlikepro 1346ce0472 [core] Add tests jest
Release / amd64 - chrome - chrome (push) Waiting to run
Release / amd64 - chromium - latest (push) Waiting to run
Release / linux/arm64 - chromium - arm (push) Waiting to run
Release / amd64 - none - noweb (push) Waiting to run
Release / linux/arm64 - none - noweb-arm (push) Waiting to run
2024-05-27 18:45:51 +07:00
devlikepro e914aaa961 [core] log 2024-05-27 17:19:44 +07:00
devlikepro 70e17250e8 [core] 2024.5.12 2024-05-27 17:19:44 +07:00
devlikepro 8c134904ba [core] log unhandled rejections 2024-05-27 17:19:44 +07:00
devlikepro bfa4b14c13 logo.png 2024-05-27 10:12:17 +07:00
devlikepro 36c7820d78 logo.svg 2024-05-27 10:08:38 +07:00
devlikepro 92e6530d3e [docs] rm docs 2024-05-27 10:08:29 +07:00
devlikepro 9e47af301e [docs] Reformat changelog.md 2024-05-24 14:52:19 +07:00
devlikepro b59eb57dce [core] fix dockerfile 2024-05-24 14:43:26 +07:00
devlikepro 158a557867 [core] 2024.5.11 2024-05-24 14:33:00 +07:00
devlikepro 5a95e9b1ee [core] Pin node 20.12.2 2024-05-24 14:31:30 +07:00
devlikepro 98d3ca31d7 [core] Set 16GB node memory 2024-05-24 14:29:52 +07:00
devlikepro 52bd5e7ae6 [docs] Add caption 2024-05-24 10:46:56 +07:00
devlikepro b883f0c9ef [docs] caption fix 2024-05-24 10:41:14 +07:00
devlikepro e61b808c3c [core] 2024.5.10 2024-05-24 10:41:14 +07:00
devlikepro 7bc049de68 [core] Detect document with caption, add caption
fix #345
2024-05-24 10:41:14 +07:00
devlikepro de3f859d98 [docs] Fix menu, add contact 2024-05-23 16:40:59 +07:00
devlikepro ea06277649 [docs] Sort it by weight 2024-05-22 18:42:05 +07:00
devlikepro 9a6bd67e43 [docs] Sort it by weight 2024-05-22 18:22:01 +07:00
devlikepro 01baee5cf2 [docs] Sort it by weight 2024-05-22 18:18:47 +07:00
devlikepro bc855bc089 [docs] Hide the list of docs 2024-05-22 18:07:25 +07:00
devlikepro 4bf1210651 [docs] Hide the list of docs 2024-05-22 18:06:24 +07:00
devlikepro a4f4398765 [docs] wide cards 2024-05-22 18:00:43 +07:00
devlikepro 0f343841a6 [core] bump to 2024.5.9 2024-05-22 16:00:20 +07:00
devlikepro 41d26799b2 [core] videofix 2024-05-22 16:00:20 +07:00
devlikepro a807d7647b [core] Ignore plus engine 2024-05-22 16:00:19 +07:00
devlikepro 7bcd2a6206 [core] WEBJS videofix 2024-05-22 16:00:19 +07:00
devlikepro a3c2c1bb22 [core] run :chrome in plus 2024-05-22 16:00:19 +07:00
devlikepro 355e47ec11 [core] pin exact Chrome version 2024-05-22 16:00:19 +07:00
devlikepro a01bee8330 [core] NOWEB update 2024-05-21 10:42:36 +07:00
devlikepro c4c020aaa6 [core] status show on mobile 2024-05-21 10:39:59 +07:00
devlikepro 35e92bebbd [core] Bump version to 2024.5.8
Release / amd64 - chrome - chrome (push) Waiting to run
Release / amd64 - chromium - latest (push) Waiting to run
Release / linux/arm64 - chromium - arm (push) Waiting to run
Release / amd64 - none - noweb (push) Waiting to run
Release / linux/arm64 - none - noweb-arm (push) Waiting to run
2024-05-21 08:46:58 +07:00
devlikepro 2bd3e9f556 [core] Update NOWEB engine 2024-05-21 08:46:49 +07:00
devlikepro 60705d1558 [core] Crypto offer 2024-05-20 19:35:10 +07:00
devlikepro 2cbd08c470 [core] Crypto offer 2024-05-20 19:33:44 +07:00
devlikepro 51a501611d [docs] Compare 2024-05-20 15:32:37 +07:00
devlikepro 46bcfb5695 [docs] Live Helper Chat 2024-05-20 14:12:13 +07:00
devlikepro e44bd55df2 [core] geonode 2024-05-18 15:19:32 +07:00
devlikepro efaa090053 [core] geonode 2024-05-18 15:14:15 +07:00
devlikepro 8be13fbc5c [core] Proxy 2024-05-18 14:37:10 +07:00
devlikepro e0a1be1417 [core] Bump to 2024.5.7 2024-05-14 10:13:37 +07:00
devlikepro 7f841f6862 [core] Revert back video fix 2024-05-14 10:13:35 +07:00
devlikepro d1804996d7 [core] Fix send video
Fix #321 #328
2024-05-12 10:47:09 +07:00
devlikepro 34084a7ee8 [docs] Fix pricing 2024-05-12 10:11:00 +07:00
devlikepro fedde8bb87 [docs] 💅 2024-05-10 19:44:11 +07:00
devlikepro 7439e80eec [docs] note 2024-05-10 19:29:34 +07:00
devlikepro e388f361af [docs] note 2024-05-10 19:27:46 +07:00
devlikepro 2a9ed6bac7 [docs] WAHA 2024-05-10 19:25:59 +07:00
devlikepro 5936a86159 [core] Rm line 2024-05-10 18:50:12 +07:00
devlikepro 3b22911fb1 [core] Update NOWEB engine 2024-05-10 18:50:12 +07:00
devlikepro 0dd3762685 [core] Bump version to 2024.5.5 2024-05-10 18:50:12 +07:00
devlikepro fd9106e97e [core] /pricing 2024-05-10 18:50:06 +07:00
devlikepro 5a3d709e4f [core] up year 2024-05-10 18:50:06 +07:00
allburov c0c357dc39 [docs] Adjust header 2024-05-08 18:06:57 +07:00
allburov e76bec3d4f [docs] Fix patreon link 2024-05-08 15:03:18 +07:00
allburov 384b3974f7 [docs] Pricing 2024-05-08 15:02:39 +07:00
allburov 3c37044cd8 [docs] index 2024-05-08 15:00:32 +07:00
allburov 541112a9eb [docs] index 2024-05-08 14:54:55 +07:00
allburov 59d7613485 [docs] badges 2024-05-08 14:52:35 +07:00
allburov d1a579372d [docs] reorder text
Release / amd64 - chrome - chrome (push) Waiting to run
Release / amd64 - chromium - latest (push) Waiting to run
Release / linux/arm64 - chromium - arm (push) Waiting to run
Release / amd64 - none - noweb (push) Waiting to run
Release / linux/arm64 - none - noweb-arm (push) Waiting to run
2024-05-08 11:20:57 +07:00
allburov 16cd247db8 [docs] Up swagger 2024-05-08 11:13:04 +07:00
allburov 872d6d9880 [docs] white label 2024-05-08 11:12:35 +07:00
allburov 79fe322d69 [docs] dashboard 2024-05-08 10:45:11 +07:00
allburov fe6f1cb547 [docs] dashboard video 2024-05-08 10:35:18 +07:00
allburov 8d7fcd0b84 [docs] dashboard video 2024-05-08 10:32:40 +07:00
allburov 46b0c3cee2 [docs] related links 2024-05-08 10:31:58 +07:00
allburov 1ad9c3017c [core] Swagger video 2024-05-08 10:20:46 +07:00
allburov 5d320fa22f [core] /videos 2024-05-08 10:13:40 +07:00
allburov 5e1d9b6463 [core] Add swagger page 2024-05-08 10:01:11 +07:00
allburov 175dfde0b8 [core] Adjust import 2024-05-07 19:20:58 +07:00
allburov 87717ae214 [core] Refactor SwaggerConfiguratorCore.ts 2024-05-07 19:18:47 +07:00
allburov 111c8f3160 [core] Adjust SwaggerConfiguratorCore.ts 2024-05-07 19:18:47 +07:00
allburov 6c756352cf [core] Add Dashboard config 2024-05-07 18:37:43 +07:00
allburov 97a5d11c1f [core] Add SwaggerConfigServiceCore 2024-05-07 18:36:54 +07:00
allburov 44415d824e [core] Detect boolean type 2024-05-07 18:34:36 +07:00
allburov 286e8f3afe [core] REST API 2024-05-07 17:04:46 +07:00
allburov 4c2e3db2d5 [core] No WAHA in text 2024-05-07 16:59:42 +07:00
allburov 6faf699fcc [docs] Changelog 2024-05-07 12:36:56 +07:00
allburov 80b765e56a [core] Bump version to 2024.5.3 2024-05-07 12:34:17 +07:00
allburov 3f9ebe5c8c [core] Use local cache, fix 2.2412.54 version
fix #316
2024-05-07 12:30:24 +07:00
allburov 481371fd03 [docs] Add Dashboard Overview 2024-05-06 12:45:03 +07:00
allburov 36c2165fc3 [docs] Add docs link 2024-05-06 11:31:55 +07:00
allburov 36402626e0 [docs] Add #315 to changelog 2024-05-06 10:55:13 +07:00
allburov 40c39e61e1 [docs] disclaimer 2024-05-06 10:51:03 +07:00
allburov 4e1b13e776 [docs] Feature first 2024-05-06 10:48:33 +07:00
allburov 7f355ff43a [docs] default password in docker-compose 2024-05-06 09:54:48 +07:00
allburov 22df449013 [docs] speacker 2024-05-04 12:34:17 +07:00
allburov 68303f5124 [docs] Add note about QR event
Fix #314
2024-05-04 12:32:54 +07:00
allburov 33babfef6b [docs] no soon 2024-05-04 12:25:52 +07:00
allburov 910a9185c7 [core] Bump to 2024.5.3 2024-05-04 12:24:58 +07:00
allburov f5bd74dfa1 [core] Prevent starting two sessions with the same name #314 2024-05-04 12:24:58 +07:00
allburov b982640c85 [docs] Dashboard changelog 2024-05-04 10:50:19 +07:00
allburov 245bcc46ed [docs] waha hub 2024-05-04 09:32:52 +07:00
allburov 08a346bfa1 [docs] index 2024-05-04 09:30:51 +07:00
allburov 0cb4dd6d63 [docs] Edit page 2024-05-04 09:25:10 +07:00
allburov 1a7a78cc51 [docs] dashboard 2024-05-04 09:22:59 +07:00
allburov 9b69875b78 [docs] dashboard 2024-05-04 09:22:33 +07:00
allburov 999ae4782b [docs] index 2024-05-04 09:21:07 +07:00
allburov 3c61ca8c94 [docs] No dark mode 2024-05-04 09:21:02 +07:00
allburov 0790e0a0ef [docs] Dashboard 2024-05-04 09:19:01 +07:00
allburov 0a2d77b699 [docs] Fix weigth 2024-05-04 09:17:17 +07:00
allburov 051ada3f21 [docs] index open in new tab 2024-05-03 18:19:17 +07:00
allburov faf8d053dd [docs] Index
Release / amd64 - chrome - chrome (push) Waiting to run
Release / amd64 - chromium - latest (push) Waiting to run
Release / linux/arm64 - chromium - arm (push) Waiting to run
Release / amd64 - none - noweb (push) Waiting to run
Release / linux/arm64 - none - noweb-arm (push) Waiting to run
2024-05-03 18:00:12 +07:00
allburov 5ece56f9b0 [docs] Add WAHA Dashboard, Hub 2024-05-03 17:44:37 +07:00
allburov c4d9474f34 [docs] update swagger 2024-05-03 16:37:55 +07:00
allburov 3b8481ccac [docs] Dashboard stub 2024-05-03 16:33:41 +07:00
allburov a31d0215f5 [core] Correct plus docker-compose.yaml 2024-05-03 16:31:25 +07:00
allburov f6cce68553 [core] Bump version 2024.5.2 2024-05-03 16:31:25 +07:00
allburov 636b100b9f [core] Bump version to 2024.5.1 2024-05-03 11:56:29 +07:00
allburov 7a3574eaa0 [core] Update WEBJS version 2024-05-03 11:56:29 +07:00
allburov 9cd6176e60 [core] Change default password to waha/waha 2024-05-03 11:56:29 +07:00
allburov f2641029cb [core] nest cli 2024-05-02 14:39:18 +07:00
allburov 6350e191f8 [core] Ignore dashboard 2024-05-02 14:38:54 +07:00
allburov c570ba3488 [core] Correct dashboard 2024-05-02 12:05:22 +07:00
allburov b64abd24c8 [core] Configure dashboard right 2024-05-02 12:03:46 +07:00
allburov 13c9ab3962 [core] Adjust dashboard stub 2024-05-02 12:03:46 +07:00
allburov b9f1c6ee79 [core] Adjust swagger 2024-05-02 12:03:46 +07:00
allburov 938170a957 [core] Add Dashboard 2024-05-02 12:03:46 +07:00
allburov ca0a28c0cf [core] Logout if logout is true 2024-05-02 09:42:25 +07:00
allburov c3967173a1 [core] Enable cors 2024-04-28 17:35:52 +07:00
allburov 9ebbd9a1fd [docs] no MOBILE yet 2024-04-23 11:03:39 +07:00
allburov 16e343ca19 [docs] Labels 2024-04-21 18:54:55 +07:00
allburov 1de9132f16 [core] Remove ignore 2024-04-21 18:49:53 +07:00
allburov dad54a8e47 [core] Pin WEBJS version to 2.2412.54 2024-04-21 17:30:16 +07:00
allburov 7d73b96b78 [core] Fix send voice 2024-04-21 17:08:08 +07:00
allburov 1260fe34aa [core] Bump version to 2024.4.4 2024-04-21 16:35:43 +07:00
allburov 3b4678e059 [core] Add GET /api/sessions/{session} endpoint 2024-04-21 16:35:28 +07:00
allburov ff8294b5db [core] Add patron portal link 2024-04-21 16:14:54 +07:00
allburov 7e94e19f5d [core] NOWEB - add GET /api/contacts/profile-picture 2024-04-21 16:14:54 +07:00
allburov ae18e2575a [docs] Add tier 2024-04-21 16:01:35 +07:00
allburov a5c493a29c [docs] Add tier 2024-04-17 13:45:14 +07:00
allburov 8ee89fe51c [docs] pro tier 2024-04-15 09:21:46 +07:00
allburov b4909847bf [docs] link 2024-04-15 09:16:32 +07:00
allburov 568be88127 [docs] tiers
Release / amd64 - chrome - chrome (push) Waiting to run
Release / amd64 - chromium - latest (push) Waiting to run
Release / linux/arm64 - chromium - arm (push) Waiting to run
Release / amd64 - none - noweb (push) Waiting to run
Release / linux/arm64 - none - noweb-arm (push) Waiting to run
2024-04-14 19:15:59 +07:00
allburov 67144c1d08 [docs] 2024-04-14 18:56:20 +07:00
allburov 285c78d41a [docs] no row 2024-04-14 18:50:26 +07:00
allburov 7d15735444 [docs] discord 2024-04-14 18:18:05 +07:00
allburov 4191749564 [docs] Crypto 2024-04-12 21:34:44 +07:00
allburov 9e68dbbf09 [docs] No advanced 2024-04-12 13:36:53 +07:00
allburov f02ad5b051 [docs] Add http requests in index 2024-04-09 17:30:55 +07:00
allburov 08e20a25ed [core] Bump version to 2024.4.3 2024-04-09 11:45:44 +07:00
allburov ee0468038d [core] Update puppetter 2024-04-09 11:45:44 +07:00
allburov 04afc297d9 [core] Update WEBJS 2024-04-09 11:45:43 +07:00
allburov ed06ca76e0 [core] Bump to 2024.4.2 2024-04-08 18:17:04 +07:00
allburov a68510a814 [core] Fix NOWEB india 2024-04-08 18:16:35 +07:00
allburov 4040efab01 [docs] Alway show sidebar 2024-04-06 13:14:59 +07:00
allburov f08cc1061e [docs] Fix favicon 2024-04-06 13:01:40 +07:00
allburov 3b5b11891e [docs] Fix logo 2024-04-06 12:52:22 +07:00
allburov 72427c9309 [docs] Fix logo 2024-04-06 12:51:29 +07:00
allburov befe2068fd [docs] Fix send file example 2024-04-05 13:54:24 +07:00
allburov c7a3ef32fa [core] Add mongodb example 2024-04-02 17:42:30 +07:00
allburov 51d394f4ef [core] Bump version to 2024.4.1 2024-04-02 14:22:03 +07:00
allburov 8db341dd70 [core] Fix NOWEB engine restart 2024-04-02 14:22:02 +07:00
allburov 5cd7fec3ab [docs] Add what can it do 2024-04-01 16:06:08 +07:00
allburov f672ecbb45 [docs] try it now 2024-04-01 13:33:20 +07:00
allburov 9a12b2c9b6 [docs] Add prices at the top 2024-04-01 10:12:27 +07:00
allburov c31407fd87 [docs] add caption 2024-04-01 10:03:25 +07:00
allburov 646c81f136 [docs] message.reactions 2024-04-01 09:44:01 +07:00
allburov aca6232d2a [docs] changelog 2024-04-01 09:37:14 +07:00
allburov c61da10523 [core] Pin Web version
Release / amd64 - chrome - chrome (push) Waiting to run
Release / amd64 - chromium - latest (push) Waiting to run
Release / linux/arm64 - chromium - arm (push) Waiting to run
Release / amd64 - none - noweb (push) Waiting to run
Release / linux/arm64 - none - noweb-arm (push) Waiting to run
2024-04-01 09:31:08 +07:00
allburov 1f53d65ac2 [docs] fix card in article 2024-03-31 18:43:31 +07:00
allburov 844ab1287e [docs] fix links 2024-03-31 18:39:39 +07:00
allburov d6d318b23b [docs] Are you a visual 2024-03-31 16:04:26 +07:00
allburov 7504ffd934 [docs] quick start second 2024-03-31 16:00:06 +07:00
allburov e8078908c9 [docs] http api 2024-03-31 15:56:37 +07:00
allburov 431848280f [docs] Fix debug 2024-03-29 16:06:31 +07:00
allburov 2e0c575512 [core] Bump version to 2024.3.14 2024-03-29 15:57:15 +07:00
allburov ebf0d99417 [core] Add "debug" flag to session config 2024-03-29 15:56:50 +07:00
allburov 423d893fee [docs] No hover 2024-03-29 14:37:21 +07:00
allburov 56fe0d3b04 [docs] Limit 2024-03-29 14:22:36 +07:00
allburov 7172d9d203 [docs] Green icons 2024-03-29 14:21:20 +07:00
allburov bd770a6902 [docs] Fix index 2024-03-29 14:06:56 +07:00
allburov 628508faed [docs] ktor 2024-03-29 13:55:27 +07:00
allburov 826634f061 [docs] Add js, php for future 2024-03-29 13:37:23 +07:00
allburov c7ed959a71 [docs] Add kotlin 2024-03-29 13:32:15 +07:00
allburov aea6befc1e [docs] Add NOWEB feedback 2024-03-29 10:08:30 +07:00
allburov 7bb3484788 [docs] Add python example 2024-03-28 08:51:38 +07:00
allburov 4eafc67a7e [core] Bump 2024.3.13 2024-03-27 17:09:29 +07:00
allburov b5197b6f20 [core] log page logs 2024-03-27 17:09:29 +07:00
allburov d306304195 [core] One line log 2024-03-27 17:09:29 +07:00
allburov 35f47dae4f [docs] Boosty instead of Patreon 2024-03-27 13:52:00 +07:00
allburov f1be4810d5 [core] Bump to 2024.3.12 2024-03-27 13:27:39 +07:00
allburov d4f9406869 [core] Update NOWEB 2024-03-27 13:27:36 +07:00
allburov a41b81d724 [docs] Add funding 2024-03-26 16:54:09 +07:00
allburov da56b86102 [docs] Boosty first 2024-03-26 16:51:58 +07:00
allburov f12d2c9be0 [docs] Add gtag 2024-03-25 11:54:21 +07:00
allburov 322b9b4c25 [docs] Correct changelog 2024-03-24 20:52:26 +07:00
allburov fb7fe410f9 [core] Bump to 2024.3.11 2024-03-24 20:43:27 +07:00
allburov ee392a079c [core] Update swagger 2024-03-24 20:43:27 +07:00
allburov 0502579d50 [core] Edit and delete messages 2024-03-24 20:43:27 +07:00
allburov f10f3175d9 [core] add new swagger 2024-03-24 18:00:36 +07:00
allburov f155af99f1 [core] Bump 2024.3.10 2024-03-24 17:58:32 +07:00
allburov 0fbf3575a6 [core] NOWEB sendVCard 2024-03-24 17:58:30 +07:00
allburov f6b9b5f54e [core] Bump to 2024.3.9 2024-03-22 18:56:54 +07:00
allburov 2dadd9d8c9 [docs] Add caption to sendfile 2024-03-22 18:56:40 +07:00
allburov 5786b3cdfe [docs] Adjust cards style 2024-03-22 10:18:26 +07:00
allburov 769fc30c0c [docs] Adjust cards style 2024-03-22 10:09:21 +07:00
allburov fb2dad9c6f [core] bump version to 2024.3.8 2024-03-22 09:47:04 +07:00
allburov c43d308a2d [core] Add star unstar
Fix #240
2024-03-22 09:46:25 +07:00
allburov 742a12ce6a [core] Fix reactions 2024-03-22 09:25:23 +07:00
allburov d953f27865 [core] Update openapi.json 2024-03-20 12:18:53 +07:00
allburov 4719cded95 [core] get engine info 2024-03-19 14:16:45 +07:00
allburov 9d489bdb69 [core] add Patron Portal 2024-03-18 18:37:20 +07:00
allburov 537c307550 [core] No mobile engine anymore 2024-03-18 18:27:11 +07:00
allburov d5575e0323 [core] Fix index 2024-03-18 18:22:38 +07:00
allburov 592962bbc8 [core] Use vars.DOCKER_IMAGE 2024-03-18 15:25:39 +07:00
allburov 7a371c86dc [core] Images 2024-03-18 15:19:20 +07:00
allburov 0e295bebde [core] Don't push each version 2024-03-18 15:06:19 +07:00
allburov 8d98759be6 Revert "[core] Update WEBJS with 2.2300 fix"
This reverts commit 924317b01b.
2024-03-18 14:56:07 +07:00
allburov 924317b01b [core] Update WEBJS with 2.2300 fix 2024-03-18 14:55:50 +07:00
allburov a08a601dc3 [core] manual push 2024-03-18 14:54:22 +07:00
allburov e652c15d6c [core] Add manual jobs 2024-03-18 14:45:57 +07:00
allburov 4534eb60de [core] Add manual jobs 2024-03-18 14:44:43 +07:00
allburov 54c6c0c24c [core] Read more about Security 2024-03-18 14:21:49 +07:00
allburov 393694ae96 [core] Rm even 2024-03-18 14:17:57 +07:00
allburov 818bb730e4 Revert "[core] fix CI"
This reverts commit 61bd35a192.
2024-03-18 14:05:54 +07:00
allburov 61bd35a192 [core] fix CI 2024-03-18 14:02:59 +07:00
allburov 81f9df000a [core] fix CI
Release / amd64 - chrome - chrome (push) Waiting to run
Release / amd64 - chromium - latest (push) Waiting to run
Release / linux/arm64 - chromium - arm (push) Waiting to run
Release / amd64 - none - noweb (push) Waiting to run
Release / linux/arm64 - none - noweb-arm (push) Waiting to run
2024-03-18 13:48:46 +07:00
allburov 0dcb31c108 [core] Bump to 2024.3.6 2024-03-18 13:46:32 +07:00
allburov cd4140fda9 [core] Add exact version (tag) 2024-03-18 13:46:30 +07:00
allburov 117cc25cdb [core] Bump version to 2024.3.5 2024-03-17 19:17:32 +07:00
allburov 832ad26151 [core] Add /messages-admin-only
fix #274
2024-03-17 19:17:14 +07:00
allburov 5a344cd8ad [core] Bump version to 2024.3.4 2024-03-15 17:45:23 +07:00
allburov 0b0a67cdad [core] Update WEBJS engine 2024-03-15 17:45:21 +07:00
allburov a326a240f0 [core] Bump version 2024.3.3 2024-03-15 15:15:13 +07:00
allburov dfdb033769 [core] Add message.reaction webhook 2024-03-15 15:14:48 +07:00
allburov a31af45d97 [core] Change code on main 2024-03-13 17:49:52 +07:00
allburov cae955c483 [core] Bump to 2024.3.2
Release / amd64 - chrome - chrome (push) Waiting to run
Release / amd64 - chromium - latest (push) Waiting to run
Release / linux/arm64 - chromium - arm (push) Waiting to run
Release / amd64 - none - noweb (push) Waiting to run
Release / linux/arm64 - none - noweb-arm (push) Waiting to run
2024-03-07 19:28:12 +07:00
allburov 0bfff5259e [core] Use ubuntu in NOWEB 2024-03-07 19:27:45 +07:00
allburov 0fa83e603b [core] No more MOBILE engine 2024-03-04 23:14:28 +07:00
allburov 906b03804f [core] Update WEBJS
Release / amd64 - chrome - chrome (push) Waiting to run
Release / amd64 - chromium - latest (push) Waiting to run
Release / linux/arm64 - chromium - arm (push) Waiting to run
Release / amd64 - none - noweb (push) Waiting to run
Release / linux/arm64 - none - noweb-arm (push) Waiting to run
2024-03-02 18:08:52 +07:00
allburov 1ed7a61bea [core] Use fork for WEBJS in Makefile 2024-03-02 18:08:31 +07:00
allburov ad6ae7ab05 [core] Bump version to 2024.3.1 2024-03-02 18:02:30 +07:00
allburov 5e2de1d47d [core] Bump to 2024.2.4
Release / amd64 - chrome - chrome (push) Waiting to run
Release / amd64 - chromium - latest (push) Waiting to run
Release / linux/arm64 - chromium - arm (push) Waiting to run
Release / amd64 - none - noweb (push) Waiting to run
Release / linux/arm64 - none - noweb-arm (push) Waiting to run
2024-02-25 17:57:29 +07:00
allburov 591ca51104 [core] add GET /health 2024-02-25 17:56:58 +07:00
allburov b210841158 [core] Fix documentation for message.revoked 2024-02-21 10:31:54 +07:00
allburov a223a3985b [core] Self-hosted solution 2024-02-19 14:52:23 +07:00
allburov 8baa6a73cd [core] Self-hosted 2024-02-19 14:52:07 +07:00
allburov 508efac2ea [core] Add links on index 2024-02-19 14:51:59 +07:00
allburov b6eed9e228 [core] Rewrite tiers 2024-02-19 14:46:17 +07:00
allburov b62cad07f0 [core] Icons on main page 2024-02-19 14:28:18 +07:00
allburov 6d552d27ac [core] Bold 2024-02-19 14:11:24 +07:00
allburov 39d0f2a060 [core] Fix doc about WEBJS
Release / linux/arm64 - chromium - arm (push) Waiting to run
Release / amd64 - none - noweb (push) Waiting to run
Release / linux/arm64 - none - noweb-arm (push) Waiting to run
Release / amd64 - chrome - chrome (push) Waiting to run
Release / amd64 - chromium - latest (push) Waiting to run
2024-02-18 20:22:45 +07:00
allburov 0b03abee91 [core] Fix delete file when it doesn't exist anymore 2024-02-18 20:22:41 +07:00
allburov b4fb69d0ee [core] Use extends instead of implements for LocalStoreCore.ts 2024-02-18 19:55:54 +07:00
allburov 5b9ed029b3 [core] NOWEB - fix stop session 2024-02-18 19:42:32 +07:00
allburov c29397371b [core] Use network host in mongo example 2024-02-18 19:37:45 +07:00
allburov fe47e27788 [core] Fix yarn file 2024-02-18 19:37:33 +07:00
allburov a14c702c79 [core] Bump to 2024.2.3 2024-02-18 19:25:12 +07:00
allburov fe4246036d [core] Support MongoDB 2024-02-18 19:21:19 +07:00
allburov 074063b814 [core] Fix set presence documentation 2024-02-12 11:34:15 +07:00
allburov 0271a8b721 [core] Fix changelog version
Release / amd64 - chrome - chrome (push) Waiting to run
Release / amd64 - chromium - latest (push) Waiting to run
Release / linux/arm64 - chromium - arm (push) Waiting to run
Release / amd64 - none - noweb (push) Waiting to run
Release / linux/arm64 - none - noweb-arm (push) Waiting to run
2024-02-10 15:09:16 +07:00
allburov 08617383be [core] Listen for page close event
fix #262
2024-02-10 15:08:03 +07:00
allburov 3840459b0a [core] add noweb engine performance 2024-02-09 15:11:36 +07:00
Sunil Sankar aee7ac28bc [core] Fix the image name (#260)
The image name is wrongly mentioned
2024-02-05 14:02:21 +07:00
allburov 9e6cd39b2d [core] fix types
Release / amd64 - none - noweb (push) Waiting to run
Release / linux/arm64 - none - noweb-arm (push) Waiting to run
Release / amd64 - chrome - chrome (push) Waiting to run
Release / amd64 - chromium - latest (push) Waiting to run
Release / linux/arm64 - chromium - arm (push) Waiting to run
2024-02-01 16:23:42 +03:00
allburov 8898429046 [core] Update engines 2024-02-01 16:23:36 +03:00
allburov a74def6dbd [core] Add Patron Portal link 2024-02-01 16:15:42 +03:00
allburov 9f783cd35e [core] Add Patron Portal link 2024-02-01 16:14:04 +03:00
allburov 9d2f061d81 [core] Pass other parameters to requestCode, like locale 2024-01-27 15:11:16 +07:00
allburov a6045b2d54 [core] Add badge example 2024-01-27 13:58:50 +07:00
allburov 6142b2b564 [core] Link fixes 2024-01-27 13:56:30 +07:00
allburov ed53ccb919 [core] One more PRO tier perk 2024-01-27 13:54:38 +07:00
allburov 1ab45c6cfd [core] Add MOBILE engine note 2024-01-27 13:40:10 +07:00
allburov c2fdb090e1 [core] build via ssh 2024-01-27 13:40:10 +07:00
allburov a10b47eb7e [core] Dockerfile - mount ssh in case of private repositories 2024-01-27 13:40:10 +07:00
allburov 7b234e2e37 [core] make build-ssh 2024-01-27 13:40:10 +07:00
allburov 90d45a4698 [core] Add captcha API endpoints 2024-01-27 13:40:10 +07:00
allburov 5e40b70e19 [core] NOWEB - Listen connection events from the start 2024-01-27 13:40:10 +07:00
allburov a27d0c3efb [core] Add MOBILE engine 2024-01-27 13:40:10 +07:00
allburov 46ed506b35 [core] start stop typing in the example 2024-01-27 13:01:52 +07:00
allburov 0ad813a1fe [core] Add links 2024-01-08 18:58:44 +07:00
allburov e57e42f47a [core] Add tiers 2024-01-08 18:53:31 +07:00
Alex cc58157d37 [core] Add badges for patreons 2024-01-08 11:55:34 +07:00
Alex 9b5bb0a339 [core] Create gh-team-labels.yml 2024-01-07 16:34:03 +07:00
Alex 84ebbea287 Delete .github/.github/gh-team-labels.yml 2024-01-07 16:33:44 +07:00
Alex 1c2021f54b Update gh-team-labels.yml 2024-01-07 16:33:09 +07:00
Alex 98a7f00d7d [core] Update gh-team-labels.yml 2024-01-07 16:29:14 +07:00
Alex 60d97d0e67 [core] Create gh-team-labels.yml 2024-01-07 16:28:17 +07:00
allburov 03f4a07cbe [core] Update NOWEB 2023-12-26 18:33:53 +07:00
allburov 3fbe526793 [core] log phone 2023-12-26 17:54:34 +07:00
allburov a892f03382 [core] Bump version to 2023.12.3 2023-12-26 17:20:12 +07:00
allburov 8db69f6e69 [core] Update WEBJS 2023-12-26 17:20:00 +07:00
allburov f9037ff9fc [core] Add github link to authroize-code 2023-12-26 17:10:37 +07:00
allburov 366ddffa2b [core] Add more about How to not get Banned 2023-12-22 16:05:25 +07:00
allburov b8468588de [core] Add note about wa.me link 2023-12-18 21:12:43 +07:00
allburov 62dd6f7f4a [core] No --rm 2023-12-11 13:26:33 +07:00
allburov 858202f1bb [core] Add chatId to changelog 2023-12-02 16:36:20 +07:00
allburov db7900dc26 [core] Bump version to 2023.12.2 2023-12-02 16:34:20 +07:00
allburov aa87e437dc [core] Add note for Brazilian phone number 2023-12-02 16:33:50 +07:00
allburov 741e5e86f8 [core] Reformat send messages documentation 2023-12-02 16:28:44 +07:00
allburov 390a171891 [core] Document check exists changes 2023-12-02 16:23:00 +07:00
allburov 1fc5e2b47c [core] Add chatId to check exists result 2023-12-02 16:13:23 +07:00
allburov 8926dc7cc6 [core] update swagger 2023-12-01 09:38:52 +07:00
allburov 5c3d3c0d70 [core] No null in swagger 2023-12-01 09:38:52 +07:00
allburov 41b29cbf60 [core] Update swagger
Release / amd64 - chrome - chrome (push) Waiting to run
Release / amd64 - chromium - latest (push) Waiting to run
Release / linux/arm64 - chromium - arm (push) Waiting to run
Release / amd64 - none - noweb (push) Waiting to run
Release / linux/arm64 - none - noweb-arm (push) Waiting to run
2023-12-01 09:34:25 +07:00
allburov 44463c199a [core] Try to fix swagger for redoc 2023-12-01 09:33:56 +07:00
allburov 9071adcdcc [core] Update NOWEB engine 2023-12-01 09:32:11 +07:00
allburov 21cd92ca13 [core] Update WEBJS engine 2023-12-01 09:30:02 +07:00
allburov d8a3e8dc43 [core] Bump version to 2023.12.1 2023-12-01 09:25:23 +07:00
allburov 3f5707952c [core] Update swagger 2023-12-01 09:25:06 +07:00
allburov 38a9590be0 [core] Add screenshot and QR to changelog
Fix #177
2023-11-30 18:01:51 +07:00
allburov a7ce117b87 [core] VENOM supports /qr 2023-11-30 18:01:51 +07:00
allburov c3b24a243c [core] document QR code formats 2023-11-30 18:01:51 +07:00
allburov cb2c11df43 [core] screenshot base64 2023-11-30 18:01:50 +07:00
allburov 98f88dcf68 [core] screenshot doc 2023-11-30 18:01:50 +07:00
allburov 9fb12e0e23 [core] Add base64 to screenshot 2023-11-30 18:01:49 +07:00
allburov 0ca106f16b [core] Fix swagger 2023-11-30 18:01:49 +07:00
allburov 33210c6374 [core] Get raw QR value 2023-11-30 18:01:49 +07:00
allburov 045ab67f5d [core] Add BufferResponseInterceptor 2023-11-30 18:01:49 +07:00
allburov 19259c93ea [core] Return json or binary based on Accept header 2023-11-30 18:01:49 +07:00
allburov 9b6784a018 [core] Use "default" session by default 2023-11-30 18:01:49 +07:00
allburov 2fe3706e9c [core] Add base64 file 2023-11-30 18:01:49 +07:00
allburov a4e310a7f8 [core] Get screenshot return only buffer 2023-11-30 18:01:49 +07:00
allburov 802da9f3b2 [core] Use StreamableFile 2023-11-30 18:01:49 +07:00
allburov 0692979b19 [core] Add swagger to config page 2023-11-25 20:43:05 +07:00
allburov fb8b146bc4 [core] Add hide swagger doc 2023-11-25 20:33:35 +07:00
allburov fdbaa43ec9 [core] Add WHATSAPP_SWAGGER_ENABLED environment variable 2023-11-25 20:33:35 +07:00
allburov 4a807530c1 [core] Remove unused method 2023-11-25 20:33:35 +07:00
allburov 84784faa1e [core] eslint no warnings 2023-11-25 20:03:34 +07:00
allburov bd40978dee [core] Apply prettier to other files too 2023-11-25 19:56:32 +07:00
allburov d4d94ffe0e [core] Add empty line linter 2023-11-25 19:44:16 +07:00
allburov d984382a33 [core] Run linter in pre-commit hook 2023-11-25 19:41:41 +07:00
allburov 02d05812d2 [core] Update prettier 2023-11-25 19:09:25 +07:00
allburov 1dbf568bac [core] Add more props 2023-11-25 19:09:25 +07:00
allburov 6bc3aed348 [core] print width 2023-11-25 19:03:58 +07:00
allburov c1e8e0f09c [core] tab 2023-11-25 19:03:58 +07:00
allburov 8f8bcfc474 [core] Don't use tabs 2023-11-25 19:03:58 +07:00
allburov b386df982d [core] bracketSpacing 2023-11-25 19:03:58 +07:00
allburov fa846ddf9b [core] arrowParens always 2023-11-25 19:03:58 +07:00
allburov 16685ed8ea [core] Add endOfLine 2023-11-25 19:03:53 +07:00
allburov 4addccbd55 [core] Update node version in nvm 2023-11-25 19:03:53 +07:00
allburov e9a20c4326 [core] Run eslint 2023-11-25 19:03:53 +07:00
Alex f073aeef13 Update issue templates 2023-11-25 18:43:22 +07:00
allburov eb08739eea [core] Send 404 if file does not exist
fix #134
2023-11-25 18:16:51 +07:00
allburov aff3b01e39 [core] Hide mentions 2023-11-25 18:03:49 +07:00
allburov 2d64b26e86 [core] Hide mentions from send message 2023-11-25 17:37:38 +07:00
allburov 7b7bd02503 [core] Media improvements
- Disable downloading files
- Add 'media' field
2023-11-25 17:25:19 +07:00
allburov 7904516c97 [core] Changelog for filename 2023-11-24 17:47:29 +07:00
allburov 6e0bafdd89 [core] Add doc about new filename field 2023-11-24 17:47:29 +07:00
allburov 2b1e605e5f [core] Add filename property - NOWEB 2023-11-24 17:47:29 +07:00
allburov f454310a09 [core] Add filename property - WEBJS 2023-11-24 17:47:29 +07:00
allburov b6579b5b96 [core] Add filename property 2023-11-24 17:47:29 +07:00
allburov 4ef06d7b92 [docs] Add doc for GET /info-admin-only 2023-11-20 16:25:21 +07:00
allburov e0c594a71b [core] Add GET /info-admin-only 2023-11-20 16:23:23 +07:00
allburov a48d386d8b [core] Update WEBJS 2023-11-20 16:23:21 +07:00
allburov d592858a90 [core] Add name to job 2023-11-05 20:19:42 +07:00
allburov a3cb3e983a [core] No chrome on arm
Release / docker-build (chrome, amd64, buildjet-4vcpu-ubuntu-2204, chrome) (push) Waiting to run
Release / docker-build (chromium, amd64, buildjet-4vcpu-ubuntu-2204, latest) (push) Waiting to run
Release / docker-build (chromium, linux/arm64, buildjet-4vcpu-ubuntu-2204-arm, arm) (push) Waiting to run
Release / docker-build (none, amd64, buildjet-4vcpu-ubuntu-2204, noweb) (push) Waiting to run
Release / docker-build (none, linux/arm64, buildjet-4vcpu-ubuntu-2204-arm, noweb-arm) (push) Waiting to run
2023-11-05 20:16:02 +07:00
allburov 4eb9029b2c [core] Add build-all 2023-11-05 18:28:34 +07:00
allburov b3835b0aa0 [core] echo USE_BROWSER 2023-11-05 18:28:29 +07:00
allburov b2db58a922 [core] Document docker images 2023-11-05 18:24:03 +07:00
allburov acb6b8e0d3 [core] Install fonts if using a browser 2023-11-05 18:14:28 +07:00
allburov 21c6e1e860 [core] Add chrome\noweb builds 2023-11-05 18:10:11 +07:00
allburov 571b65c423 [core] Specify browser args 2023-11-05 18:08:33 +07:00
allburov 1631a62abe [core] Bump version to 2023.11.1 2023-11-05 18:01:09 +07:00
allburov e88a7ca8ce [core] Use github actions matrix 2023-11-05 17:59:44 +07:00
allburov d54f64a9cc [core] Add changelog record for send video 2023-11-05 17:44:30 +07:00
allburov 03dbd5db82 [core] Add docs for send video 2023-11-05 17:31:43 +07:00
allburov 2446c292bf [core] Add /sendVideo API 2023-11-05 17:31:40 +07:00
allburov 5ab99dfd69 [core] Add video example 2023-11-05 16:04:13 +07:00
allburov 605f46fda8 [core] Bump version to 2023.10.18
Release / docker-amd64 (push) Waiting to run
Release / docker-arm (push) Waiting to run
2023-10-18 14:55:32 +07:00
allburov e53f1eafe8 [core] up WEBJS engine 2023-10-18 14:55:16 +07:00
allburov 1457185e84 [core] Add session.status as default event 2023-10-15 00:18:00 +07:00
allburov ad43bec18d [core] Bump version to 2023.10.15 2023-10-15 00:03:16 +07:00
allburov c0a4b223ea [core] add session.status 2023-10-15 00:03:13 +07:00
allburov 65917e1957 [core] Add types for environment (aka version) 2023-10-13 18:54:30 +07:00
allburov a19cede60d [core] Document revoked webhook in swagger 2023-10-13 18:54:30 +07:00
allburov a3ead95ea4 [core] Add engine to version (fix #156) 2023-10-13 18:54:30 +07:00
allburov c46bc1b923 [core] Add me and version to webhook 2023-10-12 16:54:45 +07:00
allburov b327212cbe [core] Bump versio nto 2023.10.12 2023-10-12 16:40:10 +07:00
allburov 4f348c7e48 [core][webjs] Add message.revoked (fix #190) 2023-10-12 16:38:43 +07:00
allburov f2d0001b11 [core] Update openapi.json 2023-09-18 11:55:50 +07:00
allburov 66a224a0e3 [core] Patreon first 2023-09-18 11:54:49 +07:00
allburov 1fa1206568 [core] Adjust header for swagger 2023-09-18 11:54:41 +07:00
allburov 87eea28ac2 [core] Mention feature matrix in docs 2023-09-18 11:42:26 +07:00
allburov 29ca0217b3 [core] Remove "only" engines 2023-09-18 11:31:53 +07:00
allburov 306f75ff3b [core] Fix text 2023-09-18 11:20:29 +07:00
allburov 6ecb203570 [core] Add webhooks 2023-09-18 11:17:22 +07:00
allburov 2e7a3a6b61 [core] Add presence endpoints 2023-09-18 11:13:18 +07:00
allburov 86bc4a92ba [core] Add groups endpoints 2023-09-18 11:11:48 +07:00
allburov f652277e18 [core] Init features by engines 2023-09-18 11:05:53 +07:00
allburov 14a3535439 [core] throw NotImplemented by default 2023-09-18 10:39:21 +07:00
allburov edce7424de [core] Update static swagger for site 2023-09-17 19:09:45 +07:00
allburov 0fa121bbe2 [core] Update openapi.json 2023-09-17 18:50:37 +07:00
allburov 9c046a92be [core] Document webhooks in Swagger 2023-09-17 18:48:23 +07:00
allburov e4506e14da [core] Update next/swagger 2023-09-17 17:31:26 +07:00
allburov 515a00346c [core] Adjust current engine doc 2023-09-17 16:44:06 +07:00
allburov 399e27e24e [core] Name endpoints and webhooks 2023-09-17 15:59:27 +07:00
allburov 9413376138 [core] Bump WAHA version 2023-09-11 15:26:24 +07:00
allburov 3caec14783 [core] Update swagger 2023-09-11 15:26:14 +07:00
allburov 6e427a0a34 [core] Update yarn, engines
Release / docker-amd64 (push) Waiting to run
Release / docker-arm (push) Waiting to run
2023-09-07 17:33:27 +07:00
allburov 40c5e95d93 [core] Up version 2023-09-07 17:33:18 +07:00
allburov ab70e27266 [core] fix for QR scanning 2023-09-07 16:47:17 +07:00
allburov 301b6f57d3 [core] Add changelog note 2023-09-07 13:54:06 +07:00
allburov 4c9f5ed907 [core] Add personal key to Pro 2023-09-07 13:49:22 +07:00
allburov 04d65150ed [core] Add install doc 2023-09-07 13:47:41 +07:00
allburov d29165c9a5 [core] Remove buttons API 2023-09-07 13:11:49 +07:00
allburov 30db175d52 No more semver build, only latest 2023-09-04 18:42:54 +07:00
allburov 5c666c0dd4 Use buildjet with arm
Release / docker-amd64 (push) Waiting to run
Release / docker-arm (push) Waiting to run
2023-09-04 18:39:57 +07:00
allburov 3ccc0469c0 Use buildjet 2023-09-04 18:39:55 +07:00
allburov 5ab3244d6a adjust CI 2023-09-04 18:39:52 +07:00
allburov 05bc8abbee [core] Bump version to 2023.9.3 2023-09-03 19:30:47 +07:00
allburov 8e9056a0cd [core] Add /api/sessions/{session}/me endpoint
Fix #191
2023-09-03 19:30:16 +07:00
allburov ea75b357a7 [core] Log engine events if DEBUG enabled for NOWEB 2023-09-03 16:33:08 +07:00
allburov 2b607e9b44 [core] Bump version to 2023.8.29 2023-08-29 07:49:13 +03:00
allburov 57d3528a96 [core] Apply code review suggestions 2023-08-29 07:48:51 +03:00
allburov 660a04aa52 [core] Document polls 2023-08-29 07:48:51 +03:00
allburov d0a408001d [core] poll.vote.failed 2023-08-29 07:48:51 +03:00
allburov 48391533a6 [core] poll.vote 2023-08-29 07:48:51 +03:00
allburov f2113adbbc [core] Send poll 2023-08-29 07:48:51 +03:00
allburov abfcbc7397 [core] Update WEBJS
Release / deploy-docker (push) Waiting to run
2023-08-23 16:40:46 +03:00
allburov 96f2982325 [core] Bump to 2023.8.23 2023-08-23 12:15:06 +03:00
allburov 3a521bc06c [core] Update WEBJS engine 2023-08-23 12:14:51 +03:00
allburov 6fbaec0083 [core] Bump to 2023.8.21 2023-08-21 14:25:06 +03:00
allburov cae94c7b5c [core] catch error while handling incoming message NOWEB 2023-08-21 14:24:51 +03:00
allburov bce012f692 [core] Bump version to 2023.8.19
Release / deploy-docker (push) Waiting to run
2023-08-19 12:36:08 +03:00
allburov b23b639a8b [core] Support message.ack for NOWEB, add ackName 2023-08-19 12:35:44 +03:00
allburov 5a628907ed [core] Add pairing auth method for NOWEB, add QR endpoint 2023-08-13 16:08:56 +03:00
allburov 6da479c0d7 [core] Update WEBJS engine
Release / deploy-docker (push) Waiting to run
2023-08-10 10:45:40 +03:00
allburov cbb321df6d [core] Bump to 2023.8.10 2023-08-10 07:27:36 +03:00
allburov 0a7beb6909 [core] Update webjs engine
Fix TypeError: Cannot read properties of undefined (reading 'CallCollection')
2023-08-10 07:27:33 +03:00
allburov 2105094ac3 [core] Bump version to 2023.8.8
Release / deploy-docker (push) Waiting to run
2023-08-08 08:57:31 +03:00
allburov d8fee686f8 [core] Update WEBJS and NOWEB engines 2023-08-08 08:56:23 +03:00
allburov 75fc1fd7e0 [docs] Update swagger (openapi) 2023-08-07 08:06:36 +03:00
allburov e718652491 [docs] Keep only versions as headers 2023-08-07 08:05:01 +03:00
allburov bcb49f2be7 [docs] Fix changelog for stories 2023-08-06 18:52:56 +03:00
allburov dab63e4060 [example] Send message and reply 2023-08-06 18:02:36 +03:00
allburov 3fdacbb6ac [core] set defaultQueryTimeoutMs to undefined 2023-08-01 16:42:16 +07:00
allburov f02b62e620 [plus] Show macos by default 2023-08-01 15:42:59 +07:00
allburov 51acce14a0 [plus] Add session to what's next? 2023-08-01 15:28:26 +07:00
allburov b63f6ac39e [core] Add status endpoints 2023-07-25 17:42:44 +07:00
allburov 9e107a8a76 [core] Update noweb engine 2023-07-23 16:49:21 +07:00
allburov 8c083242d3 [core] add documentation and changelog for info-admin-only 2023-07-21 16:08:04 +07:00
gqlxj1987 2a068d561f [core] Add PUT /api/groups/:id/settings/security/info-admin-only endpoint 2023-07-21 13:24:23 +07:00
allburov ef96fbf8c5 [core] Fix chatId bracket 2023-07-16 16:51:50 +07:00
allburov 2c381a0b9c [core] Add openapi json link 2023-07-16 16:41:37 +07:00
allburov fef2bcb6e2 [core] create directory before saving file
Release / deploy-docker (push) Waiting to run
2023-07-16 16:25:41 +07:00
allburov 2f6ed2fb58 [core] Add chats endpoints
Release / deploy-docker (push) Waiting to run
2023-07-16 16:14:12 +07:00
allburov 4eb23d2c09 [core] Bump version to 2023.7.16 2023-07-16 16:14:08 +07:00
allburov ec3de8dbcf [core] Init folder for a session 2023-07-16 13:30:40 +07:00
allburov f6f09747dc [core] pin node:20-bullseye
Release / deploy-docker (push) Waiting to run
2023-07-14 10:10:28 +07:00
allburov 27a534a605 [core] add set session presence endpoint 2023-07-12 16:46:15 +07:00
allburov 3cbd940843 [core] Add swagger image at the top of quick start 2023-07-07 14:26:23 +07:00
allburov e728eec01a [core] Move tiers
Release / deploy-docker (push) Waiting to run
2023-07-05 10:29:10 +07:00
allburov d06d2b78a8 [core] Move donations to top, add links 2023-07-05 10:27:32 +07:00
allburov 5878a9196e [core] Pin yarn version to 3.6.1 2023-07-03 21:52:32 +07:00
allburov 85dd061f96 [core] ignore .yaml folder 2023-07-03 21:52:29 +07:00
allburov 8381c3e946 [core] Set retention days 5 2023-07-03 11:01:51 +07:00
allburov 6ff8a9705d [core] Add cleanup github script 2023-07-03 10:59:56 +07:00
allburov fb5819b966 [core] Create folder if there's no yet
Release / deploy-docker (push) Waiting to run
2023-06-29 19:05:26 +07:00
allburov 5cc1af3f82 [core] Bump to 2023.7.1 2023-06-29 18:56:12 +07:00
allburov c279de694c [core] Update NOWEB engine 2023-06-29 18:55:20 +07:00
allburov f7a1787f1f [core] Add command to update NOWEB 2023-06-29 18:55:20 +07:00
allburov 5442fd6e93 [core] Update WEBJS engine 2023-06-29 18:55:20 +07:00
allburov b8c8ca7653 [core] Use yarn v2 commands to update package 2023-06-29 18:55:20 +07:00
allburov 5ca7dbc84b [core] Update swagger 2023-06-29 18:38:41 +07:00
allburov d836c9706f [core] Add for-swagger make command 2023-06-29 18:38:34 +07:00
allburov 318be43a4f [core] fix start\stop issue with NOWEB engine 2023-06-29 18:31:36 +07:00
allburov 95bebce731 [core] fix sessions with no config 2023-06-29 18:31:34 +07:00
allburov 27b8c9d058 [core] Make config optional 2023-06-29 18:14:23 +07:00
allburov 10d4d24526 [core] Place Boosty first 2023-06-29 18:07:14 +07:00
allburov b19917bd3d [core] Always logout from session 2023-06-29 18:06:07 +07:00
allburov 4b6774b1db [core] WAHA Plus links last 2023-06-26 11:29:31 +07:00
allburov 360e0a7951 [core] All tiers 2023-06-26 11:28:01 +07:00
allburov 171f516eee [core] Patreon first 2023-06-26 11:17:58 +07:00
allburov 01943f6970 [core] Remove global env.varilabels from webhooks 2023-06-25 14:01:22 +07:00
allburov 953d48ee1f [core] Add links to Quick Start 2023-06-25 14:00:51 +07:00
allburov 2b6028bcb1 [core] Make alert dismissible 2023-06-25 13:51:36 +07:00
allburov 79b7b7d2a2 [core] Adjust headers 2023-06-25 13:34:11 +07:00
allburov 93a6a7b87f [core] Remove youtube video from other pages 2023-06-25 13:14:30 +07:00
allburov 3b499d6af5 [core] Change headers to mobile first 2023-06-23 15:04:22 +07:00
allburov 6481919597 [core] Change swagger title to WAHA 2023-06-23 14:57:17 +07:00
allburov 228f6ec8c5 [core] No one-time 2023-06-23 14:48:03 +07:00
allburov 6723f201b7 [core] Add make start-proxy command 2023-06-23 14:45:22 +07:00
allburov c250bb49f0 [core] Make proxy per session 2023-06-23 14:44:14 +07:00
allburov 3b607662e5 [core] Flexible webhooks 2023-06-22 18:20:27 +07:00
allburov f2d7041cb0 [core] Fix Dockerfile with yarn v2 2023-06-19 13:10:43 +07:00
allburov afc06794c2 [core] No mobile yet 2023-06-19 12:16:52 +07:00
allburov 33eaafcff1 [core] update NOWEB engine, use yarn v2 2023-06-18 17:38:06 +07:00
allburov e5a8743b9a [core] Remove Get on links 2023-06-18 15:17:44 +07:00
allburov 3322c4e2a5 [core] Add eslint fix import plugin 2023-06-16 16:17:31 +07:00
allburov aa39aaf489 [core] You can run, not configure 2023-06-16 15:01:30 +07:00
allburov a238581f44 [core] Add presence event 2023-06-16 15:00:44 +07:00
allburov 00814ef64e [core] Add dedicated webhooks page 2023-06-16 14:56:35 +07:00
allburov 6362d2966b [core] Add active link to docker-compose.yaml file 2023-06-14 12:36:44 +07:00
allburov 4e181a82b6 [core] Use plus image in sessions 2023-06-14 12:35:45 +07:00
allburov 374199905d [core][noweb] Add presence endpoints and webhook 2023-06-14 12:27:39 +07:00
allburov 642079ab1f [core] Add changelog about mentions 2023-06-12 15:31:35 +07:00
allburov 215c9d96b9 [core] Add mentions
Fix #105
2023-06-12 15:27:53 +07:00
allburov 5369eda705 [core] Fix engine field 2023-06-09 16:25:31 +07:00
allburov 5e42bbe1eb [core] ignore webjs cache 2023-06-09 16:25:26 +07:00
allburov 79dd2ee03e [core] bump version to 2023.6.9 2023-06-09 16:25:24 +07:00
allburov 78d3eae44b [core] Fix storage issue 2023-06-09 16:25:22 +07:00
allburovandPierluca Lino a9ee68fe1a [core] Add proxy support
Co-authored-by: Pierluca Lino <pierluca.lino@dontouch.ch>

Co-authored-by: puntolino <pierluca.lino@dontouch.ch>
2023-06-07 17:02:18 +07:00
allburov ee5678ccfb [core] yarn upgrade instead of add 2023-06-07 17:02:18 +07:00
allburov 248a675c1a [core] No core images 2023-06-05 17:14:21 +07:00
allburov 6b1d84cf38 [core] Show core features first 2023-06-05 16:59:52 +07:00
allburov c0977538ff [core] change header 2023-06-03 18:51:23 +07:00
allburov c8727e8b2f [core] Add a link to PLUS 2023-06-03 18:49:01 +07:00
allburov 55a41e19f4 [core] Rename to WAHA Plus 2023-06-03 18:47:09 +07:00
allburov 6096c0b158 [core] Move help's files to overview 2023-06-03 18:44:35 +07:00
allburov 161c6dfd95 [core] Receive message 2023-06-03 18:39:16 +07:00
allburov 078bcf7652 [core] env variables block 2023-06-03 18:33:47 +07:00
allburov 57c6df3970 [core] Adjust sessions how to 2023-06-03 18:27:58 +07:00
allburov 1130ee1b21 [core] Add docker run on index 2023-06-01 13:15:02 +07:00
allburov c9c0a29740 Use 2023 year in changelog 2023-06-01 12:10:37 +07:00
allburov e60d972bff [core] Bump version to 2023.6.1
Release / deploy-docker (push) Waiting to run
2023-06-01 11:54:08 +07:00
allburov 3c4a139f52 [core] Update venom engine 2023-05-21 18:41:06 +07:00
allburov bf615efa96 [core] Apply pre-commit with prettier 2023-05-21 18:09:25 +07:00
allburov 2af3940be7 [core] Add prettier to pre-commit 2023-05-21 18:09:12 +07:00
allburov 64e145909e [core] Advanced sessions control 2023-05-21 18:01:04 +07:00
allburov e90f34cc96 [core] Pin markupsafe version
Release / deploy-docker (push) Waiting to run
Fix #97
2023-05-20 18:25:18 +07:00
allburov a23cf2dd26 [docs] Add port to receive message docker run command 2023-05-20 18:17:21 +07:00
allburov 7b623d0faa [core] Bump version 2023-05-20 18:11:36 +07:00
allburov 14788b1d53 [core] Update webjs engine 2023-05-20 18:11:33 +07:00
allburov e1bf8cf735 [core] Update swagger 2023-05-12 11:45:20 +07:00
allburov 2117731b46 [core] Add variables to Swagger 2023-05-12 11:44:29 +07:00
allburov 74f8fe1caf [core] bump version to 2023.5.11 2023-05-11 10:27:44 +07:00
allburov 9388a3b277 [core] Add caption to file 2023-05-11 10:27:41 +07:00
allburov 13e7a05e1b [core] Fix provide extended option dist/main.js:29:38 error 2023-05-07 10:31:23 +07:00
allburov 885fa25c0c [core] Add make build-plus command 2023-05-07 10:31:05 +07:00
allburov 966b35094f Bump version to 2023.5.3
Release / deploy-docker (push) Waiting to run
2023-05-03 09:17:44 +07:00
allburov 65607bf3b3 Handle extendedTextMessage
Fix #90
2023-05-03 09:17:24 +07:00
allburov 5fcba7a7db [core][docs] Remove the icon from headers 2023-04-27 18:37:05 +07:00
allburov f9ec3cb753 [core] Bump version 2023.4.27
Release / deploy-docker (push) Waiting to run
2023-04-27 09:13:03 +07:00
allburov bf6ffd65a9 [core] ignore all *sessions 2023-04-26 18:15:04 +07:00
allburov d680b6b43a [core] Add noweb engine 2023-04-26 18:14:38 +07:00
allburov 3ead3a0ba3 [core] Add GET /messages request
Fix #31
2023-04-26 18:14:08 +07:00
allburov 4c5c977310 [core][docs] No delay in bugfixes 2023-04-15 17:58:15 +07:00
allburov 89a9ce87da [core] Use the main branch in whatsapp webjs
Release / deploy-docker (push) Waiting to run
2023-04-14 10:43:02 +07:00
allburov 52e469f6ac [core] Bump version - 2023.4.14 2023-04-14 10:38:58 +07:00
allburov 4f275de8d4 [core] close session properly
Fix #83
2023-04-14 10:38:56 +07:00
allburov d9de41e350 [core] bump version - 2023.3.28 2023-04-14 10:38:54 +07:00
allburov a4c279ba25 [core] Add short description about webhooks
Release / deploy-docker (push) Waiting to run
2023-04-01 19:04:13 +07:00
allburov e68282a9e4 [core] Add video on the index 2023-04-01 18:53:37 +07:00
allburov 8613206c3a [core] Move video to introduction page 2023-04-01 18:50:30 +07:00
allburov 31b8cde8bf [core] Add youtube video 2023-04-01 18:46:19 +07:00
allburov 2f2f9520db [core] add session to webhook data
fix #80
2023-03-28 15:37:53 +07:00
allburov 2501ae836e [core] bump version 2023-03-28 15:37:53 +07:00
allburov 2c8bf91e77 [plus] Increase body limit for files - fix #79 2023-03-28 15:37:52 +07:00
allburov 0ac063498e [core] Fix addParticipans issue - https://github.com/pedroslopez/whatsapp-web.js/pull/2087 2023-03-28 15:37:52 +07:00
allburov 2bf672f0cd [core] Downgrade venom-bot 2023-03-22 19:14:12 +07:00
allburov ca209adca0 [core] bump version - 2023.3.21 2023-03-22 19:14:12 +07:00
allburov dd10c82c5e [core] Update engines - venom, whatsapp webjs 2023-03-22 19:14:12 +07:00
allburov c3ad2a0931 [core] Make update-dependencies - use yarn 2023-03-22 19:14:12 +07:00
allburov 30aacc8946 [core] Fix features 2023-03-22 19:13:23 +07:00
allburov 723a644937 Use "" for * in env variable 2023-02-28 16:59:28 +07:00
allburov 165eeb5bf2 Add note how to start ARM docker image 2023-02-28 10:00:06 +07:00
allburov f1776d4a26 Support only amd64
Release / deploy-docker (push) Waiting to run
2023-02-28 09:38:48 +07:00
allburov 2f2a1b3182 Use yarn 2023-02-28 09:03:30 +07:00
allburov 0477cf7db5 Update build-and-push action 2023-02-27 19:47:10 +07:00
allburov 2d7c7986aa Add changelog for Chromium 2023-02-27 19:27:22 +07:00
allburov bf84ea8fca [core] fix chromium path 2023-02-27 19:15:37 +07:00
allburov f3ef8a7f96 [core] fix version file 2023-02-27 19:08:56 +07:00
allburov ec214f610a [core] Install chromium by default 2023-02-27 19:04:27 +07:00
allburov 013fd46722 [core] Install fonts separately 2023-02-27 18:51:50 +07:00
allburov 32d583b9ef [core] Skip chromium download 2023-02-27 18:51:27 +07:00
allburov df6e201ba5 [core] Choose between chrome and chromium 2023-02-27 18:47:02 +07:00
allburov 789b613b82 [core] Build docker for ARM 64 2023-02-27 18:13:53 +07:00
allburov b698342db4 [core] Build docker for ARM v7\v8 2023-02-27 18:09:07 +07:00
allburov d853f2fe99 [core] Build docker for ARM 2023-02-27 17:57:14 +07:00
allburov 20d66b5b31 [core][doc] Split examples to echo bot and download files bot 2023-02-27 11:00:53 +07:00
allburov da7264c5e8 [core] Bump version 2023-02-24 19:57:50 +07:00
allburov f3299f78d9 [core] Update swagger 2023-02-24 19:57:49 +07:00
allburov 7ef0805c91 [core] Add group endpoints docs and changelog 2023-02-24 19:57:48 +07:00
allburov ba1afa2569 [core] Add group endpoints 2023-02-24 19:57:48 +07:00
allburov 936e2d0863 [core] Add sendLocation to webjs.
It doesn't work tho because of https://github.com/pedroslopez/whatsapp-web.js/issues/1591
2023-02-24 19:57:41 +07:00
Aleksey 166410f66a Use main webjs
Release / deploy-docker (push) Waiting to run
2023-02-11 13:39:11 +00:00
Aleksey f8c9298694 Update package lock
Release / deploy-docker (push) Waiting to run
2023-02-11 12:58:38 +07:00
Aleksey b0b642b6bb ^1.19.3 2023-02-11 08:40:48 +07:00
allburov 5fa20343da [core] Remove one time mark 2023-01-22 14:18:36 +07:00
allburov bbbf181011 [core] does not cache layers to install new Chrome
Release / deploy-docker (push) Waiting to run
2023-01-22 14:07:19 +07:00
allburov 6af547d2af [core] Quick fix for webjs engine.
Release / deploy-docker (push) Waiting to run
Fix #46
2023-01-15 14:52:17 +07:00
allburov d72b1822cb [core][2023.1] Add checkNumberStatus for webjs engine 2023-01-15 14:37:15 +07:00
allburov d34df18da8 [core][2023.1] Add contacts endpoints 2023-01-15 14:37:14 +07:00
allburov 27cb247760 [core][docs] Add contact api changelog 2023-01-09 09:31:00 +07:00
allburov 7a66d6fccd [core][docs] Add changelog.md 2023-01-09 09:31:00 +07:00
allburov f1cb372339 [core][docs] Add contacts page 2023-01-09 09:31:00 +07:00
allburov 46d65e6fc0 [core][docs] Reorder guides 2023-01-09 09:31:00 +07:00
allburov 6168298b5e [core][docs] Move engines doc to config 2023-01-09 09:31:00 +07:00
allburov d5fef413ca [core] Add swagger authentication to changelog 2022-12-19 12:35:36 +07:00
allburov 0802ee6106 [core][docs] Add GET /messages request. Fix #31 2022-12-19 12:32:55 +07:00
allburov 65d0f87eeb Use -plus docker image in security
Release / deploy-docker (push) Waiting to run
2022-12-11 17:01:47 +07:00
allburov 488868d80e Add WHATSAPP_SWAGGER_USERNAME, WHATSAPP_SWAGGER_PASSWORD to config.md 2022-12-11 16:58:12 +07:00
allburov 154965efcb [core] bump version to 2022.12.11 2022-12-11 16:52:36 +07:00
allburov f364f0b495 [core] Authentication for swagger panel (available in plus only) 2022-12-11 16:52:34 +07:00
allburov 82e2f5bcb9 [core] Authentication for swagger panel (available in plus only) 2022-12-11 16:52:28 +07:00
dependabot[bot] f7a2228925 Bump venom-bot from 4.3.6 to 4.3.7
Bumps [venom-bot](https://github.com/orkestral/venom) from 4.3.6 to 4.3.7.
- [Release notes](https://github.com/orkestral/venom/releases)
- [Changelog](https://github.com/orkestral/venom/blob/master/CHANGELOG.md)
- [Commits](https://github.com/orkestral/venom/compare/v4.3.6...v4.3.7)

---
updated-dependencies:
- dependency-name: venom-bot
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-11 16:52:17 +07:00
allburov dadc9d4efd Up version 2022-12-11 16:52:11 +07:00
allburov df59867431 Up dependencies 2022-12-11 16:52:11 +07:00
dependabot[bot] a7c6e9dc00 Bump whatsapp-web.js from 1.18.3 to 1.18.4
Bumps [whatsapp-web.js](https://github.com/pedroslopez/whatsapp-web.js) from 1.18.3 to 1.18.4.
- [Release notes](https://github.com/pedroslopez/whatsapp-web.js/releases)
- [Commits](https://github.com/pedroslopez/whatsapp-web.js/compare/v1.18.3...v1.18.4)

---
updated-dependencies:
- dependency-name: whatsapp-web.js
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-11 16:52:11 +07:00
allburov 6b51cfd448 Bump version to 2022.11.20
Release / deploy-docker (push) Waiting to run
2022-11-20 16:31:12 +07:00
allburov 98b86ca527 [core] Fix checkNumberStatus issue #26 2022-11-20 16:30:56 +07:00
allburov 9a2ef4c52a [core] Use session instead of sessionName 2022-11-20 16:30:56 +07:00
allburov d69d4bd29d [core] update venom to 4.3.5 2022-11-20 16:30:56 +07:00
allburov 97cdc56c26 [core] Update dependencies script 2022-11-20 16:30:56 +07:00
allburov c2440b9c79 Rearange blocks a little 2022-11-20 15:55:04 +07:00
allburov f0b69d089a No tokens folder 2022-11-20 15:32:41 +07:00
allburov ac79549934 Add link to example for python 2022-11-20 15:09:37 +07:00
allburov e6b8b5e904 examples not draft 2022-11-20 15:03:03 +07:00
allburov 5a22e5b2b2 Typo 2022-11-20 14:58:13 +07:00
allburov 431d7bf9d9 Add CPU and memory to Faq 2022-11-20 14:56:30 +07:00
allburov 865ea6e66b Set Plus subscription to $19 always 2022-11-20 14:28:07 +07:00
allburov 2f787d6a53 Add quick start to readme 2022-11-20 14:20:04 +07:00
allburov 939ac28d00 Remove nl language 2022-11-20 14:13:16 +07:00
allburov 76068add09 [core] Add chrome optimization arguments 2022-11-19 13:26:03 +07:00
allburov 0730dd6756 Add api key to run command 2022-11-19 13:25:59 +07:00
allburov 64cce8e8be Fix few mistakes on index 2022-11-16 14:51:34 +07:00
allburov 2d12dc0f3e How to guides 2022-11-16 14:50:42 +07:00
allburov 82a60e99cc Ignore tokens too 2022-11-16 14:49:26 +07:00
allburov 1cbd18db76 Mark faq as draft 2022-11-15 14:18:04 +07:00
allburov 48ccd636cd Add yandex metrics 2022-11-15 10:22:46 +07:00
allburov 573dd0da7e Special new year offer 2022-11-15 10:18:28 +07:00
allburov df8583801f Add engines info 2022-11-15 10:08:15 +07:00
allburov ff2b434133 Add run commands 2022-11-15 10:00:22 +07:00
allburov 30cae74d50 Update webjs to 1.18.3 2022-11-15 10:00:18 +07:00
allburov a896d32d37 Update venom to 4.3.3 2022-11-15 10:00:17 +07:00
allburov d9d4527894 add functions for getCatchQR and buildClient 2022-11-15 10:00:08 +07:00
allburov e93caac34b Do not use toWAMessage 2022-11-15 09:59:26 +07:00
allburov cd5182f8ee Set waha site base url 2022-11-11 12:48:08 +07:00
allburov b185c02252 Publish right path 2022-11-11 12:41:42 +07:00
allburov 58aa10be9c Build pages
Release / deploy-docker (push) Waiting to run
2022-11-11 12:37:22 +07:00
allburov 5d3d3bf03a Revert "Update build.yaml"
This reverts commit 983e8dbbd3.
2022-11-11 12:31:31 +07:00
allburov 11af1cb390 Use fixed webjs 2022-11-11 12:31:07 +07:00
allburov 32057573b7 Ignore plus module 2022-11-11 12:31:07 +07:00
allburov 0b6058654e Big changes - change engine, split core\plus version 2022-11-11 12:31:07 +07:00
Aleksey a7fe444166 Create CNAME 2022-11-11 10:51:40 +07:00
Aleksey Burov f4f734d8ff Install stable
Release / deploy-docker (push) Waiting to run
2022-10-28 20:25:28 +07:00
Aleksey Burov 983e8dbbd3 Update build.yaml
Release / deploy-docker (push) Waiting to run
2022-10-28 20:20:56 +07:00
Aleksey Burov b2150477d7 Add telegram dm link 2022-10-23 18:05:28 +07:00
Aleksey Burov f83eeac33a Delete docker-compose.yaml
Fix #19
2022-10-23 17:49:44 +07:00
allburov 37c4a85e76 Add httpbin in readme.md
Release / deploy-docker (push) Waiting to run
2022-10-13 10:31:39 +07:00
allburov 8732af0f43 Add onAnyMessage hook 2022-10-13 10:14:43 +07:00
allburov dfa7bc2ca8 Log errors
Release / deploy-docker (push) Waiting to run
2022-10-03 12:04:13 +07:00
allburov f857bab540 Change entrypoint to commands 2022-10-03 12:00:50 +07:00
allburov 59f2e1526d Ignore Dockerfile 2022-10-03 11:59:22 +07:00
allburov abe273166b Log QR code on a new line
Release / deploy-docker (push) Waiting to run
2022-10-03 11:53:38 +07:00
allburov 3e37e933b2 Add start:prod-exit to exit on any fails 2022-10-03 11:48:02 +07:00
allburov 6d2cae0784 Add how to build docker image locally 2022-09-30 11:47:31 +07:00
allburov 0bf44dae88 Add table of content pre-commit hook 2022-09-30 11:45:04 +07:00
FelipeVeiga 9c9d6fda10 adding message with buttons (#17) 2022-09-30 11:40:23 +07:00
allburov 8b82f76668 Start session at the launch time with WHATSAPP_START_SESSION
Release / deploy-docker (push) Waiting to run
2022-09-28 10:28:07 +07:00
allburov 5fb5eace6e Add GET /checkNumberStatus
Release / deploy-docker (push) Waiting to run
2022-09-27 17:01:36 +07:00
133 changed files with 21788 additions and 45313 deletions

No files matched your search

+8 -1
View File
@@ -1,10 +1,17 @@
tokens
Dockerfile
.*sessions
files
venv
.wwebjs_auth
docs
examples
.github
.git
# compiled output
/dist
/node_modules
.yarn
# Logs
logs
+33 -22
View File
@@ -1,25 +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',
},
},
};
+14
View File
@@ -0,0 +1,14 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: wa_http_api
open_collective: # doks Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom:
- https://boosty.to/wa-http-api
- https://portal.devlike.pro/
+61
View File
@@ -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/waha/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.
+24
View File
@@ -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.
+18
View File
@@ -0,0 +1,18 @@
# Idea from
# https://stackoverflow.com/a/65539398/6753144
#
OWNER=devlikeapro
REPO=waha-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
+10
View File
@@ -0,0 +1,10 @@
teamLabels:
- team: waha-patrons-pro
label: patron:PRO
comment: '[![patron:PRO](https://img.shields.io/badge/patron-PRO-188a42)](https://waha.devlike.pro/docs/how-to/plus-version/#tiers)'
- team: waha-patrons-advanced
label: patron:ADVANCED
comment: '[![patron:ADVANCED](https://img.shields.io/badge/patron-ADVANCED-4cd07d)](https://waha.devlike.pro/docs/how-to/plus-version/#tiers)'
- team: waha-patrons-plus
label: patron:PLUS
comment: '[![patron:PLUS](https://img.shields.io/badge/patron-PLUS-a0e6ba)](https://waha.devlike.pro/docs/how-to/plus-version/#tiers)'
+43 -10
View File
@@ -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
@@ -20,10 +51,11 @@ jobs:
id: meta
uses: docker/metadata-action@v4
with:
images: allburov/whatsapp-http-api
flavor: latest=true
images: ${{ vars.DOCKER_IMAGE }}
flavor: latest=false
tags: |
type=semver,pattern={{version}}
type=raw,value=${{ matrix.tag }}
type=raw,value=${{ matrix.tag }}-{{tag}}
- name: Login to image repository
if: github.ref_type == 'tag'
@@ -33,12 +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 }}
cache-from: type=gha
cache-to: type=gha
+84
View File
@@ -0,0 +1,84 @@
name: Manual push
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag to push'
required: true
default: 'dev'
push:
description: 'Push to registry'
required: true
type: boolean
default: true
jobs:
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
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ vars.DOCKER_IMAGE }}
flavor: latest=false
tags: |
type=raw,value=${{ inputs.tag }}-${{ matrix.tag }}
- name: Login to image repository
if: github.ref_type == 'tag'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile
platforms: ${{ matrix.platform }}
build-args: |
USE_BROWSER=${{ matrix.browser }}
push: ${{ inputs.push }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
+6
View File
@@ -1,6 +1,12 @@
.yarn
example.ts
.*sessions
tokens
files
venv
.wwebjs_auth
test.js
.wwebjs_cache
# compiled output
/dist
+1
View File
@@ -0,0 +1 @@
v20.5.0
+48
View File
@@ -0,0 +1,48 @@
exclude: |
(?x)^(
^src/dashboard/.*|
^src/core/engines/webjs/.*html|
^src/plus/engines/webjs/.*html
)$
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:
- id: markdown-toc
name: README.md
files: ^README.md$
- repo: local
hooks:
- id: no-plus-in-core
name: No "plus" in core
language: pygrep
entry: 'plus'
files: |
(?x)^(
src/api/.*|
src/core/.*|
src/structures/.*|
src/config.service.ts|
)$
+11 -2
View File
@@ -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
}
+1
View File
@@ -0,0 +1 @@
network-timeout 60000
+3
View File
@@ -0,0 +1,3 @@
nodeLinker: node-modules
yarnPath: .yarn/releases/yarn-3.6.3.cjs
+4
View File
@@ -0,0 +1,4 @@
# Changelog
You can find changelog on
[the changelog page](https://waha.devlike.pro/docs/help/changelog/)
+1
View File
@@ -0,0 +1 @@
waha.devlike.pro
+68 -16
View File
@@ -1,23 +1,75 @@
FROM node:15
# 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-unstable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
#
# Build
#
ARG NODE_VERSION=20.12.2-bullseye
FROM node:${NODE_VERSION} as build
ENV PUPPETEER_SKIP_DOWNLOAD=True
# npm packages
WORKDIR /app
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 --mount=type=ssh yarn install
RUN yarn build && find ./dist -name "*.d.ts" -delete
#
# Final
#
FROM node:${NODE_VERSION} as release
ENV PUPPETEER_SKIP_DOWNLOAD=True
# Quick fix for memory potential memory leaks
# https://github.com/devlikeapro/waha/issues/347
ENV NODE_OPTIONS="--max-old-space-size=16384"
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
# Available versions:
# https://www.ubuntuupdates.org/package/google_chrome/stable/main/base/google-chrome-stable
ARG CHROME_VERSION="122.0.6261.128-1"
RUN if [ "$USE_BROWSER" = "chrome" ]; then \
wget --no-verbose -O /tmp/chrome.deb https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}_amd64.deb \
&& apt-get update \
&& apt install -y /tmp/chrome.deb \
&& rm /tmp/chrome.deb \
&& rm -rf /var/lib/apt/lists/*; \
fi
# Attach sources, install packages
WORKDIR /app
ADD . /app
RUN npm run build
ENTRYPOINT npm run start:prod
COPY package.json ./
COPY --from=build /src/node_modules ./node_modules
COPY --from=build /src/dist ./dist
# Run command, etc
EXPOSE 3000
CMD yarn start:prod
+36 -4
View File
@@ -1,8 +1,40 @@
build:
docker build . -t allburov/whatsapp-http-api
docker build . -t devlikeapro/waha
run:
docker run --rm -v `pwd`/tokens:/app/tokens -p 127.0.0.1:3000:3000/tcp --name whatsapp-http-api allburov/whatsapp-http-api
build-chrome:
docker build . -t devlikeapro/waha-plus:chrome --build-arg USE_BROWSER=chrome
build-noweb:
docker build . -t devlikeapro/waha:noweb --build-arg USE_BROWSER=none
build-all: build build-chrome build-noweb
build-plus:
docker build . -t devlikeapro/waha-plus
build-ssh:
# check IMAGE provided
@[ "${IMAGE}" ] || ( echo "Add APP: make build-ssh image=devlikeapro/waha"; exit 1 );
eval $(ssh-agent) && \
ssh-add ~/.ssh/id_rsa && \
docker buildx build --ssh default=${SSH_AUTH_SOCK} . -t ${IMAGE} --build-arg USE_BROWSER=none
stop:
docker stop waha
clean: stop
sudo rm -rf .sessions
push:
docker push allburov/whatsapp-http-api
docker push devlikeapro/waha
for-swagger:
WHATSAPP_SWAGGER_CONFIG_ADVANCED=true npm run start
update-dependencies:
. ${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
+166 -115
View File
@@ -1,146 +1,197 @@
# WhatsApp HTTP API Free
# WAHA
WhatsApp HTTP API that you can configure in a click! It's really Free! :)
<p align="center">
<img src="./logo.png" style='border-radius: 50%' width='150'/>
</p>
The project provides you HTTP API for Whatsapp that you can use to send and receive messages. You can
go [through currently supported methods in Swagger](https://allburov.github.io/whatsapp-http-api/)
**WAHA** - **W**hats**A**pp **H**TTP **A**PI (REST API) that you can install on your own server and run in less than 5 minutes!
The project is an HTTP API wrapper around https://github.com/orkestral/venom
[![Docker Pulls](https://img.shields.io/docker/pulls/devlikeapro/waha)](https://hub.docker.com/r/devlikeapro/waha)
- Documentation: [https://waha.devlike.pro/](https://waha.devlike.pro/)
- Swagger Example: [https://waha.devlike.pro/swagger](https://waha.devlike.pro/swagger)
# Installation
# Tables of Contents
<!-- toc -->
- [Features](#features)
* [Messages](#messages)
* [Sessions](#sessions)
* [Security](#security)
* [Updates](#updates)
* [Groups](#groups)
* [Contacts](#contacts)
- [Quick start](#quick-start)
* [Requirements](#requirements)
* [Send your first message](#send-your-first-message)
+ [1. Download image](#1-download-image)
+ [2. Run WhatsApp HTTP API](#2-run-whatsapp-http-api)
+ [3. Start a new session](#3-start-a-new-session)
+ [4. Get and scan QR](#4-get-and-scan-qr)
+ [5. Get the screenshot](#5-get-the-screenshot)
+ [6. Send a text message](#6-send-a-text-message)
* [What is next?](#what-is-next)
<!-- tocstop -->
# Features
## 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)
- Single WhatsApp account running inside one container
- Multiple WhatsApp account running inside one container
## Security
- Swagger panel authentication
- API authentication
## Updates
- Bug fixes and updates come as soon as they are implemented.
## Groups
- Create a group
- Get invite for group
- Modify group info (subject, description)
- Add group participants
- Kick group participants
- Promote/demote group participants
## Contacts
- Mute/unmute chats
- Block/unblock contacts
- Get contact info
- Get profile pictures
- Get presence (online\offline\typing) status
# Quick start
## Requirements
Only thing that you must have - installed docker. Please follow the original
instruction [how to install docker](https://docs.docker.com/get-docker/)
instruction <a href="https://docs.docker.com/get-docker/" target="_blank" rel="noopener">how to install docker -></a>.
When you are ready - come back and follows the below steps to send the first text message to WhatsApp via HTTP API!
{{< 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 >}}
## Send your first message
Let's go over steps that allow you to send your first text message via WhatsApp HTTP API!
### 1. Download image
Assuming you have installed [Docker](https://docs.docker.com/get-docker/), let's download the image.
```bash
docker pull allburov/whatsapp-http-api
docker pull devlikeapro/waha
```
# First Steps
We're going to go through basic steps and send a text message at the end!
```bash
docker login -u devlikeapro -p {KEY}
docker pull devlikeapro/waha-plus
docker logout
```
## Run WhatsAPP HTTP API
Read more about how to get `PASSWORD` for [Plus Version →]({{< relref "plus-version" >}})
### 2. Run WhatsApp HTTP API
Run WhatsApp HTTP API:
```bash
docker run -it --rm -v `pwd`/tokens:/app/tokens -p 127.0.0.1:3000:3000/tcp --name whatsapp-http-api allburov/whatsapp-http-api
docker run -it --rm -p 3000:3000/tcp --name waha devlikeapro/waha
# It prints logs and the last line must be
# It prints logs and the last line must be
# WhatsApp HTTP API is running on: http://[::1]:3000
```
Open the link in your browser: http://localhost:3000/
Open the link in your browser [http://localhost:3000/](http://localhost:3000/) and you'll see API documentation
(Swagger).
Note: We don't recommend expose the API outside the world because it does not
support ([yet](https://github.com/allburov/whatsapp-http-api/issues/4)) authorization!
## Create a new session and login
### 3. Start a new session
1. To start a new session you should have your mobile phone with installed WhatsApp application close to you. Please go
and read how what we'll need to a bit
later: [How to log in - the instruction on WhatsApp site](https://faq.whatsapp.com/381777293328336/?helpref=hc_fnav)
1. Open API documentation at http://localhost:3000/
1. **Start a new session with a name** (you can use `default` for the start) - find `POST /api/session/start`, click
on **Try it out**, then **Execute** a bit below.
![](./docs/images/session-start.png)
1. **Scan QR Code** - find `GET /api/screenshot` and execute it, it'll show you QR code that you must scan with your
device.
![](./docs/images/qr.png)
1. **Get a screenshot again** - it'll show you the screenshot of you Whatsapp instance. If you can get the actual
screenshot - then you're ready to start sending messages!
![](./docs/images/screenshot.png)
To start a new session you should have your mobile phone with installed WhatsApp application close to you.
## Send a text message
Please go and read how what we'll need to a bit
later:
<a href="https://faq.whatsapp.com/381777293328336/?helpref=hc_fnav" target="_blank">
How to log in - the instruction on WhatsApp site
</a>
Let's try to send a message - you can either find `POST /api/sendText` in swagger (http://localhost:3000/) or
use `curl` or just open a link in a browser (change the phone
before!) http://localhost:3000/api/sendText?phone=79776772457&text=Hello+from+WhatsApp+HTTP+API+Free!
When your ready - find `POST /api/session/start`, click on **Try it out**, then **Execute** a bit below.
The example payload:
```json
{
"name": "default"
}
```
By using the request with `name` values you can start multiple session (WhatsApp accounts) inside the single docker container in Plus
### 4. Get and scan QR
Find `GET /api/screenshot` and execute it, it shows you QR code.
**Scan the QR with your cell phone's WhatsApp app.**
### 5. Get the screenshot
Execute `GET /api/screenshot` after a few seconds after scanning the QR - it'll show you the screenshot of you Whatsapp
instance. If you can get the actual screenshot - then you're ready to start sending messages!
### 6. Send a text message
Let's send a text message - find `POST /api/sendText` in [swagger](http://localhost:3000/) and change `chatId` this
way: use a phone international phone number without `+` symbol and add `@c.us` at the end.
For phone number `12132132131` the `chatId` is `12132132131@c.us`.
The example payload:
```json
{
"chatId": "12132132130@c.us",
"text": "Hi there!",
"session": "default"
}
```
Also, you can use `curl` and send POST request like this:
```bash
# Phone without +
# Using GET
curl "http://localhost:3000/api/sendText?phone=79776772457&text=Hello+from+WhatsApp+HTTP+API+Free!"
# Using POST
export PHONE=79776772457
curl -d "{\"chatId\": \"${PHONE}@c.us\", \"text\": \"Hello from WhatsApp HTTP API Free\" }" -H "Content-Type: application/json" -X POST http://localhost:3000/api/sendText
export PHONE=12132132130
curl -d "{\"chatId\": \"${PHONE}@c.us\", \"text\": \"Hello from WhatsApp HTTP API\" }" -H "Content-Type: application/json" -X POST http://localhost:3000/api/sendText
```
# Receive messages
To show how to receive messages we'll create a simple "echo" server with two functions:
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** (look at them below) 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/allburov/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 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 -v `pwd`/tokens:/app/tokens --network=host -e WHATSAPP_HOOK_ONMESSAGE=http://localhost:5000/message allburov/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.
# Environment variables
## Common
- `DEBUG` - show debug and verbose logs, set in any value
- `WHATSAPP_API_PORT` - listen port for HTTP server (default: `3000`)
- `WHATSAPP_API_HOSTNAME` - Hostname for HTTP server (default: `localhost`)
## Webhooks
The description of [webhooks you can in Venom README.md, section Events](https://github.com/orkestral/venom#events)
All webhooks are disabled by default:
- `WHATSAPP_HOOK_ONMESSAGE=http://localhost/uri`
- `WHATSAPP_HOOK_ONSTATECHANGE=http://localhost/uri`
- `WHATSAPP_HOOK_ONACK=http://localhost/uri`
- `WHATSAPP_HOOK_ONADDEDTOGROUP=http://localhost/uri`
## File storage
- `WHATSAPP_FILES_FOLDER` - folder where will be stored files from chats (images, voice messages) (
default: `/tmp/whatsapp-files`)
- `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)
# Support
If you want to support the project - you can either:
1. Create a Pull Request for desired functionality
2. Support [the project one time, every month or get access to telegram channel on Boosty](https://boosty.to/allburov)
## What is next?
[Go and read the full documentation!](https://waha.devlike.pro/docs/overview/introduction/)
+76 -11
View File
@@ -1,15 +1,80 @@
version: '3.4'
version: '3'
services:
whatsapp-http-api:
build: .
image: allburov/whatsapp-http-api
restart: always
waha:
# Check available Docker images:
# https://waha.devlike.pro/docs/how-to/engines/#docker-images
image: devlikeapro/waha
container_name: waha
ports:
- 3000:3000
shm_size: "1gb"
- '3000:3000/tcp'
environment:
- WHATSAPP_DOWNLOADS_FOLDER=/app/files/downloads
# 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
waha-plus:
# Check available Docker images:
# https://waha.devlike.pro/docs/how-to/engines/#docker-images
image: devlikeapro/waha-plus:chrome
container_name: waha-plus
ports:
- '3000:3000/tcp'
volumes:
- ./tokens:/app/tokens
- ./files:/app/files
- './.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_API_HOSTNAME=localhost
- WHATSAPP_DEFAULT_ENGINE=WEBJS
- WHATSAPP_API_KEY=321
# Username and password for Swagger
- WHATSAPP_SWAGGER_USERNAME=swagger
- WHATSAPP_SWAGGER_PASSWORD=admin
# Username and password for WAHA Dashboard
# you can use the same username and password for both Swagger and Dashboard
# Default - waha / waha
- WAHA_DASHBOARD_USERNAME=waha
- WAHA_DASHBOARD_PASSWORD=waha
# Engine specific environment variables
# - WAHA_WEBJS_WEB_VERSION=2.2412.54-videofix
restart: always
waha-plus--mongodb:
# Check available Docker images:
# https://waha.devlike.pro/docs/how-to/engines/#docker-images
image: devlikeapro/waha-plus:chrome
container_name: waha-plus--mongodb
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_API_KEY=321
# - WHATSAPP_SWAGGER_USERNAME=admin
# - WHATSAPP_SWAGGER_PASSWORD=123
# - WAHA_DASHBOARD_USERNAME=admin
# - WAHA_DASHBOARD_PASSWORD=123
# - WHATSAPP_API_HOSTNAME=localhost
- WHATSAPP_DEFAULT_ENGINE=WEBJS
- WHATSAPP_SESSIONS_MONGO_URL=mongodb://mongodb:27017
restart: always
mongodb:
image: mongo
container_name: mongodb
ports:
- '27017:27017/tcp'
volumes:
- mongodb_data:/data/db
restart: always
volumes:
mongodb_data: {}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 665 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 628 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

-57
View File
@@ -1,57 +0,0 @@
<!-- HTML for static distribution bundle build -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>allburov/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;
}
*,
*: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>
</html>
-77
View File
@@ -1,77 +0,0 @@
<!doctype html>
<html lang="en-US">
<head>
<title>Swagger UI: OAuth2 Redirect</title>
</head>
<body>
</body>
</html>
<script>
'use strict';
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);
} else {
qp = location.search.substring(1);
}
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)
}
) : {}
isValid = qp.state === sentState
if ((
oauth2.auth.schema.get("flow") === "accessCode" ||
oauth2.auth.schema.get("flow") === "authorizationCode"
) && !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"
});
}
if (qp.code) {
delete oauth2.state;
oauth2.auth.code = qp.code;
oauth2.callback({auth: oauth2.auth, redirectUrl: redirectUrl});
} else {
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 : "");
}
oauth2.errCb({
authId: oauth2.auth.name,
source: "auth",
level: "error",
message: oauthErrorMsg || "[Authorization failed]: no accessCode received from the server"
});
}
} else {
oauth2.callback({auth: oauth2.auth, token: qp, isValid: isValid, redirectUrl: redirectUrl});
}
window.close();
}
window.addEventListener('DOMContentLoaded', function () {
run();
});
</script>
-908
View File
@@ -1,908 +0,0 @@
{
"openapi": "3.0.0",
"paths": {
"/api/sessions/start": {
"post": {
"operationId": "SessionsController_start",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SessionRequest"
}
}
}
},
"responses": {
"201": {
"description": ""
}
},
"tags": [
"sessions"
]
}
},
"/api/sessions/stop": {
"post": {
"operationId": "SessionsController_stop",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SessionRequest"
}
}
}
},
"responses": {
"201": {
"description": ""
}
},
"tags": [
"sessions"
]
}
},
"/api/sessions": {
"get": {
"operationId": "SessionsController_list",
"parameters": [],
"responses": {
"200": {
"description": ""
}
},
"tags": [
"sessions"
]
}
},
"/api/sendContactVcard": {
"post": {
"operationId": "ChattingController_sendContactVcard",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MessageContactVcard"
}
}
}
},
"responses": {
"201": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
},
"tags": [
"chatting"
]
}
},
"/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": "sessionName",
"required": true,
"in": "query",
"schema": {
"default": "default",
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
},
"tags": [
"chatting"
]
},
"post": {
"operationId": "ChattingController_sendText",
"summary": "Send a text message",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MessageText"
}
}
}
},
"responses": {
"201": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
},
"tags": [
"chatting"
]
}
},
"/api/sendLocation": {
"post": {
"operationId": "ChattingController_sendLocation",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MessageLocation"
}
}
}
},
"responses": {
"201": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
},
"tags": [
"chatting"
]
}
},
"/api/sendLinkPreview": {
"post": {
"operationId": "ChattingController_sendLinkPreview",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MessageLinkPreview"
}
}
}
},
"responses": {
"201": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
},
"tags": [
"chatting"
]
}
},
"/api/sendImage": {
"post": {
"operationId": "ChattingController_sendImage",
"summary": "NOT IMPLEMENTED YET",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MessageImage"
}
}
}
},
"responses": {
"201": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
},
"tags": [
"chatting"
]
}
},
"/api/sendFile": {
"post": {
"operationId": "ChattingController_sendFile",
"summary": "NOT IMPLEMENTED YET",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MessageFile"
}
}
}
},
"responses": {
"201": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
},
"tags": [
"chatting"
]
}
},
"/api/reply": {
"post": {
"operationId": "ChattingController_reply",
"summary": "Reply to a text message",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MessageReply"
}
}
}
},
"responses": {
"201": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
},
"tags": [
"chatting"
]
}
},
"/api/sendSeen": {
"post": {
"operationId": "ChattingController_sendSeen",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ChatRequest"
}
}
}
},
"responses": {
"201": {
"description": ""
}
},
"tags": [
"chatting"
]
}
},
"/api/startTyping": {
"post": {
"operationId": "ChattingController_startTyping",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ChatRequest"
}
}
}
},
"responses": {
"201": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "boolean"
}
}
}
}
},
"tags": [
"chatting"
]
}
},
"/api/stopTyping": {
"post": {
"operationId": "ChattingController_stopTyping",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ChatRequest"
}
}
}
},
"responses": {
"201": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "boolean"
}
}
}
}
},
"tags": [
"chatting"
]
}
},
"/api/killServiceWorker": {
"post": {
"operationId": "DeviceController_killServiceWorker",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SessionRequest"
}
}
}
},
"responses": {
"201": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "boolean"
}
}
}
}
},
"tags": [
"device"
]
}
},
"/api/restartService": {
"post": {
"operationId": "DeviceController_restartService",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SessionRequest"
}
}
}
},
"responses": {
"201": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "boolean"
}
}
}
}
},
"tags": [
"device"
]
}
},
"/api/getHostDevice": {
"get": {
"operationId": "DeviceController_getHostDevice",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SessionRequest"
}
}
}
},
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
},
"tags": [
"device"
]
}
},
"/api/getConnectionState": {
"get": {
"operationId": "DeviceController_getConnectionState",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SessionRequest"
}
}
}
},
"responses": {
"200": {
"description": ""
}
},
"tags": [
"device"
]
}
},
"/api/getBatteryLevel": {
"get": {
"operationId": "DeviceController_getBatteryLevel",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SessionRequest"
}
}
}
},
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "number"
}
}
}
}
},
"tags": [
"device"
]
}
},
"/api/isConnected": {
"get": {
"operationId": "DeviceController_isConnected",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SessionRequest"
}
}
}
},
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "boolean"
}
}
}
}
},
"tags": [
"device"
]
}
},
"/api/getWAVersion": {
"get": {
"operationId": "DeviceController_getWAVersion",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SessionRequest"
}
}
}
},
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "string"
}
}
}
}
},
"tags": [
"device"
]
}
},
"/api/screenshot": {
"get": {
"operationId": "ScreenshotController_screenshot",
"parameters": [
{
"name": "sessionName",
"required": true,
"in": "query",
"schema": {
"default": "default",
"type": "string"
}
}
],
"responses": {
"200": {
"description": ""
}
},
"tags": [
"screenshot"
]
}
}
},
"info": {
"title": "WhatsApp HTTP API",
"description": "WhatsApp HTTP API that you can configure in a click!",
"version": "1.0",
"contact": {}
},
"tags": [
{
"name": "sessions",
"description": "Control your WhatsApp sessions"
},
{
"name": "screenshot",
"description": "Get screenshot of WhatsApp and show QR code"
},
{
"name": "chatting",
"description": "Chat methods"
},
{
"name": "device",
"description": "Device information"
}
],
"servers": [],
"components": {
"securitySchemes": {
"api_key": {
"type": "apiKey",
"in": "header",
"name": "X-VENOM-TOKEN",
"description": "Your secret key"
}
},
"schemas": {
"SessionRequest": {
"type": "object",
"properties": {
"sessionName": {
"type": "string",
"default": "default"
}
},
"required": [
"sessionName"
]
},
"MessageContactVcard": {
"type": "object",
"properties": {
"sessionName": {
"type": "string",
"default": "default"
},
"chatId": {
"type": "string",
"example": "791231234567@c.us"
},
"contactsId": {
"type": "string"
},
"name": {
"type": "string"
}
},
"required": [
"sessionName",
"chatId",
"contactsId",
"name"
]
},
"MessageText": {
"type": "object",
"properties": {
"sessionName": {
"type": "string",
"default": "default"
},
"chatId": {
"type": "string",
"example": "791231234567@c.us"
},
"text": {
"type": "string"
}
},
"required": [
"sessionName",
"chatId",
"text"
]
},
"MessageLocation": {
"type": "object",
"properties": {
"sessionName": {
"type": "string",
"default": "default"
},
"chatId": {
"type": "string",
"example": "791231234567@c.us"
},
"latitude": {
"type": "string"
},
"longitude": {
"type": "string"
},
"title": {
"type": "string"
}
},
"required": [
"sessionName",
"chatId",
"latitude",
"longitude",
"title"
]
},
"MessageLinkPreview": {
"type": "object",
"properties": {
"sessionName": {
"type": "string",
"default": "default"
},
"chatId": {
"type": "string",
"example": "791231234567@c.us"
},
"url": {
"type": "string"
},
"title": {
"type": "string"
}
},
"required": [
"sessionName",
"chatId",
"url",
"title"
]
},
"MessageImage": {
"type": "object",
"properties": {
"sessionName": {
"type": "string",
"default": "default"
},
"chatId": {
"type": "string",
"example": "791231234567@c.us"
},
"path": {
"type": "string"
},
"filename": {
"type": "string"
},
"caption": {
"type": "string"
}
},
"required": [
"sessionName",
"chatId",
"path",
"filename",
"caption"
]
},
"MessageFile": {
"type": "object",
"properties": {
"sessionName": {
"type": "string",
"default": "default"
},
"chatId": {
"type": "string",
"example": "791231234567@c.us"
},
"path": {
"type": "string"
},
"filename": {
"type": "string"
},
"caption": {
"type": "string"
}
},
"required": [
"sessionName",
"chatId",
"path",
"filename",
"caption"
]
},
"MessageReply": {
"type": "object",
"properties": {
"sessionName": {
"type": "string",
"default": "default"
},
"chatId": {
"type": "string",
"example": "791231234567@c.us"
},
"reply_to": {
"type": "string",
"example": "message.id"
},
"text": {
"type": "string"
}
},
"required": [
"sessionName",
"chatId",
"reply_to",
"text"
]
},
"ChatRequest": {
"type": "object",
"properties": {
"sessionName": {
"type": "string",
"default": "default"
},
"chatId": {
"type": "string",
"example": "791231234567@c.us"
}
},
"required": [
"sessionName",
"chatId"
]
}
}
},
"externalDocs": {
"description": "Github WhatsApp HTTP API",
"url": "https://github.com/allburov/whatsapp-http-api"
}
}
-3
View File
@@ -1,3 +0,0 @@
/*! 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
-1
View File
@@ -1 +0,0 @@
{"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
-3
View File
@@ -1,3 +0,0 @@
/*! 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
-1
View File
@@ -1 +0,0 @@
{"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
-3
View File
@@ -1,3 +0,0 @@
/*! 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
-1
View File
@@ -1 +0,0 @@
{"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
-3
View File
@@ -1,3 +0,0 @@
/*! 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
-1
View File
@@ -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
-11057
View File
File diff suppressed because it is too large. Load diff
-1
View File
@@ -1 +0,0 @@
{"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
-3
View File
@@ -1,3 +0,0 @@
/*! 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
-1
View File
@@ -1 +0,0 @@
{"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
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.
-40
View File
@@ -1,40 +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)
# The text
text = data["body"]
# Number in format 791111111@c.us
from_ = data["from"]
if data.get("clientUrl", None):
# Download file and set text to path
client_url = data["clientUrl"]
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"
+128
View File
@@ -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/waha
# Run the docker container
docker run -it --rm --network=host -e WHATSAPP_HOOK_URL=http://localhost:5000/bot -e "WHATSAPP_HOOK_EVENTS=*" --name waha devlikeapro/waha
# It prints logs and the last line must be
# WhatsApp HTTP API is running on: http://[::1]:3000
```
#### Download image - ARM
If you're using ARM (like Apple Silicon, Apple M1, etc.) - use following
commands to download the image
![](/images/versions/core.png) For Core version the command is
```bash
# Download the image
docker pull devlikeapro/waha:arm
# Rename it, so you can use devlikeapro/waha image in other place
docker tag devlikeapro/waha:arm devlikeapro/waha
# Run the docker container
docker run -it --rm --network=host -e WHATSAPP_HOOK_URL=http://localhost:5000/bot -e "WHATSAPP_HOOK_EVENTS=*" --name waha devlikeapro/waha
# 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/waha.git
# Open python example folder
cd waha/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/waha-plus
# Run the docker container
docker run -it --rm --network=host -e WHATSAPP_HOOK_URL=http://localhost:5000/bot -e "WHATSAPP_HOOK_EVENTS=*" --name waha devlikeapro/waha-plus
```
Run the WhatsApp Download Files bot:
```bash
# Clone the git repository with example
git clone https://github.com/devlikeapro/waha.git
# Open python example folder
cd waha/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!
+3
View File
@@ -0,0 +1,3 @@
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"
+123
View File
@@ -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
View File
@@ -1,2 +0,0 @@
flask
requests
Binary file not shown.
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

+4 -4
View File
@@ -2,8 +2,8 @@
"collection": "@nestjs/schematics",
"sourceRoot": "src",
"compilerOptions": {
"plugins": [
"@nestjs/swagger/plugin"
]
"plugins": ["@nestjs/swagger"],
"assets": ["dashboard/**", "core/engines/webjs/*", "plus/engines/webjs/*"],
"watchAssets": true
}
}
}
-31599
View File
File diff suppressed because it is too large. Load diff
+37 -11
View File
@@ -1,5 +1,5 @@
{
"name": "whatsapp-http-api",
"name": "waha",
"version": "0.0.1",
"description": "",
"author": "",
@@ -12,8 +12,9 @@
"start": "nest start",
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node --unhandled-rejections=none dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"start:prod": "node dist/main",
"start:prod-exit": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix --max-warnings=0",
"test": "jest",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
@@ -21,21 +22,44 @@
"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",
"async-lock": "^1.4.1",
"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",
"puppeteer": "^21.0.0",
"qrcode": "^1.5.1",
"qrcode-terminal": "^0.12.0",
"reflect-metadata": "^0.1.13",
"request": "^2.88.2",
"requestretry": "^4.1.1",
"rimraf": "^3.0.2",
"rxjs": "^7.1.0",
"swagger-ui-express": "^4.1.4",
"venom-bot": "^4.3.0"
"venom-bot": "5.0.1",
"whatsapp-web.js": "https://github.com/devlikeapro/whatsapp-web.js#main-fork-update"
},
"devDependencies": {
"@nestjs/cli": "^9.0.0",
@@ -43,21 +67,22 @@
"@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",
"jest": "26.4.2",
"eslint-plugin-simple-import-sort": "^10.0.0",
"jest": "^29.7.0",
"prettier": "^1.19.1",
"supertest": "^4.0.2",
"ts-jest": "26.2.0",
"ts-jest": "^29.1.3",
"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": [
@@ -66,11 +91,12 @@
"ts"
],
"rootDir": "src",
"testRegex": ".spec.ts$",
"testRegex": ".test.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"coverageDirectory": "../coverage",
"testEnvironment": "node"
}
},
"packageManager": "yarn@3.6.3"
}
+54
View File
@@ -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;
}
}
}
-80
View File
@@ -1,80 +0,0 @@
import {ApiProperty} from "@nestjs/swagger";
import {IsNotEmpty, IsString} from "class-validator";
export const WHATSAPP_DEFAULT_SESSION_NAME = "default"
//
// Queries
//
export class SessionQuery {
@IsNotEmpty()
sessionName: string = WHATSAPP_DEFAULT_SESSION_NAME;
}
export class MessageTextQuery extends SessionQuery {
@IsString()
phone: string
@IsString()
text: string
}
//
// Requests
//
const chatIdProperty = ApiProperty({
example: '791231234567@c.us'
})
const sessionNameProperty = ApiProperty({
default: WHATSAPP_DEFAULT_SESSION_NAME,
})
export class SessionRequest {
@sessionNameProperty
sessionName: string;
}
export class ChatRequest extends SessionRequest {
@chatIdProperty
chatId: string;
}
export class MessageContactVcard extends ChatRequest {
contactsId: string;
name: string
}
export class MessageText extends ChatRequest {
text: string;
}
export class MessageReply extends ChatRequest {
text: string;
@ApiProperty({
example: 'message.id',
})
reply_to: string;
}
export class MessageLocation extends ChatRequest {
latitude: string;
longitude: string;
title: string;
}
export class MessageImage extends ChatRequest {
path: string;
filename: string;
caption: string;
}
export class MessageFile extends ChatRequest {
path: string;
filename: string;
caption: string;
}
export class MessageLinkPreview extends ChatRequest {
url: string;
title: string;
}
+104
View 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 };
+98
View File
@@ -0,0 +1,98 @@
import {
Body,
Controller,
Delete,
Get,
Param,
Post,
Put,
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 { EditMessageRequest } from '../structures/chatting.dto';
import {
ChatIdApiParam,
MessageIdApiParam,
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);
}
@Delete(':chatId/messages/:messageId')
@SessionApiParam
@ChatIdApiParam
@MessageIdApiParam
@ApiOperation({ summary: 'Deletes a message from the chat' })
deleteMessage(
@SessionParam session: WhatsappSession,
@Param('chatId') chatId: string,
@Param('messageId') messageId: string,
) {
return session.deleteMessage(chatId, messageId);
}
@Put(':chatId/messages/:messageId')
@SessionApiParam
@ChatIdApiParam
@MessageIdApiParam
@ApiOperation({ summary: 'Edits a message in the chat' })
editMessage(
@SessionParam session: WhatsappSession,
@Param('chatId') chatId: string,
@Param('messageId') messageId: string,
@Body() body: EditMessageRequest,
) {
return session.editMessage(chatId, messageId, body);
}
}
export { ChatsController };
+159 -85
View File
@@ -1,101 +1,175 @@
import {Body, Controller, Get, NotImplementedException, Post, Query} from '@nestjs/common';
import {ApiOperation, ApiTags} from "@nestjs/swagger";
import {
ChatRequest,
MessageContactVcard,
MessageFile,
MessageImage,
MessageLinkPreview,
MessageLocation,
MessageReply,
MessageText,
MessageTextQuery
} from "./all.dto";
import {ensureSuffix, WhatsappSessionManager} from "../whatsapp.service";
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,
GetMessageQuery,
MessageContactVcardRequest,
MessageFileRequest,
MessageImageRequest,
MessageLinkPreviewRequest,
MessageLocationRequest,
MessagePollRequest,
MessageReactionRequest,
MessageReplyRequest,
MessageStarRequest,
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 whatsappSessionManager: WhatsappSessionManager) {
}
constructor(private manager: SessionManager) {}
@Post('/sendContactVcard')
sendContactVcard(@Body() message: MessageContactVcard) {
const whatsapp = this.whatsappSessionManager.getSession(message.sessionName)
return whatsapp.sendContactVcard(message.chatId, message.contactsId, message.name)
}
@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('/sendText')
@ApiOperation({summary: 'Send a text message'})
sendTextGet(
@Query() message: MessageTextQuery,
) {
const whatsapp = this.whatsappSessionManager.getSession(message.sessionName)
return whatsapp.sendText(ensureSuffix(message.phone), message.text)
}
@Post('/sendContactVcard')
sendContactVcard(@Body() request: MessageContactVcardRequest) {
const whatsapp = this.manager.getSession(request.session);
return whatsapp.sendContactVCard(request);
}
@Post('/sendText')
@ApiOperation({summary: 'Send a text message'})
sendText(@Body() message: MessageText) {
const whatsapp = this.whatsappSessionManager.getSession(message.sessionName)
return whatsapp.sendText(ensureSuffix(message.chatId), message.text)
}
@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('/sendLocation')
sendLocation(@Body() message: MessageLocation) {
const whatsapp = this.whatsappSessionManager.getSession(message.sessionName)
return whatsapp.sendLocation(message.chatId, message.latitude, message.longitude, message.title)
}
@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('/sendLinkPreview')
sendLinkPreview(@Body() message: MessageLinkPreview) {
const whatsapp = this.whatsappSessionManager.getSession(message.sessionName)
return whatsapp.sendLinkPreview(message.chatId, message.url, message.title)
}
@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('/sendImage')
@ApiOperation({summary: 'NOT IMPLEMENTED YET'})
sendImage(@Body() message: MessageImage) {
throw new NotImplementedException();
// TODO: Accept image URL, download it and then send with path
const whatsapp = this.whatsappSessionManager.getSession(message.sessionName)
return whatsapp.sendImage(message.chatId, message.path, message.filename, message.caption)
}
@Post('/sendLocation')
sendLocation(@Body() request: MessageLocationRequest) {
const whatsapp = this.manager.getSession(request.session);
return whatsapp.sendLocation(request);
}
@Post('/sendFile')
@ApiOperation({summary: 'NOT IMPLEMENTED YET'})
sendFile(@Body() message: MessageFile) {
throw new NotImplementedException();
// TODO: Accept File URL, download it and then send with path
const whatsapp = this.whatsappSessionManager.getSession(message.sessionName)
return whatsapp.sendFile(message.chatId, message.path, message.filename, message.caption)
}
@Post('/sendLinkPreview')
sendLinkPreview(@Body() request: MessageLinkPreviewRequest) {
const whatsapp = this.manager.getSession(request.session);
return whatsapp.sendLinkPreview(request);
}
@Post('/reply')
@ApiOperation({summary: 'Reply to a text message'})
reply(@Body() message: MessageReply) {
const whatsapp = this.whatsappSessionManager.getSession(message.sessionName)
return whatsapp.reply(message.chatId, message.text, message.reply_to)
}
@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('/sendSeen')
sendSeen(@Body() chat: ChatRequest) {
const whatsapp = this.whatsappSessionManager.getSession(chat.sessionName)
return whatsapp.sendSeen(chat.chatId)
}
@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('/startTyping')
startTyping(@Body() chat: ChatRequest) {
// It's infinitive action
const whatsapp = this.whatsappSessionManager.getSession(chat.sessionName)
whatsapp.startTyping(chat.chatId)
return true
}
@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('/stopTyping')
stopTyping(@Body() chat: ChatRequest) {
const whatsapp = this.whatsappSessionManager.getSession(chat.sessionName)
whatsapp.stopTyping(chat.chatId)
return true
}
@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('/reply')
@ApiOperation({ summary: 'Reply to a text message' })
reply(@Body() request: MessageReplyRequest) {
const whatsapp = this.manager.getSession(request.session);
return whatsapp.reply(request);
}
@Post('/sendSeen')
sendSeen(@Body() chat: SendSeenRequest) {
const whatsapp = this.manager.getSession(chat.session);
return whatsapp.sendSeen(chat);
}
@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('/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);
}
@Put('/star')
@ApiOperation({ summary: 'Star or unstar a message' })
async setStar(@Body() request: MessageStarRequest) {
const whatsapp = this.manager.getSession(request.session);
await whatsapp.setStar(request);
return;
}
@Get('/messages')
@ApiOperation({ summary: 'Get messages in a chat' })
getMessages(@Query() query: GetMessageQuery) {
const whatsapp = this.manager.getSession(query.session);
return whatsapp.getMessages(query);
}
}
+77
View File
@@ -0,0 +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 { 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) {}
@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('/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('/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);
}
}
-58
View File
@@ -1,58 +0,0 @@
import {Body, Controller, Get, Post} from '@nestjs/common';
import {ApiTags} from "@nestjs/swagger";
import {SessionRequest} from "./all.dto";
import {WhatsappSessionManager} from "../whatsapp.service";
@Controller('api')
@ApiTags('device')
export class DeviceController {
constructor(private whatsappSessionManager: WhatsappSessionManager) {
}
@Post('/killServiceWorker')
killServiceWorker(@Body() request: SessionRequest) {
const whatsapp = this.whatsappSessionManager.getSession(request.sessionName)
return whatsapp.killServiceWorker()
}
@Post('/restartService')
restartService(@Body() request: SessionRequest) {
const whatsapp = this.whatsappSessionManager.getSession(request.sessionName)
return whatsapp.restartService()
}
@Get('/getHostDevice')
getHostDevice(@Body() request: SessionRequest) {
const whatsapp = this.whatsappSessionManager.getSession(request.sessionName)
return whatsapp.getHostDevice()
}
@Get('/getConnectionState')
getConnectionState(@Body() request: SessionRequest) {
const whatsapp = this.whatsappSessionManager.getSession(request.sessionName)
return whatsapp.getConnectionState()
}
@Get('/getBatteryLevel')
getBatteryLevel(@Body() request: SessionRequest) {
const whatsapp = this.whatsappSessionManager.getSession(request.sessionName)
return whatsapp.getBatteryLevel()
}
@Get('/isConnected')
isConnected(@Body() request: SessionRequest) {
const whatsapp = this.whatsappSessionManager.getSession(request.sessionName)
return whatsapp.isConnected()
}
@Get('/getWAVersion')
getWAVersion(@Body() request: SessionRequest) {
const whatsapp = this.whatsappSessionManager.getSession(request.sessionName)
return whatsapp.getWAVersion()
}
}
+70 -24
View File
@@ -1,30 +1,76 @@
import {ArgumentsHost, Catch, ExceptionFilter, HttpException, HttpStatus,} from '@nestjs/common';
import {Request, Response} from 'express';
import {
ArgumentsHost,
Catch,
ExceptionFilter,
HttpException,
HttpStatus,
} from '@nestjs/common';
import { Request, Response } from 'express';
import { VERSION } from '../version';
/**
* Serializer error to JSON.
* Because it's not possible to just pass Error class to JSON.stringify in the nestjs response
* 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));
}
@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(),
path: request.url,
error: exception.message,
stack: exception.stack,
});
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/waha/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,
});
}
}
+228
View File
@@ -0,0 +1,228 @@
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 {
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);
}
}
+17
View File
@@ -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();
}
}
+96
View File
@@ -0,0 +1,96 @@
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);
export const ChatIdApiParam = ApiParam({
name: 'chatId',
required: true,
type: 'string',
description: 'Chat ID',
example: '123456789@c.us',
});
export const MessageIdApiParam = ApiParam({
name: 'messageId',
required: true,
type: 'string',
description: 'Message ID',
example: 'true_123456789@c.us_BAE6A33293978B16',
});
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),
},
},
},
}),
);
}
+89
View File
@@ -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);
}
}
+26 -26
View File
@@ -1,33 +1,33 @@
import {Controller, Get, Query, Res} from '@nestjs/common';
import {ApiTags} from "@nestjs/swagger";
import {Readable} from "stream";
import {Response} from 'express';
import {WhatsappSessionManager} from "../whatsapp.service";
import {SessionQuery} from "./all.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 whatsappSessionManager: WhatsappSessionManager) {
}
constructor(private manager: SessionManager) {}
@Get('/screenshot')
async screenshot(
@Res() res: Response,
@Query() sessionQuery: SessionQuery,
) {
const whatsappService = this.whatsappSessionManager.getService(sessionQuery.sessionName)
const buffer = await whatsappService.getScreenshotOrQRCode();
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();
}
}
+83 -18
View File
@@ -1,30 +1,95 @@
import {Body, Controller, Get, Post} from '@nestjs/common';
import {ApiTags} from "@nestjs/swagger";
import {WhatsappSessionManager} from "../whatsapp.service";
import {SessionRequest} from "./all.dto";
import {
Body,
Controller,
Delete,
Get,
NotFoundException,
Param,
Post,
Query,
} from '@nestjs/common';
import {
ApiExtraModels,
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 {
ListSessionsQuery,
MeInfo,
SessionDTO,
SessionInfo,
SessionLogoutRequest,
SessionStartRequest,
SessionStopRequest,
} from '../structures/sessions.dto';
import { SessionApiParam, SessionParam } from './helpers';
@ApiSecurity('api_key')
@Controller('api/sessions')
@ApiTags('sessions')
export class SessionsController {
constructor(private whatsappSessionManager: WhatsappSessionManager) {
}
class SessionsController {
constructor(private manager: SessionManager) {}
@Post('/start/')
async start(@Body() request: SessionStartRequest): Promise<SessionDTO> {
const result = await this.manager.start(request);
await this.manager.sessionConfigRepository.save(
request.name,
request.config || null,
);
return result;
}
@Post('/start/')
async start(@Body() request: SessionRequest) {
// Do not wait it, because we get venom instance only after scanning QR code
this.whatsappSessionManager.startSession(request.sessionName)
@Post('/stop/')
@ApiOperation({ summary: 'Stop session' })
async stop(@Body() request: SessionStopRequest): Promise<void> {
if (request.logout) {
await this.manager.logout(request);
} else {
await this.manager.stop(request);
}
return;
}
@Post('/stop/')
async stop(@Body() request: SessionRequest) {
await this.whatsappSessionManager.stopSession(request.sessionName)
}
@Post('/logout/')
@ApiOperation({ summary: 'Logout from session.' })
clean(@Body() request: SessionLogoutRequest): Promise<void> {
return this.manager.logout(request);
}
@Get('/')
async list() {
return this.whatsappSessionManager.getAllSessions()
@Get('/')
async list(@Query() query: ListSessionsQuery): Promise<SessionInfo[]> {
const all = parseBool(query.all);
return this.manager.getSessions(all);
}
@Get('/:session')
async get(@Param('session') name: string): Promise<SessionInfo> {
const session = this.manager.getSessionInfo(name);
if (session === null) {
throw new NotFoundException('Session not found');
}
return session;
}
}
@ApiSecurity('api_key')
@Controller('api/sessions/:session')
@ApiTags('sessions')
class SessionController {
constructor(private manager: SessionManager) {}
@Get('me')
@SessionApiParam
@ApiOperation({ summary: 'Get information about the authenticated account' })
getMe(@SessionParam session: WhatsappSession): Promise<MeInfo | null> {
return session.getSessionMeInfo();
}
}
export { SessionController, SessionsController };
+69
View File
@@ -0,0 +1,69 @@
import {
Body,
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 {
ImageStatus,
TextStatus,
VideoStatus,
VoiceStatus,
} from '../structures/status.dto';
import { SessionApiParam, SessionParam } from './helpers';
@ApiSecurity('api_key')
@Controller('api/:session/status')
@ApiTags('status')
class StatusController {
constructor(private manager: SessionManager) {}
@Post('text')
@SessionApiParam
@ApiOperation({ summary: 'Send text status.' })
sendTextStatus(
@SessionParam session: WhatsappSession,
@Body() status: TextStatus,
) {
return session.sendTextStatus(status);
}
@Post('image')
@SessionApiParam
@ApiOperation({ summary: 'Send image status.' })
sendImageStatus(
@SessionParam session: WhatsappSession,
@Body() status: ImageStatus,
) {
return session.sendImageStatus(status);
}
@Post('voice')
@SessionApiParam
@ApiOperation({ summary: 'Send voice status.' })
sendVoiceStatus(
@SessionParam session: WhatsappSession,
@Body() status: VoiceStatus,
) {
return session.sendVoiceStatus(status);
}
@Post('video')
@SessionApiParam
@ApiOperation({ summary: 'Send video status.' })
sendVideoStatus(
@SessionParam session: WhatsappSession,
@Body() status: VideoStatus,
) {
return session.sendVideoStatus(status);
}
}
export { StatusController };
+15
View File
@@ -0,0 +1,15 @@
import { Controller, Get } from '@nestjs/common';
import { ApiExtraModels, ApiSecurity, ApiTags } from '@nestjs/swagger';
import { WAHAEnvironment } from '../structures/environment.dto';
import { VERSION } from '../version';
@ApiSecurity('api_key')
@Controller('api/version')
@ApiTags('other')
export class VersionController {
@Get('')
get(): WAHAEnvironment {
return VERSION;
}
}
-37
View File
@@ -1,37 +0,0 @@
import {ConsoleLogger, Module} from '@nestjs/common';
import {WhatsappSessionManager} from "./whatsapp.service";
import {ScreenshotController} from "./api/screenshot.controller";
import {ConfigModule} from "@nestjs/config";
import {WhatsappConfigService} from "./config.service";
import {ServeStaticModule} from "@nestjs/serve-static";
import {SessionsController} from "./api/sessions.controller";
import {ChattingController} from "./api/chatting.controller";
import {DeviceController} from "./api/device.controller";
@Module({
imports: [
ConfigModule.forRoot({
isGlobal: true,
}),
ServeStaticModule.forRootAsync({
imports: [],
extraProviders: [WhatsappConfigService],
inject: [WhatsappConfigService],
useFactory: (config: WhatsappConfigService) => {
return [{
rootPath: config.filesFolder,
serveRoot: config.files_uri,
}]
},
}),
],
controllers: [
SessionsController,
ChattingController,
DeviceController,
ScreenshotController,
],
providers: [WhatsappSessionManager, ConsoleLogger, WhatsappConfigService],
})
export class AppModule {
}
+129 -38
View File
@@ -1,52 +1,143 @@
import {Injectable} from "@nestjs/common";
import {ConfigService} from "@nestjs/config";
import { Injectable } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { parseBool } from './helpers';
import { WAHAEngine } from './structures/enums.dto';
import { WebhookConfig } from './structures/webhooks.config.dto';
import { getEngineName } from './version';
@Injectable()
export class WhatsappConfigService {
public files_uri = '/api/files'
public schema = "http"
public filesUri = '/api/files';
public schema = 'http';
constructor(private configService: ConfigService) {
}
constructor(private configService: ConfigService) {}
get filesURL(): string {
return `${this.schema}://${this.hostname}:${this.port}${this.files_uri}/`
}
get filesURL(): string {
return `${this.schema}://${this.hostname}:${this.port}${this.filesUri}/`;
}
get hostname(): string {
return this.configService.get(
'WHATSAPP_API_HOSTNAME',
'localhost',
)
}
get hostname(): string {
return this.configService.get('WHATSAPP_API_HOSTNAME', 'localhost');
}
get port(): string {
return this.configService.get(
'WHATSAPP_API_PORT',
'3000',
)
}
get port(): string {
return this.configService.get('WHATSAPP_API_PORT', '3000');
}
get filesFolder(): string {
return this.configService.get(
'WHATSAPP_FILES_FOLDER',
'/tmp/whatsapp-files',
)
}
get filesFolder(): string {
return this.configService.get(
'WHATSAPP_FILES_FOLDER',
'/tmp/whatsapp-files',
);
}
get filesLifetime(): number {
return this.configService.get<number>(
'WHATSAPP_FILES_LIFETIME',
180,
)
}
get filesLifetime(): number {
return this.configService.get<number>('WHATSAPP_FILES_LIFETIME', 180);
}
get mimetypes(): string[] | null {
const types = this.configService.get('WHATSAPP_FILES_MIMETYPES', "")
return types ? types.split(',') : null
get mimetypes(): string[] {
if (!this.shouldDownloadMedia) {
return ['mimetype/ignore-all-media'];
}
const types = this.configService.get('WHATSAPP_FILES_MIMETYPES', '');
return types ? types.split(',') : [];
}
get(name: string): any {
return this.configService.get(name)
get shouldDownloadMedia(): boolean {
const value = this.configService.get('WHATSAPP_DOWNLOAD_MEDIA', 'true');
return parseBool(value);
}
get startSessions(): string[] {
const value: string = this.configService.get('WHATSAPP_START_SESSION', '');
if (!value) {
return [];
}
return value.split(',');
}
get shouldRestartAllSessions(): boolean {
const value: string = this.configService.get(
'WHATSAPP_RESTART_ALL_SESSIONS',
'false',
);
return parseBool(value);
}
get proxyServer(): string[] | string | undefined {
const single = this.configService.get('WHATSAPP_PROXY_SERVER', undefined);
const multipleValues = this.configService.get(
'WHATSAPP_PROXY_SERVER_LIST',
undefined,
);
const multiple = multipleValues ? multipleValues.split(',') : undefined;
return single ? single : multiple;
}
get proxyServerIndexPrefix(): string | undefined {
return this.configService.get(
'WHATSAPP_PROXY_SERVER_INDEX_PREFIX',
undefined,
);
}
get proxyServerUsername(): string | undefined {
return this.configService.get('WHATSAPP_PROXY_SERVER_USERNAME', undefined);
}
get proxyServerPassword(): string | undefined {
return this.configService.get('WHATSAPP_PROXY_SERVER_PASSWORD', undefined);
}
getWebhookConfig(): WebhookConfig | undefined {
const url = this.getWebhookUrl();
const events = this.getWebhookEvents();
if (!url || events.length === 0) {
return undefined;
}
return { url: url, events: events };
}
private getWebhookUrl(): string | undefined {
return this.get('WHATSAPP_HOOK_URL');
}
private getWebhookEvents(): string[] {
const value = this.get('WHATSAPP_HOOK_EVENTS', '');
return value ? value.split(',') : [];
}
getSessionMongoUrl(): string | undefined {
return this.configService.get('WHATSAPP_SESSIONS_MONGO_URL', undefined);
}
get(name: string, defaultValue: any = undefined): any {
return this.configService.get(name, defaultValue);
}
getApiKey(): string | undefined {
return this.configService.get('WHATSAPP_API_KEY', '');
}
getHealthMediaFilesThreshold(): number {
return this.configService.get<number>(
'WHATSAPP_HEALTH_MEDIA_FILES_THRESHOLD_MB',
100,
);
}
getHealthSessionFilesThreshold(): number {
return this.configService.get<number>(
'WHATSAPP_HEALTH_SESSION_FILES_THRESHOLD_MB',
100,
);
}
getHealthMongoTimeout(): number {
return this.configService.get<number>(
'WHATSAPP_HEALTH_MONGO_TIMEOUT_MS',
3000,
);
}
}
+13
View File
@@ -0,0 +1,13 @@
export class QR {
private base64: string;
public raw?: string;
save(base64: string, raw?: string) {
this.base64 = base64.replace(/^data:image\/png;base64,/, '');
this.raw = raw;
}
get(): Buffer {
return Buffer.from(this.base64, 'base64');
}
}
+155
View File
@@ -0,0 +1,155 @@
import { INestApplication } from '@nestjs/common';
import { DocumentBuilder, OpenAPIObject, SwaggerModule } from '@nestjs/swagger';
import { DECORATORS } from '@nestjs/swagger/dist/constants';
import { WhatsappConfigService } from '../config.service';
import { VERSION } from '../version';
import { SwaggerConfigServiceCore } from './config/SwaggerConfigServiceCore';
export class SwaggerConfiguratorCore {
constructor(protected app: INestApplication) {}
get title() {
return 'WAHA - WhatsApp HTTP API';
}
get description() {
return (
'WhatsApp HTTP API that you can run in a click!<br/>' +
'<br/>' +
'Learn more:' +
'<ul>' +
'<li><a href="https://waha.devlike.pro/" target="_blank">Documentation</a></li>' +
'<li><a href="https://waha.devlike.pro/docs/how-to/engines/#features" target="_blank">Supported features in engines</a></li>' +
'<li><a href="https://github.com/devlikeapro/waha" target="_blank">GitHub - WAHA Core</a></li>' +
'<li><a href="https://github.com/devlikeapro/waha-plu' + // Separate line to pass pre-commit check
's" target="_blank">GitHub - WAHA Plus</a></li>' +
'<li><b>NEW!</b> - <a href="/dashboard">WAHA Dashboard</a></li>' +
'<li><b>NEW!</b> - <a href="https://waha.devlike.pro/docs/how-to/waha-dashboard">WAHA Dashboard Documentation</a></li>' +
'</ul>' +
'<p>Support the project and get WAHA Plus version!</p>' +
'<ul>' +
'<li><a href="https://waha.devlike.pro/docs/how-to/plu' + // Separate line to pass pre-commit check
's-version/" target="_blank">WAHA Plus</a></li>' +
'<li><a href="https://patreon.com/wa_http_api/" target="_blank">Patreon</a></li>' +
'<li><a href="https://boosty.to/wa-http-api/" target="_blank">Boosty</a></li>' +
'<li><a href="https://portal.devlike.pro/" target="_blank">Patron Portal</a></li>' +
'</ul>'
);
}
get externalDocUrl() {
return 'https://waha.devlike.pro/';
}
configure(webhooks: any[]) {
const app = this.app;
const builder = new DocumentBuilder();
builder
.setTitle(this.title)
.setDescription(this.description)
.setExternalDoc(this.title, this.externalDocUrl)
.setVersion(VERSION.version)
.addTag('sessions', 'Control WhatsApp sessions')
.addTag('auth', 'Authentication')
.addTag('screenshot', 'Get screenshot of WhatsApp and show QR code')
.addTag('chatting', 'Chatting methods')
.addTag(
'status',
'Status (aka stories) methods. <b>NOWEB</b> engine only!',
)
.addTag('chats', `Chats methods`)
.addTag(
'contacts',
`Contacts methods.<br>
Use phone number (without +) or phone number and \`@c.us\` at the end as \`contactId\`.<br>
'E.g: \`12312312310\` OR \`12312312310@c.us\`<br>`,
)
.addTag('groups', `Groups methods.<br>`)
.addTag('presence', `Presence information`)
.addTag('other', 'Other methods')
.addApiKey({
type: 'apiKey',
description: 'Your secret api key',
name: 'X-Api-Key',
});
const config = app.get(WhatsappConfigService);
const swaggerConfig = app.get(SwaggerConfigServiceCore);
if (swaggerConfig.advancedConfigEnabled) {
builder.addServer('{protocol}://{host}:{port}/{baseUrl}', '', {
protocol: {
default: 'http',
enum: ['http', 'https'],
description: 'The protocol used to access the server.',
},
host: {
default: config.hostname,
description: 'The hostname or IP address of the server.',
},
port: {
default: config.port,
description:
'The port number on which the server is listening for requests',
},
baseUrl: {
default: '',
description:
'The base URL path for all API endpoints. This can be used to group related endpoints together under a common path.',
},
});
}
const swaggerDocumentConfig = builder.build();
const swaggerDocumentOptions = {
extraModels: webhooks,
};
let document = SwaggerModule.createDocument(
app,
swaggerDocumentConfig,
swaggerDocumentOptions,
);
document = this.configureWebhooks(document, webhooks);
SwaggerModule.setup('', app, document, {
customSiteTitle: this.title,
});
}
private configureWebhooks(document: OpenAPIObject, supportedWebhooks) {
document.openapi = '3.1.0';
const webhooks = {};
for (const webhook of supportedWebhooks) {
const eventMetadata = Reflect.getMetadata(
DECORATORS.API_MODEL_PROPERTIES,
webhook.prototype,
'event',
);
const event = new webhook().event;
const schemaName = webhook.name;
webhooks[event] = {
post: {
summary: eventMetadata.description,
requestBody: {
content: {
'application/json': {
schema: {
$ref: `#/components/schemas/${schemaName}`,
},
},
},
},
responses: {
'200': {
description:
'Return a 200 status to indicate that the data was received successfully',
},
},
},
};
}
// @ts-ignore
document.webhooks = webhooks;
return document;
}
}
+1
View File
@@ -0,0 +1 @@
export abstract class DataStore {}
+18
View File
@@ -0,0 +1,18 @@
import { ConsoleLogger, Injectable } from '@nestjs/common';
import { DiskHealthIndicator, HealthCheckService } from '@nestjs/terminus';
import type { HealthCheckResult } from '@nestjs/terminus/dist/health-check/health-check-result.interface';
import { WhatsappConfigService } from '../../config.service';
import { SessionManager } from './manager.abc';
@Injectable()
export abstract class WAHAHealthCheckService {
constructor(
protected sessionManager: SessionManager,
protected health: HealthCheckService,
protected log: ConsoleLogger,
protected config: WhatsappConfigService,
) {}
abstract check(): Promise<HealthCheckResult>;
}
+43
View File
@@ -0,0 +1,43 @@
import { OnApplicationShutdown } from '@nestjs/common';
import { WAHAEngine } from '../../structures/enums.dto';
import {
SessionDTO,
SessionInfo,
SessionLogoutRequest,
SessionStartRequest,
SessionStopRequest,
} from '../../structures/sessions.dto';
import { ISessionAuthRepository } from '../storage/ISessionAuthRepository';
import { ISessionConfigRepository } from '../storage/ISessionConfigRepository';
import { WhatsappSession } from './session.abc';
import { WebhookConductor } from './webhooks.abc';
export abstract class SessionManager implements OnApplicationShutdown {
public store: any;
public sessionAuthRepository: ISessionAuthRepository;
public sessionConfigRepository: ISessionConfigRepository;
protected abstract getEngine(engine: WAHAEngine): typeof WhatsappSession;
protected abstract get EngineClass(): typeof WhatsappSession;
protected abstract get WebhookConductorClass(): typeof WebhookConductor;
abstract onApplicationShutdown(signal?: string);
//
// API Methods
//
abstract start(request: SessionStartRequest): Promise<SessionDTO>;
abstract stop(request: SessionStopRequest): Promise<void>;
abstract logout(request: SessionLogoutRequest): Promise<void>;
abstract getSession(name: string): WhatsappSession;
abstract getSessionInfo(name: string): Promise<SessionInfo | null>;
abstract getSessions(all: boolean): Promise<SessionInfo[]>;
}
+28
View File
@@ -0,0 +1,28 @@
abstract class MediaStorage {
abstract save(
messageId: string,
mimetype: string,
buffer: Buffer,
): Promise<string>;
}
interface IEngineMediaProcessor<Message> {
hasMedia(message: Message): boolean;
getFilename(message: Message): string | null;
getMimetype(message: Message): string;
getMessageId(message: Message): string;
getMediaBuffer(message: Message): Promise<Buffer | null>;
}
interface MediaManager {
processMedia<Message>(
processor: IEngineMediaProcessor<Message>,
message: Message,
): Promise<Message>;
}
export { IEngineMediaProcessor, MediaManager, MediaStorage };
+498
View File
@@ -0,0 +1,498 @@
import { ConsoleLogger } from '@nestjs/common';
import { EventEmitter } from 'events';
import * as fs from 'fs';
import { MessageId } from 'whatsapp-web.js';
import {
ChatRequest,
CheckNumberStatusQuery,
EditMessageRequest,
GetMessageQuery,
MessageContactVcardRequest,
MessageFileRequest,
MessageImageRequest,
MessageLinkPreviewRequest,
MessageLocationRequest,
MessagePollRequest,
MessageReactionRequest,
MessageReplyRequest,
MessageStarRequest,
MessageTextRequest,
MessageVideoRequest,
MessageVoiceRequest,
} from '../../structures/chatting.dto';
import { ContactQuery, ContactRequest } from '../../structures/contacts.dto';
import {
WAHAEngine,
WAHAEvents,
WAHAPresenceStatus,
WAHASessionStatus,
} from '../../structures/enums.dto';
import {
CreateGroupRequest,
ParticipantsRequest,
SettingsSecurityChangeInfo,
} from '../../structures/groups.dto';
import { WAHAChatPresences } from '../../structures/presence.dto';
import {
MeInfo,
ProxyConfig,
SessionConfig,
} from '../../structures/sessions.dto';
import {
ImageStatus,
TextStatus,
VideoStatus,
VoiceStatus,
} from '../../structures/status.dto';
import { WASessionStatusBody } from '../../structures/webhooks.dto';
import { NotImplementedByEngineError } from '../exceptions';
import { QR } from '../QR';
import { DataStore } from './DataStore';
import { MediaManager } from './media.abc';
// eslint-disable-next-line @typescript-eslint/no-var-requires
const qrcode = require('qrcode-terminal');
const CHROME_PATH = '/usr/bin/google-chrome-stable';
const CHROMIUM_PATH = '/usr/bin/chromium';
export function getBrowserExecutablePath() {
if (fs.existsSync(CHROME_PATH)) {
return CHROME_PATH;
}
return CHROMIUM_PATH;
}
export function ensureSuffix(phone) {
const suffix = '@c.us';
if (phone.includes('@')) {
return phone;
}
return phone + suffix;
}
export enum WAHAInternalEvent {
ENGINE_START = 'engine.start',
SESSION_STATUS_CHANGED = 'session.status.changed',
}
export interface SessionParams {
name: string;
printQR: boolean;
mediaManager: MediaManager;
log: ConsoleLogger;
sessionStore: DataStore;
proxyConfig?: ProxyConfig;
sessionConfig?: SessionConfig;
engineConfig?: any;
}
export abstract class WhatsappSession {
public events: EventEmitter;
public engine: WAHAEngine;
public name: string;
protected mediaManager: MediaManager;
protected log: ConsoleLogger;
protected sessionStore: DataStore;
protected proxyConfig?: ProxyConfig;
public sessionConfig?: SessionConfig;
protected engineConfig?: any;
private _status: WAHASessionStatus;
private shouldPrintQR: boolean;
public constructor({
name,
printQR,
log,
sessionStore,
proxyConfig,
mediaManager,
sessionConfig,
engineConfig,
}: SessionParams) {
this.events = new EventEmitter();
this.name = name;
this.proxyConfig = proxyConfig;
this.log = log;
this.sessionStore = sessionStore;
this.mediaManager = mediaManager;
this.sessionConfig = sessionConfig;
this.engineConfig = engineConfig;
this.shouldPrintQR = printQR;
}
protected set status(value: WAHASessionStatus) {
this._status = value;
this.events.emit(WAHAInternalEvent.SESSION_STATUS_CHANGED, value);
}
public get status() {
return this._status;
}
getBrowserExecutablePath() {
return getBrowserExecutablePath();
}
getBrowserArgsForPuppeteer() {
// Run optimized version of Chrome
// References:
// https://github.com/pedroslopez/whatsapp-web.js/issues/1420
// https://www.bannerbear.com/blog/ways-to-speed-up-puppeteer-screenshots/
return [
'--no-sandbox',
'--disable-client-side-phishing-detection',
'--disable-setuid-sandbox',
'--disable-component-update',
'--disable-default-apps',
'--disable-popup-blocking',
'--disable-offer-store-unmasked-wallet-cards',
'--disable-speech-api',
'--hide-scrollbars',
'--mute-audio',
'--disable-extensions',
'--disable-dev-shm-usage',
'--disable-accelerated-2d-canvas',
'--no-first-run',
'--no-default-browser-check',
'--no-pings',
'--password-store=basic',
'--use-mock-keychain',
'--no-zygote',
'--single-process',
'--disable-gpu',
];
}
protected isDebugEnabled() {
return this.log.isLevelEnabled('debug');
}
/** Start the session */
abstract start();
/** Stop the session */
abstract stop(): Promise<void>;
/** Subscribe the handler to specific hook */
subscribeSessionEvent(
hook: WAHAEvents | string,
handler: (message) => void,
): boolean {
switch (hook) {
case WAHAEvents.SESSION_STATUS:
this.events.on(WAHAInternalEvent.SESSION_STATUS_CHANGED, (value) => {
const body: WASessionStatusBody = { name: this.name, status: value };
handler(body);
});
return true;
default:
return false;
}
}
abstract subscribeEngineEvent(
hook: WAHAEvents | string,
handler: (message) => void,
): boolean;
/**
* START - Methods for API
*/
/**
* Auth methods
*/
public getQR(): QR {
throw new NotImplementedByEngineError();
}
public requestCode(phoneNumber: string, method: string, params?: any) {
throw new NotImplementedByEngineError();
}
public authorizeCode(code: string) {
throw new NotImplementedByEngineError();
}
abstract getScreenshot(): Promise<Buffer>;
public getSessionMeInfo(): Promise<MeInfo | null> {
throw new NotImplementedByEngineError();
}
public getCaptcha(): Promise<QR> {
throw new NotImplementedByEngineError();
}
public saveCaptcha(code: string) {
throw new NotImplementedByEngineError();
}
/**
* Other methods
*/
abstract checkNumberStatus(request: CheckNumberStatusQuery);
abstract sendText(request: MessageTextRequest);
sendContactVCard(request: MessageContactVcardRequest) {
throw new NotImplementedByEngineError();
}
sendPoll(request: MessagePollRequest) {
throw new NotImplementedByEngineError();
}
abstract sendLocation(request: MessageLocationRequest);
sendLinkPreview(request: MessageLinkPreviewRequest) {
throw new NotImplementedByEngineError();
}
abstract sendImage(request: MessageImageRequest);
abstract sendFile(request: MessageFileRequest);
abstract sendVoice(request: MessageVoiceRequest);
sendVideo(request: MessageVideoRequest) {
throw new NotImplementedByEngineError();
}
abstract reply(request: MessageReplyRequest);
abstract sendSeen(chat: ChatRequest);
abstract startTyping(chat: ChatRequest);
abstract stopTyping(chat: ChatRequest);
getMessages(query: GetMessageQuery) {
throw new NotImplementedByEngineError();
}
abstract setReaction(request: MessageReactionRequest);
setStar(request: MessageStarRequest): Promise<void> {
throw new NotImplementedByEngineError();
}
/**
* Chats methods
*/
public getChats() {
throw new NotImplementedByEngineError();
}
public deleteChat(chatId) {
throw new NotImplementedByEngineError();
}
public getChatMessages(
chatId: string,
limit: number,
downloadMedia: boolean,
) {
throw new NotImplementedByEngineError();
}
public deleteMessage(chatId: string, messageId: string) {
throw new NotImplementedByEngineError();
}
public editMessage(
chatId: string,
messageId: string,
request: EditMessageRequest,
) {
throw new NotImplementedByEngineError();
}
public clearMessages(chatId) {
throw new NotImplementedByEngineError();
}
/**
* Contacts methods
*/
public getContact(query: ContactQuery) {
throw new NotImplementedByEngineError();
}
public getContacts() {
throw new NotImplementedByEngineError();
}
public getContactAbout(query: ContactQuery) {
throw new NotImplementedByEngineError();
}
public getContactProfilePicture(query: ContactQuery) {
throw new NotImplementedByEngineError();
}
public blockContact(request: ContactRequest) {
throw new NotImplementedByEngineError();
}
public unblockContact(request: ContactRequest) {
throw new NotImplementedByEngineError();
}
/**
* Group methods
*/
public createGroup(request: CreateGroupRequest) {
throw new NotImplementedByEngineError();
}
public getGroups() {
throw new NotImplementedByEngineError();
}
public getGroup(id) {
throw new NotImplementedByEngineError();
}
public getInfoAdminsOnly(id): Promise<SettingsSecurityChangeInfo> {
throw new NotImplementedByEngineError();
}
public setInfoAdminsOnly(id, value) {
throw new NotImplementedByEngineError();
}
public getMessagesAdminsOnly(id): Promise<SettingsSecurityChangeInfo> {
throw new NotImplementedByEngineError();
}
public setMessagesAdminsOnly(id, value) {
throw new NotImplementedByEngineError();
}
public deleteGroup(id) {
throw new NotImplementedByEngineError();
}
public leaveGroup(id) {
throw new NotImplementedByEngineError();
}
public setDescription(id, description) {
throw new NotImplementedByEngineError();
}
public setSubject(id, description) {
throw new NotImplementedByEngineError();
}
public getInviteCode(id): Promise<string> {
throw new NotImplementedByEngineError();
}
public revokeInviteCode(id): Promise<string> {
throw new NotImplementedByEngineError();
}
public getParticipants(id) {
throw new NotImplementedByEngineError();
}
public addParticipants(id, request: ParticipantsRequest) {
throw new NotImplementedByEngineError();
}
public removeParticipants(id, request: ParticipantsRequest) {
throw new NotImplementedByEngineError();
}
public promoteParticipantsToAdmin(id, request: ParticipantsRequest) {
throw new NotImplementedByEngineError();
}
public demoteParticipantsToUser(id, request: ParticipantsRequest) {
throw new NotImplementedByEngineError();
}
public setPresence(presence: WAHAPresenceStatus, chatId?: string) {
throw new NotImplementedByEngineError();
}
public getPresences(): Promise<WAHAChatPresences[]> {
throw new NotImplementedByEngineError();
}
public getPresence(id: string): Promise<WAHAChatPresences> {
throw new NotImplementedByEngineError();
}
public subscribePresence(id: string): Promise<void> {
throw new NotImplementedByEngineError();
}
/**
* Status methods
*/
public sendTextStatus(status: TextStatus) {
throw new NotImplementedByEngineError();
}
public sendImageStatus(status: ImageStatus) {
throw new NotImplementedByEngineError();
}
public sendVoiceStatus(status: VoiceStatus) {
throw new NotImplementedByEngineError();
}
public sendVideoStatus(status: VideoStatus) {
throw new NotImplementedByEngineError();
}
public async getEngineInfo(): Promise<any> {
return {};
}
/**
* END - Methods for API
*/
/**
* Add WhatsApp suffix (@c.us) to the phone number if it doesn't have it yet
* @param phone
*/
protected ensureSuffix(phone) {
return ensureSuffix(phone);
}
protected deserializeId(messageId: string): MessageId {
const parts = messageId.split('_');
return {
fromMe: parts[0] === 'true',
remote: parts[1],
id: parts[2],
_serialized: messageId,
};
}
protected printQR(qr: QR) {
if (!this.shouldPrintQR) {
return;
}
if (!qr.raw) {
this.log.error(
'QR.raw is not available, can not print it in the console',
);
return;
}
this.log.log(
"You can disable QR in console by setting 'WAHA_PRINT_QR=false' in your environment variables.",
);
qrcode.generate(qr.raw, { small: true });
}
}
+20
View File
@@ -0,0 +1,20 @@
import { ConsoleLogger } from '@nestjs/common';
import { WebhookConfig } from '../../structures/webhooks.config.dto';
import { WhatsappSession } from './session.abc';
export abstract class WebhookSender {
protected url: string;
constructor(
protected log: ConsoleLogger,
protected webhookConfig: WebhookConfig,
) {
this.url = webhookConfig.url;
}
abstract send(json);
}
export abstract class WebhookConductor {
abstract configure(session: WhatsappSession, webhooks: WebhookConfig[]);
}
+99
View File
@@ -0,0 +1,99 @@
import { ConsoleLogger, Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import { PassportModule } from '@nestjs/passport';
import { ServeStaticModule } from '@nestjs/serve-static';
import { TerminusModule } from '@nestjs/terminus';
import { join } from 'path';
import { AuthController } from '../api/auth.controller';
import { ChatsController } from '../api/chats.controller';
import { ChattingController } from '../api/chatting.controller';
import { ContactsController } from '../api/contacts.controller';
import { GroupsController } from '../api/groups.controller';
import { HealthController } from '../api/health.controller';
import { PresenceController } from '../api/presence.controller';
import { ScreenshotController } from '../api/screenshot.controller';
import {
SessionController,
SessionsController,
} from '../api/sessions.controller';
import { StatusController } from '../api/status.controller';
import { VersionController } from '../api/version.controller';
import { WhatsappConfigService } from '../config.service';
import { SessionManager } from './abc/manager.abc';
import { WAHAHealthCheckService } from './abc/WAHAHealthCheckService';
import { DashboardConfigServiceCore } from './config/DashboardConfigServiceCore';
import { EngineConfigService } from './config/EngineConfigService';
import { SwaggerConfigServiceCore } from './config/SwaggerConfigServiceCore';
import { WAHAHealthCheckServiceCore } from './health/WAHAHealthCheckServiceCore';
import { SessionManagerCore } from './manager.core';
export const IMPORTS = [
ConfigModule.forRoot({
isGlobal: true,
}),
ServeStaticModule.forRootAsync({
imports: [],
extraProviders: [WhatsappConfigService, DashboardConfigServiceCore],
inject: [WhatsappConfigService, DashboardConfigServiceCore],
useFactory: (
config: WhatsappConfigService,
dashboardConfig: DashboardConfigServiceCore,
) => {
const options = [
// Serve files (media)
{
rootPath: config.filesFolder,
serveRoot: config.filesUri,
},
];
if (dashboardConfig.enabled) {
options.push({
rootPath: join(__dirname, '..', 'dashboard'),
serveRoot: dashboardConfig.dashboardUri,
});
}
return options;
},
}),
PassportModule,
TerminusModule,
];
export const CONTROLLERS = [
AuthController,
SessionsController,
SessionController,
ChattingController,
ChatsController,
StatusController,
ContactsController,
GroupsController,
PresenceController,
ScreenshotController,
VersionController,
HealthController,
];
const PROVIDERS = [
{
provide: SessionManager,
useClass: SessionManagerCore,
},
{
provide: WAHAHealthCheckService,
useClass: WAHAHealthCheckServiceCore,
},
DashboardConfigServiceCore,
SwaggerConfigServiceCore,
WhatsappConfigService,
EngineConfigService,
ConsoleLogger,
];
@Module({
imports: IMPORTS,
controllers: CONTROLLERS,
providers: PROVIDERS,
})
export class AppModuleCore {
constructor(protected config: WhatsappConfigService) {}
}
@@ -0,0 +1,16 @@
import { Injectable } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { parseBool } from '../../helpers';
@Injectable()
export class DashboardConfigServiceCore {
public dashboardUri = '/dashboard';
constructor(protected configService: ConfigService) {}
get enabled(): boolean {
const value = this.configService.get('WAHA_DASHBOARD_ENABLED', 'true');
return parseBool(value);
}
}
+27
View File
@@ -0,0 +1,27 @@
import { Injectable } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { parseBool } from '../../helpers';
import { WAHAEngine } from '../../structures/enums.dto';
import { getEngineName } from '../../version';
@Injectable()
export class EngineConfigService {
constructor(protected configService: ConfigService) {}
getDefaultEngineName(): WAHAEngine {
const value = getEngineName();
if (value in WAHAEngine) {
return WAHAEngine[value];
}
console.log(
`Unknown WhatsApp default engine WHATSAPP_DEFAULT_ENGINE=${value}. Using WEBJS`,
);
return WAHAEngine.WEBJS;
}
get shouldPrintQR(): boolean {
const value = this.configService.get('WAHA_PRINT_QR', true);
return parseBool(value);
}
}
@@ -0,0 +1,17 @@
import { Injectable } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { parseBool } from '../../helpers';
@Injectable()
export class SwaggerConfigServiceCore {
constructor(protected configService: ConfigService) {}
get advancedConfigEnabled(): boolean {
const value = this.configService.get(
'WHATSAPP_SWAGGER_CONFIG_ADVANCED',
false,
);
return parseBool(value);
}
}
@@ -0,0 +1,17 @@
import { DataStore } from '../../abc/DataStore';
import { LocalStore } from '../../storage/LocalStore';
import { useMultiFileAuthState } from './useMultiFileAuthState';
export class NowebAuthFactoryCore {
buildAuth(store: DataStore, name: string) {
if (store instanceof LocalStore) return this.buildLocalAuth(store, name);
throw new Error(`Unsupported store type '${store.constructor.name}'`);
}
protected async buildLocalAuth(store: LocalStore, name: string) {
await store.init(name);
const authFolder = store.getSessionDirectory(name);
const { state, saveCreds } = await useMultiFileAuthState(authFolder);
return { state, saveCreds };
}
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,115 @@
import {
AuthenticationCreds,
AuthenticationState,
proto,
} from '@adiwajshing/baileys';
import { BufferJSON, initAuthCreds } from '@adiwajshing/baileys/lib/Utils';
import { mkdir, readFile, stat, unlink, writeFile } from 'fs/promises';
import { join } from 'path';
// eslint-disable-next-line @typescript-eslint/no-var-requires
const AsyncLock = require('async-lock');
// We need to lock files due to the fact that we are using async functions to read and write files
// https://github.com/WhiskeySockets/Baileys/issues/794
// https://github.com/nodejs/node/issues/26338
// Default pending is 1000, set it to infinity
// https://github.com/rogierschouten/async-lock/issues/63
const fileLock = new AsyncLock({ maxPending: Infinity });
/**
* stores the full authentication state in a single folder.
* Far more efficient than singlefileauthstate
*
* Again, I wouldn't endorse this for any production level use other than perhaps a bot.
* Would recommend writing an auth state for use with a proper SQL or No-SQL DB
* */
export const useMultiFileAuthState = async (
folder: string,
): Promise<{
state: AuthenticationState;
saveCreds: () => Promise<void>;
}> => {
const writeData = (data: any, file: string) => {
const filePath = join(folder, fixFileName(file));
return fileLock.acquire(filePath, () =>
writeFile(join(filePath), JSON.stringify(data, BufferJSON.replacer)),
);
};
const readData = async (file: string) => {
try {
const filePath = join(folder, fixFileName(file));
const data = await fileLock.acquire(filePath, () =>
readFile(filePath, { encoding: 'utf-8' }),
);
return JSON.parse(data, BufferJSON.reviver);
} catch (error) {
return null;
}
};
const removeData = async (file: string) => {
try {
const filePath = join(folder, fixFileName(file));
await fileLock.acquire(filePath, () => unlink(filePath));
} catch {}
};
const folderInfo = await stat(folder).catch(() => {
return null;
});
if (folderInfo) {
if (!folderInfo.isDirectory()) {
throw new Error(
`found something that is not a directory at ${folder}, either delete it or specify a different location`,
);
}
} else {
await mkdir(folder, { recursive: true });
}
const fixFileName = (file?: string) =>
file?.replace(/\//g, '__')?.replace(/:/g, '-') || '';
const creds: AuthenticationCreds =
(await readData('creds.json')) || initAuthCreds();
return {
state: {
creds,
keys: {
get: async (type, ids) => {
const data = {};
await Promise.all(
ids.map(async (id) => {
let value = await readData(`${type}-${id}.json`);
if (type === 'app-state-sync-key' && value) {
value = proto.Message.AppStateSyncKeyData.fromObject(value);
}
data[id] = value;
}),
);
return data;
},
set: async (data) => {
const tasks: Promise<void>[] = [];
for (const category in data) {
for (const id in data[category]) {
const value = data[category][id];
const file = `${category}-${id}.json`;
tasks.push(value ? writeData(value, file) : removeData(file));
}
}
await Promise.all(tasks);
},
},
},
saveCreds: () => {
return writeData(creds, 'creds.json');
},
};
};
+14
View File
@@ -0,0 +1,14 @@
import { extractMessageContent, proto } from '@adiwajshing/baileys';
export function extractMediaContent(
content: proto.IMessage | null | undefined,
) {
content = extractMessageContent(content);
const mediaContent =
content?.documentMessage ||
content?.imageMessage ||
content?.videoMessage ||
content?.audioMessage ||
content?.stickerMessage;
return mediaContent;
}
@@ -0,0 +1,306 @@
import { UnprocessableEntityException } from '@nestjs/common/exceptions/unprocessable-entity.exception';
import * as Buffer from 'buffer';
import { create, CreateConfig, Message, Whatsapp } from 'venom-bot';
import {
ChatRequest,
CheckNumberStatusQuery,
GetMessageQuery,
MessageFileRequest,
MessageImageRequest,
MessageLinkPreviewRequest,
MessageLocationRequest,
MessageReactionRequest,
MessageReplyRequest,
MessageTextRequest,
WANumberExistResult,
} from '../../../structures/chatting.dto';
import {
WAHAEngine,
WAHAEvents,
WAHASessionStatus,
} from '../../../structures/enums.dto';
import { WAMessage } from '../../../structures/responses.dto';
import { IEngineMediaProcessor } from '../../abc/media.abc';
import { WAHAInternalEvent, WhatsappSession } from '../../abc/session.abc';
import { NotImplementedByEngineError } from '../../exceptions';
import { QR } from '../../QR';
export class WhatsappSessionVenomCore extends WhatsappSession {
engine = WAHAEngine.VENOM;
whatsapp: Whatsapp;
private qr: QR;
public constructor(config) {
super(config);
this.qr = new QR();
}
protected buildClient() {
const venomOptions: CreateConfig = {
headless: true,
devtools: false,
debug: false,
logQR: true,
browserArgs: this.getBrowserArgsForPuppeteer(),
autoClose: 60000,
puppeteerOptions: {},
};
this.addProxyConfig(venomOptions);
return create(this.name, this.getCatchQR(), undefined, venomOptions);
}
protected addProxyConfig(venomOptions: CreateConfig) {
if (this.proxyConfig?.server !== undefined) {
venomOptions.addProxy = [this.proxyConfig?.server];
}
if (
this.proxyConfig?.username !== undefined &&
this.proxyConfig?.password !== undefined
) {
venomOptions.userProxy = this.proxyConfig?.username;
venomOptions.userPass = this.proxyConfig?.password;
}
}
protected getCatchQR() {
return (base64Qrimg, asciiQR, attempts, urlCode) => {
this.qr.save(base64Qrimg, urlCode);
this.printQR(this.qr);
this.status = WAHASessionStatus.SCAN_QR_CODE;
this.log.debug('Number of attempts to read the qrcode: ', attempts);
};
}
async start() {
this.status = WAHASessionStatus.STARTING;
try {
this.whatsapp = await this.buildClient();
} catch (error) {
this.status = WAHASessionStatus.FAILED;
this.log.error(error);
this.qr.save('');
return;
}
this.status = WAHASessionStatus.WORKING;
this.events.emit(WAHAInternalEvent.ENGINE_START);
return this;
}
async stop() {
await this.whatsapp.close();
this.status = WAHASessionStatus.STOPPED;
}
subscribeEngineEvent(event: WAHAEvents | string, handler: (message) => void) {
switch (event) {
case WAHAEvents.MESSAGE:
this.whatsapp.onMessage((message: Message) =>
this.processIncomingMessage(message).then(handler),
);
return true;
case WAHAEvents.MESSAGE_ANY:
this.whatsapp.onAnyMessage((message: Message) =>
this.processIncomingMessage(message).then(handler),
);
return true;
case WAHAEvents.STATE_CHANGE:
this.whatsapp.onStateChange(handler);
return true;
case WAHAEvents.MESSAGE_ACK:
this.whatsapp.onAck(handler);
return true;
case WAHAEvents.GROUP_JOIN:
this.whatsapp.onAddedToGroup(handler);
return true;
default:
return false;
}
}
/**
* START - Methods for API
*/
/**
* Auth methods
*/
public getQR(): QR {
return this.qr;
}
getScreenshot(): Promise<Buffer> {
if (this.status === WAHASessionStatus.STARTING) {
throw new UnprocessableEntityException(
`The session is starting, please try again after few seconds`,
);
} else if (this.status === WAHASessionStatus.SCAN_QR_CODE) {
return Promise.resolve(this.qr.get());
} else if (this.status === WAHASessionStatus.WORKING) {
return this.whatsapp.page.screenshot();
} else {
throw new UnprocessableEntityException(`Unknown status - ${this.status}`);
}
}
async checkNumberStatus(
request: CheckNumberStatusQuery,
): Promise<WANumberExistResult> {
try {
return await this.whatsapp.checkNumberStatus(
this.ensureSuffix(request.phone),
);
} catch (error) {
// Catch number doesn't exist error and return it as is
if (error.status === 404 && !error.numberExists) {
return error;
}
throw error;
}
}
sendText(request: MessageTextRequest) {
return this.whatsapp.sendText(
this.ensureSuffix(request.chatId),
request.text,
);
}
reply(request: MessageReplyRequest) {
return this.whatsapp.reply(request.chatId, request.text, request.reply_to);
}
sendFile(request: MessageFileRequest) {
throw new NotImplementedByEngineError();
}
sendImage(request: MessageImageRequest) {
throw new NotImplementedByEngineError();
}
async sendVoice(request) {
throw new NotImplementedByEngineError();
}
sendLinkPreview(request: MessageLinkPreviewRequest) {
return this.whatsapp.sendLinkPreview(
request.chatId,
request.url,
request.title,
);
}
sendLocation(request: MessageLocationRequest) {
return this.whatsapp.sendLocation(
request.chatId,
String(request.latitude),
String(request.longitude),
request.title,
);
}
sendSeen(chat: ChatRequest) {
return this.whatsapp.markMarkSeenMessage(chat.chatId);
}
startTyping(chat: ChatRequest) {
return this.whatsapp.startTyping(chat.chatId, false);
}
stopTyping(chat: ChatRequest) {
return;
// The method is not available yet in new venom-bot
// return this.whatsapp.stopTyping(chat.chatId);
}
async getChatMessages(chatId: string, limit: number) {
const messages = await this.whatsapp.getAllMessagesInChat(
chatId,
true,
false,
);
// Go over messages, download media, and convert to right format.
const result = [];
for (const [count, message] of messages.entries()) {
if (count > limit) {
// Have enough in the list, stop processing
break;
}
result.push(await this.processIncomingMessage(message));
}
return result;
}
async getMessages(query: GetMessageQuery) {
return this.getChatMessages(query.chatId, query.limit);
}
setReaction(request: MessageReactionRequest) {
throw new NotImplementedByEngineError();
}
/**
* END - Methods for API
*/
protected downloadMedia(message: Message) {
const processor = new EngineMediaProcessor(this);
return this.mediaManager.processMedia(processor, message);
}
private processIncomingMessage(message: Message) {
return this.downloadMedia(message).then(this.toWAMessage);
}
protected toWAMessage(message: Message): Promise<WAMessage> {
// @ts-ignore
return Promise.resolve({
id: message.id,
timestamp: message.timestamp,
from: message.from,
fromMe: message.fromMe,
to: message.to,
body: message.body,
// Media
// @ts-ignore
hasMedia: Boolean(message.media),
// @ts-ignore
media: message.media,
// @ts-ignore
mediaUrl: message.media?.url,
// @ts-ignore
ack: message.ack,
location: undefined,
vCards: undefined,
_data: message,
});
}
}
export class EngineMediaProcessor implements IEngineMediaProcessor<Message> {
constructor(public session: WhatsappSessionVenomCore) {}
hasMedia(message: any): boolean {
if (!message.isMMS || !message.isMedia) {
return message;
}
}
getMessageId(message: any): string {
return '';
}
getMimetype(message: any): string {
return '';
}
getMediaBuffer(message: any): Promise<Buffer | null> {
return Promise.resolve(undefined);
}
getFilename(message: Message): string | null {
return null;
}
}
+535
View File
@@ -0,0 +1,535 @@
<!doctype html>
<html class="no-js" dir="ltr" loc="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>WhatsApp Web</title>
<meta name="viewport" content="width=device-width" />
<meta name="google" content="notranslate" />
<meta name="format-detection" content="telephone=no" />
<meta
name="description"
content="Quickly send and receive WhatsApp messages right from your computer."
/>
<meta
name="og:description"
content="Quickly send and receive WhatsApp messages right from your computer."
/>
<meta name="og:url" content="https://web.whatsapp.com/" />
<meta name="og:title" content="WhatsApp Web" />
<meta
name="og:image"
content="https://static.facebook.com/images/whatsapp/www/whatsapp-promo.png"
/>
<link
id="favicon"
rel="shortcut icon"
href="/img/favicon/1x/favicon.png"
type="image/png"
/>
<link
rel="apple-touch-icon"
sizes="192x192"
href="/apple-touch-icon.png"
type="image/png"
/>
<meta
name="theme-color"
content="#111b21"
media="(prefers-color-scheme: dark)"
/>
<meta name="theme-color" content="#f0f2f5" />
<link
id="whatsapp-pwa-manifest-link"
rel="manifest"
href="/manifest.json"
crossorigin="use-credentials"
/>
<style>
#initial_startup {
--startup-background: #f0f2f5;
--startup-background-rgb: 240, 242, 245;
--startup-icon: #bbc5cb;
--secondary-lighter: #8696a0;
--primary-title: #41525d;
--progress-primary: #00c298;
--progress-background: #e9edef;
}
.dark #initial_startup {
--startup-background: #111b21;
--startup-background-rgb: 17, 27, 33;
--startup-icon: #676f73;
--primary-title: rgba(233, 237, 239, 0.88);
--secondary-lighter: #667781;
--progress-primary: #0b846d;
--progress-background: #233138;
}
#app,
body,
html {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
overflow: hidden;
}
#app {
position: absolute;
top: 0;
left: 0;
}
#initial_startup {
position: fixed;
top: 0;
left: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
user-select: none;
background-color: var(--startup-background);
}
#initial_startup .graphic {
margin-top: -40px;
color: var(--startup-icon);
}
#initial_startup .graphic .resume-logo {
transform: translateX(calc(50% - 52px / 2));
}
#initial_startup .graphic::after {
position: relative;
top: -100%;
left: calc(50% - 72px * 2 - 72px / 2);
display: block;
width: calc(72px * 3);
height: 100%;
content: '';
background: linear-gradient(
to right,
rgba(var(--startup-background-rgb), 0.5) 0,
rgba(var(--startup-background-rgb), 0.5) 33.33%,
rgba(var(--startup-background-rgb), 0) 44.1%,
rgba(var(--startup-background-rgb), 0) 55.8%,
rgba(var(--startup-background-rgb), 0.5) 66.66%,
rgba(var(--startup-background-rgb), 0.5) 100%
);
opacity: 1;
animation: shimmer 1.5s linear 0.6s infinite;
}
html[dir='rtl'] #initial_startup .graphic::after {
animation-direction: reverse;
}
@keyframes shimmer {
from {
left: calc(50% - 72px * 2 - 72px / 2);
}
to {
left: calc(50% - 72px / 2);
}
}
#initial_startup .progress {
position: relative;
width: 420px;
height: 3px;
margin-top: 40px;
}
#initial_startup .progress progress {
vertical-align: top;
}
#initial_startup .main {
margin-top: 40px;
font-size: 17px;
color: var(--primary-title);
}
#initial_startup .secondary {
margin-top: 12px;
font-size: 14px;
color: var(--secondary-lighter);
}
#initial_startup .secondary span {
display: inline-block;
margin-bottom: 2px;
vertical-align: middle;
}
progress {
-webkit-appearance: none;
appearance: none;
width: 100%;
height: 3px;
margin: 0;
color: var(--progress-primary);
background-color: var(--progress-background);
border: none;
}
progress[value]::-webkit-progress-bar {
background-color: var(--progress-background);
}
progress[value]::-moz-progress-bar,
progress[value]::-webkit-progress-value {
background-color: var(--progress-primary);
transition: width 0.45s ease;
}
</style>
<link
href="/stylex-f0601c57714fe972a8c4d2c2562f8082.css"
rel="stylesheet"
/>
<link href="/app-6113f1562d101247269b.css" rel="stylesheet" />
</head>
<body class="web">
<script
data-binary-transparency-hash-key="inline-js-d11c72a06542fc3b43af600028cf0f996e4b9b178dfa047e18730efaf74aab0b"
>
try {
var systemThemeDark,
theme = window.localStorage.getItem('theme'),
systemThemeMode = window.localStorage.getItem('system-theme-mode');
if (('true' === systemThemeMode || !theme) && window.matchMedia) {
var systemTheme = window.matchMedia('(prefers-color-scheme: dark)');
systemThemeDark = systemTheme && systemTheme.matches;
}
var darkTheme = '"dark"' === theme || Boolean(systemThemeDark);
darkTheme && document.body.classList.add('dark');
} catch (e) {}
</script>
<div id="app"></div>
<div id="hard_expire_time" data-time="1719543128.405"></div>
<div id="initial_startup">
<div class="graphic">
<span
><svg width="250" height="52" xmlns="http://www.w3.org/2000/svg">
<path
class="resume-logo"
d="M37.7 31.2c-.6-.4-3.8-2-4.4-2.1-.6-.2-1-.4-1.4.3l-2 2.5c-.4.4-.8.5-1.5.2-.6-.3-2.7-1-5.1-3.2-2-1.7-3.2-3.8-3.6-4.5-.4-.6 0-1 .3-1.3l1-1.1.6-1.1c.2-.4 0-.8 0-1.1l-2-4.8c-.6-1.3-1.1-1-1.5-1.1h-1.2c-.5 0-1.2.1-1.8.8-.5.6-2.2 2.2-2.2 5.3 0 3.2 2.3 6.3 2.6 6.7.3.4 4.6 7 11 9.7l3.7 1.4c1.5.5 3 .4 4 .2 1.3-.1 3.9-1.5 4.4-3 .5-1.5.5-2.8.4-3-.2-.4-.6-.5-1.3-.8M26 47.2c-3.9 0-7.6-1-11-3l-.7-.4-8.1 2L8.4 38l-.6-.8A21.4 21.4 0 0126 4.4a21.3 21.3 0 0121.4 21.4c0 11.8-9.6 21.4-21.4 21.4M44.2 7.6a25.8 25.8 0 00-40.6 31L0 52l13.7-3.6A25.8 25.8 0 0044.3 7.5"
fill="currentColor"
></path></svg
></span>
</div>
<div class="progress">
<progress value="0" max="100" dir="ltr"></progress>
</div>
<div class="main">WhatsApp</div>
<div class="secondary">
<span
><svg width="10" height="12" xmlns="http://www.w3.org/2000/svg">
<path
d="M5 1.6c1.4 0 2.5 1 2.6 2.4v1.5h.2c.5 0 1 .4 1 1V10c0 .6-.5 1-1 1H2.3a1 1 0 01-1.1-1V6.5c0-.6.5-1 1-1h.2V4.2c0-1.4 1-2.5 2.4-2.6H5zm0 1.2c-.7 0-1.3.6-1.3 1.3v1.4h2.6V4.2c0-.7-.4-1.2-1-1.3H5z"
fill="currentColor"
></path>
</svg> </span
>&nbsp;End-to-end encrypted
</div>
</div>
<link
rel="preload"
crossorigin="anonymous"
as="fetch"
href="/binary-transparency-manifest-2.2412.54.json"
id="binary-transparency-manifest-preload"
/>
<script src="/libsignal-protocol-ee5b8ba.min.js"></script>
<script defer="defer" src="/runtime.295f0230b6dbd8983513.js"></script>
<script
data-binary-transparency-hash-key="inline-js-cdf06293c99d00ee0c1bc0fcfdbd76a7ae9aef6290926dbff0cba3a7994b7fca"
>
/*! Copyright (c) 2024 WhatsApp Inc. All Rights Reserved. */
(self.webpackChunkwhatsapp_web_client =
self.webpackChunkwhatsapp_web_client || []).push([
[5617],
{
307914: (e) => {
e.exports = function (e) {
return e && e.__esModule ? e : { default: e };
};
},
595318: (e) => {
(e.exports = function (e) {
return e && e.__esModule ? e : { default: e };
}),
(e.exports.default = e.exports),
(e.exports.__esModule = !0);
},
415227: (e, t) => {
'use strict';
Object.defineProperty(t, '__esModule', { value: !0 }),
(t.default = function (e) {
const t = new Error(e);
if (void 0 === t.stack)
try {
throw t;
} catch (e) {}
return t;
});
},
670983: (e, t, r) => {
'use strict';
var n = r(307914);
Object.defineProperty(t, '__esModule', { value: !0 }),
(t.default = function (e) {
let t =
arguments.length > 1 && void 0 !== arguments[1]
? arguments[1]
: '?';
if (null == e)
throw (0, o.default)('Unexpected null or undefined: ' + t);
return e;
});
var o = n(r(415227));
},
250473: (e, t, r) => {
'use strict';
Object.defineProperty(t, '__esModule', { value: !0 }),
(t.UNIQUE_UPLOADS_ALLOWED_BEFORE_THROTTLE =
t.TICKET_URL =
t.CLB_URL =
t.CLB_TOKEN =
t.CLB_CHECK_URL =
void 0);
var n = r(508247);
(t.CLB_CHECK_URL =
'https://crashlogs.whatsapp.net/wa_fls_upload_check'),
(t.CLB_TOKEN =
'1063127757113399|745146ffa34413f9dbb5469f5370b7af'),
(t.CLB_URL = 'https://crashlogs.whatsapp.net/wa_clb_data');
const o = n.DYN_ORIGIN + 'web-contact-us';
(t.TICKET_URL = o), (t.UNIQUE_UPLOADS_ALLOWED_BEFORE_THROTTLE = 0);
},
207024: (e, t, r) => {
'use strict';
var n = r(595318);
Object.defineProperty(t, '__esModule', { value: !0 }),
(t.getDistribution = function () {
let e = 'unknown';
return (e = 'prod'), 'web_prod';
}),
(t.getLogUserAgent = function (e) {
let t,
{ appVersion: r, browser: n, device: o } = e;
return (t = 'Web/' + n), `WhatsApp/${r} ${t} Device/${o}`;
}),
n(r(472514)),
n(r(556869));
},
794858: (e, t, r) => {
'use strict';
var n = r(595318),
o = n(r(670983)),
a = r(508247),
s = r(250473),
c = r(207024),
_ = n(r(174285)),
u = r(425017);
function i(e) {
!(function (e, t) {
const r = window.navigator.userAgent;
if (r === p && e.includes('getElementsByTagName')) return;
const n = new FormData(),
i = new Blob([e], { type: 'text/plain' });
n.append(
'from_jid',
(function () {
if (f) return f;
try {
(f = JSON.parse(
(0, o.default)(_.default, 'localStorage').getItem(
d.UNKNOWN_ID,
),
)),
f && (f = f.replace('-', ''));
} catch (e) {}
if (!f) {
f = 'unknown' + Math.floor(1e10 * Math.random());
const e = f;
try {
(0, o.default)(_.default, 'localStorage').setItem(
d.UNKNOWN_ID,
JSON.stringify(e),
);
} catch (e) {}
}
return (0, o.default)(f, 'id');
})(),
),
n.append(
'agent',
(0, c.getLogUserAgent)(
(0, u.parseUASimple)(r, a.VERSION_BASE),
),
),
n.append('file', i, 'logs.txt'),
n.append('tags', 'load');
const l = new XMLHttpRequest(),
I =
s.CLB_URL +
'?access_token=' +
encodeURIComponent(s.CLB_TOKEN);
l.open('POST', I, !0), l.send(n);
})(e);
}
function l(e) {
let { error: t, reason: r, stack: n } = e;
const o = new Date().toISOString();
return `${o}: error: ${t}\n${o}: reason for logs: ${r}\n${o}: userAgent: ${window.navigator.userAgent}\n${n}`;
}
null == window.onerror &&
(window.onerror = function (e, t, r) {
const n = t.split('?')[0];
return "Uncaught SyntaxError: Unexpected token '<'" === e
? ((function (e) {
i(
l({
error: 'failed to load a js or css bundle',
reason: `failed to load [${e
.split('/')[3]
.replace(/^\//, '')}]`,
stack: '',
}),
);
})(n),
!0)
: (i(
l({
error: e,
reason: `Error at [${n}:${r}]`,
stack: '',
}),
),
!1);
});
const d = { UNKNOWN_ID: a.UNKNOWN_ID },
p =
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36';
let f;
},
425017: (e, t) => {
'use strict';
function r(e) {
return e.includes('windows')
? 'Windows'
: e.includes('mac')
? 'Mac OS'
: e.includes('linux')
? 'Linux'
: 'Unparsed';
}
Object.defineProperty(t, '__esModule', { value: !0 }),
(t.parseUASimple = function (e, t) {
const n = e.toLowerCase();
return { browser: s(n), device: r(n), appVersion: t };
});
const n = /(chrome|firefox)\/([\w\.]+)/i,
o = /(edge|opr)\/([\w\.]+)/i,
a = {
chrome: 'Chrome',
edge: 'Edge',
opr: 'Opera',
firefox: 'Firefox',
};
function s(e) {
const t = e.match(o) || e.match(n);
return null == t ? 'Unparsed' : `${a[t[1]]} ${t[2]}`;
}
},
174285: (e, t) => {
'use strict';
let r;
Object.defineProperty(t, '__esModule', { value: !0 }),
(t.default = void 0);
try {
r = window.localStorage;
} catch (e) {}
var n = r;
t.default = n;
},
508247: (e, t) => {
'use strict';
Object.defineProperty(t, '__esModule', { value: !0 }),
(t.WS_ORIGIN =
t.WEB_PUBLIC_PATH =
t.VERSION_TERTIARY =
t.VERSION_STR =
t.VERSION_SECONDARY =
t.VERSION_PRIMARY =
t.VERSION_BASE =
t.USER_TIMINGS =
t.UNKNOWN_ID =
t.LOCALHOST_ENV_CONFIG =
t.HASH_PLACEHOLDER =
t.FLB_PLATFORM =
t.FB_APP_ID =
t.DYN_ORIGIN =
t.DIFF_VERSION =
t.DIFF_ID =
t.BUILD_URL =
t.BUILD_TIMESTAMP =
t.BUILD_ID =
void 0);
t.DIFF_ID = '';
(t.DIFF_VERSION = ''),
(t.LOCALHOST_ENV_CONFIG = !1),
(t.HASH_PLACEHOLDER = '507042ed75b89fb00e8ef35da3541122cbc261e6'),
(t.VERSION_PRIMARY = '2'),
(t.VERSION_SECONDARY = '2412'),
(t.VERSION_TERTIARY = '54'),
(t.VERSION_BASE = '2.2412.54'),
(t.VERSION_STR = '2.2412.54'),
(t.DYN_ORIGIN = 'https://web.whatsapp.com/'),
(t.WS_ORIGIN = ''),
(t.FLB_PLATFORM = 'web'),
(t.FB_APP_ID = ''),
(t.UNKNOWN_ID = 'WAUnknownID'),
(t.BUILD_ID = '583059957'),
(t.BUILD_TIMESTAMP = 'March 29, 2024'),
(t.WEB_PUBLIC_PATH = '/'),
(t.BUILD_URL = 'https://web.whatsapp.com/'),
(t.USER_TIMINGS = !1);
},
472514: (e, t) => {
'use strict';
Object.defineProperty(t, '__esModule', { value: !0 }),
(t.default = function (e) {
return e.default;
});
},
556869: (e, t) => {
'use strict';
Object.defineProperty(t, '__esModule', { value: !0 }),
(t.default = function e(t) {
const r = new Error(t);
if (void 0 === r.stack)
try {
throw e;
} catch (e) {}
return r;
});
},
},
(e) => {
'use strict';
e((e.s = 794858));
},
]);
</script>
<script defer="defer" src="/vendor1~app.264a01b6133c4a120327.js"></script>
<script defer="defer" src="/app.2c7f8dd150ae88037cde.js"></script>
<script
data-binary-transparency-hash-key="inline-js-9c8cd3d0f4d5af8c7f5cd1c45208edd308bfe472e353a50e4cbacbf6cb58627c"
>
((i) => {
const l = document.getElementById(i);
l &&
fetch(l.href)
.then((b) => b.text())
.then((code) => {
const script = document.createElement('script');
script.id = 'binary-transparency-manifest';
script.type = 'application/json';
script.innerHTML = code;
document.body.append(script);
});
})('binary-transparency-manifest-preload');
</script>
</body>
</html>
@@ -0,0 +1,790 @@
import { UnprocessableEntityException } from '@nestjs/common/exceptions/unprocessable-entity.exception';
import {
Chat,
Client,
ClientOptions,
Contact,
Events,
GroupChat,
Location,
Message,
Reaction,
} from 'whatsapp-web.js';
import { Message as MessageInstance } from 'whatsapp-web.js/src/structures';
import {
ChatRequest,
CheckNumberStatusQuery,
EditMessageRequest,
GetMessageQuery,
MessageFileRequest,
MessageImageRequest,
MessageLocationRequest,
MessageReactionRequest,
MessageReplyRequest,
MessageStarRequest,
MessageTextRequest,
MessageVoiceRequest,
SendSeenRequest,
WANumberExistResult,
} from '../../../structures/chatting.dto';
import { ContactQuery, ContactRequest } from '../../../structures/contacts.dto';
import {
ACK_UNKNOWN,
SECOND,
WAHAEngine,
WAHAEvents,
WAHAPresenceStatus,
WAHASessionStatus,
WAMessageAck,
} from '../../../structures/enums.dto';
import {
CreateGroupRequest,
ParticipantsRequest,
SettingsSecurityChangeInfo,
} from '../../../structures/groups.dto';
import {
WAMessage,
WAMessageReaction,
} from '../../../structures/responses.dto';
import { MeInfo } from '../../../structures/sessions.dto';
import { WAMessageRevokedBody } from '../../../structures/webhooks.dto';
import { IEngineMediaProcessor } from '../../abc/media.abc';
import { WAHAInternalEvent, WhatsappSession } from '../../abc/session.abc';
import {
AvailableInPlusVersion,
NotImplementedByEngineError,
} from '../../exceptions';
import { QR } from '../../QR';
// eslint-disable-next-line @typescript-eslint/no-var-requires
const QRCode = require('qrcode');
// eslint-disable-next-line @typescript-eslint/no-var-requires
const qrcode = require('qrcode-terminal');
export interface WebJSConfig {
webVersion?: string;
}
export class WhatsappSessionWebJSCore extends WhatsappSession {
private START_ATTEMPT_DELAY_SECONDS = 2;
engine = WAHAEngine.WEBJS;
protected engineConfig?: WebJSConfig;
private startTimeoutId: null | ReturnType<typeof setTimeout> = null;
private shouldRestart: boolean;
whatsapp: Client;
protected qr: QR;
public constructor(config) {
super(config);
this.qr = new QR();
this.shouldRestart = true;
}
/**
* Folder with the current class
*/
protected getClassDirName() {
return __dirname;
}
protected getClientOptions(): ClientOptions {
const path = this.getClassDirName();
const webVersion = this.engineConfig?.webVersion || '2.2412.54';
this.log.debug(`Using web version: '${webVersion}'`);
return {
puppeteer: {
headless: true,
executablePath: this.getBrowserExecutablePath(),
args: this.getBrowserArgsForPuppeteer(),
dumpio: this.isDebugEnabled(),
},
webVersion: webVersion,
webVersionCache: {
type: 'local',
path: path,
strict: true,
},
};
}
protected async buildClient() {
const clientOptions = this.getClientOptions();
this.addProxyConfig(clientOptions);
return new Client(clientOptions);
}
private restartClient() {
if (!this.shouldRestart) {
this.log.debug("Shouldn't restart the client, ignoring restart request");
return;
}
if (this.startTimeoutId) {
const msg =
'Request to restart is already in progress, ignoring restart request';
this.log.warn(msg);
return;
}
this.log.log(
`Setting up client start in ${this.START_ATTEMPT_DELAY_SECONDS} seconds...`,
);
this.startTimeoutId = setTimeout(() => {
this.startTimeoutId = undefined;
this.start();
}, this.START_ATTEMPT_DELAY_SECONDS * SECOND);
}
protected addProxyConfig(clientOptions: ClientOptions) {
if (this.proxyConfig?.server !== undefined) {
// push the proxy server to the args
clientOptions.puppeteer.args.push(
`--proxy-server=${this.proxyConfig?.server}`,
);
// Authenticate
if (this.proxyConfig?.username && this.proxyConfig?.password) {
clientOptions.proxyAuthentication = {
username: this.proxyConfig?.username,
password: this.proxyConfig?.password,
};
}
}
}
protected async init() {
await this.end();
this.shouldRestart = true;
this.whatsapp = await this.buildClient();
this.whatsapp
.initialize()
.then(() => {
// Listen for browser disconnected event
this.whatsapp.pupBrowser.on('disconnected', () => {
this.status = WAHASessionStatus.FAILED;
this.log.error('The browser has been disconnected');
this.restartClient();
});
// Listen for page close event
this.whatsapp.pupPage.on('close', () => {
this.status = WAHASessionStatus.FAILED;
this.log.error('The WhatsApp Web page has been closed');
this.restartClient();
});
// Listen for page error event
if (this.isDebugEnabled()) {
this.log.debug("Logging 'console' event for web page");
this.whatsapp.pupPage.on('console', (msg) =>
this.log.debug(`WEBJS page log: ${msg.text()}`),
);
this.whatsapp.pupPage.evaluate(() =>
console.log(`url is ${location.href}`),
);
}
})
.catch((error) => {
this.status = WAHASessionStatus.FAILED;
this.log.error(error);
this.restartClient();
return;
});
if (this.isDebugEnabled()) {
this.listenEngineEventsInDebugMode();
}
this.listenConnectionEvents();
this.events.emit(WAHAInternalEvent.ENGINE_START);
}
async start() {
this.status = WAHASessionStatus.STARTING;
await this.init();
return this;
}
async stop() {
this.shouldRestart = false;
this.status = WAHASessionStatus.STOPPED;
await this.end();
}
private async end() {
try {
this.whatsapp?.removeAllListeners();
clearInterval(this.startTimeoutId);
this.whatsapp?.destroy().catch((error) => {
this.log.debug('Failed to destroy the client', error);
});
} catch (error) {
this.log.error(error);
}
}
async getSessionMeInfo(): Promise<MeInfo | null> {
const clientInfo = this.whatsapp?.info;
if (!clientInfo) {
return null;
}
const wid = clientInfo.wid;
const meInfo: MeInfo = {
id: wid._serialized,
pushName: clientInfo.pushname,
};
return meInfo;
}
protected listenEngineEventsInDebugMode() {
// Iterate over Events enum and log with debug level all incoming events
// This is useful for debugging
for (const key in Events) {
const event = Events[key];
this.whatsapp.on(event, (...data: any[]) => {
const log = { event: event, data: data };
this.log.debug(`WEBJS event: ${JSON.stringify(log)}`);
});
}
}
protected listenConnectionEvents() {
this.whatsapp.on(Events.QR_RECEIVED, async (qr) => {
this.log.debug('QR received');
// Convert to image and save
const url = await QRCode.toDataURL(qr);
this.qr.save(url, qr);
this.printQR(this.qr);
this.status = WAHASessionStatus.SCAN_QR_CODE;
});
this.whatsapp.on(Events.READY, () => {
this.status = WAHASessionStatus.WORKING;
this.qr.save('');
this.log.log(`Session '${this.name}' has been authenticated!`);
});
this.whatsapp.on(Events.DISCONNECTED, () => {
this.status = WAHASessionStatus.FAILED;
this.qr.save('');
this.log.log(`Session '${this.name}' has been disconnected!`);
});
}
/**
* START - Methods for API
*/
/**
* Auth methods
*/
public getQR(): QR {
return this.qr;
}
async getScreenshot(): Promise<Buffer> {
if (this.status === WAHASessionStatus.FAILED) {
throw new UnprocessableEntityException(
`The session under FAILED status. Please try to restart it.`,
);
}
const screenshot = await this.whatsapp.pupPage.screenshot({
encoding: 'binary',
});
return screenshot as Buffer;
}
async checkNumberStatus(
request: CheckNumberStatusQuery,
): Promise<WANumberExistResult> {
const phone = request.phone.split('@')[0];
const result = await this.whatsapp.getNumberId(phone);
if (!result) {
return {
numberExists: false,
};
}
return {
numberExists: true,
chatId: result._serialized,
};
}
sendText(request: MessageTextRequest) {
const options = {
// It's fine to sent just ids instead of Contact object
mentions: request.mentions as unknown as string[],
};
return this.whatsapp.sendMessage(
this.ensureSuffix(request.chatId),
request.text,
options,
);
}
public deleteMessage(chatId: string, messageId: string) {
const message = this.recreateMessage(messageId);
return message.delete(true);
}
public editMessage(
chatId: string,
messageId: string,
request: EditMessageRequest,
) {
const message = this.recreateMessage(messageId);
const options = {
// It's fine to sent just ids instead of Contact object
mentions: request.mentions as unknown as string[],
};
return message.edit(request.text, options);
}
reply(request: MessageReplyRequest) {
const options = {
quotedMessageId: request.reply_to,
// It's fine to sent just ids instead of Contact object
mentions: request.mentions as unknown as string[],
};
return this.whatsapp.sendMessage(request.chatId, request.text, options);
}
sendImage(request: MessageImageRequest) {
throw new AvailableInPlusVersion();
}
sendFile(request: MessageFileRequest) {
throw new AvailableInPlusVersion();
}
sendVoice(request: MessageVoiceRequest) {
throw new AvailableInPlusVersion();
}
async sendLocation(request: MessageLocationRequest) {
const location = new Location(request.latitude, request.longitude, {
name: request.title,
});
return this.whatsapp.sendMessage(request.chatId, location);
}
async sendSeen(request: SendSeenRequest) {
const chat: Chat = await this.whatsapp.getChatById(request.chatId);
await chat.sendSeen();
}
async startTyping(request: ChatRequest) {
const chat: Chat = await this.whatsapp.getChatById(request.chatId);
await chat.sendStateTyping();
}
async stopTyping(request: ChatRequest) {
const chat: Chat = await this.whatsapp.getChatById(request.chatId);
await chat.clearState();
}
async getMessages(query: GetMessageQuery) {
return this.getChatMessages(query.chatId, query.limit, query.downloadMedia);
}
async setReaction(request: MessageReactionRequest) {
const message = this.recreateMessage(request.messageId);
return message.react(request.reaction);
}
/**
* Recreate message instance from id
*/
private recreateMessage(msgId: string): MessageInstance {
const messageId = this.deserializeId(msgId);
const data = {
id: messageId,
};
return new MessageInstance(this.whatsapp, data);
}
async setStar(request: MessageStarRequest) {
const message = this.recreateMessage(request.messageId);
if (request.star) {
await message.star();
} else {
await message.unstar();
}
}
/**
* Chats methods
*/
getChats() {
return this.whatsapp.getChats();
}
async getChatMessages(chatId: string, limit: number, downloadMedia: boolean) {
const chat: Chat = await this.whatsapp.getChatById(
this.ensureSuffix(chatId),
);
const messages = await chat.fetchMessages({
limit: limit,
});
// Go over messages, download media, and convert to right format.
const result = [];
for (const message of messages) {
const msg = await this.processIncomingMessage(message, downloadMedia);
result.push(msg);
}
return result;
}
async deleteChat(chatId) {
const chat = await this.whatsapp.getChatById(chatId);
return chat.delete();
}
async clearMessages(chatId) {
const chat = await this.whatsapp.getChatById(chatId);
return chat.clearMessages();
}
/**
* Contacts methods
*/
getContact(query: ContactQuery) {
return this.whatsapp
.getContactById(this.ensureSuffix(query.contactId))
.then(this.toWAContact);
}
getContacts() {
return this.whatsapp
.getContacts()
.then((contacts) => contacts.map(this.toWAContact));
}
public async getContactAbout(query: ContactQuery) {
const contact = await this.whatsapp.getContactById(
this.ensureSuffix(query.contactId),
);
return { about: await contact.getAbout() };
}
public async getContactProfilePicture(query: ContactQuery) {
const contact = await this.whatsapp.getContactById(
this.ensureSuffix(query.contactId),
);
return { profilePictureURL: await contact.getProfilePicUrl() };
}
public async blockContact(request: ContactRequest) {
const contact = await this.whatsapp.getContactById(
this.ensureSuffix(request.contactId),
);
await contact.block();
}
public async unblockContact(request: ContactRequest) {
const contact = await this.whatsapp.getContactById(
this.ensureSuffix(request.contactId),
);
await contact.unblock();
}
/**
* Group methods
*/
public createGroup(request: CreateGroupRequest) {
const participantIds = request.participants.map(
(participant) => participant.id,
);
return this.whatsapp.createGroup(request.name, participantIds);
}
public async getInfoAdminsOnly(id): Promise<SettingsSecurityChangeInfo> {
const groupChat = (await this.whatsapp.getChatById(id)) as GroupChat;
return {
// Undocumented property, can be changed in the future
// @ts-ignore
adminsOnly: groupChat.groupMetadata.restrict,
};
}
public async setInfoAdminsOnly(id, value) {
const groupChat = (await this.whatsapp.getChatById(id)) as GroupChat;
return groupChat.setInfoAdminsOnly(value);
}
public async getMessagesAdminsOnly(id): Promise<SettingsSecurityChangeInfo> {
const groupChat = (await this.whatsapp.getChatById(id)) as GroupChat;
// @ts-ignore
return {
// Undocumented property, can be changed in the future
// @ts-ignore
adminsOnly: groupChat.groupMetadata.announce,
};
}
public async setMessagesAdminsOnly(id, value) {
const groupChat = (await this.whatsapp.getChatById(id)) as GroupChat;
return groupChat.setMessagesAdminsOnly(value);
}
public getGroups() {
return this.whatsapp
.getChats()
.then((chats) => chats.filter((chat) => chat.isGroup));
}
public getGroup(id) {
return this.whatsapp.getChatById(id);
}
public async deleteGroup(id) {
const groupChat = (await this.whatsapp.getChatById(id)) as GroupChat;
return groupChat.delete();
}
public async leaveGroup(id) {
const groupChat = (await this.whatsapp.getChatById(id)) as GroupChat;
return groupChat.leave();
}
public async setDescription(id, description) {
const groupChat = (await this.whatsapp.getChatById(id)) as GroupChat;
return groupChat.setDescription(description);
}
public async setSubject(id, subject) {
const groupChat = (await this.whatsapp.getChatById(id)) as GroupChat;
return groupChat.setSubject(subject);
}
public async getInviteCode(id): Promise<string> {
const groupChat = (await this.whatsapp.getChatById(id)) as GroupChat;
return groupChat.getInviteCode();
}
public async revokeInviteCode(id): Promise<string> {
const groupChat = (await this.whatsapp.getChatById(id)) as GroupChat;
await groupChat.revokeInvite();
return groupChat.getInviteCode();
}
public async getParticipants(id) {
const groupChat = (await this.whatsapp.getChatById(id)) as GroupChat;
return groupChat.participants;
}
public async addParticipants(id, request: ParticipantsRequest) {
const groupChat = (await this.whatsapp.getChatById(id)) as GroupChat;
const participantIds = request.participants.map(
(participant) => participant.id,
);
return groupChat.addParticipants(participantIds);
}
public async removeParticipants(id, request: ParticipantsRequest) {
const groupChat = (await this.whatsapp.getChatById(id)) as GroupChat;
const participantIds = request.participants.map(
(participant) => participant.id,
);
return groupChat.removeParticipants(participantIds);
}
public async promoteParticipantsToAdmin(id, request: ParticipantsRequest) {
const groupChat = (await this.whatsapp.getChatById(id)) as GroupChat;
const participantIds = request.participants.map(
(participant) => participant.id,
);
return groupChat.promoteParticipants(participantIds);
}
public async demoteParticipantsToUser(id, request: ParticipantsRequest) {
const groupChat = (await this.whatsapp.getChatById(id)) as GroupChat;
const participantIds = request.participants.map(
(participant) => participant.id,
);
return groupChat.demoteParticipants(participantIds);
}
public async setPresence(presence: WAHAPresenceStatus, chatId?: string) {
let chat: Chat;
switch (presence) {
case WAHAPresenceStatus.ONLINE:
await this.whatsapp.sendPresenceAvailable();
break;
case WAHAPresenceStatus.OFFLINE:
await this.whatsapp.sendPresenceUnavailable();
break;
case WAHAPresenceStatus.TYPING:
chat = await this.whatsapp.getChatById(chatId);
await chat.sendStateTyping();
break;
case WAHAPresenceStatus.RECORDING:
chat = await this.whatsapp.getChatById(chatId);
await chat.sendStateRecording();
break;
case WAHAPresenceStatus.PAUSED:
chat = await this.whatsapp.getChatById(chatId);
await chat.clearState();
break;
default:
throw new NotImplementedByEngineError(
`WEBJS engine doesn't support '${presence}' presence.`,
);
}
}
/**
* END - Methods for API
*/
subscribeEngineEvent(event, handler): boolean {
switch (event) {
case WAHAEvents.MESSAGE:
this.whatsapp.on(Events.MESSAGE_RECEIVED, (message) =>
this.processIncomingMessage(message).then(handler),
);
return true;
case WAHAEvents.MESSAGE_REVOKED:
this.whatsapp.on(
Events.MESSAGE_REVOKED_EVERYONE,
async (after, before) => {
const afterMessage = after ? await this.toWAMessage(after) : null;
const beforeMessage = before
? await this.toWAMessage(before)
: null;
const body: WAMessageRevokedBody = {
after: afterMessage,
before: beforeMessage,
};
handler(body);
},
);
return true;
case WAHAEvents.MESSAGE_REACTION:
this.whatsapp.on('message_reaction', (message) =>
handler(this.processMessageReaction(message)),
);
return true;
case WAHAEvents.MESSAGE_ANY:
this.whatsapp.on(Events.MESSAGE_CREATE, (message) =>
this.processIncomingMessage(message).then(handler),
);
return true;
case WAHAEvents.STATE_CHANGE:
this.whatsapp.on(Events.STATE_CHANGED, handler);
return true;
case WAHAEvents.MESSAGE_ACK:
// We do not download media here
this.whatsapp.on(Events.MESSAGE_ACK, (message) =>
this.toWAMessage(message).then(handler),
);
return true;
case WAHAEvents.GROUP_JOIN:
this.whatsapp.on(Events.GROUP_JOIN, handler);
return true;
case WAHAEvents.GROUP_LEAVE:
this.whatsapp.on(Events.GROUP_LEAVE, handler);
return true;
default:
return false;
}
}
private async processIncomingMessage(message: Message, downloadMedia = true) {
if (downloadMedia) {
try {
message = await this.downloadMedia(message);
} catch (e) {
this.log.error('Failed when tried to download media for a message');
this.log.error(e, e.stack);
}
}
return await this.toWAMessage(message);
}
private processMessageReaction(reaction: Reaction): WAMessageReaction {
return {
id: reaction.id._serialized,
from: reaction.senderId,
fromMe: reaction.id.fromMe,
participant: reaction.senderId,
to: reaction.id.remote,
timestamp: reaction.timestamp,
reaction: {
text: reaction.reaction,
messageId: reaction.msgId._serialized,
},
};
}
protected toWAMessage(message: Message): Promise<WAMessage> {
// @ts-ignore
return Promise.resolve({
id: message.id._serialized,
timestamp: message.timestamp,
from: message.from,
fromMe: message.fromMe,
to: message.to,
body: message.body,
// Media
// @ts-ignore
hasMedia: Boolean(message.media),
// @ts-ignore
media: message.media,
// @ts-ignore
mediaUrl: message.media?.url,
// @ts-ignore
ack: message.ack,
ackName: WAMessageAck[message.ack] || ACK_UNKNOWN,
location: message.location,
vCards: message.vCards,
_data: message.rawData,
});
}
public async getEngineInfo() {
return {
WWebVersion: await this.whatsapp?.getWWebVersion(),
state: await this.whatsapp?.getState(),
};
}
protected toWAContact(contact: Contact) {
// @ts-ignore
contact.id = contact.id._serialized;
return contact;
}
protected downloadMedia(message: Message) {
const processor = new EngineMediaProcessor();
return this.mediaManager.processMedia(processor, message);
}
}
export class EngineMediaProcessor implements IEngineMediaProcessor<Message> {
hasMedia(message: Message): boolean {
if (!message.hasMedia) {
return false;
}
// Can't get media for revoked messages
return message.type !== 'revoked';
}
getMessageId(message: Message): string {
return '';
}
getMimetype(message: Message): string {
return '';
}
getMediaBuffer(message: Message): Promise<Buffer | null> {
return Promise.resolve(undefined);
}
getFilename(message: Message): string | null {
// @ts-ignore
return message.rawData?.filename || null;
}
}
+21
View File
@@ -0,0 +1,21 @@
import { UnprocessableEntityException } from '@nestjs/common';
export const DOCS_URL = 'https://waha.devlike.pro/';
export class NotImplementedByEngineError extends UnprocessableEntityException {
constructor(msg = '') {
let error = 'The method is not implemented by the engine.';
if (msg) {
error += ` ${msg}`;
}
super(error);
}
}
export class AvailableInPlusVersion extends UnprocessableEntityException {
constructor() {
super(
`The feature is available only in Plus version. Check this out: ${DOCS_URL}`,
);
}
}
@@ -0,0 +1,12 @@
import { Injectable } from '@nestjs/common';
import { HealthCheckResult } from '@nestjs/terminus';
import { WAHAHealthCheckService } from '../abc/WAHAHealthCheckService';
import { AvailableInPlusVersion } from '../exceptions';
@Injectable()
export class WAHAHealthCheckServiceCore extends WAHAHealthCheckService {
check(): Promise<HealthCheckResult> {
throw new AvailableInPlusVersion();
}
}
+73
View File
@@ -0,0 +1,73 @@
import { Agent } from 'https';
import { HttpsProxyAgent } from 'https-proxy-agent';
import { URL } from 'url';
import { WhatsappConfigService } from '../config.service';
import { ProxyConfig } from '../structures/sessions.dto';
import { WhatsappSession } from './abc/session.abc';
export function getProxyConfig(
config: WhatsappConfigService,
sessions: Record<string, WhatsappSession>,
sessionName: string,
): ProxyConfig | undefined {
// Single proxy server configuration
if (typeof config.proxyServer === 'string') {
return {
server: config.proxyServer,
username: config.proxyServerUsername,
password: config.proxyServerPassword,
};
}
// Multiple proxy server configuration
if (Array.isArray(config.proxyServer)) {
const prefix = config.proxyServerIndexPrefix;
let indexToUse: number | undefined = undefined;
if (prefix && sessionName.includes(prefix)) {
// match numbers at the end of the string
const matches = sessionName.match(/\d+$/);
indexToUse = matches ? parseInt(matches[0], 10) : undefined;
}
let idx = 0;
idx = Object.keys(sessions).length % config.proxyServer.length;
const index = indexToUse ? indexToUse % config.proxyServer.length : idx;
return {
server: config.proxyServer[index],
username: config.proxyServerUsername,
password: config.proxyServerPassword,
};
}
// No proxy server configuration
return undefined;
}
function getAuthenticatedUrl(
url: string,
username: string,
password: string,
): string {
const hasSchema = url.startsWith('http://') || url.startsWith('https://');
if (!hasSchema) {
url = `http://${url}`;
}
const parsedUrl = new URL(url);
parsedUrl.protocol = parsedUrl.protocol || 'http';
parsedUrl.username = username;
parsedUrl.password = password;
return parsedUrl.toString();
}
/**
* Return https Agent proxy for the config
* @param proxyConfig
*/
export function createAgentProxy(proxyConfig: ProxyConfig): Agent | undefined {
const url = getAuthenticatedUrl(
proxyConfig.server,
proxyConfig.username || '',
proxyConfig.password || '',
);
return new HttpsProxyAgent(url);
}
+21
View File
@@ -0,0 +1,21 @@
export function toVcard(data): string {
if (data.vcard) {
return data.vcard;
}
const parts = [];
parts.push('BEGIN:VCARD');
parts.push('VERSION:3.0');
parts.push(`FN:${data.fullName}`);
if (data.organization) {
parts.push(`ORG:${data.organization};`);
}
if (data.whatsappId) {
parts.push(
`TEL;type=CELL;type=VOICE;waid=${data.whatsappId}:${data.phoneNumber}`,
);
} else {
parts.push(`TEL;type=CELL;type=VOICE:${data.phoneNumber}`);
}
parts.push('END:VCARD');
return parts.join('\n');
}
+259
View File
@@ -0,0 +1,259 @@
import {
ConsoleLogger,
Injectable,
LogLevel,
NotFoundException,
UnprocessableEntityException,
} from '@nestjs/common';
import { WhatsappConfigService } from '../config.service';
import { getLogLevels } from '../helpers';
import { WAHAEngine, WAHASessionStatus } from '../structures/enums.dto';
import {
ProxyConfig,
SessionDTO,
SessionInfo,
SessionLogoutRequest,
SessionStartRequest,
SessionStopRequest,
} from '../structures/sessions.dto';
import { WebhookConfig } from '../structures/webhooks.config.dto';
import { SessionManager } from './abc/manager.abc';
import { SessionParams, WhatsappSession } from './abc/session.abc';
import { EngineConfigService } from './config/EngineConfigService';
import { WhatsappSessionNoWebCore } from './engines/noweb/session.noweb.core';
import { WhatsappSessionVenomCore } from './engines/venom/session.venom.core';
import { WhatsappSessionWebJSCore } from './engines/webjs/session.webjs.core';
import { DOCS_URL } from './exceptions';
import { getProxyConfig } from './helpers.proxy';
import { CoreMediaManager, MediaStorageCore } from './media.core';
import { LocalSessionAuthRepository } from './storage/LocalSessionAuthRepository';
import { LocalSessionConfigRepository } from './storage/LocalSessionConfigRepository';
import { LocalStoreCore } from './storage/LocalStoreCore';
import { WebhookConductorCore } from './webhooks.core';
export class OnlyDefaultSessionIsAllowed extends UnprocessableEntityException {
constructor() {
super(
`WAHA Core support only 'default' session. If you want to run more then one WhatsApp account - please get WAHA PLUS version. Check this out: ${DOCS_URL}`,
);
}
}
export function buildLogger(name: string, levels: LogLevel[]) {
return new ConsoleLogger(name, { logLevels: levels });
}
@Injectable()
export class SessionManagerCore extends SessionManager {
private session?: WhatsappSession;
DEFAULT = 'default';
// @ts-ignore
protected WebhookConductorClass = WebhookConductorCore;
protected readonly EngineClass: typeof WhatsappSession;
constructor(
private config: WhatsappConfigService,
private log: ConsoleLogger,
private engineConfigService: EngineConfigService,
) {
super();
this.log.setContext('SessionManager');
this.session = undefined;
const engineName = this.engineConfigService.getDefaultEngineName();
this.EngineClass = this.getEngine(engineName);
this.store = new LocalStoreCore(engineName.toLowerCase());
this.sessionAuthRepository = new LocalSessionAuthRepository(this.store);
this.sessionConfigRepository = new LocalSessionConfigRepository(this.store);
this.startPredefinedSessions();
}
protected startPredefinedSessions() {
const startSessions = this.config.startSessions;
startSessions.forEach((sessionName) => {
this.start({ name: sessionName });
});
}
protected getEngine(engine: WAHAEngine): typeof WhatsappSession {
if (engine === WAHAEngine.WEBJS) {
return WhatsappSessionWebJSCore;
} else if (engine === WAHAEngine.VENOM) {
return WhatsappSessionVenomCore;
} else if (engine === WAHAEngine.NOWEB) {
return WhatsappSessionNoWebCore;
} else {
throw new NotFoundException(`Unknown whatsapp engine '${engine}'.`);
}
}
private onlyDefault(name: string) {
if (name !== this.DEFAULT) {
throw new OnlyDefaultSessionIsAllowed();
}
}
async onApplicationShutdown(signal?: string) {
if (!this.session) {
return;
}
await this.stop({ name: this.DEFAULT, logout: false });
}
//
// API Methods
//
async start(request: SessionStartRequest): Promise<SessionDTO> {
this.onlyDefault(request.name);
if (this.session) {
throw new UnprocessableEntityException(
`Session '${this.DEFAULT}' is already started.`,
);
}
const name = request.name;
this.log.log(`'${name}' - starting session...`);
const levels = getLogLevels(request.config?.debug);
const log = buildLogger(`WhatsappSession - ${name}`, levels);
const mediaManager = new CoreMediaManager(
new MediaStorageCore(),
this.config.mimetypes,
);
const webhookLog = buildLogger(`Webhook - ${name}`, levels);
const webhook = new this.WebhookConductorClass(webhookLog);
const proxyConfig = this.getProxyConfig(request);
const sessionConfig: SessionParams = {
name,
mediaManager,
log,
printQR: this.engineConfigService.shouldPrintQR,
sessionStore: this.store,
proxyConfig: proxyConfig,
sessionConfig: request.config,
};
await this.sessionAuthRepository.init(name);
// @ts-ignore
const session = new this.EngineClass(sessionConfig);
this.session = session;
// configure webhooks
const webhooks = this.getWebhooks(request);
webhook.configure(session, webhooks);
// start session
await session.start();
return {
name: session.name,
status: session.status,
config: session.sessionConfig,
};
}
/**
* Combine per session and global webhooks
*/
private getWebhooks(request: SessionStartRequest) {
let webhooks: WebhookConfig[] = [];
if (request.config?.webhooks) {
webhooks = webhooks.concat(request.config.webhooks);
}
const globalWebhookConfig = this.config.getWebhookConfig();
if (globalWebhookConfig) {
webhooks.push(globalWebhookConfig);
}
return webhooks;
}
/**
* Get either session's or global proxy if defined
*/
protected getProxyConfig(
request: SessionStartRequest,
): ProxyConfig | undefined {
if (request.config?.proxy) {
return request.config.proxy;
}
if (!this.session) {
return undefined;
}
const sessions = { [request.name]: this.session };
return getProxyConfig(this.config, sessions, request.name);
}
async stop(request: SessionStopRequest): Promise<void> {
this.onlyDefault(request.name);
const name = request.name;
this.log.log(`Stopping ${name} session...`);
const session = this.getSession(name);
await session.stop();
this.log.log(`"${name}" has been stopped.`);
this.session = undefined;
}
async logout(request: SessionLogoutRequest) {
const name = request.name;
this.onlyDefault(request.name);
this.stop({ name: name, logout: false })
.then(() => {
this.log.log(`Session '${name}' has been stopped.`);
})
.catch((err) => {
this.log.error(
`Error while stopping session '${name}' while logging out`,
err,
);
});
await this.sessionAuthRepository.clean(request.name);
}
getSession(name: string): WhatsappSession {
this.onlyDefault(name);
const session = this.session;
if (!session) {
throw new NotFoundException(
`We didn't find a session with name '${name}'. Please start it first by using POST /sessions/start request`,
);
}
return session;
}
async getSessions(all: boolean): Promise<SessionInfo[]> {
if (!this.session) {
if (!all) {
return [];
}
return [
{
name: this.DEFAULT,
status: WAHASessionStatus.STOPPED,
config: undefined,
me: null,
},
];
}
const me = await this.session.getSessionMeInfo().catch((err) => null);
const engine = {
engine: this.session?.engine,
...(await this.session?.getEngineInfo().catch((err) => ({}))),
};
return [
{
name: this.session.name,
status: this.session.status,
config: this.session.sessionConfig,
me: me,
engine: engine,
},
];
}
async getSessionInfo(name: string): Promise<SessionInfo | null> {
if (name !== this.DEFAULT) {
return null;
}
return this.getSessions(true).then((sessions) => sessions[0]);
}
}
+47
View File
@@ -0,0 +1,47 @@
import { WAMedia } from '../structures/responses.dto';
import {
IEngineMediaProcessor,
MediaManager,
MediaStorage,
} from './abc/media.abc';
import { DOCS_URL } from './exceptions';
export class MediaStorageCore implements MediaStorage {
async save(
messageId: string,
mimetype: string,
buffer: Buffer,
): Promise<string> {
return Promise.resolve(
`Media attachment's available only in WAHA Plus version. ${DOCS_URL}`,
);
}
}
export class CoreMediaManager implements MediaManager {
constructor(
private storage: MediaStorage,
private mimetypes: string[],
) {}
async processMedia<Message>(
processor: IEngineMediaProcessor<Message>,
message: Message,
): Promise<Message> {
if (!processor.hasMedia(message)) {
return message;
}
const mimetype = '';
const filename = processor.getFilename(message);
const url = await this.storage.save('', mimetype, Buffer.from(''));
const media: WAMedia = {
mimetype: mimetype,
filename: filename,
url: url,
};
// @ts-ignore
message.media = media;
return message;
}
}
@@ -0,0 +1,7 @@
export abstract class ISessionAuthRepository {
abstract init(sessionName?: string): Promise<void>;
abstract clean(sessionName: string): Promise<void>;
abstract getAll(): Promise<string[]>;
}
@@ -0,0 +1,12 @@
import { SessionConfig } from '../../structures/sessions.dto';
export abstract class ISessionConfigRepository {
abstract save(
sessionName: string,
config: SessionConfig | null,
): Promise<void>;
abstract get(sessionName: string): Promise<SessionConfig | null>;
abstract delete(sessionName: string): Promise<void>;
}
@@ -0,0 +1,32 @@
import * as fs from 'fs/promises';
import { ISessionAuthRepository } from './ISessionAuthRepository';
import { LocalStore } from './LocalStore';
export class LocalSessionAuthRepository extends ISessionAuthRepository {
private store: LocalStore;
constructor(store: LocalStore) {
super();
this.store = store;
}
async init(sessionName?: string) {
await this.store.init(sessionName);
}
async clean(sessionName: string) {
const folder = this.store.getSessionDirectory(sessionName);
await fs.rm(folder, { recursive: true });
}
async getAll(): Promise<string[]> {
await this.init();
const content = await fs.readdir(this.store.getEngineDirectory(), {
withFileTypes: true,
});
return content
.filter((dirent) => dirent.isDirectory())
.map((dirent) => dirent.name);
}
}
Loaded 100 of 133 files, more files were not shown because too many files have changed in this diff. Show more