An open API service indexing awesome lists of open source software.

https://github.com/konard/deep-foundation-js-docker-isolation-provider


https://github.com/konard/deep-foundation-js-docker-isolation-provider

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

[![Gitpod](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/deep-foundation/js-docker-isolation-provider)

# js-docker-isolation-provider

## HTTP routes

- `/healthz` - GET - 200 - Health check endpoint
- Response:
- `{}`
- `/init` - GET - 200 - Initialization endpoint
- Response:
- `{}`
- `/call` - GET - 200 - Call executable code of handler in this isolation provider (it used in HandleInsert, HandleUpdate, HandleDelete and so on)
- Request:
- body:
- params:
- jwt: STRING - Deeplinks send this token, for create gql and deep client
- secret: STRING - Secret to access Hasura in unsafe mode (if package/user are allowed to use it by permissions)
- code: STRING - Code of handler
- data: {} - Data for handler execution from deeplinks
> If this is type handler
- oldLink - from deeplinks, link before transaction
- newLink - from deeplinks, link after transaction
- promiseId - from deeplinks, promise id
- Response:
- `{ resolved?: any; rejected?: any; }` - If resolved or rejected is not null, then it's result of execution
- `/http-call` - GET - 200 - Call executable code of handler in this isolation provider to produce the http responce (it is used in HandleRoute)
- Request:
- Headers:
- `deep-call-options`
- jwt: STRING - Deeplinks send this token, for create gql and deep client
- secret: STRING - Secret to access Hasura in unsafe mode (if package/user are allowed to use it by permissions)
- code: STRING - Code of handler
- data: {} - Data for handler execution from deeplinks
> If this is type handler
- oldLink - from deeplinks, link before transaction
- newLink - from deeplinks, link after transaction
- promiseId - from deeplinks, promise id
- Responce:
- Http responce generated by code if execution is successful
- `{ rejected: any; }` - on error

## Diagnostics

### Logs

#### Get container logs to console:

```bash
docker logs $(docker ps -a -q --filter "ancestor=deepf/js-docker-isolation-provider:main")
```

#### Get container logs to file:

Sometimes console cannot output the full logs so it might be helpful to store the entire container's logs as file. It can be done like this:

```bash
docker logs $(docker ps -a -q --filter "ancestor=deepf/js-docker-isolation-provider:main") > log.txt
```