@uipath/project-packager 1.198.0-preview.95 → 1.198.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/browser.js +231 -8
- package/dist/index.js +232 -9
- package/dist/node.js +252 -148
- package/package.json +2 -2
package/dist/browser.js
CHANGED
|
@@ -22715,10 +22715,33 @@ class ConsoleTelemetryProvider {
|
|
|
22715
22715
|
console.debug(`[Telemetry] Dependency: ${name} [${type}] (${duration}ms, ${success ? "ok" : "fail"})`);
|
|
22716
22716
|
}
|
|
22717
22717
|
}
|
|
22718
|
+
var TELEMETRY_TRACEPARENT_ENV = "TRACEPARENT";
|
|
22719
|
+
var TRACEPARENT_PATTERN = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/;
|
|
22720
|
+
function getProcessEnv() {
|
|
22721
|
+
return globalThis.process?.env;
|
|
22722
|
+
}
|
|
22723
|
+
function parseInboundTraceparent(value) {
|
|
22724
|
+
if (!value) {
|
|
22725
|
+
return;
|
|
22726
|
+
}
|
|
22727
|
+
const match = TRACEPARENT_PATTERN.exec(value.trim().toLowerCase());
|
|
22728
|
+
if (!match) {
|
|
22729
|
+
return;
|
|
22730
|
+
}
|
|
22731
|
+
const [, traceId, parentSpanId] = match;
|
|
22732
|
+
if (/^0+$/.test(traceId) || /^0+$/.test(parentSpanId)) {
|
|
22733
|
+
return;
|
|
22734
|
+
}
|
|
22735
|
+
return { traceId, parentSpanId };
|
|
22736
|
+
}
|
|
22737
|
+
function getInboundTraceContext() {
|
|
22738
|
+
return parseInboundTraceparent(getProcessEnv()?.[TELEMETRY_TRACEPARENT_ENV]);
|
|
22739
|
+
}
|
|
22718
22740
|
var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
|
|
22719
22741
|
var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
|
|
22720
22742
|
var telemetrySessionIdSlot = singleton("TelemetrySessionId");
|
|
22721
|
-
|
|
22743
|
+
var telemetryOperationIdSlot = singleton("TelemetryOperationId");
|
|
22744
|
+
function getProcessEnv2() {
|
|
22722
22745
|
return globalThis.process?.env;
|
|
22723
22746
|
}
|
|
22724
22747
|
function normalizeSessionId(value) {
|
|
@@ -22729,11 +22752,21 @@ function normalizeSessionId(value) {
|
|
|
22729
22752
|
return trimmed || undefined;
|
|
22730
22753
|
}
|
|
22731
22754
|
function getConfiguredTelemetrySessionId() {
|
|
22732
|
-
return normalizeSessionId(
|
|
22755
|
+
return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
|
|
22733
22756
|
}
|
|
22734
22757
|
function resolveTelemetrySessionId(existingSessionId) {
|
|
22735
22758
|
return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
|
|
22736
22759
|
}
|
|
22760
|
+
function getTelemetryOperationId() {
|
|
22761
|
+
const existing = telemetryOperationIdSlot.get();
|
|
22762
|
+
if (existing) {
|
|
22763
|
+
return existing;
|
|
22764
|
+
}
|
|
22765
|
+
const inboundTraceId = getInboundTraceContext()?.traceId;
|
|
22766
|
+
const generated = inboundTraceId ?? crypto.randomUUID().replaceAll("-", "");
|
|
22767
|
+
telemetryOperationIdSlot.set(generated);
|
|
22768
|
+
return generated;
|
|
22769
|
+
}
|
|
22737
22770
|
var KNOWN_AGENTS = [
|
|
22738
22771
|
{ envVar: "CLAUDECODE", value: "1", id: "claude-code" },
|
|
22739
22772
|
{ envVar: "CURSOR_AGENT", value: "1", id: "cursor" },
|
|
@@ -22860,6 +22893,140 @@ function getExecutionContextTelemetryProperties() {
|
|
|
22860
22893
|
...detected.ciProvider ? { ci_provider: detected.ciProvider } : {}
|
|
22861
22894
|
};
|
|
22862
22895
|
}
|
|
22896
|
+
var REDACTED = "[REDACTED]";
|
|
22897
|
+
var MAX_VALUE_LENGTH = 200;
|
|
22898
|
+
var SENSITIVE_NAME_TOKENS = new Set([
|
|
22899
|
+
"token",
|
|
22900
|
+
"tokens",
|
|
22901
|
+
"secret",
|
|
22902
|
+
"secrets",
|
|
22903
|
+
"password",
|
|
22904
|
+
"passwords",
|
|
22905
|
+
"pwd",
|
|
22906
|
+
"credential",
|
|
22907
|
+
"credentials",
|
|
22908
|
+
"auth",
|
|
22909
|
+
"authentication",
|
|
22910
|
+
"authorization",
|
|
22911
|
+
"authority",
|
|
22912
|
+
"cert",
|
|
22913
|
+
"certificate",
|
|
22914
|
+
"certificates"
|
|
22915
|
+
]);
|
|
22916
|
+
var SENSITIVE_KEY_PREFIXES = new Set([
|
|
22917
|
+
"api",
|
|
22918
|
+
"access",
|
|
22919
|
+
"client",
|
|
22920
|
+
"private",
|
|
22921
|
+
"public",
|
|
22922
|
+
"signing",
|
|
22923
|
+
"encryption",
|
|
22924
|
+
"session",
|
|
22925
|
+
"master",
|
|
22926
|
+
"shared",
|
|
22927
|
+
"root",
|
|
22928
|
+
"ssh",
|
|
22929
|
+
"rsa",
|
|
22930
|
+
"aes",
|
|
22931
|
+
"hmac",
|
|
22932
|
+
"oauth"
|
|
22933
|
+
]);
|
|
22934
|
+
var UUID_PATTERN = /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi;
|
|
22935
|
+
var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
22936
|
+
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
22937
|
+
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
22938
|
+
var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
22939
|
+
var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
22940
|
+
var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
|
|
22941
|
+
function shortHash(input) {
|
|
22942
|
+
let hash = 2166136261;
|
|
22943
|
+
for (let i2 = 0;i2 < input.length; i2++) {
|
|
22944
|
+
hash ^= input.charCodeAt(i2);
|
|
22945
|
+
hash = Math.imul(hash, 16777619);
|
|
22946
|
+
}
|
|
22947
|
+
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
22948
|
+
}
|
|
22949
|
+
function redactUrl(raw) {
|
|
22950
|
+
try {
|
|
22951
|
+
const url = new URL(raw);
|
|
22952
|
+
return `${url.protocol}//${url.host}`;
|
|
22953
|
+
} catch {
|
|
22954
|
+
return `url#${shortHash(raw)}`;
|
|
22955
|
+
}
|
|
22956
|
+
}
|
|
22957
|
+
function redactValueDetectors(value) {
|
|
22958
|
+
let out = value;
|
|
22959
|
+
out = out.replace(JWT_PATTERN, () => REDACTED);
|
|
22960
|
+
out = out.replace(URL_PATTERN, (match) => {
|
|
22961
|
+
const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
|
|
22962
|
+
const core = trailing ? match.slice(0, -trailing.length) : match;
|
|
22963
|
+
return `${redactUrl(core)}${trailing}`;
|
|
22964
|
+
});
|
|
22965
|
+
out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
22966
|
+
out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
|
|
22967
|
+
out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
|
|
22968
|
+
out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
|
|
22969
|
+
if (out.length > MAX_VALUE_LENGTH) {
|
|
22970
|
+
out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
|
|
22971
|
+
}
|
|
22972
|
+
return out;
|
|
22973
|
+
}
|
|
22974
|
+
function redactValue(value) {
|
|
22975
|
+
return redactValueDetectors(value);
|
|
22976
|
+
}
|
|
22977
|
+
function redactError(error) {
|
|
22978
|
+
const safe = new Error(redactValueDetectors(error.message ?? ""));
|
|
22979
|
+
safe.name = error.name;
|
|
22980
|
+
safe.stack = typeof error.stack === "string" ? redactValueDetectors(error.stack) : undefined;
|
|
22981
|
+
return safe;
|
|
22982
|
+
}
|
|
22983
|
+
function nameTokens(name) {
|
|
22984
|
+
return name.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").split(/[\s._-]+/).map((t) => t.toLowerCase()).filter(Boolean);
|
|
22985
|
+
}
|
|
22986
|
+
function isSensitiveName(name) {
|
|
22987
|
+
const tokens = nameTokens(name);
|
|
22988
|
+
for (let i2 = 0;i2 < tokens.length; i2++) {
|
|
22989
|
+
const token = tokens[i2];
|
|
22990
|
+
if (SENSITIVE_NAME_TOKENS.has(token)) {
|
|
22991
|
+
return true;
|
|
22992
|
+
}
|
|
22993
|
+
if (token === "key" || token === "keys") {
|
|
22994
|
+
const prev = tokens[i2 - 1];
|
|
22995
|
+
if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
|
|
22996
|
+
return true;
|
|
22997
|
+
}
|
|
22998
|
+
}
|
|
22999
|
+
}
|
|
23000
|
+
return false;
|
|
23001
|
+
}
|
|
23002
|
+
function redactProperty(name, value) {
|
|
23003
|
+
if (value === undefined || value === null) {
|
|
23004
|
+
return;
|
|
23005
|
+
}
|
|
23006
|
+
if (isSensitiveName(name)) {
|
|
23007
|
+
return REDACTED;
|
|
23008
|
+
}
|
|
23009
|
+
if (typeof value === "boolean" || typeof value === "number") {
|
|
23010
|
+
return value;
|
|
23011
|
+
}
|
|
23012
|
+
if (typeof value !== "string") {
|
|
23013
|
+
return "[OBJECT]";
|
|
23014
|
+
}
|
|
23015
|
+
return redactValueDetectors(value);
|
|
23016
|
+
}
|
|
23017
|
+
function redactProperties(properties) {
|
|
23018
|
+
const out = {};
|
|
23019
|
+
for (const [name, value] of Object.entries(properties)) {
|
|
23020
|
+
const redacted = redactProperty(name, value);
|
|
23021
|
+
if (redacted !== undefined) {
|
|
23022
|
+
out[name] = redacted;
|
|
23023
|
+
}
|
|
23024
|
+
}
|
|
23025
|
+
return out;
|
|
23026
|
+
}
|
|
23027
|
+
var TELEMETRY_OPERATION_ID_PROPERTY = "uip.trace.operation_id";
|
|
23028
|
+
var TELEMETRY_PARENT_ID_PROPERTY = "uip.trace.parent_id";
|
|
23029
|
+
var TELEMETRY_SPAN_ID_PROPERTY = "uip.trace.span_id";
|
|
22863
23030
|
|
|
22864
23031
|
class TelemetryService {
|
|
22865
23032
|
telemetryProvider;
|
|
@@ -22887,11 +23054,15 @@ class TelemetryService {
|
|
|
22887
23054
|
trackException(error, properties) {
|
|
22888
23055
|
const context = this.getCurrentContext();
|
|
22889
23056
|
const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
|
|
22890
|
-
this.telemetryProvider.trackException(error, enrichedProperties);
|
|
23057
|
+
this.telemetryProvider.trackException(redactError(error), enrichedProperties);
|
|
22891
23058
|
}
|
|
22892
23059
|
async trackRequest(name, fn, properties) {
|
|
23060
|
+
const parentContext = this.getCurrentContext();
|
|
23061
|
+
const operationId = parentContext?.operationId ?? this.operationId ?? getTelemetryOperationId();
|
|
23062
|
+
const parentId = parentContext ? parentContext.id : this.inboundParentIdFor(operationId);
|
|
22893
23063
|
const context = {
|
|
22894
|
-
operationId
|
|
23064
|
+
operationId,
|
|
23065
|
+
...parentId !== undefined ? { parentId } : {},
|
|
22895
23066
|
id: this.generateId()
|
|
22896
23067
|
};
|
|
22897
23068
|
const startTime = performance.now();
|
|
@@ -22909,6 +23080,45 @@ class TelemetryService {
|
|
|
22909
23080
|
throw error;
|
|
22910
23081
|
}
|
|
22911
23082
|
}
|
|
23083
|
+
trackRequestResult(name, durationMs, success, properties, context) {
|
|
23084
|
+
const requestContext = context ?? {
|
|
23085
|
+
operationId: this.operationId ?? getTelemetryOperationId(),
|
|
23086
|
+
id: this.generateId()
|
|
23087
|
+
};
|
|
23088
|
+
const enrichedProperties = this.enrichPropertiesWithContext(properties, requestContext);
|
|
23089
|
+
this.telemetryProvider.trackRequest(name, durationMs, success, enrichedProperties);
|
|
23090
|
+
}
|
|
23091
|
+
createRequestContext() {
|
|
23092
|
+
const operationId = this.operationId ?? getTelemetryOperationId();
|
|
23093
|
+
const parentId = this.inboundParentIdFor(operationId);
|
|
23094
|
+
return {
|
|
23095
|
+
operationId,
|
|
23096
|
+
...parentId !== undefined ? { parentId } : {},
|
|
23097
|
+
id: this.generateId()
|
|
23098
|
+
};
|
|
23099
|
+
}
|
|
23100
|
+
inboundParentIdFor(operationId) {
|
|
23101
|
+
const inbound = getInboundTraceContext();
|
|
23102
|
+
return inbound && inbound.traceId === operationId ? inbound.parentSpanId : undefined;
|
|
23103
|
+
}
|
|
23104
|
+
runWithContext(context, fn) {
|
|
23105
|
+
return this.contextStorage.run(context, fn);
|
|
23106
|
+
}
|
|
23107
|
+
createDependencyContext() {
|
|
23108
|
+
const parentContext = this.getCurrentContext();
|
|
23109
|
+
if (!parentContext) {
|
|
23110
|
+
return;
|
|
23111
|
+
}
|
|
23112
|
+
return {
|
|
23113
|
+
operationId: parentContext.operationId,
|
|
23114
|
+
parentId: parentContext.id,
|
|
23115
|
+
id: this.generateId()
|
|
23116
|
+
};
|
|
23117
|
+
}
|
|
23118
|
+
trackDependencyResult(name, type, durationMs, success, properties, context, resultCode) {
|
|
23119
|
+
const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
|
|
23120
|
+
this.telemetryProvider.trackDependency(redactValue(name), type, durationMs, success, enrichedProperties, resultCode);
|
|
23121
|
+
}
|
|
22912
23122
|
async trackDependencyOperation(name, type, fn, properties) {
|
|
22913
23123
|
const parentContext = this.getCurrentContext();
|
|
22914
23124
|
if (!parentContext) {
|
|
@@ -22945,8 +23155,12 @@ class TelemetryService {
|
|
|
22945
23155
|
...getExecutionContextTelemetryProperties(),
|
|
22946
23156
|
...globalProperties,
|
|
22947
23157
|
...this.defaultProperties,
|
|
22948
|
-
...properties,
|
|
22949
|
-
...context
|
|
23158
|
+
...redactProperties(properties ?? {}),
|
|
23159
|
+
...context ? {
|
|
23160
|
+
[TELEMETRY_OPERATION_ID_PROPERTY]: context.operationId,
|
|
23161
|
+
...context.parentId !== undefined ? { [TELEMETRY_PARENT_ID_PROPERTY]: context.parentId } : {},
|
|
23162
|
+
[TELEMETRY_SPAN_ID_PROPERTY]: context.id
|
|
23163
|
+
} : {}
|
|
22950
23164
|
};
|
|
22951
23165
|
if (sessionId === undefined) {
|
|
22952
23166
|
delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
|
|
@@ -22956,7 +23170,16 @@ class TelemetryService {
|
|
|
22956
23170
|
return enriched;
|
|
22957
23171
|
}
|
|
22958
23172
|
generateId() {
|
|
22959
|
-
|
|
23173
|
+
const bytes = new Uint8Array(8);
|
|
23174
|
+
let hex = "";
|
|
23175
|
+
do {
|
|
23176
|
+
crypto.getRandomValues(bytes);
|
|
23177
|
+
hex = "";
|
|
23178
|
+
for (const byte of bytes) {
|
|
23179
|
+
hex += byte.toString(16).padStart(2, "0");
|
|
23180
|
+
}
|
|
23181
|
+
} while (/^0+$/.test(hex));
|
|
23182
|
+
return hex;
|
|
22960
23183
|
}
|
|
22961
23184
|
}
|
|
22962
23185
|
var factorySlot = singleton("PackagerFactoryProvider");
|
|
@@ -23930,4 +24153,4 @@ export {
|
|
|
23930
24153
|
BaseBrowserPackagerFactory
|
|
23931
24154
|
};
|
|
23932
24155
|
|
|
23933
|
-
//# debugId=
|
|
24156
|
+
//# debugId=C079BA4B4614343D64756E2164756E21
|
package/dist/index.js
CHANGED
|
@@ -22715,10 +22715,33 @@ class ConsoleTelemetryProvider {
|
|
|
22715
22715
|
console.debug(`[Telemetry] Dependency: ${name} [${type}] (${duration}ms, ${success ? "ok" : "fail"})`);
|
|
22716
22716
|
}
|
|
22717
22717
|
}
|
|
22718
|
+
var TELEMETRY_TRACEPARENT_ENV = "TRACEPARENT";
|
|
22719
|
+
var TRACEPARENT_PATTERN = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/;
|
|
22720
|
+
function getProcessEnv() {
|
|
22721
|
+
return globalThis.process?.env;
|
|
22722
|
+
}
|
|
22723
|
+
function parseInboundTraceparent(value) {
|
|
22724
|
+
if (!value) {
|
|
22725
|
+
return;
|
|
22726
|
+
}
|
|
22727
|
+
const match = TRACEPARENT_PATTERN.exec(value.trim().toLowerCase());
|
|
22728
|
+
if (!match) {
|
|
22729
|
+
return;
|
|
22730
|
+
}
|
|
22731
|
+
const [, traceId, parentSpanId] = match;
|
|
22732
|
+
if (/^0+$/.test(traceId) || /^0+$/.test(parentSpanId)) {
|
|
22733
|
+
return;
|
|
22734
|
+
}
|
|
22735
|
+
return { traceId, parentSpanId };
|
|
22736
|
+
}
|
|
22737
|
+
function getInboundTraceContext() {
|
|
22738
|
+
return parseInboundTraceparent(getProcessEnv()?.[TELEMETRY_TRACEPARENT_ENV]);
|
|
22739
|
+
}
|
|
22718
22740
|
var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
|
|
22719
22741
|
var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
|
|
22720
22742
|
var telemetrySessionIdSlot = singleton("TelemetrySessionId");
|
|
22721
|
-
|
|
22743
|
+
var telemetryOperationIdSlot = singleton("TelemetryOperationId");
|
|
22744
|
+
function getProcessEnv2() {
|
|
22722
22745
|
return globalThis.process?.env;
|
|
22723
22746
|
}
|
|
22724
22747
|
function normalizeSessionId(value) {
|
|
@@ -22729,11 +22752,21 @@ function normalizeSessionId(value) {
|
|
|
22729
22752
|
return trimmed || undefined;
|
|
22730
22753
|
}
|
|
22731
22754
|
function getConfiguredTelemetrySessionId() {
|
|
22732
|
-
return normalizeSessionId(
|
|
22755
|
+
return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
|
|
22733
22756
|
}
|
|
22734
22757
|
function resolveTelemetrySessionId(existingSessionId) {
|
|
22735
22758
|
return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
|
|
22736
22759
|
}
|
|
22760
|
+
function getTelemetryOperationId() {
|
|
22761
|
+
const existing = telemetryOperationIdSlot.get();
|
|
22762
|
+
if (existing) {
|
|
22763
|
+
return existing;
|
|
22764
|
+
}
|
|
22765
|
+
const inboundTraceId = getInboundTraceContext()?.traceId;
|
|
22766
|
+
const generated = inboundTraceId ?? crypto.randomUUID().replaceAll("-", "");
|
|
22767
|
+
telemetryOperationIdSlot.set(generated);
|
|
22768
|
+
return generated;
|
|
22769
|
+
}
|
|
22737
22770
|
var KNOWN_AGENTS = [
|
|
22738
22771
|
{ envVar: "CLAUDECODE", value: "1", id: "claude-code" },
|
|
22739
22772
|
{ envVar: "CURSOR_AGENT", value: "1", id: "cursor" },
|
|
@@ -22860,6 +22893,140 @@ function getExecutionContextTelemetryProperties() {
|
|
|
22860
22893
|
...detected.ciProvider ? { ci_provider: detected.ciProvider } : {}
|
|
22861
22894
|
};
|
|
22862
22895
|
}
|
|
22896
|
+
var REDACTED = "[REDACTED]";
|
|
22897
|
+
var MAX_VALUE_LENGTH = 200;
|
|
22898
|
+
var SENSITIVE_NAME_TOKENS = new Set([
|
|
22899
|
+
"token",
|
|
22900
|
+
"tokens",
|
|
22901
|
+
"secret",
|
|
22902
|
+
"secrets",
|
|
22903
|
+
"password",
|
|
22904
|
+
"passwords",
|
|
22905
|
+
"pwd",
|
|
22906
|
+
"credential",
|
|
22907
|
+
"credentials",
|
|
22908
|
+
"auth",
|
|
22909
|
+
"authentication",
|
|
22910
|
+
"authorization",
|
|
22911
|
+
"authority",
|
|
22912
|
+
"cert",
|
|
22913
|
+
"certificate",
|
|
22914
|
+
"certificates"
|
|
22915
|
+
]);
|
|
22916
|
+
var SENSITIVE_KEY_PREFIXES = new Set([
|
|
22917
|
+
"api",
|
|
22918
|
+
"access",
|
|
22919
|
+
"client",
|
|
22920
|
+
"private",
|
|
22921
|
+
"public",
|
|
22922
|
+
"signing",
|
|
22923
|
+
"encryption",
|
|
22924
|
+
"session",
|
|
22925
|
+
"master",
|
|
22926
|
+
"shared",
|
|
22927
|
+
"root",
|
|
22928
|
+
"ssh",
|
|
22929
|
+
"rsa",
|
|
22930
|
+
"aes",
|
|
22931
|
+
"hmac",
|
|
22932
|
+
"oauth"
|
|
22933
|
+
]);
|
|
22934
|
+
var UUID_PATTERN = /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi;
|
|
22935
|
+
var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
22936
|
+
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
22937
|
+
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
22938
|
+
var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
22939
|
+
var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
22940
|
+
var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
|
|
22941
|
+
function shortHash(input) {
|
|
22942
|
+
let hash = 2166136261;
|
|
22943
|
+
for (let i2 = 0;i2 < input.length; i2++) {
|
|
22944
|
+
hash ^= input.charCodeAt(i2);
|
|
22945
|
+
hash = Math.imul(hash, 16777619);
|
|
22946
|
+
}
|
|
22947
|
+
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
22948
|
+
}
|
|
22949
|
+
function redactUrl(raw) {
|
|
22950
|
+
try {
|
|
22951
|
+
const url = new URL(raw);
|
|
22952
|
+
return `${url.protocol}//${url.host}`;
|
|
22953
|
+
} catch {
|
|
22954
|
+
return `url#${shortHash(raw)}`;
|
|
22955
|
+
}
|
|
22956
|
+
}
|
|
22957
|
+
function redactValueDetectors(value) {
|
|
22958
|
+
let out = value;
|
|
22959
|
+
out = out.replace(JWT_PATTERN, () => REDACTED);
|
|
22960
|
+
out = out.replace(URL_PATTERN, (match) => {
|
|
22961
|
+
const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
|
|
22962
|
+
const core = trailing ? match.slice(0, -trailing.length) : match;
|
|
22963
|
+
return `${redactUrl(core)}${trailing}`;
|
|
22964
|
+
});
|
|
22965
|
+
out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
22966
|
+
out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
|
|
22967
|
+
out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
|
|
22968
|
+
out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
|
|
22969
|
+
if (out.length > MAX_VALUE_LENGTH) {
|
|
22970
|
+
out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
|
|
22971
|
+
}
|
|
22972
|
+
return out;
|
|
22973
|
+
}
|
|
22974
|
+
function redactValue(value) {
|
|
22975
|
+
return redactValueDetectors(value);
|
|
22976
|
+
}
|
|
22977
|
+
function redactError(error) {
|
|
22978
|
+
const safe = new Error(redactValueDetectors(error.message ?? ""));
|
|
22979
|
+
safe.name = error.name;
|
|
22980
|
+
safe.stack = typeof error.stack === "string" ? redactValueDetectors(error.stack) : undefined;
|
|
22981
|
+
return safe;
|
|
22982
|
+
}
|
|
22983
|
+
function nameTokens(name) {
|
|
22984
|
+
return name.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").split(/[\s._-]+/).map((t) => t.toLowerCase()).filter(Boolean);
|
|
22985
|
+
}
|
|
22986
|
+
function isSensitiveName(name) {
|
|
22987
|
+
const tokens = nameTokens(name);
|
|
22988
|
+
for (let i2 = 0;i2 < tokens.length; i2++) {
|
|
22989
|
+
const token = tokens[i2];
|
|
22990
|
+
if (SENSITIVE_NAME_TOKENS.has(token)) {
|
|
22991
|
+
return true;
|
|
22992
|
+
}
|
|
22993
|
+
if (token === "key" || token === "keys") {
|
|
22994
|
+
const prev = tokens[i2 - 1];
|
|
22995
|
+
if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
|
|
22996
|
+
return true;
|
|
22997
|
+
}
|
|
22998
|
+
}
|
|
22999
|
+
}
|
|
23000
|
+
return false;
|
|
23001
|
+
}
|
|
23002
|
+
function redactProperty(name, value) {
|
|
23003
|
+
if (value === undefined || value === null) {
|
|
23004
|
+
return;
|
|
23005
|
+
}
|
|
23006
|
+
if (isSensitiveName(name)) {
|
|
23007
|
+
return REDACTED;
|
|
23008
|
+
}
|
|
23009
|
+
if (typeof value === "boolean" || typeof value === "number") {
|
|
23010
|
+
return value;
|
|
23011
|
+
}
|
|
23012
|
+
if (typeof value !== "string") {
|
|
23013
|
+
return "[OBJECT]";
|
|
23014
|
+
}
|
|
23015
|
+
return redactValueDetectors(value);
|
|
23016
|
+
}
|
|
23017
|
+
function redactProperties(properties) {
|
|
23018
|
+
const out = {};
|
|
23019
|
+
for (const [name, value] of Object.entries(properties)) {
|
|
23020
|
+
const redacted = redactProperty(name, value);
|
|
23021
|
+
if (redacted !== undefined) {
|
|
23022
|
+
out[name] = redacted;
|
|
23023
|
+
}
|
|
23024
|
+
}
|
|
23025
|
+
return out;
|
|
23026
|
+
}
|
|
23027
|
+
var TELEMETRY_OPERATION_ID_PROPERTY = "uip.trace.operation_id";
|
|
23028
|
+
var TELEMETRY_PARENT_ID_PROPERTY = "uip.trace.parent_id";
|
|
23029
|
+
var TELEMETRY_SPAN_ID_PROPERTY = "uip.trace.span_id";
|
|
22863
23030
|
|
|
22864
23031
|
class TelemetryService {
|
|
22865
23032
|
telemetryProvider;
|
|
@@ -22887,11 +23054,15 @@ class TelemetryService {
|
|
|
22887
23054
|
trackException(error, properties) {
|
|
22888
23055
|
const context = this.getCurrentContext();
|
|
22889
23056
|
const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
|
|
22890
|
-
this.telemetryProvider.trackException(error, enrichedProperties);
|
|
23057
|
+
this.telemetryProvider.trackException(redactError(error), enrichedProperties);
|
|
22891
23058
|
}
|
|
22892
23059
|
async trackRequest(name, fn, properties) {
|
|
23060
|
+
const parentContext = this.getCurrentContext();
|
|
23061
|
+
const operationId = parentContext?.operationId ?? this.operationId ?? getTelemetryOperationId();
|
|
23062
|
+
const parentId = parentContext ? parentContext.id : this.inboundParentIdFor(operationId);
|
|
22893
23063
|
const context = {
|
|
22894
|
-
operationId
|
|
23064
|
+
operationId,
|
|
23065
|
+
...parentId !== undefined ? { parentId } : {},
|
|
22895
23066
|
id: this.generateId()
|
|
22896
23067
|
};
|
|
22897
23068
|
const startTime = performance.now();
|
|
@@ -22909,6 +23080,45 @@ class TelemetryService {
|
|
|
22909
23080
|
throw error;
|
|
22910
23081
|
}
|
|
22911
23082
|
}
|
|
23083
|
+
trackRequestResult(name, durationMs, success, properties, context) {
|
|
23084
|
+
const requestContext = context ?? {
|
|
23085
|
+
operationId: this.operationId ?? getTelemetryOperationId(),
|
|
23086
|
+
id: this.generateId()
|
|
23087
|
+
};
|
|
23088
|
+
const enrichedProperties = this.enrichPropertiesWithContext(properties, requestContext);
|
|
23089
|
+
this.telemetryProvider.trackRequest(name, durationMs, success, enrichedProperties);
|
|
23090
|
+
}
|
|
23091
|
+
createRequestContext() {
|
|
23092
|
+
const operationId = this.operationId ?? getTelemetryOperationId();
|
|
23093
|
+
const parentId = this.inboundParentIdFor(operationId);
|
|
23094
|
+
return {
|
|
23095
|
+
operationId,
|
|
23096
|
+
...parentId !== undefined ? { parentId } : {},
|
|
23097
|
+
id: this.generateId()
|
|
23098
|
+
};
|
|
23099
|
+
}
|
|
23100
|
+
inboundParentIdFor(operationId) {
|
|
23101
|
+
const inbound = getInboundTraceContext();
|
|
23102
|
+
return inbound && inbound.traceId === operationId ? inbound.parentSpanId : undefined;
|
|
23103
|
+
}
|
|
23104
|
+
runWithContext(context, fn) {
|
|
23105
|
+
return this.contextStorage.run(context, fn);
|
|
23106
|
+
}
|
|
23107
|
+
createDependencyContext() {
|
|
23108
|
+
const parentContext = this.getCurrentContext();
|
|
23109
|
+
if (!parentContext) {
|
|
23110
|
+
return;
|
|
23111
|
+
}
|
|
23112
|
+
return {
|
|
23113
|
+
operationId: parentContext.operationId,
|
|
23114
|
+
parentId: parentContext.id,
|
|
23115
|
+
id: this.generateId()
|
|
23116
|
+
};
|
|
23117
|
+
}
|
|
23118
|
+
trackDependencyResult(name, type, durationMs, success, properties, context, resultCode) {
|
|
23119
|
+
const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
|
|
23120
|
+
this.telemetryProvider.trackDependency(redactValue(name), type, durationMs, success, enrichedProperties, resultCode);
|
|
23121
|
+
}
|
|
22912
23122
|
async trackDependencyOperation(name, type, fn, properties) {
|
|
22913
23123
|
const parentContext = this.getCurrentContext();
|
|
22914
23124
|
if (!parentContext) {
|
|
@@ -22945,8 +23155,12 @@ class TelemetryService {
|
|
|
22945
23155
|
...getExecutionContextTelemetryProperties(),
|
|
22946
23156
|
...globalProperties,
|
|
22947
23157
|
...this.defaultProperties,
|
|
22948
|
-
...properties,
|
|
22949
|
-
...context
|
|
23158
|
+
...redactProperties(properties ?? {}),
|
|
23159
|
+
...context ? {
|
|
23160
|
+
[TELEMETRY_OPERATION_ID_PROPERTY]: context.operationId,
|
|
23161
|
+
...context.parentId !== undefined ? { [TELEMETRY_PARENT_ID_PROPERTY]: context.parentId } : {},
|
|
23162
|
+
[TELEMETRY_SPAN_ID_PROPERTY]: context.id
|
|
23163
|
+
} : {}
|
|
22950
23164
|
};
|
|
22951
23165
|
if (sessionId === undefined) {
|
|
22952
23166
|
delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
|
|
@@ -22956,7 +23170,16 @@ class TelemetryService {
|
|
|
22956
23170
|
return enriched;
|
|
22957
23171
|
}
|
|
22958
23172
|
generateId() {
|
|
22959
|
-
|
|
23173
|
+
const bytes = new Uint8Array(8);
|
|
23174
|
+
let hex = "";
|
|
23175
|
+
do {
|
|
23176
|
+
crypto.getRandomValues(bytes);
|
|
23177
|
+
hex = "";
|
|
23178
|
+
for (const byte of bytes) {
|
|
23179
|
+
hex += byte.toString(16).padStart(2, "0");
|
|
23180
|
+
}
|
|
23181
|
+
} while (/^0+$/.test(hex));
|
|
23182
|
+
return hex;
|
|
22960
23183
|
}
|
|
22961
23184
|
}
|
|
22962
23185
|
var factorySlot = singleton("PackagerFactoryProvider");
|
|
@@ -23358,7 +23581,7 @@ import { translate as translate3 } from "@uipath/solutionpackager-tool-core";
|
|
|
23358
23581
|
var package_default = {
|
|
23359
23582
|
name: "@uipath/project-packager",
|
|
23360
23583
|
license: "MIT",
|
|
23361
|
-
version: "1.198.0
|
|
23584
|
+
version: "1.198.0",
|
|
23362
23585
|
description: "UiPath Project Packager - core library for packing individual UiPath projects",
|
|
23363
23586
|
type: "module",
|
|
23364
23587
|
main: "./dist/index.js",
|
|
@@ -24587,4 +24810,4 @@ export {
|
|
|
24587
24810
|
BrowserContextStorage
|
|
24588
24811
|
};
|
|
24589
24812
|
|
|
24590
|
-
//# debugId=
|
|
24813
|
+
//# debugId=2B39CCDC9B24FC2E64756E2164756E21
|
package/dist/node.js
CHANGED
|
@@ -10009,10 +10009,33 @@ class NodeContextStorage {
|
|
|
10009
10009
|
return this.storage.getStore();
|
|
10010
10010
|
}
|
|
10011
10011
|
}
|
|
10012
|
+
var TELEMETRY_TRACEPARENT_ENV = "TRACEPARENT";
|
|
10013
|
+
var TRACEPARENT_PATTERN = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/;
|
|
10014
|
+
function getProcessEnv() {
|
|
10015
|
+
return globalThis.process?.env;
|
|
10016
|
+
}
|
|
10017
|
+
function parseInboundTraceparent(value) {
|
|
10018
|
+
if (!value) {
|
|
10019
|
+
return;
|
|
10020
|
+
}
|
|
10021
|
+
const match = TRACEPARENT_PATTERN.exec(value.trim().toLowerCase());
|
|
10022
|
+
if (!match) {
|
|
10023
|
+
return;
|
|
10024
|
+
}
|
|
10025
|
+
const [, traceId, parentSpanId] = match;
|
|
10026
|
+
if (/^0+$/.test(traceId) || /^0+$/.test(parentSpanId)) {
|
|
10027
|
+
return;
|
|
10028
|
+
}
|
|
10029
|
+
return { traceId, parentSpanId };
|
|
10030
|
+
}
|
|
10031
|
+
function getInboundTraceContext() {
|
|
10032
|
+
return parseInboundTraceparent(getProcessEnv()?.[TELEMETRY_TRACEPARENT_ENV]);
|
|
10033
|
+
}
|
|
10012
10034
|
var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
|
|
10013
10035
|
var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
|
|
10014
10036
|
var telemetrySessionIdSlot = singleton("TelemetrySessionId");
|
|
10015
|
-
|
|
10037
|
+
var telemetryOperationIdSlot = singleton("TelemetryOperationId");
|
|
10038
|
+
function getProcessEnv2() {
|
|
10016
10039
|
return globalThis.process?.env;
|
|
10017
10040
|
}
|
|
10018
10041
|
function normalizeSessionId(value) {
|
|
@@ -10023,15 +10046,159 @@ function normalizeSessionId(value) {
|
|
|
10023
10046
|
return trimmed || undefined;
|
|
10024
10047
|
}
|
|
10025
10048
|
function getConfiguredTelemetrySessionId() {
|
|
10026
|
-
return normalizeSessionId(
|
|
10049
|
+
return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
|
|
10027
10050
|
}
|
|
10028
10051
|
function resolveTelemetrySessionId(existingSessionId) {
|
|
10029
10052
|
return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
|
|
10030
10053
|
}
|
|
10054
|
+
function getTelemetryOperationId() {
|
|
10055
|
+
const existing = telemetryOperationIdSlot.get();
|
|
10056
|
+
if (existing) {
|
|
10057
|
+
return existing;
|
|
10058
|
+
}
|
|
10059
|
+
const inboundTraceId = getInboundTraceContext()?.traceId;
|
|
10060
|
+
const generated = inboundTraceId ?? crypto.randomUUID().replaceAll("-", "");
|
|
10061
|
+
telemetryOperationIdSlot.set(generated);
|
|
10062
|
+
return generated;
|
|
10063
|
+
}
|
|
10031
10064
|
var telemetryPropsSlot = singleton("TelemetryDefaultProps");
|
|
10032
10065
|
function getGlobalTelemetryProperties() {
|
|
10033
10066
|
return telemetryPropsSlot.get();
|
|
10034
10067
|
}
|
|
10068
|
+
var REDACTED = "[REDACTED]";
|
|
10069
|
+
var MAX_VALUE_LENGTH = 200;
|
|
10070
|
+
var SENSITIVE_NAME_TOKENS = new Set([
|
|
10071
|
+
"token",
|
|
10072
|
+
"tokens",
|
|
10073
|
+
"secret",
|
|
10074
|
+
"secrets",
|
|
10075
|
+
"password",
|
|
10076
|
+
"passwords",
|
|
10077
|
+
"pwd",
|
|
10078
|
+
"credential",
|
|
10079
|
+
"credentials",
|
|
10080
|
+
"auth",
|
|
10081
|
+
"authentication",
|
|
10082
|
+
"authorization",
|
|
10083
|
+
"authority",
|
|
10084
|
+
"cert",
|
|
10085
|
+
"certificate",
|
|
10086
|
+
"certificates"
|
|
10087
|
+
]);
|
|
10088
|
+
var SENSITIVE_KEY_PREFIXES = new Set([
|
|
10089
|
+
"api",
|
|
10090
|
+
"access",
|
|
10091
|
+
"client",
|
|
10092
|
+
"private",
|
|
10093
|
+
"public",
|
|
10094
|
+
"signing",
|
|
10095
|
+
"encryption",
|
|
10096
|
+
"session",
|
|
10097
|
+
"master",
|
|
10098
|
+
"shared",
|
|
10099
|
+
"root",
|
|
10100
|
+
"ssh",
|
|
10101
|
+
"rsa",
|
|
10102
|
+
"aes",
|
|
10103
|
+
"hmac",
|
|
10104
|
+
"oauth"
|
|
10105
|
+
]);
|
|
10106
|
+
var UUID_PATTERN = /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi;
|
|
10107
|
+
var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
10108
|
+
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
10109
|
+
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
10110
|
+
var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
10111
|
+
var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
10112
|
+
var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
|
|
10113
|
+
function shortHash(input) {
|
|
10114
|
+
let hash = 2166136261;
|
|
10115
|
+
for (let i = 0;i < input.length; i++) {
|
|
10116
|
+
hash ^= input.charCodeAt(i);
|
|
10117
|
+
hash = Math.imul(hash, 16777619);
|
|
10118
|
+
}
|
|
10119
|
+
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
10120
|
+
}
|
|
10121
|
+
function redactUrl(raw) {
|
|
10122
|
+
try {
|
|
10123
|
+
const url = new URL(raw);
|
|
10124
|
+
return `${url.protocol}//${url.host}`;
|
|
10125
|
+
} catch {
|
|
10126
|
+
return `url#${shortHash(raw)}`;
|
|
10127
|
+
}
|
|
10128
|
+
}
|
|
10129
|
+
function redactValueDetectors(value) {
|
|
10130
|
+
let out = value;
|
|
10131
|
+
out = out.replace(JWT_PATTERN, () => REDACTED);
|
|
10132
|
+
out = out.replace(URL_PATTERN, (match) => {
|
|
10133
|
+
const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
|
|
10134
|
+
const core2 = trailing ? match.slice(0, -trailing.length) : match;
|
|
10135
|
+
return `${redactUrl(core2)}${trailing}`;
|
|
10136
|
+
});
|
|
10137
|
+
out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
10138
|
+
out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
|
|
10139
|
+
out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
|
|
10140
|
+
out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
|
|
10141
|
+
if (out.length > MAX_VALUE_LENGTH) {
|
|
10142
|
+
out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
|
|
10143
|
+
}
|
|
10144
|
+
return out;
|
|
10145
|
+
}
|
|
10146
|
+
function redactValue(value) {
|
|
10147
|
+
return redactValueDetectors(value);
|
|
10148
|
+
}
|
|
10149
|
+
function redactError(error) {
|
|
10150
|
+
const safe = new Error(redactValueDetectors(error.message ?? ""));
|
|
10151
|
+
safe.name = error.name;
|
|
10152
|
+
safe.stack = typeof error.stack === "string" ? redactValueDetectors(error.stack) : undefined;
|
|
10153
|
+
return safe;
|
|
10154
|
+
}
|
|
10155
|
+
function nameTokens(name) {
|
|
10156
|
+
return name.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").split(/[\s._-]+/).map((t) => t.toLowerCase()).filter(Boolean);
|
|
10157
|
+
}
|
|
10158
|
+
function isSensitiveName(name) {
|
|
10159
|
+
const tokens = nameTokens(name);
|
|
10160
|
+
for (let i = 0;i < tokens.length; i++) {
|
|
10161
|
+
const token = tokens[i];
|
|
10162
|
+
if (SENSITIVE_NAME_TOKENS.has(token)) {
|
|
10163
|
+
return true;
|
|
10164
|
+
}
|
|
10165
|
+
if (token === "key" || token === "keys") {
|
|
10166
|
+
const prev = tokens[i - 1];
|
|
10167
|
+
if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
|
|
10168
|
+
return true;
|
|
10169
|
+
}
|
|
10170
|
+
}
|
|
10171
|
+
}
|
|
10172
|
+
return false;
|
|
10173
|
+
}
|
|
10174
|
+
function redactProperty(name, value) {
|
|
10175
|
+
if (value === undefined || value === null) {
|
|
10176
|
+
return;
|
|
10177
|
+
}
|
|
10178
|
+
if (isSensitiveName(name)) {
|
|
10179
|
+
return REDACTED;
|
|
10180
|
+
}
|
|
10181
|
+
if (typeof value === "boolean" || typeof value === "number") {
|
|
10182
|
+
return value;
|
|
10183
|
+
}
|
|
10184
|
+
if (typeof value !== "string") {
|
|
10185
|
+
return "[OBJECT]";
|
|
10186
|
+
}
|
|
10187
|
+
return redactValueDetectors(value);
|
|
10188
|
+
}
|
|
10189
|
+
function redactProperties(properties) {
|
|
10190
|
+
const out = {};
|
|
10191
|
+
for (const [name, value] of Object.entries(properties)) {
|
|
10192
|
+
const redacted = redactProperty(name, value);
|
|
10193
|
+
if (redacted !== undefined) {
|
|
10194
|
+
out[name] = redacted;
|
|
10195
|
+
}
|
|
10196
|
+
}
|
|
10197
|
+
return out;
|
|
10198
|
+
}
|
|
10199
|
+
var TELEMETRY_OPERATION_ID_PROPERTY = "uip.trace.operation_id";
|
|
10200
|
+
var TELEMETRY_PARENT_ID_PROPERTY = "uip.trace.parent_id";
|
|
10201
|
+
var TELEMETRY_SPAN_ID_PROPERTY = "uip.trace.span_id";
|
|
10035
10202
|
|
|
10036
10203
|
class TelemetryService {
|
|
10037
10204
|
telemetryProvider;
|
|
@@ -10059,11 +10226,15 @@ class TelemetryService {
|
|
|
10059
10226
|
trackException(error, properties) {
|
|
10060
10227
|
const context = this.getCurrentContext();
|
|
10061
10228
|
const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
|
|
10062
|
-
this.telemetryProvider.trackException(error, enrichedProperties);
|
|
10229
|
+
this.telemetryProvider.trackException(redactError(error), enrichedProperties);
|
|
10063
10230
|
}
|
|
10064
10231
|
async trackRequest(name, fn, properties) {
|
|
10232
|
+
const parentContext = this.getCurrentContext();
|
|
10233
|
+
const operationId = parentContext?.operationId ?? this.operationId ?? getTelemetryOperationId();
|
|
10234
|
+
const parentId = parentContext ? parentContext.id : this.inboundParentIdFor(operationId);
|
|
10065
10235
|
const context = {
|
|
10066
|
-
operationId
|
|
10236
|
+
operationId,
|
|
10237
|
+
...parentId !== undefined ? { parentId } : {},
|
|
10067
10238
|
id: this.generateId()
|
|
10068
10239
|
};
|
|
10069
10240
|
const startTime = performance.now();
|
|
@@ -10081,6 +10252,45 @@ class TelemetryService {
|
|
|
10081
10252
|
throw error;
|
|
10082
10253
|
}
|
|
10083
10254
|
}
|
|
10255
|
+
trackRequestResult(name, durationMs, success, properties, context) {
|
|
10256
|
+
const requestContext = context ?? {
|
|
10257
|
+
operationId: this.operationId ?? getTelemetryOperationId(),
|
|
10258
|
+
id: this.generateId()
|
|
10259
|
+
};
|
|
10260
|
+
const enrichedProperties = this.enrichPropertiesWithContext(properties, requestContext);
|
|
10261
|
+
this.telemetryProvider.trackRequest(name, durationMs, success, enrichedProperties);
|
|
10262
|
+
}
|
|
10263
|
+
createRequestContext() {
|
|
10264
|
+
const operationId = this.operationId ?? getTelemetryOperationId();
|
|
10265
|
+
const parentId = this.inboundParentIdFor(operationId);
|
|
10266
|
+
return {
|
|
10267
|
+
operationId,
|
|
10268
|
+
...parentId !== undefined ? { parentId } : {},
|
|
10269
|
+
id: this.generateId()
|
|
10270
|
+
};
|
|
10271
|
+
}
|
|
10272
|
+
inboundParentIdFor(operationId) {
|
|
10273
|
+
const inbound = getInboundTraceContext();
|
|
10274
|
+
return inbound && inbound.traceId === operationId ? inbound.parentSpanId : undefined;
|
|
10275
|
+
}
|
|
10276
|
+
runWithContext(context, fn) {
|
|
10277
|
+
return this.contextStorage.run(context, fn);
|
|
10278
|
+
}
|
|
10279
|
+
createDependencyContext() {
|
|
10280
|
+
const parentContext = this.getCurrentContext();
|
|
10281
|
+
if (!parentContext) {
|
|
10282
|
+
return;
|
|
10283
|
+
}
|
|
10284
|
+
return {
|
|
10285
|
+
operationId: parentContext.operationId,
|
|
10286
|
+
parentId: parentContext.id,
|
|
10287
|
+
id: this.generateId()
|
|
10288
|
+
};
|
|
10289
|
+
}
|
|
10290
|
+
trackDependencyResult(name, type2, durationMs, success, properties, context, resultCode) {
|
|
10291
|
+
const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
|
|
10292
|
+
this.telemetryProvider.trackDependency(redactValue(name), type2, durationMs, success, enrichedProperties, resultCode);
|
|
10293
|
+
}
|
|
10084
10294
|
async trackDependencyOperation(name, type2, fn, properties) {
|
|
10085
10295
|
const parentContext = this.getCurrentContext();
|
|
10086
10296
|
if (!parentContext) {
|
|
@@ -10117,8 +10327,12 @@ class TelemetryService {
|
|
|
10117
10327
|
...getExecutionContextTelemetryProperties(),
|
|
10118
10328
|
...globalProperties,
|
|
10119
10329
|
...this.defaultProperties,
|
|
10120
|
-
...properties,
|
|
10121
|
-
...context
|
|
10330
|
+
...redactProperties(properties ?? {}),
|
|
10331
|
+
...context ? {
|
|
10332
|
+
[TELEMETRY_OPERATION_ID_PROPERTY]: context.operationId,
|
|
10333
|
+
...context.parentId !== undefined ? { [TELEMETRY_PARENT_ID_PROPERTY]: context.parentId } : {},
|
|
10334
|
+
[TELEMETRY_SPAN_ID_PROPERTY]: context.id
|
|
10335
|
+
} : {}
|
|
10122
10336
|
};
|
|
10123
10337
|
if (sessionId === undefined) {
|
|
10124
10338
|
delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
|
|
@@ -10128,7 +10342,16 @@ class TelemetryService {
|
|
|
10128
10342
|
return enriched;
|
|
10129
10343
|
}
|
|
10130
10344
|
generateId() {
|
|
10131
|
-
|
|
10345
|
+
const bytes = new Uint8Array(8);
|
|
10346
|
+
let hex = "";
|
|
10347
|
+
do {
|
|
10348
|
+
crypto.getRandomValues(bytes);
|
|
10349
|
+
hex = "";
|
|
10350
|
+
for (const byte of bytes) {
|
|
10351
|
+
hex += byte.toString(16).padStart(2, "0");
|
|
10352
|
+
}
|
|
10353
|
+
} while (/^0+$/.test(hex));
|
|
10354
|
+
return hex;
|
|
10132
10355
|
}
|
|
10133
10356
|
}
|
|
10134
10357
|
var providerSlot = singleton("TelemetryProvider");
|
|
@@ -10822,149 +11045,24 @@ function buildCommandTelemetryAttribution(commandPath, skillSource) {
|
|
|
10822
11045
|
...getCommandProductModeAttribution(commandPath)
|
|
10823
11046
|
};
|
|
10824
11047
|
}
|
|
10825
|
-
var REDACTED = "[REDACTED]";
|
|
10826
|
-
var MAX_VALUE_LENGTH = 200;
|
|
10827
|
-
var SENSITIVE_NAME_TOKENS = new Set([
|
|
10828
|
-
"token",
|
|
10829
|
-
"tokens",
|
|
10830
|
-
"secret",
|
|
10831
|
-
"secrets",
|
|
10832
|
-
"password",
|
|
10833
|
-
"passwords",
|
|
10834
|
-
"pwd",
|
|
10835
|
-
"credential",
|
|
10836
|
-
"credentials",
|
|
10837
|
-
"auth",
|
|
10838
|
-
"authentication",
|
|
10839
|
-
"authorization",
|
|
10840
|
-
"authority",
|
|
10841
|
-
"cert",
|
|
10842
|
-
"certificate",
|
|
10843
|
-
"certificates"
|
|
10844
|
-
]);
|
|
10845
|
-
var SENSITIVE_KEY_PREFIXES = new Set([
|
|
10846
|
-
"api",
|
|
10847
|
-
"access",
|
|
10848
|
-
"client",
|
|
10849
|
-
"private",
|
|
10850
|
-
"public",
|
|
10851
|
-
"signing",
|
|
10852
|
-
"encryption",
|
|
10853
|
-
"session",
|
|
10854
|
-
"master",
|
|
10855
|
-
"shared",
|
|
10856
|
-
"root",
|
|
10857
|
-
"ssh",
|
|
10858
|
-
"rsa",
|
|
10859
|
-
"aes",
|
|
10860
|
-
"hmac",
|
|
10861
|
-
"oauth"
|
|
10862
|
-
]);
|
|
10863
|
-
var UUID_PATTERN = /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi;
|
|
10864
|
-
var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
10865
|
-
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
10866
|
-
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
10867
|
-
var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
10868
|
-
var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
10869
|
-
var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
|
|
10870
|
-
function shortHash(input) {
|
|
10871
|
-
let hash = 2166136261;
|
|
10872
|
-
for (let i = 0;i < input.length; i++) {
|
|
10873
|
-
hash ^= input.charCodeAt(i);
|
|
10874
|
-
hash = Math.imul(hash, 16777619);
|
|
10875
|
-
}
|
|
10876
|
-
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
10877
|
-
}
|
|
10878
|
-
function redactUrl(raw) {
|
|
10879
|
-
try {
|
|
10880
|
-
const url = new URL(raw);
|
|
10881
|
-
return `${url.protocol}//${url.host}`;
|
|
10882
|
-
} catch {
|
|
10883
|
-
return `url#${shortHash(raw)}`;
|
|
10884
|
-
}
|
|
10885
|
-
}
|
|
10886
|
-
function redactValueDetectors(value) {
|
|
10887
|
-
let out = value;
|
|
10888
|
-
out = out.replace(JWT_PATTERN, () => REDACTED);
|
|
10889
|
-
out = out.replace(URL_PATTERN, (match) => {
|
|
10890
|
-
const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
|
|
10891
|
-
const core2 = trailing ? match.slice(0, -trailing.length) : match;
|
|
10892
|
-
return `${redactUrl(core2)}${trailing}`;
|
|
10893
|
-
});
|
|
10894
|
-
out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
10895
|
-
out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
|
|
10896
|
-
out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
|
|
10897
|
-
out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
|
|
10898
|
-
if (out.length > MAX_VALUE_LENGTH) {
|
|
10899
|
-
out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
|
|
10900
|
-
}
|
|
10901
|
-
return out;
|
|
10902
|
-
}
|
|
10903
|
-
function nameTokens(name) {
|
|
10904
|
-
return name.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").split(/[\s_-]+/).map((t) => t.toLowerCase()).filter(Boolean);
|
|
10905
|
-
}
|
|
10906
|
-
function isSensitiveName(name) {
|
|
10907
|
-
const tokens = nameTokens(name);
|
|
10908
|
-
for (let i = 0;i < tokens.length; i++) {
|
|
10909
|
-
const token = tokens[i];
|
|
10910
|
-
if (SENSITIVE_NAME_TOKENS.has(token)) {
|
|
10911
|
-
return true;
|
|
10912
|
-
}
|
|
10913
|
-
if (token === "key" || token === "keys") {
|
|
10914
|
-
const prev = tokens[i - 1];
|
|
10915
|
-
if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
|
|
10916
|
-
return true;
|
|
10917
|
-
}
|
|
10918
|
-
}
|
|
10919
|
-
}
|
|
10920
|
-
return false;
|
|
10921
|
-
}
|
|
10922
|
-
function redactProperty(name, value) {
|
|
10923
|
-
if (value === undefined || value === null) {
|
|
10924
|
-
return;
|
|
10925
|
-
}
|
|
10926
|
-
if (isSensitiveName(name)) {
|
|
10927
|
-
return REDACTED;
|
|
10928
|
-
}
|
|
10929
|
-
if (typeof value === "boolean" || typeof value === "number") {
|
|
10930
|
-
return value;
|
|
10931
|
-
}
|
|
10932
|
-
if (typeof value !== "string") {
|
|
10933
|
-
return "[OBJECT]";
|
|
10934
|
-
}
|
|
10935
|
-
return redactValueDetectors(value);
|
|
10936
|
-
}
|
|
10937
|
-
function redactProperties(properties) {
|
|
10938
|
-
const out = {};
|
|
10939
|
-
for (const [name, value] of Object.entries(properties)) {
|
|
10940
|
-
const redacted = redactProperty(name, value);
|
|
10941
|
-
if (redacted !== undefined) {
|
|
10942
|
-
out[name] = redacted;
|
|
10943
|
-
}
|
|
10944
|
-
}
|
|
10945
|
-
return out;
|
|
10946
|
-
}
|
|
10947
11048
|
var pollSignalSlot = singleton("PollSignal");
|
|
10948
11049
|
var cliErrorCodeValues = new Set(CLI_ERROR_CODES);
|
|
10949
11050
|
var retryHintValues = new Set(RETRY_HINTS);
|
|
11051
|
+
var TELEMETRY_COMMAND_ARG_PREFIX = "uip.cmd.arg.";
|
|
10950
11052
|
function extractCommandParams(cmd) {
|
|
10951
11053
|
const params = {};
|
|
11054
|
+
const add2 = (name, value) => {
|
|
11055
|
+
if (name && value !== undefined) {
|
|
11056
|
+
params[`${TELEMETRY_COMMAND_ARG_PREFIX}${name}`] = value;
|
|
11057
|
+
}
|
|
11058
|
+
};
|
|
10952
11059
|
const registered = cmd.registeredArguments ?? [];
|
|
10953
11060
|
const processed = cmd.processedArgs ?? [];
|
|
10954
11061
|
for (let i = 0;i < registered.length; i++) {
|
|
10955
|
-
|
|
10956
|
-
if (value === undefined) {
|
|
10957
|
-
continue;
|
|
10958
|
-
}
|
|
10959
|
-
const name = registered[i].name();
|
|
10960
|
-
if (name) {
|
|
10961
|
-
params[name] = value;
|
|
10962
|
-
}
|
|
11062
|
+
add2(registered[i].name(), processed[i]);
|
|
10963
11063
|
}
|
|
10964
11064
|
for (const [key, value] of Object.entries(cmd.opts())) {
|
|
10965
|
-
|
|
10966
|
-
params[key] = value;
|
|
10967
|
-
}
|
|
11065
|
+
add2(key, value);
|
|
10968
11066
|
}
|
|
10969
11067
|
return params;
|
|
10970
11068
|
}
|
|
@@ -11007,11 +11105,12 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
11007
11105
|
return this.action(async (...args) => {
|
|
11008
11106
|
const telemetryName = deriveCommandPath(command);
|
|
11009
11107
|
const props = typeof properties === "function" ? properties(...args) : properties;
|
|
11108
|
+
const requestContext = telemetry.createRequestContext();
|
|
11010
11109
|
const startTime = performance.now();
|
|
11011
11110
|
let errorMessage;
|
|
11012
11111
|
let fallbackExitCode = EXIT_CODES.Success;
|
|
11013
11112
|
clearRecordedCommandFailureTelemetry();
|
|
11014
|
-
const [error] = await catchError(fn(...args));
|
|
11113
|
+
const [error] = await catchError(telemetry.runWithContext(requestContext, () => fn(...args)));
|
|
11015
11114
|
if (error) {
|
|
11016
11115
|
errorMessage = error instanceof Error ? error.message : String(error);
|
|
11017
11116
|
logger.debug(`[trackedAction] ${telemetryName} failed: ${errorMessage}`);
|
|
@@ -11047,16 +11146,21 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
11047
11146
|
recordedFailure,
|
|
11048
11147
|
pollSignal: context.pollSignal
|
|
11049
11148
|
});
|
|
11050
|
-
|
|
11051
|
-
|
|
11149
|
+
const commandParams = extractCommandParams(command);
|
|
11150
|
+
if (props) {
|
|
11151
|
+
for (const key of Object.keys(props)) {
|
|
11152
|
+
delete commandParams[`${TELEMETRY_COMMAND_ARG_PREFIX}${key}`];
|
|
11153
|
+
}
|
|
11154
|
+
}
|
|
11155
|
+
const baseProperties = redactProperties({
|
|
11156
|
+
...commandParams,
|
|
11052
11157
|
...props,
|
|
11053
11158
|
...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
|
|
11054
11159
|
command: "true",
|
|
11055
|
-
duration: String(durationMs),
|
|
11056
|
-
success: String(success),
|
|
11057
11160
|
...terminalTelemetry,
|
|
11058
11161
|
...errorMessage ? { errorMessage } : {}
|
|
11059
|
-
})
|
|
11162
|
+
});
|
|
11163
|
+
telemetry.trackRequestResult(telemetryName, durationMs, success, baseProperties, requestContext);
|
|
11060
11164
|
});
|
|
11061
11165
|
};
|
|
11062
11166
|
var guardInstalledSlot = singleton("ConsoleGuardInstalled");
|
|
@@ -12489,7 +12593,7 @@ import { translate as translate9 } from "@uipath/solutionpackager-tool-core";
|
|
|
12489
12593
|
var package_default = {
|
|
12490
12594
|
name: "@uipath/project-packager",
|
|
12491
12595
|
license: "MIT",
|
|
12492
|
-
version: "1.198.0
|
|
12596
|
+
version: "1.198.0",
|
|
12493
12597
|
description: "UiPath Project Packager - core library for packing individual UiPath projects",
|
|
12494
12598
|
type: "module",
|
|
12495
12599
|
main: "./dist/index.js",
|
|
@@ -12946,4 +13050,4 @@ export {
|
|
|
12946
13050
|
BaseNodePackagerFactory
|
|
12947
13051
|
};
|
|
12948
13052
|
|
|
12949
|
-
//# debugId=
|
|
13053
|
+
//# debugId=2F25E33E546DA7EE64756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/project-packager",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "1.198.0
|
|
4
|
+
"version": "1.198.0",
|
|
5
5
|
"description": "UiPath Project Packager - core library for packing individual UiPath projects",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"fflate": "^0.8.2"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "1fadf03d7a8dd102742571dff569fdac11808afb"
|
|
43
43
|
}
|