@opentap/runner-client 2.10.0-alpha.1.2 → 2.10.0-alpha.1.4
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.d.ts +0 -6
- package/lib/BaseClient.js +2 -12
- package/package.json +1 -1
package/lib/BaseClient.d.ts
CHANGED
|
@@ -58,12 +58,6 @@ export declare class BaseClient {
|
|
|
58
58
|
*/
|
|
59
59
|
protected subscribe(subject: string, options: SubscriptionOptions): Subscription;
|
|
60
60
|
protected encode(payload: any): Uint8Array;
|
|
61
|
-
/**
|
|
62
|
-
* Check if the the response is an error from the server.
|
|
63
|
-
* @param {any} response
|
|
64
|
-
* @returns {boolean}
|
|
65
|
-
*/
|
|
66
|
-
private isErrorResponse;
|
|
67
61
|
/**
|
|
68
62
|
* Create a connection to the nats server.
|
|
69
63
|
* @param {ConnectionOptions} options
|
package/lib/BaseClient.js
CHANGED
|
@@ -145,7 +145,7 @@ var BaseClient = /** @class */ (function () {
|
|
|
145
145
|
responsePromise = new Promise(function (resolve, reject) {
|
|
146
146
|
var messages = [];
|
|
147
147
|
subscription.callback = function (error, message) {
|
|
148
|
-
var _a, _b, _c
|
|
148
|
+
var _a, _b, _c;
|
|
149
149
|
if (error) {
|
|
150
150
|
return reject(error);
|
|
151
151
|
}
|
|
@@ -185,9 +185,7 @@ var BaseClient = /** @class */ (function () {
|
|
|
185
185
|
flattenedArray[k++] = m[i];
|
|
186
186
|
}
|
|
187
187
|
});
|
|
188
|
-
|
|
189
|
-
console.log(typeof ((_d = finalMessage.headers) === null || _d === void 0 ? void 0 : _d.get('OpenTapNatsError')));
|
|
190
|
-
return resolve({ byteArray: flattenedArray, isErrorResponse: false });
|
|
188
|
+
return resolve({ byteArray: flattenedArray, isErrorResponse: ((_c = finalMessage.headers) === null || _c === void 0 ? void 0 : _c.get('OpenTapNatsError')) === 'true' });
|
|
191
189
|
};
|
|
192
190
|
}).then(function (_a) {
|
|
193
191
|
var byteArray = _a.byteArray, isErrorResponse = _a.isErrorResponse;
|
|
@@ -279,14 +277,6 @@ var BaseClient = /** @class */ (function () {
|
|
|
279
277
|
}
|
|
280
278
|
return StringCodec().encode(JSON.stringify(payload));
|
|
281
279
|
};
|
|
282
|
-
/**
|
|
283
|
-
* Check if the the response is an error from the server.
|
|
284
|
-
* @param {any} response
|
|
285
|
-
* @returns {boolean}
|
|
286
|
-
*/
|
|
287
|
-
BaseClient.prototype.isErrorResponse = function (response) {
|
|
288
|
-
return response && typeof response === 'object' && ['Type', 'Message', 'StackTrace'].every(function (prop) { return prop in response; });
|
|
289
|
-
};
|
|
290
280
|
/**
|
|
291
281
|
* Create a connection to the nats server.
|
|
292
282
|
* @param {ConnectionOptions} options
|