@uipath/aops-tool 1.198.0-preview.95 → 1.198.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tool.js +257 -150
- package/package.json +2 -2
package/dist/tool.js
CHANGED
|
@@ -21230,7 +21230,7 @@ var init_server = __esm(() => {
|
|
|
21230
21230
|
var package_default = {
|
|
21231
21231
|
name: "@uipath/aops-tool",
|
|
21232
21232
|
license: "MIT",
|
|
21233
|
-
version: "1.198.0
|
|
21233
|
+
version: "1.198.0",
|
|
21234
21234
|
description: "Manage UiPath StudioAdmin AOps — connections, repos, projects, solutions, pipelines, executions.",
|
|
21235
21235
|
private: false,
|
|
21236
21236
|
repository: {
|
|
@@ -27413,11 +27413,36 @@ class NodeContextStorage {
|
|
|
27413
27413
|
return this.storage.getStore();
|
|
27414
27414
|
}
|
|
27415
27415
|
}
|
|
27416
|
+
// ../common/src/telemetry/trace-context.ts
|
|
27417
|
+
var TELEMETRY_TRACEPARENT_ENV = "TRACEPARENT";
|
|
27418
|
+
var TRACEPARENT_PATTERN = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/;
|
|
27419
|
+
function getProcessEnv() {
|
|
27420
|
+
return globalThis.process?.env;
|
|
27421
|
+
}
|
|
27422
|
+
function parseInboundTraceparent(value) {
|
|
27423
|
+
if (!value) {
|
|
27424
|
+
return;
|
|
27425
|
+
}
|
|
27426
|
+
const match = TRACEPARENT_PATTERN.exec(value.trim().toLowerCase());
|
|
27427
|
+
if (!match) {
|
|
27428
|
+
return;
|
|
27429
|
+
}
|
|
27430
|
+
const [, traceId, parentSpanId] = match;
|
|
27431
|
+
if (/^0+$/.test(traceId) || /^0+$/.test(parentSpanId)) {
|
|
27432
|
+
return;
|
|
27433
|
+
}
|
|
27434
|
+
return { traceId, parentSpanId };
|
|
27435
|
+
}
|
|
27436
|
+
function getInboundTraceContext() {
|
|
27437
|
+
return parseInboundTraceparent(getProcessEnv()?.[TELEMETRY_TRACEPARENT_ENV]);
|
|
27438
|
+
}
|
|
27439
|
+
|
|
27416
27440
|
// ../common/src/telemetry/session-id.ts
|
|
27417
27441
|
var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
|
|
27418
27442
|
var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
|
|
27419
27443
|
var telemetrySessionIdSlot = singleton("TelemetrySessionId");
|
|
27420
|
-
|
|
27444
|
+
var telemetryOperationIdSlot = singleton("TelemetryOperationId");
|
|
27445
|
+
function getProcessEnv2() {
|
|
27421
27446
|
return globalThis.process?.env;
|
|
27422
27447
|
}
|
|
27423
27448
|
function normalizeSessionId(value) {
|
|
@@ -27428,18 +27453,165 @@ function normalizeSessionId(value) {
|
|
|
27428
27453
|
return trimmed || undefined;
|
|
27429
27454
|
}
|
|
27430
27455
|
function getConfiguredTelemetrySessionId() {
|
|
27431
|
-
return normalizeSessionId(
|
|
27456
|
+
return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
|
|
27432
27457
|
}
|
|
27433
27458
|
function resolveTelemetrySessionId(existingSessionId) {
|
|
27434
27459
|
return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
|
|
27435
27460
|
}
|
|
27461
|
+
function getTelemetryOperationId() {
|
|
27462
|
+
const existing = telemetryOperationIdSlot.get();
|
|
27463
|
+
if (existing) {
|
|
27464
|
+
return existing;
|
|
27465
|
+
}
|
|
27466
|
+
const inboundTraceId = getInboundTraceContext()?.traceId;
|
|
27467
|
+
const generated = inboundTraceId ?? crypto.randomUUID().replaceAll("-", "");
|
|
27468
|
+
telemetryOperationIdSlot.set(generated);
|
|
27469
|
+
return generated;
|
|
27470
|
+
}
|
|
27436
27471
|
// ../common/src/telemetry/global-telemetry-properties.ts
|
|
27437
27472
|
var telemetryPropsSlot = singleton("TelemetryDefaultProps");
|
|
27438
27473
|
function getGlobalTelemetryProperties() {
|
|
27439
27474
|
return telemetryPropsSlot.get();
|
|
27440
27475
|
}
|
|
27441
27476
|
|
|
27477
|
+
// ../common/src/telemetry/pii-redactor.ts
|
|
27478
|
+
var REDACTED = "[REDACTED]";
|
|
27479
|
+
var MAX_VALUE_LENGTH = 200;
|
|
27480
|
+
var SENSITIVE_NAME_TOKENS = new Set([
|
|
27481
|
+
"token",
|
|
27482
|
+
"tokens",
|
|
27483
|
+
"secret",
|
|
27484
|
+
"secrets",
|
|
27485
|
+
"password",
|
|
27486
|
+
"passwords",
|
|
27487
|
+
"pwd",
|
|
27488
|
+
"credential",
|
|
27489
|
+
"credentials",
|
|
27490
|
+
"auth",
|
|
27491
|
+
"authentication",
|
|
27492
|
+
"authorization",
|
|
27493
|
+
"authority",
|
|
27494
|
+
"cert",
|
|
27495
|
+
"certificate",
|
|
27496
|
+
"certificates"
|
|
27497
|
+
]);
|
|
27498
|
+
var SENSITIVE_KEY_PREFIXES = new Set([
|
|
27499
|
+
"api",
|
|
27500
|
+
"access",
|
|
27501
|
+
"client",
|
|
27502
|
+
"private",
|
|
27503
|
+
"public",
|
|
27504
|
+
"signing",
|
|
27505
|
+
"encryption",
|
|
27506
|
+
"session",
|
|
27507
|
+
"master",
|
|
27508
|
+
"shared",
|
|
27509
|
+
"root",
|
|
27510
|
+
"ssh",
|
|
27511
|
+
"rsa",
|
|
27512
|
+
"aes",
|
|
27513
|
+
"hmac",
|
|
27514
|
+
"oauth"
|
|
27515
|
+
]);
|
|
27516
|
+
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;
|
|
27517
|
+
var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
27518
|
+
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
27519
|
+
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
27520
|
+
var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
27521
|
+
var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
27522
|
+
var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
|
|
27523
|
+
function shortHash(input) {
|
|
27524
|
+
let hash = 2166136261;
|
|
27525
|
+
for (let i = 0;i < input.length; i++) {
|
|
27526
|
+
hash ^= input.charCodeAt(i);
|
|
27527
|
+
hash = Math.imul(hash, 16777619);
|
|
27528
|
+
}
|
|
27529
|
+
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
27530
|
+
}
|
|
27531
|
+
function redactUrl(raw) {
|
|
27532
|
+
try {
|
|
27533
|
+
const url = new URL(raw);
|
|
27534
|
+
return `${url.protocol}//${url.host}`;
|
|
27535
|
+
} catch {
|
|
27536
|
+
return `url#${shortHash(raw)}`;
|
|
27537
|
+
}
|
|
27538
|
+
}
|
|
27539
|
+
function redactValueDetectors(value) {
|
|
27540
|
+
let out = value;
|
|
27541
|
+
out = out.replace(JWT_PATTERN, () => REDACTED);
|
|
27542
|
+
out = out.replace(URL_PATTERN, (match) => {
|
|
27543
|
+
const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
|
|
27544
|
+
const core2 = trailing ? match.slice(0, -trailing.length) : match;
|
|
27545
|
+
return `${redactUrl(core2)}${trailing}`;
|
|
27546
|
+
});
|
|
27547
|
+
out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
27548
|
+
out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
|
|
27549
|
+
out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
|
|
27550
|
+
out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
|
|
27551
|
+
if (out.length > MAX_VALUE_LENGTH) {
|
|
27552
|
+
out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
|
|
27553
|
+
}
|
|
27554
|
+
return out;
|
|
27555
|
+
}
|
|
27556
|
+
function redactValue(value) {
|
|
27557
|
+
return redactValueDetectors(value);
|
|
27558
|
+
}
|
|
27559
|
+
function redactError(error) {
|
|
27560
|
+
const safe = new Error(redactValueDetectors(error.message ?? ""));
|
|
27561
|
+
safe.name = error.name;
|
|
27562
|
+
safe.stack = typeof error.stack === "string" ? redactValueDetectors(error.stack) : undefined;
|
|
27563
|
+
return safe;
|
|
27564
|
+
}
|
|
27565
|
+
function nameTokens(name) {
|
|
27566
|
+
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);
|
|
27567
|
+
}
|
|
27568
|
+
function isSensitiveName(name) {
|
|
27569
|
+
const tokens = nameTokens(name);
|
|
27570
|
+
for (let i = 0;i < tokens.length; i++) {
|
|
27571
|
+
const token = tokens[i];
|
|
27572
|
+
if (SENSITIVE_NAME_TOKENS.has(token)) {
|
|
27573
|
+
return true;
|
|
27574
|
+
}
|
|
27575
|
+
if (token === "key" || token === "keys") {
|
|
27576
|
+
const prev = tokens[i - 1];
|
|
27577
|
+
if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
|
|
27578
|
+
return true;
|
|
27579
|
+
}
|
|
27580
|
+
}
|
|
27581
|
+
}
|
|
27582
|
+
return false;
|
|
27583
|
+
}
|
|
27584
|
+
function redactProperty(name, value) {
|
|
27585
|
+
if (value === undefined || value === null) {
|
|
27586
|
+
return;
|
|
27587
|
+
}
|
|
27588
|
+
if (isSensitiveName(name)) {
|
|
27589
|
+
return REDACTED;
|
|
27590
|
+
}
|
|
27591
|
+
if (typeof value === "boolean" || typeof value === "number") {
|
|
27592
|
+
return value;
|
|
27593
|
+
}
|
|
27594
|
+
if (typeof value !== "string") {
|
|
27595
|
+
return "[OBJECT]";
|
|
27596
|
+
}
|
|
27597
|
+
return redactValueDetectors(value);
|
|
27598
|
+
}
|
|
27599
|
+
function redactProperties(properties) {
|
|
27600
|
+
const out = {};
|
|
27601
|
+
for (const [name, value] of Object.entries(properties)) {
|
|
27602
|
+
const redacted = redactProperty(name, value);
|
|
27603
|
+
if (redacted !== undefined) {
|
|
27604
|
+
out[name] = redacted;
|
|
27605
|
+
}
|
|
27606
|
+
}
|
|
27607
|
+
return out;
|
|
27608
|
+
}
|
|
27609
|
+
|
|
27442
27610
|
// ../common/src/telemetry/telemetry-service.ts
|
|
27611
|
+
var TELEMETRY_OPERATION_ID_PROPERTY = "uip.trace.operation_id";
|
|
27612
|
+
var TELEMETRY_PARENT_ID_PROPERTY = "uip.trace.parent_id";
|
|
27613
|
+
var TELEMETRY_SPAN_ID_PROPERTY = "uip.trace.span_id";
|
|
27614
|
+
|
|
27443
27615
|
class TelemetryService {
|
|
27444
27616
|
telemetryProvider;
|
|
27445
27617
|
contextStorage;
|
|
@@ -27466,11 +27638,15 @@ class TelemetryService {
|
|
|
27466
27638
|
trackException(error, properties) {
|
|
27467
27639
|
const context = this.getCurrentContext();
|
|
27468
27640
|
const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
|
|
27469
|
-
this.telemetryProvider.trackException(error, enrichedProperties);
|
|
27641
|
+
this.telemetryProvider.trackException(redactError(error), enrichedProperties);
|
|
27470
27642
|
}
|
|
27471
27643
|
async trackRequest(name, fn, properties) {
|
|
27644
|
+
const parentContext = this.getCurrentContext();
|
|
27645
|
+
const operationId = parentContext?.operationId ?? this.operationId ?? getTelemetryOperationId();
|
|
27646
|
+
const parentId = parentContext ? parentContext.id : this.inboundParentIdFor(operationId);
|
|
27472
27647
|
const context = {
|
|
27473
|
-
operationId
|
|
27648
|
+
operationId,
|
|
27649
|
+
...parentId !== undefined ? { parentId } : {},
|
|
27474
27650
|
id: this.generateId()
|
|
27475
27651
|
};
|
|
27476
27652
|
const startTime = performance.now();
|
|
@@ -27488,6 +27664,45 @@ class TelemetryService {
|
|
|
27488
27664
|
throw error;
|
|
27489
27665
|
}
|
|
27490
27666
|
}
|
|
27667
|
+
trackRequestResult(name, durationMs, success, properties, context) {
|
|
27668
|
+
const requestContext = context ?? {
|
|
27669
|
+
operationId: this.operationId ?? getTelemetryOperationId(),
|
|
27670
|
+
id: this.generateId()
|
|
27671
|
+
};
|
|
27672
|
+
const enrichedProperties = this.enrichPropertiesWithContext(properties, requestContext);
|
|
27673
|
+
this.telemetryProvider.trackRequest(name, durationMs, success, enrichedProperties);
|
|
27674
|
+
}
|
|
27675
|
+
createRequestContext() {
|
|
27676
|
+
const operationId = this.operationId ?? getTelemetryOperationId();
|
|
27677
|
+
const parentId = this.inboundParentIdFor(operationId);
|
|
27678
|
+
return {
|
|
27679
|
+
operationId,
|
|
27680
|
+
...parentId !== undefined ? { parentId } : {},
|
|
27681
|
+
id: this.generateId()
|
|
27682
|
+
};
|
|
27683
|
+
}
|
|
27684
|
+
inboundParentIdFor(operationId) {
|
|
27685
|
+
const inbound = getInboundTraceContext();
|
|
27686
|
+
return inbound && inbound.traceId === operationId ? inbound.parentSpanId : undefined;
|
|
27687
|
+
}
|
|
27688
|
+
runWithContext(context, fn) {
|
|
27689
|
+
return this.contextStorage.run(context, fn);
|
|
27690
|
+
}
|
|
27691
|
+
createDependencyContext() {
|
|
27692
|
+
const parentContext = this.getCurrentContext();
|
|
27693
|
+
if (!parentContext) {
|
|
27694
|
+
return;
|
|
27695
|
+
}
|
|
27696
|
+
return {
|
|
27697
|
+
operationId: parentContext.operationId,
|
|
27698
|
+
parentId: parentContext.id,
|
|
27699
|
+
id: this.generateId()
|
|
27700
|
+
};
|
|
27701
|
+
}
|
|
27702
|
+
trackDependencyResult(name, type2, durationMs, success, properties, context, resultCode) {
|
|
27703
|
+
const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
|
|
27704
|
+
this.telemetryProvider.trackDependency(redactValue(name), type2, durationMs, success, enrichedProperties, resultCode);
|
|
27705
|
+
}
|
|
27491
27706
|
async trackDependencyOperation(name, type2, fn, properties) {
|
|
27492
27707
|
const parentContext = this.getCurrentContext();
|
|
27493
27708
|
if (!parentContext) {
|
|
@@ -27524,8 +27739,12 @@ class TelemetryService {
|
|
|
27524
27739
|
...getExecutionContextTelemetryProperties(),
|
|
27525
27740
|
...globalProperties,
|
|
27526
27741
|
...this.defaultProperties,
|
|
27527
|
-
...properties,
|
|
27528
|
-
...context
|
|
27742
|
+
...redactProperties(properties ?? {}),
|
|
27743
|
+
...context ? {
|
|
27744
|
+
[TELEMETRY_OPERATION_ID_PROPERTY]: context.operationId,
|
|
27745
|
+
...context.parentId !== undefined ? { [TELEMETRY_PARENT_ID_PROPERTY]: context.parentId } : {},
|
|
27746
|
+
[TELEMETRY_SPAN_ID_PROPERTY]: context.id
|
|
27747
|
+
} : {}
|
|
27529
27748
|
};
|
|
27530
27749
|
if (sessionId === undefined) {
|
|
27531
27750
|
delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
|
|
@@ -27535,7 +27754,16 @@ class TelemetryService {
|
|
|
27535
27754
|
return enriched;
|
|
27536
27755
|
}
|
|
27537
27756
|
generateId() {
|
|
27538
|
-
|
|
27757
|
+
const bytes = new Uint8Array(8);
|
|
27758
|
+
let hex = "";
|
|
27759
|
+
do {
|
|
27760
|
+
crypto.getRandomValues(bytes);
|
|
27761
|
+
hex = "";
|
|
27762
|
+
for (const byte of bytes) {
|
|
27763
|
+
hex += byte.toString(16).padStart(2, "0");
|
|
27764
|
+
}
|
|
27765
|
+
} while (/^0+$/.test(hex));
|
|
27766
|
+
return hex;
|
|
27539
27767
|
}
|
|
27540
27768
|
}
|
|
27541
27769
|
// ../common/src/telemetry/node-appinsights-telemetry-provider.ts
|
|
@@ -28237,134 +28465,11 @@ function buildCommandTelemetryAttribution(commandPath, skillSource) {
|
|
|
28237
28465
|
};
|
|
28238
28466
|
}
|
|
28239
28467
|
|
|
28240
|
-
// ../common/src/telemetry/pii-redactor.ts
|
|
28241
|
-
var REDACTED = "[REDACTED]";
|
|
28242
|
-
var MAX_VALUE_LENGTH = 200;
|
|
28243
|
-
var SENSITIVE_NAME_TOKENS = new Set([
|
|
28244
|
-
"token",
|
|
28245
|
-
"tokens",
|
|
28246
|
-
"secret",
|
|
28247
|
-
"secrets",
|
|
28248
|
-
"password",
|
|
28249
|
-
"passwords",
|
|
28250
|
-
"pwd",
|
|
28251
|
-
"credential",
|
|
28252
|
-
"credentials",
|
|
28253
|
-
"auth",
|
|
28254
|
-
"authentication",
|
|
28255
|
-
"authorization",
|
|
28256
|
-
"authority",
|
|
28257
|
-
"cert",
|
|
28258
|
-
"certificate",
|
|
28259
|
-
"certificates"
|
|
28260
|
-
]);
|
|
28261
|
-
var SENSITIVE_KEY_PREFIXES = new Set([
|
|
28262
|
-
"api",
|
|
28263
|
-
"access",
|
|
28264
|
-
"client",
|
|
28265
|
-
"private",
|
|
28266
|
-
"public",
|
|
28267
|
-
"signing",
|
|
28268
|
-
"encryption",
|
|
28269
|
-
"session",
|
|
28270
|
-
"master",
|
|
28271
|
-
"shared",
|
|
28272
|
-
"root",
|
|
28273
|
-
"ssh",
|
|
28274
|
-
"rsa",
|
|
28275
|
-
"aes",
|
|
28276
|
-
"hmac",
|
|
28277
|
-
"oauth"
|
|
28278
|
-
]);
|
|
28279
|
-
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;
|
|
28280
|
-
var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
28281
|
-
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
28282
|
-
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
28283
|
-
var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
28284
|
-
var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
28285
|
-
var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
|
|
28286
|
-
function shortHash(input) {
|
|
28287
|
-
let hash = 2166136261;
|
|
28288
|
-
for (let i = 0;i < input.length; i++) {
|
|
28289
|
-
hash ^= input.charCodeAt(i);
|
|
28290
|
-
hash = Math.imul(hash, 16777619);
|
|
28291
|
-
}
|
|
28292
|
-
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
28293
|
-
}
|
|
28294
|
-
function redactUrl(raw) {
|
|
28295
|
-
try {
|
|
28296
|
-
const url = new URL(raw);
|
|
28297
|
-
return `${url.protocol}//${url.host}`;
|
|
28298
|
-
} catch {
|
|
28299
|
-
return `url#${shortHash(raw)}`;
|
|
28300
|
-
}
|
|
28301
|
-
}
|
|
28302
|
-
function redactValueDetectors(value) {
|
|
28303
|
-
let out = value;
|
|
28304
|
-
out = out.replace(JWT_PATTERN, () => REDACTED);
|
|
28305
|
-
out = out.replace(URL_PATTERN, (match) => {
|
|
28306
|
-
const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
|
|
28307
|
-
const core2 = trailing ? match.slice(0, -trailing.length) : match;
|
|
28308
|
-
return `${redactUrl(core2)}${trailing}`;
|
|
28309
|
-
});
|
|
28310
|
-
out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
28311
|
-
out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
|
|
28312
|
-
out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
|
|
28313
|
-
out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
|
|
28314
|
-
if (out.length > MAX_VALUE_LENGTH) {
|
|
28315
|
-
out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
|
|
28316
|
-
}
|
|
28317
|
-
return out;
|
|
28318
|
-
}
|
|
28319
|
-
function nameTokens(name) {
|
|
28320
|
-
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);
|
|
28321
|
-
}
|
|
28322
|
-
function isSensitiveName(name) {
|
|
28323
|
-
const tokens = nameTokens(name);
|
|
28324
|
-
for (let i = 0;i < tokens.length; i++) {
|
|
28325
|
-
const token = tokens[i];
|
|
28326
|
-
if (SENSITIVE_NAME_TOKENS.has(token)) {
|
|
28327
|
-
return true;
|
|
28328
|
-
}
|
|
28329
|
-
if (token === "key" || token === "keys") {
|
|
28330
|
-
const prev = tokens[i - 1];
|
|
28331
|
-
if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
|
|
28332
|
-
return true;
|
|
28333
|
-
}
|
|
28334
|
-
}
|
|
28335
|
-
}
|
|
28336
|
-
return false;
|
|
28337
|
-
}
|
|
28338
|
-
function redactProperty(name, value) {
|
|
28339
|
-
if (value === undefined || value === null) {
|
|
28340
|
-
return;
|
|
28341
|
-
}
|
|
28342
|
-
if (isSensitiveName(name)) {
|
|
28343
|
-
return REDACTED;
|
|
28344
|
-
}
|
|
28345
|
-
if (typeof value === "boolean" || typeof value === "number") {
|
|
28346
|
-
return value;
|
|
28347
|
-
}
|
|
28348
|
-
if (typeof value !== "string") {
|
|
28349
|
-
return "[OBJECT]";
|
|
28350
|
-
}
|
|
28351
|
-
return redactValueDetectors(value);
|
|
28352
|
-
}
|
|
28353
|
-
function redactProperties(properties) {
|
|
28354
|
-
const out = {};
|
|
28355
|
-
for (const [name, value] of Object.entries(properties)) {
|
|
28356
|
-
const redacted = redactProperty(name, value);
|
|
28357
|
-
if (redacted !== undefined) {
|
|
28358
|
-
out[name] = redacted;
|
|
28359
|
-
}
|
|
28360
|
-
}
|
|
28361
|
-
return out;
|
|
28362
|
-
}
|
|
28363
|
-
|
|
28364
28468
|
// ../common/src/trackedAction.ts
|
|
28365
28469
|
var pollSignalSlot = singleton("PollSignal");
|
|
28366
28470
|
var cliErrorCodeValues = new Set(CLI_ERROR_CODES);
|
|
28367
28471
|
var retryHintValues = new Set(RETRY_HINTS);
|
|
28472
|
+
var TELEMETRY_COMMAND_ARG_PREFIX = "uip.cmd.arg.";
|
|
28368
28473
|
var processContext = {
|
|
28369
28474
|
exit: (code) => {
|
|
28370
28475
|
process.exitCode = code;
|
|
@@ -28375,22 +28480,18 @@ var processContext = {
|
|
|
28375
28480
|
};
|
|
28376
28481
|
function extractCommandParams(cmd) {
|
|
28377
28482
|
const params = {};
|
|
28483
|
+
const add2 = (name, value) => {
|
|
28484
|
+
if (name && value !== undefined) {
|
|
28485
|
+
params[`${TELEMETRY_COMMAND_ARG_PREFIX}${name}`] = value;
|
|
28486
|
+
}
|
|
28487
|
+
};
|
|
28378
28488
|
const registered = cmd.registeredArguments ?? [];
|
|
28379
28489
|
const processed = cmd.processedArgs ?? [];
|
|
28380
28490
|
for (let i = 0;i < registered.length; i++) {
|
|
28381
|
-
|
|
28382
|
-
if (value === undefined) {
|
|
28383
|
-
continue;
|
|
28384
|
-
}
|
|
28385
|
-
const name = registered[i].name();
|
|
28386
|
-
if (name) {
|
|
28387
|
-
params[name] = value;
|
|
28388
|
-
}
|
|
28491
|
+
add2(registered[i].name(), processed[i]);
|
|
28389
28492
|
}
|
|
28390
28493
|
for (const [key, value] of Object.entries(cmd.opts())) {
|
|
28391
|
-
|
|
28392
|
-
params[key] = value;
|
|
28393
|
-
}
|
|
28494
|
+
add2(key, value);
|
|
28394
28495
|
}
|
|
28395
28496
|
return params;
|
|
28396
28497
|
}
|
|
@@ -28433,11 +28534,12 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
28433
28534
|
return this.action(async (...args) => {
|
|
28434
28535
|
const telemetryName = deriveCommandPath(command);
|
|
28435
28536
|
const props = typeof properties === "function" ? properties(...args) : properties;
|
|
28537
|
+
const requestContext = telemetry.createRequestContext();
|
|
28436
28538
|
const startTime = performance.now();
|
|
28437
28539
|
let errorMessage;
|
|
28438
28540
|
let fallbackExitCode = EXIT_CODES.Success;
|
|
28439
28541
|
clearRecordedCommandFailureTelemetry();
|
|
28440
|
-
const [error] = await catchError(fn(...args));
|
|
28542
|
+
const [error] = await catchError(telemetry.runWithContext(requestContext, () => fn(...args)));
|
|
28441
28543
|
if (error) {
|
|
28442
28544
|
errorMessage = error instanceof Error ? error.message : String(error);
|
|
28443
28545
|
logger.debug(`[trackedAction] ${telemetryName} failed: ${errorMessage}`);
|
|
@@ -28473,16 +28575,21 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
28473
28575
|
recordedFailure,
|
|
28474
28576
|
pollSignal: context.pollSignal
|
|
28475
28577
|
});
|
|
28476
|
-
|
|
28477
|
-
|
|
28578
|
+
const commandParams = extractCommandParams(command);
|
|
28579
|
+
if (props) {
|
|
28580
|
+
for (const key of Object.keys(props)) {
|
|
28581
|
+
delete commandParams[`${TELEMETRY_COMMAND_ARG_PREFIX}${key}`];
|
|
28582
|
+
}
|
|
28583
|
+
}
|
|
28584
|
+
const baseProperties = redactProperties({
|
|
28585
|
+
...commandParams,
|
|
28478
28586
|
...props,
|
|
28479
28587
|
...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
|
|
28480
28588
|
command: "true",
|
|
28481
|
-
duration: String(durationMs),
|
|
28482
|
-
success: String(success),
|
|
28483
28589
|
...terminalTelemetry,
|
|
28484
28590
|
...errorMessage ? { errorMessage } : {}
|
|
28485
|
-
})
|
|
28591
|
+
});
|
|
28592
|
+
telemetry.trackRequestResult(telemetryName, durationMs, success, baseProperties, requestContext);
|
|
28486
28593
|
});
|
|
28487
28594
|
};
|
|
28488
28595
|
|
|
@@ -35814,4 +35921,4 @@ export {
|
|
|
35814
35921
|
metadata
|
|
35815
35922
|
};
|
|
35816
35923
|
|
|
35817
|
-
//# debugId=
|
|
35924
|
+
//# debugId=AA056BC425CA7C2C64756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/aops-tool",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "1.198.0
|
|
4
|
+
"version": "1.198.0",
|
|
5
5
|
"description": "Manage UiPath StudioAdmin AOps — connections, repos, projects, solutions, pipelines, executions.",
|
|
6
6
|
"private": false,
|
|
7
7
|
"repository": {
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"files": [
|
|
27
27
|
"dist"
|
|
28
28
|
],
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "1fadf03d7a8dd102742571dff569fdac11808afb"
|
|
30
30
|
}
|