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 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,
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,
-
npm
>= 7.0.0 -
node
>= 16.0.0
NOTE: Ensure unit tests are passing and new functionality is verified prior to release!
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