@uipath/platform-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
|
@@ -46306,7 +46306,7 @@ var require_dist3 = __commonJS((exports) => {
|
|
|
46306
46306
|
var package_default = {
|
|
46307
46307
|
name: "@uipath/platform-tool",
|
|
46308
46308
|
license: "MIT",
|
|
46309
|
-
version: "1.199.0-preview.
|
|
46309
|
+
version: "1.199.0-preview.99",
|
|
46310
46310
|
description: "Manage UiPath platform-level resources such as tenant licensing.",
|
|
46311
46311
|
type: "module",
|
|
46312
46312
|
main: "./dist/tool.js",
|
|
@@ -53725,11 +53725,36 @@ class NodeContextStorage {
|
|
|
53725
53725
|
return this.storage.getStore();
|
|
53726
53726
|
}
|
|
53727
53727
|
}
|
|
53728
|
+
// ../common/src/telemetry/trace-context.ts
|
|
53729
|
+
var TELEMETRY_TRACEPARENT_ENV = "TRACEPARENT";
|
|
53730
|
+
var TRACEPARENT_PATTERN = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/;
|
|
53731
|
+
function getProcessEnv() {
|
|
53732
|
+
return globalThis.process?.env;
|
|
53733
|
+
}
|
|
53734
|
+
function parseInboundTraceparent(value) {
|
|
53735
|
+
if (!value) {
|
|
53736
|
+
return;
|
|
53737
|
+
}
|
|
53738
|
+
const match = TRACEPARENT_PATTERN.exec(value.trim().toLowerCase());
|
|
53739
|
+
if (!match) {
|
|
53740
|
+
return;
|
|
53741
|
+
}
|
|
53742
|
+
const [, traceId, parentSpanId] = match;
|
|
53743
|
+
if (/^0+$/.test(traceId) || /^0+$/.test(parentSpanId)) {
|
|
53744
|
+
return;
|
|
53745
|
+
}
|
|
53746
|
+
return { traceId, parentSpanId };
|
|
53747
|
+
}
|
|
53748
|
+
function getInboundTraceContext() {
|
|
53749
|
+
return parseInboundTraceparent(getProcessEnv()?.[TELEMETRY_TRACEPARENT_ENV]);
|
|
53750
|
+
}
|
|
53751
|
+
|
|
53728
53752
|
// ../common/src/telemetry/session-id.ts
|
|
53729
53753
|
var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
|
|
53730
53754
|
var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
|
|
53731
53755
|
var telemetrySessionIdSlot = singleton("TelemetrySessionId");
|
|
53732
|
-
|
|
53756
|
+
var telemetryOperationIdSlot = singleton("TelemetryOperationId");
|
|
53757
|
+
function getProcessEnv2() {
|
|
53733
53758
|
return globalThis.process?.env;
|
|
53734
53759
|
}
|
|
53735
53760
|
function normalizeSessionId(value) {
|
|
@@ -53740,18 +53765,165 @@ function normalizeSessionId(value) {
|
|
|
53740
53765
|
return trimmed || undefined;
|
|
53741
53766
|
}
|
|
53742
53767
|
function getConfiguredTelemetrySessionId() {
|
|
53743
|
-
return normalizeSessionId(
|
|
53768
|
+
return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
|
|
53744
53769
|
}
|
|
53745
53770
|
function resolveTelemetrySessionId(existingSessionId) {
|
|
53746
53771
|
return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
|
|
53747
53772
|
}
|
|
53773
|
+
function getTelemetryOperationId() {
|
|
53774
|
+
const existing = telemetryOperationIdSlot.get();
|
|
53775
|
+
if (existing) {
|
|
53776
|
+
return existing;
|
|
53777
|
+
}
|
|
53778
|
+
const inboundTraceId = getInboundTraceContext()?.traceId;
|
|
53779
|
+
const generated = inboundTraceId ?? crypto.randomUUID().replaceAll("-", "");
|
|
53780
|
+
telemetryOperationIdSlot.set(generated);
|
|
53781
|
+
return generated;
|
|
53782
|
+
}
|
|
53748
53783
|
// ../common/src/telemetry/global-telemetry-properties.ts
|
|
53749
53784
|
var telemetryPropsSlot = singleton("TelemetryDefaultProps");
|
|
53750
53785
|
function getGlobalTelemetryProperties() {
|
|
53751
53786
|
return telemetryPropsSlot.get();
|
|
53752
53787
|
}
|
|
53753
53788
|
|
|
53789
|
+
// ../common/src/telemetry/pii-redactor.ts
|
|
53790
|
+
var REDACTED = "[REDACTED]";
|
|
53791
|
+
var MAX_VALUE_LENGTH = 200;
|
|
53792
|
+
var SENSITIVE_NAME_TOKENS = new Set([
|
|
53793
|
+
"token",
|
|
53794
|
+
"tokens",
|
|
53795
|
+
"secret",
|
|
53796
|
+
"secrets",
|
|
53797
|
+
"password",
|
|
53798
|
+
"passwords",
|
|
53799
|
+
"pwd",
|
|
53800
|
+
"credential",
|
|
53801
|
+
"credentials",
|
|
53802
|
+
"auth",
|
|
53803
|
+
"authentication",
|
|
53804
|
+
"authorization",
|
|
53805
|
+
"authority",
|
|
53806
|
+
"cert",
|
|
53807
|
+
"certificate",
|
|
53808
|
+
"certificates"
|
|
53809
|
+
]);
|
|
53810
|
+
var SENSITIVE_KEY_PREFIXES = new Set([
|
|
53811
|
+
"api",
|
|
53812
|
+
"access",
|
|
53813
|
+
"client",
|
|
53814
|
+
"private",
|
|
53815
|
+
"public",
|
|
53816
|
+
"signing",
|
|
53817
|
+
"encryption",
|
|
53818
|
+
"session",
|
|
53819
|
+
"master",
|
|
53820
|
+
"shared",
|
|
53821
|
+
"root",
|
|
53822
|
+
"ssh",
|
|
53823
|
+
"rsa",
|
|
53824
|
+
"aes",
|
|
53825
|
+
"hmac",
|
|
53826
|
+
"oauth"
|
|
53827
|
+
]);
|
|
53828
|
+
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;
|
|
53829
|
+
var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
53830
|
+
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
53831
|
+
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
53832
|
+
var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
53833
|
+
var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
53834
|
+
var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
|
|
53835
|
+
function shortHash(input) {
|
|
53836
|
+
let hash = 2166136261;
|
|
53837
|
+
for (let i = 0;i < input.length; i++) {
|
|
53838
|
+
hash ^= input.charCodeAt(i);
|
|
53839
|
+
hash = Math.imul(hash, 16777619);
|
|
53840
|
+
}
|
|
53841
|
+
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
53842
|
+
}
|
|
53843
|
+
function redactUrl(raw) {
|
|
53844
|
+
try {
|
|
53845
|
+
const url = new URL(raw);
|
|
53846
|
+
return `${url.protocol}//${url.host}`;
|
|
53847
|
+
} catch {
|
|
53848
|
+
return `url#${shortHash(raw)}`;
|
|
53849
|
+
}
|
|
53850
|
+
}
|
|
53851
|
+
function redactValueDetectors(value) {
|
|
53852
|
+
let out = value;
|
|
53853
|
+
out = out.replace(JWT_PATTERN, () => REDACTED);
|
|
53854
|
+
out = out.replace(URL_PATTERN, (match) => {
|
|
53855
|
+
const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
|
|
53856
|
+
const core2 = trailing ? match.slice(0, -trailing.length) : match;
|
|
53857
|
+
return `${redactUrl(core2)}${trailing}`;
|
|
53858
|
+
});
|
|
53859
|
+
out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
53860
|
+
out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
|
|
53861
|
+
out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
|
|
53862
|
+
out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
|
|
53863
|
+
if (out.length > MAX_VALUE_LENGTH) {
|
|
53864
|
+
out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
|
|
53865
|
+
}
|
|
53866
|
+
return out;
|
|
53867
|
+
}
|
|
53868
|
+
function redactValue(value) {
|
|
53869
|
+
return redactValueDetectors(value);
|
|
53870
|
+
}
|
|
53871
|
+
function redactError(error) {
|
|
53872
|
+
const safe = new Error(redactValueDetectors(error.message ?? ""));
|
|
53873
|
+
safe.name = error.name;
|
|
53874
|
+
safe.stack = typeof error.stack === "string" ? redactValueDetectors(error.stack) : undefined;
|
|
53875
|
+
return safe;
|
|
53876
|
+
}
|
|
53877
|
+
function nameTokens(name) {
|
|
53878
|
+
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);
|
|
53879
|
+
}
|
|
53880
|
+
function isSensitiveName(name) {
|
|
53881
|
+
const tokens = nameTokens(name);
|
|
53882
|
+
for (let i = 0;i < tokens.length; i++) {
|
|
53883
|
+
const token = tokens[i];
|
|
53884
|
+
if (SENSITIVE_NAME_TOKENS.has(token)) {
|
|
53885
|
+
return true;
|
|
53886
|
+
}
|
|
53887
|
+
if (token === "key" || token === "keys") {
|
|
53888
|
+
const prev = tokens[i - 1];
|
|
53889
|
+
if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
|
|
53890
|
+
return true;
|
|
53891
|
+
}
|
|
53892
|
+
}
|
|
53893
|
+
}
|
|
53894
|
+
return false;
|
|
53895
|
+
}
|
|
53896
|
+
function redactProperty(name, value) {
|
|
53897
|
+
if (value === undefined || value === null) {
|
|
53898
|
+
return;
|
|
53899
|
+
}
|
|
53900
|
+
if (isSensitiveName(name)) {
|
|
53901
|
+
return REDACTED;
|
|
53902
|
+
}
|
|
53903
|
+
if (typeof value === "boolean" || typeof value === "number") {
|
|
53904
|
+
return value;
|
|
53905
|
+
}
|
|
53906
|
+
if (typeof value !== "string") {
|
|
53907
|
+
return "[OBJECT]";
|
|
53908
|
+
}
|
|
53909
|
+
return redactValueDetectors(value);
|
|
53910
|
+
}
|
|
53911
|
+
function redactProperties(properties) {
|
|
53912
|
+
const out = {};
|
|
53913
|
+
for (const [name, value] of Object.entries(properties)) {
|
|
53914
|
+
const redacted = redactProperty(name, value);
|
|
53915
|
+
if (redacted !== undefined) {
|
|
53916
|
+
out[name] = redacted;
|
|
53917
|
+
}
|
|
53918
|
+
}
|
|
53919
|
+
return out;
|
|
53920
|
+
}
|
|
53921
|
+
|
|
53754
53922
|
// ../common/src/telemetry/telemetry-service.ts
|
|
53923
|
+
var TELEMETRY_OPERATION_ID_PROPERTY = "uip.trace.operation_id";
|
|
53924
|
+
var TELEMETRY_PARENT_ID_PROPERTY = "uip.trace.parent_id";
|
|
53925
|
+
var TELEMETRY_SPAN_ID_PROPERTY = "uip.trace.span_id";
|
|
53926
|
+
|
|
53755
53927
|
class TelemetryService {
|
|
53756
53928
|
telemetryProvider;
|
|
53757
53929
|
contextStorage;
|
|
@@ -53778,11 +53950,15 @@ class TelemetryService {
|
|
|
53778
53950
|
trackException(error, properties) {
|
|
53779
53951
|
const context = this.getCurrentContext();
|
|
53780
53952
|
const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
|
|
53781
|
-
this.telemetryProvider.trackException(error, enrichedProperties);
|
|
53953
|
+
this.telemetryProvider.trackException(redactError(error), enrichedProperties);
|
|
53782
53954
|
}
|
|
53783
53955
|
async trackRequest(name, fn, properties) {
|
|
53956
|
+
const parentContext = this.getCurrentContext();
|
|
53957
|
+
const operationId = parentContext?.operationId ?? this.operationId ?? getTelemetryOperationId();
|
|
53958
|
+
const parentId = parentContext ? parentContext.id : this.inboundParentIdFor(operationId);
|
|
53784
53959
|
const context = {
|
|
53785
|
-
operationId
|
|
53960
|
+
operationId,
|
|
53961
|
+
...parentId !== undefined ? { parentId } : {},
|
|
53786
53962
|
id: this.generateId()
|
|
53787
53963
|
};
|
|
53788
53964
|
const startTime = performance.now();
|
|
@@ -53800,6 +53976,45 @@ class TelemetryService {
|
|
|
53800
53976
|
throw error;
|
|
53801
53977
|
}
|
|
53802
53978
|
}
|
|
53979
|
+
trackRequestResult(name, durationMs, success, properties, context) {
|
|
53980
|
+
const requestContext = context ?? {
|
|
53981
|
+
operationId: this.operationId ?? getTelemetryOperationId(),
|
|
53982
|
+
id: this.generateId()
|
|
53983
|
+
};
|
|
53984
|
+
const enrichedProperties = this.enrichPropertiesWithContext(properties, requestContext);
|
|
53985
|
+
this.telemetryProvider.trackRequest(name, durationMs, success, enrichedProperties);
|
|
53986
|
+
}
|
|
53987
|
+
createRequestContext() {
|
|
53988
|
+
const operationId = this.operationId ?? getTelemetryOperationId();
|
|
53989
|
+
const parentId = this.inboundParentIdFor(operationId);
|
|
53990
|
+
return {
|
|
53991
|
+
operationId,
|
|
53992
|
+
...parentId !== undefined ? { parentId } : {},
|
|
53993
|
+
id: this.generateId()
|
|
53994
|
+
};
|
|
53995
|
+
}
|
|
53996
|
+
inboundParentIdFor(operationId) {
|
|
53997
|
+
const inbound = getInboundTraceContext();
|
|
53998
|
+
return inbound && inbound.traceId === operationId ? inbound.parentSpanId : undefined;
|
|
53999
|
+
}
|
|
54000
|
+
runWithContext(context, fn) {
|
|
54001
|
+
return this.contextStorage.run(context, fn);
|
|
54002
|
+
}
|
|
54003
|
+
createDependencyContext() {
|
|
54004
|
+
const parentContext = this.getCurrentContext();
|
|
54005
|
+
if (!parentContext) {
|
|
54006
|
+
return;
|
|
54007
|
+
}
|
|
54008
|
+
return {
|
|
54009
|
+
operationId: parentContext.operationId,
|
|
54010
|
+
parentId: parentContext.id,
|
|
54011
|
+
id: this.generateId()
|
|
54012
|
+
};
|
|
54013
|
+
}
|
|
54014
|
+
trackDependencyResult(name, type2, durationMs, success, properties, context, resultCode) {
|
|
54015
|
+
const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
|
|
54016
|
+
this.telemetryProvider.trackDependency(redactValue(name), type2, durationMs, success, enrichedProperties, resultCode);
|
|
54017
|
+
}
|
|
53803
54018
|
async trackDependencyOperation(name, type2, fn, properties) {
|
|
53804
54019
|
const parentContext = this.getCurrentContext();
|
|
53805
54020
|
if (!parentContext) {
|
|
@@ -53836,8 +54051,12 @@ class TelemetryService {
|
|
|
53836
54051
|
...getExecutionContextTelemetryProperties(),
|
|
53837
54052
|
...globalProperties,
|
|
53838
54053
|
...this.defaultProperties,
|
|
53839
|
-
...properties,
|
|
53840
|
-
...context
|
|
54054
|
+
...redactProperties(properties ?? {}),
|
|
54055
|
+
...context ? {
|
|
54056
|
+
[TELEMETRY_OPERATION_ID_PROPERTY]: context.operationId,
|
|
54057
|
+
...context.parentId !== undefined ? { [TELEMETRY_PARENT_ID_PROPERTY]: context.parentId } : {},
|
|
54058
|
+
[TELEMETRY_SPAN_ID_PROPERTY]: context.id
|
|
54059
|
+
} : {}
|
|
53841
54060
|
};
|
|
53842
54061
|
if (sessionId === undefined) {
|
|
53843
54062
|
delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
|
|
@@ -53847,7 +54066,16 @@ class TelemetryService {
|
|
|
53847
54066
|
return enriched;
|
|
53848
54067
|
}
|
|
53849
54068
|
generateId() {
|
|
53850
|
-
|
|
54069
|
+
const bytes = new Uint8Array(8);
|
|
54070
|
+
let hex = "";
|
|
54071
|
+
do {
|
|
54072
|
+
crypto.getRandomValues(bytes);
|
|
54073
|
+
hex = "";
|
|
54074
|
+
for (const byte of bytes) {
|
|
54075
|
+
hex += byte.toString(16).padStart(2, "0");
|
|
54076
|
+
}
|
|
54077
|
+
} while (/^0+$/.test(hex));
|
|
54078
|
+
return hex;
|
|
53851
54079
|
}
|
|
53852
54080
|
}
|
|
53853
54081
|
// ../common/src/telemetry/node-appinsights-telemetry-provider.ts
|
|
@@ -54571,134 +54799,11 @@ function buildCommandTelemetryAttribution(commandPath, skillSource) {
|
|
|
54571
54799
|
};
|
|
54572
54800
|
}
|
|
54573
54801
|
|
|
54574
|
-
// ../common/src/telemetry/pii-redactor.ts
|
|
54575
|
-
var REDACTED = "[REDACTED]";
|
|
54576
|
-
var MAX_VALUE_LENGTH = 200;
|
|
54577
|
-
var SENSITIVE_NAME_TOKENS = new Set([
|
|
54578
|
-
"token",
|
|
54579
|
-
"tokens",
|
|
54580
|
-
"secret",
|
|
54581
|
-
"secrets",
|
|
54582
|
-
"password",
|
|
54583
|
-
"passwords",
|
|
54584
|
-
"pwd",
|
|
54585
|
-
"credential",
|
|
54586
|
-
"credentials",
|
|
54587
|
-
"auth",
|
|
54588
|
-
"authentication",
|
|
54589
|
-
"authorization",
|
|
54590
|
-
"authority",
|
|
54591
|
-
"cert",
|
|
54592
|
-
"certificate",
|
|
54593
|
-
"certificates"
|
|
54594
|
-
]);
|
|
54595
|
-
var SENSITIVE_KEY_PREFIXES = new Set([
|
|
54596
|
-
"api",
|
|
54597
|
-
"access",
|
|
54598
|
-
"client",
|
|
54599
|
-
"private",
|
|
54600
|
-
"public",
|
|
54601
|
-
"signing",
|
|
54602
|
-
"encryption",
|
|
54603
|
-
"session",
|
|
54604
|
-
"master",
|
|
54605
|
-
"shared",
|
|
54606
|
-
"root",
|
|
54607
|
-
"ssh",
|
|
54608
|
-
"rsa",
|
|
54609
|
-
"aes",
|
|
54610
|
-
"hmac",
|
|
54611
|
-
"oauth"
|
|
54612
|
-
]);
|
|
54613
|
-
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;
|
|
54614
|
-
var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
54615
|
-
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
54616
|
-
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
54617
|
-
var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
54618
|
-
var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
54619
|
-
var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
|
|
54620
|
-
function shortHash(input) {
|
|
54621
|
-
let hash = 2166136261;
|
|
54622
|
-
for (let i = 0;i < input.length; i++) {
|
|
54623
|
-
hash ^= input.charCodeAt(i);
|
|
54624
|
-
hash = Math.imul(hash, 16777619);
|
|
54625
|
-
}
|
|
54626
|
-
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
54627
|
-
}
|
|
54628
|
-
function redactUrl(raw) {
|
|
54629
|
-
try {
|
|
54630
|
-
const url = new URL(raw);
|
|
54631
|
-
return `${url.protocol}//${url.host}`;
|
|
54632
|
-
} catch {
|
|
54633
|
-
return `url#${shortHash(raw)}`;
|
|
54634
|
-
}
|
|
54635
|
-
}
|
|
54636
|
-
function redactValueDetectors(value) {
|
|
54637
|
-
let out = value;
|
|
54638
|
-
out = out.replace(JWT_PATTERN, () => REDACTED);
|
|
54639
|
-
out = out.replace(URL_PATTERN, (match) => {
|
|
54640
|
-
const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
|
|
54641
|
-
const core2 = trailing ? match.slice(0, -trailing.length) : match;
|
|
54642
|
-
return `${redactUrl(core2)}${trailing}`;
|
|
54643
|
-
});
|
|
54644
|
-
out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
54645
|
-
out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
|
|
54646
|
-
out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
|
|
54647
|
-
out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
|
|
54648
|
-
if (out.length > MAX_VALUE_LENGTH) {
|
|
54649
|
-
out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
|
|
54650
|
-
}
|
|
54651
|
-
return out;
|
|
54652
|
-
}
|
|
54653
|
-
function nameTokens(name) {
|
|
54654
|
-
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);
|
|
54655
|
-
}
|
|
54656
|
-
function isSensitiveName(name) {
|
|
54657
|
-
const tokens = nameTokens(name);
|
|
54658
|
-
for (let i = 0;i < tokens.length; i++) {
|
|
54659
|
-
const token = tokens[i];
|
|
54660
|
-
if (SENSITIVE_NAME_TOKENS.has(token)) {
|
|
54661
|
-
return true;
|
|
54662
|
-
}
|
|
54663
|
-
if (token === "key" || token === "keys") {
|
|
54664
|
-
const prev = tokens[i - 1];
|
|
54665
|
-
if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
|
|
54666
|
-
return true;
|
|
54667
|
-
}
|
|
54668
|
-
}
|
|
54669
|
-
}
|
|
54670
|
-
return false;
|
|
54671
|
-
}
|
|
54672
|
-
function redactProperty(name, value) {
|
|
54673
|
-
if (value === undefined || value === null) {
|
|
54674
|
-
return;
|
|
54675
|
-
}
|
|
54676
|
-
if (isSensitiveName(name)) {
|
|
54677
|
-
return REDACTED;
|
|
54678
|
-
}
|
|
54679
|
-
if (typeof value === "boolean" || typeof value === "number") {
|
|
54680
|
-
return value;
|
|
54681
|
-
}
|
|
54682
|
-
if (typeof value !== "string") {
|
|
54683
|
-
return "[OBJECT]";
|
|
54684
|
-
}
|
|
54685
|
-
return redactValueDetectors(value);
|
|
54686
|
-
}
|
|
54687
|
-
function redactProperties(properties) {
|
|
54688
|
-
const out = {};
|
|
54689
|
-
for (const [name, value] of Object.entries(properties)) {
|
|
54690
|
-
const redacted = redactProperty(name, value);
|
|
54691
|
-
if (redacted !== undefined) {
|
|
54692
|
-
out[name] = redacted;
|
|
54693
|
-
}
|
|
54694
|
-
}
|
|
54695
|
-
return out;
|
|
54696
|
-
}
|
|
54697
|
-
|
|
54698
54802
|
// ../common/src/trackedAction.ts
|
|
54699
54803
|
var pollSignalSlot = singleton("PollSignal");
|
|
54700
54804
|
var cliErrorCodeValues = new Set(CLI_ERROR_CODES);
|
|
54701
54805
|
var retryHintValues = new Set(RETRY_HINTS);
|
|
54806
|
+
var TELEMETRY_COMMAND_ARG_PREFIX = "uip.cmd.arg.";
|
|
54702
54807
|
var processContext = {
|
|
54703
54808
|
exit: (code) => {
|
|
54704
54809
|
process.exitCode = code;
|
|
@@ -54709,22 +54814,18 @@ var processContext = {
|
|
|
54709
54814
|
};
|
|
54710
54815
|
function extractCommandParams(cmd) {
|
|
54711
54816
|
const params = {};
|
|
54817
|
+
const add2 = (name, value) => {
|
|
54818
|
+
if (name && value !== undefined) {
|
|
54819
|
+
params[`${TELEMETRY_COMMAND_ARG_PREFIX}${name}`] = value;
|
|
54820
|
+
}
|
|
54821
|
+
};
|
|
54712
54822
|
const registered = cmd.registeredArguments ?? [];
|
|
54713
54823
|
const processed = cmd.processedArgs ?? [];
|
|
54714
54824
|
for (let i = 0;i < registered.length; i++) {
|
|
54715
|
-
|
|
54716
|
-
if (value === undefined) {
|
|
54717
|
-
continue;
|
|
54718
|
-
}
|
|
54719
|
-
const name = registered[i].name();
|
|
54720
|
-
if (name) {
|
|
54721
|
-
params[name] = value;
|
|
54722
|
-
}
|
|
54825
|
+
add2(registered[i].name(), processed[i]);
|
|
54723
54826
|
}
|
|
54724
54827
|
for (const [key, value] of Object.entries(cmd.opts())) {
|
|
54725
|
-
|
|
54726
|
-
params[key] = value;
|
|
54727
|
-
}
|
|
54828
|
+
add2(key, value);
|
|
54728
54829
|
}
|
|
54729
54830
|
return params;
|
|
54730
54831
|
}
|
|
@@ -54767,11 +54868,12 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
54767
54868
|
return this.action(async (...args) => {
|
|
54768
54869
|
const telemetryName = deriveCommandPath(command);
|
|
54769
54870
|
const props = typeof properties === "function" ? properties(...args) : properties;
|
|
54871
|
+
const requestContext = telemetry.createRequestContext();
|
|
54770
54872
|
const startTime = performance.now();
|
|
54771
54873
|
let errorMessage2;
|
|
54772
54874
|
let fallbackExitCode = EXIT_CODES.Success;
|
|
54773
54875
|
clearRecordedCommandFailureTelemetry();
|
|
54774
|
-
const [error] = await catchError2(fn(...args));
|
|
54876
|
+
const [error] = await catchError2(telemetry.runWithContext(requestContext, () => fn(...args)));
|
|
54775
54877
|
if (error) {
|
|
54776
54878
|
errorMessage2 = error instanceof Error ? error.message : String(error);
|
|
54777
54879
|
logger.debug(`[trackedAction] ${telemetryName} failed: ${errorMessage2}`);
|
|
@@ -54807,16 +54909,21 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
54807
54909
|
recordedFailure,
|
|
54808
54910
|
pollSignal: context.pollSignal
|
|
54809
54911
|
});
|
|
54810
|
-
|
|
54811
|
-
|
|
54912
|
+
const commandParams = extractCommandParams(command);
|
|
54913
|
+
if (props) {
|
|
54914
|
+
for (const key of Object.keys(props)) {
|
|
54915
|
+
delete commandParams[`${TELEMETRY_COMMAND_ARG_PREFIX}${key}`];
|
|
54916
|
+
}
|
|
54917
|
+
}
|
|
54918
|
+
const baseProperties = redactProperties({
|
|
54919
|
+
...commandParams,
|
|
54812
54920
|
...props,
|
|
54813
54921
|
...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
|
|
54814
54922
|
command: "true",
|
|
54815
|
-
duration: String(durationMs),
|
|
54816
|
-
success: String(success),
|
|
54817
54923
|
...terminalTelemetry,
|
|
54818
54924
|
...errorMessage2 ? { errorMessage: errorMessage2 } : {}
|
|
54819
|
-
})
|
|
54925
|
+
});
|
|
54926
|
+
telemetry.trackRequestResult(telemetryName, durationMs, success, baseProperties, requestContext);
|
|
54820
54927
|
});
|
|
54821
54928
|
};
|
|
54822
54929
|
// ../common/src/console-guard.ts
|
|
@@ -57926,4 +58033,4 @@ export {
|
|
|
57926
58033
|
metadata
|
|
57927
58034
|
};
|
|
57928
58035
|
|
|
57929
|
-
//# debugId=
|
|
58036
|
+
//# debugId=3ADAE3115B9D149D64756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/platform-tool",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "1.199.0-preview.
|
|
4
|
+
"version": "1.199.0-preview.99",
|
|
5
5
|
"description": "Manage UiPath platform-level resources such as tenant licensing.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/tool.js",
|
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
"publishConfig": {
|
|
21
21
|
"registry": "https://registry.npmjs.org/"
|
|
22
22
|
},
|
|
23
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "6ba217cddceb86e3fa39ed82e49c5062878a85c6"
|
|
24
24
|
}
|