npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

airvantage

v4.0.0

Published

AirVantage API client for nodejs

Downloads

133

Readme

AirVantage.js

Nodejs AirVantage API client

Build Status

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


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: "[email protected]",
        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:


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


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
      {
          "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
      {
          "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
      {
          "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
      {
          "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.