@opentap/runner-client 2.11.0-alpha.1.2 → 2.11.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,5 @@
1
1
  import { ConnectionOptions, Subscription, SubscriptionOptions } from 'nats.ws';
2
- import { ErrorResponse, RunnerDeletedEvent, RunnerRegisteredEvent, RunnerUpdatedEvent, TestPlanRunCompletedEventArgs, TestPlanRunStartEventArgs, TestStepRunCompletedEventArgs, TestStepRunStartEventArgs } from './DTOs';
2
+ import { ErrorResponse, RunnerEvent, TestPlanRunCompletedEventArgs, TestPlanRunStartEventArgs, TestStepRunCompletedEventArgs, TestStepRunStartEventArgs } from './DTOs';
3
3
  import { BaseClient } from './BaseClient';
4
4
  export interface RunnerLifetimeEvent {
5
5
  RunnerId: string;
@@ -15,30 +15,14 @@ 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 runner registered events for the given Runner ID.
20
- * Wildcard can be used to receive all runner registered events.
21
- * @param {string} runnerId
22
- * @param {(error:ErrorResponse|null,message:RunnerRegisteredEvent|null)=>void} listener
23
- * @param {SubscriptionOptions} options?
24
- */
25
- subscribeRunnerRegisteredEvents(runnerId: string, listener: (error: ErrorResponse | null, message: RunnerRegisteredEvent | null) => void, options?: SubscriptionOptions): Subscription;
26
18
  /**
27
19
  * Subscribe to the runner updated events for the given Runner ID.
28
20
  * Wildcard can be used to receive all runner updated events.
29
21
  * @param {string} runnerId
30
- * @param {(error:ErrorResponse|null,message:RunnerUpdatedEvent|null)=>void} listener
31
- * @param {SubscriptionOptions} options?
32
- */
33
- subscribeRunnerUpdatedEvents(runnerId: string, listener: (error: ErrorResponse | null, message: RunnerUpdatedEvent | null) => void, options?: SubscriptionOptions): Subscription;
34
- /**
35
- * Subscribe to the runner deleted events for the given Runner ID.
36
- * Wildcard can be used to receive all runner deleted events.
37
- * @param {string} runnerId
38
- * @param {(error:ErrorResponse|null,message:RunnerDeletedEvent|null)=>void} listener
22
+ * @param {(error:ErrorResponse|null,message:RunnerEvent|null)=>void} listener
39
23
  * @param {SubscriptionOptions} options?
40
24
  */
41
- subscribeRunnerDeletedEvents(runnerId: string, listener: (error: ErrorResponse | null, message: RunnerDeletedEvent | null) => void, options?: SubscriptionOptions): Subscription;
25
+ subscribeRunnerUpdatedEvents(runnerId: string, listener: (error: ErrorResponse | null, message: RunnerEvent | null) => void, options?: SubscriptionOptions): Subscription;
42
26
  /**
43
27
  * Subscribe to the test step run start events for the given Runner and Run ID.
44
28
  * Wildcard can be used for the Runner or Run ID to receive all test step run start events.
@@ -25,7 +25,7 @@ var __assign = (this && this.__assign) || function () {
25
25
  return __assign.apply(this, arguments);
26
26
  };
27
27
  import { JSONCodec } from 'nats.ws';
28
- import { TestPlanRunCompletedEventArgs, TestPlanRunStartEventArgs, TestStepRunCompletedEventArgs, TestStepRunStartEventArgs, } from './DTOs';
28
+ import { RunnerEvent, TestPlanRunCompletedEventArgs, TestPlanRunStartEventArgs, TestStepRunCompletedEventArgs, TestStepRunStartEventArgs, } from './DTOs';
29
29
  import { BaseClient } from './BaseClient';
30
30
  var SystemClient = /** @class */ (function (_super) {
31
31
  __extends(SystemClient, _super);
@@ -56,36 +56,11 @@ var SystemClient = /** @class */ (function (_super) {
56
56
  }
57
57
  } }));
58
58
  };
59
- /**
60
- * Subscribe to the runner registered events for the given Runner ID.
61
- * Wildcard can be used to receive all runner registered events.
62
- * @param {string} runnerId
63
- * @param {(error:ErrorResponse|null,message:RunnerRegisteredEvent|null)=>void} listener
64
- * @param {SubscriptionOptions} options?
65
- */
66
- SystemClient.prototype.subscribeRunnerRegisteredEvents = function (runnerId, listener, options) {
67
- var _this = this;
68
- var subject = "RunnerRegistry.".concat(runnerId, ".Events.Registered");
69
- return this.subscribe(subject, __assign(__assign({}, options), { callback: function (error, message) {
70
- if (error) {
71
- listener(_this.natsErrorHandler(error, subject), null);
72
- return;
73
- }
74
- try {
75
- var jsonCodec = JSONCodec();
76
- var data = jsonCodec.decode(message === null || message === void 0 ? void 0 : message.data);
77
- listener(null, data);
78
- }
79
- catch (error) {
80
- listener(_this.natsErrorHandler(error, subject), null);
81
- }
82
- } }));
83
- };
84
59
  /**
85
60
  * Subscribe to the runner updated events for the given Runner ID.
86
61
  * Wildcard can be used to receive all runner updated events.
87
62
  * @param {string} runnerId
88
- * @param {(error:ErrorResponse|null,message:RunnerUpdatedEvent|null)=>void} listener
63
+ * @param {(error:ErrorResponse|null,message:RunnerEvent|null)=>void} listener
89
64
  * @param {SubscriptionOptions} options?
90
65
  */
91
66
  SystemClient.prototype.subscribeRunnerUpdatedEvents = function (runnerId, listener, options) {
@@ -98,32 +73,7 @@ var SystemClient = /** @class */ (function (_super) {
98
73
  }
99
74
  try {
100
75
  var jsonCodec = JSONCodec();
101
- var data = jsonCodec.decode(message === null || message === void 0 ? void 0 : message.data);
102
- listener(null, data);
103
- }
104
- catch (error) {
105
- listener(_this.natsErrorHandler(error, subject), null);
106
- }
107
- } }));
108
- };
109
- /**
110
- * Subscribe to the runner deleted events for the given Runner ID.
111
- * Wildcard can be used to receive all runner deleted events.
112
- * @param {string} runnerId
113
- * @param {(error:ErrorResponse|null,message:RunnerDeletedEvent|null)=>void} listener
114
- * @param {SubscriptionOptions} options?
115
- */
116
- SystemClient.prototype.subscribeRunnerDeletedEvents = function (runnerId, listener, options) {
117
- var _this = this;
118
- var subject = "RunnerRegistry.".concat(runnerId, ".Events.Deleted");
119
- return this.subscribe(subject, __assign(__assign({}, options), { callback: function (error, message) {
120
- if (error) {
121
- listener(_this.natsErrorHandler(error, subject), null);
122
- return;
123
- }
124
- try {
125
- var jsonCodec = JSONCodec();
126
- var data = jsonCodec.decode(message === null || message === void 0 ? void 0 : message.data);
76
+ var data = RunnerEvent.fromJS(jsonCodec.decode(message === null || message === void 0 ? void 0 : message.data));
127
77
  listener(null, data);
128
78
  }
129
79
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentap/runner-client",
3
- "version": "2.11.0-alpha.1.2",
3
+ "version": "2.11.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",