2.1.0 • Published 5 months ago

@evva/nest-xs3-api-client v2.1.0

Weekly downloads
-
License
SEE LICENSE IN <L...
Repository
github
Last release
5 months ago

Nest XS3 Api Client

NPM Version NPM Downloads NPM Unpacked Size (with version) GitHub last commit GitHub branch check runs EVVA License

Install

$ npm i @evva/nest-xs3-api-client

Description

Client implementation for the Xesar 3 MQTT api interface.

Build & Package

# Nest Build
$ nest build

Usage

Import module

import { ClientService } from '@evva/nest-xs3-api-client';

@Module({
  imports: [ClientModule],
  providers: [AppService],
})
export class AppModule {}

Connect

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 results

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 and offset 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 commands

Execute specific CQRS commands on the Xesar API.

let result = await this.clientService.remoteDisengageCommand(
  'a034bfda-c569-49a0-a3ba-d438d65eeb34',
  false,
);

License

Proprietary

2.1.0

5 months ago

2.0.0

5 months ago

1.0.0

5 months ago

0.0.6

5 months ago

0.0.5

6 months ago

0.0.4

7 months ago

0.0.3

7 months ago

0.0.2

7 months ago

0.0.1

7 months ago