$ npm i @evva/nest-xs3-api-client
Client implementation for the Xesar 3 MQTT api interface.
# Nest Build
$ nest build
import { ClientService } from '@evva/nest-xs3-api-client';
@Module({
imports: [ClientModule],
providers: [AppService],
})
export class AppModule {}
Connect to the broker by passing connect options.
await this.clientService.connect({
host: 'host',
port: 1883,
cert: 'cert',
certCA: 'certCA',
key: 'key',
clientId: 'clientId',
token: 'token',
} as ClientConnectOptions);
Query specific resources from the Xesar API with support for pagination and filters.
let result = await this.clientService.queryPaged({
res: 'evva-components',
limit: 5,
offset: 0,
filters: [
{
type: 'eq',
field: 'status',
value: 'Synced',
},
],
});
You can auto-paginate all results by omitting the
limit
andoffset
properties.
A few of the supported resources are:
export type Resource =
| 'identification-media'
| 'authorization-profiles'
| 'access-protocol'
| 'persons'
| 'installation-points'
| 'evva-components'
| 'office-modes'
| 'time-profiles'
| 'zones';
Execute specific CQRS commands on the Xesar API.
let result = await this.clientService.commandCQRS(
'RequestAddMediumToInstallationMapi',
{
id: 'id',
commandId: 'commandId',
terminalId: 'terminalId',
hardwareId: 'hardwareId',
},
);
For a full list of supported commands and parameters check the /api/docs of your installation.
Proprietary