# airvantage

> AirVantage API client for nodejs

Latest version **4.0.0** (published 2017-02-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install airvantage
pnpm add airvantage
yarn add airvantage
bun add airvantage
```

## 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 | 4.0.0 |
| Published | 2017-02-07 |
| First published | 2015-08-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Sebz |
| Maintainers | sebz |
| Keywords | airvantage, rest, api, nodejs |

## Links

- npm: https://www.npmjs.com/package/airvantage
- Repository: https://github.com/sebz/airvantage.js
- Homepage: https://github.com/sebz/airvantage.js#readme
- Issues: https://github.com/sebz/airvantage.js/issues
- npm.io page: https://npm.io/package/airvantage

## Dependencies (3)

- [got](https://npm.io/package/got.md) ^6.5.0
- [lodash](https://npm.io/package/lodash.md) ^4.16.4
- [bluebird](https://npm.io/package/bluebird.md) ^2.9.34

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 4.0.0 (latest) — 2017-02-07
- 3.4.0 — 2017-02-07
- 3.3.0 — 2016-09-02
- 3.2.1 — 2016-09-02
- 3.2.0 — 2016-09-01
- 3.1.0 — 2016-08-12
- 3.0.0 — 2016-08-08
- 2.1.0 — 2016-07-18
- 2.0.0 — 2016-04-15
- 1.23.0 — 2016-04-14
- 1.22.0 — 2016-03-08
- 1.1.0 — 2016-03-01
- 1.0.0 — 2016-02-10
- 0.0.3 — 2015-12-08
- 0.0.2 — 2015-08-27
- … 1 more at https://npm.io/package/airvantage/versions

## README

AirVantage.js
========

> Nodejs AirVantage API client

[![Build Status](https://travis-ci.org/sebz/airvantage.js.svg?branch=master)](https://travis-ci.org/sebz/airvantage.js)

Full AirVantage API documentation: https://doc.airvantage.net/av/reference/cloud/API/


## Install

:warning: **Node.js 4 or higher is required for airvantage@3 and above.** For older Node.js versions use airvantage@2.

```
$ npm install --save airvantage
```


## Usage

```javascript

const AirVantage = require("airvantage");

const config = {
    serverUrl: "https://eu.airvantage.net", // or https://na.airvantage.net
    credentials: {
        client_id: "YOUR_CLIENT_ID",
        client_secret: "YOUR_CLIENT_SECRET",
        username: "you@domain.com",
        password: "yOuRs3cR3t!"
    }
};

const airvantage = new AirVantage(config);

airvantage
    .authenticate()
    .then(() => airvantage.querySystems({ labels: ["demo"] }))
    .then(systems => console.log("All demo systems:", systems));
```

You may already have an `access_token` and want to use it:

```javascript

const AirVantage = require("airvantage");
const airvantage = new AirVantage({
    serverUrl: "https://eu.airvantage.net", // or https://na.airvantage.net
});

function querySystems(accessToken) {
    airvantage
        .authenticate({token: accessToken})
        .then(() => airvantage.querySystems({ labels: ["demo"] }))
        .then(systems => console.log("All demo systems:", systems));
}
```

OR you may want to authentication multiple users with a single AirVantage instance

```javascript

const AirVantage = require("airvantage");
const airvantage = new AirVantage({
    serverUrl: "https://eu.airvantage.net", // or https://na.airvantage.net
});

function authenticate(username, password) {
    airvantage
        .authenticate({username: username, password: password})
        .then(token => storeToken(username, token));
}
```

## Available methods
## Systems

* *querySystems*
> See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

* *getDetailsSystem*
> See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

* *createSystem*
> See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

* *editSystem*
> See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

* *deleteSystem(uid)*
    * uid
        * *Required*
        * Type: `string`

* *deleteSystems(options)*
    * options
        * Type: `object`
        ```javascript
        {
            "selection" : {
                "label": "aLabel",
                // Or
                "uids" : ["uid1", ...]
            },
            "deleteGateway": false | true,
            "deleteSubscriptions": false | true
        }
        ```

* *activateSystems*
> See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

* *suspendSystems*
> See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

* *resumeSystems*
> See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

* *terminateSystems*
> See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

* *queryMultiRawDataPoints*
> See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

## Gateways
* *queryGateways*
> See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

* *getDetailsGateway*
> See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

* *createGateway*
> See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

* *editGateway*
> See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

* *deleteGateway(uid)*
    * uid
        * *Required*
        * Type: `string`

* *deleteGateways(options)*
    * options
        * Type: `object`
        ```javascript
        {
            "selection" : {
                "label": "aLabel",
                // Or
                "uids" : ["uid1", ...]
            }
        }
        ```

## Subscriptions
* *querySusbscriptions*
> See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

* *getDetailsSubscription*
> See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

* *createSusbscription*
> See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

* *editSusbscription*
> See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

* *deleteSusbscription(uid)*
    * uid
        * *Required*
        * Type: `string`

* *deleteSusbscription(options)*
    * options
        * Type: `object`
        ```javascript
        {
            "selection" : {
                "label": "aLabel",
                // Or
                "uids" : ["uid1", ...]
            }
        }
        ```

* *activateSusbscriptions*
> See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

* *synchronizeSusbscriptions*
> See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

* *suspendSusbscriptions*
> See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

* *restoreSusbscriptions*
> See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

* *terminateSusbscriptions*
> See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.


## Applications

* queryApplications
> See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

* getDetailsApplication
> See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

* createApplication
> See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

* editApplication
> See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

* editApplicationCommunication(uid, data)
> See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

* editApplicationData(uid, data)
> See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

* releaseApplication(filePath)
> See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

* publishApplication(uid)
> See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

* addApplication(uid)
> See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

* deleteApplication(uid)
    * uid
        * *Required*
        * Type: `string`

* deleteApplications(options)
    * options
        * Type: `object`
        ```javascript
        {
            "selection" : {
                "label": "aLabel",
                // Or
                "uids" : ["uid1", ...]
            }
        }
        ```

## Alert Rules

* *createAlertRule*(data)
* *editAlertRule*(uid, data)
* *deleteAlertRule*(uid)
* *deleteAlertRules*(params)
* *queryAlertRules*(params)
* *getDetailsAlertRule*(id)

* *createNotificationHook*(id, callback)
> Add a new notification hook when the given alert rule identifier is triggered. When a rule get trigged, the given _callback_ is invoked
> See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

* *getNotificationHooks*(id)
> Get the list of all notification hooks configured for the given alert rule identifier.
> See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.


## Operations
* queryOperations
> See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

* getDetailsOperation
> See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

## Misc

* currentUser
> See https://doc.airvantage.net/av/reference/cloud/API/ for the methods arguments.

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