@uipath/gov-tool 1.199.0-preview.92 → 1.199.0-preview.99
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 require_commander = __commonJS((exports) => {
|
|
|
21230
21230
|
var package_default = {
|
|
21231
21231
|
name: "@uipath/gov-tool",
|
|
21232
21232
|
license: "MIT",
|
|
21233
|
-
version: "1.199.0-preview.
|
|
21233
|
+
version: "1.199.0-preview.99",
|
|
21234
21234
|
description: "Manage UiPath governance — AOps policies, Access policies, and compliance packs.",
|
|
21235
21235
|
private: false,
|
|
21236
21236
|
repository: {
|
|
@@ -29610,11 +29610,36 @@ class NodeContextStorage {
|
|
|
29610
29610
|
return this.storage.getStore();
|
|
29611
29611
|
}
|
|
29612
29612
|
}
|
|
29613
|
+
// ../../common/src/telemetry/trace-context.ts
|
|
29614
|
+
var TELEMETRY_TRACEPARENT_ENV = "TRACEPARENT";
|
|
29615
|
+
var TRACEPARENT_PATTERN = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/;
|
|
29616
|
+
function getProcessEnv() {
|
|
29617
|
+
return globalThis.process?.env;
|
|
29618
|
+
}
|
|
29619
|
+
function parseInboundTraceparent(value) {
|
|
29620
|
+
if (!value) {
|
|
29621
|
+
return;
|
|
29622
|
+
}
|
|
29623
|
+
const match = TRACEPARENT_PATTERN.exec(value.trim().toLowerCase());
|
|
29624
|
+
if (!match) {
|
|
29625
|
+
return;
|
|
29626
|
+
}
|
|
29627
|
+
const [, traceId, parentSpanId] = match;
|
|
29628
|
+
if (/^0+$/.test(traceId) || /^0+$/.test(parentSpanId)) {
|
|
29629
|
+
return;
|
|
29630
|
+
}
|
|
29631
|
+
return { traceId, parentSpanId };
|
|
29632
|
+
}
|
|
29633
|
+
function getInboundTraceContext() {
|
|
29634
|
+
return parseInboundTraceparent(getProcessEnv()?.[TELEMETRY_TRACEPARENT_ENV]);
|
|
29635
|
+
}
|
|
29636
|
+
|
|
29613
29637
|
// ../../common/src/telemetry/session-id.ts
|
|
29614
29638
|
var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
|
|
29615
29639
|
var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
|
|
29616
29640
|
var telemetrySessionIdSlot = singleton("TelemetrySessionId");
|
|
29617
|
-
|
|
29641
|
+
var telemetryOperationIdSlot = singleton("TelemetryOperationId");
|
|
29642
|
+
function getProcessEnv2() {
|
|
29618
29643
|
return globalThis.process?.env;
|
|
29619
29644
|
}
|
|
29620
29645
|
function normalizeSessionId(value) {
|
|
@@ -29625,12 +29650,159 @@ function normalizeSessionId(value) {
|
|
|
29625
29650
|
return trimmed || undefined;
|
|
29626
29651
|
}
|
|
29627
29652
|
function getConfiguredTelemetrySessionId() {
|
|
29628
|
-
return normalizeSessionId(
|
|
29653
|
+
return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
|
|
29629
29654
|
}
|
|
29630
29655
|
function resolveTelemetrySessionId(existingSessionId) {
|
|
29631
29656
|
return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
|
|
29632
29657
|
}
|
|
29658
|
+
function getTelemetryOperationId() {
|
|
29659
|
+
const existing = telemetryOperationIdSlot.get();
|
|
29660
|
+
if (existing) {
|
|
29661
|
+
return existing;
|
|
29662
|
+
}
|
|
29663
|
+
const inboundTraceId = getInboundTraceContext()?.traceId;
|
|
29664
|
+
const generated = inboundTraceId ?? crypto.randomUUID().replaceAll("-", "");
|
|
29665
|
+
telemetryOperationIdSlot.set(generated);
|
|
29666
|
+
return generated;
|
|
29667
|
+
}
|
|
29668
|
+
// ../../common/src/telemetry/pii-redactor.ts
|
|
29669
|
+
var REDACTED = "[REDACTED]";
|
|
29670
|
+
var MAX_VALUE_LENGTH = 200;
|
|
29671
|
+
var SENSITIVE_NAME_TOKENS = new Set([
|
|
29672
|
+
"token",
|
|
29673
|
+
"tokens",
|
|
29674
|
+
"secret",
|
|
29675
|
+
"secrets",
|
|
29676
|
+
"password",
|
|
29677
|
+
"passwords",
|
|
29678
|
+
"pwd",
|
|
29679
|
+
"credential",
|
|
29680
|
+
"credentials",
|
|
29681
|
+
"auth",
|
|
29682
|
+
"authentication",
|
|
29683
|
+
"authorization",
|
|
29684
|
+
"authority",
|
|
29685
|
+
"cert",
|
|
29686
|
+
"certificate",
|
|
29687
|
+
"certificates"
|
|
29688
|
+
]);
|
|
29689
|
+
var SENSITIVE_KEY_PREFIXES = new Set([
|
|
29690
|
+
"api",
|
|
29691
|
+
"access",
|
|
29692
|
+
"client",
|
|
29693
|
+
"private",
|
|
29694
|
+
"public",
|
|
29695
|
+
"signing",
|
|
29696
|
+
"encryption",
|
|
29697
|
+
"session",
|
|
29698
|
+
"master",
|
|
29699
|
+
"shared",
|
|
29700
|
+
"root",
|
|
29701
|
+
"ssh",
|
|
29702
|
+
"rsa",
|
|
29703
|
+
"aes",
|
|
29704
|
+
"hmac",
|
|
29705
|
+
"oauth"
|
|
29706
|
+
]);
|
|
29707
|
+
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;
|
|
29708
|
+
var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
29709
|
+
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
29710
|
+
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
29711
|
+
var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
29712
|
+
var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
29713
|
+
var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
|
|
29714
|
+
function shortHash(input) {
|
|
29715
|
+
let hash = 2166136261;
|
|
29716
|
+
for (let i = 0;i < input.length; i++) {
|
|
29717
|
+
hash ^= input.charCodeAt(i);
|
|
29718
|
+
hash = Math.imul(hash, 16777619);
|
|
29719
|
+
}
|
|
29720
|
+
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
29721
|
+
}
|
|
29722
|
+
function redactUrl(raw) {
|
|
29723
|
+
try {
|
|
29724
|
+
const url = new URL(raw);
|
|
29725
|
+
return `${url.protocol}//${url.host}`;
|
|
29726
|
+
} catch {
|
|
29727
|
+
return `url#${shortHash(raw)}`;
|
|
29728
|
+
}
|
|
29729
|
+
}
|
|
29730
|
+
function redactValueDetectors(value) {
|
|
29731
|
+
let out = value;
|
|
29732
|
+
out = out.replace(JWT_PATTERN, () => REDACTED);
|
|
29733
|
+
out = out.replace(URL_PATTERN, (match) => {
|
|
29734
|
+
const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
|
|
29735
|
+
const core2 = trailing ? match.slice(0, -trailing.length) : match;
|
|
29736
|
+
return `${redactUrl(core2)}${trailing}`;
|
|
29737
|
+
});
|
|
29738
|
+
out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
29739
|
+
out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
|
|
29740
|
+
out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
|
|
29741
|
+
out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
|
|
29742
|
+
if (out.length > MAX_VALUE_LENGTH) {
|
|
29743
|
+
out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
|
|
29744
|
+
}
|
|
29745
|
+
return out;
|
|
29746
|
+
}
|
|
29747
|
+
function redactValue(value) {
|
|
29748
|
+
return redactValueDetectors(value);
|
|
29749
|
+
}
|
|
29750
|
+
function redactError(error) {
|
|
29751
|
+
const safe = new Error(redactValueDetectors(error.message ?? ""));
|
|
29752
|
+
safe.name = error.name;
|
|
29753
|
+
safe.stack = typeof error.stack === "string" ? redactValueDetectors(error.stack) : undefined;
|
|
29754
|
+
return safe;
|
|
29755
|
+
}
|
|
29756
|
+
function nameTokens(name) {
|
|
29757
|
+
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);
|
|
29758
|
+
}
|
|
29759
|
+
function isSensitiveName(name) {
|
|
29760
|
+
const tokens = nameTokens(name);
|
|
29761
|
+
for (let i = 0;i < tokens.length; i++) {
|
|
29762
|
+
const token = tokens[i];
|
|
29763
|
+
if (SENSITIVE_NAME_TOKENS.has(token)) {
|
|
29764
|
+
return true;
|
|
29765
|
+
}
|
|
29766
|
+
if (token === "key" || token === "keys") {
|
|
29767
|
+
const prev = tokens[i - 1];
|
|
29768
|
+
if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
|
|
29769
|
+
return true;
|
|
29770
|
+
}
|
|
29771
|
+
}
|
|
29772
|
+
}
|
|
29773
|
+
return false;
|
|
29774
|
+
}
|
|
29775
|
+
function redactProperty(name, value) {
|
|
29776
|
+
if (value === undefined || value === null) {
|
|
29777
|
+
return;
|
|
29778
|
+
}
|
|
29779
|
+
if (isSensitiveName(name)) {
|
|
29780
|
+
return REDACTED;
|
|
29781
|
+
}
|
|
29782
|
+
if (typeof value === "boolean" || typeof value === "number") {
|
|
29783
|
+
return value;
|
|
29784
|
+
}
|
|
29785
|
+
if (typeof value !== "string") {
|
|
29786
|
+
return "[OBJECT]";
|
|
29787
|
+
}
|
|
29788
|
+
return redactValueDetectors(value);
|
|
29789
|
+
}
|
|
29790
|
+
function redactProperties(properties) {
|
|
29791
|
+
const out = {};
|
|
29792
|
+
for (const [name, value] of Object.entries(properties)) {
|
|
29793
|
+
const redacted = redactProperty(name, value);
|
|
29794
|
+
if (redacted !== undefined) {
|
|
29795
|
+
out[name] = redacted;
|
|
29796
|
+
}
|
|
29797
|
+
}
|
|
29798
|
+
return out;
|
|
29799
|
+
}
|
|
29800
|
+
|
|
29633
29801
|
// ../../common/src/telemetry/telemetry-service.ts
|
|
29802
|
+
var TELEMETRY_OPERATION_ID_PROPERTY = "uip.trace.operation_id";
|
|
29803
|
+
var TELEMETRY_PARENT_ID_PROPERTY = "uip.trace.parent_id";
|
|
29804
|
+
var TELEMETRY_SPAN_ID_PROPERTY = "uip.trace.span_id";
|
|
29805
|
+
|
|
29634
29806
|
class TelemetryService {
|
|
29635
29807
|
telemetryProvider;
|
|
29636
29808
|
contextStorage;
|
|
@@ -29657,11 +29829,15 @@ class TelemetryService {
|
|
|
29657
29829
|
trackException(error, properties) {
|
|
29658
29830
|
const context = this.getCurrentContext();
|
|
29659
29831
|
const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
|
|
29660
|
-
this.telemetryProvider.trackException(error, enrichedProperties);
|
|
29832
|
+
this.telemetryProvider.trackException(redactError(error), enrichedProperties);
|
|
29661
29833
|
}
|
|
29662
29834
|
async trackRequest(name, fn, properties) {
|
|
29835
|
+
const parentContext = this.getCurrentContext();
|
|
29836
|
+
const operationId = parentContext?.operationId ?? this.operationId ?? getTelemetryOperationId();
|
|
29837
|
+
const parentId = parentContext ? parentContext.id : this.inboundParentIdFor(operationId);
|
|
29663
29838
|
const context = {
|
|
29664
|
-
operationId
|
|
29839
|
+
operationId,
|
|
29840
|
+
...parentId !== undefined ? { parentId } : {},
|
|
29665
29841
|
id: this.generateId()
|
|
29666
29842
|
};
|
|
29667
29843
|
const startTime = performance.now();
|
|
@@ -29679,6 +29855,45 @@ class TelemetryService {
|
|
|
29679
29855
|
throw error;
|
|
29680
29856
|
}
|
|
29681
29857
|
}
|
|
29858
|
+
trackRequestResult(name, durationMs, success, properties, context) {
|
|
29859
|
+
const requestContext = context ?? {
|
|
29860
|
+
operationId: this.operationId ?? getTelemetryOperationId(),
|
|
29861
|
+
id: this.generateId()
|
|
29862
|
+
};
|
|
29863
|
+
const enrichedProperties = this.enrichPropertiesWithContext(properties, requestContext);
|
|
29864
|
+
this.telemetryProvider.trackRequest(name, durationMs, success, enrichedProperties);
|
|
29865
|
+
}
|
|
29866
|
+
createRequestContext() {
|
|
29867
|
+
const operationId = this.operationId ?? getTelemetryOperationId();
|
|
29868
|
+
const parentId = this.inboundParentIdFor(operationId);
|
|
29869
|
+
return {
|
|
29870
|
+
operationId,
|
|
29871
|
+
...parentId !== undefined ? { parentId } : {},
|
|
29872
|
+
id: this.generateId()
|
|
29873
|
+
};
|
|
29874
|
+
}
|
|
29875
|
+
inboundParentIdFor(operationId) {
|
|
29876
|
+
const inbound = getInboundTraceContext();
|
|
29877
|
+
return inbound && inbound.traceId === operationId ? inbound.parentSpanId : undefined;
|
|
29878
|
+
}
|
|
29879
|
+
runWithContext(context, fn) {
|
|
29880
|
+
return this.contextStorage.run(context, fn);
|
|
29881
|
+
}
|
|
29882
|
+
createDependencyContext() {
|
|
29883
|
+
const parentContext = this.getCurrentContext();
|
|
29884
|
+
if (!parentContext) {
|
|
29885
|
+
return;
|
|
29886
|
+
}
|
|
29887
|
+
return {
|
|
29888
|
+
operationId: parentContext.operationId,
|
|
29889
|
+
parentId: parentContext.id,
|
|
29890
|
+
id: this.generateId()
|
|
29891
|
+
};
|
|
29892
|
+
}
|
|
29893
|
+
trackDependencyResult(name, type2, durationMs, success, properties, context, resultCode) {
|
|
29894
|
+
const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
|
|
29895
|
+
this.telemetryProvider.trackDependency(redactValue(name), type2, durationMs, success, enrichedProperties, resultCode);
|
|
29896
|
+
}
|
|
29682
29897
|
async trackDependencyOperation(name, type2, fn, properties) {
|
|
29683
29898
|
const parentContext = this.getCurrentContext();
|
|
29684
29899
|
if (!parentContext) {
|
|
@@ -29715,8 +29930,12 @@ class TelemetryService {
|
|
|
29715
29930
|
...getExecutionContextTelemetryProperties(),
|
|
29716
29931
|
...globalProperties,
|
|
29717
29932
|
...this.defaultProperties,
|
|
29718
|
-
...properties,
|
|
29719
|
-
...context
|
|
29933
|
+
...redactProperties(properties ?? {}),
|
|
29934
|
+
...context ? {
|
|
29935
|
+
[TELEMETRY_OPERATION_ID_PROPERTY]: context.operationId,
|
|
29936
|
+
...context.parentId !== undefined ? { [TELEMETRY_PARENT_ID_PROPERTY]: context.parentId } : {},
|
|
29937
|
+
[TELEMETRY_SPAN_ID_PROPERTY]: context.id
|
|
29938
|
+
} : {}
|
|
29720
29939
|
};
|
|
29721
29940
|
if (sessionId === undefined) {
|
|
29722
29941
|
delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
|
|
@@ -29726,7 +29945,16 @@ class TelemetryService {
|
|
|
29726
29945
|
return enriched;
|
|
29727
29946
|
}
|
|
29728
29947
|
generateId() {
|
|
29729
|
-
|
|
29948
|
+
const bytes = new Uint8Array(8);
|
|
29949
|
+
let hex = "";
|
|
29950
|
+
do {
|
|
29951
|
+
crypto.getRandomValues(bytes);
|
|
29952
|
+
hex = "";
|
|
29953
|
+
for (const byte of bytes) {
|
|
29954
|
+
hex += byte.toString(16).padStart(2, "0");
|
|
29955
|
+
}
|
|
29956
|
+
} while (/^0+$/.test(hex));
|
|
29957
|
+
return hex;
|
|
29730
29958
|
}
|
|
29731
29959
|
}
|
|
29732
29960
|
// ../../common/src/telemetry/node-appinsights-telemetry-provider.ts
|
|
@@ -30429,134 +30657,11 @@ function buildCommandTelemetryAttribution(commandPath, skillSource) {
|
|
|
30429
30657
|
};
|
|
30430
30658
|
}
|
|
30431
30659
|
|
|
30432
|
-
// ../../common/src/telemetry/pii-redactor.ts
|
|
30433
|
-
var REDACTED = "[REDACTED]";
|
|
30434
|
-
var MAX_VALUE_LENGTH = 200;
|
|
30435
|
-
var SENSITIVE_NAME_TOKENS = new Set([
|
|
30436
|
-
"token",
|
|
30437
|
-
"tokens",
|
|
30438
|
-
"secret",
|
|
30439
|
-
"secrets",
|
|
30440
|
-
"password",
|
|
30441
|
-
"passwords",
|
|
30442
|
-
"pwd",
|
|
30443
|
-
"credential",
|
|
30444
|
-
"credentials",
|
|
30445
|
-
"auth",
|
|
30446
|
-
"authentication",
|
|
30447
|
-
"authorization",
|
|
30448
|
-
"authority",
|
|
30449
|
-
"cert",
|
|
30450
|
-
"certificate",
|
|
30451
|
-
"certificates"
|
|
30452
|
-
]);
|
|
30453
|
-
var SENSITIVE_KEY_PREFIXES = new Set([
|
|
30454
|
-
"api",
|
|
30455
|
-
"access",
|
|
30456
|
-
"client",
|
|
30457
|
-
"private",
|
|
30458
|
-
"public",
|
|
30459
|
-
"signing",
|
|
30460
|
-
"encryption",
|
|
30461
|
-
"session",
|
|
30462
|
-
"master",
|
|
30463
|
-
"shared",
|
|
30464
|
-
"root",
|
|
30465
|
-
"ssh",
|
|
30466
|
-
"rsa",
|
|
30467
|
-
"aes",
|
|
30468
|
-
"hmac",
|
|
30469
|
-
"oauth"
|
|
30470
|
-
]);
|
|
30471
|
-
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;
|
|
30472
|
-
var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
30473
|
-
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
30474
|
-
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
30475
|
-
var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
30476
|
-
var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
30477
|
-
var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
|
|
30478
|
-
function shortHash(input) {
|
|
30479
|
-
let hash = 2166136261;
|
|
30480
|
-
for (let i = 0;i < input.length; i++) {
|
|
30481
|
-
hash ^= input.charCodeAt(i);
|
|
30482
|
-
hash = Math.imul(hash, 16777619);
|
|
30483
|
-
}
|
|
30484
|
-
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
30485
|
-
}
|
|
30486
|
-
function redactUrl(raw) {
|
|
30487
|
-
try {
|
|
30488
|
-
const url = new URL(raw);
|
|
30489
|
-
return `${url.protocol}//${url.host}`;
|
|
30490
|
-
} catch {
|
|
30491
|
-
return `url#${shortHash(raw)}`;
|
|
30492
|
-
}
|
|
30493
|
-
}
|
|
30494
|
-
function redactValueDetectors(value) {
|
|
30495
|
-
let out = value;
|
|
30496
|
-
out = out.replace(JWT_PATTERN, () => REDACTED);
|
|
30497
|
-
out = out.replace(URL_PATTERN, (match) => {
|
|
30498
|
-
const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
|
|
30499
|
-
const core2 = trailing ? match.slice(0, -trailing.length) : match;
|
|
30500
|
-
return `${redactUrl(core2)}${trailing}`;
|
|
30501
|
-
});
|
|
30502
|
-
out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
30503
|
-
out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
|
|
30504
|
-
out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
|
|
30505
|
-
out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
|
|
30506
|
-
if (out.length > MAX_VALUE_LENGTH) {
|
|
30507
|
-
out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
|
|
30508
|
-
}
|
|
30509
|
-
return out;
|
|
30510
|
-
}
|
|
30511
|
-
function nameTokens(name) {
|
|
30512
|
-
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);
|
|
30513
|
-
}
|
|
30514
|
-
function isSensitiveName(name) {
|
|
30515
|
-
const tokens = nameTokens(name);
|
|
30516
|
-
for (let i = 0;i < tokens.length; i++) {
|
|
30517
|
-
const token = tokens[i];
|
|
30518
|
-
if (SENSITIVE_NAME_TOKENS.has(token)) {
|
|
30519
|
-
return true;
|
|
30520
|
-
}
|
|
30521
|
-
if (token === "key" || token === "keys") {
|
|
30522
|
-
const prev = tokens[i - 1];
|
|
30523
|
-
if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
|
|
30524
|
-
return true;
|
|
30525
|
-
}
|
|
30526
|
-
}
|
|
30527
|
-
}
|
|
30528
|
-
return false;
|
|
30529
|
-
}
|
|
30530
|
-
function redactProperty(name, value) {
|
|
30531
|
-
if (value === undefined || value === null) {
|
|
30532
|
-
return;
|
|
30533
|
-
}
|
|
30534
|
-
if (isSensitiveName(name)) {
|
|
30535
|
-
return REDACTED;
|
|
30536
|
-
}
|
|
30537
|
-
if (typeof value === "boolean" || typeof value === "number") {
|
|
30538
|
-
return value;
|
|
30539
|
-
}
|
|
30540
|
-
if (typeof value !== "string") {
|
|
30541
|
-
return "[OBJECT]";
|
|
30542
|
-
}
|
|
30543
|
-
return redactValueDetectors(value);
|
|
30544
|
-
}
|
|
30545
|
-
function redactProperties(properties) {
|
|
30546
|
-
const out = {};
|
|
30547
|
-
for (const [name, value] of Object.entries(properties)) {
|
|
30548
|
-
const redacted = redactProperty(name, value);
|
|
30549
|
-
if (redacted !== undefined) {
|
|
30550
|
-
out[name] = redacted;
|
|
30551
|
-
}
|
|
30552
|
-
}
|
|
30553
|
-
return out;
|
|
30554
|
-
}
|
|
30555
|
-
|
|
30556
30660
|
// ../../common/src/trackedAction.ts
|
|
30557
30661
|
var pollSignalSlot = singleton("PollSignal");
|
|
30558
30662
|
var cliErrorCodeValues = new Set(CLI_ERROR_CODES);
|
|
30559
30663
|
var retryHintValues = new Set(RETRY_HINTS);
|
|
30664
|
+
var TELEMETRY_COMMAND_ARG_PREFIX = "uip.cmd.arg.";
|
|
30560
30665
|
var processContext = {
|
|
30561
30666
|
exit: (code) => {
|
|
30562
30667
|
process.exitCode = code;
|
|
@@ -30567,22 +30672,18 @@ var processContext = {
|
|
|
30567
30672
|
};
|
|
30568
30673
|
function extractCommandParams(cmd) {
|
|
30569
30674
|
const params = {};
|
|
30675
|
+
const add2 = (name, value) => {
|
|
30676
|
+
if (name && value !== undefined) {
|
|
30677
|
+
params[`${TELEMETRY_COMMAND_ARG_PREFIX}${name}`] = value;
|
|
30678
|
+
}
|
|
30679
|
+
};
|
|
30570
30680
|
const registered = cmd.registeredArguments ?? [];
|
|
30571
30681
|
const processed = cmd.processedArgs ?? [];
|
|
30572
30682
|
for (let i = 0;i < registered.length; i++) {
|
|
30573
|
-
|
|
30574
|
-
if (value === undefined) {
|
|
30575
|
-
continue;
|
|
30576
|
-
}
|
|
30577
|
-
const name = registered[i].name();
|
|
30578
|
-
if (name) {
|
|
30579
|
-
params[name] = value;
|
|
30580
|
-
}
|
|
30683
|
+
add2(registered[i].name(), processed[i]);
|
|
30581
30684
|
}
|
|
30582
30685
|
for (const [key, value] of Object.entries(cmd.opts())) {
|
|
30583
|
-
|
|
30584
|
-
params[key] = value;
|
|
30585
|
-
}
|
|
30686
|
+
add2(key, value);
|
|
30586
30687
|
}
|
|
30587
30688
|
return params;
|
|
30588
30689
|
}
|
|
@@ -30625,11 +30726,12 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
30625
30726
|
return this.action(async (...args) => {
|
|
30626
30727
|
const telemetryName = deriveCommandPath(command);
|
|
30627
30728
|
const props = typeof properties === "function" ? properties(...args) : properties;
|
|
30729
|
+
const requestContext = telemetry.createRequestContext();
|
|
30628
30730
|
const startTime = performance.now();
|
|
30629
30731
|
let errorMessage2;
|
|
30630
30732
|
let fallbackExitCode = EXIT_CODES.Success;
|
|
30631
30733
|
clearRecordedCommandFailureTelemetry();
|
|
30632
|
-
const [error] = await catchError2(fn(...args));
|
|
30734
|
+
const [error] = await catchError2(telemetry.runWithContext(requestContext, () => fn(...args)));
|
|
30633
30735
|
if (error) {
|
|
30634
30736
|
errorMessage2 = error instanceof Error ? error.message : String(error);
|
|
30635
30737
|
logger.debug(`[trackedAction] ${telemetryName} failed: ${errorMessage2}`);
|
|
@@ -30665,16 +30767,21 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
30665
30767
|
recordedFailure,
|
|
30666
30768
|
pollSignal: context.pollSignal
|
|
30667
30769
|
});
|
|
30668
|
-
|
|
30669
|
-
|
|
30770
|
+
const commandParams = extractCommandParams(command);
|
|
30771
|
+
if (props) {
|
|
30772
|
+
for (const key of Object.keys(props)) {
|
|
30773
|
+
delete commandParams[`${TELEMETRY_COMMAND_ARG_PREFIX}${key}`];
|
|
30774
|
+
}
|
|
30775
|
+
}
|
|
30776
|
+
const baseProperties = redactProperties({
|
|
30777
|
+
...commandParams,
|
|
30670
30778
|
...props,
|
|
30671
30779
|
...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
|
|
30672
30780
|
command: "true",
|
|
30673
|
-
duration: String(durationMs),
|
|
30674
|
-
success: String(success),
|
|
30675
30781
|
...terminalTelemetry,
|
|
30676
30782
|
...errorMessage2 ? { errorMessage: errorMessage2 } : {}
|
|
30677
|
-
})
|
|
30783
|
+
});
|
|
30784
|
+
telemetry.trackRequestResult(telemetryName, durationMs, success, baseProperties, requestContext);
|
|
30678
30785
|
});
|
|
30679
30786
|
};
|
|
30680
30787
|
// ../../common/src/console-guard.ts
|
|
@@ -59398,4 +59505,4 @@ export {
|
|
|
59398
59505
|
metadata
|
|
59399
59506
|
};
|
|
59400
59507
|
|
|
59401
|
-
//# debugId=
|
|
59508
|
+
//# debugId=76DE59F52BFDCC8664756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/gov-tool",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "1.199.0-preview.
|
|
4
|
+
"version": "1.199.0-preview.99",
|
|
5
5
|
"description": "Manage UiPath governance — AOps policies, Access policies, and compliance packs.",
|
|
6
6
|
"private": false,
|
|
7
7
|
"repository": {
|
|
@@ -23,5 +23,5 @@
|
|
|
23
23
|
"files": [
|
|
24
24
|
"dist"
|
|
25
25
|
],
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "6ba217cddceb86e3fa39ed82e49c5062878a85c6"
|
|
27
27
|
}
|