slnodejs 6.1.494 → 6.1.506

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.
Files changed (52) hide show
  1. package/browser-agent/dist/browser-agent-all.js +74 -49
  2. package/browser-agent/dist/browser-agent-all.min.js +3 -3
  3. package/browser-agent/package.json +1 -1
  4. package/package.json +1 -1
  5. package/tsOutputs/api.js +3 -0
  6. package/tsOutputs/build-scanner/current-agent-instance.js +3 -3
  7. package/tsOutputs/build-scanner/current-agent-instance.js.map +1 -1
  8. package/tsOutputs/build-scanner/mappings/file-enricher.js +15 -0
  9. package/tsOutputs/build-scanner/mappings/file-enricher.js.map +1 -1
  10. package/tsOutputs/cli-parse/agent-instance-data.js +1 -1
  11. package/tsOutputs/cli-parse/agent-instance-data.js.map +1 -1
  12. package/tsOutputs/cli-parse/executors/base-executor.js +3 -0
  13. package/tsOutputs/cli-parse/executors/base-executor.js.map +1 -1
  14. package/tsOutputs/cli-parse/executors/build-executor.js +1 -1
  15. package/tsOutputs/cli-parse/executors/build-executor.js.map +1 -1
  16. package/tsOutputs/common/agent-events/agent-events-contracts.d.ts +3 -4
  17. package/tsOutputs/common/agent-events/agent-events-contracts.js +13 -14
  18. package/tsOutputs/common/agent-events/agent-events-contracts.js.map +1 -1
  19. package/tsOutputs/common/agent-events/agent-events-controller.js +4 -3
  20. package/tsOutputs/common/agent-events/agent-events-controller.js.map +1 -1
  21. package/tsOutputs/common/agent-events/dry-run-agent-events-controller.js +1 -1
  22. package/tsOutputs/common/agent-events/dry-run-agent-events-controller.js.map +1 -1
  23. package/tsOutputs/common/agent-instance-data.d.ts +5 -4
  24. package/tsOutputs/common/agent-instance-data.js +3 -2
  25. package/tsOutputs/common/agent-instance-data.js.map +1 -1
  26. package/tsOutputs/common/footprints-process/footprints-service-proxy.d.ts +2 -1
  27. package/tsOutputs/common/footprints-process/footprints-service-proxy.js +10 -3
  28. package/tsOutputs/common/footprints-process/footprints-service-proxy.js.map +1 -1
  29. package/tsOutputs/common/footprints-process/production-footprints-handler.d.ts +2 -1
  30. package/tsOutputs/common/footprints-process/production-footprints-handler.js +10 -3
  31. package/tsOutputs/common/footprints-process/production-footprints-handler.js.map +1 -1
  32. package/tsOutputs/common/footprints-process-v6/collector-footprints-buffer.js +1 -1
  33. package/tsOutputs/common/footprints-process-v6/collector-footprints-buffer.js.map +1 -1
  34. package/tsOutputs/common/footprints-process-v6/contracts.d.ts +2 -2
  35. package/tsOutputs/common/http/backend-proxy-interface.d.ts +2 -1
  36. package/tsOutputs/common/http/backend-proxy.d.ts +5 -4
  37. package/tsOutputs/common/http/backend-proxy.js +10 -1
  38. package/tsOutputs/common/http/backend-proxy.js.map +1 -1
  39. package/tsOutputs/common/http/contracts.d.ts +10 -1
  40. package/tsOutputs/common/http/contracts.js +11 -8
  41. package/tsOutputs/common/http/contracts.js.map +1 -1
  42. package/tsOutputs/common/http/dry-run-proxy.js +1 -0
  43. package/tsOutputs/common/http/dry-run-proxy.js.map +1 -1
  44. package/tsOutputs/common/http/http-client.d.ts +4 -2
  45. package/tsOutputs/common/http/http-client.js +8 -3
  46. package/tsOutputs/common/http/http-client.js.map +1 -1
  47. package/tsOutputs/common/scm/git.js +1 -1
  48. package/tsOutputs/common/scm/git.js.map +1 -1
  49. package/tsOutputs/test-listener/factory.js +5 -4
  50. package/tsOutputs/test-listener/factory.js.map +1 -1
  51. package/tsOutputs/test-listener/nyc-report-executor.js +1 -1
  52. package/tsOutputs/test-listener/nyc-report-executor.js.map +1 -1
@@ -27270,7 +27270,7 @@ arguments[4][160][0].apply(exports,arguments)
27270
27270
  if (!configurationManager.isValidConfiguration()) {
27271
27271
  return null;
27272
27272
  }
27273
- const agentInstanceData = new agent_instance_data_1.AgentInstanceData(agent_events_contracts_1.AgentType.TEST_LISTENER, agent_events_contracts_1.Technology.BROWSER);
27273
+ const agentInstanceData = new agent_instance_data_1.AgentInstanceData(agent_events_contracts_1.AgentTypes.TEST_LISTENER, agent_events_contracts_1.AgentTechnologies.BROWSER);
27274
27274
  const logger = AgentFactory.createLogger('BrowserAgent', configuration, window);
27275
27275
  const agentConfiguration = this.createAgentConfiguration(configuration);
27276
27276
  const backendProxy = this.createBackendProxy(agentConfiguration, agentInstanceData, window, featureDetection, configuration);
@@ -28045,7 +28045,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
28045
28045
  "use strict";
28046
28046
  Object.defineProperty(exports, "__esModule", { value: true });
28047
28047
  exports.SL_AGENT_TYPE = exports.SL_AGENT_VERSION = void 0;
28048
- exports.SL_AGENT_VERSION = '6.1.494';
28048
+ exports.SL_AGENT_VERSION = '6.1.506';
28049
28049
  exports.SL_AGENT_TYPE = 'browser';
28050
28050
  });
28051
28051
 
@@ -30136,6 +30136,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
30136
30136
  postMultipart(requestData, urlPath, callback) {
30137
30137
  throw new Error('\'postMultipart\' not implemented yet');
30138
30138
  }
30139
+ updateMetadata(metadata) {
30140
+ this.jsonClient.updateMetadata(metadata);
30141
+ }
30139
30142
  getBaseUrl() {
30140
30143
  if (this.collectorUrl) {
30141
30144
  return this.collectorUrl;
@@ -30153,7 +30156,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
30153
30156
  if (v !== undefined) module.exports = v;
30154
30157
  }
30155
30158
  else if (typeof define === "function" && define.amd) {
30156
- define(["require", "exports", "../http/http-request", "../../../../common/http/contracts"], factory);
30159
+ define(["require", "exports", "../http/http-request", "../../../../common/http/contracts", "../../../../common/agent-events/agent-events-contracts"], factory);
30157
30160
  }
30158
30161
  })(function (require, exports) {
30159
30162
  "use strict";
@@ -30161,13 +30164,22 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
30161
30164
  exports.JsonClient = void 0;
30162
30165
  const http_request_1 = require("../http/http-request");
30163
30166
  const contracts_1 = require("../../../../common/http/contracts");
30167
+ const agent_events_contracts_1 = require("../../../../common/agent-events/agent-events-contracts");
30164
30168
  class JsonClient {
30165
30169
  constructor(httpClient, configuration, agentInstanceData) {
30170
+ var _a;
30166
30171
  this.httpClient = httpClient;
30167
30172
  this.configuration = configuration;
30168
30173
  this.agentInstanceData = agentInstanceData;
30169
30174
  this.requestsInProgress = 0;
30175
+ this.metadata = {};
30170
30176
  this.requestsInProgress = 0;
30177
+ this.updateMetadata({
30178
+ agentId: this.agentInstanceData.agentId,
30179
+ buildSessionId: (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.buildSessionId,
30180
+ agentType: agent_events_contracts_1.AgentTypes.BROWSER_AGENT,
30181
+ agentTechnology: agent_events_contracts_1.AgentTechnologies.BROWSER,
30182
+ });
30171
30183
  }
30172
30184
  sendHttpRequest(request, onSuccess, onError, contentType) {
30173
30185
  const context = this;
@@ -30218,6 +30230,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
30218
30230
  get(url, onSuccess, onError, async = true, data) {
30219
30231
  this.send(url, data, onSuccess, onError, async, 'GET');
30220
30232
  }
30233
+ updateMetadata(metadata) {
30234
+ this.metadata = Object.assign(Object.assign({}, this.metadata), metadata);
30235
+ }
30221
30236
  send(url, data, onSuccess, onError, async = true, httpMethod, contentType) {
30222
30237
  const request = new http_request_1.HttpRequest();
30223
30238
  request.url = url;
@@ -30231,13 +30246,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
30231
30246
  }
30232
30247
  getHeaders(url, contentType) {
30233
30248
  var _a, _b;
30234
- const headers = [{ name: contracts_1.SealightsHaderNames.CONTENT_TYPE, value: (contentType || contracts_1.ContentType.JSON) }];
30235
- headers.push({ name: contracts_1.SealightsHaderNames.META_DATA, value: JSON.stringify(this.getSlMetadataHeaders()) });
30249
+ const headers = [{ name: contracts_1.SealightsHeaderNames.CONTENT_TYPE, value: (contentType || contracts_1.ContentType.JSON) }];
30250
+ headers.push({ name: contracts_1.SealightsHeaderNames.META_DATA, value: JSON.stringify(this.metadata) });
30236
30251
  if ((_a = this === null || this === void 0 ? void 0 : this.configuration) === null || _a === void 0 ? void 0 : _a.token) {
30237
- headers.push({ name: contracts_1.SealightsHaderNames.AUTHOTIZARTION, value: 'Bearer ' + ((_b = this === null || this === void 0 ? void 0 : this.configuration) === null || _b === void 0 ? void 0 : _b.token) });
30252
+ headers.push({ name: contracts_1.SealightsHeaderNames.AUTHOTIZARTION, value: 'Bearer ' + ((_b = this === null || this === void 0 ? void 0 : this.configuration) === null || _b === void 0 ? void 0 : _b.token) });
30238
30253
  }
30239
30254
  if (this.shouldAddCollectorRelatedHeaders(url)) {
30240
- headers.push({ name: contracts_1.SealightsHaderNames.MODE, value: contracts_1.SealightsHaderValues.LIGHT_AGENT_MODE });
30255
+ headers.push({ name: contracts_1.SealightsHeaderNames.MODE, value: contracts_1.SealightsHaderValues.LIGHT_AGENT_MODE });
30241
30256
  }
30242
30257
  return headers;
30243
30258
  }
@@ -30245,19 +30260,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
30245
30260
  const collectorUrl = this.configuration.collectorUrl;
30246
30261
  return collectorUrl && url.indexOf(collectorUrl) == 0;
30247
30262
  }
30248
- getSlMetadataHeaders() {
30249
- var _a;
30250
- return {
30251
- agentId: this.agentInstanceData.agentId,
30252
- buildSessionId: (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.buildSessionId,
30253
- agentType: 'browser'
30254
- };
30255
- }
30256
30263
  }
30257
30264
  exports.JsonClient = JsonClient;
30258
30265
  });
30259
30266
 
30260
- },{"../../../../common/http/contracts":310,"../http/http-request":255}],259:[function(require,module,exports){
30267
+ },{"../../../../common/agent-events/agent-events-contracts":268,"../../../../common/http/contracts":310,"../http/http-request":255}],259:[function(require,module,exports){
30261
30268
  (function (factory) {
30262
30269
  if (typeof module === "object" && typeof module.exports === "object") {
30263
30270
  var v = factory(require, exports);
@@ -30774,15 +30781,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
30774
30781
  })(function (require, exports) {
30775
30782
  "use strict";
30776
30783
  Object.defineProperty(exports, "__esModule", { value: true });
30777
- exports.Technology = exports.AgentEventCode = exports.AgentType = void 0;
30778
- var AgentType;
30779
- (function (AgentType) {
30780
- AgentType["BUILD_SCANNER"] = "BuildScanner";
30781
- AgentType["TEST_LISTENER"] = "TestListener";
30782
- AgentType["PRODUCTION_LISTENER"] = "ProductionListener";
30783
- AgentType["BROWSER_AGENT"] = "BrowserAgent";
30784
- AgentType["SLNODEJS"] = "slnodejs";
30785
- })(AgentType = exports.AgentType || (exports.AgentType = {}));
30784
+ exports.AgentTechnologies = exports.AgentEventCode = exports.AgentTypes = void 0;
30785
+ var AgentTypes;
30786
+ (function (AgentTypes) {
30787
+ AgentTypes["BUILD_SCANNER"] = "BuildScanner";
30788
+ AgentTypes["TEST_LISTENER"] = "TestListener";
30789
+ AgentTypes["BROWSER_AGENT"] = "BrowserAgent";
30790
+ AgentTypes["SLNODEJS"] = "slnodejs";
30791
+ })(AgentTypes = exports.AgentTypes || (exports.AgentTypes = {}));
30786
30792
  var AgentEventCode;
30787
30793
  (function (AgentEventCode) {
30788
30794
  AgentEventCode[AgentEventCode["GENERIC_AGENT_EVENT"] = 1000] = "GENERIC_AGENT_EVENT";
@@ -30822,11 +30828,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
30822
30828
  AgentEventCode[AgentEventCode["LEAST_VERBOSE_LOG"] = 5001] = "LEAST_VERBOSE_LOG";
30823
30829
  AgentEventCode[AgentEventCode["MOST_VERBOSE_LOG"] = 5999] = "MOST_VERBOSE_LOG";
30824
30830
  })(AgentEventCode = exports.AgentEventCode || (exports.AgentEventCode = {}));
30825
- var Technology;
30826
- (function (Technology) {
30827
- Technology["NODEJS"] = "nodejs";
30828
- Technology["BROWSER"] = "browser";
30829
- })(Technology = exports.Technology || (exports.Technology = {}));
30831
+ var AgentTechnologies;
30832
+ (function (AgentTechnologies) {
30833
+ AgentTechnologies["NODEJS"] = "nodejs";
30834
+ AgentTechnologies["BROWSER"] = "browser";
30835
+ })(AgentTechnologies = exports.AgentTechnologies || (exports.AgentTechnologies = {}));
30830
30836
  });
30831
30837
 
30832
30838
  },{}],269:[function(require,module,exports){
@@ -30927,7 +30933,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
30927
30933
  const agentInstanceInfoBuilder = new agent_instance_info_builder_1.AgentInstanceInfoBuilder(this);
30928
30934
  const machineInfoBuilder = new machine_info_builder_1.MachineInfoBuilder();
30929
30935
  const dependencies = Object.assign(Object.assign({}, packageJsonFile.dependencies), packageJsonFile.devDependencies);
30930
- const nodejsEnvInfoBuilder = this.agentInstanceData.technology === agent_events_contracts_1.Technology.BROWSER ? new browser_info_builder_1.BrowserInfoBuilder() : new nodejs_env_info_builder_1.NodejsEnvInfoBuilder(this.agentInstanceData, dependencies);
30936
+ const nodejsEnvInfoBuilder = this.agentInstanceData.technology === agent_events_contracts_1.AgentTechnologies.BROWSER ? new browser_info_builder_1.BrowserInfoBuilder() : new nodejs_env_info_builder_1.NodejsEnvInfoBuilder(this.agentInstanceData, dependencies);
30931
30937
  const ciInfoBuilder = new ci_info_builder_1.CiInfoBuilder();
30932
30938
  const agentStartInfoBuilder = new agent_start_info_builder_1.AgentStartInfoBuilder(agentInstanceInfoBuilder, machineInfoBuilder, nodejsEnvInfoBuilder, ciInfoBuilder, this._agentConfig);
30933
30939
  const agentStartInfo = agentStartInfoBuilder.build();
@@ -31029,7 +31035,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
31029
31035
  token: this._agentConfig.token.value,
31030
31036
  proxy: this._agentConfig.proxy.value,
31031
31037
  server: this._agentConfig.server.value,
31032
- compressRequests: this._agentConfig.gzip.value
31038
+ compressRequests: this._agentConfig.gzip.value,
31039
+ buildSessionId: this._agentConfig.buildSessionId.value,
31033
31040
  };
31034
31041
  return new backend_proxy_1.BackendProxy(this._agentInstanceData, httpConfig, this._logger);
31035
31042
  }
@@ -31040,7 +31047,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
31040
31047
  this._pingWatchdog.on('alarm', this.submitPingEvent.bind(this));
31041
31048
  }
31042
31049
  getTimers() {
31043
- if (this._agentInstanceData.technology === agent_events_contracts_1.Technology.BROWSER) {
31050
+ if (this._agentInstanceData.technology === agent_events_contracts_1.AgentTechnologies.BROWSER) {
31044
31051
  return { setTimeout: setTimeout.bind(window), clearTimeout: clearTimeout.bind(window) };
31045
31052
  }
31046
31053
  else {
@@ -31541,7 +31548,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
31541
31548
  const agent_instance_data_1 = require("../agent-instance-data");
31542
31549
  class DryRunAgentEventsController extends agent_events_controller_1.AgentEventsController {
31543
31550
  constructor(logger, proxy) {
31544
- super(new config_1.AgentConfig(), new agent_instance_data_1.AgentInstanceData(agent_events_contracts_1.AgentType.SLNODEJS, agent_events_contracts_1.Technology.NODEJS), logger, proxy, null);
31551
+ super(new config_1.AgentConfig(), new agent_instance_data_1.AgentInstanceData(agent_events_contracts_1.AgentTypes.SLNODEJS, agent_events_contracts_1.AgentTechnologies.NODEJS), logger, proxy, null);
31545
31552
  }
31546
31553
  submitAgentStartedEvent(packageJsonFile) {
31547
31554
  return Promise.resolve(undefined);
@@ -31780,14 +31787,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
31780
31787
  const fs_1 = require("fs");
31781
31788
  const agent_instance_info_builder_1 = require("./agent-events/agent-instance-info-builder");
31782
31789
  class AgentInstanceData {
31783
- constructor(agentType, technology) {
31790
+ constructor(agentType, technology, buildSessionId) {
31784
31791
  this.agentType = agentType;
31785
31792
  this.technology = technology;
31793
+ this.buildSessionId = buildSessionId;
31786
31794
  this.agentId = uuid();
31787
31795
  this.agentVersion = this.resolveAgentVersion();
31788
31796
  }
31789
31797
  resolveAgentVersion() {
31790
- if (this.technology === agent_events_contracts_1.Technology.BROWSER) {
31798
+ if (this.technology === agent_events_contracts_1.AgentTechnologies.BROWSER) {
31791
31799
  return this.resolveAgentVersionForBrowserAgent();
31792
31800
  }
31793
31801
  const packageJsonFilePath = files_utils_1.FilesUtils.findFileUp('package.json', __dirname);
@@ -33630,7 +33638,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
33630
33638
  buildSessionId: this.agentConfig.buildSessionId.value,
33631
33639
  labId: this.agentConfig.labId.value,
33632
33640
  agentVersion: this.agentInstanceData.agentVersion,
33633
- agentType: agent_events_contracts_1.AgentType.BROWSER_AGENT
33641
+ agentType: agent_events_contracts_1.AgentTypes.BROWSER_AGENT
33634
33642
  };
33635
33643
  }
33636
33644
  }
@@ -34614,7 +34622,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
34614
34622
  this.agentInstanceData = agentInstanceData;
34615
34623
  this.config = config;
34616
34624
  this.logger = logger;
34617
- this.client = httpClient || new http_client_1.HttpClient(this.config, this.logger);
34625
+ const metadata = {
34626
+ agentId: agentInstanceData.agentId,
34627
+ buildSessionId: config.buildSessionId,
34628
+ agentType: agentInstanceData.agentType,
34629
+ agentTechnology: agentInstanceData.technology,
34630
+ };
34631
+ this.client = httpClient || new http_client_1.HttpClient(this.config, metadata, this.logger);
34618
34632
  }
34619
34633
  getBuildSession(buildSessionId, callback) {
34620
34634
  validation_utils_1.ValidationUtils.verifyNotNullOrEmpty(buildSessionId, constants_1.Constants.BUILD_SESSION_ID);
@@ -34865,6 +34879,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
34865
34879
  return this.submitGetRequestWithRetries(url);
34866
34880
  });
34867
34881
  }
34882
+ updateMetadata(metadata) {
34883
+ this.client.updateMetadata(metadata);
34884
+ }
34868
34885
  invokeCallback(callback, err, body, map) {
34869
34886
  validation_utils_1.ValidationUtils.verifyNotNullOrEmpty(callback, constants_1.Constants.CALLBACK);
34870
34887
  if (err != null) {
@@ -34938,11 +34955,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
34938
34955
  })(function (require, exports) {
34939
34956
  "use strict";
34940
34957
  Object.defineProperty(exports, "__esModule", { value: true });
34941
- exports.SealightsHaderValues = exports.SealightsHaderNames = exports.ContentType = exports.RecommendationSetStatus = exports.RecommendedTestReason = exports.UploadReportsBody = exports.EnvironmentData = exports.AgentData = exports.UploadReportRequest = exports.EndExecutionRequest = exports.StartExecutionRequest = exports.BaseRequest = exports.SubmitLogsRequest = exports.GetRemoteConfigRequest = exports.FileData = exports.DependencyData = exports.BuildMappingRequest = exports.VersionMetaQuery = exports.VersionMeta = exports.AgentInfo = exports.GetVersionResponse = exports.GetVersionRequest = exports.CreateBuildSessionIdResponse = exports.HttpClientConfigData = void 0;
34958
+ exports.SealightsHaderValues = exports.SealightsHeaderNames = exports.ContentType = exports.RecommendationSetStatus = exports.RecommendedTestReason = exports.UploadReportsBody = exports.EnvironmentData = exports.AgentData = exports.UploadReportRequest = exports.EndExecutionRequest = exports.StartExecutionRequest = exports.BaseRequest = exports.SubmitLogsRequest = exports.GetRemoteConfigRequest = exports.FileData = exports.DependencyData = exports.BuildMappingRequest = exports.VersionMetaQuery = exports.VersionMeta = exports.AgentInfo = exports.GetVersionResponse = exports.GetVersionRequest = exports.CreateBuildSessionIdResponse = exports.SlAgentMetadata = exports.HttpClientConfigData = void 0;
34942
34959
  const system_date_1 = require("../system-date");
34943
34960
  class HttpClientConfigData {
34944
34961
  }
34945
34962
  exports.HttpClientConfigData = HttpClientConfigData;
34963
+ class SlAgentMetadata {
34964
+ }
34965
+ exports.SlAgentMetadata = SlAgentMetadata;
34946
34966
  class CreateBuildSessionIdResponse {
34947
34967
  }
34948
34968
  exports.CreateBuildSessionIdResponse = CreateBuildSessionIdResponse;
@@ -35019,13 +35039,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
35019
35039
  ContentType["OCTET_STREAM"] = "application/octet-stream";
35020
35040
  ContentType["JSON"] = "application/json";
35021
35041
  })(ContentType = exports.ContentType || (exports.ContentType = {}));
35022
- var SealightsHaderNames;
35023
- (function (SealightsHaderNames) {
35024
- SealightsHaderNames["CONTENT_TYPE"] = "Content-Type";
35025
- SealightsHaderNames["AUTHOTIZARTION"] = "Authorization";
35026
- SealightsHaderNames["MODE"] = "X-Sealights-Agent-Mode";
35027
- SealightsHaderNames["META_DATA"] = "sl-metadata";
35028
- })(SealightsHaderNames = exports.SealightsHaderNames || (exports.SealightsHaderNames = {}));
35042
+ var SealightsHeaderNames;
35043
+ (function (SealightsHeaderNames) {
35044
+ SealightsHeaderNames["CONTENT_TYPE"] = "Content-Type";
35045
+ SealightsHeaderNames["AUTHOTIZARTION"] = "Authorization";
35046
+ SealightsHeaderNames["MODE"] = "X-Sealights-Agent-Mode";
35047
+ SealightsHeaderNames["META_DATA"] = "sl-metadata";
35048
+ })(SealightsHeaderNames = exports.SealightsHeaderNames || (exports.SealightsHeaderNames = {}));
35029
35049
  var SealightsHaderValues;
35030
35050
  (function (SealightsHaderValues) {
35031
35051
  SealightsHaderValues["LIGHT_AGENT_MODE"] = "light";
@@ -35082,8 +35102,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
35082
35102
  var system_date_2 = require("../../common/system-date");
35083
35103
  Object.defineProperty(exports, "getSystemDateValueOf", { enumerable: true, get: function () { return system_date_2.getSystemDateValueOf; } });
35084
35104
  class HttpClient {
35085
- constructor(cfg, logger) {
35105
+ constructor(cfg, metadata, logger) {
35086
35106
  this.cfg = cfg;
35107
+ this.metadata = metadata;
35087
35108
  this.logger = logger;
35088
35109
  validation_utils_1.ValidationUtils.verifyNotNullOrEmpty(cfg, 'cfg');
35089
35110
  validation_utils_1.ValidationUtils.verifyNotNullOrEmpty(logger, 'logger');
@@ -35133,6 +35154,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
35133
35154
  return callback(err, null, null);
35134
35155
  }
35135
35156
  }
35157
+ updateMetadata(metadata) {
35158
+ this.metadata = Object.assign(Object.assign({}, this.metadata), metadata);
35159
+ }
35136
35160
  submitRequestWithBody(verb, requestData, urlPath, callback, async, contentType) {
35137
35161
  validation_utils_1.ValidationUtils.verifyNotNullOrEmpty(requestData, 'requestData');
35138
35162
  const bufferToSend = Buffer.from(JSON.stringify(requestData));
@@ -35251,8 +35275,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
35251
35275
  const opts = {
35252
35276
  url: this.cfg.server + urlPath,
35253
35277
  headers: {
35254
- 'Content-Type': contentType,
35255
- 'Authorization': 'Bearer ' + this.cfg.token
35278
+ [contracts_1.SealightsHeaderNames.CONTENT_TYPE]: contentType,
35279
+ [contracts_1.SealightsHeaderNames.AUTHOTIZARTION]: 'Bearer ' + this.cfg.token,
35280
+ [contracts_1.SealightsHeaderNames.META_DATA]: JSON.stringify(this.metadata)
35256
35281
  },
35257
35282
  timeout: this.defaultTimeout,
35258
35283
  compressed: true