@uipath/pm-tool 1.199.0-preview.92 → 1.199.0-preview.97
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.199.0-preview.
|
|
21233
|
+
version: "1.199.0-preview.97",
|
|
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
|
|
@@ -27956,134 +28184,11 @@ function buildCommandTelemetryAttribution(commandPath, skillSource) {
|
|
|
27956
28184
|
};
|
|
27957
28185
|
}
|
|
27958
28186
|
|
|
27959
|
-
// ../common/src/telemetry/pii-redactor.ts
|
|
27960
|
-
var REDACTED = "[REDACTED]";
|
|
27961
|
-
var MAX_VALUE_LENGTH = 200;
|
|
27962
|
-
var SENSITIVE_NAME_TOKENS = new Set([
|
|
27963
|
-
"token",
|
|
27964
|
-
"tokens",
|
|
27965
|
-
"secret",
|
|
27966
|
-
"secrets",
|
|
27967
|
-
"password",
|
|
27968
|
-
"passwords",
|
|
27969
|
-
"pwd",
|
|
27970
|
-
"credential",
|
|
27971
|
-
"credentials",
|
|
27972
|
-
"auth",
|
|
27973
|
-
"authentication",
|
|
27974
|
-
"authorization",
|
|
27975
|
-
"authority",
|
|
27976
|
-
"cert",
|
|
27977
|
-
"certificate",
|
|
27978
|
-
"certificates"
|
|
27979
|
-
]);
|
|
27980
|
-
var SENSITIVE_KEY_PREFIXES = new Set([
|
|
27981
|
-
"api",
|
|
27982
|
-
"access",
|
|
27983
|
-
"client",
|
|
27984
|
-
"private",
|
|
27985
|
-
"public",
|
|
27986
|
-
"signing",
|
|
27987
|
-
"encryption",
|
|
27988
|
-
"session",
|
|
27989
|
-
"master",
|
|
27990
|
-
"shared",
|
|
27991
|
-
"root",
|
|
27992
|
-
"ssh",
|
|
27993
|
-
"rsa",
|
|
27994
|
-
"aes",
|
|
27995
|
-
"hmac",
|
|
27996
|
-
"oauth"
|
|
27997
|
-
]);
|
|
27998
|
-
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;
|
|
27999
|
-
var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
28000
|
-
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
28001
|
-
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
28002
|
-
var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
28003
|
-
var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
28004
|
-
var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
|
|
28005
|
-
function shortHash(input) {
|
|
28006
|
-
let hash = 2166136261;
|
|
28007
|
-
for (let i = 0;i < input.length; i++) {
|
|
28008
|
-
hash ^= input.charCodeAt(i);
|
|
28009
|
-
hash = Math.imul(hash, 16777619);
|
|
28010
|
-
}
|
|
28011
|
-
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
28012
|
-
}
|
|
28013
|
-
function redactUrl(raw) {
|
|
28014
|
-
try {
|
|
28015
|
-
const url = new URL(raw);
|
|
28016
|
-
return `${url.protocol}//${url.host}`;
|
|
28017
|
-
} catch {
|
|
28018
|
-
return `url#${shortHash(raw)}`;
|
|
28019
|
-
}
|
|
28020
|
-
}
|
|
28021
|
-
function redactValueDetectors(value) {
|
|
28022
|
-
let out = value;
|
|
28023
|
-
out = out.replace(JWT_PATTERN, () => REDACTED);
|
|
28024
|
-
out = out.replace(URL_PATTERN, (match) => {
|
|
28025
|
-
const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
|
|
28026
|
-
const core2 = trailing ? match.slice(0, -trailing.length) : match;
|
|
28027
|
-
return `${redactUrl(core2)}${trailing}`;
|
|
28028
|
-
});
|
|
28029
|
-
out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
28030
|
-
out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
|
|
28031
|
-
out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
|
|
28032
|
-
out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
|
|
28033
|
-
if (out.length > MAX_VALUE_LENGTH) {
|
|
28034
|
-
out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
|
|
28035
|
-
}
|
|
28036
|
-
return out;
|
|
28037
|
-
}
|
|
28038
|
-
function nameTokens(name) {
|
|
28039
|
-
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);
|
|
28040
|
-
}
|
|
28041
|
-
function isSensitiveName(name) {
|
|
28042
|
-
const tokens = nameTokens(name);
|
|
28043
|
-
for (let i = 0;i < tokens.length; i++) {
|
|
28044
|
-
const token = tokens[i];
|
|
28045
|
-
if (SENSITIVE_NAME_TOKENS.has(token)) {
|
|
28046
|
-
return true;
|
|
28047
|
-
}
|
|
28048
|
-
if (token === "key" || token === "keys") {
|
|
28049
|
-
const prev = tokens[i - 1];
|
|
28050
|
-
if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
|
|
28051
|
-
return true;
|
|
28052
|
-
}
|
|
28053
|
-
}
|
|
28054
|
-
}
|
|
28055
|
-
return false;
|
|
28056
|
-
}
|
|
28057
|
-
function redactProperty(name, value) {
|
|
28058
|
-
if (value === undefined || value === null) {
|
|
28059
|
-
return;
|
|
28060
|
-
}
|
|
28061
|
-
if (isSensitiveName(name)) {
|
|
28062
|
-
return REDACTED;
|
|
28063
|
-
}
|
|
28064
|
-
if (typeof value === "boolean" || typeof value === "number") {
|
|
28065
|
-
return value;
|
|
28066
|
-
}
|
|
28067
|
-
if (typeof value !== "string") {
|
|
28068
|
-
return "[OBJECT]";
|
|
28069
|
-
}
|
|
28070
|
-
return redactValueDetectors(value);
|
|
28071
|
-
}
|
|
28072
|
-
function redactProperties(properties) {
|
|
28073
|
-
const out = {};
|
|
28074
|
-
for (const [name, value] of Object.entries(properties)) {
|
|
28075
|
-
const redacted = redactProperty(name, value);
|
|
28076
|
-
if (redacted !== undefined) {
|
|
28077
|
-
out[name] = redacted;
|
|
28078
|
-
}
|
|
28079
|
-
}
|
|
28080
|
-
return out;
|
|
28081
|
-
}
|
|
28082
|
-
|
|
28083
28187
|
// ../common/src/trackedAction.ts
|
|
28084
28188
|
var pollSignalSlot = singleton("PollSignal");
|
|
28085
28189
|
var cliErrorCodeValues = new Set(CLI_ERROR_CODES);
|
|
28086
28190
|
var retryHintValues = new Set(RETRY_HINTS);
|
|
28191
|
+
var TELEMETRY_COMMAND_ARG_PREFIX = "uip.cmd.arg.";
|
|
28087
28192
|
var processContext = {
|
|
28088
28193
|
exit: (code) => {
|
|
28089
28194
|
process.exitCode = code;
|
|
@@ -28094,22 +28199,18 @@ var processContext = {
|
|
|
28094
28199
|
};
|
|
28095
28200
|
function extractCommandParams(cmd) {
|
|
28096
28201
|
const params = {};
|
|
28202
|
+
const add2 = (name, value) => {
|
|
28203
|
+
if (name && value !== undefined) {
|
|
28204
|
+
params[`${TELEMETRY_COMMAND_ARG_PREFIX}${name}`] = value;
|
|
28205
|
+
}
|
|
28206
|
+
};
|
|
28097
28207
|
const registered = cmd.registeredArguments ?? [];
|
|
28098
28208
|
const processed = cmd.processedArgs ?? [];
|
|
28099
28209
|
for (let i = 0;i < registered.length; i++) {
|
|
28100
|
-
|
|
28101
|
-
if (value === undefined) {
|
|
28102
|
-
continue;
|
|
28103
|
-
}
|
|
28104
|
-
const name = registered[i].name();
|
|
28105
|
-
if (name) {
|
|
28106
|
-
params[name] = value;
|
|
28107
|
-
}
|
|
28210
|
+
add2(registered[i].name(), processed[i]);
|
|
28108
28211
|
}
|
|
28109
28212
|
for (const [key, value] of Object.entries(cmd.opts())) {
|
|
28110
|
-
|
|
28111
|
-
params[key] = value;
|
|
28112
|
-
}
|
|
28213
|
+
add2(key, value);
|
|
28113
28214
|
}
|
|
28114
28215
|
return params;
|
|
28115
28216
|
}
|
|
@@ -28152,11 +28253,12 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
28152
28253
|
return this.action(async (...args) => {
|
|
28153
28254
|
const telemetryName = deriveCommandPath(command);
|
|
28154
28255
|
const props = typeof properties === "function" ? properties(...args) : properties;
|
|
28256
|
+
const requestContext = telemetry.createRequestContext();
|
|
28155
28257
|
const startTime = performance.now();
|
|
28156
28258
|
let errorMessage;
|
|
28157
28259
|
let fallbackExitCode = EXIT_CODES.Success;
|
|
28158
28260
|
clearRecordedCommandFailureTelemetry();
|
|
28159
|
-
const [error] = await catchError(fn(...args));
|
|
28261
|
+
const [error] = await catchError(telemetry.runWithContext(requestContext, () => fn(...args)));
|
|
28160
28262
|
if (error) {
|
|
28161
28263
|
errorMessage = error instanceof Error ? error.message : String(error);
|
|
28162
28264
|
logger.debug(`[trackedAction] ${telemetryName} failed: ${errorMessage}`);
|
|
@@ -28192,16 +28294,21 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
28192
28294
|
recordedFailure,
|
|
28193
28295
|
pollSignal: context.pollSignal
|
|
28194
28296
|
});
|
|
28195
|
-
|
|
28196
|
-
|
|
28297
|
+
const commandParams = extractCommandParams(command);
|
|
28298
|
+
if (props) {
|
|
28299
|
+
for (const key of Object.keys(props)) {
|
|
28300
|
+
delete commandParams[`${TELEMETRY_COMMAND_ARG_PREFIX}${key}`];
|
|
28301
|
+
}
|
|
28302
|
+
}
|
|
28303
|
+
const baseProperties = redactProperties({
|
|
28304
|
+
...commandParams,
|
|
28197
28305
|
...props,
|
|
28198
28306
|
...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
|
|
28199
28307
|
command: "true",
|
|
28200
|
-
duration: String(durationMs),
|
|
28201
|
-
success: String(success),
|
|
28202
28308
|
...terminalTelemetry,
|
|
28203
28309
|
...errorMessage ? { errorMessage } : {}
|
|
28204
|
-
})
|
|
28310
|
+
});
|
|
28311
|
+
telemetry.trackRequestResult(telemetryName, durationMs, success, baseProperties, requestContext);
|
|
28205
28312
|
});
|
|
28206
28313
|
};
|
|
28207
28314
|
|
|
@@ -30345,4 +30452,4 @@ export {
|
|
|
30345
30452
|
metadata
|
|
30346
30453
|
};
|
|
30347
30454
|
|
|
30348
|
-
//# debugId=
|
|
30455
|
+
//# debugId=88E77E23B4FDD26D64756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/pm-tool",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "1.199.0-preview.
|
|
4
|
+
"version": "1.199.0-preview.97",
|
|
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": "087ae21e842f27bde5eb0013892c9487bfe60568"
|
|
30
30
|
}
|