@uipath/platform-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.
- package/dist/tool.js +50 -19
- package/package.json +2 -2
package/dist/tool.js
CHANGED
|
@@ -46306,7 +46306,7 @@ var require_dist3 = __commonJS((exports) => {
|
|
|
46306
46306
|
var package_default = {
|
|
46307
46307
|
name: "@uipath/platform-tool",
|
|
46308
46308
|
license: "MIT",
|
|
46309
|
-
version: "1.199.0
|
|
46309
|
+
version: "1.199.0",
|
|
46310
46310
|
description: "Manage UiPath platform-level resources such as tenant licensing.",
|
|
46311
46311
|
type: "module",
|
|
46312
46312
|
main: "./dist/tool.js",
|
|
@@ -50869,7 +50869,7 @@ function requireOmap() {
|
|
|
50869
50869
|
function resolveYamlOmap(data) {
|
|
50870
50870
|
if (data === null)
|
|
50871
50871
|
return true;
|
|
50872
|
-
const objectKeys =
|
|
50872
|
+
const objectKeys = {};
|
|
50873
50873
|
const object = data;
|
|
50874
50874
|
for (let index = 0, length = object.length;index < length; index += 1) {
|
|
50875
50875
|
const pair = object[index];
|
|
@@ -50887,10 +50887,9 @@ function requireOmap() {
|
|
|
50887
50887
|
}
|
|
50888
50888
|
if (!pairHasKey)
|
|
50889
50889
|
return false;
|
|
50890
|
-
if (
|
|
50891
|
-
objectKeys.push(pairKey);
|
|
50892
|
-
else
|
|
50890
|
+
if (_hasOwnProperty.call(objectKeys, pairKey))
|
|
50893
50891
|
return false;
|
|
50892
|
+
Object.defineProperty(objectKeys, pairKey, { value: true });
|
|
50894
50893
|
}
|
|
50895
50894
|
return true;
|
|
50896
50895
|
}
|
|
@@ -53751,8 +53750,18 @@ function getInboundTraceContext() {
|
|
|
53751
53750
|
|
|
53752
53751
|
// ../common/src/telemetry/session-id.ts
|
|
53753
53752
|
var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
|
|
53754
|
-
var
|
|
53755
|
-
var
|
|
53753
|
+
var SESSION_ID_MAX_LENGTH = 64;
|
|
53754
|
+
var RANDOM_SESSION_ID_LENGTH = 32;
|
|
53755
|
+
var TELEMETRY_SESSION_SOURCE_PROPERTY = "session_id_source";
|
|
53756
|
+
var CONTROL_CHARACTERS = /\p{Cc}/gu;
|
|
53757
|
+
var INHERITED_SESSION_SOURCES = [
|
|
53758
|
+
{ envVar: "CLAUDE_CODE_SESSION_ID", source: "claude-code" },
|
|
53759
|
+
{ envVar: "CODEX_THREAD_ID", source: "codex" },
|
|
53760
|
+
{ envVar: "ANTIGRAVITY_TRAJECTORY_ID", source: "antigravity" },
|
|
53761
|
+
{ envVar: "TERM_SESSION_ID", source: "terminal" },
|
|
53762
|
+
{ envVar: "WT_SESSION", source: "terminal" }
|
|
53763
|
+
];
|
|
53764
|
+
var telemetrySessionSlot = singleton("TelemetrySession");
|
|
53756
53765
|
var telemetryOperationIdSlot = singleton("TelemetryOperationId");
|
|
53757
53766
|
function getProcessEnv2() {
|
|
53758
53767
|
return globalThis.process?.env;
|
|
@@ -53761,14 +53770,42 @@ function normalizeSessionId(value) {
|
|
|
53761
53770
|
if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
|
|
53762
53771
|
return;
|
|
53763
53772
|
}
|
|
53764
|
-
const
|
|
53765
|
-
return
|
|
53773
|
+
const cleaned = String(value).replace(CONTROL_CHARACTERS, "").trim().slice(0, SESSION_ID_MAX_LENGTH);
|
|
53774
|
+
return cleaned || undefined;
|
|
53766
53775
|
}
|
|
53767
53776
|
function getConfiguredTelemetrySessionId() {
|
|
53768
53777
|
return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
|
|
53769
53778
|
}
|
|
53770
|
-
function
|
|
53771
|
-
|
|
53779
|
+
function getInheritedSession(env) {
|
|
53780
|
+
for (const candidate of INHERITED_SESSION_SOURCES) {
|
|
53781
|
+
const handle = normalizeSessionId(env[candidate.envVar]);
|
|
53782
|
+
if (handle) {
|
|
53783
|
+
return { id: handle, source: candidate.source };
|
|
53784
|
+
}
|
|
53785
|
+
}
|
|
53786
|
+
return;
|
|
53787
|
+
}
|
|
53788
|
+
function generateRandomSession() {
|
|
53789
|
+
const bytes = new Uint8Array(RANDOM_SESSION_ID_LENGTH / 2);
|
|
53790
|
+
crypto.getRandomValues(bytes);
|
|
53791
|
+
let hex = "";
|
|
53792
|
+
for (const byte of bytes) {
|
|
53793
|
+
hex += byte.toString(16).padStart(2, "0");
|
|
53794
|
+
}
|
|
53795
|
+
return { id: hex, source: "random" };
|
|
53796
|
+
}
|
|
53797
|
+
function resolveTelemetrySession() {
|
|
53798
|
+
const existing = telemetrySessionSlot.get();
|
|
53799
|
+
if (existing) {
|
|
53800
|
+
return existing;
|
|
53801
|
+
}
|
|
53802
|
+
const declaredHandle = getConfiguredTelemetrySessionId();
|
|
53803
|
+
const resolved = declaredHandle ? { id: declaredHandle, source: "declared" } : getInheritedSession(getProcessEnv2() ?? {}) ?? generateRandomSession();
|
|
53804
|
+
telemetrySessionSlot.set(resolved);
|
|
53805
|
+
return resolved;
|
|
53806
|
+
}
|
|
53807
|
+
function getTelemetrySessionSource() {
|
|
53808
|
+
return resolveTelemetrySession().source;
|
|
53772
53809
|
}
|
|
53773
53810
|
function getTelemetryOperationId() {
|
|
53774
53811
|
const existing = telemetryOperationIdSlot.get();
|
|
@@ -54045,24 +54082,18 @@ class TelemetryService {
|
|
|
54045
54082
|
}
|
|
54046
54083
|
enrichPropertiesWithContext(properties, context) {
|
|
54047
54084
|
const globalProperties = getGlobalTelemetryProperties();
|
|
54048
|
-
const existingSessionId = properties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? this.defaultProperties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? globalProperties?.[TELEMETRY_SESSION_ID_PROPERTY];
|
|
54049
|
-
const sessionId = resolveTelemetrySessionId(existingSessionId);
|
|
54050
54085
|
const enriched = {
|
|
54051
54086
|
...getExecutionContextTelemetryProperties(),
|
|
54052
54087
|
...globalProperties,
|
|
54053
54088
|
...this.defaultProperties,
|
|
54054
54089
|
...redactProperties(properties ?? {}),
|
|
54090
|
+
[TELEMETRY_SESSION_SOURCE_PROPERTY]: getTelemetrySessionSource(),
|
|
54055
54091
|
...context ? {
|
|
54056
54092
|
[TELEMETRY_OPERATION_ID_PROPERTY]: context.operationId,
|
|
54057
54093
|
...context.parentId !== undefined ? { [TELEMETRY_PARENT_ID_PROPERTY]: context.parentId } : {},
|
|
54058
54094
|
[TELEMETRY_SPAN_ID_PROPERTY]: context.id
|
|
54059
54095
|
} : {}
|
|
54060
54096
|
};
|
|
54061
|
-
if (sessionId === undefined) {
|
|
54062
|
-
delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
|
|
54063
|
-
} else {
|
|
54064
|
-
enriched[TELEMETRY_SESSION_ID_PROPERTY] = sessionId;
|
|
54065
|
-
}
|
|
54066
54097
|
return enriched;
|
|
54067
54098
|
}
|
|
54068
54099
|
generateId() {
|
|
@@ -58033,4 +58064,4 @@ export {
|
|
|
58033
58064
|
metadata
|
|
58034
58065
|
};
|
|
58035
58066
|
|
|
58036
|
-
//# debugId=
|
|
58067
|
+
//# debugId=C8E2DA0FDAE5658E64756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/platform-tool",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "1.199.0
|
|
4
|
+
"version": "1.199.0",
|
|
5
5
|
"description": "Manage UiPath platform-level resources such as tenant licensing.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/tool.js",
|
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
"publishConfig": {
|
|
21
21
|
"registry": "https://registry.npmjs.org/"
|
|
22
22
|
},
|
|
23
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "723e6801b77b5926ba75e75b6a756cc38b1b7adc"
|
|
24
24
|
}
|