https://github.com/alexrogalskiy/web-ets
Web-ets demo
https://github.com/alexrogalskiy/web-ets
Last synced: 3 months ago
JSON representation
Web-ets demo
- Host: GitHub
- URL: https://github.com/alexrogalskiy/web-ets
- Owner: AlexRogalskiy
- License: gpl-3.0
- Created: 2021-01-07T17:19:46.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-04-13T06:45:24.000Z (about 3 years ago)
- Last Synced: 2025-01-26T10:13:29.673Z (5 months ago)
- Language: TypeScript
- Size: 133 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Wire
This repository is part of the source code of Wire. You can find more information at [wire.com](https://wire.com) or by contacting [email protected].
You can find the published source code at [github.com/wireapp](https://github.com/wireapp).
For licensing information, see the attached LICENSE file and the list of third-party licenses at [wire.com/legal/licenses/](https://wire.com/legal/licenses/).
## E2E Test Service
End-to-end Test Service (ETS) for Wire's test automation suite.
### Usage in testing environment
First, make sure you have all dependencies installed by running:
```
yarn
```Then run the server with:
```
yarn start:dev
```The ETS will now be running locally and is ready to process requests.
### Testing
```
yarn test
```### Running in production environment
```
yarn
yarn dist
yarn start
```## API documentation
- Swagger UI is available at `/swagger-ui` when running the ETS, i.e. http://localhost:21080/swagger-ui/
## Implementation
1. Add endpoint description in `swagger.json`
1. Add business logic in `InstanceService.ts`
1. Add endpoint implementation in `conversationRoutes.ts`## Deployments
The following ETS deployments are reachable via Wire's VPN:
- [ETS "dev" branch](http://192.168.120.44:27080/swagger-ui/)
- [ETS "main" branch](http://192.168.120.44:28080/swagger-ui/)## How it works
1. Create an instance (POST `/instance`)
1. Use the received `instanceId` to use resources like `sendText`**Example payload to create an instance**
- http://localhost:21080/swagger-ui/#/Instance/createInstance
```json
{
"backend": "staging",
"email": "[email protected]",
"password": "secret",
"deviceClass": "desktop",
"name": "Some Instance Name"
}
```**Example payload to start a poll**
- http://localhost:21080/swagger-ui/#/Instance/sendText
```json
{
"buttons": ["A", "B"],
"text": "Do you like A or B?",
"conversationId": "b894b2e4-e862-4b55-a97e-56ea3690be20"
}
```## Common errors
### Invalid JSON provided
```json
{
"code": "400",
"error": "Payload is not valid JSON data."
}
```### Instance or endpoint not found
```json
{
"code": "404",
"error": ""
}
```### JSON data with missing or invalid fields provided
```json
{
"code": "422",
"error": ""
}
```### Internal server error
```json
{
"code": "500",
"error": "",
"stack": "string"
}
```