Skip to content

Commit

Permalink
[core] Apply prettier to other files too
Browse files Browse the repository at this point in the history
  • Loading branch information
allburov committed Nov 25, 2023
1 parent d4d94ff commit bd40978
Show file tree
Hide file tree
Showing 11 changed files with 123 additions and 105 deletions.
47 changes: 24 additions & 23 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
module.exports = {
parser: "@typescript-eslint/parser",
parser: '@typescript-eslint/parser',
parserOptions: {
project: "tsconfig.json",
sourceType: "module"
project: 'tsconfig.json',
sourceType: 'module',
},
plugins: [
"@typescript-eslint/eslint-plugin",
"simple-import-sort"
],
plugins: ['@typescript-eslint/eslint-plugin', 'simple-import-sort'],
extends: [
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
"prettier/@typescript-eslint"
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
'prettier/@typescript-eslint',
],
root: true,
env: {
node: true,
jest: 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",
'lines-between-class-members': ['error', 'always', { 'exceptAfterSingleLine': true }],
}
'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',
'lines-between-class-members': [
'error',
'always',
{ exceptAfterSingleLine: true },
],
},
};
33 changes: 21 additions & 12 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG][WEBJS] - "
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!

> 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",
Expand All @@ -20,33 +21,41 @@ assignees: ''
"browser": "/usr/bin/google-chrome-stable"
}
```
> You can get the WAHA version by calling `GET /api/version`
> Try to update to [the latest version](https://github.com/devlikeapro/whatsapp-http-api/releases) before creating an issue!

> You can get the WAHA version by calling `GET /api/version` Try to update to
> [the latest version](https://github.com/devlikeapro/whatsapp-http-api/releases)
> before creating an issue!
**To Reproduce** Steps to reproduce the behavior:

**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.
**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

> 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.
19 changes: 11 additions & 8 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[Feature Request]"
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.
**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.
> 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.
50 changes: 25 additions & 25 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release
on:
push:
tags:
- "*"
- '*'

jobs:
docker-build:
Expand All @@ -13,33 +13,33 @@ jobs:
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"
- 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"
- 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"
# - 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"
- 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
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ repos:
rev: 'v3.1.0'
hooks:
- id: prettier
types_or: [ javascript, ts ]
files: |
exclude: |
(?x)^(
src/.*|
docs/.*|
README.md|
)$
- repo: https://github.com/Lucas-C/pre-commit-hooks-nodejs
rev: v1.1.2
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# Changelog
You can find changelog on [the changelog page](https://waha.devlike.pro/docs/help/changelog/)

You can find changelog on
[the changelog page](https://waha.devlike.pro/docs/help/changelog/)
6 changes: 3 additions & 3 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
image: devlikeapro/whatsapp-http-api
container_name: whatsapp-http-api
ports:
- "3000:3000/tcp"
- '3000:3000/tcp'
environment:
# Environment variables from https://waha.devlike.pro/docs/how-to/config/
- WHATSAPP_HOOK_URL=https://httpbin.org/post
Expand All @@ -16,9 +16,9 @@ services:
image: devlikeapro/whatsapp-http-api-plus
container_name: whatsapp-http-api-plus
ports:
- "3000:3000/tcp"
- '3000:3000/tcp'
volumes:
- "./.sessions:/app/.sessions"
- './.sessions:/app/.sessions'
environment:
# Environment variables from https://waha.devlike.pro/docs/how-to/config/
- WHATSAPP_RESTART_ALL_SESSIONS=True
Expand Down
50 changes: 30 additions & 20 deletions examples/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ We assume that you have installed software:

### 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).
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/):
Here are the steps from
[Quick Start](https://waha.devlike.pro/docs/overview/quick-start/):

Download and start WhatsApp HTTP API docker container

Expand All @@ -28,9 +29,11 @@ docker run -it --rm --network=host -e WHATSAPP_HOOK_URL=http://localhost:5000/bo

#### Download image - ARM

If you're using ARM (like Apple Silicon, Apple M1, etc.) - use following commands to download the image
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/whatsapp-http-api:arm
Expand All @@ -47,12 +50,16 @@ docker run -it --rm --network=host -e WHATSAPP_HOOK_URL=http://localhost:5000/bo

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).
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
{
Expand All @@ -66,9 +73,9 @@ 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.
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
Expand All @@ -81,16 +88,19 @@ python -mpip install -r requirements.txt
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!
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!
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 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/).
**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:

Expand All @@ -114,5 +124,5 @@ python -mpip install -r requirements.txt
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!
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!
4 changes: 1 addition & 3 deletions nest-cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
"collection": "@nestjs/schematics",
"sourceRoot": "src",
"compilerOptions": {
"plugins": [
"@nestjs/swagger"
]
"plugins": ["@nestjs/swagger"]
}
}
7 changes: 1 addition & 6 deletions tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
{
"extends": "./tsconfig.json",
"exclude": [
"node_modules",
"test",
"dist",
"**/*spec.ts"
]
"exclude": ["node_modules", "test", "dist", "**/*spec.ts"]
}
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"baseUrl": "./",
"incremental": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"skipLibCheck": true
}
}

0 comments on commit bd40978

Please sign in to comment.