# iqpass-label-composer-service

> Compose combinations of 3 different labels

Latest version **0.0.1** (published 2016-11-10) · ISC license · 0 weekly downloads

## Install

```sh
npm install iqpass-label-composer-service
pnpm add iqpass-label-composer-service
yarn add iqpass-label-composer-service
bun add iqpass-label-composer-service
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2016-11-10 |
| First published | 2016-11-10 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | paulb@pti.nl |
| Maintainers | paulb-pti |

## Links

- npm: https://www.npmjs.com/package/iqpass-label-composer-service
- npm.io page: https://npm.io/package/iqpass-label-composer-service

## Dependencies (2)

- [seneca](https://npm.io/package/seneca.md) ^3.2.2
- [@pti-innovatie/database-mysql](https://npm.io/package/@pti-innovatie/database-mysql.md) 0.0.8

## Recent versions

- 0.0.1 (latest) — 2016-11-10

## README

# Label Composer Service

### Description

This service manages the label compositions in a `MySQL` database with CRUD. The service can be used through a `seneca` communication. 

`http://37.97.191.51:10135/act`

### Config

The `config.json` file is located in the `lib` folder. 
Use this file to configure all the credentials and database layout. Also set the `seneca` host and port the service should be run on.


### Create a new composition

##### Pattern

    role:labelComposer
    action:create

##### Arguments

All of these arguments are required.

The combination must be unique in order for it to be inserted into the database.

```javascript
composition: {
    rubric: <number>
    role: <number>
    rubric: <number>
}
```

##### Callback

Expected `{ success: true, result: { id:<number> } }`

Failed: Database write failed `{ success: false, error:ACTION_FAILED' }`

Failed: No rows affected `{ success: false, error:NO_DATA_WRITTEN' }`


### Get all compositions

    
##### Pattern

    role:labelComposer
    action:getAll

##### Arguments

None

##### Callback

Expected `{ success: true, result: <Array> }`

```javascript
result: [
    { rubric: <number>, role: <number>, worktype: <number> },
    ...
]
```

Failed: Database read failed `{ success: false, error:ACTION_FAILED' }`


### Update
    
##### Pattern

    role:labelComposer
    action:update


##### Arguments

All of these arguments are required.

`composition` Used as a indentifier.

`newComposition` The combination must be unique in order for it to be inserted into the database.

```javascript
composition: {
    rubric: <number>
    role: <number>
    worktype: <number>
},
newComposition: {
    rubric: <number>
    role: <number>
    worktype: <number>
}
```

##### Callback

Expected `{ success: true, result: { rubric:<number>, role:<number>, worktype:<number> } }`

The result hold the `composition` that was used as a identifier


Failed: Database write failed `{ success: false, error:ACTION_FAILED' }`

Failed: No rows affected `{ success: false, error:NO_DATA_WRITTEN' }`


### Delete
    
##### Pattern

    role:labelComposer
    action:delete


##### Arguments

All of these arguments are required.

`composition` Used as a indentifier.

```javascript
composition: {
    rubric: <number>
    role: <number>
    worktype: <number>
}
```

##### Callback

Expected `{ success: true, result: { rubric:<number>, role:<number>, worktype:<number> } }`

The result hold the `composition` that was used as a identifier


Failed: Database write failed `{ success: false, error:ACTION_FAILED' }`

Failed: No rows affected `{ success: false, error:NO_DATA_WRITTEN' }`

---
_Source: https://npm.io/package/iqpass-label-composer-service · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
