@opentap/runner-client 1.2.1 → 1.2.2-alpha.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -13
- package/lib/BaseClient.js +1 -1
- package/lib/SessionClient.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,15 +9,15 @@ This is the web client for the OpenTAP Runner.
|
|
|
9
9
|
- [@OpenTAP.io](https://opentap.io/)
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## How to install the client
|
|
13
13
|
|
|
14
|
-
Install
|
|
14
|
+
Install with npm
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
17
|
npm install @opentap/runner-client
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
##
|
|
20
|
+
## How to use the client
|
|
21
21
|
|
|
22
22
|
```typescript
|
|
23
23
|
import { RunnerClient } from "@openTap/runner-client";
|
|
@@ -27,34 +27,34 @@ class client {
|
|
|
27
27
|
|
|
28
28
|
constructor() {
|
|
29
29
|
this.runnerClient = new RunnerClient('<BASE_SUBJECT>', { servers: '<SERVER_ADDRESS>' });
|
|
30
|
+
// Always connect first
|
|
31
|
+
this.runnerClient.connect()
|
|
32
|
+
.then(() => console.log('CONNECTED'))
|
|
33
|
+
.catch(err => console.log(err));
|
|
30
34
|
}
|
|
31
35
|
|
|
32
36
|
getImages() {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
.catch(error => console.error(error));
|
|
37
|
-
} catch (error) {
|
|
38
|
-
console.error(error);
|
|
39
|
-
}
|
|
37
|
+
this.data = this.runnerClient?.getImages()
|
|
38
|
+
.then(res => console.log(res))
|
|
39
|
+
.catch(error => console.error(error));
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
|
|
46
|
-
##
|
|
46
|
+
## How to build locally
|
|
47
47
|
|
|
48
48
|
Clone the project
|
|
49
49
|
|
|
50
50
|
```bash
|
|
51
|
-
git clone https://
|
|
51
|
+
~ git clone https://github.com/opentap/runner-client-web.git
|
|
52
52
|
```
|
|
53
53
|
|
|
54
54
|
Go to the project directory
|
|
55
55
|
|
|
56
56
|
```bash
|
|
57
|
-
cd
|
|
57
|
+
~ cd runner-client-web
|
|
58
58
|
```
|
|
59
59
|
|
|
60
60
|
Install dependencies
|
|
@@ -69,6 +69,7 @@ Build the library
|
|
|
69
69
|
npm run build
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
+
## How to debug the project
|
|
72
73
|
|
|
73
74
|
## License
|
|
74
75
|
|
package/lib/BaseClient.js
CHANGED
|
@@ -184,7 +184,7 @@ var BaseClient = /** @class */ (function () {
|
|
|
184
184
|
* @returns {boolean}
|
|
185
185
|
*/
|
|
186
186
|
BaseClient.prototype.isErrorResponse = function (response) {
|
|
187
|
-
return response && typeof response === 'object' && ['Type', 'Message', 'StackTrace'
|
|
187
|
+
return response && typeof response === 'object' && ['Type', 'Message', 'StackTrace'].every(function (prop) { return prop in response; });
|
|
188
188
|
};
|
|
189
189
|
/**
|
|
190
190
|
* Create a connection to the nats server.
|
package/lib/SessionClient.js
CHANGED
|
@@ -60,7 +60,7 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
60
60
|
* @returns Subscription object
|
|
61
61
|
*/
|
|
62
62
|
SessionClient.prototype.connectSessionEvents = function (eventHandler, options) {
|
|
63
|
-
return this.subscribe('Events', __assign(__assign({}, options), { callback: function (error, encodedMessage) {
|
|
63
|
+
return this.subscribe('Events.*', __assign(__assign({}, options), { callback: function (error, encodedMessage) {
|
|
64
64
|
if (error) {
|
|
65
65
|
eventHandler(undefined, error);
|
|
66
66
|
return;
|