@alwaysai/device-agent-schemas
v3.1.0
Published
alwaysAI schemas
Downloads
1,440
Maintainers
Keywords
Readme
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.0node
>= 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