@uipath/tasks-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
|
@@ -27244,7 +27244,7 @@ var require_src6 = __commonJS((exports) => {
|
|
|
27244
27244
|
var package_default = {
|
|
27245
27245
|
name: "@uipath/tasks-tool",
|
|
27246
27246
|
license: "MIT",
|
|
27247
|
-
version: "1.198.0
|
|
27247
|
+
version: "1.198.0",
|
|
27248
27248
|
description: "Manage Action Center tasks.",
|
|
27249
27249
|
type: "module",
|
|
27250
27250
|
main: "./dist/tool.js",
|
|
@@ -33424,11 +33424,36 @@ class NodeContextStorage {
|
|
|
33424
33424
|
return this.storage.getStore();
|
|
33425
33425
|
}
|
|
33426
33426
|
}
|
|
33427
|
+
// ../common/src/telemetry/trace-context.ts
|
|
33428
|
+
var TELEMETRY_TRACEPARENT_ENV = "TRACEPARENT";
|
|
33429
|
+
var TRACEPARENT_PATTERN = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/;
|
|
33430
|
+
function getProcessEnv() {
|
|
33431
|
+
return globalThis.process?.env;
|
|
33432
|
+
}
|
|
33433
|
+
function parseInboundTraceparent(value) {
|
|
33434
|
+
if (!value) {
|
|
33435
|
+
return;
|
|
33436
|
+
}
|
|
33437
|
+
const match = TRACEPARENT_PATTERN.exec(value.trim().toLowerCase());
|
|
33438
|
+
if (!match) {
|
|
33439
|
+
return;
|
|
33440
|
+
}
|
|
33441
|
+
const [, traceId, parentSpanId] = match;
|
|
33442
|
+
if (/^0+$/.test(traceId) || /^0+$/.test(parentSpanId)) {
|
|
33443
|
+
return;
|
|
33444
|
+
}
|
|
33445
|
+
return { traceId, parentSpanId };
|
|
33446
|
+
}
|
|
33447
|
+
function getInboundTraceContext() {
|
|
33448
|
+
return parseInboundTraceparent(getProcessEnv()?.[TELEMETRY_TRACEPARENT_ENV]);
|
|
33449
|
+
}
|
|
33450
|
+
|
|
33427
33451
|
// ../common/src/telemetry/session-id.ts
|
|
33428
33452
|
var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
|
|
33429
33453
|
var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
|
|
33430
33454
|
var telemetrySessionIdSlot = singleton("TelemetrySessionId");
|
|
33431
|
-
|
|
33455
|
+
var telemetryOperationIdSlot = singleton("TelemetryOperationId");
|
|
33456
|
+
function getProcessEnv2() {
|
|
33432
33457
|
return globalThis.process?.env;
|
|
33433
33458
|
}
|
|
33434
33459
|
function normalizeSessionId(value) {
|
|
@@ -33439,18 +33464,165 @@ function normalizeSessionId(value) {
|
|
|
33439
33464
|
return trimmed || undefined;
|
|
33440
33465
|
}
|
|
33441
33466
|
function getConfiguredTelemetrySessionId() {
|
|
33442
|
-
return normalizeSessionId(
|
|
33467
|
+
return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
|
|
33443
33468
|
}
|
|
33444
33469
|
function resolveTelemetrySessionId(existingSessionId) {
|
|
33445
33470
|
return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
|
|
33446
33471
|
}
|
|
33472
|
+
function getTelemetryOperationId() {
|
|
33473
|
+
const existing = telemetryOperationIdSlot.get();
|
|
33474
|
+
if (existing) {
|
|
33475
|
+
return existing;
|
|
33476
|
+
}
|
|
33477
|
+
const inboundTraceId = getInboundTraceContext()?.traceId;
|
|
33478
|
+
const generated = inboundTraceId ?? crypto.randomUUID().replaceAll("-", "");
|
|
33479
|
+
telemetryOperationIdSlot.set(generated);
|
|
33480
|
+
return generated;
|
|
33481
|
+
}
|
|
33447
33482
|
// ../common/src/telemetry/global-telemetry-properties.ts
|
|
33448
33483
|
var telemetryPropsSlot = singleton("TelemetryDefaultProps");
|
|
33449
33484
|
function getGlobalTelemetryProperties() {
|
|
33450
33485
|
return telemetryPropsSlot.get();
|
|
33451
33486
|
}
|
|
33452
33487
|
|
|
33488
|
+
// ../common/src/telemetry/pii-redactor.ts
|
|
33489
|
+
var REDACTED = "[REDACTED]";
|
|
33490
|
+
var MAX_VALUE_LENGTH = 200;
|
|
33491
|
+
var SENSITIVE_NAME_TOKENS = new Set([
|
|
33492
|
+
"token",
|
|
33493
|
+
"tokens",
|
|
33494
|
+
"secret",
|
|
33495
|
+
"secrets",
|
|
33496
|
+
"password",
|
|
33497
|
+
"passwords",
|
|
33498
|
+
"pwd",
|
|
33499
|
+
"credential",
|
|
33500
|
+
"credentials",
|
|
33501
|
+
"auth",
|
|
33502
|
+
"authentication",
|
|
33503
|
+
"authorization",
|
|
33504
|
+
"authority",
|
|
33505
|
+
"cert",
|
|
33506
|
+
"certificate",
|
|
33507
|
+
"certificates"
|
|
33508
|
+
]);
|
|
33509
|
+
var SENSITIVE_KEY_PREFIXES = new Set([
|
|
33510
|
+
"api",
|
|
33511
|
+
"access",
|
|
33512
|
+
"client",
|
|
33513
|
+
"private",
|
|
33514
|
+
"public",
|
|
33515
|
+
"signing",
|
|
33516
|
+
"encryption",
|
|
33517
|
+
"session",
|
|
33518
|
+
"master",
|
|
33519
|
+
"shared",
|
|
33520
|
+
"root",
|
|
33521
|
+
"ssh",
|
|
33522
|
+
"rsa",
|
|
33523
|
+
"aes",
|
|
33524
|
+
"hmac",
|
|
33525
|
+
"oauth"
|
|
33526
|
+
]);
|
|
33527
|
+
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;
|
|
33528
|
+
var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
33529
|
+
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
33530
|
+
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
33531
|
+
var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
33532
|
+
var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
33533
|
+
var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
|
|
33534
|
+
function shortHash(input) {
|
|
33535
|
+
let hash = 2166136261;
|
|
33536
|
+
for (let i = 0;i < input.length; i++) {
|
|
33537
|
+
hash ^= input.charCodeAt(i);
|
|
33538
|
+
hash = Math.imul(hash, 16777619);
|
|
33539
|
+
}
|
|
33540
|
+
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
33541
|
+
}
|
|
33542
|
+
function redactUrl(raw) {
|
|
33543
|
+
try {
|
|
33544
|
+
const url = new URL(raw);
|
|
33545
|
+
return `${url.protocol}//${url.host}`;
|
|
33546
|
+
} catch {
|
|
33547
|
+
return `url#${shortHash(raw)}`;
|
|
33548
|
+
}
|
|
33549
|
+
}
|
|
33550
|
+
function redactValueDetectors(value) {
|
|
33551
|
+
let out = value;
|
|
33552
|
+
out = out.replace(JWT_PATTERN, () => REDACTED);
|
|
33553
|
+
out = out.replace(URL_PATTERN, (match) => {
|
|
33554
|
+
const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
|
|
33555
|
+
const core2 = trailing ? match.slice(0, -trailing.length) : match;
|
|
33556
|
+
return `${redactUrl(core2)}${trailing}`;
|
|
33557
|
+
});
|
|
33558
|
+
out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
33559
|
+
out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
|
|
33560
|
+
out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
|
|
33561
|
+
out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
|
|
33562
|
+
if (out.length > MAX_VALUE_LENGTH) {
|
|
33563
|
+
out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
|
|
33564
|
+
}
|
|
33565
|
+
return out;
|
|
33566
|
+
}
|
|
33567
|
+
function redactValue(value) {
|
|
33568
|
+
return redactValueDetectors(value);
|
|
33569
|
+
}
|
|
33570
|
+
function redactError(error) {
|
|
33571
|
+
const safe = new Error(redactValueDetectors(error.message ?? ""));
|
|
33572
|
+
safe.name = error.name;
|
|
33573
|
+
safe.stack = typeof error.stack === "string" ? redactValueDetectors(error.stack) : undefined;
|
|
33574
|
+
return safe;
|
|
33575
|
+
}
|
|
33576
|
+
function nameTokens(name) {
|
|
33577
|
+
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);
|
|
33578
|
+
}
|
|
33579
|
+
function isSensitiveName(name) {
|
|
33580
|
+
const tokens = nameTokens(name);
|
|
33581
|
+
for (let i = 0;i < tokens.length; i++) {
|
|
33582
|
+
const token = tokens[i];
|
|
33583
|
+
if (SENSITIVE_NAME_TOKENS.has(token)) {
|
|
33584
|
+
return true;
|
|
33585
|
+
}
|
|
33586
|
+
if (token === "key" || token === "keys") {
|
|
33587
|
+
const prev = tokens[i - 1];
|
|
33588
|
+
if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
|
|
33589
|
+
return true;
|
|
33590
|
+
}
|
|
33591
|
+
}
|
|
33592
|
+
}
|
|
33593
|
+
return false;
|
|
33594
|
+
}
|
|
33595
|
+
function redactProperty(name, value) {
|
|
33596
|
+
if (value === undefined || value === null) {
|
|
33597
|
+
return;
|
|
33598
|
+
}
|
|
33599
|
+
if (isSensitiveName(name)) {
|
|
33600
|
+
return REDACTED;
|
|
33601
|
+
}
|
|
33602
|
+
if (typeof value === "boolean" || typeof value === "number") {
|
|
33603
|
+
return value;
|
|
33604
|
+
}
|
|
33605
|
+
if (typeof value !== "string") {
|
|
33606
|
+
return "[OBJECT]";
|
|
33607
|
+
}
|
|
33608
|
+
return redactValueDetectors(value);
|
|
33609
|
+
}
|
|
33610
|
+
function redactProperties(properties) {
|
|
33611
|
+
const out = {};
|
|
33612
|
+
for (const [name, value] of Object.entries(properties)) {
|
|
33613
|
+
const redacted = redactProperty(name, value);
|
|
33614
|
+
if (redacted !== undefined) {
|
|
33615
|
+
out[name] = redacted;
|
|
33616
|
+
}
|
|
33617
|
+
}
|
|
33618
|
+
return out;
|
|
33619
|
+
}
|
|
33620
|
+
|
|
33453
33621
|
// ../common/src/telemetry/telemetry-service.ts
|
|
33622
|
+
var TELEMETRY_OPERATION_ID_PROPERTY = "uip.trace.operation_id";
|
|
33623
|
+
var TELEMETRY_PARENT_ID_PROPERTY = "uip.trace.parent_id";
|
|
33624
|
+
var TELEMETRY_SPAN_ID_PROPERTY = "uip.trace.span_id";
|
|
33625
|
+
|
|
33454
33626
|
class TelemetryService {
|
|
33455
33627
|
telemetryProvider;
|
|
33456
33628
|
contextStorage;
|
|
@@ -33477,11 +33649,15 @@ class TelemetryService {
|
|
|
33477
33649
|
trackException(error, properties) {
|
|
33478
33650
|
const context = this.getCurrentContext();
|
|
33479
33651
|
const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
|
|
33480
|
-
this.telemetryProvider.trackException(error, enrichedProperties);
|
|
33652
|
+
this.telemetryProvider.trackException(redactError(error), enrichedProperties);
|
|
33481
33653
|
}
|
|
33482
33654
|
async trackRequest(name, fn, properties) {
|
|
33655
|
+
const parentContext = this.getCurrentContext();
|
|
33656
|
+
const operationId = parentContext?.operationId ?? this.operationId ?? getTelemetryOperationId();
|
|
33657
|
+
const parentId = parentContext ? parentContext.id : this.inboundParentIdFor(operationId);
|
|
33483
33658
|
const context = {
|
|
33484
|
-
operationId
|
|
33659
|
+
operationId,
|
|
33660
|
+
...parentId !== undefined ? { parentId } : {},
|
|
33485
33661
|
id: this.generateId()
|
|
33486
33662
|
};
|
|
33487
33663
|
const startTime = performance.now();
|
|
@@ -33499,6 +33675,45 @@ class TelemetryService {
|
|
|
33499
33675
|
throw error;
|
|
33500
33676
|
}
|
|
33501
33677
|
}
|
|
33678
|
+
trackRequestResult(name, durationMs, success, properties, context) {
|
|
33679
|
+
const requestContext = context ?? {
|
|
33680
|
+
operationId: this.operationId ?? getTelemetryOperationId(),
|
|
33681
|
+
id: this.generateId()
|
|
33682
|
+
};
|
|
33683
|
+
const enrichedProperties = this.enrichPropertiesWithContext(properties, requestContext);
|
|
33684
|
+
this.telemetryProvider.trackRequest(name, durationMs, success, enrichedProperties);
|
|
33685
|
+
}
|
|
33686
|
+
createRequestContext() {
|
|
33687
|
+
const operationId = this.operationId ?? getTelemetryOperationId();
|
|
33688
|
+
const parentId = this.inboundParentIdFor(operationId);
|
|
33689
|
+
return {
|
|
33690
|
+
operationId,
|
|
33691
|
+
...parentId !== undefined ? { parentId } : {},
|
|
33692
|
+
id: this.generateId()
|
|
33693
|
+
};
|
|
33694
|
+
}
|
|
33695
|
+
inboundParentIdFor(operationId) {
|
|
33696
|
+
const inbound = getInboundTraceContext();
|
|
33697
|
+
return inbound && inbound.traceId === operationId ? inbound.parentSpanId : undefined;
|
|
33698
|
+
}
|
|
33699
|
+
runWithContext(context, fn) {
|
|
33700
|
+
return this.contextStorage.run(context, fn);
|
|
33701
|
+
}
|
|
33702
|
+
createDependencyContext() {
|
|
33703
|
+
const parentContext = this.getCurrentContext();
|
|
33704
|
+
if (!parentContext) {
|
|
33705
|
+
return;
|
|
33706
|
+
}
|
|
33707
|
+
return {
|
|
33708
|
+
operationId: parentContext.operationId,
|
|
33709
|
+
parentId: parentContext.id,
|
|
33710
|
+
id: this.generateId()
|
|
33711
|
+
};
|
|
33712
|
+
}
|
|
33713
|
+
trackDependencyResult(name, type2, durationMs, success, properties, context, resultCode) {
|
|
33714
|
+
const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
|
|
33715
|
+
this.telemetryProvider.trackDependency(redactValue(name), type2, durationMs, success, enrichedProperties, resultCode);
|
|
33716
|
+
}
|
|
33502
33717
|
async trackDependencyOperation(name, type2, fn, properties) {
|
|
33503
33718
|
const parentContext = this.getCurrentContext();
|
|
33504
33719
|
if (!parentContext) {
|
|
@@ -33535,8 +33750,12 @@ class TelemetryService {
|
|
|
33535
33750
|
...getExecutionContextTelemetryProperties(),
|
|
33536
33751
|
...globalProperties,
|
|
33537
33752
|
...this.defaultProperties,
|
|
33538
|
-
...properties,
|
|
33539
|
-
...context
|
|
33753
|
+
...redactProperties(properties ?? {}),
|
|
33754
|
+
...context ? {
|
|
33755
|
+
[TELEMETRY_OPERATION_ID_PROPERTY]: context.operationId,
|
|
33756
|
+
...context.parentId !== undefined ? { [TELEMETRY_PARENT_ID_PROPERTY]: context.parentId } : {},
|
|
33757
|
+
[TELEMETRY_SPAN_ID_PROPERTY]: context.id
|
|
33758
|
+
} : {}
|
|
33540
33759
|
};
|
|
33541
33760
|
if (sessionId === undefined) {
|
|
33542
33761
|
delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
|
|
@@ -33546,7 +33765,16 @@ class TelemetryService {
|
|
|
33546
33765
|
return enriched;
|
|
33547
33766
|
}
|
|
33548
33767
|
generateId() {
|
|
33549
|
-
|
|
33768
|
+
const bytes = new Uint8Array(8);
|
|
33769
|
+
let hex = "";
|
|
33770
|
+
do {
|
|
33771
|
+
crypto.getRandomValues(bytes);
|
|
33772
|
+
hex = "";
|
|
33773
|
+
for (const byte of bytes) {
|
|
33774
|
+
hex += byte.toString(16).padStart(2, "0");
|
|
33775
|
+
}
|
|
33776
|
+
} while (/^0+$/.test(hex));
|
|
33777
|
+
return hex;
|
|
33550
33778
|
}
|
|
33551
33779
|
}
|
|
33552
33780
|
// ../common/src/telemetry/node-appinsights-telemetry-provider.ts
|
|
@@ -34248,134 +34476,11 @@ function buildCommandTelemetryAttribution(commandPath, skillSource) {
|
|
|
34248
34476
|
};
|
|
34249
34477
|
}
|
|
34250
34478
|
|
|
34251
|
-
// ../common/src/telemetry/pii-redactor.ts
|
|
34252
|
-
var REDACTED = "[REDACTED]";
|
|
34253
|
-
var MAX_VALUE_LENGTH = 200;
|
|
34254
|
-
var SENSITIVE_NAME_TOKENS = new Set([
|
|
34255
|
-
"token",
|
|
34256
|
-
"tokens",
|
|
34257
|
-
"secret",
|
|
34258
|
-
"secrets",
|
|
34259
|
-
"password",
|
|
34260
|
-
"passwords",
|
|
34261
|
-
"pwd",
|
|
34262
|
-
"credential",
|
|
34263
|
-
"credentials",
|
|
34264
|
-
"auth",
|
|
34265
|
-
"authentication",
|
|
34266
|
-
"authorization",
|
|
34267
|
-
"authority",
|
|
34268
|
-
"cert",
|
|
34269
|
-
"certificate",
|
|
34270
|
-
"certificates"
|
|
34271
|
-
]);
|
|
34272
|
-
var SENSITIVE_KEY_PREFIXES = new Set([
|
|
34273
|
-
"api",
|
|
34274
|
-
"access",
|
|
34275
|
-
"client",
|
|
34276
|
-
"private",
|
|
34277
|
-
"public",
|
|
34278
|
-
"signing",
|
|
34279
|
-
"encryption",
|
|
34280
|
-
"session",
|
|
34281
|
-
"master",
|
|
34282
|
-
"shared",
|
|
34283
|
-
"root",
|
|
34284
|
-
"ssh",
|
|
34285
|
-
"rsa",
|
|
34286
|
-
"aes",
|
|
34287
|
-
"hmac",
|
|
34288
|
-
"oauth"
|
|
34289
|
-
]);
|
|
34290
|
-
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;
|
|
34291
|
-
var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
34292
|
-
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
34293
|
-
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
34294
|
-
var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
34295
|
-
var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
34296
|
-
var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
|
|
34297
|
-
function shortHash(input) {
|
|
34298
|
-
let hash = 2166136261;
|
|
34299
|
-
for (let i = 0;i < input.length; i++) {
|
|
34300
|
-
hash ^= input.charCodeAt(i);
|
|
34301
|
-
hash = Math.imul(hash, 16777619);
|
|
34302
|
-
}
|
|
34303
|
-
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
34304
|
-
}
|
|
34305
|
-
function redactUrl(raw) {
|
|
34306
|
-
try {
|
|
34307
|
-
const url = new URL(raw);
|
|
34308
|
-
return `${url.protocol}//${url.host}`;
|
|
34309
|
-
} catch {
|
|
34310
|
-
return `url#${shortHash(raw)}`;
|
|
34311
|
-
}
|
|
34312
|
-
}
|
|
34313
|
-
function redactValueDetectors(value) {
|
|
34314
|
-
let out = value;
|
|
34315
|
-
out = out.replace(JWT_PATTERN, () => REDACTED);
|
|
34316
|
-
out = out.replace(URL_PATTERN, (match) => {
|
|
34317
|
-
const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
|
|
34318
|
-
const core2 = trailing ? match.slice(0, -trailing.length) : match;
|
|
34319
|
-
return `${redactUrl(core2)}${trailing}`;
|
|
34320
|
-
});
|
|
34321
|
-
out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
34322
|
-
out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
|
|
34323
|
-
out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
|
|
34324
|
-
out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
|
|
34325
|
-
if (out.length > MAX_VALUE_LENGTH) {
|
|
34326
|
-
out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
|
|
34327
|
-
}
|
|
34328
|
-
return out;
|
|
34329
|
-
}
|
|
34330
|
-
function nameTokens(name) {
|
|
34331
|
-
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);
|
|
34332
|
-
}
|
|
34333
|
-
function isSensitiveName(name) {
|
|
34334
|
-
const tokens = nameTokens(name);
|
|
34335
|
-
for (let i = 0;i < tokens.length; i++) {
|
|
34336
|
-
const token = tokens[i];
|
|
34337
|
-
if (SENSITIVE_NAME_TOKENS.has(token)) {
|
|
34338
|
-
return true;
|
|
34339
|
-
}
|
|
34340
|
-
if (token === "key" || token === "keys") {
|
|
34341
|
-
const prev = tokens[i - 1];
|
|
34342
|
-
if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
|
|
34343
|
-
return true;
|
|
34344
|
-
}
|
|
34345
|
-
}
|
|
34346
|
-
}
|
|
34347
|
-
return false;
|
|
34348
|
-
}
|
|
34349
|
-
function redactProperty(name, value) {
|
|
34350
|
-
if (value === undefined || value === null) {
|
|
34351
|
-
return;
|
|
34352
|
-
}
|
|
34353
|
-
if (isSensitiveName(name)) {
|
|
34354
|
-
return REDACTED;
|
|
34355
|
-
}
|
|
34356
|
-
if (typeof value === "boolean" || typeof value === "number") {
|
|
34357
|
-
return value;
|
|
34358
|
-
}
|
|
34359
|
-
if (typeof value !== "string") {
|
|
34360
|
-
return "[OBJECT]";
|
|
34361
|
-
}
|
|
34362
|
-
return redactValueDetectors(value);
|
|
34363
|
-
}
|
|
34364
|
-
function redactProperties(properties) {
|
|
34365
|
-
const out = {};
|
|
34366
|
-
for (const [name, value] of Object.entries(properties)) {
|
|
34367
|
-
const redacted = redactProperty(name, value);
|
|
34368
|
-
if (redacted !== undefined) {
|
|
34369
|
-
out[name] = redacted;
|
|
34370
|
-
}
|
|
34371
|
-
}
|
|
34372
|
-
return out;
|
|
34373
|
-
}
|
|
34374
|
-
|
|
34375
34479
|
// ../common/src/trackedAction.ts
|
|
34376
34480
|
var pollSignalSlot = singleton("PollSignal");
|
|
34377
34481
|
var cliErrorCodeValues = new Set(CLI_ERROR_CODES);
|
|
34378
34482
|
var retryHintValues = new Set(RETRY_HINTS);
|
|
34483
|
+
var TELEMETRY_COMMAND_ARG_PREFIX = "uip.cmd.arg.";
|
|
34379
34484
|
var processContext = {
|
|
34380
34485
|
exit: (code) => {
|
|
34381
34486
|
process.exitCode = code;
|
|
@@ -34386,22 +34491,18 @@ var processContext = {
|
|
|
34386
34491
|
};
|
|
34387
34492
|
function extractCommandParams(cmd) {
|
|
34388
34493
|
const params = {};
|
|
34494
|
+
const add2 = (name, value) => {
|
|
34495
|
+
if (name && value !== undefined) {
|
|
34496
|
+
params[`${TELEMETRY_COMMAND_ARG_PREFIX}${name}`] = value;
|
|
34497
|
+
}
|
|
34498
|
+
};
|
|
34389
34499
|
const registered = cmd.registeredArguments ?? [];
|
|
34390
34500
|
const processed = cmd.processedArgs ?? [];
|
|
34391
34501
|
for (let i = 0;i < registered.length; i++) {
|
|
34392
|
-
|
|
34393
|
-
if (value === undefined) {
|
|
34394
|
-
continue;
|
|
34395
|
-
}
|
|
34396
|
-
const name = registered[i].name();
|
|
34397
|
-
if (name) {
|
|
34398
|
-
params[name] = value;
|
|
34399
|
-
}
|
|
34502
|
+
add2(registered[i].name(), processed[i]);
|
|
34400
34503
|
}
|
|
34401
34504
|
for (const [key, value] of Object.entries(cmd.opts())) {
|
|
34402
|
-
|
|
34403
|
-
params[key] = value;
|
|
34404
|
-
}
|
|
34505
|
+
add2(key, value);
|
|
34405
34506
|
}
|
|
34406
34507
|
return params;
|
|
34407
34508
|
}
|
|
@@ -34444,11 +34545,12 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
34444
34545
|
return this.action(async (...args) => {
|
|
34445
34546
|
const telemetryName = deriveCommandPath(command);
|
|
34446
34547
|
const props = typeof properties === "function" ? properties(...args) : properties;
|
|
34548
|
+
const requestContext = telemetry.createRequestContext();
|
|
34447
34549
|
const startTime = performance.now();
|
|
34448
34550
|
let errorMessage;
|
|
34449
34551
|
let fallbackExitCode = EXIT_CODES.Success;
|
|
34450
34552
|
clearRecordedCommandFailureTelemetry();
|
|
34451
|
-
const [error] = await catchError(fn(...args));
|
|
34553
|
+
const [error] = await catchError(telemetry.runWithContext(requestContext, () => fn(...args)));
|
|
34452
34554
|
if (error) {
|
|
34453
34555
|
errorMessage = error instanceof Error ? error.message : String(error);
|
|
34454
34556
|
logger.debug(`[trackedAction] ${telemetryName} failed: ${errorMessage}`);
|
|
@@ -34484,16 +34586,21 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
34484
34586
|
recordedFailure,
|
|
34485
34587
|
pollSignal: context.pollSignal
|
|
34486
34588
|
});
|
|
34487
|
-
|
|
34488
|
-
|
|
34589
|
+
const commandParams = extractCommandParams(command);
|
|
34590
|
+
if (props) {
|
|
34591
|
+
for (const key of Object.keys(props)) {
|
|
34592
|
+
delete commandParams[`${TELEMETRY_COMMAND_ARG_PREFIX}${key}`];
|
|
34593
|
+
}
|
|
34594
|
+
}
|
|
34595
|
+
const baseProperties = redactProperties({
|
|
34596
|
+
...commandParams,
|
|
34489
34597
|
...props,
|
|
34490
34598
|
...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
|
|
34491
34599
|
command: "true",
|
|
34492
|
-
duration: String(durationMs),
|
|
34493
|
-
success: String(success),
|
|
34494
34600
|
...terminalTelemetry,
|
|
34495
34601
|
...errorMessage ? { errorMessage } : {}
|
|
34496
|
-
})
|
|
34602
|
+
});
|
|
34603
|
+
telemetry.trackRequestResult(telemetryName, durationMs, success, baseProperties, requestContext);
|
|
34497
34604
|
});
|
|
34498
34605
|
};
|
|
34499
34606
|
// ../common/src/console-guard.ts
|
|
@@ -46655,4 +46762,4 @@ export {
|
|
|
46655
46762
|
metadata
|
|
46656
46763
|
};
|
|
46657
46764
|
|
|
46658
|
-
//# debugId=
|
|
46765
|
+
//# debugId=ACE1E4D9ACC164FF64756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/tasks-tool",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "1.198.0
|
|
4
|
+
"version": "1.198.0",
|
|
5
5
|
"description": "Manage Action Center tasks.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/tool.js",
|
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
"publishConfig": {
|
|
15
15
|
"registry": "https://registry.npmjs.org/"
|
|
16
16
|
},
|
|
17
|
-
"gitHead": "
|
|
17
|
+
"gitHead": "1fadf03d7a8dd102742571dff569fdac11808afb"
|
|
18
18
|
}
|