@opentap/runner-client 2.4.0 → 2.5.0-alpha.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/lib/DTOs.d.ts CHANGED
@@ -1168,3 +1168,88 @@ export declare class TestPlanSettingsChangedEventArgs extends SessionEvent imple
1168
1168
  toJSON(data?: any): any;
1169
1169
  }
1170
1170
  export declare type ITestPlanSettingsChangedEventArgs = ISessionEvent;
1171
+ export interface ITestStepRunEvent {
1172
+ parent?: string;
1173
+ testStepId?: string;
1174
+ testStepName?: string;
1175
+ testStepTypeName?: string;
1176
+ id?: string;
1177
+ verdict?: number;
1178
+ startTime?: string;
1179
+ parameters?: Parameter[];
1180
+ }
1181
+ export declare class TestStepRunEvent implements ITestStepRunEvent {
1182
+ parent?: string;
1183
+ testStepId?: string;
1184
+ testStepName?: string;
1185
+ testStepTypeName?: string;
1186
+ id?: string;
1187
+ verdict?: number;
1188
+ startTime?: string;
1189
+ parameters?: Parameter[];
1190
+ protected _discriminator: string;
1191
+ constructor(data?: ITestStepRunEvent);
1192
+ init(_data?: any): void;
1193
+ static fromJS(data: any): TestStepRunEvent;
1194
+ toJSON(data?: any): any;
1195
+ }
1196
+ export declare type ITestStepRunStartEventArgs = ITestStepRunEvent;
1197
+ export declare class TestStepRunStartEventArgs extends TestStepRunEvent implements ITestStepRunStartEventArgs {
1198
+ constructor(data?: ITestStepRunStartEventArgs);
1199
+ init(_data?: any): void;
1200
+ static fromJS(data: any): TestStepRunStartEventArgs;
1201
+ toJSON(data?: any): any;
1202
+ }
1203
+ export declare type ITestStepRunCompletedEventArgs = ITestStepRunEvent;
1204
+ export declare class TestStepRunCompletedEventArgs extends TestStepRunEvent implements ITestStepRunCompletedEventArgs {
1205
+ constructor(data?: ITestStepRunCompletedEventArgs);
1206
+ init(_data?: any): void;
1207
+ static fromJS(data: any): TestStepRunCompletedEventArgs;
1208
+ toJSON(data?: any): any;
1209
+ }
1210
+ export interface ITestPlanRunEvent {
1211
+ testPlanRunId?: number;
1212
+ testPlanRunGuid?: string;
1213
+ path?: string;
1214
+ name?: string;
1215
+ verdict?: string;
1216
+ startTime?: string;
1217
+ runner?: string;
1218
+ status?: string;
1219
+ isCampaign?: boolean;
1220
+ operator?: string;
1221
+ }
1222
+ export declare class TestPlanRunEvent implements ITestPlanRunEvent {
1223
+ testPlanRunId?: number;
1224
+ testPlanRunGuid?: string;
1225
+ path?: string;
1226
+ name?: string;
1227
+ verdict?: string;
1228
+ startTime?: string;
1229
+ runner?: string;
1230
+ status?: string;
1231
+ isCampaign?: boolean;
1232
+ operator?: string;
1233
+ protected _discriminator: string;
1234
+ constructor(data?: ITestPlanRunEvent);
1235
+ init(_data?: any): void;
1236
+ static fromJS(data: any): TestPlanRunEvent;
1237
+ toJSON(data?: any): any;
1238
+ }
1239
+ export declare type ITestPlanRunStartEventArgs = ITestPlanRunEvent;
1240
+ export declare class TestPlanRunStartEventArgs extends TestPlanRunEvent implements ITestPlanRunStartEventArgs {
1241
+ constructor(data?: ITestPlanRunStartEventArgs);
1242
+ init(_data?: any): void;
1243
+ static fromJS(data: any): TestPlanRunStartEventArgs;
1244
+ toJSON(data?: any): any;
1245
+ }
1246
+ export interface ITestPlanRunCompletedEventArgs extends ITestPlanRunEvent {
1247
+ durationInSeconds?: number;
1248
+ }
1249
+ export declare class TestPlanRunCompletedEventArgs extends TestPlanRunEvent implements ITestPlanRunCompletedEventArgs {
1250
+ durationInSeconds?: number;
1251
+ constructor(data?: ITestPlanRunCompletedEventArgs);
1252
+ init(_data?: any): void;
1253
+ static fromJS(data: any): TestPlanRunCompletedEventArgs;
1254
+ toJSON(data?: any): any;
1255
+ }
package/lib/DTOs.js CHANGED
@@ -3392,3 +3392,224 @@ var TestPlanSettingsChangedEventArgs = /** @class */ (function (_super) {
3392
3392
  return TestPlanSettingsChangedEventArgs;
3393
3393
  }(SessionEvent));
3394
3394
  export { TestPlanSettingsChangedEventArgs };
3395
+ var TestStepRunEvent = /** @class */ (function () {
3396
+ function TestStepRunEvent(data) {
3397
+ if (data) {
3398
+ for (var property in data) {
3399
+ if (Object.prototype.hasOwnProperty.call(data, property))
3400
+ this[property] = data[property];
3401
+ }
3402
+ }
3403
+ this._discriminator = 'TestStepRunEvent';
3404
+ }
3405
+ TestStepRunEvent.prototype.init = function (_data) {
3406
+ if (_data) {
3407
+ this.parent = _data['Parent'];
3408
+ this.testStepId = _data['TestStepId'];
3409
+ this.testStepName = _data['TestStepName'];
3410
+ this.testStepTypeName = _data['TestStepTypeName'];
3411
+ this.id = _data['Id'];
3412
+ this.verdict = _data['Verdict'];
3413
+ this.startTime = _data['StartTime'];
3414
+ if (Array.isArray(_data['Parameters'])) {
3415
+ this.parameters = [];
3416
+ for (var _i = 0, _a = _data['Parameters']; _i < _a.length; _i++) {
3417
+ var item = _a[_i];
3418
+ this.parameters.push(Parameter.fromJS(item));
3419
+ }
3420
+ }
3421
+ }
3422
+ };
3423
+ TestStepRunEvent.fromJS = function (data) {
3424
+ data = typeof data === 'object' ? data : {};
3425
+ if (data['discriminator'] === 'TestStepRunStartEventArgs') {
3426
+ var result_39 = new TestStepRunStartEventArgs();
3427
+ result_39.init(data);
3428
+ return result_39;
3429
+ }
3430
+ if (data['discriminator'] === 'TestStepRunCompletedEventArgs') {
3431
+ var result_40 = new TestStepRunCompletedEventArgs();
3432
+ result_40.init(data);
3433
+ return result_40;
3434
+ }
3435
+ var result = new TestStepRunEvent();
3436
+ result.init(data);
3437
+ return result;
3438
+ };
3439
+ TestStepRunEvent.prototype.toJSON = function (data) {
3440
+ data['Parent'] = this.parent;
3441
+ data['TestStepId'] = this.testStepId;
3442
+ data['TestStepName'] = this.testStepName;
3443
+ data['TestStepTypeName'] = this.testStepTypeName;
3444
+ data['Id'] = this.id;
3445
+ data['Verdict'] = this.verdict;
3446
+ data['StartTime'] = this.startTime;
3447
+ if (Array.isArray(this.parameters)) {
3448
+ data['Parameters'] = [];
3449
+ for (var _i = 0, _a = this.parameters; _i < _a.length; _i++) {
3450
+ var item = _a[_i];
3451
+ data['Parameters'].push(item.toJSON());
3452
+ }
3453
+ }
3454
+ return data;
3455
+ };
3456
+ return TestStepRunEvent;
3457
+ }());
3458
+ export { TestStepRunEvent };
3459
+ var TestStepRunStartEventArgs = /** @class */ (function (_super) {
3460
+ __extends(TestStepRunStartEventArgs, _super);
3461
+ function TestStepRunStartEventArgs(data) {
3462
+ var _this = _super.call(this, data) || this;
3463
+ _this._discriminator = 'TestStepRunStartEventArgs';
3464
+ return _this;
3465
+ }
3466
+ TestStepRunStartEventArgs.prototype.init = function (_data) {
3467
+ _super.prototype.init.call(this, _data);
3468
+ };
3469
+ TestStepRunStartEventArgs.fromJS = function (data) {
3470
+ data = typeof data === 'object' ? data : {};
3471
+ var result = new TestStepRunStartEventArgs();
3472
+ result.init(data);
3473
+ return result;
3474
+ };
3475
+ TestStepRunStartEventArgs.prototype.toJSON = function (data) {
3476
+ data = typeof data === 'object' ? data : {};
3477
+ _super.prototype.toJSON.call(this, data);
3478
+ return data;
3479
+ };
3480
+ return TestStepRunStartEventArgs;
3481
+ }(TestStepRunEvent));
3482
+ export { TestStepRunStartEventArgs };
3483
+ var TestStepRunCompletedEventArgs = /** @class */ (function (_super) {
3484
+ __extends(TestStepRunCompletedEventArgs, _super);
3485
+ function TestStepRunCompletedEventArgs(data) {
3486
+ var _this = _super.call(this, data) || this;
3487
+ _this._discriminator = 'TestStepRunCompletedEventArgs';
3488
+ return _this;
3489
+ }
3490
+ TestStepRunCompletedEventArgs.prototype.init = function (_data) {
3491
+ _super.prototype.init.call(this, _data);
3492
+ };
3493
+ TestStepRunCompletedEventArgs.fromJS = function (data) {
3494
+ data = typeof data === 'object' ? data : {};
3495
+ var result = new TestStepRunCompletedEventArgs();
3496
+ result.init(data);
3497
+ return result;
3498
+ };
3499
+ TestStepRunCompletedEventArgs.prototype.toJSON = function (data) {
3500
+ data = typeof data === 'object' ? data : {};
3501
+ _super.prototype.toJSON.call(this, data);
3502
+ return data;
3503
+ };
3504
+ return TestStepRunCompletedEventArgs;
3505
+ }(TestStepRunEvent));
3506
+ export { TestStepRunCompletedEventArgs };
3507
+ var TestPlanRunEvent = /** @class */ (function () {
3508
+ function TestPlanRunEvent(data) {
3509
+ if (data) {
3510
+ for (var property in data) {
3511
+ if (Object.prototype.hasOwnProperty.call(data, property))
3512
+ this[property] = data[property];
3513
+ }
3514
+ }
3515
+ this._discriminator = 'TestPlanRunEvent';
3516
+ }
3517
+ TestPlanRunEvent.prototype.init = function (_data) {
3518
+ if (_data) {
3519
+ this.testPlanRunId = _data['Run/TestPlanRunId'];
3520
+ this.testPlanRunGuid = _data['Run/TestPlanRunGuid'];
3521
+ this.path = _data['Run/Path'];
3522
+ this.name = _data['Run/Name'];
3523
+ this.verdict = _data['Run/Verdict'];
3524
+ this.startTime = _data['Run/StartTime'];
3525
+ this.runner = _data['Run/Runner'];
3526
+ this.status = _data['Run/Status'];
3527
+ this.isCampaign = _data['Run/IsCampaign'];
3528
+ this.operator = _data['Run/Operator'];
3529
+ }
3530
+ };
3531
+ TestPlanRunEvent.fromJS = function (data) {
3532
+ data = typeof data === 'object' ? data : {};
3533
+ if (data['discriminator'] === 'TestPlanRunStartEventArgs') {
3534
+ var result_41 = new TestPlanRunStartEventArgs();
3535
+ result_41.init(data);
3536
+ return result_41;
3537
+ }
3538
+ if (data['discriminator'] === 'TestPlanRunCompletedEventArgs') {
3539
+ var result_42 = new TestPlanRunCompletedEventArgs();
3540
+ result_42.init(data);
3541
+ return result_42;
3542
+ }
3543
+ var result = new TestPlanRunEvent();
3544
+ result.init(data);
3545
+ return result;
3546
+ };
3547
+ TestPlanRunEvent.prototype.toJSON = function (data) {
3548
+ data = typeof data === 'object' ? data : {};
3549
+ data['Run/TestPlanRunId'] = this.testPlanRunId;
3550
+ data['Run/TestPlanRunGuid'] = this.testPlanRunGuid;
3551
+ data['Run/Path'] = this.path;
3552
+ data['Run/Name'] = this.name;
3553
+ data['Run/Verdict'] = this.verdict;
3554
+ data['Run/StartTime'] = this.startTime;
3555
+ data['Run/Runner'] = this.runner;
3556
+ data['Run/Status'] = this.status;
3557
+ data['Run/IsCampaign'] = this.isCampaign;
3558
+ data['Run/Operator'] = this.operator;
3559
+ return data;
3560
+ };
3561
+ return TestPlanRunEvent;
3562
+ }());
3563
+ export { TestPlanRunEvent };
3564
+ var TestPlanRunStartEventArgs = /** @class */ (function (_super) {
3565
+ __extends(TestPlanRunStartEventArgs, _super);
3566
+ function TestPlanRunStartEventArgs(data) {
3567
+ var _this = _super.call(this, data) || this;
3568
+ _this._discriminator = 'TestPlanRunStartEventArgs';
3569
+ return _this;
3570
+ }
3571
+ TestPlanRunStartEventArgs.prototype.init = function (_data) {
3572
+ _super.prototype.init.call(this, _data);
3573
+ };
3574
+ TestPlanRunStartEventArgs.fromJS = function (data) {
3575
+ data = typeof data === 'object' ? data : {};
3576
+ var result = new TestPlanRunStartEventArgs();
3577
+ result.init(data);
3578
+ return result;
3579
+ };
3580
+ TestPlanRunStartEventArgs.prototype.toJSON = function (data) {
3581
+ data = typeof data === 'object' ? data : {};
3582
+ _super.prototype.toJSON.call(this, data);
3583
+ return data;
3584
+ };
3585
+ return TestPlanRunStartEventArgs;
3586
+ }(TestPlanRunEvent));
3587
+ export { TestPlanRunStartEventArgs };
3588
+ var TestPlanRunCompletedEventArgs = /** @class */ (function (_super) {
3589
+ __extends(TestPlanRunCompletedEventArgs, _super);
3590
+ function TestPlanRunCompletedEventArgs(data) {
3591
+ var _this = _super.call(this, data) || this;
3592
+ _this._discriminator = 'TestPlanRunCompletedEventArgs';
3593
+ return _this;
3594
+ }
3595
+ TestPlanRunCompletedEventArgs.prototype.init = function (_data) {
3596
+ _super.prototype.init.call(this, _data);
3597
+ if (_data) {
3598
+ this.durationInSeconds = _data['Run/DurationInSeconds'];
3599
+ }
3600
+ };
3601
+ TestPlanRunCompletedEventArgs.fromJS = function (data) {
3602
+ data = typeof data === 'object' ? data : {};
3603
+ var result = new TestPlanRunCompletedEventArgs();
3604
+ result.init(data);
3605
+ return result;
3606
+ };
3607
+ TestPlanRunCompletedEventArgs.prototype.toJSON = function (data) {
3608
+ data = typeof data === 'object' ? data : {};
3609
+ data['Run/DurationInSeconds'] = this.durationInSeconds;
3610
+ _super.prototype.toJSON.call(this, data);
3611
+ return data;
3612
+ };
3613
+ return TestPlanRunCompletedEventArgs;
3614
+ }(TestPlanRunEvent));
3615
+ export { TestPlanRunCompletedEventArgs };
@@ -1,6 +1,6 @@
1
1
  import { BaseClient } from './BaseClient';
2
2
  import { ConnectionOptions, Subscription, SubscriptionOptions } from 'nats.ws';
3
- import { ErrorResponse } from './DTOs';
3
+ import { ErrorResponse, TestPlanRunCompletedEventArgs, TestPlanRunStartEventArgs, TestStepRunCompletedEventArgs, TestStepRunStartEventArgs } from './DTOs';
4
4
  export interface RunnerLifetimeEvent {
5
5
  RunnerId: string;
6
6
  Subject: string;
@@ -15,4 +15,40 @@ export declare class SystemClient extends BaseClient {
15
15
  * @returns {Subscription}
16
16
  */
17
17
  subscribeLifetimeEventListener(listener: (error: ErrorResponse | null, message: RunnerLifetimeEvent | null) => void, options?: SubscriptionOptions): Subscription;
18
+ /**
19
+ * Subscribe to the test step run start events for the given Runner and Run ID.
20
+ * Wildcard can be used for the Runner or Run ID to receive all test step run start events.
21
+ * @param {string} runnerId
22
+ * @param {string} runId
23
+ * @param {(error:ErrorResponse|null,message:TestStepRunStartEventArgs|null)=>void} listener
24
+ * @param {SubscriptionOptions} options?
25
+ */
26
+ subscribeTestStepRunStartEventListener(runnerId: string, runId: string, listener: (error: ErrorResponse | null, message: TestStepRunStartEventArgs | null) => void, options?: SubscriptionOptions): Subscription;
27
+ /**
28
+ * Subscribe to the test step run completed events for the given Runner and Run ID.
29
+ * Wildcard can be used for the Runner or Run ID to receive all test step run completed events.
30
+ * @param {string} runnerId
31
+ * @param {string} runId
32
+ * @param {(error:ErrorResponse|null,message:TestStepRunStartEventArgs|null)=>void} listener
33
+ * @param {SubscriptionOptions} options?
34
+ */
35
+ subscribeTestStepRunCompletedEventListener(runnerId: string, runId: string, listener: (error: ErrorResponse | null, message: TestStepRunCompletedEventArgs | null) => void, options?: SubscriptionOptions): Subscription;
36
+ /**
37
+ * Subscribe to the test plan run start events for the given Runner and Run ID.
38
+ * Wildcard can be used for the Runner or Run ID to receive all test plan run start events.
39
+ * @param {string} runnerId
40
+ * @param {string} runId
41
+ * @param {(error:ErrorResponse|null,message:TestStepRunStartEventArgs|null)=>void} listener
42
+ * @param {SubscriptionOptions} options?
43
+ */
44
+ subscribeTestPlanRunStartEventListener(runnerId: string, runId: string, listener: (error: ErrorResponse | null, message: TestPlanRunStartEventArgs | null) => void, options?: SubscriptionOptions): Subscription;
45
+ /**
46
+ * Subscribe to the test plan run completed events for the given Runner and Run ID.
47
+ * Wildcard can be used for the Runner or Run ID to receive all test plan run completed events.
48
+ * @param {string} runnerId
49
+ * @param {string} runId
50
+ * @param {(error:ErrorResponse|null,message:TestStepRunStartEventArgs|null)=>void} listener
51
+ * @param {SubscriptionOptions} options?
52
+ */
53
+ subscribeTestPlanRunCompletedEventListener(runnerId: string, runId: string, listener: (error: ErrorResponse | null, message: TestPlanRunCompletedEventArgs | null) => void, options?: SubscriptionOptions): Subscription;
18
54
  }
@@ -26,6 +26,7 @@ var __assign = (this && this.__assign) || function () {
26
26
  };
27
27
  import { BaseClient } from './BaseClient';
28
28
  import { JSONCodec } from 'nats.ws';
29
+ import { TestPlanRunCompletedEventArgs, TestPlanRunStartEventArgs, TestStepRunCompletedEventArgs, TestStepRunStartEventArgs, } from './DTOs';
29
30
  var SystemClient = /** @class */ (function (_super) {
30
31
  __extends(SystemClient, _super);
31
32
  function SystemClient(baseSubject, options) {
@@ -39,9 +40,10 @@ var SystemClient = /** @class */ (function (_super) {
39
40
  */
40
41
  SystemClient.prototype.subscribeLifetimeEventListener = function (listener, options) {
41
42
  var _this = this;
42
- return this.subscribe('*.Events.Lifetime', __assign(__assign({}, options), { callback: function (error, message) {
43
+ var subject = '*.Events.Lifetime';
44
+ return this.subscribe(subject, __assign(__assign({}, options), { callback: function (error, message) {
43
45
  if (error) {
44
- listener(_this.natsErrorHandler(error, '*.Events.Lifetime'), null);
46
+ listener(_this.natsErrorHandler(error, subject), null);
45
47
  return;
46
48
  }
47
49
  try {
@@ -50,7 +52,115 @@ var SystemClient = /** @class */ (function (_super) {
50
52
  listener(null, data);
51
53
  }
52
54
  catch (error) {
53
- listener(_this.natsErrorHandler(error, '*.Events.Lifetime'), null);
55
+ listener(_this.natsErrorHandler(error, subject), null);
56
+ }
57
+ } }));
58
+ };
59
+ /**
60
+ * Subscribe to the test step run start events for the given Runner and Run ID.
61
+ * Wildcard can be used for the Runner or Run ID to receive all test step run start events.
62
+ * @param {string} runnerId
63
+ * @param {string} runId
64
+ * @param {(error:ErrorResponse|null,message:TestStepRunStartEventArgs|null)=>void} listener
65
+ * @param {SubscriptionOptions} options?
66
+ */
67
+ SystemClient.prototype.subscribeTestStepRunStartEventListener = function (runnerId, runId, listener, options) {
68
+ var _this = this;
69
+ var subject = "".concat(runnerId, ".Runs.").concat(runId, ".Events.TestStepRunStart");
70
+ return this.subscribe(subject, __assign(__assign({}, options), { callback: function (error, message) {
71
+ if (error) {
72
+ listener(_this.natsErrorHandler(error, subject), null);
73
+ return;
74
+ }
75
+ try {
76
+ var jsonCodec = JSONCodec();
77
+ var testStepRunStartEventArgsJs = jsonCodec.decode(message === null || message === void 0 ? void 0 : message.data);
78
+ var testStepRunStartEventArgs = TestStepRunStartEventArgs.fromJS(testStepRunStartEventArgsJs);
79
+ listener(null, testStepRunStartEventArgs);
80
+ }
81
+ catch (error) {
82
+ listener(_this.natsErrorHandler(error, subject), null);
83
+ }
84
+ } }));
85
+ };
86
+ /**
87
+ * Subscribe to the test step run completed events for the given Runner and Run ID.
88
+ * Wildcard can be used for the Runner or Run ID to receive all test step run completed events.
89
+ * @param {string} runnerId
90
+ * @param {string} runId
91
+ * @param {(error:ErrorResponse|null,message:TestStepRunStartEventArgs|null)=>void} listener
92
+ * @param {SubscriptionOptions} options?
93
+ */
94
+ SystemClient.prototype.subscribeTestStepRunCompletedEventListener = function (runnerId, runId, listener, options) {
95
+ var _this = this;
96
+ var subject = "".concat(runnerId, ".Runs.").concat(runId, ".Events.TestStepRunCompleted");
97
+ return this.subscribe(subject, __assign(__assign({}, options), { callback: function (error, message) {
98
+ if (error) {
99
+ listener(_this.natsErrorHandler(error, subject), null);
100
+ return;
101
+ }
102
+ try {
103
+ var jsonCodec = JSONCodec();
104
+ var testStepRunCompletedEventArgsJs = jsonCodec.decode(message === null || message === void 0 ? void 0 : message.data);
105
+ var testStepRunCompletedEventArgs = TestStepRunCompletedEventArgs.fromJS(testStepRunCompletedEventArgsJs);
106
+ listener(null, testStepRunCompletedEventArgs);
107
+ }
108
+ catch (error) {
109
+ listener(_this.natsErrorHandler(error, subject), null);
110
+ }
111
+ } }));
112
+ };
113
+ /**
114
+ * Subscribe to the test plan run start events for the given Runner and Run ID.
115
+ * Wildcard can be used for the Runner or Run ID to receive all test plan run start events.
116
+ * @param {string} runnerId
117
+ * @param {string} runId
118
+ * @param {(error:ErrorResponse|null,message:TestStepRunStartEventArgs|null)=>void} listener
119
+ * @param {SubscriptionOptions} options?
120
+ */
121
+ SystemClient.prototype.subscribeTestPlanRunStartEventListener = function (runnerId, runId, listener, options) {
122
+ var _this = this;
123
+ var subject = "".concat(runnerId, ".Runs.").concat(runId, ".Events.TestPlanRunStart");
124
+ return this.subscribe(subject, __assign(__assign({}, options), { callback: function (error, message) {
125
+ if (error) {
126
+ listener(_this.natsErrorHandler(error, subject), null);
127
+ return;
128
+ }
129
+ try {
130
+ var jsonCodec = JSONCodec();
131
+ var testPlanRunStartEventArgsJs = jsonCodec.decode(message === null || message === void 0 ? void 0 : message.data);
132
+ var testPlanRunStartEventArgs = TestPlanRunStartEventArgs.fromJS(testPlanRunStartEventArgsJs);
133
+ listener(null, testPlanRunStartEventArgs);
134
+ }
135
+ catch (error) {
136
+ listener(_this.natsErrorHandler(error, subject), null);
137
+ }
138
+ } }));
139
+ };
140
+ /**
141
+ * Subscribe to the test plan run completed events for the given Runner and Run ID.
142
+ * Wildcard can be used for the Runner or Run ID to receive all test plan run completed events.
143
+ * @param {string} runnerId
144
+ * @param {string} runId
145
+ * @param {(error:ErrorResponse|null,message:TestStepRunStartEventArgs|null)=>void} listener
146
+ * @param {SubscriptionOptions} options?
147
+ */
148
+ SystemClient.prototype.subscribeTestPlanRunCompletedEventListener = function (runnerId, runId, listener, options) {
149
+ var _this = this;
150
+ var subject = "".concat(runnerId, ".Runs.").concat(runId, ".Events.TestPlanRunCompleted");
151
+ return this.subscribe(subject, __assign(__assign({}, options), { callback: function (error, message) {
152
+ if (error) {
153
+ listener(_this.natsErrorHandler(error, subject), null);
154
+ return;
155
+ }
156
+ try {
157
+ var jsonCodec = JSONCodec();
158
+ var testPlanRunCompletedEventArgsJs = jsonCodec.decode(message === null || message === void 0 ? void 0 : message.data);
159
+ var testPlanRunCompletedEventArgs = TestPlanRunCompletedEventArgs.fromJS(testPlanRunCompletedEventArgsJs);
160
+ listener(null, testPlanRunCompletedEventArgs);
161
+ }
162
+ catch (error) {
163
+ listener(_this.natsErrorHandler(error, subject), null);
54
164
  }
55
165
  } }));
56
166
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentap/runner-client",
3
- "version": "2.4.0",
3
+ "version": "2.5.0-alpha.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",