@uipath/maestro-sdk 1.199.0-preview.91 → 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
|
@@ -72339,11 +72339,36 @@ class NodeContextStorage {
|
|
|
72339
72339
|
return this.storage.getStore();
|
|
72340
72340
|
}
|
|
72341
72341
|
}
|
|
72342
|
+
// ../common/src/telemetry/trace-context.ts
|
|
72343
|
+
var TELEMETRY_TRACEPARENT_ENV = "TRACEPARENT";
|
|
72344
|
+
var TRACEPARENT_PATTERN = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/;
|
|
72345
|
+
function getProcessEnv() {
|
|
72346
|
+
return globalThis.process?.env;
|
|
72347
|
+
}
|
|
72348
|
+
function parseInboundTraceparent(value) {
|
|
72349
|
+
if (!value) {
|
|
72350
|
+
return;
|
|
72351
|
+
}
|
|
72352
|
+
const match2 = TRACEPARENT_PATTERN.exec(value.trim().toLowerCase());
|
|
72353
|
+
if (!match2) {
|
|
72354
|
+
return;
|
|
72355
|
+
}
|
|
72356
|
+
const [, traceId, parentSpanId] = match2;
|
|
72357
|
+
if (/^0+$/.test(traceId) || /^0+$/.test(parentSpanId)) {
|
|
72358
|
+
return;
|
|
72359
|
+
}
|
|
72360
|
+
return { traceId, parentSpanId };
|
|
72361
|
+
}
|
|
72362
|
+
function getInboundTraceContext() {
|
|
72363
|
+
return parseInboundTraceparent(getProcessEnv()?.[TELEMETRY_TRACEPARENT_ENV]);
|
|
72364
|
+
}
|
|
72365
|
+
|
|
72342
72366
|
// ../common/src/telemetry/session-id.ts
|
|
72343
72367
|
var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
|
|
72344
72368
|
var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
|
|
72345
72369
|
var telemetrySessionIdSlot = singleton2("TelemetrySessionId");
|
|
72346
|
-
|
|
72370
|
+
var telemetryOperationIdSlot = singleton2("TelemetryOperationId");
|
|
72371
|
+
function getProcessEnv2() {
|
|
72347
72372
|
return globalThis.process?.env;
|
|
72348
72373
|
}
|
|
72349
72374
|
function normalizeSessionId(value) {
|
|
@@ -72354,18 +72379,165 @@ function normalizeSessionId(value) {
|
|
|
72354
72379
|
return trimmed || undefined;
|
|
72355
72380
|
}
|
|
72356
72381
|
function getConfiguredTelemetrySessionId() {
|
|
72357
|
-
return normalizeSessionId(
|
|
72382
|
+
return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
|
|
72358
72383
|
}
|
|
72359
72384
|
function resolveTelemetrySessionId(existingSessionId) {
|
|
72360
72385
|
return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
|
|
72361
72386
|
}
|
|
72387
|
+
function getTelemetryOperationId() {
|
|
72388
|
+
const existing = telemetryOperationIdSlot.get();
|
|
72389
|
+
if (existing) {
|
|
72390
|
+
return existing;
|
|
72391
|
+
}
|
|
72392
|
+
const inboundTraceId = getInboundTraceContext()?.traceId;
|
|
72393
|
+
const generated = inboundTraceId ?? crypto.randomUUID().replaceAll("-", "");
|
|
72394
|
+
telemetryOperationIdSlot.set(generated);
|
|
72395
|
+
return generated;
|
|
72396
|
+
}
|
|
72362
72397
|
// ../common/src/telemetry/global-telemetry-properties.ts
|
|
72363
72398
|
var telemetryPropsSlot = singleton2("TelemetryDefaultProps");
|
|
72364
72399
|
function getGlobalTelemetryProperties() {
|
|
72365
72400
|
return telemetryPropsSlot.get();
|
|
72366
72401
|
}
|
|
72367
72402
|
|
|
72403
|
+
// ../common/src/telemetry/pii-redactor.ts
|
|
72404
|
+
var REDACTED = "[REDACTED]";
|
|
72405
|
+
var MAX_VALUE_LENGTH = 200;
|
|
72406
|
+
var SENSITIVE_NAME_TOKENS = new Set([
|
|
72407
|
+
"token",
|
|
72408
|
+
"tokens",
|
|
72409
|
+
"secret",
|
|
72410
|
+
"secrets",
|
|
72411
|
+
"password",
|
|
72412
|
+
"passwords",
|
|
72413
|
+
"pwd",
|
|
72414
|
+
"credential",
|
|
72415
|
+
"credentials",
|
|
72416
|
+
"auth",
|
|
72417
|
+
"authentication",
|
|
72418
|
+
"authorization",
|
|
72419
|
+
"authority",
|
|
72420
|
+
"cert",
|
|
72421
|
+
"certificate",
|
|
72422
|
+
"certificates"
|
|
72423
|
+
]);
|
|
72424
|
+
var SENSITIVE_KEY_PREFIXES = new Set([
|
|
72425
|
+
"api",
|
|
72426
|
+
"access",
|
|
72427
|
+
"client",
|
|
72428
|
+
"private",
|
|
72429
|
+
"public",
|
|
72430
|
+
"signing",
|
|
72431
|
+
"encryption",
|
|
72432
|
+
"session",
|
|
72433
|
+
"master",
|
|
72434
|
+
"shared",
|
|
72435
|
+
"root",
|
|
72436
|
+
"ssh",
|
|
72437
|
+
"rsa",
|
|
72438
|
+
"aes",
|
|
72439
|
+
"hmac",
|
|
72440
|
+
"oauth"
|
|
72441
|
+
]);
|
|
72442
|
+
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;
|
|
72443
|
+
var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
72444
|
+
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
72445
|
+
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
72446
|
+
var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
72447
|
+
var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
72448
|
+
var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
|
|
72449
|
+
function shortHash(input) {
|
|
72450
|
+
let hash = 2166136261;
|
|
72451
|
+
for (let i = 0;i < input.length; i++) {
|
|
72452
|
+
hash ^= input.charCodeAt(i);
|
|
72453
|
+
hash = Math.imul(hash, 16777619);
|
|
72454
|
+
}
|
|
72455
|
+
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
72456
|
+
}
|
|
72457
|
+
function redactUrl(raw) {
|
|
72458
|
+
try {
|
|
72459
|
+
const url = new URL(raw);
|
|
72460
|
+
return `${url.protocol}//${url.host}`;
|
|
72461
|
+
} catch {
|
|
72462
|
+
return `url#${shortHash(raw)}`;
|
|
72463
|
+
}
|
|
72464
|
+
}
|
|
72465
|
+
function redactValueDetectors(value) {
|
|
72466
|
+
let out = value;
|
|
72467
|
+
out = out.replace(JWT_PATTERN, () => REDACTED);
|
|
72468
|
+
out = out.replace(URL_PATTERN, (match2) => {
|
|
72469
|
+
const trailing = match2.match(URL_TRAILING_PUNCT)?.[0] ?? "";
|
|
72470
|
+
const core2 = trailing ? match2.slice(0, -trailing.length) : match2;
|
|
72471
|
+
return `${redactUrl(core2)}${trailing}`;
|
|
72472
|
+
});
|
|
72473
|
+
out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
72474
|
+
out = out.replace(EMAIL_PATTERN, (match2) => `email#${shortHash(match2)}`);
|
|
72475
|
+
out = out.replace(UUID_PATTERN, (match2) => `uuid#${shortHash(match2)}`);
|
|
72476
|
+
out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
|
|
72477
|
+
if (out.length > MAX_VALUE_LENGTH) {
|
|
72478
|
+
out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
|
|
72479
|
+
}
|
|
72480
|
+
return out;
|
|
72481
|
+
}
|
|
72482
|
+
function redactValue(value) {
|
|
72483
|
+
return redactValueDetectors(value);
|
|
72484
|
+
}
|
|
72485
|
+
function redactError(error3) {
|
|
72486
|
+
const safe = new Error(redactValueDetectors(error3.message ?? ""));
|
|
72487
|
+
safe.name = error3.name;
|
|
72488
|
+
safe.stack = typeof error3.stack === "string" ? redactValueDetectors(error3.stack) : undefined;
|
|
72489
|
+
return safe;
|
|
72490
|
+
}
|
|
72491
|
+
function nameTokens(name2) {
|
|
72492
|
+
return name2.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);
|
|
72493
|
+
}
|
|
72494
|
+
function isSensitiveName(name2) {
|
|
72495
|
+
const tokens = nameTokens(name2);
|
|
72496
|
+
for (let i = 0;i < tokens.length; i++) {
|
|
72497
|
+
const token = tokens[i];
|
|
72498
|
+
if (SENSITIVE_NAME_TOKENS.has(token)) {
|
|
72499
|
+
return true;
|
|
72500
|
+
}
|
|
72501
|
+
if (token === "key" || token === "keys") {
|
|
72502
|
+
const prev = tokens[i - 1];
|
|
72503
|
+
if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
|
|
72504
|
+
return true;
|
|
72505
|
+
}
|
|
72506
|
+
}
|
|
72507
|
+
}
|
|
72508
|
+
return false;
|
|
72509
|
+
}
|
|
72510
|
+
function redactProperty(name2, value) {
|
|
72511
|
+
if (value === undefined || value === null) {
|
|
72512
|
+
return;
|
|
72513
|
+
}
|
|
72514
|
+
if (isSensitiveName(name2)) {
|
|
72515
|
+
return REDACTED;
|
|
72516
|
+
}
|
|
72517
|
+
if (typeof value === "boolean" || typeof value === "number") {
|
|
72518
|
+
return value;
|
|
72519
|
+
}
|
|
72520
|
+
if (typeof value !== "string") {
|
|
72521
|
+
return "[OBJECT]";
|
|
72522
|
+
}
|
|
72523
|
+
return redactValueDetectors(value);
|
|
72524
|
+
}
|
|
72525
|
+
function redactProperties(properties) {
|
|
72526
|
+
const out = {};
|
|
72527
|
+
for (const [name2, value] of Object.entries(properties)) {
|
|
72528
|
+
const redacted = redactProperty(name2, value);
|
|
72529
|
+
if (redacted !== undefined) {
|
|
72530
|
+
out[name2] = redacted;
|
|
72531
|
+
}
|
|
72532
|
+
}
|
|
72533
|
+
return out;
|
|
72534
|
+
}
|
|
72535
|
+
|
|
72368
72536
|
// ../common/src/telemetry/telemetry-service.ts
|
|
72537
|
+
var TELEMETRY_OPERATION_ID_PROPERTY = "uip.trace.operation_id";
|
|
72538
|
+
var TELEMETRY_PARENT_ID_PROPERTY = "uip.trace.parent_id";
|
|
72539
|
+
var TELEMETRY_SPAN_ID_PROPERTY = "uip.trace.span_id";
|
|
72540
|
+
|
|
72369
72541
|
class TelemetryService {
|
|
72370
72542
|
telemetryProvider;
|
|
72371
72543
|
contextStorage;
|
|
@@ -72392,11 +72564,15 @@ class TelemetryService {
|
|
|
72392
72564
|
trackException(error3, properties) {
|
|
72393
72565
|
const context = this.getCurrentContext();
|
|
72394
72566
|
const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
|
|
72395
|
-
this.telemetryProvider.trackException(error3, enrichedProperties);
|
|
72567
|
+
this.telemetryProvider.trackException(redactError(error3), enrichedProperties);
|
|
72396
72568
|
}
|
|
72397
72569
|
async trackRequest(name2, fn, properties) {
|
|
72570
|
+
const parentContext = this.getCurrentContext();
|
|
72571
|
+
const operationId = parentContext?.operationId ?? this.operationId ?? getTelemetryOperationId();
|
|
72572
|
+
const parentId = parentContext ? parentContext.id : this.inboundParentIdFor(operationId);
|
|
72398
72573
|
const context = {
|
|
72399
|
-
operationId
|
|
72574
|
+
operationId,
|
|
72575
|
+
...parentId !== undefined ? { parentId } : {},
|
|
72400
72576
|
id: this.generateId()
|
|
72401
72577
|
};
|
|
72402
72578
|
const startTime = performance.now();
|
|
@@ -72414,6 +72590,45 @@ class TelemetryService {
|
|
|
72414
72590
|
throw error3;
|
|
72415
72591
|
}
|
|
72416
72592
|
}
|
|
72593
|
+
trackRequestResult(name2, durationMs, success, properties, context) {
|
|
72594
|
+
const requestContext = context ?? {
|
|
72595
|
+
operationId: this.operationId ?? getTelemetryOperationId(),
|
|
72596
|
+
id: this.generateId()
|
|
72597
|
+
};
|
|
72598
|
+
const enrichedProperties = this.enrichPropertiesWithContext(properties, requestContext);
|
|
72599
|
+
this.telemetryProvider.trackRequest(name2, durationMs, success, enrichedProperties);
|
|
72600
|
+
}
|
|
72601
|
+
createRequestContext() {
|
|
72602
|
+
const operationId = this.operationId ?? getTelemetryOperationId();
|
|
72603
|
+
const parentId = this.inboundParentIdFor(operationId);
|
|
72604
|
+
return {
|
|
72605
|
+
operationId,
|
|
72606
|
+
...parentId !== undefined ? { parentId } : {},
|
|
72607
|
+
id: this.generateId()
|
|
72608
|
+
};
|
|
72609
|
+
}
|
|
72610
|
+
inboundParentIdFor(operationId) {
|
|
72611
|
+
const inbound = getInboundTraceContext();
|
|
72612
|
+
return inbound && inbound.traceId === operationId ? inbound.parentSpanId : undefined;
|
|
72613
|
+
}
|
|
72614
|
+
runWithContext(context, fn) {
|
|
72615
|
+
return this.contextStorage.run(context, fn);
|
|
72616
|
+
}
|
|
72617
|
+
createDependencyContext() {
|
|
72618
|
+
const parentContext = this.getCurrentContext();
|
|
72619
|
+
if (!parentContext) {
|
|
72620
|
+
return;
|
|
72621
|
+
}
|
|
72622
|
+
return {
|
|
72623
|
+
operationId: parentContext.operationId,
|
|
72624
|
+
parentId: parentContext.id,
|
|
72625
|
+
id: this.generateId()
|
|
72626
|
+
};
|
|
72627
|
+
}
|
|
72628
|
+
trackDependencyResult(name2, type2, durationMs, success, properties, context, resultCode) {
|
|
72629
|
+
const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
|
|
72630
|
+
this.telemetryProvider.trackDependency(redactValue(name2), type2, durationMs, success, enrichedProperties, resultCode);
|
|
72631
|
+
}
|
|
72417
72632
|
async trackDependencyOperation(name2, type2, fn, properties) {
|
|
72418
72633
|
const parentContext = this.getCurrentContext();
|
|
72419
72634
|
if (!parentContext) {
|
|
@@ -72450,8 +72665,12 @@ class TelemetryService {
|
|
|
72450
72665
|
...getExecutionContextTelemetryProperties(),
|
|
72451
72666
|
...globalProperties,
|
|
72452
72667
|
...this.defaultProperties,
|
|
72453
|
-
...properties,
|
|
72454
|
-
...context
|
|
72668
|
+
...redactProperties(properties ?? {}),
|
|
72669
|
+
...context ? {
|
|
72670
|
+
[TELEMETRY_OPERATION_ID_PROPERTY]: context.operationId,
|
|
72671
|
+
...context.parentId !== undefined ? { [TELEMETRY_PARENT_ID_PROPERTY]: context.parentId } : {},
|
|
72672
|
+
[TELEMETRY_SPAN_ID_PROPERTY]: context.id
|
|
72673
|
+
} : {}
|
|
72455
72674
|
};
|
|
72456
72675
|
if (sessionId === undefined) {
|
|
72457
72676
|
delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
|
|
@@ -72461,7 +72680,16 @@ class TelemetryService {
|
|
|
72461
72680
|
return enriched;
|
|
72462
72681
|
}
|
|
72463
72682
|
generateId() {
|
|
72464
|
-
|
|
72683
|
+
const bytes = new Uint8Array(8);
|
|
72684
|
+
let hex = "";
|
|
72685
|
+
do {
|
|
72686
|
+
crypto.getRandomValues(bytes);
|
|
72687
|
+
hex = "";
|
|
72688
|
+
for (const byte of bytes) {
|
|
72689
|
+
hex += byte.toString(16).padStart(2, "0");
|
|
72690
|
+
}
|
|
72691
|
+
} while (/^0+$/.test(hex));
|
|
72692
|
+
return hex;
|
|
72465
72693
|
}
|
|
72466
72694
|
}
|
|
72467
72695
|
// ../common/src/telemetry/node-appinsights-telemetry-provider.ts
|
|
@@ -73164,134 +73392,11 @@ function buildCommandTelemetryAttribution(commandPath, skillSource) {
|
|
|
73164
73392
|
};
|
|
73165
73393
|
}
|
|
73166
73394
|
|
|
73167
|
-
// ../common/src/telemetry/pii-redactor.ts
|
|
73168
|
-
var REDACTED = "[REDACTED]";
|
|
73169
|
-
var MAX_VALUE_LENGTH = 200;
|
|
73170
|
-
var SENSITIVE_NAME_TOKENS = new Set([
|
|
73171
|
-
"token",
|
|
73172
|
-
"tokens",
|
|
73173
|
-
"secret",
|
|
73174
|
-
"secrets",
|
|
73175
|
-
"password",
|
|
73176
|
-
"passwords",
|
|
73177
|
-
"pwd",
|
|
73178
|
-
"credential",
|
|
73179
|
-
"credentials",
|
|
73180
|
-
"auth",
|
|
73181
|
-
"authentication",
|
|
73182
|
-
"authorization",
|
|
73183
|
-
"authority",
|
|
73184
|
-
"cert",
|
|
73185
|
-
"certificate",
|
|
73186
|
-
"certificates"
|
|
73187
|
-
]);
|
|
73188
|
-
var SENSITIVE_KEY_PREFIXES = new Set([
|
|
73189
|
-
"api",
|
|
73190
|
-
"access",
|
|
73191
|
-
"client",
|
|
73192
|
-
"private",
|
|
73193
|
-
"public",
|
|
73194
|
-
"signing",
|
|
73195
|
-
"encryption",
|
|
73196
|
-
"session",
|
|
73197
|
-
"master",
|
|
73198
|
-
"shared",
|
|
73199
|
-
"root",
|
|
73200
|
-
"ssh",
|
|
73201
|
-
"rsa",
|
|
73202
|
-
"aes",
|
|
73203
|
-
"hmac",
|
|
73204
|
-
"oauth"
|
|
73205
|
-
]);
|
|
73206
|
-
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;
|
|
73207
|
-
var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
73208
|
-
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
73209
|
-
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
73210
|
-
var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
73211
|
-
var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
73212
|
-
var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
|
|
73213
|
-
function shortHash(input) {
|
|
73214
|
-
let hash = 2166136261;
|
|
73215
|
-
for (let i = 0;i < input.length; i++) {
|
|
73216
|
-
hash ^= input.charCodeAt(i);
|
|
73217
|
-
hash = Math.imul(hash, 16777619);
|
|
73218
|
-
}
|
|
73219
|
-
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
73220
|
-
}
|
|
73221
|
-
function redactUrl(raw) {
|
|
73222
|
-
try {
|
|
73223
|
-
const url = new URL(raw);
|
|
73224
|
-
return `${url.protocol}//${url.host}`;
|
|
73225
|
-
} catch {
|
|
73226
|
-
return `url#${shortHash(raw)}`;
|
|
73227
|
-
}
|
|
73228
|
-
}
|
|
73229
|
-
function redactValueDetectors(value) {
|
|
73230
|
-
let out = value;
|
|
73231
|
-
out = out.replace(JWT_PATTERN, () => REDACTED);
|
|
73232
|
-
out = out.replace(URL_PATTERN, (match2) => {
|
|
73233
|
-
const trailing = match2.match(URL_TRAILING_PUNCT)?.[0] ?? "";
|
|
73234
|
-
const core2 = trailing ? match2.slice(0, -trailing.length) : match2;
|
|
73235
|
-
return `${redactUrl(core2)}${trailing}`;
|
|
73236
|
-
});
|
|
73237
|
-
out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
73238
|
-
out = out.replace(EMAIL_PATTERN, (match2) => `email#${shortHash(match2)}`);
|
|
73239
|
-
out = out.replace(UUID_PATTERN, (match2) => `uuid#${shortHash(match2)}`);
|
|
73240
|
-
out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
|
|
73241
|
-
if (out.length > MAX_VALUE_LENGTH) {
|
|
73242
|
-
out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
|
|
73243
|
-
}
|
|
73244
|
-
return out;
|
|
73245
|
-
}
|
|
73246
|
-
function nameTokens(name2) {
|
|
73247
|
-
return name2.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);
|
|
73248
|
-
}
|
|
73249
|
-
function isSensitiveName(name2) {
|
|
73250
|
-
const tokens = nameTokens(name2);
|
|
73251
|
-
for (let i = 0;i < tokens.length; i++) {
|
|
73252
|
-
const token = tokens[i];
|
|
73253
|
-
if (SENSITIVE_NAME_TOKENS.has(token)) {
|
|
73254
|
-
return true;
|
|
73255
|
-
}
|
|
73256
|
-
if (token === "key" || token === "keys") {
|
|
73257
|
-
const prev = tokens[i - 1];
|
|
73258
|
-
if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
|
|
73259
|
-
return true;
|
|
73260
|
-
}
|
|
73261
|
-
}
|
|
73262
|
-
}
|
|
73263
|
-
return false;
|
|
73264
|
-
}
|
|
73265
|
-
function redactProperty(name2, value) {
|
|
73266
|
-
if (value === undefined || value === null) {
|
|
73267
|
-
return;
|
|
73268
|
-
}
|
|
73269
|
-
if (isSensitiveName(name2)) {
|
|
73270
|
-
return REDACTED;
|
|
73271
|
-
}
|
|
73272
|
-
if (typeof value === "boolean" || typeof value === "number") {
|
|
73273
|
-
return value;
|
|
73274
|
-
}
|
|
73275
|
-
if (typeof value !== "string") {
|
|
73276
|
-
return "[OBJECT]";
|
|
73277
|
-
}
|
|
73278
|
-
return redactValueDetectors(value);
|
|
73279
|
-
}
|
|
73280
|
-
function redactProperties(properties) {
|
|
73281
|
-
const out = {};
|
|
73282
|
-
for (const [name2, value] of Object.entries(properties)) {
|
|
73283
|
-
const redacted = redactProperty(name2, value);
|
|
73284
|
-
if (redacted !== undefined) {
|
|
73285
|
-
out[name2] = redacted;
|
|
73286
|
-
}
|
|
73287
|
-
}
|
|
73288
|
-
return out;
|
|
73289
|
-
}
|
|
73290
|
-
|
|
73291
73395
|
// ../common/src/trackedAction.ts
|
|
73292
73396
|
var pollSignalSlot = singleton2("PollSignal");
|
|
73293
73397
|
var cliErrorCodeValues = new Set(CLI_ERROR_CODES);
|
|
73294
73398
|
var retryHintValues = new Set(RETRY_HINTS);
|
|
73399
|
+
var TELEMETRY_COMMAND_ARG_PREFIX = "uip.cmd.arg.";
|
|
73295
73400
|
var processContext = {
|
|
73296
73401
|
exit: (code) => {
|
|
73297
73402
|
process.exitCode = code;
|
|
@@ -73302,22 +73407,18 @@ var processContext = {
|
|
|
73302
73407
|
};
|
|
73303
73408
|
function extractCommandParams(cmd) {
|
|
73304
73409
|
const params = {};
|
|
73410
|
+
const add2 = (name2, value) => {
|
|
73411
|
+
if (name2 && value !== undefined) {
|
|
73412
|
+
params[`${TELEMETRY_COMMAND_ARG_PREFIX}${name2}`] = value;
|
|
73413
|
+
}
|
|
73414
|
+
};
|
|
73305
73415
|
const registered = cmd.registeredArguments ?? [];
|
|
73306
73416
|
const processed = cmd.processedArgs ?? [];
|
|
73307
73417
|
for (let i = 0;i < registered.length; i++) {
|
|
73308
|
-
|
|
73309
|
-
if (value === undefined) {
|
|
73310
|
-
continue;
|
|
73311
|
-
}
|
|
73312
|
-
const name2 = registered[i].name();
|
|
73313
|
-
if (name2) {
|
|
73314
|
-
params[name2] = value;
|
|
73315
|
-
}
|
|
73418
|
+
add2(registered[i].name(), processed[i]);
|
|
73316
73419
|
}
|
|
73317
73420
|
for (const [key, value] of Object.entries(cmd.opts())) {
|
|
73318
|
-
|
|
73319
|
-
params[key] = value;
|
|
73320
|
-
}
|
|
73421
|
+
add2(key, value);
|
|
73321
73422
|
}
|
|
73322
73423
|
return params;
|
|
73323
73424
|
}
|
|
@@ -73360,11 +73461,12 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
73360
73461
|
return this.action(async (...args) => {
|
|
73361
73462
|
const telemetryName = deriveCommandPath(command);
|
|
73362
73463
|
const props = typeof properties === "function" ? properties(...args) : properties;
|
|
73464
|
+
const requestContext = telemetry.createRequestContext();
|
|
73363
73465
|
const startTime = performance.now();
|
|
73364
73466
|
let errorMessage;
|
|
73365
73467
|
let fallbackExitCode = EXIT_CODES.Success;
|
|
73366
73468
|
clearRecordedCommandFailureTelemetry();
|
|
73367
|
-
const [error3] = await catchError(fn(...args));
|
|
73469
|
+
const [error3] = await catchError(telemetry.runWithContext(requestContext, () => fn(...args)));
|
|
73368
73470
|
if (error3) {
|
|
73369
73471
|
errorMessage = error3 instanceof Error ? error3.message : String(error3);
|
|
73370
73472
|
logger.debug(`[trackedAction] ${telemetryName} failed: ${errorMessage}`);
|
|
@@ -73400,16 +73502,21 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
73400
73502
|
recordedFailure,
|
|
73401
73503
|
pollSignal: context.pollSignal
|
|
73402
73504
|
});
|
|
73403
|
-
|
|
73404
|
-
|
|
73505
|
+
const commandParams = extractCommandParams(command);
|
|
73506
|
+
if (props) {
|
|
73507
|
+
for (const key of Object.keys(props)) {
|
|
73508
|
+
delete commandParams[`${TELEMETRY_COMMAND_ARG_PREFIX}${key}`];
|
|
73509
|
+
}
|
|
73510
|
+
}
|
|
73511
|
+
const baseProperties = redactProperties({
|
|
73512
|
+
...commandParams,
|
|
73405
73513
|
...props,
|
|
73406
73514
|
...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
|
|
73407
73515
|
command: "true",
|
|
73408
|
-
duration: String(durationMs),
|
|
73409
|
-
success: String(success),
|
|
73410
73516
|
...terminalTelemetry,
|
|
73411
73517
|
...errorMessage ? { errorMessage } : {}
|
|
73412
|
-
})
|
|
73518
|
+
});
|
|
73519
|
+
telemetry.trackRequestResult(telemetryName, durationMs, success, baseProperties, requestContext);
|
|
73413
73520
|
});
|
|
73414
73521
|
};
|
|
73415
73522
|
// ../common/src/console-guard.ts
|
|
@@ -146070,7 +146177,7 @@ class TextApiResponse {
|
|
|
146070
146177
|
var package_default = {
|
|
146071
146178
|
name: "@uipath/integrationservice-sdk",
|
|
146072
146179
|
license: "MIT",
|
|
146073
|
-
version: "1.199.0-preview.
|
|
146180
|
+
version: "1.199.0-preview.97",
|
|
146074
146181
|
repository: {
|
|
146075
146182
|
type: "git",
|
|
146076
146183
|
url: "https://github.com/UiPath/cli.git",
|
|
@@ -157937,4 +158044,4 @@ export {
|
|
|
157937
158044
|
BPMN_PARSE_ERROR
|
|
157938
158045
|
};
|
|
157939
158046
|
|
|
157940
|
-
//# debugId=
|
|
158047
|
+
//# debugId=17A5C4191FEA12D864756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/maestro-sdk",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "1.199.0-preview.
|
|
4
|
+
"version": "1.199.0-preview.97",
|
|
5
5
|
"description": "SDK for the UiPath Maestro (PIMS) API — process instance management.",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"files": [
|
|
43
43
|
"dist"
|
|
44
44
|
],
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "087ae21e842f27bde5eb0013892c9487bfe60568"
|
|
46
46
|
}
|