@uipath/test-manager-tool 1.199.0-preview.107 → 1.199.0-preview.110

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 (2) hide show
  1. package/dist/tool.js +50 -19
  2. package/package.json +2 -2
package/dist/tool.js CHANGED
@@ -30309,7 +30309,7 @@ var require_lib3 = __commonJS((exports, module) => {
30309
30309
  var package_default = {
30310
30310
  name: "@uipath/test-manager-tool",
30311
30311
  license: "MIT",
30312
- version: "1.199.0-preview.107",
30312
+ version: "1.199.0-preview.110",
30313
30313
  description: "Manage test cases, test sets, executions, and results.",
30314
30314
  private: false,
30315
30315
  repository: {
@@ -33644,7 +33644,7 @@ function requireOmap() {
33644
33644
  function resolveYamlOmap(data) {
33645
33645
  if (data === null)
33646
33646
  return true;
33647
- const objectKeys = [];
33647
+ const objectKeys = {};
33648
33648
  const object = data;
33649
33649
  for (let index = 0, length = object.length;index < length; index += 1) {
33650
33650
  const pair = object[index];
@@ -33662,10 +33662,9 @@ function requireOmap() {
33662
33662
  }
33663
33663
  if (!pairHasKey)
33664
33664
  return false;
33665
- if (objectKeys.indexOf(pairKey) === -1)
33666
- objectKeys.push(pairKey);
33667
- else
33665
+ if (_hasOwnProperty.call(objectKeys, pairKey))
33668
33666
  return false;
33667
+ Object.defineProperty(objectKeys, pairKey, { value: true });
33669
33668
  }
33670
33669
  return true;
33671
33670
  }
@@ -36547,8 +36546,18 @@ function getInboundTraceContext() {
36547
36546
 
36548
36547
  // ../common/src/telemetry/session-id.ts
36549
36548
  var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
36550
- var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
36551
- var telemetrySessionIdSlot = singleton("TelemetrySessionId");
36549
+ var SESSION_ID_MAX_LENGTH = 64;
36550
+ var RANDOM_SESSION_ID_LENGTH = 32;
36551
+ var TELEMETRY_SESSION_SOURCE_PROPERTY = "session_id_source";
36552
+ var CONTROL_CHARACTERS = /\p{Cc}/gu;
36553
+ var INHERITED_SESSION_SOURCES = [
36554
+ { envVar: "CLAUDE_CODE_SESSION_ID", source: "claude-code" },
36555
+ { envVar: "CODEX_THREAD_ID", source: "codex" },
36556
+ { envVar: "ANTIGRAVITY_TRAJECTORY_ID", source: "antigravity" },
36557
+ { envVar: "TERM_SESSION_ID", source: "terminal" },
36558
+ { envVar: "WT_SESSION", source: "terminal" }
36559
+ ];
36560
+ var telemetrySessionSlot = singleton("TelemetrySession");
36552
36561
  var telemetryOperationIdSlot = singleton("TelemetryOperationId");
36553
36562
  function getProcessEnv2() {
36554
36563
  return globalThis.process?.env;
@@ -36557,14 +36566,42 @@ function normalizeSessionId(value) {
36557
36566
  if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
36558
36567
  return;
36559
36568
  }
36560
- const trimmed = String(value).trim();
36561
- return trimmed || undefined;
36569
+ const cleaned = String(value).replace(CONTROL_CHARACTERS, "").trim().slice(0, SESSION_ID_MAX_LENGTH);
36570
+ return cleaned || undefined;
36562
36571
  }
36563
36572
  function getConfiguredTelemetrySessionId() {
36564
36573
  return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
36565
36574
  }
36566
- function resolveTelemetrySessionId(existingSessionId) {
36567
- return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
36575
+ function getInheritedSession(env) {
36576
+ for (const candidate of INHERITED_SESSION_SOURCES) {
36577
+ const handle = normalizeSessionId(env[candidate.envVar]);
36578
+ if (handle) {
36579
+ return { id: handle, source: candidate.source };
36580
+ }
36581
+ }
36582
+ return;
36583
+ }
36584
+ function generateRandomSession() {
36585
+ const bytes = new Uint8Array(RANDOM_SESSION_ID_LENGTH / 2);
36586
+ crypto.getRandomValues(bytes);
36587
+ let hex = "";
36588
+ for (const byte of bytes) {
36589
+ hex += byte.toString(16).padStart(2, "0");
36590
+ }
36591
+ return { id: hex, source: "random" };
36592
+ }
36593
+ function resolveTelemetrySession() {
36594
+ const existing = telemetrySessionSlot.get();
36595
+ if (existing) {
36596
+ return existing;
36597
+ }
36598
+ const declaredHandle = getConfiguredTelemetrySessionId();
36599
+ const resolved = declaredHandle ? { id: declaredHandle, source: "declared" } : getInheritedSession(getProcessEnv2() ?? {}) ?? generateRandomSession();
36600
+ telemetrySessionSlot.set(resolved);
36601
+ return resolved;
36602
+ }
36603
+ function getTelemetrySessionSource() {
36604
+ return resolveTelemetrySession().source;
36568
36605
  }
36569
36606
  function getTelemetryOperationId() {
36570
36607
  const existing = telemetryOperationIdSlot.get();
@@ -36841,24 +36878,18 @@ class TelemetryService {
36841
36878
  }
36842
36879
  enrichPropertiesWithContext(properties, context) {
36843
36880
  const globalProperties = getGlobalTelemetryProperties();
36844
- const existingSessionId = properties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? this.defaultProperties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? globalProperties?.[TELEMETRY_SESSION_ID_PROPERTY];
36845
- const sessionId = resolveTelemetrySessionId(existingSessionId);
36846
36881
  const enriched = {
36847
36882
  ...getExecutionContextTelemetryProperties(),
36848
36883
  ...globalProperties,
36849
36884
  ...this.defaultProperties,
36850
36885
  ...redactProperties(properties ?? {}),
36886
+ [TELEMETRY_SESSION_SOURCE_PROPERTY]: getTelemetrySessionSource(),
36851
36887
  ...context ? {
36852
36888
  [TELEMETRY_OPERATION_ID_PROPERTY]: context.operationId,
36853
36889
  ...context.parentId !== undefined ? { [TELEMETRY_PARENT_ID_PROPERTY]: context.parentId } : {},
36854
36890
  [TELEMETRY_SPAN_ID_PROPERTY]: context.id
36855
36891
  } : {}
36856
36892
  };
36857
- if (sessionId === undefined) {
36858
- delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
36859
- } else {
36860
- enriched[TELEMETRY_SESSION_ID_PROPERTY] = sessionId;
36861
- }
36862
36893
  return enriched;
36863
36894
  }
36864
36895
  generateId() {
@@ -58542,4 +58573,4 @@ export {
58542
58573
  metadata
58543
58574
  };
58544
58575
 
58545
- //# debugId=0670727A9A7ECC6164756E2164756E21
58576
+ //# debugId=752436EF7E385BE464756E2164756E21
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uipath/test-manager-tool",
3
3
  "license": "MIT",
4
- "version": "1.199.0-preview.107",
4
+ "version": "1.199.0-preview.110",
5
5
  "description": "Manage test cases, test sets, executions, and results.",
6
6
  "private": false,
7
7
  "repository": {
@@ -26,5 +26,5 @@
26
26
  "files": [
27
27
  "dist"
28
28
  ],
29
- "gitHead": "bbfbe57757e61c3b0c6ef05fb0ad5c1d0f1f7680"
29
+ "gitHead": "a714aed479181e56e2a867470c3050b7230ec41f"
30
30
  }