1.0.94 • Published 4 years ago

clx-web-api v1.0.94

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

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
1.0.94

4 years ago

1.0.93

5 years ago

1.0.92

5 years ago

1.0.91

5 years ago

1.0.90

5 years ago

1.0.89

5 years ago

1.0.88

5 years ago

1.0.87

5 years ago

1.0.86

5 years ago

1.0.85

5 years ago

1.0.84

5 years ago

1.0.83

5 years ago

1.0.82

5 years ago

1.0.81

5 years ago

1.0.80

5 years ago

1.0.79

5 years ago

1.0.78

5 years ago

1.0.77

5 years ago

1.0.75

5 years ago

1.0.74

5 years ago

1.0.73

5 years ago

1.0.72

5 years ago

1.0.71

5 years ago

1.0.70

5 years ago

1.0.69

5 years ago

1.0.68

5 years ago

1.0.67

5 years ago

1.0.66

5 years ago

1.0.65

5 years ago

1.0.64

5 years ago

1.0.63

5 years ago

1.0.62

5 years ago

1.0.61

5 years ago

1.0.60

5 years ago

1.0.59

5 years ago

1.0.58

5 years ago

1.0.57

5 years ago

1.0.56

5 years ago

1.0.55

5 years ago

1.0.54

5 years ago

1.0.53

5 years ago

1.0.52

5 years ago

1.0.51

5 years ago

1.0.50

5 years ago

1.0.48

5 years ago

1.0.47

5 years ago

1.0.46

5 years ago

1.0.45

5 years ago

1.0.44

5 years ago

1.0.43

5 years ago

1.0.42

5 years ago

1.0.41

5 years ago

1.0.40

5 years ago

1.0.39

5 years ago

1.0.38

5 years ago

1.0.36

5 years ago

1.0.35

5 years ago

1.0.34

5 years ago

1.0.33

5 years ago

1.0.32

5 years ago

1.0.31

5 years ago

1.0.30

5 years ago

1.0.29

5 years ago

1.0.28

5 years ago

1.0.27

5 years ago

1.0.26

5 years ago

1.0.25

5 years ago

1.0.24

5 years ago

1.0.23

5 years ago

1.0.22

5 years ago

1.0.21

5 years ago

1.0.20

5 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago