forked from ookamiiixd/baileys-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5fbdf13
commit 6ede4e6
Showing
28 changed files
with
3,372 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
custom: ['https://paypal.me/ookamiiixd', 'https://trakteer.id/ookamiiixd'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
node_modules/ | ||
dist/ | ||
debug/ | ||
.env | ||
prisma/migrations/ | ||
.env | ||
*.tgz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
node_modules/ | ||
dist/ | ||
debug/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2022 Royhan | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Baileys API | ||
|
||
An implementation of [@adiwajshing/Baileys](https://github.com/adiwajshing/Baileys) as a simple REST API with multiple device support | ||
|
||
## Requirements | ||
|
||
- **NodeJS** version **14.5.0** or higher | ||
|
||
## Installation | ||
|
||
1. Download or clone this repo. If you want to skip the build step, you can download the prebuilt one from the release page | ||
1. Enter to the project directory | ||
1. Install the dependencies | ||
1. Build the project using the `build` script. You can skip this part if you're using the prebuilt one from the release page | ||
|
||
## Setup | ||
|
||
1. Copy the `.env.example` file and rename it into `.env`, then update your [connection url](https://www.prisma.io/docs/reference/database-reference/connection-urls) in the `DATABASE_URL` field | ||
1. Run your [migration](https://www.prisma.io/docs/reference/api-reference/command-reference#prisma-migrate). Don't forget to always re-run your migration whenever there's a change on the `prisma/` directory | ||
|
||
## `.env` Configurations | ||
|
||
```env | ||
# Listening Host | ||
HOST="localhost" | ||
# Listening Port | ||
PORT="3000" | ||
# Database Connection URL | ||
DATABASE_URL="mysql://root:12345@localhost:3306/baileys_api" | ||
# Reconnect Interval (in Milliseconds) | ||
RECONNECT_INTERVAL="5000" | ||
# Maximum Reconnect Attempts | ||
MAX_RECONNECT_RETRIES="5" | ||
# Maximum SSE QR Generation Attempts | ||
SSE_MAX_QR_GENERATION="10" | ||
# Pino Logger Level | ||
LOG_LEVEL="warn" | ||
``` | ||
|
||
## Usage | ||
|
||
1. Make sure to build the project first using the `build` script | ||
1. You can then start the app using the `start` script | ||
1. Now the endpoint should be available according to your environment variables configuration. Default is at `http://localhost:3000` | ||
|
||
## API Docs | ||
|
||
The API documentation is available online [here](https://documenter.getpostman.com/view/18988925/2s8Z73zWbg). You can also import the **Postman Collection File** `(postman_collection.json)` into your Postman App alternatively | ||
|
||
## Notes | ||
|
||
- There's no authentication, you may want to implement your own. I don't want to force anyone to use a specific authentication method, choose whatever you love | ||
|
||
## Notice | ||
|
||
This project is intended for learning purpose only, don't use it for spamming or any activities that's prohibited by **WhatsApp** |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,25 +4,23 @@ | |
"version": "1.0.0-beta.0", | ||
"private": true, | ||
"main": "dist/index.js", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/ookamiiixd/baileys-api.git" | ||
}, | ||
"author": "ookamiiixd <[email protected]>", | ||
"repository": "github:ookamiiixd/baileys-api", | ||
"author": "Royhan (https://github.com/ookamiiixd)", | ||
"bugs": { | ||
"url": "https://github.com/ookamiiixd/baileys-api/issues" | ||
}, | ||
"homepage": "https://github.com/ookamiiixd/baileys-api#readme", | ||
"license": "MIT", | ||
"scripts": { | ||
"start": "node .", | ||
"build": "tsc", | ||
"lint": "eslint .", | ||
"format": "prettier . --write" | ||
}, | ||
"dependencies": { | ||
"@adiwajshing/baileys": "https://github.com/ookamiiixd/Baileys.git#build", | ||
"baileys-store": "file:external/baileys-store-4.tgz", | ||
"@adiwajshing/baileys": "^5.0.0", | ||
"@hapi/boom": "^10.0.0", | ||
"@ookamiiixd/baileys-store": "^1.0.0-beta.0", | ||
"@prisma/client": "^4.7.1", | ||
"cors": "^2.8.5", | ||
"dotenv": "^16.0.3", | ||
|
@@ -45,11 +43,17 @@ | |
"eslint": "^8.29.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"prettier": "^2.8.0", | ||
"prettier-plugin-organize-imports": "^3.2.1", | ||
"prisma": "^4.7.1", | ||
"ts-node": "^10.9.1", | ||
"typescript": "^4.9.3" | ||
}, | ||
"engines": { | ||
"node": ">=14.5.0" | ||
} | ||
}, | ||
"files": [ | ||
"dist/", | ||
"prisma/schema.prisma", | ||
".env.example" | ||
] | ||
} |
Oops, something went wrong.