# molgenis-node-lifelines-edge

> Edge server for lifelines webshop - Platform integration

Latest version **3.3.0** (published 2021-01-14) · LGPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install molgenis-node-lifelines-edge
pnpm add molgenis-node-lifelines-edge
yarn add molgenis-node-lifelines-edge
bun add molgenis-node-lifelines-edge
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.3.0 |
| Published | 2021-01-14 |
| First published | 2020-04-14 |
| Weekly downloads | 0 |
| License | LGPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 9 |
| Unpacked size | 43.2 KB |
| Known vulnerabilities | 0 (+37 in 2 direct dependencies) |
| Install scripts | no |
| Maintainers | molgenis-npm |

## Links

- npm: https://www.npmjs.com/package/molgenis-node-lifelines-edge
- Repository: https://github.com/molgenis/molgenis-node-lifelines-edge
- Homepage: https://github.com/molgenis/molgenis-node-lifelines-edge#readme
- Issues: https://github.com/molgenis/molgenis-node-lifelines-edge/issues
- npm.io page: https://npm.io/package/molgenis-node-lifelines-edge

## Dependencies (9)

- [axios](https://npm.io/package/axios.md) ^0.19.0
- [express](https://npm.io/package/express.md) ^4.17.1
- [iapetus](https://npm.io/package/iapetus.md) ^2.1.4
- [winston](https://npm.io/package/winston.md) ^3.2.1
- [lightship](https://npm.io/package/lightship.md) ^4.3.7
- [nodemailer](https://npm.io/package/nodemailer.md) ^6.4.17
- [cookie-parser](https://npm.io/package/cookie-parser.md) ^1.4.4
- [axios-debug-log](https://npm.io/package/axios-debug-log.md) ^0.6.2
- [winston-daily-rotate-file](https://npm.io/package/winston-daily-rotate-file.md) ^4.5.0

## Recent versions

- 3.3.0 (latest) — 2021-01-14
- 3.2.0 — 2020-12-30
- 3.1.0 — 2020-11-09
- 3.0.0 — 2020-11-09
- 2.2.0 — 2020-06-17
- 2.1.1 — 2020-04-30
- 2.1.0 — 2020-04-20
- 2.0.3 — 2020-04-17
- 2.0.2 — 2020-04-14
- 2.0.1 — 2020-04-14

## README

# Edge server for Lifelines order management

Edge server supplies a service to approve lifelines-catelog orders and submits the order to the lifelines platform.

## EndPoints

GET ```/version```

 - Returns edge-server version information in json format

POST ```/edge-server/approve?ordernumber=12345```
 - Calls molgenis service to approve the order
 - Calls data platform send out the order
 - Expects ordernumber as query param 

POST ```/edge-server/submit?ordernumber=12345```
 - Send notification that the order has been submitted
 - Expects ordernumber as query param 

## Usage

Prerequisites:

node = lts/erbium 

Install:

```npm install```

Run:

```node server.js```

By default the server listens at port 3000, see Enviroment section on changing the port.

Debug:

```node --inspect server.js``` 

## Environment

In order for the edge-server to handle an 'approve order' request 
the request must be made by a user that has the 'ROLE_lifelines_MANAGER' role.

# EDGE_SERVER
- EDGE_SERVER_PORT: port-number

# MOLGENIS or other backend
- MOLGENIS_URL: https://molgenis-backend.org

# Data platform
- DATA_PLATFORM_URL: https://data-platform.org
- DATA_PLATFORM_TOKEN: token-for-dataplatform-lifelines
# REQUIRED FOR EMAIL SUBMISSION NOTIFICATION
- EDGE_SERVER_MAIL_FROM: [from email address] // string, defaults to ''
- EDGE_SERVER_MAIL_TO: [list of email addresses ] // string, defaults '' 
- EDGE_SERVER_MAIL_SUBJECT: [submit trigger email subject ] // defaults '' 

# OPTIONAL FOR EMAIL SETTINGS
- EDGE_SERVER_MAIL_HOST: 'some.host.org' // defaults to  'smtp.rug.nl',
- EDGE_SERVER_MAIL_PORT: 25 // some port defaults to 25,
- EDGE_SERVER_MAIL_SECURE: true // boolean defaults to true,
- EDGE_SERVER_MAIL_AUTH: true // boolean, defaults to 'true'
- EDGE_SERVER_MAIL_AUTH_USER: '' // string required is auth is set to true
- EDGE_SERVER_MAIL_AUTH_PASS: '' // string required is auth is set to true
- EDGE_SERVER_MAIL_TLS_REJECT_UNAUTHORIZED: true // boolean defaults to 'true'
- EDGE_SERVER_MAIL_TLS_ALLOW_INSECURE_AUTH: false // boolean defaults to 'false'
- EDGE_SERVER_MAIL_IGNORE_TLS: boolean defaults to 'false'
- EDGE_SERVER_MAIL_LOGGER: true // boolean set to true log sending email, defaults to 'true'
- EDGE_SERVER_MAIL_DEBUG: false // boolean set to true for detailed transport logging defaults to 'false'

---
_Source: https://npm.io/package/molgenis-node-lifelines-edge · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
