@uipath/platform-tool 1.198.0-preview.95 → 1.198.0-preview.96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tool.js +257 -150
- package/package.json +2 -2
package/dist/tool.js
CHANGED
|
@@ -44724,7 +44724,7 @@ var require_dist3 = __commonJS((exports) => {
|
|
|
44724
44724
|
var package_default = {
|
|
44725
44725
|
name: "@uipath/platform-tool",
|
|
44726
44726
|
license: "MIT",
|
|
44727
|
-
version: "1.198.0-preview.
|
|
44727
|
+
version: "1.198.0-preview.96",
|
|
44728
44728
|
description: "Manage UiPath platform-level resources such as tenant licensing.",
|
|
44729
44729
|
type: "module",
|
|
44730
44730
|
main: "./dist/tool.js",
|
|
@@ -52137,11 +52137,36 @@ class NodeContextStorage {
|
|
|
52137
52137
|
return this.storage.getStore();
|
|
52138
52138
|
}
|
|
52139
52139
|
}
|
|
52140
|
+
// ../common/src/telemetry/trace-context.ts
|
|
52141
|
+
var TELEMETRY_TRACEPARENT_ENV = "TRACEPARENT";
|
|
52142
|
+
var TRACEPARENT_PATTERN = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/;
|
|
52143
|
+
function getProcessEnv() {
|
|
52144
|
+
return globalThis.process?.env;
|
|
52145
|
+
}
|
|
52146
|
+
function parseInboundTraceparent(value) {
|
|
52147
|
+
if (!value) {
|
|
52148
|
+
return;
|
|
52149
|
+
}
|
|
52150
|
+
const match = TRACEPARENT_PATTERN.exec(value.trim().toLowerCase());
|
|
52151
|
+
if (!match) {
|
|
52152
|
+
return;
|
|
52153
|
+
}
|
|
52154
|
+
const [, traceId, parentSpanId] = match;
|
|
52155
|
+
if (/^0+$/.test(traceId) || /^0+$/.test(parentSpanId)) {
|
|
52156
|
+
return;
|
|
52157
|
+
}
|
|
52158
|
+
return { traceId, parentSpanId };
|
|
52159
|
+
}
|
|
52160
|
+
function getInboundTraceContext() {
|
|
52161
|
+
return parseInboundTraceparent(getProcessEnv()?.[TELEMETRY_TRACEPARENT_ENV]);
|
|
52162
|
+
}
|
|
52163
|
+
|
|
52140
52164
|
// ../common/src/telemetry/session-id.ts
|
|
52141
52165
|
var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
|
|
52142
52166
|
var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
|
|
52143
52167
|
var telemetrySessionIdSlot = singleton("TelemetrySessionId");
|
|
52144
|
-
|
|
52168
|
+
var telemetryOperationIdSlot = singleton("TelemetryOperationId");
|
|
52169
|
+
function getProcessEnv2() {
|
|
52145
52170
|
return globalThis.process?.env;
|
|
52146
52171
|
}
|
|
52147
52172
|
function normalizeSessionId(value) {
|
|
@@ -52152,18 +52177,165 @@ function normalizeSessionId(value) {
|
|
|
52152
52177
|
return trimmed || undefined;
|
|
52153
52178
|
}
|
|
52154
52179
|
function getConfiguredTelemetrySessionId() {
|
|
52155
|
-
return normalizeSessionId(
|
|
52180
|
+
return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
|
|
52156
52181
|
}
|
|
52157
52182
|
function resolveTelemetrySessionId(existingSessionId) {
|
|
52158
52183
|
return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
|
|
52159
52184
|
}
|
|
52185
|
+
function getTelemetryOperationId() {
|
|
52186
|
+
const existing = telemetryOperationIdSlot.get();
|
|
52187
|
+
if (existing) {
|
|
52188
|
+
return existing;
|
|
52189
|
+
}
|
|
52190
|
+
const inboundTraceId = getInboundTraceContext()?.traceId;
|
|
52191
|
+
const generated = inboundTraceId ?? crypto.randomUUID().replaceAll("-", "");
|
|
52192
|
+
telemetryOperationIdSlot.set(generated);
|
|
52193
|
+
return generated;
|
|
52194
|
+
}
|
|
52160
52195
|
// ../common/src/telemetry/global-telemetry-properties.ts
|
|
52161
52196
|
var telemetryPropsSlot = singleton("TelemetryDefaultProps");
|
|
52162
52197
|
function getGlobalTelemetryProperties() {
|
|
52163
52198
|
return telemetryPropsSlot.get();
|
|
52164
52199
|
}
|
|
52165
52200
|
|
|
52201
|
+
// ../common/src/telemetry/pii-redactor.ts
|
|
52202
|
+
var REDACTED = "[REDACTED]";
|
|
52203
|
+
var MAX_VALUE_LENGTH = 200;
|
|
52204
|
+
var SENSITIVE_NAME_TOKENS = new Set([
|
|
52205
|
+
"token",
|
|
52206
|
+
"tokens",
|
|
52207
|
+
"secret",
|
|
52208
|
+
"secrets",
|
|
52209
|
+
"password",
|
|
52210
|
+
"passwords",
|
|
52211
|
+
"pwd",
|
|
52212
|
+
"credential",
|
|
52213
|
+
"credentials",
|
|
52214
|
+
"auth",
|
|
52215
|
+
"authentication",
|
|
52216
|
+
"authorization",
|
|
52217
|
+
"authority",
|
|
52218
|
+
"cert",
|
|
52219
|
+
"certificate",
|
|
52220
|
+
"certificates"
|
|
52221
|
+
]);
|
|
52222
|
+
var SENSITIVE_KEY_PREFIXES = new Set([
|
|
52223
|
+
"api",
|
|
52224
|
+
"access",
|
|
52225
|
+
"client",
|
|
52226
|
+
"private",
|
|
52227
|
+
"public",
|
|
52228
|
+
"signing",
|
|
52229
|
+
"encryption",
|
|
52230
|
+
"session",
|
|
52231
|
+
"master",
|
|
52232
|
+
"shared",
|
|
52233
|
+
"root",
|
|
52234
|
+
"ssh",
|
|
52235
|
+
"rsa",
|
|
52236
|
+
"aes",
|
|
52237
|
+
"hmac",
|
|
52238
|
+
"oauth"
|
|
52239
|
+
]);
|
|
52240
|
+
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;
|
|
52241
|
+
var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
52242
|
+
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
52243
|
+
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
52244
|
+
var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
52245
|
+
var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
52246
|
+
var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
|
|
52247
|
+
function shortHash(input) {
|
|
52248
|
+
let hash = 2166136261;
|
|
52249
|
+
for (let i = 0;i < input.length; i++) {
|
|
52250
|
+
hash ^= input.charCodeAt(i);
|
|
52251
|
+
hash = Math.imul(hash, 16777619);
|
|
52252
|
+
}
|
|
52253
|
+
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
52254
|
+
}
|
|
52255
|
+
function redactUrl(raw) {
|
|
52256
|
+
try {
|
|
52257
|
+
const url = new URL(raw);
|
|
52258
|
+
return `${url.protocol}//${url.host}`;
|
|
52259
|
+
} catch {
|
|
52260
|
+
return `url#${shortHash(raw)}`;
|
|
52261
|
+
}
|
|
52262
|
+
}
|
|
52263
|
+
function redactValueDetectors(value) {
|
|
52264
|
+
let out = value;
|
|
52265
|
+
out = out.replace(JWT_PATTERN, () => REDACTED);
|
|
52266
|
+
out = out.replace(URL_PATTERN, (match) => {
|
|
52267
|
+
const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
|
|
52268
|
+
const core2 = trailing ? match.slice(0, -trailing.length) : match;
|
|
52269
|
+
return `${redactUrl(core2)}${trailing}`;
|
|
52270
|
+
});
|
|
52271
|
+
out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
52272
|
+
out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
|
|
52273
|
+
out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
|
|
52274
|
+
out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
|
|
52275
|
+
if (out.length > MAX_VALUE_LENGTH) {
|
|
52276
|
+
out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
|
|
52277
|
+
}
|
|
52278
|
+
return out;
|
|
52279
|
+
}
|
|
52280
|
+
function redactValue(value) {
|
|
52281
|
+
return redactValueDetectors(value);
|
|
52282
|
+
}
|
|
52283
|
+
function redactError(error) {
|
|
52284
|
+
const safe = new Error(redactValueDetectors(error.message ?? ""));
|
|
52285
|
+
safe.name = error.name;
|
|
52286
|
+
safe.stack = typeof error.stack === "string" ? redactValueDetectors(error.stack) : undefined;
|
|
52287
|
+
return safe;
|
|
52288
|
+
}
|
|
52289
|
+
function nameTokens(name) {
|
|
52290
|
+
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);
|
|
52291
|
+
}
|
|
52292
|
+
function isSensitiveName(name) {
|
|
52293
|
+
const tokens = nameTokens(name);
|
|
52294
|
+
for (let i = 0;i < tokens.length; i++) {
|
|
52295
|
+
const token = tokens[i];
|
|
52296
|
+
if (SENSITIVE_NAME_TOKENS.has(token)) {
|
|
52297
|
+
return true;
|
|
52298
|
+
}
|
|
52299
|
+
if (token === "key" || token === "keys") {
|
|
52300
|
+
const prev = tokens[i - 1];
|
|
52301
|
+
if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
|
|
52302
|
+
return true;
|
|
52303
|
+
}
|
|
52304
|
+
}
|
|
52305
|
+
}
|
|
52306
|
+
return false;
|
|
52307
|
+
}
|
|
52308
|
+
function redactProperty(name, value) {
|
|
52309
|
+
if (value === undefined || value === null) {
|
|
52310
|
+
return;
|
|
52311
|
+
}
|
|
52312
|
+
if (isSensitiveName(name)) {
|
|
52313
|
+
return REDACTED;
|
|
52314
|
+
}
|
|
52315
|
+
if (typeof value === "boolean" || typeof value === "number") {
|
|
52316
|
+
return value;
|
|
52317
|
+
}
|
|
52318
|
+
if (typeof value !== "string") {
|
|
52319
|
+
return "[OBJECT]";
|
|
52320
|
+
}
|
|
52321
|
+
return redactValueDetectors(value);
|
|
52322
|
+
}
|
|
52323
|
+
function redactProperties(properties) {
|
|
52324
|
+
const out = {};
|
|
52325
|
+
for (const [name, value] of Object.entries(properties)) {
|
|
52326
|
+
const redacted = redactProperty(name, value);
|
|
52327
|
+
if (redacted !== undefined) {
|
|
52328
|
+
out[name] = redacted;
|
|
52329
|
+
}
|
|
52330
|
+
}
|
|
52331
|
+
return out;
|
|
52332
|
+
}
|
|
52333
|
+
|
|
52166
52334
|
// ../common/src/telemetry/telemetry-service.ts
|
|
52335
|
+
var TELEMETRY_OPERATION_ID_PROPERTY = "uip.trace.operation_id";
|
|
52336
|
+
var TELEMETRY_PARENT_ID_PROPERTY = "uip.trace.parent_id";
|
|
52337
|
+
var TELEMETRY_SPAN_ID_PROPERTY = "uip.trace.span_id";
|
|
52338
|
+
|
|
52167
52339
|
class TelemetryService {
|
|
52168
52340
|
telemetryProvider;
|
|
52169
52341
|
contextStorage;
|
|
@@ -52190,11 +52362,15 @@ class TelemetryService {
|
|
|
52190
52362
|
trackException(error, properties) {
|
|
52191
52363
|
const context = this.getCurrentContext();
|
|
52192
52364
|
const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
|
|
52193
|
-
this.telemetryProvider.trackException(error, enrichedProperties);
|
|
52365
|
+
this.telemetryProvider.trackException(redactError(error), enrichedProperties);
|
|
52194
52366
|
}
|
|
52195
52367
|
async trackRequest(name, fn, properties) {
|
|
52368
|
+
const parentContext = this.getCurrentContext();
|
|
52369
|
+
const operationId = parentContext?.operationId ?? this.operationId ?? getTelemetryOperationId();
|
|
52370
|
+
const parentId = parentContext ? parentContext.id : this.inboundParentIdFor(operationId);
|
|
52196
52371
|
const context = {
|
|
52197
|
-
operationId
|
|
52372
|
+
operationId,
|
|
52373
|
+
...parentId !== undefined ? { parentId } : {},
|
|
52198
52374
|
id: this.generateId()
|
|
52199
52375
|
};
|
|
52200
52376
|
const startTime = performance.now();
|
|
@@ -52212,6 +52388,45 @@ class TelemetryService {
|
|
|
52212
52388
|
throw error;
|
|
52213
52389
|
}
|
|
52214
52390
|
}
|
|
52391
|
+
trackRequestResult(name, durationMs, success, properties, context) {
|
|
52392
|
+
const requestContext = context ?? {
|
|
52393
|
+
operationId: this.operationId ?? getTelemetryOperationId(),
|
|
52394
|
+
id: this.generateId()
|
|
52395
|
+
};
|
|
52396
|
+
const enrichedProperties = this.enrichPropertiesWithContext(properties, requestContext);
|
|
52397
|
+
this.telemetryProvider.trackRequest(name, durationMs, success, enrichedProperties);
|
|
52398
|
+
}
|
|
52399
|
+
createRequestContext() {
|
|
52400
|
+
const operationId = this.operationId ?? getTelemetryOperationId();
|
|
52401
|
+
const parentId = this.inboundParentIdFor(operationId);
|
|
52402
|
+
return {
|
|
52403
|
+
operationId,
|
|
52404
|
+
...parentId !== undefined ? { parentId } : {},
|
|
52405
|
+
id: this.generateId()
|
|
52406
|
+
};
|
|
52407
|
+
}
|
|
52408
|
+
inboundParentIdFor(operationId) {
|
|
52409
|
+
const inbound = getInboundTraceContext();
|
|
52410
|
+
return inbound && inbound.traceId === operationId ? inbound.parentSpanId : undefined;
|
|
52411
|
+
}
|
|
52412
|
+
runWithContext(context, fn) {
|
|
52413
|
+
return this.contextStorage.run(context, fn);
|
|
52414
|
+
}
|
|
52415
|
+
createDependencyContext() {
|
|
52416
|
+
const parentContext = this.getCurrentContext();
|
|
52417
|
+
if (!parentContext) {
|
|
52418
|
+
return;
|
|
52419
|
+
}
|
|
52420
|
+
return {
|
|
52421
|
+
operationId: parentContext.operationId,
|
|
52422
|
+
parentId: parentContext.id,
|
|
52423
|
+
id: this.generateId()
|
|
52424
|
+
};
|
|
52425
|
+
}
|
|
52426
|
+
trackDependencyResult(name, type2, durationMs, success, properties, context, resultCode) {
|
|
52427
|
+
const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
|
|
52428
|
+
this.telemetryProvider.trackDependency(redactValue(name), type2, durationMs, success, enrichedProperties, resultCode);
|
|
52429
|
+
}
|
|
52215
52430
|
async trackDependencyOperation(name, type2, fn, properties) {
|
|
52216
52431
|
const parentContext = this.getCurrentContext();
|
|
52217
52432
|
if (!parentContext) {
|
|
@@ -52248,8 +52463,12 @@ class TelemetryService {
|
|
|
52248
52463
|
...getExecutionContextTelemetryProperties(),
|
|
52249
52464
|
...globalProperties,
|
|
52250
52465
|
...this.defaultProperties,
|
|
52251
|
-
...properties,
|
|
52252
|
-
...context
|
|
52466
|
+
...redactProperties(properties ?? {}),
|
|
52467
|
+
...context ? {
|
|
52468
|
+
[TELEMETRY_OPERATION_ID_PROPERTY]: context.operationId,
|
|
52469
|
+
...context.parentId !== undefined ? { [TELEMETRY_PARENT_ID_PROPERTY]: context.parentId } : {},
|
|
52470
|
+
[TELEMETRY_SPAN_ID_PROPERTY]: context.id
|
|
52471
|
+
} : {}
|
|
52253
52472
|
};
|
|
52254
52473
|
if (sessionId === undefined) {
|
|
52255
52474
|
delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
|
|
@@ -52259,7 +52478,16 @@ class TelemetryService {
|
|
|
52259
52478
|
return enriched;
|
|
52260
52479
|
}
|
|
52261
52480
|
generateId() {
|
|
52262
|
-
|
|
52481
|
+
const bytes = new Uint8Array(8);
|
|
52482
|
+
let hex = "";
|
|
52483
|
+
do {
|
|
52484
|
+
crypto.getRandomValues(bytes);
|
|
52485
|
+
hex = "";
|
|
52486
|
+
for (const byte of bytes) {
|
|
52487
|
+
hex += byte.toString(16).padStart(2, "0");
|
|
52488
|
+
}
|
|
52489
|
+
} while (/^0+$/.test(hex));
|
|
52490
|
+
return hex;
|
|
52263
52491
|
}
|
|
52264
52492
|
}
|
|
52265
52493
|
// ../common/src/telemetry/node-appinsights-telemetry-provider.ts
|
|
@@ -52982,134 +53210,11 @@ function buildCommandTelemetryAttribution(commandPath, skillSource) {
|
|
|
52982
53210
|
};
|
|
52983
53211
|
}
|
|
52984
53212
|
|
|
52985
|
-
// ../common/src/telemetry/pii-redactor.ts
|
|
52986
|
-
var REDACTED = "[REDACTED]";
|
|
52987
|
-
var MAX_VALUE_LENGTH = 200;
|
|
52988
|
-
var SENSITIVE_NAME_TOKENS = new Set([
|
|
52989
|
-
"token",
|
|
52990
|
-
"tokens",
|
|
52991
|
-
"secret",
|
|
52992
|
-
"secrets",
|
|
52993
|
-
"password",
|
|
52994
|
-
"passwords",
|
|
52995
|
-
"pwd",
|
|
52996
|
-
"credential",
|
|
52997
|
-
"credentials",
|
|
52998
|
-
"auth",
|
|
52999
|
-
"authentication",
|
|
53000
|
-
"authorization",
|
|
53001
|
-
"authority",
|
|
53002
|
-
"cert",
|
|
53003
|
-
"certificate",
|
|
53004
|
-
"certificates"
|
|
53005
|
-
]);
|
|
53006
|
-
var SENSITIVE_KEY_PREFIXES = new Set([
|
|
53007
|
-
"api",
|
|
53008
|
-
"access",
|
|
53009
|
-
"client",
|
|
53010
|
-
"private",
|
|
53011
|
-
"public",
|
|
53012
|
-
"signing",
|
|
53013
|
-
"encryption",
|
|
53014
|
-
"session",
|
|
53015
|
-
"master",
|
|
53016
|
-
"shared",
|
|
53017
|
-
"root",
|
|
53018
|
-
"ssh",
|
|
53019
|
-
"rsa",
|
|
53020
|
-
"aes",
|
|
53021
|
-
"hmac",
|
|
53022
|
-
"oauth"
|
|
53023
|
-
]);
|
|
53024
|
-
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;
|
|
53025
|
-
var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
53026
|
-
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
53027
|
-
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
53028
|
-
var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
53029
|
-
var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
53030
|
-
var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
|
|
53031
|
-
function shortHash(input) {
|
|
53032
|
-
let hash = 2166136261;
|
|
53033
|
-
for (let i = 0;i < input.length; i++) {
|
|
53034
|
-
hash ^= input.charCodeAt(i);
|
|
53035
|
-
hash = Math.imul(hash, 16777619);
|
|
53036
|
-
}
|
|
53037
|
-
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
53038
|
-
}
|
|
53039
|
-
function redactUrl(raw) {
|
|
53040
|
-
try {
|
|
53041
|
-
const url = new URL(raw);
|
|
53042
|
-
return `${url.protocol}//${url.host}`;
|
|
53043
|
-
} catch {
|
|
53044
|
-
return `url#${shortHash(raw)}`;
|
|
53045
|
-
}
|
|
53046
|
-
}
|
|
53047
|
-
function redactValueDetectors(value) {
|
|
53048
|
-
let out = value;
|
|
53049
|
-
out = out.replace(JWT_PATTERN, () => REDACTED);
|
|
53050
|
-
out = out.replace(URL_PATTERN, (match) => {
|
|
53051
|
-
const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
|
|
53052
|
-
const core2 = trailing ? match.slice(0, -trailing.length) : match;
|
|
53053
|
-
return `${redactUrl(core2)}${trailing}`;
|
|
53054
|
-
});
|
|
53055
|
-
out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
53056
|
-
out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
|
|
53057
|
-
out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
|
|
53058
|
-
out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
|
|
53059
|
-
if (out.length > MAX_VALUE_LENGTH) {
|
|
53060
|
-
out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
|
|
53061
|
-
}
|
|
53062
|
-
return out;
|
|
53063
|
-
}
|
|
53064
|
-
function nameTokens(name) {
|
|
53065
|
-
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);
|
|
53066
|
-
}
|
|
53067
|
-
function isSensitiveName(name) {
|
|
53068
|
-
const tokens = nameTokens(name);
|
|
53069
|
-
for (let i = 0;i < tokens.length; i++) {
|
|
53070
|
-
const token = tokens[i];
|
|
53071
|
-
if (SENSITIVE_NAME_TOKENS.has(token)) {
|
|
53072
|
-
return true;
|
|
53073
|
-
}
|
|
53074
|
-
if (token === "key" || token === "keys") {
|
|
53075
|
-
const prev = tokens[i - 1];
|
|
53076
|
-
if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
|
|
53077
|
-
return true;
|
|
53078
|
-
}
|
|
53079
|
-
}
|
|
53080
|
-
}
|
|
53081
|
-
return false;
|
|
53082
|
-
}
|
|
53083
|
-
function redactProperty(name, value) {
|
|
53084
|
-
if (value === undefined || value === null) {
|
|
53085
|
-
return;
|
|
53086
|
-
}
|
|
53087
|
-
if (isSensitiveName(name)) {
|
|
53088
|
-
return REDACTED;
|
|
53089
|
-
}
|
|
53090
|
-
if (typeof value === "boolean" || typeof value === "number") {
|
|
53091
|
-
return value;
|
|
53092
|
-
}
|
|
53093
|
-
if (typeof value !== "string") {
|
|
53094
|
-
return "[OBJECT]";
|
|
53095
|
-
}
|
|
53096
|
-
return redactValueDetectors(value);
|
|
53097
|
-
}
|
|
53098
|
-
function redactProperties(properties) {
|
|
53099
|
-
const out = {};
|
|
53100
|
-
for (const [name, value] of Object.entries(properties)) {
|
|
53101
|
-
const redacted = redactProperty(name, value);
|
|
53102
|
-
if (redacted !== undefined) {
|
|
53103
|
-
out[name] = redacted;
|
|
53104
|
-
}
|
|
53105
|
-
}
|
|
53106
|
-
return out;
|
|
53107
|
-
}
|
|
53108
|
-
|
|
53109
53213
|
// ../common/src/trackedAction.ts
|
|
53110
53214
|
var pollSignalSlot = singleton("PollSignal");
|
|
53111
53215
|
var cliErrorCodeValues = new Set(CLI_ERROR_CODES);
|
|
53112
53216
|
var retryHintValues = new Set(RETRY_HINTS);
|
|
53217
|
+
var TELEMETRY_COMMAND_ARG_PREFIX = "uip.cmd.arg.";
|
|
53113
53218
|
var processContext = {
|
|
53114
53219
|
exit: (code) => {
|
|
53115
53220
|
process.exitCode = code;
|
|
@@ -53120,22 +53225,18 @@ var processContext = {
|
|
|
53120
53225
|
};
|
|
53121
53226
|
function extractCommandParams(cmd) {
|
|
53122
53227
|
const params = {};
|
|
53228
|
+
const add2 = (name, value) => {
|
|
53229
|
+
if (name && value !== undefined) {
|
|
53230
|
+
params[`${TELEMETRY_COMMAND_ARG_PREFIX}${name}`] = value;
|
|
53231
|
+
}
|
|
53232
|
+
};
|
|
53123
53233
|
const registered = cmd.registeredArguments ?? [];
|
|
53124
53234
|
const processed = cmd.processedArgs ?? [];
|
|
53125
53235
|
for (let i = 0;i < registered.length; i++) {
|
|
53126
|
-
|
|
53127
|
-
if (value === undefined) {
|
|
53128
|
-
continue;
|
|
53129
|
-
}
|
|
53130
|
-
const name = registered[i].name();
|
|
53131
|
-
if (name) {
|
|
53132
|
-
params[name] = value;
|
|
53133
|
-
}
|
|
53236
|
+
add2(registered[i].name(), processed[i]);
|
|
53134
53237
|
}
|
|
53135
53238
|
for (const [key, value] of Object.entries(cmd.opts())) {
|
|
53136
|
-
|
|
53137
|
-
params[key] = value;
|
|
53138
|
-
}
|
|
53239
|
+
add2(key, value);
|
|
53139
53240
|
}
|
|
53140
53241
|
return params;
|
|
53141
53242
|
}
|
|
@@ -53178,11 +53279,12 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
53178
53279
|
return this.action(async (...args) => {
|
|
53179
53280
|
const telemetryName = deriveCommandPath(command);
|
|
53180
53281
|
const props = typeof properties === "function" ? properties(...args) : properties;
|
|
53282
|
+
const requestContext = telemetry.createRequestContext();
|
|
53181
53283
|
const startTime = performance.now();
|
|
53182
53284
|
let errorMessage2;
|
|
53183
53285
|
let fallbackExitCode = EXIT_CODES.Success;
|
|
53184
53286
|
clearRecordedCommandFailureTelemetry();
|
|
53185
|
-
const [error] = await catchError2(fn(...args));
|
|
53287
|
+
const [error] = await catchError2(telemetry.runWithContext(requestContext, () => fn(...args)));
|
|
53186
53288
|
if (error) {
|
|
53187
53289
|
errorMessage2 = error instanceof Error ? error.message : String(error);
|
|
53188
53290
|
logger.debug(`[trackedAction] ${telemetryName} failed: ${errorMessage2}`);
|
|
@@ -53218,16 +53320,21 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
53218
53320
|
recordedFailure,
|
|
53219
53321
|
pollSignal: context.pollSignal
|
|
53220
53322
|
});
|
|
53221
|
-
|
|
53222
|
-
|
|
53323
|
+
const commandParams = extractCommandParams(command);
|
|
53324
|
+
if (props) {
|
|
53325
|
+
for (const key of Object.keys(props)) {
|
|
53326
|
+
delete commandParams[`${TELEMETRY_COMMAND_ARG_PREFIX}${key}`];
|
|
53327
|
+
}
|
|
53328
|
+
}
|
|
53329
|
+
const baseProperties = redactProperties({
|
|
53330
|
+
...commandParams,
|
|
53223
53331
|
...props,
|
|
53224
53332
|
...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
|
|
53225
53333
|
command: "true",
|
|
53226
|
-
duration: String(durationMs),
|
|
53227
|
-
success: String(success),
|
|
53228
53334
|
...terminalTelemetry,
|
|
53229
53335
|
...errorMessage2 ? { errorMessage: errorMessage2 } : {}
|
|
53230
|
-
})
|
|
53336
|
+
});
|
|
53337
|
+
telemetry.trackRequestResult(telemetryName, durationMs, success, baseProperties, requestContext);
|
|
53231
53338
|
});
|
|
53232
53339
|
};
|
|
53233
53340
|
// ../common/src/console-guard.ts
|
|
@@ -56022,4 +56129,4 @@ export {
|
|
|
56022
56129
|
metadata
|
|
56023
56130
|
};
|
|
56024
56131
|
|
|
56025
|
-
//# debugId=
|
|
56132
|
+
//# debugId=D45DFDE9F52D3E1064756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/platform-tool",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "1.198.0-preview.
|
|
4
|
+
"version": "1.198.0-preview.96",
|
|
5
5
|
"description": "Manage UiPath platform-level resources such as tenant licensing.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/tool.js",
|
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
"publishConfig": {
|
|
21
21
|
"registry": "https://registry.npmjs.org/"
|
|
22
22
|
},
|
|
23
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "1fadf03d7a8dd102742571dff569fdac11808afb"
|
|
24
24
|
}
|