@uipath/solution-sdk 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/index.js +257 -150
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2535,7 +2535,7 @@ class TextApiResponse {
|
|
|
2535
2535
|
var package_default = {
|
|
2536
2536
|
name: "@uipath/solution-sdk",
|
|
2537
2537
|
license: "MIT",
|
|
2538
|
-
version: "1.198.0
|
|
2538
|
+
version: "1.198.0",
|
|
2539
2539
|
repository: {
|
|
2540
2540
|
type: "git",
|
|
2541
2541
|
url: "https://github.com/UiPath/cli.git",
|
|
@@ -11252,11 +11252,36 @@ class NodeContextStorage {
|
|
|
11252
11252
|
return this.storage.getStore();
|
|
11253
11253
|
}
|
|
11254
11254
|
}
|
|
11255
|
+
// ../common/src/telemetry/trace-context.ts
|
|
11256
|
+
var TELEMETRY_TRACEPARENT_ENV = "TRACEPARENT";
|
|
11257
|
+
var TRACEPARENT_PATTERN = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/;
|
|
11258
|
+
function getProcessEnv() {
|
|
11259
|
+
return globalThis.process?.env;
|
|
11260
|
+
}
|
|
11261
|
+
function parseInboundTraceparent(value) {
|
|
11262
|
+
if (!value) {
|
|
11263
|
+
return;
|
|
11264
|
+
}
|
|
11265
|
+
const match = TRACEPARENT_PATTERN.exec(value.trim().toLowerCase());
|
|
11266
|
+
if (!match) {
|
|
11267
|
+
return;
|
|
11268
|
+
}
|
|
11269
|
+
const [, traceId, parentSpanId] = match;
|
|
11270
|
+
if (/^0+$/.test(traceId) || /^0+$/.test(parentSpanId)) {
|
|
11271
|
+
return;
|
|
11272
|
+
}
|
|
11273
|
+
return { traceId, parentSpanId };
|
|
11274
|
+
}
|
|
11275
|
+
function getInboundTraceContext() {
|
|
11276
|
+
return parseInboundTraceparent(getProcessEnv()?.[TELEMETRY_TRACEPARENT_ENV]);
|
|
11277
|
+
}
|
|
11278
|
+
|
|
11255
11279
|
// ../common/src/telemetry/session-id.ts
|
|
11256
11280
|
var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
|
|
11257
11281
|
var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
|
|
11258
11282
|
var telemetrySessionIdSlot = singleton("TelemetrySessionId");
|
|
11259
|
-
|
|
11283
|
+
var telemetryOperationIdSlot = singleton("TelemetryOperationId");
|
|
11284
|
+
function getProcessEnv2() {
|
|
11260
11285
|
return globalThis.process?.env;
|
|
11261
11286
|
}
|
|
11262
11287
|
function normalizeSessionId(value) {
|
|
@@ -11267,12 +11292,159 @@ function normalizeSessionId(value) {
|
|
|
11267
11292
|
return trimmed || undefined;
|
|
11268
11293
|
}
|
|
11269
11294
|
function getConfiguredTelemetrySessionId() {
|
|
11270
|
-
return normalizeSessionId(
|
|
11295
|
+
return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
|
|
11271
11296
|
}
|
|
11272
11297
|
function resolveTelemetrySessionId(existingSessionId) {
|
|
11273
11298
|
return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
|
|
11274
11299
|
}
|
|
11300
|
+
function getTelemetryOperationId() {
|
|
11301
|
+
const existing = telemetryOperationIdSlot.get();
|
|
11302
|
+
if (existing) {
|
|
11303
|
+
return existing;
|
|
11304
|
+
}
|
|
11305
|
+
const inboundTraceId = getInboundTraceContext()?.traceId;
|
|
11306
|
+
const generated = inboundTraceId ?? crypto.randomUUID().replaceAll("-", "");
|
|
11307
|
+
telemetryOperationIdSlot.set(generated);
|
|
11308
|
+
return generated;
|
|
11309
|
+
}
|
|
11310
|
+
// ../common/src/telemetry/pii-redactor.ts
|
|
11311
|
+
var REDACTED = "[REDACTED]";
|
|
11312
|
+
var MAX_VALUE_LENGTH = 200;
|
|
11313
|
+
var SENSITIVE_NAME_TOKENS = new Set([
|
|
11314
|
+
"token",
|
|
11315
|
+
"tokens",
|
|
11316
|
+
"secret",
|
|
11317
|
+
"secrets",
|
|
11318
|
+
"password",
|
|
11319
|
+
"passwords",
|
|
11320
|
+
"pwd",
|
|
11321
|
+
"credential",
|
|
11322
|
+
"credentials",
|
|
11323
|
+
"auth",
|
|
11324
|
+
"authentication",
|
|
11325
|
+
"authorization",
|
|
11326
|
+
"authority",
|
|
11327
|
+
"cert",
|
|
11328
|
+
"certificate",
|
|
11329
|
+
"certificates"
|
|
11330
|
+
]);
|
|
11331
|
+
var SENSITIVE_KEY_PREFIXES = new Set([
|
|
11332
|
+
"api",
|
|
11333
|
+
"access",
|
|
11334
|
+
"client",
|
|
11335
|
+
"private",
|
|
11336
|
+
"public",
|
|
11337
|
+
"signing",
|
|
11338
|
+
"encryption",
|
|
11339
|
+
"session",
|
|
11340
|
+
"master",
|
|
11341
|
+
"shared",
|
|
11342
|
+
"root",
|
|
11343
|
+
"ssh",
|
|
11344
|
+
"rsa",
|
|
11345
|
+
"aes",
|
|
11346
|
+
"hmac",
|
|
11347
|
+
"oauth"
|
|
11348
|
+
]);
|
|
11349
|
+
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;
|
|
11350
|
+
var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
11351
|
+
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
11352
|
+
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
11353
|
+
var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
11354
|
+
var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
11355
|
+
var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
|
|
11356
|
+
function shortHash(input) {
|
|
11357
|
+
let hash = 2166136261;
|
|
11358
|
+
for (let i = 0;i < input.length; i++) {
|
|
11359
|
+
hash ^= input.charCodeAt(i);
|
|
11360
|
+
hash = Math.imul(hash, 16777619);
|
|
11361
|
+
}
|
|
11362
|
+
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
11363
|
+
}
|
|
11364
|
+
function redactUrl(raw) {
|
|
11365
|
+
try {
|
|
11366
|
+
const url = new URL(raw);
|
|
11367
|
+
return `${url.protocol}//${url.host}`;
|
|
11368
|
+
} catch {
|
|
11369
|
+
return `url#${shortHash(raw)}`;
|
|
11370
|
+
}
|
|
11371
|
+
}
|
|
11372
|
+
function redactValueDetectors(value) {
|
|
11373
|
+
let out = value;
|
|
11374
|
+
out = out.replace(JWT_PATTERN, () => REDACTED);
|
|
11375
|
+
out = out.replace(URL_PATTERN, (match) => {
|
|
11376
|
+
const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
|
|
11377
|
+
const core2 = trailing ? match.slice(0, -trailing.length) : match;
|
|
11378
|
+
return `${redactUrl(core2)}${trailing}`;
|
|
11379
|
+
});
|
|
11380
|
+
out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
11381
|
+
out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
|
|
11382
|
+
out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
|
|
11383
|
+
out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
|
|
11384
|
+
if (out.length > MAX_VALUE_LENGTH) {
|
|
11385
|
+
out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
|
|
11386
|
+
}
|
|
11387
|
+
return out;
|
|
11388
|
+
}
|
|
11389
|
+
function redactValue(value) {
|
|
11390
|
+
return redactValueDetectors(value);
|
|
11391
|
+
}
|
|
11392
|
+
function redactError(error) {
|
|
11393
|
+
const safe = new Error(redactValueDetectors(error.message ?? ""));
|
|
11394
|
+
safe.name = error.name;
|
|
11395
|
+
safe.stack = typeof error.stack === "string" ? redactValueDetectors(error.stack) : undefined;
|
|
11396
|
+
return safe;
|
|
11397
|
+
}
|
|
11398
|
+
function nameTokens(name) {
|
|
11399
|
+
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);
|
|
11400
|
+
}
|
|
11401
|
+
function isSensitiveName(name) {
|
|
11402
|
+
const tokens = nameTokens(name);
|
|
11403
|
+
for (let i = 0;i < tokens.length; i++) {
|
|
11404
|
+
const token = tokens[i];
|
|
11405
|
+
if (SENSITIVE_NAME_TOKENS.has(token)) {
|
|
11406
|
+
return true;
|
|
11407
|
+
}
|
|
11408
|
+
if (token === "key" || token === "keys") {
|
|
11409
|
+
const prev = tokens[i - 1];
|
|
11410
|
+
if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
|
|
11411
|
+
return true;
|
|
11412
|
+
}
|
|
11413
|
+
}
|
|
11414
|
+
}
|
|
11415
|
+
return false;
|
|
11416
|
+
}
|
|
11417
|
+
function redactProperty(name, value) {
|
|
11418
|
+
if (value === undefined || value === null) {
|
|
11419
|
+
return;
|
|
11420
|
+
}
|
|
11421
|
+
if (isSensitiveName(name)) {
|
|
11422
|
+
return REDACTED;
|
|
11423
|
+
}
|
|
11424
|
+
if (typeof value === "boolean" || typeof value === "number") {
|
|
11425
|
+
return value;
|
|
11426
|
+
}
|
|
11427
|
+
if (typeof value !== "string") {
|
|
11428
|
+
return "[OBJECT]";
|
|
11429
|
+
}
|
|
11430
|
+
return redactValueDetectors(value);
|
|
11431
|
+
}
|
|
11432
|
+
function redactProperties(properties) {
|
|
11433
|
+
const out = {};
|
|
11434
|
+
for (const [name, value] of Object.entries(properties)) {
|
|
11435
|
+
const redacted = redactProperty(name, value);
|
|
11436
|
+
if (redacted !== undefined) {
|
|
11437
|
+
out[name] = redacted;
|
|
11438
|
+
}
|
|
11439
|
+
}
|
|
11440
|
+
return out;
|
|
11441
|
+
}
|
|
11442
|
+
|
|
11275
11443
|
// ../common/src/telemetry/telemetry-service.ts
|
|
11444
|
+
var TELEMETRY_OPERATION_ID_PROPERTY = "uip.trace.operation_id";
|
|
11445
|
+
var TELEMETRY_PARENT_ID_PROPERTY = "uip.trace.parent_id";
|
|
11446
|
+
var TELEMETRY_SPAN_ID_PROPERTY = "uip.trace.span_id";
|
|
11447
|
+
|
|
11276
11448
|
class TelemetryService {
|
|
11277
11449
|
telemetryProvider;
|
|
11278
11450
|
contextStorage;
|
|
@@ -11299,11 +11471,15 @@ class TelemetryService {
|
|
|
11299
11471
|
trackException(error, properties) {
|
|
11300
11472
|
const context = this.getCurrentContext();
|
|
11301
11473
|
const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
|
|
11302
|
-
this.telemetryProvider.trackException(error, enrichedProperties);
|
|
11474
|
+
this.telemetryProvider.trackException(redactError(error), enrichedProperties);
|
|
11303
11475
|
}
|
|
11304
11476
|
async trackRequest(name, fn, properties) {
|
|
11477
|
+
const parentContext = this.getCurrentContext();
|
|
11478
|
+
const operationId = parentContext?.operationId ?? this.operationId ?? getTelemetryOperationId();
|
|
11479
|
+
const parentId = parentContext ? parentContext.id : this.inboundParentIdFor(operationId);
|
|
11305
11480
|
const context = {
|
|
11306
|
-
operationId
|
|
11481
|
+
operationId,
|
|
11482
|
+
...parentId !== undefined ? { parentId } : {},
|
|
11307
11483
|
id: this.generateId()
|
|
11308
11484
|
};
|
|
11309
11485
|
const startTime = performance.now();
|
|
@@ -11321,6 +11497,45 @@ class TelemetryService {
|
|
|
11321
11497
|
throw error;
|
|
11322
11498
|
}
|
|
11323
11499
|
}
|
|
11500
|
+
trackRequestResult(name, durationMs, success, properties, context) {
|
|
11501
|
+
const requestContext = context ?? {
|
|
11502
|
+
operationId: this.operationId ?? getTelemetryOperationId(),
|
|
11503
|
+
id: this.generateId()
|
|
11504
|
+
};
|
|
11505
|
+
const enrichedProperties = this.enrichPropertiesWithContext(properties, requestContext);
|
|
11506
|
+
this.telemetryProvider.trackRequest(name, durationMs, success, enrichedProperties);
|
|
11507
|
+
}
|
|
11508
|
+
createRequestContext() {
|
|
11509
|
+
const operationId = this.operationId ?? getTelemetryOperationId();
|
|
11510
|
+
const parentId = this.inboundParentIdFor(operationId);
|
|
11511
|
+
return {
|
|
11512
|
+
operationId,
|
|
11513
|
+
...parentId !== undefined ? { parentId } : {},
|
|
11514
|
+
id: this.generateId()
|
|
11515
|
+
};
|
|
11516
|
+
}
|
|
11517
|
+
inboundParentIdFor(operationId) {
|
|
11518
|
+
const inbound = getInboundTraceContext();
|
|
11519
|
+
return inbound && inbound.traceId === operationId ? inbound.parentSpanId : undefined;
|
|
11520
|
+
}
|
|
11521
|
+
runWithContext(context, fn) {
|
|
11522
|
+
return this.contextStorage.run(context, fn);
|
|
11523
|
+
}
|
|
11524
|
+
createDependencyContext() {
|
|
11525
|
+
const parentContext = this.getCurrentContext();
|
|
11526
|
+
if (!parentContext) {
|
|
11527
|
+
return;
|
|
11528
|
+
}
|
|
11529
|
+
return {
|
|
11530
|
+
operationId: parentContext.operationId,
|
|
11531
|
+
parentId: parentContext.id,
|
|
11532
|
+
id: this.generateId()
|
|
11533
|
+
};
|
|
11534
|
+
}
|
|
11535
|
+
trackDependencyResult(name, type2, durationMs, success, properties, context, resultCode) {
|
|
11536
|
+
const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
|
|
11537
|
+
this.telemetryProvider.trackDependency(redactValue(name), type2, durationMs, success, enrichedProperties, resultCode);
|
|
11538
|
+
}
|
|
11324
11539
|
async trackDependencyOperation(name, type2, fn, properties) {
|
|
11325
11540
|
const parentContext = this.getCurrentContext();
|
|
11326
11541
|
if (!parentContext) {
|
|
@@ -11357,8 +11572,12 @@ class TelemetryService {
|
|
|
11357
11572
|
...getExecutionContextTelemetryProperties(),
|
|
11358
11573
|
...globalProperties,
|
|
11359
11574
|
...this.defaultProperties,
|
|
11360
|
-
...properties,
|
|
11361
|
-
...context
|
|
11575
|
+
...redactProperties(properties ?? {}),
|
|
11576
|
+
...context ? {
|
|
11577
|
+
[TELEMETRY_OPERATION_ID_PROPERTY]: context.operationId,
|
|
11578
|
+
...context.parentId !== undefined ? { [TELEMETRY_PARENT_ID_PROPERTY]: context.parentId } : {},
|
|
11579
|
+
[TELEMETRY_SPAN_ID_PROPERTY]: context.id
|
|
11580
|
+
} : {}
|
|
11362
11581
|
};
|
|
11363
11582
|
if (sessionId === undefined) {
|
|
11364
11583
|
delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
|
|
@@ -11368,7 +11587,16 @@ class TelemetryService {
|
|
|
11368
11587
|
return enriched;
|
|
11369
11588
|
}
|
|
11370
11589
|
generateId() {
|
|
11371
|
-
|
|
11590
|
+
const bytes = new Uint8Array(8);
|
|
11591
|
+
let hex = "";
|
|
11592
|
+
do {
|
|
11593
|
+
crypto.getRandomValues(bytes);
|
|
11594
|
+
hex = "";
|
|
11595
|
+
for (const byte of bytes) {
|
|
11596
|
+
hex += byte.toString(16).padStart(2, "0");
|
|
11597
|
+
}
|
|
11598
|
+
} while (/^0+$/.test(hex));
|
|
11599
|
+
return hex;
|
|
11372
11600
|
}
|
|
11373
11601
|
}
|
|
11374
11602
|
// ../common/src/telemetry/node-appinsights-telemetry-provider.ts
|
|
@@ -12070,152 +12298,25 @@ function buildCommandTelemetryAttribution(commandPath, skillSource) {
|
|
|
12070
12298
|
};
|
|
12071
12299
|
}
|
|
12072
12300
|
|
|
12073
|
-
// ../common/src/telemetry/pii-redactor.ts
|
|
12074
|
-
var REDACTED = "[REDACTED]";
|
|
12075
|
-
var MAX_VALUE_LENGTH = 200;
|
|
12076
|
-
var SENSITIVE_NAME_TOKENS = new Set([
|
|
12077
|
-
"token",
|
|
12078
|
-
"tokens",
|
|
12079
|
-
"secret",
|
|
12080
|
-
"secrets",
|
|
12081
|
-
"password",
|
|
12082
|
-
"passwords",
|
|
12083
|
-
"pwd",
|
|
12084
|
-
"credential",
|
|
12085
|
-
"credentials",
|
|
12086
|
-
"auth",
|
|
12087
|
-
"authentication",
|
|
12088
|
-
"authorization",
|
|
12089
|
-
"authority",
|
|
12090
|
-
"cert",
|
|
12091
|
-
"certificate",
|
|
12092
|
-
"certificates"
|
|
12093
|
-
]);
|
|
12094
|
-
var SENSITIVE_KEY_PREFIXES = new Set([
|
|
12095
|
-
"api",
|
|
12096
|
-
"access",
|
|
12097
|
-
"client",
|
|
12098
|
-
"private",
|
|
12099
|
-
"public",
|
|
12100
|
-
"signing",
|
|
12101
|
-
"encryption",
|
|
12102
|
-
"session",
|
|
12103
|
-
"master",
|
|
12104
|
-
"shared",
|
|
12105
|
-
"root",
|
|
12106
|
-
"ssh",
|
|
12107
|
-
"rsa",
|
|
12108
|
-
"aes",
|
|
12109
|
-
"hmac",
|
|
12110
|
-
"oauth"
|
|
12111
|
-
]);
|
|
12112
|
-
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;
|
|
12113
|
-
var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
12114
|
-
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
12115
|
-
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
12116
|
-
var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
12117
|
-
var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
12118
|
-
var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
|
|
12119
|
-
function shortHash(input) {
|
|
12120
|
-
let hash = 2166136261;
|
|
12121
|
-
for (let i = 0;i < input.length; i++) {
|
|
12122
|
-
hash ^= input.charCodeAt(i);
|
|
12123
|
-
hash = Math.imul(hash, 16777619);
|
|
12124
|
-
}
|
|
12125
|
-
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
12126
|
-
}
|
|
12127
|
-
function redactUrl(raw) {
|
|
12128
|
-
try {
|
|
12129
|
-
const url = new URL(raw);
|
|
12130
|
-
return `${url.protocol}//${url.host}`;
|
|
12131
|
-
} catch {
|
|
12132
|
-
return `url#${shortHash(raw)}`;
|
|
12133
|
-
}
|
|
12134
|
-
}
|
|
12135
|
-
function redactValueDetectors(value) {
|
|
12136
|
-
let out = value;
|
|
12137
|
-
out = out.replace(JWT_PATTERN, () => REDACTED);
|
|
12138
|
-
out = out.replace(URL_PATTERN, (match) => {
|
|
12139
|
-
const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
|
|
12140
|
-
const core2 = trailing ? match.slice(0, -trailing.length) : match;
|
|
12141
|
-
return `${redactUrl(core2)}${trailing}`;
|
|
12142
|
-
});
|
|
12143
|
-
out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
12144
|
-
out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
|
|
12145
|
-
out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
|
|
12146
|
-
out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
|
|
12147
|
-
if (out.length > MAX_VALUE_LENGTH) {
|
|
12148
|
-
out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
|
|
12149
|
-
}
|
|
12150
|
-
return out;
|
|
12151
|
-
}
|
|
12152
|
-
function nameTokens(name) {
|
|
12153
|
-
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);
|
|
12154
|
-
}
|
|
12155
|
-
function isSensitiveName(name) {
|
|
12156
|
-
const tokens = nameTokens(name);
|
|
12157
|
-
for (let i = 0;i < tokens.length; i++) {
|
|
12158
|
-
const token = tokens[i];
|
|
12159
|
-
if (SENSITIVE_NAME_TOKENS.has(token)) {
|
|
12160
|
-
return true;
|
|
12161
|
-
}
|
|
12162
|
-
if (token === "key" || token === "keys") {
|
|
12163
|
-
const prev = tokens[i - 1];
|
|
12164
|
-
if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
|
|
12165
|
-
return true;
|
|
12166
|
-
}
|
|
12167
|
-
}
|
|
12168
|
-
}
|
|
12169
|
-
return false;
|
|
12170
|
-
}
|
|
12171
|
-
function redactProperty(name, value) {
|
|
12172
|
-
if (value === undefined || value === null) {
|
|
12173
|
-
return;
|
|
12174
|
-
}
|
|
12175
|
-
if (isSensitiveName(name)) {
|
|
12176
|
-
return REDACTED;
|
|
12177
|
-
}
|
|
12178
|
-
if (typeof value === "boolean" || typeof value === "number") {
|
|
12179
|
-
return value;
|
|
12180
|
-
}
|
|
12181
|
-
if (typeof value !== "string") {
|
|
12182
|
-
return "[OBJECT]";
|
|
12183
|
-
}
|
|
12184
|
-
return redactValueDetectors(value);
|
|
12185
|
-
}
|
|
12186
|
-
function redactProperties(properties) {
|
|
12187
|
-
const out = {};
|
|
12188
|
-
for (const [name, value] of Object.entries(properties)) {
|
|
12189
|
-
const redacted = redactProperty(name, value);
|
|
12190
|
-
if (redacted !== undefined) {
|
|
12191
|
-
out[name] = redacted;
|
|
12192
|
-
}
|
|
12193
|
-
}
|
|
12194
|
-
return out;
|
|
12195
|
-
}
|
|
12196
|
-
|
|
12197
12301
|
// ../common/src/trackedAction.ts
|
|
12198
12302
|
var pollSignalSlot = singleton("PollSignal");
|
|
12199
12303
|
var cliErrorCodeValues = new Set(CLI_ERROR_CODES);
|
|
12200
12304
|
var retryHintValues = new Set(RETRY_HINTS);
|
|
12305
|
+
var TELEMETRY_COMMAND_ARG_PREFIX = "uip.cmd.arg.";
|
|
12201
12306
|
function extractCommandParams(cmd) {
|
|
12202
12307
|
const params = {};
|
|
12308
|
+
const add2 = (name, value) => {
|
|
12309
|
+
if (name && value !== undefined) {
|
|
12310
|
+
params[`${TELEMETRY_COMMAND_ARG_PREFIX}${name}`] = value;
|
|
12311
|
+
}
|
|
12312
|
+
};
|
|
12203
12313
|
const registered = cmd.registeredArguments ?? [];
|
|
12204
12314
|
const processed = cmd.processedArgs ?? [];
|
|
12205
12315
|
for (let i = 0;i < registered.length; i++) {
|
|
12206
|
-
|
|
12207
|
-
if (value === undefined) {
|
|
12208
|
-
continue;
|
|
12209
|
-
}
|
|
12210
|
-
const name = registered[i].name();
|
|
12211
|
-
if (name) {
|
|
12212
|
-
params[name] = value;
|
|
12213
|
-
}
|
|
12316
|
+
add2(registered[i].name(), processed[i]);
|
|
12214
12317
|
}
|
|
12215
12318
|
for (const [key, value] of Object.entries(cmd.opts())) {
|
|
12216
|
-
|
|
12217
|
-
params[key] = value;
|
|
12218
|
-
}
|
|
12319
|
+
add2(key, value);
|
|
12219
12320
|
}
|
|
12220
12321
|
return params;
|
|
12221
12322
|
}
|
|
@@ -12258,11 +12359,12 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
12258
12359
|
return this.action(async (...args) => {
|
|
12259
12360
|
const telemetryName = deriveCommandPath(command);
|
|
12260
12361
|
const props = typeof properties === "function" ? properties(...args) : properties;
|
|
12362
|
+
const requestContext = telemetry.createRequestContext();
|
|
12261
12363
|
const startTime = performance.now();
|
|
12262
12364
|
let errorMessage;
|
|
12263
12365
|
let fallbackExitCode = EXIT_CODES.Success;
|
|
12264
12366
|
clearRecordedCommandFailureTelemetry();
|
|
12265
|
-
const [error] = await catchError(fn(...args));
|
|
12367
|
+
const [error] = await catchError(telemetry.runWithContext(requestContext, () => fn(...args)));
|
|
12266
12368
|
if (error) {
|
|
12267
12369
|
errorMessage = error instanceof Error ? error.message : String(error);
|
|
12268
12370
|
logger.debug(`[trackedAction] ${telemetryName} failed: ${errorMessage}`);
|
|
@@ -12298,16 +12400,21 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
12298
12400
|
recordedFailure,
|
|
12299
12401
|
pollSignal: context.pollSignal
|
|
12300
12402
|
});
|
|
12301
|
-
|
|
12302
|
-
|
|
12403
|
+
const commandParams = extractCommandParams(command);
|
|
12404
|
+
if (props) {
|
|
12405
|
+
for (const key of Object.keys(props)) {
|
|
12406
|
+
delete commandParams[`${TELEMETRY_COMMAND_ARG_PREFIX}${key}`];
|
|
12407
|
+
}
|
|
12408
|
+
}
|
|
12409
|
+
const baseProperties = redactProperties({
|
|
12410
|
+
...commandParams,
|
|
12303
12411
|
...props,
|
|
12304
12412
|
...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
|
|
12305
12413
|
command: "true",
|
|
12306
|
-
duration: String(durationMs),
|
|
12307
|
-
success: String(success),
|
|
12308
12414
|
...terminalTelemetry,
|
|
12309
12415
|
...errorMessage ? { errorMessage } : {}
|
|
12310
|
-
})
|
|
12416
|
+
});
|
|
12417
|
+
telemetry.trackRequestResult(telemetryName, durationMs, success, baseProperties, requestContext);
|
|
12311
12418
|
});
|
|
12312
12419
|
};
|
|
12313
12420
|
// ../common/src/console-guard.ts
|
|
@@ -15268,4 +15375,4 @@ export {
|
|
|
15268
15375
|
BASE_PATH
|
|
15269
15376
|
};
|
|
15270
15377
|
|
|
15271
|
-
//# debugId=
|
|
15378
|
+
//# debugId=4CFFD07F599D197A64756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/solution-sdk",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "1.198.0
|
|
4
|
+
"version": "1.198.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/UiPath/cli.git",
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"dist"
|
|
32
32
|
],
|
|
33
33
|
"private": false,
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "1fadf03d7a8dd102742571dff569fdac11808afb"
|
|
35
35
|
}
|