slnodejs 6.1.147 → 6.1.149

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.
@@ -42829,7 +42829,7 @@ function extend() {
42829
42829
  };
42830
42830
  AgentFactory.createJsonClient = function (window, featureDetection, configuration, agentInstanceData) {
42831
42831
  var httpClient = AgentFactory.createHttpClient(window, featureDetection, configuration);
42832
- return configuration.blockBrowserHttpTraffic ? new noop_json_client_1.NoopJsonClient(httpClient, configuration.token, agentInstanceData) : new json_client_1.JsonClient(httpClient, configuration.token, agentInstanceData);
42832
+ return configuration.blockBrowserHttpTraffic ? new noop_json_client_1.NoopJsonClient(httpClient, configuration, agentInstanceData) : new json_client_1.JsonClient(httpClient, configuration, agentInstanceData);
42833
42833
  };
42834
42834
  AgentFactory.createHttpClient = function (window, featureDetection, configuration) {
42835
42835
  var logger = AgentFactory.createLogger('HttpClient', configuration, window);
@@ -45468,9 +45468,9 @@ var __extends = (this && this.__extends) || (function () {
45468
45468
  var http_request_1 = require("../http/http-request");
45469
45469
  var contracts_1 = require("../../../../common/http/contracts");
45470
45470
  var JsonClient = (function () {
45471
- function JsonClient(httpClient, token, agentInstanceData) {
45471
+ function JsonClient(httpClient, configuration, agentInstanceData) {
45472
45472
  this.httpClient = httpClient;
45473
- this.token = token;
45473
+ this.configuration = configuration;
45474
45474
  this.agentInstanceData = agentInstanceData;
45475
45475
  this.requestsInProgress = 0;
45476
45476
  this.requestsInProgress = 0;
@@ -45539,13 +45539,22 @@ var __extends = (this && this.__extends) || (function () {
45539
45539
  return this.requestsInProgress > 0;
45540
45540
  };
45541
45541
  JsonClient.prototype.getHeaders = function (contentType) {
45542
+ var _a, _b;
45542
45543
  var headers = [{ name: 'Content-Type', value: (contentType || contracts_1.ContentType.JSON) }];
45543
- headers.push({ name: 'sl-agentId', value: this.agentInstanceData.agentId });
45544
- if (this.token) {
45545
- headers.push({ name: 'Authorization', value: 'Bearer ' + this.token });
45544
+ headers.push({ name: 'sl-metadata', value: JSON.stringify(this.getSlMetadataHeaders()) });
45545
+ if ((_a = this === null || this === void 0 ? void 0 : this.configuration) === null || _a === void 0 ? void 0 : _a.token) {
45546
+ headers.push({ name: 'Authorization', value: 'Bearer ' + ((_b = this === null || this === void 0 ? void 0 : this.configuration) === null || _b === void 0 ? void 0 : _b.token) });
45546
45547
  }
45547
45548
  return headers;
45548
45549
  };
45550
+ JsonClient.prototype.getSlMetadataHeaders = function () {
45551
+ var _a;
45552
+ return {
45553
+ agentId: this.agentInstanceData.agentId,
45554
+ buildSessionId: (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.buildSessionId,
45555
+ agentType: 'browser'
45556
+ };
45557
+ };
45549
45558
  return JsonClient;
45550
45559
  }());
45551
45560
  exports.JsonClient = JsonClient;