Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
@devoinc/alerts-api-client
Advanced tools
Devo Alerts API Client is a client for Devo Alerts API writed in TypeScript.
NOTE:The clients was developed and test using node v16.15.1 and npm v8.11.0
Use one of those ways to use the Alerts API Client.
Install from npm
npm install --save @devoinc/alerts-api-client
Install from Github
First, install typescript:
npm install --save-dev typescript
Install the client:
npm install --save https://github.com/DevoInc/alerts-api-client
Install from source
npm install --save /path/to/alerts-api-client
Prior to instantiate the client, you need to create a class which implements the IConfig interface, for example, in this example we create a class called AuthConfig:
import { IConfig } from "@devoinc/alerts-api-client";
const credentials = require('../../.credentials/tapu.json');
export class AuthConfig implements IConfig {
getAuthorization() {
return credentials.token;
}
}
Now you can instantiate the client. In the case that you use async/await:
import { Client } from '@devoinc/alerts-api-client';
// define the url that are you using and the token created.
const url = 'https://api-us.devo.com/alerts';
const authConfig: AuthConfig = new AuthConfig();
// initialize the Client
const client = new Client(authConfig, url);
// get alert
const alertId = 1;
const alert: Alert = await client.get(alertId, true, true);
Or instead of using async/await, you can also use promises:
import { AlertDefinition } from '@devoinc/alerts-api-client';
// define the url that are you using and the token created.
const url = 'https://api-us.devo.com/alerts';
const authConfig: AuthConfig = new AuthConfig();
// initialize the Client
const client = new Client(authConfig, url);
// get alert
const alertId = 1;
client
.get(alertId, true, true)
.then((alert) => {
// do something with the alert
})
.catch((error) => {
console.log(error);
});
This client has been generated using Nswag.
Nswag is a dotnet library that takes OpenApi documentation from an existing API and builds a typescript client to consume this at your front-end.
If you are going to regenerate this client be sure you firstly had installed at least .net core 3.1 runtime in your local machine.
The documentation of this client is available at GitHub.
v2.0.4
Fix pagination when get alerts
FAQs
Typescript client for devo alerts API
The npm package @devoinc/alerts-api-client receives a total of 2 weekly downloads. As such, @devoinc/alerts-api-client popularity was classified as not popular.
We found that @devoinc/alerts-api-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.