@uipath/flow-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/init.js +510 -299
- package/dist/packager-tool.js +2 -2
- package/dist/tool.js +757 -447
- package/dist/validation.js +259 -152
- package/package.json +2 -2
package/dist/init.js
CHANGED
|
@@ -181319,11 +181319,36 @@ class NodeContextStorage {
|
|
|
181319
181319
|
return this.storage.getStore();
|
|
181320
181320
|
}
|
|
181321
181321
|
}
|
|
181322
|
+
// ../common/src/telemetry/trace-context.ts
|
|
181323
|
+
var TELEMETRY_TRACEPARENT_ENV = "TRACEPARENT";
|
|
181324
|
+
var TRACEPARENT_PATTERN = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/;
|
|
181325
|
+
function getProcessEnv() {
|
|
181326
|
+
return globalThis.process?.env;
|
|
181327
|
+
}
|
|
181328
|
+
function parseInboundTraceparent(value) {
|
|
181329
|
+
if (!value) {
|
|
181330
|
+
return;
|
|
181331
|
+
}
|
|
181332
|
+
const match = TRACEPARENT_PATTERN.exec(value.trim().toLowerCase());
|
|
181333
|
+
if (!match) {
|
|
181334
|
+
return;
|
|
181335
|
+
}
|
|
181336
|
+
const [, traceId, parentSpanId] = match;
|
|
181337
|
+
if (/^0+$/.test(traceId) || /^0+$/.test(parentSpanId)) {
|
|
181338
|
+
return;
|
|
181339
|
+
}
|
|
181340
|
+
return { traceId, parentSpanId };
|
|
181341
|
+
}
|
|
181342
|
+
function getInboundTraceContext() {
|
|
181343
|
+
return parseInboundTraceparent(getProcessEnv()?.[TELEMETRY_TRACEPARENT_ENV]);
|
|
181344
|
+
}
|
|
181345
|
+
|
|
181322
181346
|
// ../common/src/telemetry/session-id.ts
|
|
181323
181347
|
var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
|
|
181324
181348
|
var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
|
|
181325
181349
|
var telemetrySessionIdSlot = singleton("TelemetrySessionId");
|
|
181326
|
-
|
|
181350
|
+
var telemetryOperationIdSlot = singleton("TelemetryOperationId");
|
|
181351
|
+
function getProcessEnv2() {
|
|
181327
181352
|
return globalThis.process?.env;
|
|
181328
181353
|
}
|
|
181329
181354
|
function normalizeSessionId(value) {
|
|
@@ -181334,18 +181359,165 @@ function normalizeSessionId(value) {
|
|
|
181334
181359
|
return trimmed || undefined;
|
|
181335
181360
|
}
|
|
181336
181361
|
function getConfiguredTelemetrySessionId() {
|
|
181337
|
-
return normalizeSessionId(
|
|
181362
|
+
return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
|
|
181338
181363
|
}
|
|
181339
181364
|
function resolveTelemetrySessionId(existingSessionId) {
|
|
181340
181365
|
return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
|
|
181341
181366
|
}
|
|
181367
|
+
function getTelemetryOperationId() {
|
|
181368
|
+
const existing = telemetryOperationIdSlot.get();
|
|
181369
|
+
if (existing) {
|
|
181370
|
+
return existing;
|
|
181371
|
+
}
|
|
181372
|
+
const inboundTraceId = getInboundTraceContext()?.traceId;
|
|
181373
|
+
const generated = inboundTraceId ?? crypto.randomUUID().replaceAll("-", "");
|
|
181374
|
+
telemetryOperationIdSlot.set(generated);
|
|
181375
|
+
return generated;
|
|
181376
|
+
}
|
|
181342
181377
|
// ../common/src/telemetry/global-telemetry-properties.ts
|
|
181343
181378
|
var telemetryPropsSlot = singleton("TelemetryDefaultProps");
|
|
181344
181379
|
function getGlobalTelemetryProperties() {
|
|
181345
181380
|
return telemetryPropsSlot.get();
|
|
181346
181381
|
}
|
|
181347
181382
|
|
|
181383
|
+
// ../common/src/telemetry/pii-redactor.ts
|
|
181384
|
+
var REDACTED = "[REDACTED]";
|
|
181385
|
+
var MAX_VALUE_LENGTH = 200;
|
|
181386
|
+
var SENSITIVE_NAME_TOKENS = new Set([
|
|
181387
|
+
"token",
|
|
181388
|
+
"tokens",
|
|
181389
|
+
"secret",
|
|
181390
|
+
"secrets",
|
|
181391
|
+
"password",
|
|
181392
|
+
"passwords",
|
|
181393
|
+
"pwd",
|
|
181394
|
+
"credential",
|
|
181395
|
+
"credentials",
|
|
181396
|
+
"auth",
|
|
181397
|
+
"authentication",
|
|
181398
|
+
"authorization",
|
|
181399
|
+
"authority",
|
|
181400
|
+
"cert",
|
|
181401
|
+
"certificate",
|
|
181402
|
+
"certificates"
|
|
181403
|
+
]);
|
|
181404
|
+
var SENSITIVE_KEY_PREFIXES = new Set([
|
|
181405
|
+
"api",
|
|
181406
|
+
"access",
|
|
181407
|
+
"client",
|
|
181408
|
+
"private",
|
|
181409
|
+
"public",
|
|
181410
|
+
"signing",
|
|
181411
|
+
"encryption",
|
|
181412
|
+
"session",
|
|
181413
|
+
"master",
|
|
181414
|
+
"shared",
|
|
181415
|
+
"root",
|
|
181416
|
+
"ssh",
|
|
181417
|
+
"rsa",
|
|
181418
|
+
"aes",
|
|
181419
|
+
"hmac",
|
|
181420
|
+
"oauth"
|
|
181421
|
+
]);
|
|
181422
|
+
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;
|
|
181423
|
+
var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
181424
|
+
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
181425
|
+
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
181426
|
+
var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
181427
|
+
var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
181428
|
+
var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
|
|
181429
|
+
function shortHash(input) {
|
|
181430
|
+
let hash = 2166136261;
|
|
181431
|
+
for (let i = 0;i < input.length; i++) {
|
|
181432
|
+
hash ^= input.charCodeAt(i);
|
|
181433
|
+
hash = Math.imul(hash, 16777619);
|
|
181434
|
+
}
|
|
181435
|
+
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
181436
|
+
}
|
|
181437
|
+
function redactUrl(raw) {
|
|
181438
|
+
try {
|
|
181439
|
+
const url = new URL(raw);
|
|
181440
|
+
return `${url.protocol}//${url.host}`;
|
|
181441
|
+
} catch {
|
|
181442
|
+
return `url#${shortHash(raw)}`;
|
|
181443
|
+
}
|
|
181444
|
+
}
|
|
181445
|
+
function redactValueDetectors(value) {
|
|
181446
|
+
let out = value;
|
|
181447
|
+
out = out.replace(JWT_PATTERN, () => REDACTED);
|
|
181448
|
+
out = out.replace(URL_PATTERN, (match) => {
|
|
181449
|
+
const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
|
|
181450
|
+
const core2 = trailing ? match.slice(0, -trailing.length) : match;
|
|
181451
|
+
return `${redactUrl(core2)}${trailing}`;
|
|
181452
|
+
});
|
|
181453
|
+
out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
181454
|
+
out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
|
|
181455
|
+
out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
|
|
181456
|
+
out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
|
|
181457
|
+
if (out.length > MAX_VALUE_LENGTH) {
|
|
181458
|
+
out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
|
|
181459
|
+
}
|
|
181460
|
+
return out;
|
|
181461
|
+
}
|
|
181462
|
+
function redactValue(value) {
|
|
181463
|
+
return redactValueDetectors(value);
|
|
181464
|
+
}
|
|
181465
|
+
function redactError(error) {
|
|
181466
|
+
const safe = new Error(redactValueDetectors(error.message ?? ""));
|
|
181467
|
+
safe.name = error.name;
|
|
181468
|
+
safe.stack = typeof error.stack === "string" ? redactValueDetectors(error.stack) : undefined;
|
|
181469
|
+
return safe;
|
|
181470
|
+
}
|
|
181471
|
+
function nameTokens(name) {
|
|
181472
|
+
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);
|
|
181473
|
+
}
|
|
181474
|
+
function isSensitiveName(name) {
|
|
181475
|
+
const tokens = nameTokens(name);
|
|
181476
|
+
for (let i = 0;i < tokens.length; i++) {
|
|
181477
|
+
const token = tokens[i];
|
|
181478
|
+
if (SENSITIVE_NAME_TOKENS.has(token)) {
|
|
181479
|
+
return true;
|
|
181480
|
+
}
|
|
181481
|
+
if (token === "key" || token === "keys") {
|
|
181482
|
+
const prev = tokens[i - 1];
|
|
181483
|
+
if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
|
|
181484
|
+
return true;
|
|
181485
|
+
}
|
|
181486
|
+
}
|
|
181487
|
+
}
|
|
181488
|
+
return false;
|
|
181489
|
+
}
|
|
181490
|
+
function redactProperty(name, value) {
|
|
181491
|
+
if (value === undefined || value === null) {
|
|
181492
|
+
return;
|
|
181493
|
+
}
|
|
181494
|
+
if (isSensitiveName(name)) {
|
|
181495
|
+
return REDACTED;
|
|
181496
|
+
}
|
|
181497
|
+
if (typeof value === "boolean" || typeof value === "number") {
|
|
181498
|
+
return value;
|
|
181499
|
+
}
|
|
181500
|
+
if (typeof value !== "string") {
|
|
181501
|
+
return "[OBJECT]";
|
|
181502
|
+
}
|
|
181503
|
+
return redactValueDetectors(value);
|
|
181504
|
+
}
|
|
181505
|
+
function redactProperties(properties) {
|
|
181506
|
+
const out = {};
|
|
181507
|
+
for (const [name, value] of Object.entries(properties)) {
|
|
181508
|
+
const redacted = redactProperty(name, value);
|
|
181509
|
+
if (redacted !== undefined) {
|
|
181510
|
+
out[name] = redacted;
|
|
181511
|
+
}
|
|
181512
|
+
}
|
|
181513
|
+
return out;
|
|
181514
|
+
}
|
|
181515
|
+
|
|
181348
181516
|
// ../common/src/telemetry/telemetry-service.ts
|
|
181517
|
+
var TELEMETRY_OPERATION_ID_PROPERTY = "uip.trace.operation_id";
|
|
181518
|
+
var TELEMETRY_PARENT_ID_PROPERTY = "uip.trace.parent_id";
|
|
181519
|
+
var TELEMETRY_SPAN_ID_PROPERTY = "uip.trace.span_id";
|
|
181520
|
+
|
|
181349
181521
|
class TelemetryService {
|
|
181350
181522
|
telemetryProvider;
|
|
181351
181523
|
contextStorage;
|
|
@@ -181372,11 +181544,15 @@ class TelemetryService {
|
|
|
181372
181544
|
trackException(error, properties) {
|
|
181373
181545
|
const context = this.getCurrentContext();
|
|
181374
181546
|
const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
|
|
181375
|
-
this.telemetryProvider.trackException(error, enrichedProperties);
|
|
181547
|
+
this.telemetryProvider.trackException(redactError(error), enrichedProperties);
|
|
181376
181548
|
}
|
|
181377
181549
|
async trackRequest(name, fn, properties) {
|
|
181550
|
+
const parentContext = this.getCurrentContext();
|
|
181551
|
+
const operationId = parentContext?.operationId ?? this.operationId ?? getTelemetryOperationId();
|
|
181552
|
+
const parentId = parentContext ? parentContext.id : this.inboundParentIdFor(operationId);
|
|
181378
181553
|
const context = {
|
|
181379
|
-
operationId
|
|
181554
|
+
operationId,
|
|
181555
|
+
...parentId !== undefined ? { parentId } : {},
|
|
181380
181556
|
id: this.generateId()
|
|
181381
181557
|
};
|
|
181382
181558
|
const startTime = performance.now();
|
|
@@ -181394,6 +181570,45 @@ class TelemetryService {
|
|
|
181394
181570
|
throw error;
|
|
181395
181571
|
}
|
|
181396
181572
|
}
|
|
181573
|
+
trackRequestResult(name, durationMs, success, properties, context) {
|
|
181574
|
+
const requestContext = context ?? {
|
|
181575
|
+
operationId: this.operationId ?? getTelemetryOperationId(),
|
|
181576
|
+
id: this.generateId()
|
|
181577
|
+
};
|
|
181578
|
+
const enrichedProperties = this.enrichPropertiesWithContext(properties, requestContext);
|
|
181579
|
+
this.telemetryProvider.trackRequest(name, durationMs, success, enrichedProperties);
|
|
181580
|
+
}
|
|
181581
|
+
createRequestContext() {
|
|
181582
|
+
const operationId = this.operationId ?? getTelemetryOperationId();
|
|
181583
|
+
const parentId = this.inboundParentIdFor(operationId);
|
|
181584
|
+
return {
|
|
181585
|
+
operationId,
|
|
181586
|
+
...parentId !== undefined ? { parentId } : {},
|
|
181587
|
+
id: this.generateId()
|
|
181588
|
+
};
|
|
181589
|
+
}
|
|
181590
|
+
inboundParentIdFor(operationId) {
|
|
181591
|
+
const inbound = getInboundTraceContext();
|
|
181592
|
+
return inbound && inbound.traceId === operationId ? inbound.parentSpanId : undefined;
|
|
181593
|
+
}
|
|
181594
|
+
runWithContext(context, fn) {
|
|
181595
|
+
return this.contextStorage.run(context, fn);
|
|
181596
|
+
}
|
|
181597
|
+
createDependencyContext() {
|
|
181598
|
+
const parentContext = this.getCurrentContext();
|
|
181599
|
+
if (!parentContext) {
|
|
181600
|
+
return;
|
|
181601
|
+
}
|
|
181602
|
+
return {
|
|
181603
|
+
operationId: parentContext.operationId,
|
|
181604
|
+
parentId: parentContext.id,
|
|
181605
|
+
id: this.generateId()
|
|
181606
|
+
};
|
|
181607
|
+
}
|
|
181608
|
+
trackDependencyResult(name, type2, durationMs, success, properties, context, resultCode) {
|
|
181609
|
+
const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
|
|
181610
|
+
this.telemetryProvider.trackDependency(redactValue(name), type2, durationMs, success, enrichedProperties, resultCode);
|
|
181611
|
+
}
|
|
181397
181612
|
async trackDependencyOperation(name, type2, fn, properties) {
|
|
181398
181613
|
const parentContext = this.getCurrentContext();
|
|
181399
181614
|
if (!parentContext) {
|
|
@@ -181430,8 +181645,12 @@ class TelemetryService {
|
|
|
181430
181645
|
...getExecutionContextTelemetryProperties(),
|
|
181431
181646
|
...globalProperties,
|
|
181432
181647
|
...this.defaultProperties,
|
|
181433
|
-
...properties,
|
|
181434
|
-
...context
|
|
181648
|
+
...redactProperties(properties ?? {}),
|
|
181649
|
+
...context ? {
|
|
181650
|
+
[TELEMETRY_OPERATION_ID_PROPERTY]: context.operationId,
|
|
181651
|
+
...context.parentId !== undefined ? { [TELEMETRY_PARENT_ID_PROPERTY]: context.parentId } : {},
|
|
181652
|
+
[TELEMETRY_SPAN_ID_PROPERTY]: context.id
|
|
181653
|
+
} : {}
|
|
181435
181654
|
};
|
|
181436
181655
|
if (sessionId === undefined) {
|
|
181437
181656
|
delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
|
|
@@ -181441,7 +181660,16 @@ class TelemetryService {
|
|
|
181441
181660
|
return enriched;
|
|
181442
181661
|
}
|
|
181443
181662
|
generateId() {
|
|
181444
|
-
|
|
181663
|
+
const bytes = new Uint8Array(8);
|
|
181664
|
+
let hex = "";
|
|
181665
|
+
do {
|
|
181666
|
+
crypto.getRandomValues(bytes);
|
|
181667
|
+
hex = "";
|
|
181668
|
+
for (const byte of bytes) {
|
|
181669
|
+
hex += byte.toString(16).padStart(2, "0");
|
|
181670
|
+
}
|
|
181671
|
+
} while (/^0+$/.test(hex));
|
|
181672
|
+
return hex;
|
|
181445
181673
|
}
|
|
181446
181674
|
}
|
|
181447
181675
|
// ../common/src/telemetry/node-appinsights-telemetry-provider.ts
|
|
@@ -182144,152 +182372,25 @@ function buildCommandTelemetryAttribution(commandPath, skillSource) {
|
|
|
182144
182372
|
};
|
|
182145
182373
|
}
|
|
182146
182374
|
|
|
182147
|
-
// ../common/src/telemetry/pii-redactor.ts
|
|
182148
|
-
var REDACTED = "[REDACTED]";
|
|
182149
|
-
var MAX_VALUE_LENGTH = 200;
|
|
182150
|
-
var SENSITIVE_NAME_TOKENS = new Set([
|
|
182151
|
-
"token",
|
|
182152
|
-
"tokens",
|
|
182153
|
-
"secret",
|
|
182154
|
-
"secrets",
|
|
182155
|
-
"password",
|
|
182156
|
-
"passwords",
|
|
182157
|
-
"pwd",
|
|
182158
|
-
"credential",
|
|
182159
|
-
"credentials",
|
|
182160
|
-
"auth",
|
|
182161
|
-
"authentication",
|
|
182162
|
-
"authorization",
|
|
182163
|
-
"authority",
|
|
182164
|
-
"cert",
|
|
182165
|
-
"certificate",
|
|
182166
|
-
"certificates"
|
|
182167
|
-
]);
|
|
182168
|
-
var SENSITIVE_KEY_PREFIXES = new Set([
|
|
182169
|
-
"api",
|
|
182170
|
-
"access",
|
|
182171
|
-
"client",
|
|
182172
|
-
"private",
|
|
182173
|
-
"public",
|
|
182174
|
-
"signing",
|
|
182175
|
-
"encryption",
|
|
182176
|
-
"session",
|
|
182177
|
-
"master",
|
|
182178
|
-
"shared",
|
|
182179
|
-
"root",
|
|
182180
|
-
"ssh",
|
|
182181
|
-
"rsa",
|
|
182182
|
-
"aes",
|
|
182183
|
-
"hmac",
|
|
182184
|
-
"oauth"
|
|
182185
|
-
]);
|
|
182186
|
-
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;
|
|
182187
|
-
var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
182188
|
-
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
182189
|
-
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
182190
|
-
var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
182191
|
-
var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
182192
|
-
var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
|
|
182193
|
-
function shortHash(input) {
|
|
182194
|
-
let hash = 2166136261;
|
|
182195
|
-
for (let i = 0;i < input.length; i++) {
|
|
182196
|
-
hash ^= input.charCodeAt(i);
|
|
182197
|
-
hash = Math.imul(hash, 16777619);
|
|
182198
|
-
}
|
|
182199
|
-
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
182200
|
-
}
|
|
182201
|
-
function redactUrl(raw) {
|
|
182202
|
-
try {
|
|
182203
|
-
const url = new URL(raw);
|
|
182204
|
-
return `${url.protocol}//${url.host}`;
|
|
182205
|
-
} catch {
|
|
182206
|
-
return `url#${shortHash(raw)}`;
|
|
182207
|
-
}
|
|
182208
|
-
}
|
|
182209
|
-
function redactValueDetectors(value) {
|
|
182210
|
-
let out = value;
|
|
182211
|
-
out = out.replace(JWT_PATTERN, () => REDACTED);
|
|
182212
|
-
out = out.replace(URL_PATTERN, (match) => {
|
|
182213
|
-
const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
|
|
182214
|
-
const core2 = trailing ? match.slice(0, -trailing.length) : match;
|
|
182215
|
-
return `${redactUrl(core2)}${trailing}`;
|
|
182216
|
-
});
|
|
182217
|
-
out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
182218
|
-
out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
|
|
182219
|
-
out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
|
|
182220
|
-
out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
|
|
182221
|
-
if (out.length > MAX_VALUE_LENGTH) {
|
|
182222
|
-
out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
|
|
182223
|
-
}
|
|
182224
|
-
return out;
|
|
182225
|
-
}
|
|
182226
|
-
function nameTokens(name) {
|
|
182227
|
-
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);
|
|
182228
|
-
}
|
|
182229
|
-
function isSensitiveName(name) {
|
|
182230
|
-
const tokens = nameTokens(name);
|
|
182231
|
-
for (let i = 0;i < tokens.length; i++) {
|
|
182232
|
-
const token = tokens[i];
|
|
182233
|
-
if (SENSITIVE_NAME_TOKENS.has(token)) {
|
|
182234
|
-
return true;
|
|
182235
|
-
}
|
|
182236
|
-
if (token === "key" || token === "keys") {
|
|
182237
|
-
const prev = tokens[i - 1];
|
|
182238
|
-
if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
|
|
182239
|
-
return true;
|
|
182240
|
-
}
|
|
182241
|
-
}
|
|
182242
|
-
}
|
|
182243
|
-
return false;
|
|
182244
|
-
}
|
|
182245
|
-
function redactProperty(name, value) {
|
|
182246
|
-
if (value === undefined || value === null) {
|
|
182247
|
-
return;
|
|
182248
|
-
}
|
|
182249
|
-
if (isSensitiveName(name)) {
|
|
182250
|
-
return REDACTED;
|
|
182251
|
-
}
|
|
182252
|
-
if (typeof value === "boolean" || typeof value === "number") {
|
|
182253
|
-
return value;
|
|
182254
|
-
}
|
|
182255
|
-
if (typeof value !== "string") {
|
|
182256
|
-
return "[OBJECT]";
|
|
182257
|
-
}
|
|
182258
|
-
return redactValueDetectors(value);
|
|
182259
|
-
}
|
|
182260
|
-
function redactProperties(properties) {
|
|
182261
|
-
const out = {};
|
|
182262
|
-
for (const [name, value] of Object.entries(properties)) {
|
|
182263
|
-
const redacted = redactProperty(name, value);
|
|
182264
|
-
if (redacted !== undefined) {
|
|
182265
|
-
out[name] = redacted;
|
|
182266
|
-
}
|
|
182267
|
-
}
|
|
182268
|
-
return out;
|
|
182269
|
-
}
|
|
182270
|
-
|
|
182271
182375
|
// ../common/src/trackedAction.ts
|
|
182272
182376
|
var pollSignalSlot = singleton("PollSignal");
|
|
182273
182377
|
var cliErrorCodeValues = new Set(CLI_ERROR_CODES);
|
|
182274
182378
|
var retryHintValues = new Set(RETRY_HINTS);
|
|
182379
|
+
var TELEMETRY_COMMAND_ARG_PREFIX = "uip.cmd.arg.";
|
|
182275
182380
|
function extractCommandParams(cmd) {
|
|
182276
182381
|
const params = {};
|
|
182382
|
+
const add2 = (name, value) => {
|
|
182383
|
+
if (name && value !== undefined) {
|
|
182384
|
+
params[`${TELEMETRY_COMMAND_ARG_PREFIX}${name}`] = value;
|
|
182385
|
+
}
|
|
182386
|
+
};
|
|
182277
182387
|
const registered = cmd.registeredArguments ?? [];
|
|
182278
182388
|
const processed = cmd.processedArgs ?? [];
|
|
182279
182389
|
for (let i = 0;i < registered.length; i++) {
|
|
182280
|
-
|
|
182281
|
-
if (value === undefined) {
|
|
182282
|
-
continue;
|
|
182283
|
-
}
|
|
182284
|
-
const name = registered[i].name();
|
|
182285
|
-
if (name) {
|
|
182286
|
-
params[name] = value;
|
|
182287
|
-
}
|
|
182390
|
+
add2(registered[i].name(), processed[i]);
|
|
182288
182391
|
}
|
|
182289
182392
|
for (const [key, value] of Object.entries(cmd.opts())) {
|
|
182290
|
-
|
|
182291
|
-
params[key] = value;
|
|
182292
|
-
}
|
|
182393
|
+
add2(key, value);
|
|
182293
182394
|
}
|
|
182294
182395
|
return params;
|
|
182295
182396
|
}
|
|
@@ -182332,11 +182433,12 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
182332
182433
|
return this.action(async (...args) => {
|
|
182333
182434
|
const telemetryName = deriveCommandPath(command);
|
|
182334
182435
|
const props = typeof properties === "function" ? properties(...args) : properties;
|
|
182436
|
+
const requestContext = telemetry.createRequestContext();
|
|
182335
182437
|
const startTime = performance.now();
|
|
182336
182438
|
let errorMessage;
|
|
182337
182439
|
let fallbackExitCode = EXIT_CODES.Success;
|
|
182338
182440
|
clearRecordedCommandFailureTelemetry();
|
|
182339
|
-
const [error] = await catchError(fn(...args));
|
|
182441
|
+
const [error] = await catchError(telemetry.runWithContext(requestContext, () => fn(...args)));
|
|
182340
182442
|
if (error) {
|
|
182341
182443
|
errorMessage = error instanceof Error ? error.message : String(error);
|
|
182342
182444
|
logger.debug(`[trackedAction] ${telemetryName} failed: ${errorMessage}`);
|
|
@@ -182372,16 +182474,21 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
182372
182474
|
recordedFailure,
|
|
182373
182475
|
pollSignal: context.pollSignal
|
|
182374
182476
|
});
|
|
182375
|
-
|
|
182376
|
-
|
|
182477
|
+
const commandParams = extractCommandParams(command);
|
|
182478
|
+
if (props) {
|
|
182479
|
+
for (const key of Object.keys(props)) {
|
|
182480
|
+
delete commandParams[`${TELEMETRY_COMMAND_ARG_PREFIX}${key}`];
|
|
182481
|
+
}
|
|
182482
|
+
}
|
|
182483
|
+
const baseProperties = redactProperties({
|
|
182484
|
+
...commandParams,
|
|
182377
182485
|
...props,
|
|
182378
182486
|
...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
|
|
182379
182487
|
command: "true",
|
|
182380
|
-
duration: String(durationMs),
|
|
182381
|
-
success: String(success),
|
|
182382
182488
|
...terminalTelemetry,
|
|
182383
182489
|
...errorMessage ? { errorMessage } : {}
|
|
182384
|
-
})
|
|
182490
|
+
});
|
|
182491
|
+
telemetry.trackRequestResult(telemetryName, durationMs, success, baseProperties, requestContext);
|
|
182385
182492
|
});
|
|
182386
182493
|
};
|
|
182387
182494
|
// ../common/src/console-guard.ts
|
|
@@ -216215,7 +216322,7 @@ class TextApiResponse {
|
|
|
216215
216322
|
var package_default = {
|
|
216216
216323
|
name: "@uipath/integrationservice-sdk",
|
|
216217
216324
|
license: "MIT",
|
|
216218
|
-
version: "1.199.0-preview.
|
|
216325
|
+
version: "1.199.0-preview.99",
|
|
216219
216326
|
repository: {
|
|
216220
216327
|
type: "git",
|
|
216221
216328
|
url: "https://github.com/UiPath/cli.git",
|
|
@@ -223009,7 +223116,7 @@ function querystringSingleKey4(key, value, keyPrefix = "") {
|
|
|
223009
223116
|
var package_default3 = {
|
|
223010
223117
|
name: "@uipath/solution-sdk",
|
|
223011
223118
|
license: "MIT",
|
|
223012
|
-
version: "1.199.0-preview.
|
|
223119
|
+
version: "1.199.0-preview.99",
|
|
223013
223120
|
repository: {
|
|
223014
223121
|
type: "git",
|
|
223015
223122
|
url: "https://github.com/UiPath/cli.git",
|
|
@@ -225613,7 +225720,7 @@ init_dist2();
|
|
|
225613
225720
|
// ../packager/packager-tool-flow/package.json
|
|
225614
225721
|
var package_default4 = {
|
|
225615
225722
|
name: "@uipath/packager-tool-flow",
|
|
225616
|
-
version: "1.199.0-preview.
|
|
225723
|
+
version: "1.199.0-preview.99",
|
|
225617
225724
|
description: "UiPath Flow tool implementation",
|
|
225618
225725
|
type: "module",
|
|
225619
225726
|
exports: {
|
|
@@ -268402,10 +268509,33 @@ class NodeContextStorage2 {
|
|
|
268402
268509
|
return this.storage.getStore();
|
|
268403
268510
|
}
|
|
268404
268511
|
}
|
|
268512
|
+
var TELEMETRY_TRACEPARENT_ENV2 = "TRACEPARENT";
|
|
268513
|
+
var TRACEPARENT_PATTERN2 = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/;
|
|
268514
|
+
function getProcessEnv3() {
|
|
268515
|
+
return globalThis.process?.env;
|
|
268516
|
+
}
|
|
268517
|
+
function parseInboundTraceparent2(value) {
|
|
268518
|
+
if (!value) {
|
|
268519
|
+
return;
|
|
268520
|
+
}
|
|
268521
|
+
const match = TRACEPARENT_PATTERN2.exec(value.trim().toLowerCase());
|
|
268522
|
+
if (!match) {
|
|
268523
|
+
return;
|
|
268524
|
+
}
|
|
268525
|
+
const [, traceId, parentSpanId] = match;
|
|
268526
|
+
if (/^0+$/.test(traceId) || /^0+$/.test(parentSpanId)) {
|
|
268527
|
+
return;
|
|
268528
|
+
}
|
|
268529
|
+
return { traceId, parentSpanId };
|
|
268530
|
+
}
|
|
268531
|
+
function getInboundTraceContext2() {
|
|
268532
|
+
return parseInboundTraceparent2(getProcessEnv3()?.[TELEMETRY_TRACEPARENT_ENV2]);
|
|
268533
|
+
}
|
|
268405
268534
|
var TELEMETRY_SESSION_ID_ENV2 = "UIPATH_SESSION_ID";
|
|
268406
268535
|
var TELEMETRY_SESSION_ID_PROPERTY2 = "session_id";
|
|
268407
268536
|
var telemetrySessionIdSlot2 = singleton3("TelemetrySessionId");
|
|
268408
|
-
|
|
268537
|
+
var telemetryOperationIdSlot2 = singleton3("TelemetryOperationId");
|
|
268538
|
+
function getProcessEnv22() {
|
|
268409
268539
|
return globalThis.process?.env;
|
|
268410
268540
|
}
|
|
268411
268541
|
function normalizeSessionId2(value) {
|
|
@@ -268416,15 +268546,159 @@ function normalizeSessionId2(value) {
|
|
|
268416
268546
|
return trimmed || undefined;
|
|
268417
268547
|
}
|
|
268418
268548
|
function getConfiguredTelemetrySessionId2() {
|
|
268419
|
-
return normalizeSessionId2(
|
|
268549
|
+
return normalizeSessionId2(getProcessEnv22()?.[TELEMETRY_SESSION_ID_ENV2]);
|
|
268420
268550
|
}
|
|
268421
268551
|
function resolveTelemetrySessionId2(existingSessionId) {
|
|
268422
268552
|
return getConfiguredTelemetrySessionId2() ?? normalizeSessionId2(existingSessionId);
|
|
268423
268553
|
}
|
|
268554
|
+
function getTelemetryOperationId2() {
|
|
268555
|
+
const existing = telemetryOperationIdSlot2.get();
|
|
268556
|
+
if (existing) {
|
|
268557
|
+
return existing;
|
|
268558
|
+
}
|
|
268559
|
+
const inboundTraceId = getInboundTraceContext2()?.traceId;
|
|
268560
|
+
const generated = inboundTraceId ?? crypto.randomUUID().replaceAll("-", "");
|
|
268561
|
+
telemetryOperationIdSlot2.set(generated);
|
|
268562
|
+
return generated;
|
|
268563
|
+
}
|
|
268424
268564
|
var telemetryPropsSlot2 = singleton3("TelemetryDefaultProps");
|
|
268425
268565
|
function getGlobalTelemetryProperties2() {
|
|
268426
268566
|
return telemetryPropsSlot2.get();
|
|
268427
268567
|
}
|
|
268568
|
+
var REDACTED2 = "[REDACTED]";
|
|
268569
|
+
var MAX_VALUE_LENGTH2 = 200;
|
|
268570
|
+
var SENSITIVE_NAME_TOKENS2 = new Set([
|
|
268571
|
+
"token",
|
|
268572
|
+
"tokens",
|
|
268573
|
+
"secret",
|
|
268574
|
+
"secrets",
|
|
268575
|
+
"password",
|
|
268576
|
+
"passwords",
|
|
268577
|
+
"pwd",
|
|
268578
|
+
"credential",
|
|
268579
|
+
"credentials",
|
|
268580
|
+
"auth",
|
|
268581
|
+
"authentication",
|
|
268582
|
+
"authorization",
|
|
268583
|
+
"authority",
|
|
268584
|
+
"cert",
|
|
268585
|
+
"certificate",
|
|
268586
|
+
"certificates"
|
|
268587
|
+
]);
|
|
268588
|
+
var SENSITIVE_KEY_PREFIXES2 = new Set([
|
|
268589
|
+
"api",
|
|
268590
|
+
"access",
|
|
268591
|
+
"client",
|
|
268592
|
+
"private",
|
|
268593
|
+
"public",
|
|
268594
|
+
"signing",
|
|
268595
|
+
"encryption",
|
|
268596
|
+
"session",
|
|
268597
|
+
"master",
|
|
268598
|
+
"shared",
|
|
268599
|
+
"root",
|
|
268600
|
+
"ssh",
|
|
268601
|
+
"rsa",
|
|
268602
|
+
"aes",
|
|
268603
|
+
"hmac",
|
|
268604
|
+
"oauth"
|
|
268605
|
+
]);
|
|
268606
|
+
var UUID_PATTERN3 = /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi;
|
|
268607
|
+
var EMAIL_PATTERN2 = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
268608
|
+
var JWT_PATTERN2 = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
268609
|
+
var LONG_TOKEN_PATTERN2 = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
268610
|
+
var USER_HOME_PATTERN2 = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
268611
|
+
var URL_PATTERN2 = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
268612
|
+
var URL_TRAILING_PUNCT2 = /[.,;:!?)\]}>'"]+$/;
|
|
268613
|
+
function shortHash2(input2) {
|
|
268614
|
+
let hash3 = 2166136261;
|
|
268615
|
+
for (let i3 = 0;i3 < input2.length; i3++) {
|
|
268616
|
+
hash3 ^= input2.charCodeAt(i3);
|
|
268617
|
+
hash3 = Math.imul(hash3, 16777619);
|
|
268618
|
+
}
|
|
268619
|
+
return (hash3 >>> 0).toString(16).padStart(8, "0");
|
|
268620
|
+
}
|
|
268621
|
+
function redactUrl2(raw) {
|
|
268622
|
+
try {
|
|
268623
|
+
const url5 = new URL(raw);
|
|
268624
|
+
return `${url5.protocol}//${url5.host}`;
|
|
268625
|
+
} catch {
|
|
268626
|
+
return `url#${shortHash2(raw)}`;
|
|
268627
|
+
}
|
|
268628
|
+
}
|
|
268629
|
+
function redactValueDetectors2(value) {
|
|
268630
|
+
let out = value;
|
|
268631
|
+
out = out.replace(JWT_PATTERN2, () => REDACTED2);
|
|
268632
|
+
out = out.replace(URL_PATTERN2, (match) => {
|
|
268633
|
+
const trailing = match.match(URL_TRAILING_PUNCT2)?.[0] ?? "";
|
|
268634
|
+
const core22 = trailing ? match.slice(0, -trailing.length) : match;
|
|
268635
|
+
return `${redactUrl2(core22)}${trailing}`;
|
|
268636
|
+
});
|
|
268637
|
+
out = out.replace(USER_HOME_PATTERN2, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
268638
|
+
out = out.replace(EMAIL_PATTERN2, (match) => `email#${shortHash2(match)}`);
|
|
268639
|
+
out = out.replace(UUID_PATTERN3, (match) => `uuid#${shortHash2(match)}`);
|
|
268640
|
+
out = out.replace(LONG_TOKEN_PATTERN2, () => REDACTED2);
|
|
268641
|
+
if (out.length > MAX_VALUE_LENGTH2) {
|
|
268642
|
+
out = `${out.slice(0, MAX_VALUE_LENGTH2)}…`;
|
|
268643
|
+
}
|
|
268644
|
+
return out;
|
|
268645
|
+
}
|
|
268646
|
+
function redactValue2(value) {
|
|
268647
|
+
return redactValueDetectors2(value);
|
|
268648
|
+
}
|
|
268649
|
+
function redactError2(error95) {
|
|
268650
|
+
const safe = new Error(redactValueDetectors2(error95.message ?? ""));
|
|
268651
|
+
safe.name = error95.name;
|
|
268652
|
+
safe.stack = typeof error95.stack === "string" ? redactValueDetectors2(error95.stack) : undefined;
|
|
268653
|
+
return safe;
|
|
268654
|
+
}
|
|
268655
|
+
function nameTokens2(name2) {
|
|
268656
|
+
return name2.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").split(/[\s._-]+/).map((t13) => t13.toLowerCase()).filter(Boolean);
|
|
268657
|
+
}
|
|
268658
|
+
function isSensitiveName2(name2) {
|
|
268659
|
+
const tokens = nameTokens2(name2);
|
|
268660
|
+
for (let i3 = 0;i3 < tokens.length; i3++) {
|
|
268661
|
+
const token = tokens[i3];
|
|
268662
|
+
if (SENSITIVE_NAME_TOKENS2.has(token)) {
|
|
268663
|
+
return true;
|
|
268664
|
+
}
|
|
268665
|
+
if (token === "key" || token === "keys") {
|
|
268666
|
+
const prev = tokens[i3 - 1];
|
|
268667
|
+
if (prev && SENSITIVE_KEY_PREFIXES2.has(prev)) {
|
|
268668
|
+
return true;
|
|
268669
|
+
}
|
|
268670
|
+
}
|
|
268671
|
+
}
|
|
268672
|
+
return false;
|
|
268673
|
+
}
|
|
268674
|
+
function redactProperty2(name2, value) {
|
|
268675
|
+
if (value === undefined || value === null) {
|
|
268676
|
+
return;
|
|
268677
|
+
}
|
|
268678
|
+
if (isSensitiveName2(name2)) {
|
|
268679
|
+
return REDACTED2;
|
|
268680
|
+
}
|
|
268681
|
+
if (typeof value === "boolean" || typeof value === "number") {
|
|
268682
|
+
return value;
|
|
268683
|
+
}
|
|
268684
|
+
if (typeof value !== "string") {
|
|
268685
|
+
return "[OBJECT]";
|
|
268686
|
+
}
|
|
268687
|
+
return redactValueDetectors2(value);
|
|
268688
|
+
}
|
|
268689
|
+
function redactProperties2(properties) {
|
|
268690
|
+
const out = {};
|
|
268691
|
+
for (const [name2, value] of Object.entries(properties)) {
|
|
268692
|
+
const redacted = redactProperty2(name2, value);
|
|
268693
|
+
if (redacted !== undefined) {
|
|
268694
|
+
out[name2] = redacted;
|
|
268695
|
+
}
|
|
268696
|
+
}
|
|
268697
|
+
return out;
|
|
268698
|
+
}
|
|
268699
|
+
var TELEMETRY_OPERATION_ID_PROPERTY2 = "uip.trace.operation_id";
|
|
268700
|
+
var TELEMETRY_PARENT_ID_PROPERTY2 = "uip.trace.parent_id";
|
|
268701
|
+
var TELEMETRY_SPAN_ID_PROPERTY2 = "uip.trace.span_id";
|
|
268428
268702
|
|
|
268429
268703
|
class TelemetryService2 {
|
|
268430
268704
|
telemetryProvider;
|
|
@@ -268452,11 +268726,15 @@ class TelemetryService2 {
|
|
|
268452
268726
|
trackException(error95, properties) {
|
|
268453
268727
|
const context = this.getCurrentContext();
|
|
268454
268728
|
const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
|
|
268455
|
-
this.telemetryProvider.trackException(error95, enrichedProperties);
|
|
268729
|
+
this.telemetryProvider.trackException(redactError2(error95), enrichedProperties);
|
|
268456
268730
|
}
|
|
268457
268731
|
async trackRequest(name2, fn2, properties) {
|
|
268732
|
+
const parentContext = this.getCurrentContext();
|
|
268733
|
+
const operationId = parentContext?.operationId ?? this.operationId ?? getTelemetryOperationId2();
|
|
268734
|
+
const parentId = parentContext ? parentContext.id : this.inboundParentIdFor(operationId);
|
|
268458
268735
|
const context = {
|
|
268459
|
-
operationId
|
|
268736
|
+
operationId,
|
|
268737
|
+
...parentId !== undefined ? { parentId } : {},
|
|
268460
268738
|
id: this.generateId()
|
|
268461
268739
|
};
|
|
268462
268740
|
const startTime = performance.now();
|
|
@@ -268474,6 +268752,45 @@ class TelemetryService2 {
|
|
|
268474
268752
|
throw error95;
|
|
268475
268753
|
}
|
|
268476
268754
|
}
|
|
268755
|
+
trackRequestResult(name2, durationMs, success5, properties, context) {
|
|
268756
|
+
const requestContext = context ?? {
|
|
268757
|
+
operationId: this.operationId ?? getTelemetryOperationId2(),
|
|
268758
|
+
id: this.generateId()
|
|
268759
|
+
};
|
|
268760
|
+
const enrichedProperties = this.enrichPropertiesWithContext(properties, requestContext);
|
|
268761
|
+
this.telemetryProvider.trackRequest(name2, durationMs, success5, enrichedProperties);
|
|
268762
|
+
}
|
|
268763
|
+
createRequestContext() {
|
|
268764
|
+
const operationId = this.operationId ?? getTelemetryOperationId2();
|
|
268765
|
+
const parentId = this.inboundParentIdFor(operationId);
|
|
268766
|
+
return {
|
|
268767
|
+
operationId,
|
|
268768
|
+
...parentId !== undefined ? { parentId } : {},
|
|
268769
|
+
id: this.generateId()
|
|
268770
|
+
};
|
|
268771
|
+
}
|
|
268772
|
+
inboundParentIdFor(operationId) {
|
|
268773
|
+
const inbound = getInboundTraceContext2();
|
|
268774
|
+
return inbound && inbound.traceId === operationId ? inbound.parentSpanId : undefined;
|
|
268775
|
+
}
|
|
268776
|
+
runWithContext(context, fn2) {
|
|
268777
|
+
return this.contextStorage.run(context, fn2);
|
|
268778
|
+
}
|
|
268779
|
+
createDependencyContext() {
|
|
268780
|
+
const parentContext = this.getCurrentContext();
|
|
268781
|
+
if (!parentContext) {
|
|
268782
|
+
return;
|
|
268783
|
+
}
|
|
268784
|
+
return {
|
|
268785
|
+
operationId: parentContext.operationId,
|
|
268786
|
+
parentId: parentContext.id,
|
|
268787
|
+
id: this.generateId()
|
|
268788
|
+
};
|
|
268789
|
+
}
|
|
268790
|
+
trackDependencyResult(name2, type22, durationMs, success5, properties, context, resultCode) {
|
|
268791
|
+
const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
|
|
268792
|
+
this.telemetryProvider.trackDependency(redactValue2(name2), type22, durationMs, success5, enrichedProperties, resultCode);
|
|
268793
|
+
}
|
|
268477
268794
|
async trackDependencyOperation(name2, type22, fn2, properties) {
|
|
268478
268795
|
const parentContext = this.getCurrentContext();
|
|
268479
268796
|
if (!parentContext) {
|
|
@@ -268510,8 +268827,12 @@ class TelemetryService2 {
|
|
|
268510
268827
|
...getExecutionContextTelemetryProperties2(),
|
|
268511
268828
|
...globalProperties,
|
|
268512
268829
|
...this.defaultProperties,
|
|
268513
|
-
...properties,
|
|
268514
|
-
...context
|
|
268830
|
+
...redactProperties2(properties ?? {}),
|
|
268831
|
+
...context ? {
|
|
268832
|
+
[TELEMETRY_OPERATION_ID_PROPERTY2]: context.operationId,
|
|
268833
|
+
...context.parentId !== undefined ? { [TELEMETRY_PARENT_ID_PROPERTY2]: context.parentId } : {},
|
|
268834
|
+
[TELEMETRY_SPAN_ID_PROPERTY2]: context.id
|
|
268835
|
+
} : {}
|
|
268515
268836
|
};
|
|
268516
268837
|
if (sessionId === undefined) {
|
|
268517
268838
|
delete enriched[TELEMETRY_SESSION_ID_PROPERTY2];
|
|
@@ -268521,7 +268842,16 @@ class TelemetryService2 {
|
|
|
268521
268842
|
return enriched;
|
|
268522
268843
|
}
|
|
268523
268844
|
generateId() {
|
|
268524
|
-
|
|
268845
|
+
const bytes = new Uint8Array(8);
|
|
268846
|
+
let hex4 = "";
|
|
268847
|
+
do {
|
|
268848
|
+
crypto.getRandomValues(bytes);
|
|
268849
|
+
hex4 = "";
|
|
268850
|
+
for (const byte of bytes) {
|
|
268851
|
+
hex4 += byte.toString(16).padStart(2, "0");
|
|
268852
|
+
}
|
|
268853
|
+
} while (/^0+$/.test(hex4));
|
|
268854
|
+
return hex4;
|
|
268525
268855
|
}
|
|
268526
268856
|
}
|
|
268527
268857
|
var providerSlot2 = singleton3("TelemetryProvider");
|
|
@@ -269218,149 +269548,24 @@ function buildCommandTelemetryAttribution2(commandPath, skillSource) {
|
|
|
269218
269548
|
...getCommandProductModeAttribution2(commandPath)
|
|
269219
269549
|
};
|
|
269220
269550
|
}
|
|
269221
|
-
var REDACTED2 = "[REDACTED]";
|
|
269222
|
-
var MAX_VALUE_LENGTH2 = 200;
|
|
269223
|
-
var SENSITIVE_NAME_TOKENS2 = new Set([
|
|
269224
|
-
"token",
|
|
269225
|
-
"tokens",
|
|
269226
|
-
"secret",
|
|
269227
|
-
"secrets",
|
|
269228
|
-
"password",
|
|
269229
|
-
"passwords",
|
|
269230
|
-
"pwd",
|
|
269231
|
-
"credential",
|
|
269232
|
-
"credentials",
|
|
269233
|
-
"auth",
|
|
269234
|
-
"authentication",
|
|
269235
|
-
"authorization",
|
|
269236
|
-
"authority",
|
|
269237
|
-
"cert",
|
|
269238
|
-
"certificate",
|
|
269239
|
-
"certificates"
|
|
269240
|
-
]);
|
|
269241
|
-
var SENSITIVE_KEY_PREFIXES2 = new Set([
|
|
269242
|
-
"api",
|
|
269243
|
-
"access",
|
|
269244
|
-
"client",
|
|
269245
|
-
"private",
|
|
269246
|
-
"public",
|
|
269247
|
-
"signing",
|
|
269248
|
-
"encryption",
|
|
269249
|
-
"session",
|
|
269250
|
-
"master",
|
|
269251
|
-
"shared",
|
|
269252
|
-
"root",
|
|
269253
|
-
"ssh",
|
|
269254
|
-
"rsa",
|
|
269255
|
-
"aes",
|
|
269256
|
-
"hmac",
|
|
269257
|
-
"oauth"
|
|
269258
|
-
]);
|
|
269259
|
-
var UUID_PATTERN3 = /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi;
|
|
269260
|
-
var EMAIL_PATTERN2 = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
269261
|
-
var JWT_PATTERN2 = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
269262
|
-
var LONG_TOKEN_PATTERN2 = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
269263
|
-
var USER_HOME_PATTERN2 = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
269264
|
-
var URL_PATTERN2 = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
269265
|
-
var URL_TRAILING_PUNCT2 = /[.,;:!?)\]}>'"]+$/;
|
|
269266
|
-
function shortHash2(input2) {
|
|
269267
|
-
let hash3 = 2166136261;
|
|
269268
|
-
for (let i3 = 0;i3 < input2.length; i3++) {
|
|
269269
|
-
hash3 ^= input2.charCodeAt(i3);
|
|
269270
|
-
hash3 = Math.imul(hash3, 16777619);
|
|
269271
|
-
}
|
|
269272
|
-
return (hash3 >>> 0).toString(16).padStart(8, "0");
|
|
269273
|
-
}
|
|
269274
|
-
function redactUrl2(raw) {
|
|
269275
|
-
try {
|
|
269276
|
-
const url5 = new URL(raw);
|
|
269277
|
-
return `${url5.protocol}//${url5.host}`;
|
|
269278
|
-
} catch {
|
|
269279
|
-
return `url#${shortHash2(raw)}`;
|
|
269280
|
-
}
|
|
269281
|
-
}
|
|
269282
|
-
function redactValueDetectors2(value) {
|
|
269283
|
-
let out = value;
|
|
269284
|
-
out = out.replace(JWT_PATTERN2, () => REDACTED2);
|
|
269285
|
-
out = out.replace(URL_PATTERN2, (match) => {
|
|
269286
|
-
const trailing = match.match(URL_TRAILING_PUNCT2)?.[0] ?? "";
|
|
269287
|
-
const core22 = trailing ? match.slice(0, -trailing.length) : match;
|
|
269288
|
-
return `${redactUrl2(core22)}${trailing}`;
|
|
269289
|
-
});
|
|
269290
|
-
out = out.replace(USER_HOME_PATTERN2, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
269291
|
-
out = out.replace(EMAIL_PATTERN2, (match) => `email#${shortHash2(match)}`);
|
|
269292
|
-
out = out.replace(UUID_PATTERN3, (match) => `uuid#${shortHash2(match)}`);
|
|
269293
|
-
out = out.replace(LONG_TOKEN_PATTERN2, () => REDACTED2);
|
|
269294
|
-
if (out.length > MAX_VALUE_LENGTH2) {
|
|
269295
|
-
out = `${out.slice(0, MAX_VALUE_LENGTH2)}…`;
|
|
269296
|
-
}
|
|
269297
|
-
return out;
|
|
269298
|
-
}
|
|
269299
|
-
function nameTokens2(name2) {
|
|
269300
|
-
return name2.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").split(/[\s_-]+/).map((t13) => t13.toLowerCase()).filter(Boolean);
|
|
269301
|
-
}
|
|
269302
|
-
function isSensitiveName2(name2) {
|
|
269303
|
-
const tokens = nameTokens2(name2);
|
|
269304
|
-
for (let i3 = 0;i3 < tokens.length; i3++) {
|
|
269305
|
-
const token = tokens[i3];
|
|
269306
|
-
if (SENSITIVE_NAME_TOKENS2.has(token)) {
|
|
269307
|
-
return true;
|
|
269308
|
-
}
|
|
269309
|
-
if (token === "key" || token === "keys") {
|
|
269310
|
-
const prev = tokens[i3 - 1];
|
|
269311
|
-
if (prev && SENSITIVE_KEY_PREFIXES2.has(prev)) {
|
|
269312
|
-
return true;
|
|
269313
|
-
}
|
|
269314
|
-
}
|
|
269315
|
-
}
|
|
269316
|
-
return false;
|
|
269317
|
-
}
|
|
269318
|
-
function redactProperty2(name2, value) {
|
|
269319
|
-
if (value === undefined || value === null) {
|
|
269320
|
-
return;
|
|
269321
|
-
}
|
|
269322
|
-
if (isSensitiveName2(name2)) {
|
|
269323
|
-
return REDACTED2;
|
|
269324
|
-
}
|
|
269325
|
-
if (typeof value === "boolean" || typeof value === "number") {
|
|
269326
|
-
return value;
|
|
269327
|
-
}
|
|
269328
|
-
if (typeof value !== "string") {
|
|
269329
|
-
return "[OBJECT]";
|
|
269330
|
-
}
|
|
269331
|
-
return redactValueDetectors2(value);
|
|
269332
|
-
}
|
|
269333
|
-
function redactProperties2(properties) {
|
|
269334
|
-
const out = {};
|
|
269335
|
-
for (const [name2, value] of Object.entries(properties)) {
|
|
269336
|
-
const redacted = redactProperty2(name2, value);
|
|
269337
|
-
if (redacted !== undefined) {
|
|
269338
|
-
out[name2] = redacted;
|
|
269339
|
-
}
|
|
269340
|
-
}
|
|
269341
|
-
return out;
|
|
269342
|
-
}
|
|
269343
269551
|
var pollSignalSlot2 = singleton3("PollSignal");
|
|
269344
269552
|
var cliErrorCodeValues2 = new Set(CLI_ERROR_CODES2);
|
|
269345
269553
|
var retryHintValues2 = new Set(RETRY_HINTS2);
|
|
269554
|
+
var TELEMETRY_COMMAND_ARG_PREFIX2 = "uip.cmd.arg.";
|
|
269346
269555
|
function extractCommandParams2(cmd) {
|
|
269347
269556
|
const params = {};
|
|
269557
|
+
const add22 = (name2, value) => {
|
|
269558
|
+
if (name2 && value !== undefined) {
|
|
269559
|
+
params[`${TELEMETRY_COMMAND_ARG_PREFIX2}${name2}`] = value;
|
|
269560
|
+
}
|
|
269561
|
+
};
|
|
269348
269562
|
const registered = cmd.registeredArguments ?? [];
|
|
269349
269563
|
const processed = cmd.processedArgs ?? [];
|
|
269350
269564
|
for (let i3 = 0;i3 < registered.length; i3++) {
|
|
269351
|
-
|
|
269352
|
-
if (value === undefined) {
|
|
269353
|
-
continue;
|
|
269354
|
-
}
|
|
269355
|
-
const name2 = registered[i3].name();
|
|
269356
|
-
if (name2) {
|
|
269357
|
-
params[name2] = value;
|
|
269358
|
-
}
|
|
269565
|
+
add22(registered[i3].name(), processed[i3]);
|
|
269359
269566
|
}
|
|
269360
269567
|
for (const [key, value] of Object.entries(cmd.opts())) {
|
|
269361
|
-
|
|
269362
|
-
params[key] = value;
|
|
269363
|
-
}
|
|
269568
|
+
add22(key, value);
|
|
269364
269569
|
}
|
|
269365
269570
|
return params;
|
|
269366
269571
|
}
|
|
@@ -269403,11 +269608,12 @@ Command3.prototype.trackedAction = function(context, fn2, properties) {
|
|
|
269403
269608
|
return this.action(async (...args) => {
|
|
269404
269609
|
const telemetryName = deriveCommandPath2(command);
|
|
269405
269610
|
const props = typeof properties === "function" ? properties(...args) : properties;
|
|
269611
|
+
const requestContext = telemetry2.createRequestContext();
|
|
269406
269612
|
const startTime = performance.now();
|
|
269407
269613
|
let errorMessage;
|
|
269408
269614
|
let fallbackExitCode = EXIT_CODES2.Success;
|
|
269409
269615
|
clearRecordedCommandFailureTelemetry2();
|
|
269410
|
-
const [error95] = await catchError3(fn2(...args));
|
|
269616
|
+
const [error95] = await catchError3(telemetry2.runWithContext(requestContext, () => fn2(...args)));
|
|
269411
269617
|
if (error95) {
|
|
269412
269618
|
errorMessage = error95 instanceof Error ? error95.message : String(error95);
|
|
269413
269619
|
logger3.debug(`[trackedAction] ${telemetryName} failed: ${errorMessage}`);
|
|
@@ -269443,16 +269649,21 @@ Command3.prototype.trackedAction = function(context, fn2, properties) {
|
|
|
269443
269649
|
recordedFailure,
|
|
269444
269650
|
pollSignal: context.pollSignal
|
|
269445
269651
|
});
|
|
269446
|
-
|
|
269447
|
-
|
|
269652
|
+
const commandParams = extractCommandParams2(command);
|
|
269653
|
+
if (props) {
|
|
269654
|
+
for (const key of Object.keys(props)) {
|
|
269655
|
+
delete commandParams[`${TELEMETRY_COMMAND_ARG_PREFIX2}${key}`];
|
|
269656
|
+
}
|
|
269657
|
+
}
|
|
269658
|
+
const baseProperties = redactProperties2({
|
|
269659
|
+
...commandParams,
|
|
269448
269660
|
...props,
|
|
269449
269661
|
...buildCommandTelemetryAttribution2(telemetryName, process.env.UIPATH_SKILL),
|
|
269450
269662
|
command: "true",
|
|
269451
|
-
duration: String(durationMs),
|
|
269452
|
-
success: String(success5),
|
|
269453
269663
|
...terminalTelemetry,
|
|
269454
269664
|
...errorMessage ? { errorMessage } : {}
|
|
269455
|
-
})
|
|
269665
|
+
});
|
|
269666
|
+
telemetry2.trackRequestResult(telemetryName, durationMs, success5, baseProperties, requestContext);
|
|
269456
269667
|
});
|
|
269457
269668
|
};
|
|
269458
269669
|
var guardInstalledSlot2 = singleton3("ConsoleGuardInstalled");
|
|
@@ -269808,7 +270019,7 @@ function querystringSingleKey6(key, value, keyPrefix = "") {
|
|
|
269808
270019
|
var package_default5 = {
|
|
269809
270020
|
name: "@uipath/solution-sdk",
|
|
269810
270021
|
license: "MIT",
|
|
269811
|
-
version: "1.199.0-preview.
|
|
270022
|
+
version: "1.199.0-preview.99",
|
|
269812
270023
|
repository: {
|
|
269813
270024
|
type: "git",
|
|
269814
270025
|
url: "https://github.com/UiPath/cli.git",
|
|
@@ -287489,4 +287700,4 @@ export {
|
|
|
287489
287700
|
flowInitAsync
|
|
287490
287701
|
};
|
|
287491
287702
|
|
|
287492
|
-
//# debugId=
|
|
287703
|
+
//# debugId=3512FF4A7ABD111064756E2164756E21
|