@opentap/runner-client 2.4.0-alpha.1.2 → 2.4.0

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.
@@ -1,5 +1,11 @@
1
1
  import { BaseClient } from './BaseClient';
2
2
  import { ConnectionOptions, Subscription, SubscriptionOptions } from 'nats.ws';
3
+ import { ErrorResponse } from './DTOs';
4
+ export interface RunnerLifetimeEvent {
5
+ RunnerId: string;
6
+ Subject: string;
7
+ Discriminator: string;
8
+ }
3
9
  export declare class SystemClient extends BaseClient {
4
10
  constructor(baseSubject: string, options: ConnectionOptions);
5
11
  /**
@@ -8,5 +14,5 @@ export declare class SystemClient extends BaseClient {
8
14
  * @param {SubscriptionOptions} options
9
15
  * @returns {Subscription}
10
16
  */
11
- subscribeLifetimeEventListener(listener: (...args: any[]) => void, options?: SubscriptionOptions): Subscription;
17
+ subscribeLifetimeEventListener(listener: (error: ErrorResponse | null, message: RunnerLifetimeEvent | null) => void, options?: SubscriptionOptions): Subscription;
12
18
  }
@@ -41,16 +41,16 @@ var SystemClient = /** @class */ (function (_super) {
41
41
  var _this = this;
42
42
  return this.subscribe('*.Events.Lifetime', __assign(__assign({}, options), { callback: function (error, message) {
43
43
  if (error) {
44
- listener(_this.natsErrorHandler(error, '*.Events.Lifetime'));
44
+ listener(_this.natsErrorHandler(error, '*.Events.Lifetime'), null);
45
45
  return;
46
46
  }
47
47
  try {
48
48
  var jsonCodec = JSONCodec();
49
49
  var data = jsonCodec.decode(message === null || message === void 0 ? void 0 : message.data);
50
- listener(data);
50
+ listener(null, data);
51
51
  }
52
52
  catch (error) {
53
- listener(_this.natsErrorHandler(error, '*.Events.Lifetime'));
53
+ listener(_this.natsErrorHandler(error, '*.Events.Lifetime'), null);
54
54
  }
55
55
  } }));
56
56
  };
package/lib/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { RunnerClient } from './RunnerClient';
2
2
  export { SessionClient } from './SessionClient';
3
- export { SystemClient } from './SystemClient';
3
+ export { SystemClient, RunnerLifetimeEvent } from './SystemClient';
4
4
  export * from './DTOs';
5
5
  export * from 'nats.ws';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentap/runner-client",
3
- "version": "2.4.0-alpha.1.2",
3
+ "version": "2.4.0",
4
4
  "description": "This is the web client for the OpenTAP Runner.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",