Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@elevated-libs/cuss2

Package Overview
Dependencies
Maintainers
2
Versions
135
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@elevated-libs/cuss2

## Publishing changes - Clone repo - Install dependecies - run `npm publish`

  • 0.1.12
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-20%
Maintainers
2
Weekly downloads
 
Created
Source

@elevated-libs/cuss2

Publishing changes

  • Clone repo
  • Install dependecies
  • run npm publish

Elevated CUSS Library

Build Status

Interact with a CUSS 2.0 Restful API using a simple interface leveraging the asyncronicity of event driven architectures. By using the Elevated CUSS library you will get:

  • Simple device interfaces
  • Subscribable events for all CUSS states and device status
  • Typescript libs for Angular and React

Event Life Cycle

  • initCompleted

    • The application just called the init function with the appropiate parameters
  • token

    • The OAuth Server just returned a token to the applicaiton, this event data contains the actual token values
    cuss.token.subscribe(({access_token}) => console.log(`${access_token}`));
    
    
  • tokenReceived

    • The application succefully acquired a token and it is ready to create a listener on the cuss platform
  • listenerCreated

    • A websocket connection was succesfully created and now the application is allow to interact with the CUSS api
  • environmentReceived

    • The application just received the environment response from the platform and now is allowed to make a request for components availability
  • componentsReceived

    • The application just receieved all the components available including their characteristics.
  • queryCompleted

    • The application successfully queried all the devices in the platform
  • requiredComponentsFound

    • The applicaton was able to identify and validate the state of all required components; at this point it could request a state change to become AVAILABLE
  • requiredComponentsMissing

    • The application was unable to identify or validate the state of all required components within the platform; at this point it could request a state change to become UNAVAILABLE

Basic Initialization flow

importing the elevated cuss 2 lib

import { cuss, ComponentName, ApplicationStates } from '@elevated-libs/cuss2';

specify required components

requiredComponents: ComponentName[] = [
    ComponentName.BARCODE_READER, 
    ComponentName.BAGTAG_PRINTER, 
    ComponentName.BOARDINGPASS_PRINTER
];

call the init method

cuss.init({
    clientId: 'APPLICATION-CLIENT-ID',
    clientSecret: 'APPLICATION-CLIENT-SECRET',
    baseURL: 'VENDOR-CUSS-URL',
    oauthURL: 'VENDOR-OAUTH-SERVER-URL',
    requiredComponents: requiredComponents
});

subscribe to main events

 // handle when all required components are present
cuss.requiredComponentsFound
   .subscribe((found) => {
       if (found) {
           console.log("Validation completed");
           cuss.moveToState(ApplicationStates.AVAILABLE);
       }
   });

// handle when missing required components
cuss.requiredComponentsMissing
   .subscribe(({missing, components}) => {
       if (missing) {
           console.log("Missing the following required components", components);
           cuss.moveToState(ApplicationStates.UNAVAILABLE);
       }
   });

FAQs

Package last updated on 26 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc