@opentap/runner-client 2.20.0-alpha.1.1 → 2.20.0-alpha.1.2
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 +6 -2
- package/lib/BaseClient.js +6 -3
- package/package.json +1 -1
package/lib/BaseClient.d.ts
CHANGED
|
@@ -21,9 +21,13 @@ export declare class BaseClient {
|
|
|
21
21
|
/** Set request access token */
|
|
22
22
|
set accessToken(value: string);
|
|
23
23
|
/** Get request headers */
|
|
24
|
-
get headers():
|
|
24
|
+
get headers(): {
|
|
25
|
+
[key: string]: string;
|
|
26
|
+
};
|
|
25
27
|
/** Set request headers */
|
|
26
|
-
set headers(value:
|
|
28
|
+
set headers(value: {
|
|
29
|
+
[key: string]: string;
|
|
30
|
+
});
|
|
27
31
|
/** Get timeout */
|
|
28
32
|
get timeout(): number;
|
|
29
33
|
/** Set timeout in milliseconds. Default is 40000 milliseconds */
|
package/lib/BaseClient.js
CHANGED
|
@@ -60,7 +60,7 @@ var Events;
|
|
|
60
60
|
var BaseClient = /** @class */ (function () {
|
|
61
61
|
function BaseClient(baseSubject, options) {
|
|
62
62
|
this.domainAccess = new Map();
|
|
63
|
-
this._headers =
|
|
63
|
+
this._headers = {};
|
|
64
64
|
this.baseSubject = baseSubject;
|
|
65
65
|
this.connectionOptions = __assign({}, options) || {};
|
|
66
66
|
this.connectionOptions.timeout = (options === null || options === void 0 ? void 0 : options.timeout) || DEFAULT_TIMEOUT;
|
|
@@ -249,11 +249,14 @@ var BaseClient = /** @class */ (function () {
|
|
|
249
249
|
* @returns {MsgHdrs} Header object
|
|
250
250
|
*/
|
|
251
251
|
BaseClient.prototype.buildHeaders = function () {
|
|
252
|
-
var _a
|
|
252
|
+
var _a;
|
|
253
253
|
var _headers = (0, nats_ws_1.headers)();
|
|
254
254
|
this._accessToken && _headers.set('Authorization', this._accessToken);
|
|
255
255
|
(_a = this.domainAccess) === null || _a === void 0 ? void 0 : _a.forEach(function (value, key) { return _headers.append('DomainAuthorization', "".concat(key, "|").concat(value)); });
|
|
256
|
-
(
|
|
256
|
+
Object.entries(this._headers).forEach(function (_a) {
|
|
257
|
+
var key = _a[0], value = _a[1];
|
|
258
|
+
return _headers.append(key, value);
|
|
259
|
+
});
|
|
257
260
|
return _headers;
|
|
258
261
|
};
|
|
259
262
|
/**
|