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