@uipath/pm-tool 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/tool.js +257 -150
- package/package.json +2 -2
package/dist/tool.js
CHANGED
|
@@ -21230,7 +21230,7 @@ var init_server = __esm(() => {
|
|
|
21230
21230
|
var package_default = {
|
|
21231
21231
|
name: "@uipath/pm-tool",
|
|
21232
21232
|
license: "MIT",
|
|
21233
|
-
version: "1.198.0
|
|
21233
|
+
version: "1.198.0",
|
|
21234
21234
|
description: "Process Mining — process apps, transformations, and data ingestion.",
|
|
21235
21235
|
private: false,
|
|
21236
21236
|
repository: {
|
|
@@ -27131,11 +27131,36 @@ class NodeContextStorage {
|
|
|
27131
27131
|
return this.storage.getStore();
|
|
27132
27132
|
}
|
|
27133
27133
|
}
|
|
27134
|
+
// ../common/src/telemetry/trace-context.ts
|
|
27135
|
+
var TELEMETRY_TRACEPARENT_ENV = "TRACEPARENT";
|
|
27136
|
+
var TRACEPARENT_PATTERN = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/;
|
|
27137
|
+
function getProcessEnv() {
|
|
27138
|
+
return globalThis.process?.env;
|
|
27139
|
+
}
|
|
27140
|
+
function parseInboundTraceparent(value) {
|
|
27141
|
+
if (!value) {
|
|
27142
|
+
return;
|
|
27143
|
+
}
|
|
27144
|
+
const match = TRACEPARENT_PATTERN.exec(value.trim().toLowerCase());
|
|
27145
|
+
if (!match) {
|
|
27146
|
+
return;
|
|
27147
|
+
}
|
|
27148
|
+
const [, traceId, parentSpanId] = match;
|
|
27149
|
+
if (/^0+$/.test(traceId) || /^0+$/.test(parentSpanId)) {
|
|
27150
|
+
return;
|
|
27151
|
+
}
|
|
27152
|
+
return { traceId, parentSpanId };
|
|
27153
|
+
}
|
|
27154
|
+
function getInboundTraceContext() {
|
|
27155
|
+
return parseInboundTraceparent(getProcessEnv()?.[TELEMETRY_TRACEPARENT_ENV]);
|
|
27156
|
+
}
|
|
27157
|
+
|
|
27134
27158
|
// ../common/src/telemetry/session-id.ts
|
|
27135
27159
|
var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
|
|
27136
27160
|
var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
|
|
27137
27161
|
var telemetrySessionIdSlot = singleton("TelemetrySessionId");
|
|
27138
|
-
|
|
27162
|
+
var telemetryOperationIdSlot = singleton("TelemetryOperationId");
|
|
27163
|
+
function getProcessEnv2() {
|
|
27139
27164
|
return globalThis.process?.env;
|
|
27140
27165
|
}
|
|
27141
27166
|
function normalizeSessionId(value) {
|
|
@@ -27146,18 +27171,165 @@ function normalizeSessionId(value) {
|
|
|
27146
27171
|
return trimmed || undefined;
|
|
27147
27172
|
}
|
|
27148
27173
|
function getConfiguredTelemetrySessionId() {
|
|
27149
|
-
return normalizeSessionId(
|
|
27174
|
+
return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
|
|
27150
27175
|
}
|
|
27151
27176
|
function resolveTelemetrySessionId(existingSessionId) {
|
|
27152
27177
|
return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
|
|
27153
27178
|
}
|
|
27179
|
+
function getTelemetryOperationId() {
|
|
27180
|
+
const existing = telemetryOperationIdSlot.get();
|
|
27181
|
+
if (existing) {
|
|
27182
|
+
return existing;
|
|
27183
|
+
}
|
|
27184
|
+
const inboundTraceId = getInboundTraceContext()?.traceId;
|
|
27185
|
+
const generated = inboundTraceId ?? crypto.randomUUID().replaceAll("-", "");
|
|
27186
|
+
telemetryOperationIdSlot.set(generated);
|
|
27187
|
+
return generated;
|
|
27188
|
+
}
|
|
27154
27189
|
// ../common/src/telemetry/global-telemetry-properties.ts
|
|
27155
27190
|
var telemetryPropsSlot = singleton("TelemetryDefaultProps");
|
|
27156
27191
|
function getGlobalTelemetryProperties() {
|
|
27157
27192
|
return telemetryPropsSlot.get();
|
|
27158
27193
|
}
|
|
27159
27194
|
|
|
27195
|
+
// ../common/src/telemetry/pii-redactor.ts
|
|
27196
|
+
var REDACTED = "[REDACTED]";
|
|
27197
|
+
var MAX_VALUE_LENGTH = 200;
|
|
27198
|
+
var SENSITIVE_NAME_TOKENS = new Set([
|
|
27199
|
+
"token",
|
|
27200
|
+
"tokens",
|
|
27201
|
+
"secret",
|
|
27202
|
+
"secrets",
|
|
27203
|
+
"password",
|
|
27204
|
+
"passwords",
|
|
27205
|
+
"pwd",
|
|
27206
|
+
"credential",
|
|
27207
|
+
"credentials",
|
|
27208
|
+
"auth",
|
|
27209
|
+
"authentication",
|
|
27210
|
+
"authorization",
|
|
27211
|
+
"authority",
|
|
27212
|
+
"cert",
|
|
27213
|
+
"certificate",
|
|
27214
|
+
"certificates"
|
|
27215
|
+
]);
|
|
27216
|
+
var SENSITIVE_KEY_PREFIXES = new Set([
|
|
27217
|
+
"api",
|
|
27218
|
+
"access",
|
|
27219
|
+
"client",
|
|
27220
|
+
"private",
|
|
27221
|
+
"public",
|
|
27222
|
+
"signing",
|
|
27223
|
+
"encryption",
|
|
27224
|
+
"session",
|
|
27225
|
+
"master",
|
|
27226
|
+
"shared",
|
|
27227
|
+
"root",
|
|
27228
|
+
"ssh",
|
|
27229
|
+
"rsa",
|
|
27230
|
+
"aes",
|
|
27231
|
+
"hmac",
|
|
27232
|
+
"oauth"
|
|
27233
|
+
]);
|
|
27234
|
+
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;
|
|
27235
|
+
var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
27236
|
+
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
27237
|
+
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
27238
|
+
var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
27239
|
+
var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
27240
|
+
var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
|
|
27241
|
+
function shortHash(input) {
|
|
27242
|
+
let hash = 2166136261;
|
|
27243
|
+
for (let i = 0;i < input.length; i++) {
|
|
27244
|
+
hash ^= input.charCodeAt(i);
|
|
27245
|
+
hash = Math.imul(hash, 16777619);
|
|
27246
|
+
}
|
|
27247
|
+
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
27248
|
+
}
|
|
27249
|
+
function redactUrl(raw) {
|
|
27250
|
+
try {
|
|
27251
|
+
const url = new URL(raw);
|
|
27252
|
+
return `${url.protocol}//${url.host}`;
|
|
27253
|
+
} catch {
|
|
27254
|
+
return `url#${shortHash(raw)}`;
|
|
27255
|
+
}
|
|
27256
|
+
}
|
|
27257
|
+
function redactValueDetectors(value) {
|
|
27258
|
+
let out = value;
|
|
27259
|
+
out = out.replace(JWT_PATTERN, () => REDACTED);
|
|
27260
|
+
out = out.replace(URL_PATTERN, (match) => {
|
|
27261
|
+
const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
|
|
27262
|
+
const core2 = trailing ? match.slice(0, -trailing.length) : match;
|
|
27263
|
+
return `${redactUrl(core2)}${trailing}`;
|
|
27264
|
+
});
|
|
27265
|
+
out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
27266
|
+
out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
|
|
27267
|
+
out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
|
|
27268
|
+
out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
|
|
27269
|
+
if (out.length > MAX_VALUE_LENGTH) {
|
|
27270
|
+
out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
|
|
27271
|
+
}
|
|
27272
|
+
return out;
|
|
27273
|
+
}
|
|
27274
|
+
function redactValue(value) {
|
|
27275
|
+
return redactValueDetectors(value);
|
|
27276
|
+
}
|
|
27277
|
+
function redactError(error) {
|
|
27278
|
+
const safe = new Error(redactValueDetectors(error.message ?? ""));
|
|
27279
|
+
safe.name = error.name;
|
|
27280
|
+
safe.stack = typeof error.stack === "string" ? redactValueDetectors(error.stack) : undefined;
|
|
27281
|
+
return safe;
|
|
27282
|
+
}
|
|
27283
|
+
function nameTokens(name) {
|
|
27284
|
+
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);
|
|
27285
|
+
}
|
|
27286
|
+
function isSensitiveName(name) {
|
|
27287
|
+
const tokens = nameTokens(name);
|
|
27288
|
+
for (let i = 0;i < tokens.length; i++) {
|
|
27289
|
+
const token = tokens[i];
|
|
27290
|
+
if (SENSITIVE_NAME_TOKENS.has(token)) {
|
|
27291
|
+
return true;
|
|
27292
|
+
}
|
|
27293
|
+
if (token === "key" || token === "keys") {
|
|
27294
|
+
const prev = tokens[i - 1];
|
|
27295
|
+
if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
|
|
27296
|
+
return true;
|
|
27297
|
+
}
|
|
27298
|
+
}
|
|
27299
|
+
}
|
|
27300
|
+
return false;
|
|
27301
|
+
}
|
|
27302
|
+
function redactProperty(name, value) {
|
|
27303
|
+
if (value === undefined || value === null) {
|
|
27304
|
+
return;
|
|
27305
|
+
}
|
|
27306
|
+
if (isSensitiveName(name)) {
|
|
27307
|
+
return REDACTED;
|
|
27308
|
+
}
|
|
27309
|
+
if (typeof value === "boolean" || typeof value === "number") {
|
|
27310
|
+
return value;
|
|
27311
|
+
}
|
|
27312
|
+
if (typeof value !== "string") {
|
|
27313
|
+
return "[OBJECT]";
|
|
27314
|
+
}
|
|
27315
|
+
return redactValueDetectors(value);
|
|
27316
|
+
}
|
|
27317
|
+
function redactProperties(properties) {
|
|
27318
|
+
const out = {};
|
|
27319
|
+
for (const [name, value] of Object.entries(properties)) {
|
|
27320
|
+
const redacted = redactProperty(name, value);
|
|
27321
|
+
if (redacted !== undefined) {
|
|
27322
|
+
out[name] = redacted;
|
|
27323
|
+
}
|
|
27324
|
+
}
|
|
27325
|
+
return out;
|
|
27326
|
+
}
|
|
27327
|
+
|
|
27160
27328
|
// ../common/src/telemetry/telemetry-service.ts
|
|
27329
|
+
var TELEMETRY_OPERATION_ID_PROPERTY = "uip.trace.operation_id";
|
|
27330
|
+
var TELEMETRY_PARENT_ID_PROPERTY = "uip.trace.parent_id";
|
|
27331
|
+
var TELEMETRY_SPAN_ID_PROPERTY = "uip.trace.span_id";
|
|
27332
|
+
|
|
27161
27333
|
class TelemetryService {
|
|
27162
27334
|
telemetryProvider;
|
|
27163
27335
|
contextStorage;
|
|
@@ -27184,11 +27356,15 @@ class TelemetryService {
|
|
|
27184
27356
|
trackException(error, properties) {
|
|
27185
27357
|
const context = this.getCurrentContext();
|
|
27186
27358
|
const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
|
|
27187
|
-
this.telemetryProvider.trackException(error, enrichedProperties);
|
|
27359
|
+
this.telemetryProvider.trackException(redactError(error), enrichedProperties);
|
|
27188
27360
|
}
|
|
27189
27361
|
async trackRequest(name, fn, properties) {
|
|
27362
|
+
const parentContext = this.getCurrentContext();
|
|
27363
|
+
const operationId = parentContext?.operationId ?? this.operationId ?? getTelemetryOperationId();
|
|
27364
|
+
const parentId = parentContext ? parentContext.id : this.inboundParentIdFor(operationId);
|
|
27190
27365
|
const context = {
|
|
27191
|
-
operationId
|
|
27366
|
+
operationId,
|
|
27367
|
+
...parentId !== undefined ? { parentId } : {},
|
|
27192
27368
|
id: this.generateId()
|
|
27193
27369
|
};
|
|
27194
27370
|
const startTime = performance.now();
|
|
@@ -27206,6 +27382,45 @@ class TelemetryService {
|
|
|
27206
27382
|
throw error;
|
|
27207
27383
|
}
|
|
27208
27384
|
}
|
|
27385
|
+
trackRequestResult(name, durationMs, success, properties, context) {
|
|
27386
|
+
const requestContext = context ?? {
|
|
27387
|
+
operationId: this.operationId ?? getTelemetryOperationId(),
|
|
27388
|
+
id: this.generateId()
|
|
27389
|
+
};
|
|
27390
|
+
const enrichedProperties = this.enrichPropertiesWithContext(properties, requestContext);
|
|
27391
|
+
this.telemetryProvider.trackRequest(name, durationMs, success, enrichedProperties);
|
|
27392
|
+
}
|
|
27393
|
+
createRequestContext() {
|
|
27394
|
+
const operationId = this.operationId ?? getTelemetryOperationId();
|
|
27395
|
+
const parentId = this.inboundParentIdFor(operationId);
|
|
27396
|
+
return {
|
|
27397
|
+
operationId,
|
|
27398
|
+
...parentId !== undefined ? { parentId } : {},
|
|
27399
|
+
id: this.generateId()
|
|
27400
|
+
};
|
|
27401
|
+
}
|
|
27402
|
+
inboundParentIdFor(operationId) {
|
|
27403
|
+
const inbound = getInboundTraceContext();
|
|
27404
|
+
return inbound && inbound.traceId === operationId ? inbound.parentSpanId : undefined;
|
|
27405
|
+
}
|
|
27406
|
+
runWithContext(context, fn) {
|
|
27407
|
+
return this.contextStorage.run(context, fn);
|
|
27408
|
+
}
|
|
27409
|
+
createDependencyContext() {
|
|
27410
|
+
const parentContext = this.getCurrentContext();
|
|
27411
|
+
if (!parentContext) {
|
|
27412
|
+
return;
|
|
27413
|
+
}
|
|
27414
|
+
return {
|
|
27415
|
+
operationId: parentContext.operationId,
|
|
27416
|
+
parentId: parentContext.id,
|
|
27417
|
+
id: this.generateId()
|
|
27418
|
+
};
|
|
27419
|
+
}
|
|
27420
|
+
trackDependencyResult(name, type2, durationMs, success, properties, context, resultCode) {
|
|
27421
|
+
const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
|
|
27422
|
+
this.telemetryProvider.trackDependency(redactValue(name), type2, durationMs, success, enrichedProperties, resultCode);
|
|
27423
|
+
}
|
|
27209
27424
|
async trackDependencyOperation(name, type2, fn, properties) {
|
|
27210
27425
|
const parentContext = this.getCurrentContext();
|
|
27211
27426
|
if (!parentContext) {
|
|
@@ -27242,8 +27457,12 @@ class TelemetryService {
|
|
|
27242
27457
|
...getExecutionContextTelemetryProperties(),
|
|
27243
27458
|
...globalProperties,
|
|
27244
27459
|
...this.defaultProperties,
|
|
27245
|
-
...properties,
|
|
27246
|
-
...context
|
|
27460
|
+
...redactProperties(properties ?? {}),
|
|
27461
|
+
...context ? {
|
|
27462
|
+
[TELEMETRY_OPERATION_ID_PROPERTY]: context.operationId,
|
|
27463
|
+
...context.parentId !== undefined ? { [TELEMETRY_PARENT_ID_PROPERTY]: context.parentId } : {},
|
|
27464
|
+
[TELEMETRY_SPAN_ID_PROPERTY]: context.id
|
|
27465
|
+
} : {}
|
|
27247
27466
|
};
|
|
27248
27467
|
if (sessionId === undefined) {
|
|
27249
27468
|
delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
|
|
@@ -27253,7 +27472,16 @@ class TelemetryService {
|
|
|
27253
27472
|
return enriched;
|
|
27254
27473
|
}
|
|
27255
27474
|
generateId() {
|
|
27256
|
-
|
|
27475
|
+
const bytes = new Uint8Array(8);
|
|
27476
|
+
let hex = "";
|
|
27477
|
+
do {
|
|
27478
|
+
crypto.getRandomValues(bytes);
|
|
27479
|
+
hex = "";
|
|
27480
|
+
for (const byte of bytes) {
|
|
27481
|
+
hex += byte.toString(16).padStart(2, "0");
|
|
27482
|
+
}
|
|
27483
|
+
} while (/^0+$/.test(hex));
|
|
27484
|
+
return hex;
|
|
27257
27485
|
}
|
|
27258
27486
|
}
|
|
27259
27487
|
// ../common/src/telemetry/node-appinsights-telemetry-provider.ts
|
|
@@ -27955,134 +28183,11 @@ function buildCommandTelemetryAttribution(commandPath, skillSource) {
|
|
|
27955
28183
|
};
|
|
27956
28184
|
}
|
|
27957
28185
|
|
|
27958
|
-
// ../common/src/telemetry/pii-redactor.ts
|
|
27959
|
-
var REDACTED = "[REDACTED]";
|
|
27960
|
-
var MAX_VALUE_LENGTH = 200;
|
|
27961
|
-
var SENSITIVE_NAME_TOKENS = new Set([
|
|
27962
|
-
"token",
|
|
27963
|
-
"tokens",
|
|
27964
|
-
"secret",
|
|
27965
|
-
"secrets",
|
|
27966
|
-
"password",
|
|
27967
|
-
"passwords",
|
|
27968
|
-
"pwd",
|
|
27969
|
-
"credential",
|
|
27970
|
-
"credentials",
|
|
27971
|
-
"auth",
|
|
27972
|
-
"authentication",
|
|
27973
|
-
"authorization",
|
|
27974
|
-
"authority",
|
|
27975
|
-
"cert",
|
|
27976
|
-
"certificate",
|
|
27977
|
-
"certificates"
|
|
27978
|
-
]);
|
|
27979
|
-
var SENSITIVE_KEY_PREFIXES = new Set([
|
|
27980
|
-
"api",
|
|
27981
|
-
"access",
|
|
27982
|
-
"client",
|
|
27983
|
-
"private",
|
|
27984
|
-
"public",
|
|
27985
|
-
"signing",
|
|
27986
|
-
"encryption",
|
|
27987
|
-
"session",
|
|
27988
|
-
"master",
|
|
27989
|
-
"shared",
|
|
27990
|
-
"root",
|
|
27991
|
-
"ssh",
|
|
27992
|
-
"rsa",
|
|
27993
|
-
"aes",
|
|
27994
|
-
"hmac",
|
|
27995
|
-
"oauth"
|
|
27996
|
-
]);
|
|
27997
|
-
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;
|
|
27998
|
-
var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
27999
|
-
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
28000
|
-
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
28001
|
-
var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
28002
|
-
var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
28003
|
-
var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
|
|
28004
|
-
function shortHash(input) {
|
|
28005
|
-
let hash = 2166136261;
|
|
28006
|
-
for (let i = 0;i < input.length; i++) {
|
|
28007
|
-
hash ^= input.charCodeAt(i);
|
|
28008
|
-
hash = Math.imul(hash, 16777619);
|
|
28009
|
-
}
|
|
28010
|
-
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
28011
|
-
}
|
|
28012
|
-
function redactUrl(raw) {
|
|
28013
|
-
try {
|
|
28014
|
-
const url = new URL(raw);
|
|
28015
|
-
return `${url.protocol}//${url.host}`;
|
|
28016
|
-
} catch {
|
|
28017
|
-
return `url#${shortHash(raw)}`;
|
|
28018
|
-
}
|
|
28019
|
-
}
|
|
28020
|
-
function redactValueDetectors(value) {
|
|
28021
|
-
let out = value;
|
|
28022
|
-
out = out.replace(JWT_PATTERN, () => REDACTED);
|
|
28023
|
-
out = out.replace(URL_PATTERN, (match) => {
|
|
28024
|
-
const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
|
|
28025
|
-
const core2 = trailing ? match.slice(0, -trailing.length) : match;
|
|
28026
|
-
return `${redactUrl(core2)}${trailing}`;
|
|
28027
|
-
});
|
|
28028
|
-
out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
28029
|
-
out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
|
|
28030
|
-
out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
|
|
28031
|
-
out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
|
|
28032
|
-
if (out.length > MAX_VALUE_LENGTH) {
|
|
28033
|
-
out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
|
|
28034
|
-
}
|
|
28035
|
-
return out;
|
|
28036
|
-
}
|
|
28037
|
-
function nameTokens(name) {
|
|
28038
|
-
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);
|
|
28039
|
-
}
|
|
28040
|
-
function isSensitiveName(name) {
|
|
28041
|
-
const tokens = nameTokens(name);
|
|
28042
|
-
for (let i = 0;i < tokens.length; i++) {
|
|
28043
|
-
const token = tokens[i];
|
|
28044
|
-
if (SENSITIVE_NAME_TOKENS.has(token)) {
|
|
28045
|
-
return true;
|
|
28046
|
-
}
|
|
28047
|
-
if (token === "key" || token === "keys") {
|
|
28048
|
-
const prev = tokens[i - 1];
|
|
28049
|
-
if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
|
|
28050
|
-
return true;
|
|
28051
|
-
}
|
|
28052
|
-
}
|
|
28053
|
-
}
|
|
28054
|
-
return false;
|
|
28055
|
-
}
|
|
28056
|
-
function redactProperty(name, value) {
|
|
28057
|
-
if (value === undefined || value === null) {
|
|
28058
|
-
return;
|
|
28059
|
-
}
|
|
28060
|
-
if (isSensitiveName(name)) {
|
|
28061
|
-
return REDACTED;
|
|
28062
|
-
}
|
|
28063
|
-
if (typeof value === "boolean" || typeof value === "number") {
|
|
28064
|
-
return value;
|
|
28065
|
-
}
|
|
28066
|
-
if (typeof value !== "string") {
|
|
28067
|
-
return "[OBJECT]";
|
|
28068
|
-
}
|
|
28069
|
-
return redactValueDetectors(value);
|
|
28070
|
-
}
|
|
28071
|
-
function redactProperties(properties) {
|
|
28072
|
-
const out = {};
|
|
28073
|
-
for (const [name, value] of Object.entries(properties)) {
|
|
28074
|
-
const redacted = redactProperty(name, value);
|
|
28075
|
-
if (redacted !== undefined) {
|
|
28076
|
-
out[name] = redacted;
|
|
28077
|
-
}
|
|
28078
|
-
}
|
|
28079
|
-
return out;
|
|
28080
|
-
}
|
|
28081
|
-
|
|
28082
28186
|
// ../common/src/trackedAction.ts
|
|
28083
28187
|
var pollSignalSlot = singleton("PollSignal");
|
|
28084
28188
|
var cliErrorCodeValues = new Set(CLI_ERROR_CODES);
|
|
28085
28189
|
var retryHintValues = new Set(RETRY_HINTS);
|
|
28190
|
+
var TELEMETRY_COMMAND_ARG_PREFIX = "uip.cmd.arg.";
|
|
28086
28191
|
var processContext = {
|
|
28087
28192
|
exit: (code) => {
|
|
28088
28193
|
process.exitCode = code;
|
|
@@ -28093,22 +28198,18 @@ var processContext = {
|
|
|
28093
28198
|
};
|
|
28094
28199
|
function extractCommandParams(cmd) {
|
|
28095
28200
|
const params = {};
|
|
28201
|
+
const add2 = (name, value) => {
|
|
28202
|
+
if (name && value !== undefined) {
|
|
28203
|
+
params[`${TELEMETRY_COMMAND_ARG_PREFIX}${name}`] = value;
|
|
28204
|
+
}
|
|
28205
|
+
};
|
|
28096
28206
|
const registered = cmd.registeredArguments ?? [];
|
|
28097
28207
|
const processed = cmd.processedArgs ?? [];
|
|
28098
28208
|
for (let i = 0;i < registered.length; i++) {
|
|
28099
|
-
|
|
28100
|
-
if (value === undefined) {
|
|
28101
|
-
continue;
|
|
28102
|
-
}
|
|
28103
|
-
const name = registered[i].name();
|
|
28104
|
-
if (name) {
|
|
28105
|
-
params[name] = value;
|
|
28106
|
-
}
|
|
28209
|
+
add2(registered[i].name(), processed[i]);
|
|
28107
28210
|
}
|
|
28108
28211
|
for (const [key, value] of Object.entries(cmd.opts())) {
|
|
28109
|
-
|
|
28110
|
-
params[key] = value;
|
|
28111
|
-
}
|
|
28212
|
+
add2(key, value);
|
|
28112
28213
|
}
|
|
28113
28214
|
return params;
|
|
28114
28215
|
}
|
|
@@ -28151,11 +28252,12 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
28151
28252
|
return this.action(async (...args) => {
|
|
28152
28253
|
const telemetryName = deriveCommandPath(command);
|
|
28153
28254
|
const props = typeof properties === "function" ? properties(...args) : properties;
|
|
28255
|
+
const requestContext = telemetry.createRequestContext();
|
|
28154
28256
|
const startTime = performance.now();
|
|
28155
28257
|
let errorMessage;
|
|
28156
28258
|
let fallbackExitCode = EXIT_CODES.Success;
|
|
28157
28259
|
clearRecordedCommandFailureTelemetry();
|
|
28158
|
-
const [error] = await catchError(fn(...args));
|
|
28260
|
+
const [error] = await catchError(telemetry.runWithContext(requestContext, () => fn(...args)));
|
|
28159
28261
|
if (error) {
|
|
28160
28262
|
errorMessage = error instanceof Error ? error.message : String(error);
|
|
28161
28263
|
logger.debug(`[trackedAction] ${telemetryName} failed: ${errorMessage}`);
|
|
@@ -28191,16 +28293,21 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
28191
28293
|
recordedFailure,
|
|
28192
28294
|
pollSignal: context.pollSignal
|
|
28193
28295
|
});
|
|
28194
|
-
|
|
28195
|
-
|
|
28296
|
+
const commandParams = extractCommandParams(command);
|
|
28297
|
+
if (props) {
|
|
28298
|
+
for (const key of Object.keys(props)) {
|
|
28299
|
+
delete commandParams[`${TELEMETRY_COMMAND_ARG_PREFIX}${key}`];
|
|
28300
|
+
}
|
|
28301
|
+
}
|
|
28302
|
+
const baseProperties = redactProperties({
|
|
28303
|
+
...commandParams,
|
|
28196
28304
|
...props,
|
|
28197
28305
|
...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
|
|
28198
28306
|
command: "true",
|
|
28199
|
-
duration: String(durationMs),
|
|
28200
|
-
success: String(success),
|
|
28201
28307
|
...terminalTelemetry,
|
|
28202
28308
|
...errorMessage ? { errorMessage } : {}
|
|
28203
|
-
})
|
|
28309
|
+
});
|
|
28310
|
+
telemetry.trackRequestResult(telemetryName, durationMs, success, baseProperties, requestContext);
|
|
28204
28311
|
});
|
|
28205
28312
|
};
|
|
28206
28313
|
// ../common/src/console-guard.ts
|
|
@@ -30102,4 +30209,4 @@ export {
|
|
|
30102
30209
|
metadata
|
|
30103
30210
|
};
|
|
30104
30211
|
|
|
30105
|
-
//# debugId=
|
|
30212
|
+
//# debugId=3A4CE4EA79D9034564756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/pm-tool",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "1.198.0
|
|
4
|
+
"version": "1.198.0",
|
|
5
5
|
"description": "Process Mining — process apps, transformations, and data ingestion.",
|
|
6
6
|
"private": false,
|
|
7
7
|
"repository": {
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"files": [
|
|
27
27
|
"dist"
|
|
28
28
|
],
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "1fadf03d7a8dd102742571dff569fdac11808afb"
|
|
30
30
|
}
|