@uipath/resourcecatalog-tool 1.199.0-preview.99 → 1.199.0

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 (3) hide show
  1. package/dist/index.js +50 -19
  2. package/dist/tool.js +50 -19
  3. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -21247,7 +21247,7 @@ var {
21247
21247
  var package_default = {
21248
21248
  name: "@uipath/resourcecatalog-tool",
21249
21249
  license: "MIT",
21250
- version: "1.199.0-preview.99",
21250
+ version: "1.199.0",
21251
21251
  description: "CLI plugin for the UiPath Resource Catalog Service.",
21252
21252
  private: false,
21253
21253
  repository: {
@@ -24562,7 +24562,7 @@ function requireOmap() {
24562
24562
  function resolveYamlOmap(data) {
24563
24563
  if (data === null)
24564
24564
  return true;
24565
- const objectKeys = [];
24565
+ const objectKeys = {};
24566
24566
  const object = data;
24567
24567
  for (let index = 0, length = object.length;index < length; index += 1) {
24568
24568
  const pair = object[index];
@@ -24580,10 +24580,9 @@ function requireOmap() {
24580
24580
  }
24581
24581
  if (!pairHasKey)
24582
24582
  return false;
24583
- if (objectKeys.indexOf(pairKey) === -1)
24584
- objectKeys.push(pairKey);
24585
- else
24583
+ if (_hasOwnProperty.call(objectKeys, pairKey))
24586
24584
  return false;
24585
+ Object.defineProperty(objectKeys, pairKey, { value: true });
24587
24586
  }
24588
24587
  return true;
24589
24588
  }
@@ -27444,8 +27443,18 @@ function getInboundTraceContext() {
27444
27443
 
27445
27444
  // ../../common/src/telemetry/session-id.ts
27446
27445
  var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
27447
- var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
27448
- var telemetrySessionIdSlot = singleton("TelemetrySessionId");
27446
+ var SESSION_ID_MAX_LENGTH = 64;
27447
+ var RANDOM_SESSION_ID_LENGTH = 32;
27448
+ var TELEMETRY_SESSION_SOURCE_PROPERTY = "session_id_source";
27449
+ var CONTROL_CHARACTERS = /\p{Cc}/gu;
27450
+ var INHERITED_SESSION_SOURCES = [
27451
+ { envVar: "CLAUDE_CODE_SESSION_ID", source: "claude-code" },
27452
+ { envVar: "CODEX_THREAD_ID", source: "codex" },
27453
+ { envVar: "ANTIGRAVITY_TRAJECTORY_ID", source: "antigravity" },
27454
+ { envVar: "TERM_SESSION_ID", source: "terminal" },
27455
+ { envVar: "WT_SESSION", source: "terminal" }
27456
+ ];
27457
+ var telemetrySessionSlot = singleton("TelemetrySession");
27449
27458
  var telemetryOperationIdSlot = singleton("TelemetryOperationId");
27450
27459
  function getProcessEnv2() {
27451
27460
  return globalThis.process?.env;
@@ -27454,14 +27463,42 @@ function normalizeSessionId(value) {
27454
27463
  if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
27455
27464
  return;
27456
27465
  }
27457
- const trimmed = String(value).trim();
27458
- return trimmed || undefined;
27466
+ const cleaned = String(value).replace(CONTROL_CHARACTERS, "").trim().slice(0, SESSION_ID_MAX_LENGTH);
27467
+ return cleaned || undefined;
27459
27468
  }
27460
27469
  function getConfiguredTelemetrySessionId() {
27461
27470
  return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
27462
27471
  }
27463
- function resolveTelemetrySessionId(existingSessionId) {
27464
- return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
27472
+ function getInheritedSession(env) {
27473
+ for (const candidate of INHERITED_SESSION_SOURCES) {
27474
+ const handle = normalizeSessionId(env[candidate.envVar]);
27475
+ if (handle) {
27476
+ return { id: handle, source: candidate.source };
27477
+ }
27478
+ }
27479
+ return;
27480
+ }
27481
+ function generateRandomSession() {
27482
+ const bytes = new Uint8Array(RANDOM_SESSION_ID_LENGTH / 2);
27483
+ crypto.getRandomValues(bytes);
27484
+ let hex = "";
27485
+ for (const byte of bytes) {
27486
+ hex += byte.toString(16).padStart(2, "0");
27487
+ }
27488
+ return { id: hex, source: "random" };
27489
+ }
27490
+ function resolveTelemetrySession() {
27491
+ const existing = telemetrySessionSlot.get();
27492
+ if (existing) {
27493
+ return existing;
27494
+ }
27495
+ const declaredHandle = getConfiguredTelemetrySessionId();
27496
+ const resolved = declaredHandle ? { id: declaredHandle, source: "declared" } : getInheritedSession(getProcessEnv2() ?? {}) ?? generateRandomSession();
27497
+ telemetrySessionSlot.set(resolved);
27498
+ return resolved;
27499
+ }
27500
+ function getTelemetrySessionSource() {
27501
+ return resolveTelemetrySession().source;
27465
27502
  }
27466
27503
  function getTelemetryOperationId() {
27467
27504
  const existing = telemetryOperationIdSlot.get();
@@ -27738,24 +27775,18 @@ class TelemetryService {
27738
27775
  }
27739
27776
  enrichPropertiesWithContext(properties, context) {
27740
27777
  const globalProperties = getGlobalTelemetryProperties();
27741
- const existingSessionId = properties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? this.defaultProperties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? globalProperties?.[TELEMETRY_SESSION_ID_PROPERTY];
27742
- const sessionId = resolveTelemetrySessionId(existingSessionId);
27743
27778
  const enriched = {
27744
27779
  ...getExecutionContextTelemetryProperties(),
27745
27780
  ...globalProperties,
27746
27781
  ...this.defaultProperties,
27747
27782
  ...redactProperties(properties ?? {}),
27783
+ [TELEMETRY_SESSION_SOURCE_PROPERTY]: getTelemetrySessionSource(),
27748
27784
  ...context ? {
27749
27785
  [TELEMETRY_OPERATION_ID_PROPERTY]: context.operationId,
27750
27786
  ...context.parentId !== undefined ? { [TELEMETRY_PARENT_ID_PROPERTY]: context.parentId } : {},
27751
27787
  [TELEMETRY_SPAN_ID_PROPERTY]: context.id
27752
27788
  } : {}
27753
27789
  };
27754
- if (sessionId === undefined) {
27755
- delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
27756
- } else {
27757
- enriched[TELEMETRY_SESSION_ID_PROPERTY] = sessionId;
27758
- }
27759
27790
  return enriched;
27760
27791
  }
27761
27792
  generateId() {
@@ -31874,4 +31905,4 @@ program2.name(metadata.commandPrefix).description(metadata.description).version(
31874
31905
  await registerCommands(program2);
31875
31906
  program2.parse(process.argv);
31876
31907
 
31877
- //# debugId=1F5909EF9C75DCEC64756E2164756E21
31908
+ //# debugId=5D9F29E1117D386D64756E2164756E21
package/dist/tool.js CHANGED
@@ -19137,7 +19137,7 @@ var init_server = __esm(() => {
19137
19137
  var package_default = {
19138
19138
  name: "@uipath/resourcecatalog-tool",
19139
19139
  license: "MIT",
19140
- version: "1.199.0-preview.99",
19140
+ version: "1.199.0",
19141
19141
  description: "CLI plugin for the UiPath Resource Catalog Service.",
19142
19142
  private: false,
19143
19143
  repository: {
@@ -22453,7 +22453,7 @@ function requireOmap() {
22453
22453
  function resolveYamlOmap(data) {
22454
22454
  if (data === null)
22455
22455
  return true;
22456
- const objectKeys = [];
22456
+ const objectKeys = {};
22457
22457
  const object = data;
22458
22458
  for (let index = 0, length = object.length;index < length; index += 1) {
22459
22459
  const pair = object[index];
@@ -22471,10 +22471,9 @@ function requireOmap() {
22471
22471
  }
22472
22472
  if (!pairHasKey)
22473
22473
  return false;
22474
- if (objectKeys.indexOf(pairKey) === -1)
22475
- objectKeys.push(pairKey);
22476
- else
22474
+ if (_hasOwnProperty.call(objectKeys, pairKey))
22477
22475
  return false;
22476
+ Object.defineProperty(objectKeys, pairKey, { value: true });
22478
22477
  }
22479
22478
  return true;
22480
22479
  }
@@ -25335,8 +25334,18 @@ function getInboundTraceContext() {
25335
25334
 
25336
25335
  // ../../common/src/telemetry/session-id.ts
25337
25336
  var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
25338
- var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
25339
- var telemetrySessionIdSlot = singleton("TelemetrySessionId");
25337
+ var SESSION_ID_MAX_LENGTH = 64;
25338
+ var RANDOM_SESSION_ID_LENGTH = 32;
25339
+ var TELEMETRY_SESSION_SOURCE_PROPERTY = "session_id_source";
25340
+ var CONTROL_CHARACTERS = /\p{Cc}/gu;
25341
+ var INHERITED_SESSION_SOURCES = [
25342
+ { envVar: "CLAUDE_CODE_SESSION_ID", source: "claude-code" },
25343
+ { envVar: "CODEX_THREAD_ID", source: "codex" },
25344
+ { envVar: "ANTIGRAVITY_TRAJECTORY_ID", source: "antigravity" },
25345
+ { envVar: "TERM_SESSION_ID", source: "terminal" },
25346
+ { envVar: "WT_SESSION", source: "terminal" }
25347
+ ];
25348
+ var telemetrySessionSlot = singleton("TelemetrySession");
25340
25349
  var telemetryOperationIdSlot = singleton("TelemetryOperationId");
25341
25350
  function getProcessEnv2() {
25342
25351
  return globalThis.process?.env;
@@ -25345,14 +25354,42 @@ function normalizeSessionId(value) {
25345
25354
  if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
25346
25355
  return;
25347
25356
  }
25348
- const trimmed = String(value).trim();
25349
- return trimmed || undefined;
25357
+ const cleaned = String(value).replace(CONTROL_CHARACTERS, "").trim().slice(0, SESSION_ID_MAX_LENGTH);
25358
+ return cleaned || undefined;
25350
25359
  }
25351
25360
  function getConfiguredTelemetrySessionId() {
25352
25361
  return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
25353
25362
  }
25354
- function resolveTelemetrySessionId(existingSessionId) {
25355
- return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
25363
+ function getInheritedSession(env) {
25364
+ for (const candidate of INHERITED_SESSION_SOURCES) {
25365
+ const handle = normalizeSessionId(env[candidate.envVar]);
25366
+ if (handle) {
25367
+ return { id: handle, source: candidate.source };
25368
+ }
25369
+ }
25370
+ return;
25371
+ }
25372
+ function generateRandomSession() {
25373
+ const bytes = new Uint8Array(RANDOM_SESSION_ID_LENGTH / 2);
25374
+ crypto.getRandomValues(bytes);
25375
+ let hex = "";
25376
+ for (const byte of bytes) {
25377
+ hex += byte.toString(16).padStart(2, "0");
25378
+ }
25379
+ return { id: hex, source: "random" };
25380
+ }
25381
+ function resolveTelemetrySession() {
25382
+ const existing = telemetrySessionSlot.get();
25383
+ if (existing) {
25384
+ return existing;
25385
+ }
25386
+ const declaredHandle = getConfiguredTelemetrySessionId();
25387
+ const resolved = declaredHandle ? { id: declaredHandle, source: "declared" } : getInheritedSession(getProcessEnv2() ?? {}) ?? generateRandomSession();
25388
+ telemetrySessionSlot.set(resolved);
25389
+ return resolved;
25390
+ }
25391
+ function getTelemetrySessionSource() {
25392
+ return resolveTelemetrySession().source;
25356
25393
  }
25357
25394
  function getTelemetryOperationId() {
25358
25395
  const existing = telemetryOperationIdSlot.get();
@@ -25629,24 +25666,18 @@ class TelemetryService {
25629
25666
  }
25630
25667
  enrichPropertiesWithContext(properties, context) {
25631
25668
  const globalProperties = getGlobalTelemetryProperties();
25632
- const existingSessionId = properties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? this.defaultProperties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? globalProperties?.[TELEMETRY_SESSION_ID_PROPERTY];
25633
- const sessionId = resolveTelemetrySessionId(existingSessionId);
25634
25669
  const enriched = {
25635
25670
  ...getExecutionContextTelemetryProperties(),
25636
25671
  ...globalProperties,
25637
25672
  ...this.defaultProperties,
25638
25673
  ...redactProperties(properties ?? {}),
25674
+ [TELEMETRY_SESSION_SOURCE_PROPERTY]: getTelemetrySessionSource(),
25639
25675
  ...context ? {
25640
25676
  [TELEMETRY_OPERATION_ID_PROPERTY]: context.operationId,
25641
25677
  ...context.parentId !== undefined ? { [TELEMETRY_PARENT_ID_PROPERTY]: context.parentId } : {},
25642
25678
  [TELEMETRY_SPAN_ID_PROPERTY]: context.id
25643
25679
  } : {}
25644
25680
  };
25645
- if (sessionId === undefined) {
25646
- delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
25647
- } else {
25648
- enriched[TELEMETRY_SESSION_ID_PROPERTY] = sessionId;
25649
- }
25650
25681
  return enriched;
25651
25682
  }
25652
25683
  generateId() {
@@ -29772,4 +29803,4 @@ export {
29772
29803
  metadata
29773
29804
  };
29774
29805
 
29775
- //# debugId=6303A2CF6B2DF43964756E2164756E21
29806
+ //# debugId=5BEEF30D69663A0664756E2164756E21
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uipath/resourcecatalog-tool",
3
3
  "license": "MIT",
4
- "version": "1.199.0-preview.99",
4
+ "version": "1.199.0",
5
5
  "description": "CLI plugin for the UiPath Resource Catalog Service.",
6
6
  "private": false,
7
7
  "repository": {
@@ -26,5 +26,5 @@
26
26
  "files": [
27
27
  "dist"
28
28
  ],
29
- "gitHead": "6ba217cddceb86e3fa39ed82e49c5062878a85c6"
29
+ "gitHead": "723e6801b77b5926ba75e75b6a756cc38b1b7adc"
30
30
  }