@uipath/solution-sdk 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/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.199.0-preview.
|
|
2538
|
+
version: "1.199.0-preview.97",
|
|
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
|
|
@@ -12071,152 +12299,25 @@ function buildCommandTelemetryAttribution(commandPath, skillSource) {
|
|
|
12071
12299
|
};
|
|
12072
12300
|
}
|
|
12073
12301
|
|
|
12074
|
-
// ../common/src/telemetry/pii-redactor.ts
|
|
12075
|
-
var REDACTED = "[REDACTED]";
|
|
12076
|
-
var MAX_VALUE_LENGTH = 200;
|
|
12077
|
-
var SENSITIVE_NAME_TOKENS = new Set([
|
|
12078
|
-
"token",
|
|
12079
|
-
"tokens",
|
|
12080
|
-
"secret",
|
|
12081
|
-
"secrets",
|
|
12082
|
-
"password",
|
|
12083
|
-
"passwords",
|
|
12084
|
-
"pwd",
|
|
12085
|
-
"credential",
|
|
12086
|
-
"credentials",
|
|
12087
|
-
"auth",
|
|
12088
|
-
"authentication",
|
|
12089
|
-
"authorization",
|
|
12090
|
-
"authority",
|
|
12091
|
-
"cert",
|
|
12092
|
-
"certificate",
|
|
12093
|
-
"certificates"
|
|
12094
|
-
]);
|
|
12095
|
-
var SENSITIVE_KEY_PREFIXES = new Set([
|
|
12096
|
-
"api",
|
|
12097
|
-
"access",
|
|
12098
|
-
"client",
|
|
12099
|
-
"private",
|
|
12100
|
-
"public",
|
|
12101
|
-
"signing",
|
|
12102
|
-
"encryption",
|
|
12103
|
-
"session",
|
|
12104
|
-
"master",
|
|
12105
|
-
"shared",
|
|
12106
|
-
"root",
|
|
12107
|
-
"ssh",
|
|
12108
|
-
"rsa",
|
|
12109
|
-
"aes",
|
|
12110
|
-
"hmac",
|
|
12111
|
-
"oauth"
|
|
12112
|
-
]);
|
|
12113
|
-
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;
|
|
12114
|
-
var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
12115
|
-
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
12116
|
-
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
12117
|
-
var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
12118
|
-
var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
12119
|
-
var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
|
|
12120
|
-
function shortHash(input) {
|
|
12121
|
-
let hash = 2166136261;
|
|
12122
|
-
for (let i = 0;i < input.length; i++) {
|
|
12123
|
-
hash ^= input.charCodeAt(i);
|
|
12124
|
-
hash = Math.imul(hash, 16777619);
|
|
12125
|
-
}
|
|
12126
|
-
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
12127
|
-
}
|
|
12128
|
-
function redactUrl(raw) {
|
|
12129
|
-
try {
|
|
12130
|
-
const url = new URL(raw);
|
|
12131
|
-
return `${url.protocol}//${url.host}`;
|
|
12132
|
-
} catch {
|
|
12133
|
-
return `url#${shortHash(raw)}`;
|
|
12134
|
-
}
|
|
12135
|
-
}
|
|
12136
|
-
function redactValueDetectors(value) {
|
|
12137
|
-
let out = value;
|
|
12138
|
-
out = out.replace(JWT_PATTERN, () => REDACTED);
|
|
12139
|
-
out = out.replace(URL_PATTERN, (match) => {
|
|
12140
|
-
const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
|
|
12141
|
-
const core2 = trailing ? match.slice(0, -trailing.length) : match;
|
|
12142
|
-
return `${redactUrl(core2)}${trailing}`;
|
|
12143
|
-
});
|
|
12144
|
-
out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
12145
|
-
out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
|
|
12146
|
-
out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
|
|
12147
|
-
out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
|
|
12148
|
-
if (out.length > MAX_VALUE_LENGTH) {
|
|
12149
|
-
out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
|
|
12150
|
-
}
|
|
12151
|
-
return out;
|
|
12152
|
-
}
|
|
12153
|
-
function nameTokens(name) {
|
|
12154
|
-
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);
|
|
12155
|
-
}
|
|
12156
|
-
function isSensitiveName(name) {
|
|
12157
|
-
const tokens = nameTokens(name);
|
|
12158
|
-
for (let i = 0;i < tokens.length; i++) {
|
|
12159
|
-
const token = tokens[i];
|
|
12160
|
-
if (SENSITIVE_NAME_TOKENS.has(token)) {
|
|
12161
|
-
return true;
|
|
12162
|
-
}
|
|
12163
|
-
if (token === "key" || token === "keys") {
|
|
12164
|
-
const prev = tokens[i - 1];
|
|
12165
|
-
if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
|
|
12166
|
-
return true;
|
|
12167
|
-
}
|
|
12168
|
-
}
|
|
12169
|
-
}
|
|
12170
|
-
return false;
|
|
12171
|
-
}
|
|
12172
|
-
function redactProperty(name, value) {
|
|
12173
|
-
if (value === undefined || value === null) {
|
|
12174
|
-
return;
|
|
12175
|
-
}
|
|
12176
|
-
if (isSensitiveName(name)) {
|
|
12177
|
-
return REDACTED;
|
|
12178
|
-
}
|
|
12179
|
-
if (typeof value === "boolean" || typeof value === "number") {
|
|
12180
|
-
return value;
|
|
12181
|
-
}
|
|
12182
|
-
if (typeof value !== "string") {
|
|
12183
|
-
return "[OBJECT]";
|
|
12184
|
-
}
|
|
12185
|
-
return redactValueDetectors(value);
|
|
12186
|
-
}
|
|
12187
|
-
function redactProperties(properties) {
|
|
12188
|
-
const out = {};
|
|
12189
|
-
for (const [name, value] of Object.entries(properties)) {
|
|
12190
|
-
const redacted = redactProperty(name, value);
|
|
12191
|
-
if (redacted !== undefined) {
|
|
12192
|
-
out[name] = redacted;
|
|
12193
|
-
}
|
|
12194
|
-
}
|
|
12195
|
-
return out;
|
|
12196
|
-
}
|
|
12197
|
-
|
|
12198
12302
|
// ../common/src/trackedAction.ts
|
|
12199
12303
|
var pollSignalSlot = singleton("PollSignal");
|
|
12200
12304
|
var cliErrorCodeValues = new Set(CLI_ERROR_CODES);
|
|
12201
12305
|
var retryHintValues = new Set(RETRY_HINTS);
|
|
12306
|
+
var TELEMETRY_COMMAND_ARG_PREFIX = "uip.cmd.arg.";
|
|
12202
12307
|
function extractCommandParams(cmd) {
|
|
12203
12308
|
const params = {};
|
|
12309
|
+
const add2 = (name, value) => {
|
|
12310
|
+
if (name && value !== undefined) {
|
|
12311
|
+
params[`${TELEMETRY_COMMAND_ARG_PREFIX}${name}`] = value;
|
|
12312
|
+
}
|
|
12313
|
+
};
|
|
12204
12314
|
const registered = cmd.registeredArguments ?? [];
|
|
12205
12315
|
const processed = cmd.processedArgs ?? [];
|
|
12206
12316
|
for (let i = 0;i < registered.length; i++) {
|
|
12207
|
-
|
|
12208
|
-
if (value === undefined) {
|
|
12209
|
-
continue;
|
|
12210
|
-
}
|
|
12211
|
-
const name = registered[i].name();
|
|
12212
|
-
if (name) {
|
|
12213
|
-
params[name] = value;
|
|
12214
|
-
}
|
|
12317
|
+
add2(registered[i].name(), processed[i]);
|
|
12215
12318
|
}
|
|
12216
12319
|
for (const [key, value] of Object.entries(cmd.opts())) {
|
|
12217
|
-
|
|
12218
|
-
params[key] = value;
|
|
12219
|
-
}
|
|
12320
|
+
add2(key, value);
|
|
12220
12321
|
}
|
|
12221
12322
|
return params;
|
|
12222
12323
|
}
|
|
@@ -12259,11 +12360,12 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
12259
12360
|
return this.action(async (...args) => {
|
|
12260
12361
|
const telemetryName = deriveCommandPath(command);
|
|
12261
12362
|
const props = typeof properties === "function" ? properties(...args) : properties;
|
|
12363
|
+
const requestContext = telemetry.createRequestContext();
|
|
12262
12364
|
const startTime = performance.now();
|
|
12263
12365
|
let errorMessage;
|
|
12264
12366
|
let fallbackExitCode = EXIT_CODES.Success;
|
|
12265
12367
|
clearRecordedCommandFailureTelemetry();
|
|
12266
|
-
const [error] = await catchError(fn(...args));
|
|
12368
|
+
const [error] = await catchError(telemetry.runWithContext(requestContext, () => fn(...args)));
|
|
12267
12369
|
if (error) {
|
|
12268
12370
|
errorMessage = error instanceof Error ? error.message : String(error);
|
|
12269
12371
|
logger.debug(`[trackedAction] ${telemetryName} failed: ${errorMessage}`);
|
|
@@ -12299,16 +12401,21 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
12299
12401
|
recordedFailure,
|
|
12300
12402
|
pollSignal: context.pollSignal
|
|
12301
12403
|
});
|
|
12302
|
-
|
|
12303
|
-
|
|
12404
|
+
const commandParams = extractCommandParams(command);
|
|
12405
|
+
if (props) {
|
|
12406
|
+
for (const key of Object.keys(props)) {
|
|
12407
|
+
delete commandParams[`${TELEMETRY_COMMAND_ARG_PREFIX}${key}`];
|
|
12408
|
+
}
|
|
12409
|
+
}
|
|
12410
|
+
const baseProperties = redactProperties({
|
|
12411
|
+
...commandParams,
|
|
12304
12412
|
...props,
|
|
12305
12413
|
...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
|
|
12306
12414
|
command: "true",
|
|
12307
|
-
duration: String(durationMs),
|
|
12308
|
-
success: String(success),
|
|
12309
12415
|
...terminalTelemetry,
|
|
12310
12416
|
...errorMessage ? { errorMessage } : {}
|
|
12311
|
-
})
|
|
12417
|
+
});
|
|
12418
|
+
telemetry.trackRequestResult(telemetryName, durationMs, success, baseProperties, requestContext);
|
|
12312
12419
|
});
|
|
12313
12420
|
};
|
|
12314
12421
|
// ../common/src/console-guard.ts
|
|
@@ -15338,4 +15445,4 @@ export {
|
|
|
15338
15445
|
BASE_PATH
|
|
15339
15446
|
};
|
|
15340
15447
|
|
|
15341
|
-
//# debugId=
|
|
15448
|
+
//# debugId=8798FABCCAA6CD6B64756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/solution-sdk",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "1.199.0-preview.
|
|
4
|
+
"version": "1.199.0-preview.97",
|
|
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": "087ae21e842f27bde5eb0013892c9487bfe60568"
|
|
35
35
|
}
|