@uipath/tasks-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
|
@@ -27310,7 +27310,7 @@ var require_src6 = __commonJS((exports) => {
|
|
|
27310
27310
|
var package_default = {
|
|
27311
27311
|
name: "@uipath/tasks-tool",
|
|
27312
27312
|
license: "MIT",
|
|
27313
|
-
version: "1.199.0-preview.
|
|
27313
|
+
version: "1.199.0-preview.97",
|
|
27314
27314
|
description: "Manage Action Center tasks.",
|
|
27315
27315
|
type: "module",
|
|
27316
27316
|
main: "./dist/tool.js",
|
|
@@ -33496,11 +33496,36 @@ class NodeContextStorage {
|
|
|
33496
33496
|
return this.storage.getStore();
|
|
33497
33497
|
}
|
|
33498
33498
|
}
|
|
33499
|
+
// ../common/src/telemetry/trace-context.ts
|
|
33500
|
+
var TELEMETRY_TRACEPARENT_ENV = "TRACEPARENT";
|
|
33501
|
+
var TRACEPARENT_PATTERN = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/;
|
|
33502
|
+
function getProcessEnv() {
|
|
33503
|
+
return globalThis.process?.env;
|
|
33504
|
+
}
|
|
33505
|
+
function parseInboundTraceparent(value) {
|
|
33506
|
+
if (!value) {
|
|
33507
|
+
return;
|
|
33508
|
+
}
|
|
33509
|
+
const match = TRACEPARENT_PATTERN.exec(value.trim().toLowerCase());
|
|
33510
|
+
if (!match) {
|
|
33511
|
+
return;
|
|
33512
|
+
}
|
|
33513
|
+
const [, traceId, parentSpanId] = match;
|
|
33514
|
+
if (/^0+$/.test(traceId) || /^0+$/.test(parentSpanId)) {
|
|
33515
|
+
return;
|
|
33516
|
+
}
|
|
33517
|
+
return { traceId, parentSpanId };
|
|
33518
|
+
}
|
|
33519
|
+
function getInboundTraceContext() {
|
|
33520
|
+
return parseInboundTraceparent(getProcessEnv()?.[TELEMETRY_TRACEPARENT_ENV]);
|
|
33521
|
+
}
|
|
33522
|
+
|
|
33499
33523
|
// ../common/src/telemetry/session-id.ts
|
|
33500
33524
|
var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
|
|
33501
33525
|
var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
|
|
33502
33526
|
var telemetrySessionIdSlot = singleton("TelemetrySessionId");
|
|
33503
|
-
|
|
33527
|
+
var telemetryOperationIdSlot = singleton("TelemetryOperationId");
|
|
33528
|
+
function getProcessEnv2() {
|
|
33504
33529
|
return globalThis.process?.env;
|
|
33505
33530
|
}
|
|
33506
33531
|
function normalizeSessionId(value) {
|
|
@@ -33511,18 +33536,165 @@ function normalizeSessionId(value) {
|
|
|
33511
33536
|
return trimmed || undefined;
|
|
33512
33537
|
}
|
|
33513
33538
|
function getConfiguredTelemetrySessionId() {
|
|
33514
|
-
return normalizeSessionId(
|
|
33539
|
+
return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
|
|
33515
33540
|
}
|
|
33516
33541
|
function resolveTelemetrySessionId(existingSessionId) {
|
|
33517
33542
|
return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
|
|
33518
33543
|
}
|
|
33544
|
+
function getTelemetryOperationId() {
|
|
33545
|
+
const existing = telemetryOperationIdSlot.get();
|
|
33546
|
+
if (existing) {
|
|
33547
|
+
return existing;
|
|
33548
|
+
}
|
|
33549
|
+
const inboundTraceId = getInboundTraceContext()?.traceId;
|
|
33550
|
+
const generated = inboundTraceId ?? crypto.randomUUID().replaceAll("-", "");
|
|
33551
|
+
telemetryOperationIdSlot.set(generated);
|
|
33552
|
+
return generated;
|
|
33553
|
+
}
|
|
33519
33554
|
// ../common/src/telemetry/global-telemetry-properties.ts
|
|
33520
33555
|
var telemetryPropsSlot = singleton("TelemetryDefaultProps");
|
|
33521
33556
|
function getGlobalTelemetryProperties() {
|
|
33522
33557
|
return telemetryPropsSlot.get();
|
|
33523
33558
|
}
|
|
33524
33559
|
|
|
33560
|
+
// ../common/src/telemetry/pii-redactor.ts
|
|
33561
|
+
var REDACTED = "[REDACTED]";
|
|
33562
|
+
var MAX_VALUE_LENGTH = 200;
|
|
33563
|
+
var SENSITIVE_NAME_TOKENS = new Set([
|
|
33564
|
+
"token",
|
|
33565
|
+
"tokens",
|
|
33566
|
+
"secret",
|
|
33567
|
+
"secrets",
|
|
33568
|
+
"password",
|
|
33569
|
+
"passwords",
|
|
33570
|
+
"pwd",
|
|
33571
|
+
"credential",
|
|
33572
|
+
"credentials",
|
|
33573
|
+
"auth",
|
|
33574
|
+
"authentication",
|
|
33575
|
+
"authorization",
|
|
33576
|
+
"authority",
|
|
33577
|
+
"cert",
|
|
33578
|
+
"certificate",
|
|
33579
|
+
"certificates"
|
|
33580
|
+
]);
|
|
33581
|
+
var SENSITIVE_KEY_PREFIXES = new Set([
|
|
33582
|
+
"api",
|
|
33583
|
+
"access",
|
|
33584
|
+
"client",
|
|
33585
|
+
"private",
|
|
33586
|
+
"public",
|
|
33587
|
+
"signing",
|
|
33588
|
+
"encryption",
|
|
33589
|
+
"session",
|
|
33590
|
+
"master",
|
|
33591
|
+
"shared",
|
|
33592
|
+
"root",
|
|
33593
|
+
"ssh",
|
|
33594
|
+
"rsa",
|
|
33595
|
+
"aes",
|
|
33596
|
+
"hmac",
|
|
33597
|
+
"oauth"
|
|
33598
|
+
]);
|
|
33599
|
+
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;
|
|
33600
|
+
var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
33601
|
+
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
33602
|
+
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
33603
|
+
var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
33604
|
+
var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
33605
|
+
var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
|
|
33606
|
+
function shortHash(input) {
|
|
33607
|
+
let hash = 2166136261;
|
|
33608
|
+
for (let i = 0;i < input.length; i++) {
|
|
33609
|
+
hash ^= input.charCodeAt(i);
|
|
33610
|
+
hash = Math.imul(hash, 16777619);
|
|
33611
|
+
}
|
|
33612
|
+
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
33613
|
+
}
|
|
33614
|
+
function redactUrl(raw) {
|
|
33615
|
+
try {
|
|
33616
|
+
const url = new URL(raw);
|
|
33617
|
+
return `${url.protocol}//${url.host}`;
|
|
33618
|
+
} catch {
|
|
33619
|
+
return `url#${shortHash(raw)}`;
|
|
33620
|
+
}
|
|
33621
|
+
}
|
|
33622
|
+
function redactValueDetectors(value) {
|
|
33623
|
+
let out = value;
|
|
33624
|
+
out = out.replace(JWT_PATTERN, () => REDACTED);
|
|
33625
|
+
out = out.replace(URL_PATTERN, (match) => {
|
|
33626
|
+
const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
|
|
33627
|
+
const core2 = trailing ? match.slice(0, -trailing.length) : match;
|
|
33628
|
+
return `${redactUrl(core2)}${trailing}`;
|
|
33629
|
+
});
|
|
33630
|
+
out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
33631
|
+
out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
|
|
33632
|
+
out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
|
|
33633
|
+
out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
|
|
33634
|
+
if (out.length > MAX_VALUE_LENGTH) {
|
|
33635
|
+
out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
|
|
33636
|
+
}
|
|
33637
|
+
return out;
|
|
33638
|
+
}
|
|
33639
|
+
function redactValue(value) {
|
|
33640
|
+
return redactValueDetectors(value);
|
|
33641
|
+
}
|
|
33642
|
+
function redactError(error) {
|
|
33643
|
+
const safe = new Error(redactValueDetectors(error.message ?? ""));
|
|
33644
|
+
safe.name = error.name;
|
|
33645
|
+
safe.stack = typeof error.stack === "string" ? redactValueDetectors(error.stack) : undefined;
|
|
33646
|
+
return safe;
|
|
33647
|
+
}
|
|
33648
|
+
function nameTokens(name) {
|
|
33649
|
+
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);
|
|
33650
|
+
}
|
|
33651
|
+
function isSensitiveName(name) {
|
|
33652
|
+
const tokens = nameTokens(name);
|
|
33653
|
+
for (let i = 0;i < tokens.length; i++) {
|
|
33654
|
+
const token = tokens[i];
|
|
33655
|
+
if (SENSITIVE_NAME_TOKENS.has(token)) {
|
|
33656
|
+
return true;
|
|
33657
|
+
}
|
|
33658
|
+
if (token === "key" || token === "keys") {
|
|
33659
|
+
const prev = tokens[i - 1];
|
|
33660
|
+
if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
|
|
33661
|
+
return true;
|
|
33662
|
+
}
|
|
33663
|
+
}
|
|
33664
|
+
}
|
|
33665
|
+
return false;
|
|
33666
|
+
}
|
|
33667
|
+
function redactProperty(name, value) {
|
|
33668
|
+
if (value === undefined || value === null) {
|
|
33669
|
+
return;
|
|
33670
|
+
}
|
|
33671
|
+
if (isSensitiveName(name)) {
|
|
33672
|
+
return REDACTED;
|
|
33673
|
+
}
|
|
33674
|
+
if (typeof value === "boolean" || typeof value === "number") {
|
|
33675
|
+
return value;
|
|
33676
|
+
}
|
|
33677
|
+
if (typeof value !== "string") {
|
|
33678
|
+
return "[OBJECT]";
|
|
33679
|
+
}
|
|
33680
|
+
return redactValueDetectors(value);
|
|
33681
|
+
}
|
|
33682
|
+
function redactProperties(properties) {
|
|
33683
|
+
const out = {};
|
|
33684
|
+
for (const [name, value] of Object.entries(properties)) {
|
|
33685
|
+
const redacted = redactProperty(name, value);
|
|
33686
|
+
if (redacted !== undefined) {
|
|
33687
|
+
out[name] = redacted;
|
|
33688
|
+
}
|
|
33689
|
+
}
|
|
33690
|
+
return out;
|
|
33691
|
+
}
|
|
33692
|
+
|
|
33525
33693
|
// ../common/src/telemetry/telemetry-service.ts
|
|
33694
|
+
var TELEMETRY_OPERATION_ID_PROPERTY = "uip.trace.operation_id";
|
|
33695
|
+
var TELEMETRY_PARENT_ID_PROPERTY = "uip.trace.parent_id";
|
|
33696
|
+
var TELEMETRY_SPAN_ID_PROPERTY = "uip.trace.span_id";
|
|
33697
|
+
|
|
33526
33698
|
class TelemetryService {
|
|
33527
33699
|
telemetryProvider;
|
|
33528
33700
|
contextStorage;
|
|
@@ -33549,11 +33721,15 @@ class TelemetryService {
|
|
|
33549
33721
|
trackException(error, properties) {
|
|
33550
33722
|
const context = this.getCurrentContext();
|
|
33551
33723
|
const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
|
|
33552
|
-
this.telemetryProvider.trackException(error, enrichedProperties);
|
|
33724
|
+
this.telemetryProvider.trackException(redactError(error), enrichedProperties);
|
|
33553
33725
|
}
|
|
33554
33726
|
async trackRequest(name, fn, properties) {
|
|
33727
|
+
const parentContext = this.getCurrentContext();
|
|
33728
|
+
const operationId = parentContext?.operationId ?? this.operationId ?? getTelemetryOperationId();
|
|
33729
|
+
const parentId = parentContext ? parentContext.id : this.inboundParentIdFor(operationId);
|
|
33555
33730
|
const context = {
|
|
33556
|
-
operationId
|
|
33731
|
+
operationId,
|
|
33732
|
+
...parentId !== undefined ? { parentId } : {},
|
|
33557
33733
|
id: this.generateId()
|
|
33558
33734
|
};
|
|
33559
33735
|
const startTime = performance.now();
|
|
@@ -33571,6 +33747,45 @@ class TelemetryService {
|
|
|
33571
33747
|
throw error;
|
|
33572
33748
|
}
|
|
33573
33749
|
}
|
|
33750
|
+
trackRequestResult(name, durationMs, success, properties, context) {
|
|
33751
|
+
const requestContext = context ?? {
|
|
33752
|
+
operationId: this.operationId ?? getTelemetryOperationId(),
|
|
33753
|
+
id: this.generateId()
|
|
33754
|
+
};
|
|
33755
|
+
const enrichedProperties = this.enrichPropertiesWithContext(properties, requestContext);
|
|
33756
|
+
this.telemetryProvider.trackRequest(name, durationMs, success, enrichedProperties);
|
|
33757
|
+
}
|
|
33758
|
+
createRequestContext() {
|
|
33759
|
+
const operationId = this.operationId ?? getTelemetryOperationId();
|
|
33760
|
+
const parentId = this.inboundParentIdFor(operationId);
|
|
33761
|
+
return {
|
|
33762
|
+
operationId,
|
|
33763
|
+
...parentId !== undefined ? { parentId } : {},
|
|
33764
|
+
id: this.generateId()
|
|
33765
|
+
};
|
|
33766
|
+
}
|
|
33767
|
+
inboundParentIdFor(operationId) {
|
|
33768
|
+
const inbound = getInboundTraceContext();
|
|
33769
|
+
return inbound && inbound.traceId === operationId ? inbound.parentSpanId : undefined;
|
|
33770
|
+
}
|
|
33771
|
+
runWithContext(context, fn) {
|
|
33772
|
+
return this.contextStorage.run(context, fn);
|
|
33773
|
+
}
|
|
33774
|
+
createDependencyContext() {
|
|
33775
|
+
const parentContext = this.getCurrentContext();
|
|
33776
|
+
if (!parentContext) {
|
|
33777
|
+
return;
|
|
33778
|
+
}
|
|
33779
|
+
return {
|
|
33780
|
+
operationId: parentContext.operationId,
|
|
33781
|
+
parentId: parentContext.id,
|
|
33782
|
+
id: this.generateId()
|
|
33783
|
+
};
|
|
33784
|
+
}
|
|
33785
|
+
trackDependencyResult(name, type2, durationMs, success, properties, context, resultCode) {
|
|
33786
|
+
const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
|
|
33787
|
+
this.telemetryProvider.trackDependency(redactValue(name), type2, durationMs, success, enrichedProperties, resultCode);
|
|
33788
|
+
}
|
|
33574
33789
|
async trackDependencyOperation(name, type2, fn, properties) {
|
|
33575
33790
|
const parentContext = this.getCurrentContext();
|
|
33576
33791
|
if (!parentContext) {
|
|
@@ -33607,8 +33822,12 @@ class TelemetryService {
|
|
|
33607
33822
|
...getExecutionContextTelemetryProperties(),
|
|
33608
33823
|
...globalProperties,
|
|
33609
33824
|
...this.defaultProperties,
|
|
33610
|
-
...properties,
|
|
33611
|
-
...context
|
|
33825
|
+
...redactProperties(properties ?? {}),
|
|
33826
|
+
...context ? {
|
|
33827
|
+
[TELEMETRY_OPERATION_ID_PROPERTY]: context.operationId,
|
|
33828
|
+
...context.parentId !== undefined ? { [TELEMETRY_PARENT_ID_PROPERTY]: context.parentId } : {},
|
|
33829
|
+
[TELEMETRY_SPAN_ID_PROPERTY]: context.id
|
|
33830
|
+
} : {}
|
|
33612
33831
|
};
|
|
33613
33832
|
if (sessionId === undefined) {
|
|
33614
33833
|
delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
|
|
@@ -33618,7 +33837,16 @@ class TelemetryService {
|
|
|
33618
33837
|
return enriched;
|
|
33619
33838
|
}
|
|
33620
33839
|
generateId() {
|
|
33621
|
-
|
|
33840
|
+
const bytes = new Uint8Array(8);
|
|
33841
|
+
let hex = "";
|
|
33842
|
+
do {
|
|
33843
|
+
crypto.getRandomValues(bytes);
|
|
33844
|
+
hex = "";
|
|
33845
|
+
for (const byte of bytes) {
|
|
33846
|
+
hex += byte.toString(16).padStart(2, "0");
|
|
33847
|
+
}
|
|
33848
|
+
} while (/^0+$/.test(hex));
|
|
33849
|
+
return hex;
|
|
33622
33850
|
}
|
|
33623
33851
|
}
|
|
33624
33852
|
// ../common/src/telemetry/node-appinsights-telemetry-provider.ts
|
|
@@ -34321,134 +34549,11 @@ function buildCommandTelemetryAttribution(commandPath, skillSource) {
|
|
|
34321
34549
|
};
|
|
34322
34550
|
}
|
|
34323
34551
|
|
|
34324
|
-
// ../common/src/telemetry/pii-redactor.ts
|
|
34325
|
-
var REDACTED = "[REDACTED]";
|
|
34326
|
-
var MAX_VALUE_LENGTH = 200;
|
|
34327
|
-
var SENSITIVE_NAME_TOKENS = new Set([
|
|
34328
|
-
"token",
|
|
34329
|
-
"tokens",
|
|
34330
|
-
"secret",
|
|
34331
|
-
"secrets",
|
|
34332
|
-
"password",
|
|
34333
|
-
"passwords",
|
|
34334
|
-
"pwd",
|
|
34335
|
-
"credential",
|
|
34336
|
-
"credentials",
|
|
34337
|
-
"auth",
|
|
34338
|
-
"authentication",
|
|
34339
|
-
"authorization",
|
|
34340
|
-
"authority",
|
|
34341
|
-
"cert",
|
|
34342
|
-
"certificate",
|
|
34343
|
-
"certificates"
|
|
34344
|
-
]);
|
|
34345
|
-
var SENSITIVE_KEY_PREFIXES = new Set([
|
|
34346
|
-
"api",
|
|
34347
|
-
"access",
|
|
34348
|
-
"client",
|
|
34349
|
-
"private",
|
|
34350
|
-
"public",
|
|
34351
|
-
"signing",
|
|
34352
|
-
"encryption",
|
|
34353
|
-
"session",
|
|
34354
|
-
"master",
|
|
34355
|
-
"shared",
|
|
34356
|
-
"root",
|
|
34357
|
-
"ssh",
|
|
34358
|
-
"rsa",
|
|
34359
|
-
"aes",
|
|
34360
|
-
"hmac",
|
|
34361
|
-
"oauth"
|
|
34362
|
-
]);
|
|
34363
|
-
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;
|
|
34364
|
-
var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
34365
|
-
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
34366
|
-
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
34367
|
-
var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
34368
|
-
var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
34369
|
-
var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
|
|
34370
|
-
function shortHash(input) {
|
|
34371
|
-
let hash = 2166136261;
|
|
34372
|
-
for (let i = 0;i < input.length; i++) {
|
|
34373
|
-
hash ^= input.charCodeAt(i);
|
|
34374
|
-
hash = Math.imul(hash, 16777619);
|
|
34375
|
-
}
|
|
34376
|
-
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
34377
|
-
}
|
|
34378
|
-
function redactUrl(raw) {
|
|
34379
|
-
try {
|
|
34380
|
-
const url = new URL(raw);
|
|
34381
|
-
return `${url.protocol}//${url.host}`;
|
|
34382
|
-
} catch {
|
|
34383
|
-
return `url#${shortHash(raw)}`;
|
|
34384
|
-
}
|
|
34385
|
-
}
|
|
34386
|
-
function redactValueDetectors(value) {
|
|
34387
|
-
let out = value;
|
|
34388
|
-
out = out.replace(JWT_PATTERN, () => REDACTED);
|
|
34389
|
-
out = out.replace(URL_PATTERN, (match) => {
|
|
34390
|
-
const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
|
|
34391
|
-
const core2 = trailing ? match.slice(0, -trailing.length) : match;
|
|
34392
|
-
return `${redactUrl(core2)}${trailing}`;
|
|
34393
|
-
});
|
|
34394
|
-
out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
34395
|
-
out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
|
|
34396
|
-
out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
|
|
34397
|
-
out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
|
|
34398
|
-
if (out.length > MAX_VALUE_LENGTH) {
|
|
34399
|
-
out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
|
|
34400
|
-
}
|
|
34401
|
-
return out;
|
|
34402
|
-
}
|
|
34403
|
-
function nameTokens(name) {
|
|
34404
|
-
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);
|
|
34405
|
-
}
|
|
34406
|
-
function isSensitiveName(name) {
|
|
34407
|
-
const tokens = nameTokens(name);
|
|
34408
|
-
for (let i = 0;i < tokens.length; i++) {
|
|
34409
|
-
const token = tokens[i];
|
|
34410
|
-
if (SENSITIVE_NAME_TOKENS.has(token)) {
|
|
34411
|
-
return true;
|
|
34412
|
-
}
|
|
34413
|
-
if (token === "key" || token === "keys") {
|
|
34414
|
-
const prev = tokens[i - 1];
|
|
34415
|
-
if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
|
|
34416
|
-
return true;
|
|
34417
|
-
}
|
|
34418
|
-
}
|
|
34419
|
-
}
|
|
34420
|
-
return false;
|
|
34421
|
-
}
|
|
34422
|
-
function redactProperty(name, value) {
|
|
34423
|
-
if (value === undefined || value === null) {
|
|
34424
|
-
return;
|
|
34425
|
-
}
|
|
34426
|
-
if (isSensitiveName(name)) {
|
|
34427
|
-
return REDACTED;
|
|
34428
|
-
}
|
|
34429
|
-
if (typeof value === "boolean" || typeof value === "number") {
|
|
34430
|
-
return value;
|
|
34431
|
-
}
|
|
34432
|
-
if (typeof value !== "string") {
|
|
34433
|
-
return "[OBJECT]";
|
|
34434
|
-
}
|
|
34435
|
-
return redactValueDetectors(value);
|
|
34436
|
-
}
|
|
34437
|
-
function redactProperties(properties) {
|
|
34438
|
-
const out = {};
|
|
34439
|
-
for (const [name, value] of Object.entries(properties)) {
|
|
34440
|
-
const redacted = redactProperty(name, value);
|
|
34441
|
-
if (redacted !== undefined) {
|
|
34442
|
-
out[name] = redacted;
|
|
34443
|
-
}
|
|
34444
|
-
}
|
|
34445
|
-
return out;
|
|
34446
|
-
}
|
|
34447
|
-
|
|
34448
34552
|
// ../common/src/trackedAction.ts
|
|
34449
34553
|
var pollSignalSlot = singleton("PollSignal");
|
|
34450
34554
|
var cliErrorCodeValues = new Set(CLI_ERROR_CODES);
|
|
34451
34555
|
var retryHintValues = new Set(RETRY_HINTS);
|
|
34556
|
+
var TELEMETRY_COMMAND_ARG_PREFIX = "uip.cmd.arg.";
|
|
34452
34557
|
var processContext = {
|
|
34453
34558
|
exit: (code) => {
|
|
34454
34559
|
process.exitCode = code;
|
|
@@ -34459,22 +34564,18 @@ var processContext = {
|
|
|
34459
34564
|
};
|
|
34460
34565
|
function extractCommandParams(cmd) {
|
|
34461
34566
|
const params = {};
|
|
34567
|
+
const add2 = (name, value) => {
|
|
34568
|
+
if (name && value !== undefined) {
|
|
34569
|
+
params[`${TELEMETRY_COMMAND_ARG_PREFIX}${name}`] = value;
|
|
34570
|
+
}
|
|
34571
|
+
};
|
|
34462
34572
|
const registered = cmd.registeredArguments ?? [];
|
|
34463
34573
|
const processed = cmd.processedArgs ?? [];
|
|
34464
34574
|
for (let i = 0;i < registered.length; i++) {
|
|
34465
|
-
|
|
34466
|
-
if (value === undefined) {
|
|
34467
|
-
continue;
|
|
34468
|
-
}
|
|
34469
|
-
const name = registered[i].name();
|
|
34470
|
-
if (name) {
|
|
34471
|
-
params[name] = value;
|
|
34472
|
-
}
|
|
34575
|
+
add2(registered[i].name(), processed[i]);
|
|
34473
34576
|
}
|
|
34474
34577
|
for (const [key, value] of Object.entries(cmd.opts())) {
|
|
34475
|
-
|
|
34476
|
-
params[key] = value;
|
|
34477
|
-
}
|
|
34578
|
+
add2(key, value);
|
|
34478
34579
|
}
|
|
34479
34580
|
return params;
|
|
34480
34581
|
}
|
|
@@ -34517,11 +34618,12 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
34517
34618
|
return this.action(async (...args) => {
|
|
34518
34619
|
const telemetryName = deriveCommandPath(command);
|
|
34519
34620
|
const props = typeof properties === "function" ? properties(...args) : properties;
|
|
34621
|
+
const requestContext = telemetry.createRequestContext();
|
|
34520
34622
|
const startTime = performance.now();
|
|
34521
34623
|
let errorMessage;
|
|
34522
34624
|
let fallbackExitCode = EXIT_CODES.Success;
|
|
34523
34625
|
clearRecordedCommandFailureTelemetry();
|
|
34524
|
-
const [error] = await catchError(fn(...args));
|
|
34626
|
+
const [error] = await catchError(telemetry.runWithContext(requestContext, () => fn(...args)));
|
|
34525
34627
|
if (error) {
|
|
34526
34628
|
errorMessage = error instanceof Error ? error.message : String(error);
|
|
34527
34629
|
logger.debug(`[trackedAction] ${telemetryName} failed: ${errorMessage}`);
|
|
@@ -34557,16 +34659,21 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
34557
34659
|
recordedFailure,
|
|
34558
34660
|
pollSignal: context.pollSignal
|
|
34559
34661
|
});
|
|
34560
|
-
|
|
34561
|
-
|
|
34662
|
+
const commandParams = extractCommandParams(command);
|
|
34663
|
+
if (props) {
|
|
34664
|
+
for (const key of Object.keys(props)) {
|
|
34665
|
+
delete commandParams[`${TELEMETRY_COMMAND_ARG_PREFIX}${key}`];
|
|
34666
|
+
}
|
|
34667
|
+
}
|
|
34668
|
+
const baseProperties = redactProperties({
|
|
34669
|
+
...commandParams,
|
|
34562
34670
|
...props,
|
|
34563
34671
|
...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
|
|
34564
34672
|
command: "true",
|
|
34565
|
-
duration: String(durationMs),
|
|
34566
|
-
success: String(success),
|
|
34567
34673
|
...terminalTelemetry,
|
|
34568
34674
|
...errorMessage ? { errorMessage } : {}
|
|
34569
|
-
})
|
|
34675
|
+
});
|
|
34676
|
+
telemetry.trackRequestResult(telemetryName, durationMs, success, baseProperties, requestContext);
|
|
34570
34677
|
});
|
|
34571
34678
|
};
|
|
34572
34679
|
// ../common/src/console-guard.ts
|
|
@@ -46742,4 +46849,4 @@ export {
|
|
|
46742
46849
|
metadata
|
|
46743
46850
|
};
|
|
46744
46851
|
|
|
46745
|
-
//# debugId=
|
|
46852
|
+
//# debugId=4CD2A3A87D0E48CB64756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/tasks-tool",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "1.199.0-preview.
|
|
4
|
+
"version": "1.199.0-preview.97",
|
|
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": "087ae21e842f27bde5eb0013892c9487bfe60568"
|
|
18
18
|
}
|