Giter Site home page Giter Site logo

magikabdul / jsxapi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cisco-ce/jsxapi

0.0 1.0 0.0 2.8 MB

JavaScript bindings for Cisco Collaboration Endpoint XAPI

Home Page: https://cisco-ce.github.io/jsxapi/

License: MIT License

JavaScript 1.55% TypeScript 98.10% Shell 0.35%

jsxapi's Introduction

JSXAPI

Build Status

API Documentation

A set of tools to integrate with the Cisco Telepresence Endpoint APIs in JavaScript.

Quick start examples

Connecting using WebSockets

const jsxapi = require('jsxapi');

jsxapi
  .connect('wss://host.example.com', {
    username: 'admin',
    password: 'password',
  })
  .on('error', console.error)
  .on('ready', async (xapi) => {
    const volume = await xapi.status.get('Audio Volume');
    console.log(`volume is: ${volume}`);
    xapi.close();
  });

Connecting using SSH

const jsxapi = require('jsxapi');

jsxapi
  .connect('ssh://host.example.com', {
    username: 'admin',
    password: 'password',
  })
  .on('error', console.error)
  .on('ready', async (xapi) => {
    const volume = await xapi.status.get('Audio Volume');
    console.log(`volume is: ${volume}`);
    xapi.close();
  });

New style API

The aim of the new style API is to improve readability, while also being more suited towards automatic type generation and auto-completion.

// Set up a call
xapi.Command.Dial({ Number: '[email protected]' });

// Fetch volume and print it
xapi.Status.Audio.Volume
  .get()
  .then((volume) => { console.log(volume); });

// Set a configuration
xapi.Config.SystemUnit.Name.set('My System');

// Listen to feedback
const off = xapi.Event.Standby.on((event) => {
  // ...
});

// De-register feedback
off();

Old style API

// Set up a call
xapi.command('Dial', { Number: '[email protected]' });

// Fetch volume and print it
xapi.status
  .get('Audio Volume')
  .then((volume) => { console.log(volume); });

// Set a configuration
xapi.config.set('SystemUnit Name', 'My System');

// Listen to feedback
const off = xapi.event.on('Standby', (event) => {
  // ...
});

// De-register feedback
off();

Documentation

The full API documentation can be built by running npm install in a jsxapi module directory. Documentation will be located under docs/ can then be opened in a browser.

More specifically:

mkdir tmp
cd tmp
npm install jsxapi
cd node_modules/jsxapi
npm install

Then open ./docs/index.html.

Questions and support?

Find more information regarding Cisco's Room Devices over at developer.cisco.com or the TelePresence and Video support forums.

Questions about the xAPI, integrations and customizations? Using Webex Teams join the xAPI Devs space community for realtime support by clicking this link and entering your Webex Teams-registered e-mail address at the prompt.

Development & Contribution

Release procedure

Making a release is quite simple:

  • Perform all changes/commits.
  • Determine the version change (npm help semver).
  • Update "CHANGELOG.md" with version number, date and change summary.
  • Run npm version with the appropriate version bump.
  • Run npm publish to push the package version to the registry.

jsxapi's People

Contributors

torkildr avatar myme avatar dependabot[bot] avatar bjornars avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.