@opentap/runner-client 2.31.0 → 2.31.1-alpha.1.2.14054681442

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.
@@ -60,7 +60,9 @@ export declare class BaseClient {
60
60
  * @param options Subscription options
61
61
  * @returns Subscription object
62
62
  */
63
- protected subscribe(subject: string, options: SubscriptionOptions): Subscription;
63
+ protected subscribe(subject: string, options?: SubscriptionOptions & {
64
+ fullSubject?: boolean;
65
+ }): Subscription;
64
66
  /**
65
67
  * Subscribes to given subject.
66
68
  * @param subject The subject to subscribe
@@ -266,13 +266,14 @@ var BaseClient = /** @class */ (function () {
266
266
  * @returns Subscription object
267
267
  */
268
268
  BaseClient.prototype.subscribe = function (subject, options) {
269
+ if (options === void 0) { options = {}; }
269
270
  if (!subject)
270
271
  throw Error('Subject is not defined!');
271
272
  if (!this.connection)
272
273
  throw Error('Connection is not up yet! Please try again later!');
273
274
  if (this.connection.isClosed())
274
275
  throw Error('Connection has been closed! Please reconnect!');
275
- var natsSubject = "".concat(this.baseSubject, ".").concat(subject);
276
+ var natsSubject = options.fullSubject ? subject : "".concat(this.baseSubject, ".").concat(subject);
276
277
  return this.connection.subscribe(natsSubject, options);
277
278
  };
278
279
  /**
@@ -62,6 +62,7 @@ export declare class SystemClient extends BaseClient {
62
62
  /**
63
63
  * Subscribe to the asset update events for the given Runner ID.
64
64
  * Wildcard can be used to receive all asset update events.
65
+ * @param {string} realm
65
66
  * @param {string} runnerId
66
67
  * @param {(error:ErrorResponse|null,message:AssetUpdatedEvent|null)=>void} listener
67
68
  * @param {SubscriptionOptions} options?
@@ -195,13 +195,14 @@ var SystemClient = /** @class */ (function (_super) {
195
195
  /**
196
196
  * Subscribe to the asset update events for the given Runner ID.
197
197
  * Wildcard can be used to receive all asset update events.
198
+ * @param {string} realm
198
199
  * @param {string} runnerId
199
200
  * @param {(error:ErrorResponse|null,message:AssetUpdatedEvent|null)=>void} listener
200
201
  * @param {SubscriptionOptions} options?
201
202
  */
202
203
  SystemClient.prototype.subscribeAssetUpdatedEvents = function (runnerId, listener, options) {
203
204
  var _this = this;
204
- var subject = "OpenTap.RunnerRegistry.".concat(runnerId, ".Events.AssetsUpdated");
205
+ var subject = "RunnerRegistry.".concat(runnerId, ".Events.AssetsUpdated");
205
206
  return this.subscribe(subject, __assign(__assign({}, options), { callback: function (error, message) {
206
207
  if (error) {
207
208
  listener(_this.natsErrorHandler(error, subject), null);
@@ -60,7 +60,9 @@ export declare class BaseClient {
60
60
  * @param options Subscription options
61
61
  * @returns Subscription object
62
62
  */
63
- protected subscribe(subject: string, options: SubscriptionOptions): Subscription;
63
+ protected subscribe(subject: string, options?: SubscriptionOptions & {
64
+ fullSubject?: boolean;
65
+ }): Subscription;
64
66
  /**
65
67
  * Subscribes to given subject.
66
68
  * @param subject The subject to subscribe
@@ -219,14 +219,14 @@ export class BaseClient {
219
219
  * @param options Subscription options
220
220
  * @returns Subscription object
221
221
  */
222
- subscribe(subject, options) {
222
+ subscribe(subject, options = {}) {
223
223
  if (!subject)
224
224
  throw Error('Subject is not defined!');
225
225
  if (!this.connection)
226
226
  throw Error('Connection is not up yet! Please try again later!');
227
227
  if (this.connection.isClosed())
228
228
  throw Error('Connection has been closed! Please reconnect!');
229
- const natsSubject = `${this.baseSubject}.${subject}`;
229
+ const natsSubject = options.fullSubject ? subject : `${this.baseSubject}.${subject}`;
230
230
  return this.connection.subscribe(natsSubject, options);
231
231
  }
232
232
  /**
@@ -62,6 +62,7 @@ export declare class SystemClient extends BaseClient {
62
62
  /**
63
63
  * Subscribe to the asset update events for the given Runner ID.
64
64
  * Wildcard can be used to receive all asset update events.
65
+ * @param {string} realm
65
66
  * @param {string} runnerId
66
67
  * @param {(error:ErrorResponse|null,message:AssetUpdatedEvent|null)=>void} listener
67
68
  * @param {SubscriptionOptions} options?
@@ -159,12 +159,13 @@ export class SystemClient extends BaseClient {
159
159
  /**
160
160
  * Subscribe to the asset update events for the given Runner ID.
161
161
  * Wildcard can be used to receive all asset update events.
162
+ * @param {string} realm
162
163
  * @param {string} runnerId
163
164
  * @param {(error:ErrorResponse|null,message:AssetUpdatedEvent|null)=>void} listener
164
165
  * @param {SubscriptionOptions} options?
165
166
  */
166
167
  subscribeAssetUpdatedEvents(runnerId, listener, options) {
167
- const subject = `OpenTap.RunnerRegistry.${runnerId}.Events.AssetsUpdated`;
168
+ const subject = `RunnerRegistry.${runnerId}.Events.AssetsUpdated`;
168
169
  return this.subscribe(subject, Object.assign(Object.assign({}, options), { callback: (error, message) => {
169
170
  if (error) {
170
171
  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.31.0",
3
+ "version": "2.31.1-alpha.1.2.14054681442",
4
4
  "description": "This is the web client for the OpenTAP Runner.",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/mjs/index.js",