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

bavenir-agent

v1.1.7

Published

bAvenir agent plugin for VICINITY adapters

Downloads

11

Readme

bAvenir VICINITY agent

npm NPM GitHub code size in bytes

This is a Node.js project that acts as integration support for VICINITY adapters. Provides functionality to manage VICINITY items lifecycle and consumption of resources.

The agent is used as an NPM package that integrates with the generic VICINITY adapter. The purpose of this tools is to ease the development of new adapters using the generic adapter as platform.

https://github.com/bAvenir/vicinity-generic-adapter

Pre-requisites

  • Generic adapter: git clone https://github.com/bAvenir/vicinity-generic-adapter.git
  • Node.js >= v12

How to install

  • npm i bavenir-agent

Documentation of the API

The agent exposes several routes (admin/ and api/) that the vicinity generic adapter includes in its API.

Once the VICINITY adapter is running, we can see the agent routes in localhost:PORT/agentdocs

Resources available for developers

When the adapter installs the VICINITY agent, besides the APIs, several other resources become available to it:

For DEVELOPERS, see docs/resources for description of the available functions to build an extension to the adapter.

  • Agent

    • Gateway: Interface to the gateway API.
    • Services: Agent services based on series of interactions with VICINITY using the Gateway.
  • Persistance

    • Redis: Access to control REDIS db. You can extend the persistance functionality. Careful using this feature to avoid overriding agent default hashes and lists.
    • Persistance: Services based on REDIS. Interface to more common functions for default models.
  • Classes: Agent predefined classes are available to use in the Adapter.

    • logger.js: Logging module
    • request.js: Perform requests to APIs or other services
    • response.js: Response wrapper
    • timer.js: Wrapper for the nodeJS timer, it eases the control of the timers.
    • mqtt.js: Create connections to mqtt servers

Default models persisted to memory

NOTE: The names used by the following lists and hashes are reserved, try not to override if you decide to reuse the redis module.

  • Default lists

    • properties: [properties] list in REDIS contains registered PIDs
    • events: [events] list in REDIS contains registered EIDs
    • actions: [actions] list in REDIS contains registered AIDs
    • registrations [oids]
    • mappers [<some_id>]
    • dataurls [oid:interaction:interaction_id]
  • Default hashes

    • registration:
      • id --> oid of your register devices
      • Hash contains --> {oid, name, type, properties, events, actions, password, credentials}
    • interaction:
      • interaction_id --> properties:brightness
      • Hash contains --> { body: stringified object with interaction description in JSON, vicinity: vicinity interaction type }
    • mappers: User defined, the identifier of the has field has to be map:<some_id>
      • You need to add the prefix map: to avoid overriding other hash maps (E.g: Case that you would be reusing oid as identifier)
      • Therefore when creating a new mapper this has to contain the field "id"
    • configuration: Managed by agent
  • Default strings

    • /objects/{oid}/{interaction}/{interaction_id} --> Used for caching

More info available in folder src/_persistance/_models, on top of each file the model is described in the comments.