@opentap/runner-client 2.0.0-alpha.2.15 → 2.0.0-alpha.2.16

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.
@@ -28,7 +28,7 @@ export declare class BaseClient {
28
28
  * @param options (optional)
29
29
  * @returns Promise of an object
30
30
  */
31
- protected request<T>(subject: string, payload?: any, options?: RequestOptions): Promise<T>;
31
+ protected request<T>(subject: string, payload?: any, options?: RequestOptions, isFullSubject?: boolean): Promise<T>;
32
32
  /**
33
33
  * Handle the error
34
34
  * @param error
@@ -63,7 +63,7 @@ export declare class BaseClient {
63
63
  * @param options (optional)
64
64
  * @returns Promise of an object
65
65
  */
66
- protected requestChunked<T>(subject: string, options?: RequestOptions): Promise<T>;
66
+ protected requestChunked<T>(subject: string, options?: RequestOptions, isFullSubject?: boolean): Promise<T>;
67
67
  /**
68
68
  * Check if the the response is an error from the server.
69
69
  * @param {any} response
package/lib/BaseClient.js CHANGED
@@ -109,14 +109,14 @@ var BaseClient = /** @class */ (function () {
109
109
  * @param options (optional)
110
110
  * @returns Promise of an object
111
111
  */
112
- BaseClient.prototype.request = function (subject, payload, options) {
112
+ BaseClient.prototype.request = function (subject, payload, options, isFullSubject) {
113
113
  return __awaiter(this, void 0, void 0, function () {
114
114
  var stringCodec, data, headers, opts;
115
115
  var _this = this;
116
116
  return __generator(this, function (_a) {
117
117
  switch (_a.label) {
118
118
  case 0:
119
- subject = "".concat(this.baseSubject, ".Request.").concat(subject);
119
+ subject = isFullSubject ? subject : "".concat(this.baseSubject, ".Request.").concat(subject);
120
120
  if (!this.connection)
121
121
  return [2 /*return*/, Promise.reject("".concat(subject, ": Connection is down! Please try again!"))];
122
122
  if (this.connection.isClosed())
@@ -248,7 +248,7 @@ var BaseClient = /** @class */ (function () {
248
248
  * @param options (optional)
249
249
  * @returns Promise of an object
250
250
  */
251
- BaseClient.prototype.requestChunked = function (subject, options) {
251
+ BaseClient.prototype.requestChunked = function (subject, options, isFullSubject) {
252
252
  return __awaiter(this, void 0, void 0, function () {
253
253
  var replySubject, requestSubject, headers, opts;
254
254
  var _this = this;
@@ -263,9 +263,9 @@ var BaseClient = /** @class */ (function () {
263
263
  opts = __assign(__assign({}, options), { timeout: this.timeout, headers: headers });
264
264
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
265
265
  return [2 /*return*/, new Promise(function (resolve, reject) {
266
- var numberOfChunks = 9999;
267
- var combinedResult = new Uint8Array([]);
266
+ var numberOfChunks = -1;
268
267
  var received = 0;
268
+ var combinedResult = new Uint8Array([]);
269
269
  var resolveIfComplete = function () {
270
270
  if (received === numberOfChunks) {
271
271
  resolve(combinedResult);
@@ -281,7 +281,7 @@ var BaseClient = /** @class */ (function () {
281
281
  message.respond(Empty);
282
282
  resolveIfComplete();
283
283
  };
284
- return _this.request(subject, replySubject, opts)
284
+ return _this.request(subject, replySubject, opts, isFullSubject)
285
285
  .then(function (fileDescriptor) { return FileDescriptor.fromJS(fileDescriptor); })
286
286
  .then(function (fileDescriptor) {
287
287
  numberOfChunks = fileDescriptor.numberOfChunks;
@@ -217,7 +217,7 @@ var SessionClient = /** @class */ (function (_super) {
217
217
  return Promise.reject('The source of the provided resource is not a nats subject.');
218
218
  }
219
219
  var subject = resource.source.replace(runnerResourcePrefix, '');
220
- return this.requestChunked(subject).then(this.success()).catch(this.error());
220
+ return this.requestChunked(subject, undefined, true).then(this.success()).catch(this.error());
221
221
  };
222
222
  /**
223
223
  * Load test plan using a test plan TapPackage from a repository
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentap/runner-client",
3
- "version": "2.0.0-alpha.2.15",
3
+ "version": "2.0.0-alpha.2.16",
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",