@opentap/runner-client 2.31.0 → 2.31.1-alpha.1.1.14244115843
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/dist/cjs/BaseClient.d.ts
CHANGED
|
@@ -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
|
|
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
|
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -136,7 +136,7 @@ var BaseClient = /** @class */ (function () {
|
|
|
136
136
|
headers.append('ChunkSize', chunkSize.toString());
|
|
137
137
|
requestId = (0, uuid_1.v4)();
|
|
138
138
|
headers.append('RequestId', requestId);
|
|
139
|
-
opts = __assign(
|
|
139
|
+
opts = __assign({ headers: headers, reply: replySubject }, options === null || options === void 0 ? void 0 : options.publishOptions);
|
|
140
140
|
fileDescriptor = new DTOs_1.FileDescriptor(data.length, chunkSize);
|
|
141
141
|
chunkNumber = 1;
|
|
142
142
|
headers.set('ChunkNumber', chunkNumber.toString());
|
|
@@ -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
|
/**
|
package/dist/cjs/SystemClient.js
CHANGED
|
@@ -201,7 +201,7 @@ var SystemClient = /** @class */ (function (_super) {
|
|
|
201
201
|
*/
|
|
202
202
|
SystemClient.prototype.subscribeAssetUpdatedEvents = function (runnerId, listener, options) {
|
|
203
203
|
var _this = this;
|
|
204
|
-
var subject = "
|
|
204
|
+
var subject = "RunnerRegistry.".concat(runnerId, ".Events.AssetsUpdated");
|
|
205
205
|
return this.subscribe(subject, __assign(__assign({}, options), { callback: function (error, message) {
|
|
206
206
|
if (error) {
|
|
207
207
|
listener(_this.natsErrorHandler(error, subject), null);
|
package/dist/mjs/BaseClient.d.ts
CHANGED
|
@@ -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
|
|
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
|
package/dist/mjs/BaseClient.js
CHANGED
|
@@ -89,7 +89,7 @@ export class BaseClient {
|
|
|
89
89
|
// Generate a unique request ID which the Session needs to associate chunks
|
|
90
90
|
const requestId = uuidv4();
|
|
91
91
|
headers.append('RequestId', requestId);
|
|
92
|
-
const opts = Object.assign(
|
|
92
|
+
const opts = Object.assign({ headers, reply: replySubject }, options === null || options === void 0 ? void 0 : options.publishOptions);
|
|
93
93
|
const fileDescriptor = new FileDescriptor(data.length, chunkSize);
|
|
94
94
|
// Put the chunk sequence number in a header so the session knows if a chunk is missing
|
|
95
95
|
let chunkNumber = 1;
|
|
@@ -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
|
/**
|
package/dist/mjs/SystemClient.js
CHANGED
|
@@ -164,7 +164,7 @@ export class SystemClient extends BaseClient {
|
|
|
164
164
|
* @param {SubscriptionOptions} options?
|
|
165
165
|
*/
|
|
166
166
|
subscribeAssetUpdatedEvents(runnerId, listener, options) {
|
|
167
|
-
const subject = `
|
|
167
|
+
const subject = `RunnerRegistry.${runnerId}.Events.AssetsUpdated`;
|
|
168
168
|
return this.subscribe(subject, Object.assign(Object.assign({}, options), { callback: (error, message) => {
|
|
169
169
|
if (error) {
|
|
170
170
|
listener(this.natsErrorHandler(error, subject), null);
|
package/package.json
CHANGED