
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
@openremote/rest
Advanced tools
ES6 modules for connecting to an OpenRemote Manager as well as utilities for performing common tasks.
The default export is a singleton of type RestApi
that can be used to communicate with the OpenRemote Manager REST API.
It uses an axios client to perform the requests and it contains strongly typed
definitions for each OpenRemote Manager REST API endpoint (JAX-RS resource).
npm i @openremote/rest
yarn add @openremote/rest
For a full list of properties, methods and options refer to the TypeDoc generated documentation.
If used in conjunction with @openremote/core
and the Manager
init
method has been called then the default export
will be ready to use, the endpoints can be accessed via the RestApi
api
property and each JAX-RS resource defined
in the OpenRemote Manager is also defined with the same name in the RestApi
object.
import openremote from "@openremote/core";
import rest from "@openremote/rest";
openremote.init({
...
}).then((success) => {
if (success) {
let assetQuery = ...;
let response = await rest.api.AssetResource.queryAssets(assetQuery);
let assets = response.data;
// Do something with the assets
} else {
// Something has gone wrong
}
});
It is possible to add additional request interceptors by calling the addRequestInterceptor
method, it is also possible
to access the AxiosInstance
by calling the axiosInstance
property.
It is also possible to instantiate the RestApi
object on demand but note you will need to ensure the Authorization
header is correctly set if calling secure endpoints on the OpenRemote Manager REST API.
import {RestApi} from "@openremote/rest";
let rest = new RestApi();
rest.setTimeout(10000);
rest.addRequestInterceptor(...);
rest.initialise();
The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge. In addition, Internet Explorer 11 is also supported.
FAQs
OpenRemote 3.x REST API
The npm package @openremote/rest receives a total of 405 weekly downloads. As such, @openremote/rest popularity was classified as not popular.
We found that @openremote/rest demonstrated a healthy version release cadence and project activity because the last version was released less than 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
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.