clx-web-api v1.0.94
Features
CAC - Cloudworx Api Client
Documentation
CLX Web Api
The Cloudworx Api Client is a layer to provide a light-weight communication between the panels and the control system using Web Socket which is a computer communication protocol, providing full-duplex communication channels over a single TCP connection.
To use it, you should install the package clx-web-api-1.0.0.tgz
in your project and instantiate the ControlApi
class.
There is a unit test to see how it works.
unit test script:
describe("ControlApi", () => {
const controlApiClient: any = ControlApi.getInstance();
const data = {
connectionId: "8fa2dc8e-83f1-a5f8-7349-7aa33341b414",
topic: "device",
data: {
deviceName: "CTSeries-1301",
command: "set",
value: "25",
path: "/ctseries/audio/audiooutputvolume"
}
};
it("Should get a valid control", async (done) => {
controlApiClient.get(data.paramId).subscribe((result: any) => {
expect(result).toBeDefined(true);
expect(data.paramId).toBe(data.paramId);
done();
}, (error: any) => { expect(error).toBeNull(error); });
});
it("Should set a response to control", async (done) => {
controlApiClient.set(data).subscribe((result: any) => {
expect(result).toBeDefined(true);
expect(result.success).toBeTruthy();
done();
}, (error: any) => { expect(error).toBeNull(error); });
});
});
Build the project
Run npm run build:project
to build the project. The build artifacts will be stored in the dist/
directory.
Generate a package
To perform this action:
Run npm run generate:package
to generate the package. The build artifacts will be stored in the dist/
directory.
You should see the clx-web-api-1.0.0.tgz
file generated based on the version specified in package.json file.
Now, if you want to test it, you should install this file in your application.
npm i clx-web-api
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago