# g4-runtime-api-business-apps

> Module to get data of business_apps collection

Latest version **1.0.21** (published 2016-12-21) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install g4-runtime-api-business-apps
pnpm add g4-runtime-api-business-apps
yarn add g4-runtime-api-business-apps
bun add g4-runtime-api-business-apps
```

## 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 | 1.0.21 |
| Published | 2016-12-21 |
| First published | 2016-12-21 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+11 in 1 direct dependencies) |
| Install scripts | no |
| Author | Jesus Hernandez @Intelisis |
| Maintainers | elgubenis |

## Links

- npm: https://www.npmjs.com/package/g4-runtime-api-business-apps
- Repository: https://github.com/IntelisisG4/jesushv/back/g4-runtime-api-business-apps
- Homepage: https://github.com/IntelisisG4/jesushv/back/g4-runtime-api-business-apps#readme
- Issues: https://github.com/IntelisisG4/jesushv/back/g4-runtime-api-business-apps/issues
- npm.io page: https://npm.io/package/g4-runtime-api-business-apps

## Dependencies (2)

- [backbone](https://npm.io/package/backbone.md) ^1.2.3
- [mongoose](https://npm.io/package/mongoose.md) ^4.3.5

## Recent versions

- 1.0.21 (latest) — 2016-12-21

## README

G4 runtime-api business-apps module
---
> Module to search for specific business-apps.

Search by _id business-apps and find diagram, form, rule. docType by _id

## Table of Contents

- [Prerequisites](#preqrequisites)
- [Installation](#installation)
- [Usage](#usage)
- [Options](#options)
- [API](#api)
- [Tests](#tests)
- [License](#license)

## Prerequisites
- [nodejs v5.0.0](https://nodejs.org/en/blog/release/v5.0.0)

## Installation

Package installation
```sh
> npm install @intelisis/g4-runtime-api-business-apps --save
```

## Usage

#### Initialize

Initilize module passing business-apps _id, database connection pool and database's name as tenantName

```js
// JS Example
const BusinessApps = require('@intelisis/g4-runtime-api-business-apps');
const options = {
  _id: business_app_ID,
  tenantName: dataBaseName,
  db: InstanceOfDb
};

new BusinessApps(options);
```

```coffee
# Coffee Example
BusinessApp  = require '@intelisis/g4-runtime-api-business-apps'

businessApp = new BusinessApp options
```

## Options

* `db:` - pool connection from mongoose
* `tenantName:` - indicates the name of the tenant, is normally the users tenant
* `_id` - indicates business-apps' id to search

## API

#### fetch()
Search a specific business-apps by `_id`.
```coffee
# Coffee Example
businessApp.fetch().then ->
  # now all business-apps attributes are available
  # businessApp.get 'name' 
.catch (err) ->
  # returns an error if it happens
```

###getDiagram(diagramId)

##### diagramId
Type: `String`

Search diagram on business-apps
```coffee
# Coffee Example
businessApp.getDiagram(diagramId).then (diagram) ->
  # returns specific diagram
.catch (err) ->
  # returns an error if it happens
```

###getForm(formId)

##### formId
Type: `String`

Search form on business-apps
```coffee
# Coffee Example
businessApp.getForm(formId).then (form) ->
  # returns specific form
.catch (err) ->
  # returns an error if it happens
```

###getRule(ruleId)

##### ruleId
Type: `String`

Search rule on business-apps
```coffee
# Coffee Example
businessApp.getRule(ruleId).then (rule) ->
  # returns specific rule
.catch (err) ->
  # returns an error if it happens
```

###getDocType(docTypeId)

##### docTypeId
Type: `String`

Search docType on business-apps
```coffee
# Coffee Example
businessApp.getDocType(docTypeId).then (docType) ->
  # returns specific docType
.catch (err) ->
  # returns an error if it happens
```

## Tests

How to run the unit tests
```sh
> npm install
> gulp test
```

## License
Copyright (C) 2016 Intelisis Software, S.A. de C.V. - All Rights Reserved

Unauthorized copying or distributing of this repository, project or any part of it, via any medium is strictly prohibited

Proprietary and confidential

---
_Source: https://npm.io/package/g4-runtime-api-business-apps · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
