@opentap/runner-client 2.10.0 → 2.11.0-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.
@@ -6,6 +6,9 @@ export interface RunnerLifetimeEvent {
6
6
  Subject: string;
7
7
  Discriminator: string;
8
8
  }
9
+ export interface RunnerUpdatedEvent {
10
+ RunnerId: string;
11
+ }
9
12
  export declare class SystemClient extends BaseClient {
10
13
  constructor(baseSubject: string, options: ConnectionOptions);
11
14
  /**
@@ -15,6 +18,14 @@ export declare class SystemClient extends BaseClient {
15
18
  * @returns {Subscription}
16
19
  */
17
20
  subscribeLifetimeEventListener(listener: (error: ErrorResponse | null, message: RunnerLifetimeEvent | null) => void, options?: SubscriptionOptions): Subscription;
21
+ /**
22
+ * Subscribe to the runner updated events for the given Runner ID.
23
+ * Wildcard can be used to receive all runner updated events.
24
+ * @param {string} runnerId
25
+ * @param {(error:ErrorResponse|null,message:RunnerUpdatedEvent|null)=>void} listener
26
+ * @param {SubscriptionOptions} options?
27
+ */
28
+ subscribeRunnerUpdatedEvents(runnerId: string, listener: (error: ErrorResponse | null, message: RunnerUpdatedEvent | null) => void, options?: SubscriptionOptions): Subscription;
18
29
  /**
19
30
  * Subscribe to the test step run start events for the given Runner and Run ID.
20
31
  * Wildcard can be used for the Runner or Run ID to receive all test step run start events.
@@ -40,7 +40,32 @@ var SystemClient = /** @class */ (function (_super) {
40
40
  */
41
41
  SystemClient.prototype.subscribeLifetimeEventListener = function (listener, options) {
42
42
  var _this = this;
43
- var subject = '*.Events.Lifetime';
43
+ var subject = 'Runner.*.Events.Lifetime';
44
+ return this.subscribe(subject, __assign(__assign({}, options), { callback: function (error, message) {
45
+ if (error) {
46
+ listener(_this.natsErrorHandler(error, subject), null);
47
+ return;
48
+ }
49
+ try {
50
+ var jsonCodec = JSONCodec();
51
+ var data = jsonCodec.decode(message === null || message === void 0 ? void 0 : message.data);
52
+ listener(null, data);
53
+ }
54
+ catch (error) {
55
+ listener(_this.natsErrorHandler(error, subject), null);
56
+ }
57
+ } }));
58
+ };
59
+ /**
60
+ * Subscribe to the runner updated events for the given Runner ID.
61
+ * Wildcard can be used to receive all runner updated events.
62
+ * @param {string} runnerId
63
+ * @param {(error:ErrorResponse|null,message:RunnerUpdatedEvent|null)=>void} listener
64
+ * @param {SubscriptionOptions} options?
65
+ */
66
+ SystemClient.prototype.subscribeRunnerUpdatedEvents = function (runnerId, listener, options) {
67
+ var _this = this;
68
+ var subject = "RunnerRegistry.".concat(runnerId, ".Events.Updated");
44
69
  return this.subscribe(subject, __assign(__assign({}, options), { callback: function (error, message) {
45
70
  if (error) {
46
71
  listener(_this.natsErrorHandler(error, subject), null);
@@ -66,7 +91,7 @@ var SystemClient = /** @class */ (function (_super) {
66
91
  */
67
92
  SystemClient.prototype.subscribeTestStepRunStartEventListener = function (runnerId, runId, listener, options) {
68
93
  var _this = this;
69
- var subject = "".concat(runnerId, ".Runs.").concat(runId, ".Events.TestStepRunStart");
94
+ var subject = "Runner.".concat(runnerId, ".Runs.").concat(runId, ".Events.TestStepRunStart");
70
95
  return this.subscribe(subject, __assign(__assign({}, options), { callback: function (error, message) {
71
96
  if (error) {
72
97
  listener(_this.natsErrorHandler(error, subject), null);
@@ -93,7 +118,7 @@ var SystemClient = /** @class */ (function (_super) {
93
118
  */
94
119
  SystemClient.prototype.subscribeTestStepRunCompletedEventListener = function (runnerId, runId, listener, options) {
95
120
  var _this = this;
96
- var subject = "".concat(runnerId, ".Runs.").concat(runId, ".Events.TestStepRunCompleted");
121
+ var subject = "Runner.".concat(runnerId, ".Runs.").concat(runId, ".Events.TestStepRunCompleted");
97
122
  return this.subscribe(subject, __assign(__assign({}, options), { callback: function (error, message) {
98
123
  if (error) {
99
124
  listener(_this.natsErrorHandler(error, subject), null);
@@ -120,7 +145,7 @@ var SystemClient = /** @class */ (function (_super) {
120
145
  */
121
146
  SystemClient.prototype.subscribeTestPlanRunStartEventListener = function (runnerId, runId, listener, options) {
122
147
  var _this = this;
123
- var subject = "".concat(runnerId, ".Runs.").concat(runId, ".Events.TestPlanRunStart");
148
+ var subject = "Runner.".concat(runnerId, ".Runs.").concat(runId, ".Events.TestPlanRunStart");
124
149
  return this.subscribe(subject, __assign(__assign({}, options), { callback: function (error, message) {
125
150
  if (error) {
126
151
  listener(_this.natsErrorHandler(error, subject), null);
@@ -147,7 +172,7 @@ var SystemClient = /** @class */ (function (_super) {
147
172
  */
148
173
  SystemClient.prototype.subscribeTestPlanRunCompletedEventListener = function (runnerId, runId, listener, options) {
149
174
  var _this = this;
150
- var subject = "".concat(runnerId, ".Runs.").concat(runId, ".Events.TestPlanRunCompleted");
175
+ var subject = "Runner.".concat(runnerId, ".Runs.").concat(runId, ".Events.TestPlanRunCompleted");
151
176
  return this.subscribe(subject, __assign(__assign({}, options), { callback: function (error, message) {
152
177
  if (error) {
153
178
  listener(_this.natsErrorHandler(error, subject), null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentap/runner-client",
3
- "version": "2.10.0",
3
+ "version": "2.11.0-alpha.1.1",
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",