@alwaysai/device-agent-schemas
TypeScript icon, indicating that this package has built-in type declarations

2.4.2 • Public • Published

alwaysAI Device Agent Schemas

Contents

The alwaysAI Device Agent Schemas package provides interfaces that represent the messaging interface for communication with the alwaysAI Device Agent, as well as functions for validating JSON data that are being used as device agent messages.

Use in Development

Use the provided interfaces as type guards in your development to ensure that proper messages are generated.

The provided interfaces are:

  • DeviceStats,
  • DeviceStatsPayload,
  • AppState,
  • AppStateValue,
  • ServiceStatus,
  • AppDetails,
  • AppStatePayload,
  • InstallationStatus,
  • InstallationStatusMessage,
  • AppLogs,
  • AppLogsPayload,
  • AppStateControlValue,
  • AppVersionControlValue,
  • AppStateControl,
  • AppVersionControl,
  • AppActionMessage,
  • AgentActionValue,
  • LiveUpdatesToggles,
  • DeviceAgentMessage,
  • ClientMessage,

Runtime Message Validation

You can also incorporated the provided validation methods to ensure that incoming JSON data are properly formatted at runtime.

validateDeviceAgentMessage can be used to validate any package as a whole to verify that it is a valid device agent message. There are more granular validation methods for verifying packets for a specific type of device agent message. These methods are:

  • validateDeviceStatsMessage,
  • validateAppStateMessage,
  • validateInstallationStatusMessage,
  • validateAppLogsMessage,
  • validateAppActionMessage,
  • validateAgentActionMessage,
  • validateDeviceAgentMessage,
  • validateClientMessage,

System Requirements

  • npm >= 7.0.0
  • node >= 16.0.0

Release Process

NOTE: Ensure unit tests are passing and new functionality is verified prior to release!

Release procedure

To release the package to npmjs.org follow the steps:

  • publish new version: npm run publish:<major|minor|patch>
  • watch the bitbucket pipeline running, if successful a new version will be created and published to npmjs.org
  • to get the auto-generated commit and tags, simply pull: git pull

Readme

Keywords

none

Package Sidebar

Install

npm i @alwaysai/device-agent-schemas

Homepage

alwaysai.co

Weekly Downloads

415

Version

2.4.2

License

none

Unpacked Size

83.6 kB

Total Files

53

Last publish

Collaborators

  • toddathan
  • sheshalwaysai
  • alexbigkid
  • tony-alwaysai
  • jarrett.thompson
  • dwolner
  • olaf.ziel
  • lilamullany
  • mitchrosenlof
  • carloslazo
  • ericvanbuhler
  • socalrunner