@uipath/case-tool 1.199.0-preview.91 → 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 +510 -299
- package/package.json +2 -2
package/dist/tool.js
CHANGED
|
@@ -284997,7 +284997,7 @@ import"./packager-tool.js";
|
|
|
284997
284997
|
var package_default = {
|
|
284998
284998
|
name: "@uipath/case-tool",
|
|
284999
284999
|
license: "MIT",
|
|
285000
|
-
version: "1.199.0-preview.
|
|
285000
|
+
version: "1.199.0-preview.97",
|
|
285001
285001
|
description: "Manage Case Management instances, processes, and incidents.",
|
|
285002
285002
|
private: false,
|
|
285003
285003
|
repository: {
|
|
@@ -291194,11 +291194,36 @@ class NodeContextStorage {
|
|
|
291194
291194
|
return this.storage.getStore();
|
|
291195
291195
|
}
|
|
291196
291196
|
}
|
|
291197
|
+
// ../common/src/telemetry/trace-context.ts
|
|
291198
|
+
var TELEMETRY_TRACEPARENT_ENV = "TRACEPARENT";
|
|
291199
|
+
var TRACEPARENT_PATTERN = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/;
|
|
291200
|
+
function getProcessEnv() {
|
|
291201
|
+
return globalThis.process?.env;
|
|
291202
|
+
}
|
|
291203
|
+
function parseInboundTraceparent(value) {
|
|
291204
|
+
if (!value) {
|
|
291205
|
+
return;
|
|
291206
|
+
}
|
|
291207
|
+
const match = TRACEPARENT_PATTERN.exec(value.trim().toLowerCase());
|
|
291208
|
+
if (!match) {
|
|
291209
|
+
return;
|
|
291210
|
+
}
|
|
291211
|
+
const [, traceId, parentSpanId] = match;
|
|
291212
|
+
if (/^0+$/.test(traceId) || /^0+$/.test(parentSpanId)) {
|
|
291213
|
+
return;
|
|
291214
|
+
}
|
|
291215
|
+
return { traceId, parentSpanId };
|
|
291216
|
+
}
|
|
291217
|
+
function getInboundTraceContext() {
|
|
291218
|
+
return parseInboundTraceparent(getProcessEnv()?.[TELEMETRY_TRACEPARENT_ENV]);
|
|
291219
|
+
}
|
|
291220
|
+
|
|
291197
291221
|
// ../common/src/telemetry/session-id.ts
|
|
291198
291222
|
var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
|
|
291199
291223
|
var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
|
|
291200
291224
|
var telemetrySessionIdSlot = singleton("TelemetrySessionId");
|
|
291201
|
-
|
|
291225
|
+
var telemetryOperationIdSlot = singleton("TelemetryOperationId");
|
|
291226
|
+
function getProcessEnv2() {
|
|
291202
291227
|
return globalThis.process?.env;
|
|
291203
291228
|
}
|
|
291204
291229
|
function normalizeSessionId(value) {
|
|
@@ -291209,18 +291234,165 @@ function normalizeSessionId(value) {
|
|
|
291209
291234
|
return trimmed || undefined;
|
|
291210
291235
|
}
|
|
291211
291236
|
function getConfiguredTelemetrySessionId() {
|
|
291212
|
-
return normalizeSessionId(
|
|
291237
|
+
return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
|
|
291213
291238
|
}
|
|
291214
291239
|
function resolveTelemetrySessionId(existingSessionId) {
|
|
291215
291240
|
return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
|
|
291216
291241
|
}
|
|
291242
|
+
function getTelemetryOperationId() {
|
|
291243
|
+
const existing = telemetryOperationIdSlot.get();
|
|
291244
|
+
if (existing) {
|
|
291245
|
+
return existing;
|
|
291246
|
+
}
|
|
291247
|
+
const inboundTraceId = getInboundTraceContext()?.traceId;
|
|
291248
|
+
const generated = inboundTraceId ?? crypto.randomUUID().replaceAll("-", "");
|
|
291249
|
+
telemetryOperationIdSlot.set(generated);
|
|
291250
|
+
return generated;
|
|
291251
|
+
}
|
|
291217
291252
|
// ../common/src/telemetry/global-telemetry-properties.ts
|
|
291218
291253
|
var telemetryPropsSlot = singleton("TelemetryDefaultProps");
|
|
291219
291254
|
function getGlobalTelemetryProperties() {
|
|
291220
291255
|
return telemetryPropsSlot.get();
|
|
291221
291256
|
}
|
|
291222
291257
|
|
|
291258
|
+
// ../common/src/telemetry/pii-redactor.ts
|
|
291259
|
+
var REDACTED = "[REDACTED]";
|
|
291260
|
+
var MAX_VALUE_LENGTH = 200;
|
|
291261
|
+
var SENSITIVE_NAME_TOKENS = new Set([
|
|
291262
|
+
"token",
|
|
291263
|
+
"tokens",
|
|
291264
|
+
"secret",
|
|
291265
|
+
"secrets",
|
|
291266
|
+
"password",
|
|
291267
|
+
"passwords",
|
|
291268
|
+
"pwd",
|
|
291269
|
+
"credential",
|
|
291270
|
+
"credentials",
|
|
291271
|
+
"auth",
|
|
291272
|
+
"authentication",
|
|
291273
|
+
"authorization",
|
|
291274
|
+
"authority",
|
|
291275
|
+
"cert",
|
|
291276
|
+
"certificate",
|
|
291277
|
+
"certificates"
|
|
291278
|
+
]);
|
|
291279
|
+
var SENSITIVE_KEY_PREFIXES = new Set([
|
|
291280
|
+
"api",
|
|
291281
|
+
"access",
|
|
291282
|
+
"client",
|
|
291283
|
+
"private",
|
|
291284
|
+
"public",
|
|
291285
|
+
"signing",
|
|
291286
|
+
"encryption",
|
|
291287
|
+
"session",
|
|
291288
|
+
"master",
|
|
291289
|
+
"shared",
|
|
291290
|
+
"root",
|
|
291291
|
+
"ssh",
|
|
291292
|
+
"rsa",
|
|
291293
|
+
"aes",
|
|
291294
|
+
"hmac",
|
|
291295
|
+
"oauth"
|
|
291296
|
+
]);
|
|
291297
|
+
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;
|
|
291298
|
+
var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
291299
|
+
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
291300
|
+
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
291301
|
+
var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
291302
|
+
var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
291303
|
+
var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
|
|
291304
|
+
function shortHash(input) {
|
|
291305
|
+
let hash = 2166136261;
|
|
291306
|
+
for (let i = 0;i < input.length; i++) {
|
|
291307
|
+
hash ^= input.charCodeAt(i);
|
|
291308
|
+
hash = Math.imul(hash, 16777619);
|
|
291309
|
+
}
|
|
291310
|
+
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
291311
|
+
}
|
|
291312
|
+
function redactUrl(raw) {
|
|
291313
|
+
try {
|
|
291314
|
+
const url = new URL(raw);
|
|
291315
|
+
return `${url.protocol}//${url.host}`;
|
|
291316
|
+
} catch {
|
|
291317
|
+
return `url#${shortHash(raw)}`;
|
|
291318
|
+
}
|
|
291319
|
+
}
|
|
291320
|
+
function redactValueDetectors(value) {
|
|
291321
|
+
let out = value;
|
|
291322
|
+
out = out.replace(JWT_PATTERN, () => REDACTED);
|
|
291323
|
+
out = out.replace(URL_PATTERN, (match) => {
|
|
291324
|
+
const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
|
|
291325
|
+
const core2 = trailing ? match.slice(0, -trailing.length) : match;
|
|
291326
|
+
return `${redactUrl(core2)}${trailing}`;
|
|
291327
|
+
});
|
|
291328
|
+
out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
291329
|
+
out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
|
|
291330
|
+
out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
|
|
291331
|
+
out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
|
|
291332
|
+
if (out.length > MAX_VALUE_LENGTH) {
|
|
291333
|
+
out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
|
|
291334
|
+
}
|
|
291335
|
+
return out;
|
|
291336
|
+
}
|
|
291337
|
+
function redactValue(value) {
|
|
291338
|
+
return redactValueDetectors(value);
|
|
291339
|
+
}
|
|
291340
|
+
function redactError(error) {
|
|
291341
|
+
const safe = new Error(redactValueDetectors(error.message ?? ""));
|
|
291342
|
+
safe.name = error.name;
|
|
291343
|
+
safe.stack = typeof error.stack === "string" ? redactValueDetectors(error.stack) : undefined;
|
|
291344
|
+
return safe;
|
|
291345
|
+
}
|
|
291346
|
+
function nameTokens(name2) {
|
|
291347
|
+
return name2.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);
|
|
291348
|
+
}
|
|
291349
|
+
function isSensitiveName(name2) {
|
|
291350
|
+
const tokens = nameTokens(name2);
|
|
291351
|
+
for (let i = 0;i < tokens.length; i++) {
|
|
291352
|
+
const token = tokens[i];
|
|
291353
|
+
if (SENSITIVE_NAME_TOKENS.has(token)) {
|
|
291354
|
+
return true;
|
|
291355
|
+
}
|
|
291356
|
+
if (token === "key" || token === "keys") {
|
|
291357
|
+
const prev = tokens[i - 1];
|
|
291358
|
+
if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
|
|
291359
|
+
return true;
|
|
291360
|
+
}
|
|
291361
|
+
}
|
|
291362
|
+
}
|
|
291363
|
+
return false;
|
|
291364
|
+
}
|
|
291365
|
+
function redactProperty(name2, value) {
|
|
291366
|
+
if (value === undefined || value === null) {
|
|
291367
|
+
return;
|
|
291368
|
+
}
|
|
291369
|
+
if (isSensitiveName(name2)) {
|
|
291370
|
+
return REDACTED;
|
|
291371
|
+
}
|
|
291372
|
+
if (typeof value === "boolean" || typeof value === "number") {
|
|
291373
|
+
return value;
|
|
291374
|
+
}
|
|
291375
|
+
if (typeof value !== "string") {
|
|
291376
|
+
return "[OBJECT]";
|
|
291377
|
+
}
|
|
291378
|
+
return redactValueDetectors(value);
|
|
291379
|
+
}
|
|
291380
|
+
function redactProperties(properties) {
|
|
291381
|
+
const out = {};
|
|
291382
|
+
for (const [name2, value] of Object.entries(properties)) {
|
|
291383
|
+
const redacted = redactProperty(name2, value);
|
|
291384
|
+
if (redacted !== undefined) {
|
|
291385
|
+
out[name2] = redacted;
|
|
291386
|
+
}
|
|
291387
|
+
}
|
|
291388
|
+
return out;
|
|
291389
|
+
}
|
|
291390
|
+
|
|
291223
291391
|
// ../common/src/telemetry/telemetry-service.ts
|
|
291392
|
+
var TELEMETRY_OPERATION_ID_PROPERTY = "uip.trace.operation_id";
|
|
291393
|
+
var TELEMETRY_PARENT_ID_PROPERTY = "uip.trace.parent_id";
|
|
291394
|
+
var TELEMETRY_SPAN_ID_PROPERTY = "uip.trace.span_id";
|
|
291395
|
+
|
|
291224
291396
|
class TelemetryService {
|
|
291225
291397
|
telemetryProvider;
|
|
291226
291398
|
contextStorage;
|
|
@@ -291247,11 +291419,15 @@ class TelemetryService {
|
|
|
291247
291419
|
trackException(error, properties) {
|
|
291248
291420
|
const context = this.getCurrentContext();
|
|
291249
291421
|
const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
|
|
291250
|
-
this.telemetryProvider.trackException(error, enrichedProperties);
|
|
291422
|
+
this.telemetryProvider.trackException(redactError(error), enrichedProperties);
|
|
291251
291423
|
}
|
|
291252
291424
|
async trackRequest(name2, fn, properties) {
|
|
291425
|
+
const parentContext = this.getCurrentContext();
|
|
291426
|
+
const operationId = parentContext?.operationId ?? this.operationId ?? getTelemetryOperationId();
|
|
291427
|
+
const parentId = parentContext ? parentContext.id : this.inboundParentIdFor(operationId);
|
|
291253
291428
|
const context = {
|
|
291254
|
-
operationId
|
|
291429
|
+
operationId,
|
|
291430
|
+
...parentId !== undefined ? { parentId } : {},
|
|
291255
291431
|
id: this.generateId()
|
|
291256
291432
|
};
|
|
291257
291433
|
const startTime = performance.now();
|
|
@@ -291269,6 +291445,45 @@ class TelemetryService {
|
|
|
291269
291445
|
throw error;
|
|
291270
291446
|
}
|
|
291271
291447
|
}
|
|
291448
|
+
trackRequestResult(name2, durationMs, success, properties, context) {
|
|
291449
|
+
const requestContext = context ?? {
|
|
291450
|
+
operationId: this.operationId ?? getTelemetryOperationId(),
|
|
291451
|
+
id: this.generateId()
|
|
291452
|
+
};
|
|
291453
|
+
const enrichedProperties = this.enrichPropertiesWithContext(properties, requestContext);
|
|
291454
|
+
this.telemetryProvider.trackRequest(name2, durationMs, success, enrichedProperties);
|
|
291455
|
+
}
|
|
291456
|
+
createRequestContext() {
|
|
291457
|
+
const operationId = this.operationId ?? getTelemetryOperationId();
|
|
291458
|
+
const parentId = this.inboundParentIdFor(operationId);
|
|
291459
|
+
return {
|
|
291460
|
+
operationId,
|
|
291461
|
+
...parentId !== undefined ? { parentId } : {},
|
|
291462
|
+
id: this.generateId()
|
|
291463
|
+
};
|
|
291464
|
+
}
|
|
291465
|
+
inboundParentIdFor(operationId) {
|
|
291466
|
+
const inbound = getInboundTraceContext();
|
|
291467
|
+
return inbound && inbound.traceId === operationId ? inbound.parentSpanId : undefined;
|
|
291468
|
+
}
|
|
291469
|
+
runWithContext(context, fn) {
|
|
291470
|
+
return this.contextStorage.run(context, fn);
|
|
291471
|
+
}
|
|
291472
|
+
createDependencyContext() {
|
|
291473
|
+
const parentContext = this.getCurrentContext();
|
|
291474
|
+
if (!parentContext) {
|
|
291475
|
+
return;
|
|
291476
|
+
}
|
|
291477
|
+
return {
|
|
291478
|
+
operationId: parentContext.operationId,
|
|
291479
|
+
parentId: parentContext.id,
|
|
291480
|
+
id: this.generateId()
|
|
291481
|
+
};
|
|
291482
|
+
}
|
|
291483
|
+
trackDependencyResult(name2, type2, durationMs, success, properties, context, resultCode) {
|
|
291484
|
+
const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
|
|
291485
|
+
this.telemetryProvider.trackDependency(redactValue(name2), type2, durationMs, success, enrichedProperties, resultCode);
|
|
291486
|
+
}
|
|
291272
291487
|
async trackDependencyOperation(name2, type2, fn, properties) {
|
|
291273
291488
|
const parentContext = this.getCurrentContext();
|
|
291274
291489
|
if (!parentContext) {
|
|
@@ -291305,8 +291520,12 @@ class TelemetryService {
|
|
|
291305
291520
|
...getExecutionContextTelemetryProperties(),
|
|
291306
291521
|
...globalProperties,
|
|
291307
291522
|
...this.defaultProperties,
|
|
291308
|
-
...properties,
|
|
291309
|
-
...context
|
|
291523
|
+
...redactProperties(properties ?? {}),
|
|
291524
|
+
...context ? {
|
|
291525
|
+
[TELEMETRY_OPERATION_ID_PROPERTY]: context.operationId,
|
|
291526
|
+
...context.parentId !== undefined ? { [TELEMETRY_PARENT_ID_PROPERTY]: context.parentId } : {},
|
|
291527
|
+
[TELEMETRY_SPAN_ID_PROPERTY]: context.id
|
|
291528
|
+
} : {}
|
|
291310
291529
|
};
|
|
291311
291530
|
if (sessionId === undefined) {
|
|
291312
291531
|
delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
|
|
@@ -291316,7 +291535,16 @@ class TelemetryService {
|
|
|
291316
291535
|
return enriched;
|
|
291317
291536
|
}
|
|
291318
291537
|
generateId() {
|
|
291319
|
-
|
|
291538
|
+
const bytes = new Uint8Array(8);
|
|
291539
|
+
let hex = "";
|
|
291540
|
+
do {
|
|
291541
|
+
crypto.getRandomValues(bytes);
|
|
291542
|
+
hex = "";
|
|
291543
|
+
for (const byte of bytes) {
|
|
291544
|
+
hex += byte.toString(16).padStart(2, "0");
|
|
291545
|
+
}
|
|
291546
|
+
} while (/^0+$/.test(hex));
|
|
291547
|
+
return hex;
|
|
291320
291548
|
}
|
|
291321
291549
|
}
|
|
291322
291550
|
// ../common/src/telemetry/node-appinsights-telemetry-provider.ts
|
|
@@ -292019,134 +292247,11 @@ function buildCommandTelemetryAttribution(commandPath, skillSource) {
|
|
|
292019
292247
|
};
|
|
292020
292248
|
}
|
|
292021
292249
|
|
|
292022
|
-
// ../common/src/telemetry/pii-redactor.ts
|
|
292023
|
-
var REDACTED = "[REDACTED]";
|
|
292024
|
-
var MAX_VALUE_LENGTH = 200;
|
|
292025
|
-
var SENSITIVE_NAME_TOKENS = new Set([
|
|
292026
|
-
"token",
|
|
292027
|
-
"tokens",
|
|
292028
|
-
"secret",
|
|
292029
|
-
"secrets",
|
|
292030
|
-
"password",
|
|
292031
|
-
"passwords",
|
|
292032
|
-
"pwd",
|
|
292033
|
-
"credential",
|
|
292034
|
-
"credentials",
|
|
292035
|
-
"auth",
|
|
292036
|
-
"authentication",
|
|
292037
|
-
"authorization",
|
|
292038
|
-
"authority",
|
|
292039
|
-
"cert",
|
|
292040
|
-
"certificate",
|
|
292041
|
-
"certificates"
|
|
292042
|
-
]);
|
|
292043
|
-
var SENSITIVE_KEY_PREFIXES = new Set([
|
|
292044
|
-
"api",
|
|
292045
|
-
"access",
|
|
292046
|
-
"client",
|
|
292047
|
-
"private",
|
|
292048
|
-
"public",
|
|
292049
|
-
"signing",
|
|
292050
|
-
"encryption",
|
|
292051
|
-
"session",
|
|
292052
|
-
"master",
|
|
292053
|
-
"shared",
|
|
292054
|
-
"root",
|
|
292055
|
-
"ssh",
|
|
292056
|
-
"rsa",
|
|
292057
|
-
"aes",
|
|
292058
|
-
"hmac",
|
|
292059
|
-
"oauth"
|
|
292060
|
-
]);
|
|
292061
|
-
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;
|
|
292062
|
-
var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
292063
|
-
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
292064
|
-
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
292065
|
-
var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
292066
|
-
var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
292067
|
-
var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
|
|
292068
|
-
function shortHash(input) {
|
|
292069
|
-
let hash = 2166136261;
|
|
292070
|
-
for (let i = 0;i < input.length; i++) {
|
|
292071
|
-
hash ^= input.charCodeAt(i);
|
|
292072
|
-
hash = Math.imul(hash, 16777619);
|
|
292073
|
-
}
|
|
292074
|
-
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
292075
|
-
}
|
|
292076
|
-
function redactUrl(raw) {
|
|
292077
|
-
try {
|
|
292078
|
-
const url = new URL(raw);
|
|
292079
|
-
return `${url.protocol}//${url.host}`;
|
|
292080
|
-
} catch {
|
|
292081
|
-
return `url#${shortHash(raw)}`;
|
|
292082
|
-
}
|
|
292083
|
-
}
|
|
292084
|
-
function redactValueDetectors(value) {
|
|
292085
|
-
let out = value;
|
|
292086
|
-
out = out.replace(JWT_PATTERN, () => REDACTED);
|
|
292087
|
-
out = out.replace(URL_PATTERN, (match) => {
|
|
292088
|
-
const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
|
|
292089
|
-
const core2 = trailing ? match.slice(0, -trailing.length) : match;
|
|
292090
|
-
return `${redactUrl(core2)}${trailing}`;
|
|
292091
|
-
});
|
|
292092
|
-
out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
292093
|
-
out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
|
|
292094
|
-
out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
|
|
292095
|
-
out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
|
|
292096
|
-
if (out.length > MAX_VALUE_LENGTH) {
|
|
292097
|
-
out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
|
|
292098
|
-
}
|
|
292099
|
-
return out;
|
|
292100
|
-
}
|
|
292101
|
-
function nameTokens(name2) {
|
|
292102
|
-
return name2.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);
|
|
292103
|
-
}
|
|
292104
|
-
function isSensitiveName(name2) {
|
|
292105
|
-
const tokens = nameTokens(name2);
|
|
292106
|
-
for (let i = 0;i < tokens.length; i++) {
|
|
292107
|
-
const token = tokens[i];
|
|
292108
|
-
if (SENSITIVE_NAME_TOKENS.has(token)) {
|
|
292109
|
-
return true;
|
|
292110
|
-
}
|
|
292111
|
-
if (token === "key" || token === "keys") {
|
|
292112
|
-
const prev = tokens[i - 1];
|
|
292113
|
-
if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
|
|
292114
|
-
return true;
|
|
292115
|
-
}
|
|
292116
|
-
}
|
|
292117
|
-
}
|
|
292118
|
-
return false;
|
|
292119
|
-
}
|
|
292120
|
-
function redactProperty(name2, value) {
|
|
292121
|
-
if (value === undefined || value === null) {
|
|
292122
|
-
return;
|
|
292123
|
-
}
|
|
292124
|
-
if (isSensitiveName(name2)) {
|
|
292125
|
-
return REDACTED;
|
|
292126
|
-
}
|
|
292127
|
-
if (typeof value === "boolean" || typeof value === "number") {
|
|
292128
|
-
return value;
|
|
292129
|
-
}
|
|
292130
|
-
if (typeof value !== "string") {
|
|
292131
|
-
return "[OBJECT]";
|
|
292132
|
-
}
|
|
292133
|
-
return redactValueDetectors(value);
|
|
292134
|
-
}
|
|
292135
|
-
function redactProperties(properties) {
|
|
292136
|
-
const out = {};
|
|
292137
|
-
for (const [name2, value] of Object.entries(properties)) {
|
|
292138
|
-
const redacted = redactProperty(name2, value);
|
|
292139
|
-
if (redacted !== undefined) {
|
|
292140
|
-
out[name2] = redacted;
|
|
292141
|
-
}
|
|
292142
|
-
}
|
|
292143
|
-
return out;
|
|
292144
|
-
}
|
|
292145
|
-
|
|
292146
292250
|
// ../common/src/trackedAction.ts
|
|
292147
292251
|
var pollSignalSlot = singleton("PollSignal");
|
|
292148
292252
|
var cliErrorCodeValues = new Set(CLI_ERROR_CODES);
|
|
292149
292253
|
var retryHintValues = new Set(RETRY_HINTS);
|
|
292254
|
+
var TELEMETRY_COMMAND_ARG_PREFIX = "uip.cmd.arg.";
|
|
292150
292255
|
var processContext = {
|
|
292151
292256
|
exit: (code) => {
|
|
292152
292257
|
process.exitCode = code;
|
|
@@ -292157,22 +292262,18 @@ var processContext = {
|
|
|
292157
292262
|
};
|
|
292158
292263
|
function extractCommandParams(cmd) {
|
|
292159
292264
|
const params = {};
|
|
292265
|
+
const add2 = (name2, value) => {
|
|
292266
|
+
if (name2 && value !== undefined) {
|
|
292267
|
+
params[`${TELEMETRY_COMMAND_ARG_PREFIX}${name2}`] = value;
|
|
292268
|
+
}
|
|
292269
|
+
};
|
|
292160
292270
|
const registered = cmd.registeredArguments ?? [];
|
|
292161
292271
|
const processed = cmd.processedArgs ?? [];
|
|
292162
292272
|
for (let i = 0;i < registered.length; i++) {
|
|
292163
|
-
|
|
292164
|
-
if (value === undefined) {
|
|
292165
|
-
continue;
|
|
292166
|
-
}
|
|
292167
|
-
const name2 = registered[i].name();
|
|
292168
|
-
if (name2) {
|
|
292169
|
-
params[name2] = value;
|
|
292170
|
-
}
|
|
292273
|
+
add2(registered[i].name(), processed[i]);
|
|
292171
292274
|
}
|
|
292172
292275
|
for (const [key, value] of Object.entries(cmd.opts())) {
|
|
292173
|
-
|
|
292174
|
-
params[key] = value;
|
|
292175
|
-
}
|
|
292276
|
+
add2(key, value);
|
|
292176
292277
|
}
|
|
292177
292278
|
return params;
|
|
292178
292279
|
}
|
|
@@ -292215,11 +292316,12 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
292215
292316
|
return this.action(async (...args) => {
|
|
292216
292317
|
const telemetryName = deriveCommandPath(command);
|
|
292217
292318
|
const props = typeof properties === "function" ? properties(...args) : properties;
|
|
292319
|
+
const requestContext = telemetry.createRequestContext();
|
|
292218
292320
|
const startTime = performance.now();
|
|
292219
292321
|
let errorMessage;
|
|
292220
292322
|
let fallbackExitCode = EXIT_CODES.Success;
|
|
292221
292323
|
clearRecordedCommandFailureTelemetry();
|
|
292222
|
-
const [error] = await catchError(fn(...args));
|
|
292324
|
+
const [error] = await catchError(telemetry.runWithContext(requestContext, () => fn(...args)));
|
|
292223
292325
|
if (error) {
|
|
292224
292326
|
errorMessage = error instanceof Error ? error.message : String(error);
|
|
292225
292327
|
logger.debug(`[trackedAction] ${telemetryName} failed: ${errorMessage}`);
|
|
@@ -292255,16 +292357,21 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
292255
292357
|
recordedFailure,
|
|
292256
292358
|
pollSignal: context.pollSignal
|
|
292257
292359
|
});
|
|
292258
|
-
|
|
292259
|
-
|
|
292360
|
+
const commandParams = extractCommandParams(command);
|
|
292361
|
+
if (props) {
|
|
292362
|
+
for (const key of Object.keys(props)) {
|
|
292363
|
+
delete commandParams[`${TELEMETRY_COMMAND_ARG_PREFIX}${key}`];
|
|
292364
|
+
}
|
|
292365
|
+
}
|
|
292366
|
+
const baseProperties = redactProperties({
|
|
292367
|
+
...commandParams,
|
|
292260
292368
|
...props,
|
|
292261
292369
|
...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
|
|
292262
292370
|
command: "true",
|
|
292263
|
-
duration: String(durationMs),
|
|
292264
|
-
success: String(success),
|
|
292265
292371
|
...terminalTelemetry,
|
|
292266
292372
|
...errorMessage ? { errorMessage } : {}
|
|
292267
|
-
})
|
|
292373
|
+
});
|
|
292374
|
+
telemetry.trackRequestResult(telemetryName, durationMs, success, baseProperties, requestContext);
|
|
292268
292375
|
});
|
|
292269
292376
|
};
|
|
292270
292377
|
// ../common/src/console-guard.ts
|
|
@@ -368752,7 +368859,7 @@ class TextApiResponse {
|
|
|
368752
368859
|
var package_default2 = {
|
|
368753
368860
|
name: "@uipath/integrationservice-sdk",
|
|
368754
368861
|
license: "MIT",
|
|
368755
|
-
version: "1.199.0-preview.
|
|
368862
|
+
version: "1.199.0-preview.97",
|
|
368756
368863
|
repository: {
|
|
368757
368864
|
type: "git",
|
|
368758
368865
|
url: "https://github.com/UiPath/cli.git",
|
|
@@ -382959,7 +383066,7 @@ function querystringSingleKey4(key, value, keyPrefix = "") {
|
|
|
382959
383066
|
var package_default4 = {
|
|
382960
383067
|
name: "@uipath/solution-sdk",
|
|
382961
383068
|
license: "MIT",
|
|
382962
|
-
version: "1.199.0-preview.
|
|
383069
|
+
version: "1.199.0-preview.97",
|
|
382963
383070
|
repository: {
|
|
382964
383071
|
type: "git",
|
|
382965
383072
|
url: "https://github.com/UiPath/cli.git",
|
|
@@ -414260,10 +414367,33 @@ class NodeContextStorage2 {
|
|
|
414260
414367
|
return this.storage.getStore();
|
|
414261
414368
|
}
|
|
414262
414369
|
}
|
|
414370
|
+
var TELEMETRY_TRACEPARENT_ENV2 = "TRACEPARENT";
|
|
414371
|
+
var TRACEPARENT_PATTERN2 = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/;
|
|
414372
|
+
function getProcessEnv3() {
|
|
414373
|
+
return globalThis.process?.env;
|
|
414374
|
+
}
|
|
414375
|
+
function parseInboundTraceparent2(value) {
|
|
414376
|
+
if (!value) {
|
|
414377
|
+
return;
|
|
414378
|
+
}
|
|
414379
|
+
const match = TRACEPARENT_PATTERN2.exec(value.trim().toLowerCase());
|
|
414380
|
+
if (!match) {
|
|
414381
|
+
return;
|
|
414382
|
+
}
|
|
414383
|
+
const [, traceId, parentSpanId] = match;
|
|
414384
|
+
if (/^0+$/.test(traceId) || /^0+$/.test(parentSpanId)) {
|
|
414385
|
+
return;
|
|
414386
|
+
}
|
|
414387
|
+
return { traceId, parentSpanId };
|
|
414388
|
+
}
|
|
414389
|
+
function getInboundTraceContext2() {
|
|
414390
|
+
return parseInboundTraceparent2(getProcessEnv3()?.[TELEMETRY_TRACEPARENT_ENV2]);
|
|
414391
|
+
}
|
|
414263
414392
|
var TELEMETRY_SESSION_ID_ENV2 = "UIPATH_SESSION_ID";
|
|
414264
414393
|
var TELEMETRY_SESSION_ID_PROPERTY2 = "session_id";
|
|
414265
414394
|
var telemetrySessionIdSlot2 = singleton3("TelemetrySessionId");
|
|
414266
|
-
|
|
414395
|
+
var telemetryOperationIdSlot2 = singleton3("TelemetryOperationId");
|
|
414396
|
+
function getProcessEnv22() {
|
|
414267
414397
|
return globalThis.process?.env;
|
|
414268
414398
|
}
|
|
414269
414399
|
function normalizeSessionId2(value) {
|
|
@@ -414274,15 +414404,159 @@ function normalizeSessionId2(value) {
|
|
|
414274
414404
|
return trimmed || undefined;
|
|
414275
414405
|
}
|
|
414276
414406
|
function getConfiguredTelemetrySessionId2() {
|
|
414277
|
-
return normalizeSessionId2(
|
|
414407
|
+
return normalizeSessionId2(getProcessEnv22()?.[TELEMETRY_SESSION_ID_ENV2]);
|
|
414278
414408
|
}
|
|
414279
414409
|
function resolveTelemetrySessionId2(existingSessionId) {
|
|
414280
414410
|
return getConfiguredTelemetrySessionId2() ?? normalizeSessionId2(existingSessionId);
|
|
414281
414411
|
}
|
|
414412
|
+
function getTelemetryOperationId2() {
|
|
414413
|
+
const existing = telemetryOperationIdSlot2.get();
|
|
414414
|
+
if (existing) {
|
|
414415
|
+
return existing;
|
|
414416
|
+
}
|
|
414417
|
+
const inboundTraceId = getInboundTraceContext2()?.traceId;
|
|
414418
|
+
const generated = inboundTraceId ?? crypto.randomUUID().replaceAll("-", "");
|
|
414419
|
+
telemetryOperationIdSlot2.set(generated);
|
|
414420
|
+
return generated;
|
|
414421
|
+
}
|
|
414282
414422
|
var telemetryPropsSlot2 = singleton3("TelemetryDefaultProps");
|
|
414283
414423
|
function getGlobalTelemetryProperties2() {
|
|
414284
414424
|
return telemetryPropsSlot2.get();
|
|
414285
414425
|
}
|
|
414426
|
+
var REDACTED2 = "[REDACTED]";
|
|
414427
|
+
var MAX_VALUE_LENGTH2 = 200;
|
|
414428
|
+
var SENSITIVE_NAME_TOKENS2 = new Set([
|
|
414429
|
+
"token",
|
|
414430
|
+
"tokens",
|
|
414431
|
+
"secret",
|
|
414432
|
+
"secrets",
|
|
414433
|
+
"password",
|
|
414434
|
+
"passwords",
|
|
414435
|
+
"pwd",
|
|
414436
|
+
"credential",
|
|
414437
|
+
"credentials",
|
|
414438
|
+
"auth",
|
|
414439
|
+
"authentication",
|
|
414440
|
+
"authorization",
|
|
414441
|
+
"authority",
|
|
414442
|
+
"cert",
|
|
414443
|
+
"certificate",
|
|
414444
|
+
"certificates"
|
|
414445
|
+
]);
|
|
414446
|
+
var SENSITIVE_KEY_PREFIXES2 = new Set([
|
|
414447
|
+
"api",
|
|
414448
|
+
"access",
|
|
414449
|
+
"client",
|
|
414450
|
+
"private",
|
|
414451
|
+
"public",
|
|
414452
|
+
"signing",
|
|
414453
|
+
"encryption",
|
|
414454
|
+
"session",
|
|
414455
|
+
"master",
|
|
414456
|
+
"shared",
|
|
414457
|
+
"root",
|
|
414458
|
+
"ssh",
|
|
414459
|
+
"rsa",
|
|
414460
|
+
"aes",
|
|
414461
|
+
"hmac",
|
|
414462
|
+
"oauth"
|
|
414463
|
+
]);
|
|
414464
|
+
var UUID_PATTERN2 = /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi;
|
|
414465
|
+
var EMAIL_PATTERN2 = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
414466
|
+
var JWT_PATTERN2 = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
414467
|
+
var LONG_TOKEN_PATTERN2 = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
414468
|
+
var USER_HOME_PATTERN2 = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
414469
|
+
var URL_PATTERN2 = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
414470
|
+
var URL_TRAILING_PUNCT2 = /[.,;:!?)\]}>'"]+$/;
|
|
414471
|
+
function shortHash2(input) {
|
|
414472
|
+
let hash2 = 2166136261;
|
|
414473
|
+
for (let i2 = 0;i2 < input.length; i2++) {
|
|
414474
|
+
hash2 ^= input.charCodeAt(i2);
|
|
414475
|
+
hash2 = Math.imul(hash2, 16777619);
|
|
414476
|
+
}
|
|
414477
|
+
return (hash2 >>> 0).toString(16).padStart(8, "0");
|
|
414478
|
+
}
|
|
414479
|
+
function redactUrl2(raw) {
|
|
414480
|
+
try {
|
|
414481
|
+
const url3 = new URL(raw);
|
|
414482
|
+
return `${url3.protocol}//${url3.host}`;
|
|
414483
|
+
} catch {
|
|
414484
|
+
return `url#${shortHash2(raw)}`;
|
|
414485
|
+
}
|
|
414486
|
+
}
|
|
414487
|
+
function redactValueDetectors2(value) {
|
|
414488
|
+
let out = value;
|
|
414489
|
+
out = out.replace(JWT_PATTERN2, () => REDACTED2);
|
|
414490
|
+
out = out.replace(URL_PATTERN2, (match) => {
|
|
414491
|
+
const trailing = match.match(URL_TRAILING_PUNCT2)?.[0] ?? "";
|
|
414492
|
+
const core22 = trailing ? match.slice(0, -trailing.length) : match;
|
|
414493
|
+
return `${redactUrl2(core22)}${trailing}`;
|
|
414494
|
+
});
|
|
414495
|
+
out = out.replace(USER_HOME_PATTERN2, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
414496
|
+
out = out.replace(EMAIL_PATTERN2, (match) => `email#${shortHash2(match)}`);
|
|
414497
|
+
out = out.replace(UUID_PATTERN2, (match) => `uuid#${shortHash2(match)}`);
|
|
414498
|
+
out = out.replace(LONG_TOKEN_PATTERN2, () => REDACTED2);
|
|
414499
|
+
if (out.length > MAX_VALUE_LENGTH2) {
|
|
414500
|
+
out = `${out.slice(0, MAX_VALUE_LENGTH2)}…`;
|
|
414501
|
+
}
|
|
414502
|
+
return out;
|
|
414503
|
+
}
|
|
414504
|
+
function redactValue2(value) {
|
|
414505
|
+
return redactValueDetectors2(value);
|
|
414506
|
+
}
|
|
414507
|
+
function redactError2(error90) {
|
|
414508
|
+
const safe = new Error(redactValueDetectors2(error90.message ?? ""));
|
|
414509
|
+
safe.name = error90.name;
|
|
414510
|
+
safe.stack = typeof error90.stack === "string" ? redactValueDetectors2(error90.stack) : undefined;
|
|
414511
|
+
return safe;
|
|
414512
|
+
}
|
|
414513
|
+
function nameTokens2(name2) {
|
|
414514
|
+
return name2.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").split(/[\s._-]+/).map((t13) => t13.toLowerCase()).filter(Boolean);
|
|
414515
|
+
}
|
|
414516
|
+
function isSensitiveName2(name2) {
|
|
414517
|
+
const tokens = nameTokens2(name2);
|
|
414518
|
+
for (let i2 = 0;i2 < tokens.length; i2++) {
|
|
414519
|
+
const token = tokens[i2];
|
|
414520
|
+
if (SENSITIVE_NAME_TOKENS2.has(token)) {
|
|
414521
|
+
return true;
|
|
414522
|
+
}
|
|
414523
|
+
if (token === "key" || token === "keys") {
|
|
414524
|
+
const prev = tokens[i2 - 1];
|
|
414525
|
+
if (prev && SENSITIVE_KEY_PREFIXES2.has(prev)) {
|
|
414526
|
+
return true;
|
|
414527
|
+
}
|
|
414528
|
+
}
|
|
414529
|
+
}
|
|
414530
|
+
return false;
|
|
414531
|
+
}
|
|
414532
|
+
function redactProperty2(name2, value) {
|
|
414533
|
+
if (value === undefined || value === null) {
|
|
414534
|
+
return;
|
|
414535
|
+
}
|
|
414536
|
+
if (isSensitiveName2(name2)) {
|
|
414537
|
+
return REDACTED2;
|
|
414538
|
+
}
|
|
414539
|
+
if (typeof value === "boolean" || typeof value === "number") {
|
|
414540
|
+
return value;
|
|
414541
|
+
}
|
|
414542
|
+
if (typeof value !== "string") {
|
|
414543
|
+
return "[OBJECT]";
|
|
414544
|
+
}
|
|
414545
|
+
return redactValueDetectors2(value);
|
|
414546
|
+
}
|
|
414547
|
+
function redactProperties2(properties) {
|
|
414548
|
+
const out = {};
|
|
414549
|
+
for (const [name2, value] of Object.entries(properties)) {
|
|
414550
|
+
const redacted = redactProperty2(name2, value);
|
|
414551
|
+
if (redacted !== undefined) {
|
|
414552
|
+
out[name2] = redacted;
|
|
414553
|
+
}
|
|
414554
|
+
}
|
|
414555
|
+
return out;
|
|
414556
|
+
}
|
|
414557
|
+
var TELEMETRY_OPERATION_ID_PROPERTY2 = "uip.trace.operation_id";
|
|
414558
|
+
var TELEMETRY_PARENT_ID_PROPERTY2 = "uip.trace.parent_id";
|
|
414559
|
+
var TELEMETRY_SPAN_ID_PROPERTY2 = "uip.trace.span_id";
|
|
414286
414560
|
|
|
414287
414561
|
class TelemetryService2 {
|
|
414288
414562
|
telemetryProvider;
|
|
@@ -414310,11 +414584,15 @@ class TelemetryService2 {
|
|
|
414310
414584
|
trackException(error90, properties) {
|
|
414311
414585
|
const context = this.getCurrentContext();
|
|
414312
414586
|
const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
|
|
414313
|
-
this.telemetryProvider.trackException(error90, enrichedProperties);
|
|
414587
|
+
this.telemetryProvider.trackException(redactError2(error90), enrichedProperties);
|
|
414314
414588
|
}
|
|
414315
414589
|
async trackRequest(name2, fn, properties) {
|
|
414590
|
+
const parentContext = this.getCurrentContext();
|
|
414591
|
+
const operationId = parentContext?.operationId ?? this.operationId ?? getTelemetryOperationId2();
|
|
414592
|
+
const parentId = parentContext ? parentContext.id : this.inboundParentIdFor(operationId);
|
|
414316
414593
|
const context = {
|
|
414317
|
-
operationId
|
|
414594
|
+
operationId,
|
|
414595
|
+
...parentId !== undefined ? { parentId } : {},
|
|
414318
414596
|
id: this.generateId()
|
|
414319
414597
|
};
|
|
414320
414598
|
const startTime = performance.now();
|
|
@@ -414332,6 +414610,45 @@ class TelemetryService2 {
|
|
|
414332
414610
|
throw error90;
|
|
414333
414611
|
}
|
|
414334
414612
|
}
|
|
414613
|
+
trackRequestResult(name2, durationMs, success3, properties, context) {
|
|
414614
|
+
const requestContext = context ?? {
|
|
414615
|
+
operationId: this.operationId ?? getTelemetryOperationId2(),
|
|
414616
|
+
id: this.generateId()
|
|
414617
|
+
};
|
|
414618
|
+
const enrichedProperties = this.enrichPropertiesWithContext(properties, requestContext);
|
|
414619
|
+
this.telemetryProvider.trackRequest(name2, durationMs, success3, enrichedProperties);
|
|
414620
|
+
}
|
|
414621
|
+
createRequestContext() {
|
|
414622
|
+
const operationId = this.operationId ?? getTelemetryOperationId2();
|
|
414623
|
+
const parentId = this.inboundParentIdFor(operationId);
|
|
414624
|
+
return {
|
|
414625
|
+
operationId,
|
|
414626
|
+
...parentId !== undefined ? { parentId } : {},
|
|
414627
|
+
id: this.generateId()
|
|
414628
|
+
};
|
|
414629
|
+
}
|
|
414630
|
+
inboundParentIdFor(operationId) {
|
|
414631
|
+
const inbound = getInboundTraceContext2();
|
|
414632
|
+
return inbound && inbound.traceId === operationId ? inbound.parentSpanId : undefined;
|
|
414633
|
+
}
|
|
414634
|
+
runWithContext(context, fn) {
|
|
414635
|
+
return this.contextStorage.run(context, fn);
|
|
414636
|
+
}
|
|
414637
|
+
createDependencyContext() {
|
|
414638
|
+
const parentContext = this.getCurrentContext();
|
|
414639
|
+
if (!parentContext) {
|
|
414640
|
+
return;
|
|
414641
|
+
}
|
|
414642
|
+
return {
|
|
414643
|
+
operationId: parentContext.operationId,
|
|
414644
|
+
parentId: parentContext.id,
|
|
414645
|
+
id: this.generateId()
|
|
414646
|
+
};
|
|
414647
|
+
}
|
|
414648
|
+
trackDependencyResult(name2, type22, durationMs, success3, properties, context, resultCode) {
|
|
414649
|
+
const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
|
|
414650
|
+
this.telemetryProvider.trackDependency(redactValue2(name2), type22, durationMs, success3, enrichedProperties, resultCode);
|
|
414651
|
+
}
|
|
414335
414652
|
async trackDependencyOperation(name2, type22, fn, properties) {
|
|
414336
414653
|
const parentContext = this.getCurrentContext();
|
|
414337
414654
|
if (!parentContext) {
|
|
@@ -414368,8 +414685,12 @@ class TelemetryService2 {
|
|
|
414368
414685
|
...getExecutionContextTelemetryProperties2(),
|
|
414369
414686
|
...globalProperties,
|
|
414370
414687
|
...this.defaultProperties,
|
|
414371
|
-
...properties,
|
|
414372
|
-
...context
|
|
414688
|
+
...redactProperties2(properties ?? {}),
|
|
414689
|
+
...context ? {
|
|
414690
|
+
[TELEMETRY_OPERATION_ID_PROPERTY2]: context.operationId,
|
|
414691
|
+
...context.parentId !== undefined ? { [TELEMETRY_PARENT_ID_PROPERTY2]: context.parentId } : {},
|
|
414692
|
+
[TELEMETRY_SPAN_ID_PROPERTY2]: context.id
|
|
414693
|
+
} : {}
|
|
414373
414694
|
};
|
|
414374
414695
|
if (sessionId === undefined) {
|
|
414375
414696
|
delete enriched[TELEMETRY_SESSION_ID_PROPERTY2];
|
|
@@ -414379,7 +414700,16 @@ class TelemetryService2 {
|
|
|
414379
414700
|
return enriched;
|
|
414380
414701
|
}
|
|
414381
414702
|
generateId() {
|
|
414382
|
-
|
|
414703
|
+
const bytes = new Uint8Array(8);
|
|
414704
|
+
let hex3 = "";
|
|
414705
|
+
do {
|
|
414706
|
+
crypto.getRandomValues(bytes);
|
|
414707
|
+
hex3 = "";
|
|
414708
|
+
for (const byte of bytes) {
|
|
414709
|
+
hex3 += byte.toString(16).padStart(2, "0");
|
|
414710
|
+
}
|
|
414711
|
+
} while (/^0+$/.test(hex3));
|
|
414712
|
+
return hex3;
|
|
414383
414713
|
}
|
|
414384
414714
|
}
|
|
414385
414715
|
var providerSlot2 = singleton3("TelemetryProvider");
|
|
@@ -415076,149 +415406,24 @@ function buildCommandTelemetryAttribution2(commandPath, skillSource) {
|
|
|
415076
415406
|
...getCommandProductModeAttribution2(commandPath)
|
|
415077
415407
|
};
|
|
415078
415408
|
}
|
|
415079
|
-
var REDACTED2 = "[REDACTED]";
|
|
415080
|
-
var MAX_VALUE_LENGTH2 = 200;
|
|
415081
|
-
var SENSITIVE_NAME_TOKENS2 = new Set([
|
|
415082
|
-
"token",
|
|
415083
|
-
"tokens",
|
|
415084
|
-
"secret",
|
|
415085
|
-
"secrets",
|
|
415086
|
-
"password",
|
|
415087
|
-
"passwords",
|
|
415088
|
-
"pwd",
|
|
415089
|
-
"credential",
|
|
415090
|
-
"credentials",
|
|
415091
|
-
"auth",
|
|
415092
|
-
"authentication",
|
|
415093
|
-
"authorization",
|
|
415094
|
-
"authority",
|
|
415095
|
-
"cert",
|
|
415096
|
-
"certificate",
|
|
415097
|
-
"certificates"
|
|
415098
|
-
]);
|
|
415099
|
-
var SENSITIVE_KEY_PREFIXES2 = new Set([
|
|
415100
|
-
"api",
|
|
415101
|
-
"access",
|
|
415102
|
-
"client",
|
|
415103
|
-
"private",
|
|
415104
|
-
"public",
|
|
415105
|
-
"signing",
|
|
415106
|
-
"encryption",
|
|
415107
|
-
"session",
|
|
415108
|
-
"master",
|
|
415109
|
-
"shared",
|
|
415110
|
-
"root",
|
|
415111
|
-
"ssh",
|
|
415112
|
-
"rsa",
|
|
415113
|
-
"aes",
|
|
415114
|
-
"hmac",
|
|
415115
|
-
"oauth"
|
|
415116
|
-
]);
|
|
415117
|
-
var UUID_PATTERN2 = /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi;
|
|
415118
|
-
var EMAIL_PATTERN2 = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
415119
|
-
var JWT_PATTERN2 = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
415120
|
-
var LONG_TOKEN_PATTERN2 = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
415121
|
-
var USER_HOME_PATTERN2 = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
415122
|
-
var URL_PATTERN2 = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
415123
|
-
var URL_TRAILING_PUNCT2 = /[.,;:!?)\]}>'"]+$/;
|
|
415124
|
-
function shortHash2(input) {
|
|
415125
|
-
let hash2 = 2166136261;
|
|
415126
|
-
for (let i2 = 0;i2 < input.length; i2++) {
|
|
415127
|
-
hash2 ^= input.charCodeAt(i2);
|
|
415128
|
-
hash2 = Math.imul(hash2, 16777619);
|
|
415129
|
-
}
|
|
415130
|
-
return (hash2 >>> 0).toString(16).padStart(8, "0");
|
|
415131
|
-
}
|
|
415132
|
-
function redactUrl2(raw) {
|
|
415133
|
-
try {
|
|
415134
|
-
const url3 = new URL(raw);
|
|
415135
|
-
return `${url3.protocol}//${url3.host}`;
|
|
415136
|
-
} catch {
|
|
415137
|
-
return `url#${shortHash2(raw)}`;
|
|
415138
|
-
}
|
|
415139
|
-
}
|
|
415140
|
-
function redactValueDetectors2(value) {
|
|
415141
|
-
let out = value;
|
|
415142
|
-
out = out.replace(JWT_PATTERN2, () => REDACTED2);
|
|
415143
|
-
out = out.replace(URL_PATTERN2, (match) => {
|
|
415144
|
-
const trailing = match.match(URL_TRAILING_PUNCT2)?.[0] ?? "";
|
|
415145
|
-
const core22 = trailing ? match.slice(0, -trailing.length) : match;
|
|
415146
|
-
return `${redactUrl2(core22)}${trailing}`;
|
|
415147
|
-
});
|
|
415148
|
-
out = out.replace(USER_HOME_PATTERN2, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
415149
|
-
out = out.replace(EMAIL_PATTERN2, (match) => `email#${shortHash2(match)}`);
|
|
415150
|
-
out = out.replace(UUID_PATTERN2, (match) => `uuid#${shortHash2(match)}`);
|
|
415151
|
-
out = out.replace(LONG_TOKEN_PATTERN2, () => REDACTED2);
|
|
415152
|
-
if (out.length > MAX_VALUE_LENGTH2) {
|
|
415153
|
-
out = `${out.slice(0, MAX_VALUE_LENGTH2)}…`;
|
|
415154
|
-
}
|
|
415155
|
-
return out;
|
|
415156
|
-
}
|
|
415157
|
-
function nameTokens2(name2) {
|
|
415158
|
-
return name2.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").split(/[\s_-]+/).map((t13) => t13.toLowerCase()).filter(Boolean);
|
|
415159
|
-
}
|
|
415160
|
-
function isSensitiveName2(name2) {
|
|
415161
|
-
const tokens = nameTokens2(name2);
|
|
415162
|
-
for (let i2 = 0;i2 < tokens.length; i2++) {
|
|
415163
|
-
const token = tokens[i2];
|
|
415164
|
-
if (SENSITIVE_NAME_TOKENS2.has(token)) {
|
|
415165
|
-
return true;
|
|
415166
|
-
}
|
|
415167
|
-
if (token === "key" || token === "keys") {
|
|
415168
|
-
const prev = tokens[i2 - 1];
|
|
415169
|
-
if (prev && SENSITIVE_KEY_PREFIXES2.has(prev)) {
|
|
415170
|
-
return true;
|
|
415171
|
-
}
|
|
415172
|
-
}
|
|
415173
|
-
}
|
|
415174
|
-
return false;
|
|
415175
|
-
}
|
|
415176
|
-
function redactProperty2(name2, value) {
|
|
415177
|
-
if (value === undefined || value === null) {
|
|
415178
|
-
return;
|
|
415179
|
-
}
|
|
415180
|
-
if (isSensitiveName2(name2)) {
|
|
415181
|
-
return REDACTED2;
|
|
415182
|
-
}
|
|
415183
|
-
if (typeof value === "boolean" || typeof value === "number") {
|
|
415184
|
-
return value;
|
|
415185
|
-
}
|
|
415186
|
-
if (typeof value !== "string") {
|
|
415187
|
-
return "[OBJECT]";
|
|
415188
|
-
}
|
|
415189
|
-
return redactValueDetectors2(value);
|
|
415190
|
-
}
|
|
415191
|
-
function redactProperties2(properties) {
|
|
415192
|
-
const out = {};
|
|
415193
|
-
for (const [name2, value] of Object.entries(properties)) {
|
|
415194
|
-
const redacted = redactProperty2(name2, value);
|
|
415195
|
-
if (redacted !== undefined) {
|
|
415196
|
-
out[name2] = redacted;
|
|
415197
|
-
}
|
|
415198
|
-
}
|
|
415199
|
-
return out;
|
|
415200
|
-
}
|
|
415201
415409
|
var pollSignalSlot2 = singleton3("PollSignal");
|
|
415202
415410
|
var cliErrorCodeValues2 = new Set(CLI_ERROR_CODES2);
|
|
415203
415411
|
var retryHintValues2 = new Set(RETRY_HINTS2);
|
|
415412
|
+
var TELEMETRY_COMMAND_ARG_PREFIX2 = "uip.cmd.arg.";
|
|
415204
415413
|
function extractCommandParams2(cmd) {
|
|
415205
415414
|
const params = {};
|
|
415415
|
+
const add22 = (name2, value) => {
|
|
415416
|
+
if (name2 && value !== undefined) {
|
|
415417
|
+
params[`${TELEMETRY_COMMAND_ARG_PREFIX2}${name2}`] = value;
|
|
415418
|
+
}
|
|
415419
|
+
};
|
|
415206
415420
|
const registered = cmd.registeredArguments ?? [];
|
|
415207
415421
|
const processed = cmd.processedArgs ?? [];
|
|
415208
415422
|
for (let i2 = 0;i2 < registered.length; i2++) {
|
|
415209
|
-
|
|
415210
|
-
if (value === undefined) {
|
|
415211
|
-
continue;
|
|
415212
|
-
}
|
|
415213
|
-
const name2 = registered[i2].name();
|
|
415214
|
-
if (name2) {
|
|
415215
|
-
params[name2] = value;
|
|
415216
|
-
}
|
|
415423
|
+
add22(registered[i2].name(), processed[i2]);
|
|
415217
415424
|
}
|
|
415218
415425
|
for (const [key, value] of Object.entries(cmd.opts())) {
|
|
415219
|
-
|
|
415220
|
-
params[key] = value;
|
|
415221
|
-
}
|
|
415426
|
+
add22(key, value);
|
|
415222
415427
|
}
|
|
415223
415428
|
return params;
|
|
415224
415429
|
}
|
|
@@ -415261,11 +415466,12 @@ Command3.prototype.trackedAction = function(context, fn, properties) {
|
|
|
415261
415466
|
return this.action(async (...args) => {
|
|
415262
415467
|
const telemetryName = deriveCommandPath2(command);
|
|
415263
415468
|
const props = typeof properties === "function" ? properties(...args) : properties;
|
|
415469
|
+
const requestContext = telemetry2.createRequestContext();
|
|
415264
415470
|
const startTime = performance.now();
|
|
415265
415471
|
let errorMessage2;
|
|
415266
415472
|
let fallbackExitCode = EXIT_CODES2.Success;
|
|
415267
415473
|
clearRecordedCommandFailureTelemetry2();
|
|
415268
|
-
const [error90] = await catchError3(fn(...args));
|
|
415474
|
+
const [error90] = await catchError3(telemetry2.runWithContext(requestContext, () => fn(...args)));
|
|
415269
415475
|
if (error90) {
|
|
415270
415476
|
errorMessage2 = error90 instanceof Error ? error90.message : String(error90);
|
|
415271
415477
|
logger3.debug(`[trackedAction] ${telemetryName} failed: ${errorMessage2}`);
|
|
@@ -415301,16 +415507,21 @@ Command3.prototype.trackedAction = function(context, fn, properties) {
|
|
|
415301
415507
|
recordedFailure,
|
|
415302
415508
|
pollSignal: context.pollSignal
|
|
415303
415509
|
});
|
|
415304
|
-
|
|
415305
|
-
|
|
415510
|
+
const commandParams = extractCommandParams2(command);
|
|
415511
|
+
if (props) {
|
|
415512
|
+
for (const key of Object.keys(props)) {
|
|
415513
|
+
delete commandParams[`${TELEMETRY_COMMAND_ARG_PREFIX2}${key}`];
|
|
415514
|
+
}
|
|
415515
|
+
}
|
|
415516
|
+
const baseProperties = redactProperties2({
|
|
415517
|
+
...commandParams,
|
|
415306
415518
|
...props,
|
|
415307
415519
|
...buildCommandTelemetryAttribution2(telemetryName, process.env.UIPATH_SKILL),
|
|
415308
415520
|
command: "true",
|
|
415309
|
-
duration: String(durationMs),
|
|
415310
|
-
success: String(success3),
|
|
415311
415521
|
...terminalTelemetry,
|
|
415312
415522
|
...errorMessage2 ? { errorMessage: errorMessage2 } : {}
|
|
415313
|
-
})
|
|
415523
|
+
});
|
|
415524
|
+
telemetry2.trackRequestResult(telemetryName, durationMs, success3, baseProperties, requestContext);
|
|
415314
415525
|
});
|
|
415315
415526
|
};
|
|
415316
415527
|
var guardInstalledSlot2 = singleton3("ConsoleGuardInstalled");
|
|
@@ -415666,7 +415877,7 @@ function querystringSingleKey6(key, value, keyPrefix = "") {
|
|
|
415666
415877
|
var package_default5 = {
|
|
415667
415878
|
name: "@uipath/solution-sdk",
|
|
415668
415879
|
license: "MIT",
|
|
415669
|
-
version: "1.199.0-preview.
|
|
415880
|
+
version: "1.199.0-preview.97",
|
|
415670
415881
|
repository: {
|
|
415671
415882
|
type: "git",
|
|
415672
415883
|
url: "https://github.com/UiPath/cli.git",
|
|
@@ -445352,4 +445563,4 @@ export {
|
|
|
445352
445563
|
metadata
|
|
445353
445564
|
};
|
|
445354
445565
|
|
|
445355
|
-
//# debugId=
|
|
445566
|
+
//# debugId=E43FD7F699E6E3B464756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/case-tool",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "1.199.0-preview.
|
|
4
|
+
"version": "1.199.0-preview.97",
|
|
5
5
|
"description": "Manage Case Management instances, processes, and incidents.",
|
|
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
|
}
|