@opentap/runner-client 2.0.0-alpha.2.11 → 2.0.0-alpha.2.13
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/BaseClient.js +18 -13
- package/package.json +1 -1
package/lib/BaseClient.js
CHANGED
|
@@ -261,21 +261,26 @@ var BaseClient = /** @class */ (function () {
|
|
|
261
261
|
opts = __assign(__assign({}, options), { timeout: this.timeout, headers: headers });
|
|
262
262
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
263
263
|
return [2 /*return*/, new Promise(function (resolve, reject) {
|
|
264
|
+
var numberOfChunks = 9999;
|
|
265
|
+
var combinedResult = new Uint8Array([]);
|
|
266
|
+
var received = 0;
|
|
264
267
|
var subscription = _this.connection.subscribe(replySubject);
|
|
268
|
+
subscription.callback = function (error, message) {
|
|
269
|
+
if (error) {
|
|
270
|
+
reject(error);
|
|
271
|
+
}
|
|
272
|
+
combinedResult = new Uint8Array(__spreadArray(__spreadArray([], Array.from(combinedResult), true), Array.from(message === null || message === void 0 ? void 0 : message.data), true));
|
|
273
|
+
received++;
|
|
274
|
+
message.respond(Empty);
|
|
275
|
+
if (received === numberOfChunks) {
|
|
276
|
+
resolve(combinedResult);
|
|
277
|
+
}
|
|
278
|
+
};
|
|
265
279
|
return _this.request(subject, replySubject, opts).then(function (fileDescriptor) {
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
reject(error);
|
|
271
|
-
}
|
|
272
|
-
combinedResult = new Uint8Array(__spreadArray(__spreadArray([], Array.from(combinedResult), true), Array.from(message === null || message === void 0 ? void 0 : message.data), true));
|
|
273
|
-
received++;
|
|
274
|
-
message.respond(Empty);
|
|
275
|
-
if (received === fileDescriptor.numberOfChunks) {
|
|
276
|
-
resolve(combinedResult);
|
|
277
|
-
}
|
|
278
|
-
};
|
|
280
|
+
numberOfChunks = fileDescriptor.numberOfChunks;
|
|
281
|
+
if (received === numberOfChunks) {
|
|
282
|
+
resolve(combinedResult);
|
|
283
|
+
}
|
|
279
284
|
});
|
|
280
285
|
}).then(function (byteArray) {
|
|
281
286
|
var jsonCodec = JSONCodec();
|