@uipath/solution-sdk 1.203.0-preview.212 → 1.204.0-preview.211
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/THIRD-PARTY-NOTICES.md +2 -2
- package/dist/{embedded-file-reader-xxqe8vs8.js → embedded-file-reader-rf2g1kfj.js} +2 -2
- package/dist/generated/src/apis/DeploymentsApi.d.ts +27 -23
- package/dist/generated/src/models/DeploymentResourceInfo.d.ts +109 -0
- package/dist/generated/src/models/DeploymentResourceReplacementDto.d.ts +50 -0
- package/dist/generated/src/models/DeploymentUpgradeState.d.ts +27 -0
- package/dist/generated/src/models/PageInfoDtoOfDeploymentResourceInfo.d.ts +39 -0
- package/dist/generated/src/models/ResetConfigurationSource.d.ts +25 -0
- package/dist/generated/src/models/index.d.ts +5 -2
- package/dist/{index-y8tgscfm.js → index-6gp5j7j5.js} +22 -6
- package/dist/{index-4zqv4bn2.js → index-bdpp6dsk.js} +565 -92
- package/dist/index.js +345 -209
- package/dist/resources/index.js +418 -82
- package/dist/scripts/generate-sdk.js +14 -7
- package/dist/solution-auth.js +1 -1
- package/dist/src/index.d.ts +0 -1
- package/dist/src/resources/index.d.ts +2 -0
- package/dist/src/resources/providers/resource-builder-init.d.ts +1 -1
- package/dist/src/resources/services/remote-resources.d.ts +45 -0
- package/dist/src/resources/services/resource-name.d.ts +28 -0
- package/dist/src/resources/services/sync-resources-from-bindings.d.ts +17 -5
- package/dist/src/solution-auth.d.ts +3 -0
- package/dist/src/zip-utils.d.ts +8 -0
- package/package.json +2 -2
- package/dist/generated/src/models/DeploymentRunResponse.d.ts +0 -51
- package/dist/generated/src/models/DeploymentUpgradeRequest.d.ts +0 -38
- package/dist/src/deployments-auto-install.d.ts +0 -55
|
@@ -2637,9 +2637,60 @@ function settlePromiseLike(thenable) {
|
|
|
2637
2637
|
return Promise.resolve(thenable).then((data) => [undefined, data]).catch((error) => [toError(error), undefined]);
|
|
2638
2638
|
}
|
|
2639
2639
|
|
|
2640
|
+
// ../common/src/error-graph.ts
|
|
2641
|
+
function* walkErrorGraph(error) {
|
|
2642
|
+
const queue = [error];
|
|
2643
|
+
const seen = new Set;
|
|
2644
|
+
for (let steps = 0;queue.length > 0 && steps < 32; steps++) {
|
|
2645
|
+
const current = queue.shift();
|
|
2646
|
+
if (current === null || typeof current !== "object")
|
|
2647
|
+
continue;
|
|
2648
|
+
if (seen.has(current))
|
|
2649
|
+
continue;
|
|
2650
|
+
seen.add(current);
|
|
2651
|
+
const cur = current;
|
|
2652
|
+
yield cur;
|
|
2653
|
+
if (cur.cause !== undefined)
|
|
2654
|
+
queue.push(cur.cause);
|
|
2655
|
+
if (Array.isArray(cur.errors))
|
|
2656
|
+
queue.push(...cur.errors);
|
|
2657
|
+
}
|
|
2658
|
+
return;
|
|
2659
|
+
}
|
|
2660
|
+
function parseHttpStatusFromMessage(message) {
|
|
2661
|
+
const match = /^HTTP\s+(\d{3})(?::|\s|-|$)/i.exec(message.trim());
|
|
2662
|
+
if (!match)
|
|
2663
|
+
return;
|
|
2664
|
+
const status = Number(match[1]);
|
|
2665
|
+
return Number.isInteger(status) && status >= 100 && status <= 599 ? status : undefined;
|
|
2666
|
+
}
|
|
2667
|
+
function findHttpStatusInGraph(error) {
|
|
2668
|
+
for (const node of walkErrorGraph(error)) {
|
|
2669
|
+
const response = node.response;
|
|
2670
|
+
const explicit = typeof node.status === "number" ? node.status : response?.status;
|
|
2671
|
+
if (typeof explicit === "number" && explicit >= 400 && explicit <= 599) {
|
|
2672
|
+
return explicit;
|
|
2673
|
+
}
|
|
2674
|
+
if (typeof node.message === "string") {
|
|
2675
|
+
const parsed = parseHttpStatusFromMessage(node.message);
|
|
2676
|
+
if (parsed !== undefined && parsed >= 400) {
|
|
2677
|
+
return parsed;
|
|
2678
|
+
}
|
|
2679
|
+
}
|
|
2680
|
+
}
|
|
2681
|
+
return;
|
|
2682
|
+
}
|
|
2683
|
+
|
|
2684
|
+
// ../common/src/local-permission-codes.ts
|
|
2685
|
+
var LOCAL_PERMISSION_ERROR_CODES = new Set([
|
|
2686
|
+
"EACCES",
|
|
2687
|
+
"EPERM",
|
|
2688
|
+
"EROFS"
|
|
2689
|
+
]);
|
|
2690
|
+
|
|
2640
2691
|
// ../common/src/error-handler.ts
|
|
2641
|
-
var DEFAULT_401 = "Unauthorized (401). Run `uip login` to
|
|
2642
|
-
var DEFAULT_403 = "Forbidden (403).
|
|
2692
|
+
var DEFAULT_401 = "Unauthorized (401). The session is missing or expired, or its token carries no scope for this API. Run `uip login status --detailed` to see the session and its scopes.";
|
|
2693
|
+
var DEFAULT_403 = "Forbidden (403). The account lacks permission for this operation, or the token carries no scope for this API. Run `uip login status --detailed` to see the token's scopes.";
|
|
2643
2694
|
var DEFAULT_405 = "Method Not Allowed (405). The endpoint may not exist or the base URL may be incorrect.";
|
|
2644
2695
|
var DEFAULT_413 = "Payload too large (413). The upload exceeded the server or CDN size limit. Reduce the package size — for example, exclude unused dependencies or remove large files from the project — and try again.";
|
|
2645
2696
|
var HTML_RESPONSE_MESSAGE = "Received HTML instead of the expected JSON response.";
|
|
@@ -2666,14 +2717,14 @@ var TLS_ERROR_CODES = new Set([
|
|
|
2666
2717
|
]);
|
|
2667
2718
|
var TLS_INSTRUCTIONS = "The server's TLS certificate could not be verified. Most often a " + "corporate proxy/firewall re-signs HTTPS with a root CA that Node does " + "not trust — set NODE_EXTRA_CA_CERTS to that CA's PEM file (and HTTPS_PROXY " + "if you connect through a proxy). If the certificate is instead expired or " + "its hostname does not match, fix the endpoint URL or the system clock. " + "Then retry.";
|
|
2668
2719
|
var NETWORK_INSTRUCTIONS = "Could not reach the UiPath service. Check your network connection and " + "VPN, confirm any HTTP_PROXY/HTTPS_PROXY/NO_PROXY settings are correct, " + "then retry.";
|
|
2669
|
-
var
|
|
2670
|
-
var LOCAL_PERMISSION_MESSAGE_PATTERN = /\b(EACCES|EPERM|EROFS)\b/;
|
|
2720
|
+
var LOCAL_PERMISSION_MESSAGE_PATTERN = new RegExp(`\\b(${[...LOCAL_PERMISSION_ERROR_CODES].join("|")})\\b`);
|
|
2671
2721
|
function localPermissionInstructions(code, path) {
|
|
2672
2722
|
const target = path !== undefined ? `'${path}'` : "a local file or resource";
|
|
2673
2723
|
if (code === "EROFS") {
|
|
2674
2724
|
return `The filesystem containing ${target} is read-only (EROFS), so the ` + "CLI could not write to it. This is a local environment problem, " + "not a UiPath service error — retrying will not help. Use a " + "writable location, or give this environment write access to the " + "path.";
|
|
2675
2725
|
}
|
|
2676
|
-
const
|
|
2726
|
+
const onWindows = typeof process !== "undefined" && process.platform === "win32";
|
|
2727
|
+
const remedy = onWindows ? "Re-run from an elevated terminal, close any program holding " + "the file open, or grant your user access to the path." : "Grant this user (or the sandbox the command runs in) access " + "to the path, or run the command outside the sandbox.";
|
|
2677
2728
|
return `The operating system denied access to ${target} (${code}). This is ` + "a local permission problem, not a UiPath service error — retrying " + `without a permission change will not help. ${remedy}`;
|
|
2678
2729
|
}
|
|
2679
2730
|
function describeConnectivityError(error) {
|
|
@@ -2727,48 +2778,6 @@ function localPermissionPath(path, message) {
|
|
|
2727
2778
|
return path;
|
|
2728
2779
|
return message ? /'([^']+)'/.exec(message)?.[1] : undefined;
|
|
2729
2780
|
}
|
|
2730
|
-
function* walkErrorGraph(error) {
|
|
2731
|
-
const queue = [error];
|
|
2732
|
-
const seen = new Set;
|
|
2733
|
-
for (let steps = 0;queue.length > 0 && steps < 32; steps++) {
|
|
2734
|
-
const current = queue.shift();
|
|
2735
|
-
if (current === null || typeof current !== "object")
|
|
2736
|
-
continue;
|
|
2737
|
-
if (seen.has(current))
|
|
2738
|
-
continue;
|
|
2739
|
-
seen.add(current);
|
|
2740
|
-
const cur = current;
|
|
2741
|
-
yield cur;
|
|
2742
|
-
if (cur.cause !== undefined)
|
|
2743
|
-
queue.push(cur.cause);
|
|
2744
|
-
if (Array.isArray(cur.errors))
|
|
2745
|
-
queue.push(...cur.errors);
|
|
2746
|
-
}
|
|
2747
|
-
return;
|
|
2748
|
-
}
|
|
2749
|
-
function parseHttpStatusFromMessage(message) {
|
|
2750
|
-
const match = /^HTTP\s+(\d{3})(?::|\s|-|$)/i.exec(message.trim());
|
|
2751
|
-
if (!match)
|
|
2752
|
-
return;
|
|
2753
|
-
const status = Number(match[1]);
|
|
2754
|
-
return Number.isInteger(status) && status >= 100 && status <= 599 ? status : undefined;
|
|
2755
|
-
}
|
|
2756
|
-
function findHttpStatusInGraph(error) {
|
|
2757
|
-
for (const node of walkErrorGraph(error)) {
|
|
2758
|
-
const response = node.response;
|
|
2759
|
-
const explicit = typeof node.status === "number" ? node.status : response?.status;
|
|
2760
|
-
if (typeof explicit === "number" && explicit >= 400 && explicit <= 599) {
|
|
2761
|
-
return explicit;
|
|
2762
|
-
}
|
|
2763
|
-
if (typeof node.message === "string") {
|
|
2764
|
-
const parsed = parseHttpStatusFromMessage(node.message);
|
|
2765
|
-
if (parsed !== undefined && parsed >= 400) {
|
|
2766
|
-
return parsed;
|
|
2767
|
-
}
|
|
2768
|
-
}
|
|
2769
|
-
}
|
|
2770
|
-
return;
|
|
2771
|
-
}
|
|
2772
2781
|
function isHtmlDocument(body) {
|
|
2773
2782
|
return /^\s*(<!doctype html|<html\b)/i.test(body);
|
|
2774
2783
|
}
|
|
@@ -3290,12 +3299,162 @@ function getOutputFilter() {
|
|
|
3290
3299
|
return filterSlot.get();
|
|
3291
3300
|
}
|
|
3292
3301
|
|
|
3302
|
+
// ../common/src/telemetry/telemetry-dimensions.ts
|
|
3303
|
+
var BaseDimensions = {
|
|
3304
|
+
ApplicationName: "ApplicationName",
|
|
3305
|
+
ProductVersion: "ProductVersion",
|
|
3306
|
+
InstallationId: "InstallationId",
|
|
3307
|
+
CloudUserId: "CloudUserId",
|
|
3308
|
+
CloudTenantId: "CloudTenantId",
|
|
3309
|
+
CloudOrganizationId: "CloudOrganizationId",
|
|
3310
|
+
IsInternalUser: "IsInternalUser",
|
|
3311
|
+
Environment: "Environment",
|
|
3312
|
+
BaseUrl: "BaseUrl",
|
|
3313
|
+
Region: "Region",
|
|
3314
|
+
Agent: "Agent",
|
|
3315
|
+
AgentVersion: "AgentVersion",
|
|
3316
|
+
AgentModel: "AgentModel",
|
|
3317
|
+
ToolName: "ToolName",
|
|
3318
|
+
ToolVersion: "ToolVersion",
|
|
3319
|
+
ExecutionContext: "ExecutionContext",
|
|
3320
|
+
CiProvider: "CiProvider",
|
|
3321
|
+
SessionIdSource: "SessionIdSource",
|
|
3322
|
+
SessionId: "SessionId"
|
|
3323
|
+
};
|
|
3324
|
+
var CommandDimensions = {
|
|
3325
|
+
IsCommand: "IsCommand",
|
|
3326
|
+
IsReexec: "IsReexec",
|
|
3327
|
+
CommandName: "CommandName",
|
|
3328
|
+
ExitCode: "ExitCode",
|
|
3329
|
+
TerminalOutcome: "TerminalOutcome",
|
|
3330
|
+
ErrorClass: "ErrorClass",
|
|
3331
|
+
TerminalSignal: "TerminalSignal",
|
|
3332
|
+
ErrorMessage: "ErrorMessage",
|
|
3333
|
+
SkillName: "SkillName",
|
|
3334
|
+
ProductArea: "ProductArea",
|
|
3335
|
+
Mode: "Mode"
|
|
3336
|
+
};
|
|
3337
|
+
var ShipDimensions = {
|
|
3338
|
+
ShipKind: "ShipKind",
|
|
3339
|
+
Target: "Target",
|
|
3340
|
+
ProjectType: "ProjectType",
|
|
3341
|
+
ProjectTypes: "ProjectTypes",
|
|
3342
|
+
ArtifactCorrelationKey: "ArtifactCorrelationKey",
|
|
3343
|
+
PackageName: "PackageName",
|
|
3344
|
+
PackageVersion: "PackageVersion",
|
|
3345
|
+
PackageVersionKey: "PackageVersionKey",
|
|
3346
|
+
DeploymentKey: "DeploymentKey",
|
|
3347
|
+
SolutionId: "SolutionId",
|
|
3348
|
+
FolderKey: "FolderKey",
|
|
3349
|
+
FeedId: "FeedId"
|
|
3350
|
+
};
|
|
3351
|
+
var ErrorDimensions = {
|
|
3352
|
+
Result: "Result",
|
|
3353
|
+
ErrorCode: "ErrorCode",
|
|
3354
|
+
Retry: "Retry",
|
|
3355
|
+
ErrorMessage: "ErrorMessage"
|
|
3356
|
+
};
|
|
3357
|
+
var AuthDimensions = {
|
|
3358
|
+
AuthenticationMethod: "AuthenticationMethod",
|
|
3359
|
+
Success: "Success",
|
|
3360
|
+
Reason: "Reason"
|
|
3361
|
+
};
|
|
3362
|
+
var SkillsDimensions = {
|
|
3363
|
+
SchemaVersion: "SchemaVersion",
|
|
3364
|
+
AgentType: "AgentType",
|
|
3365
|
+
SkillsVersion: "SkillsVersion",
|
|
3366
|
+
UipSubcommand: "UipSubcommand",
|
|
3367
|
+
FileExtension: "FileExtension",
|
|
3368
|
+
SubagentModel: "SubagentModel",
|
|
3369
|
+
SubagentType: "SubagentType",
|
|
3370
|
+
PermissionMode: "PermissionMode",
|
|
3371
|
+
EffortLevel: "EffortLevel",
|
|
3372
|
+
SessionSource: "SessionSource",
|
|
3373
|
+
Outcome: "Outcome",
|
|
3374
|
+
DurationMs: "DurationMs",
|
|
3375
|
+
Source: "Source"
|
|
3376
|
+
};
|
|
3377
|
+
var PackagerDimensions = {
|
|
3378
|
+
ProjectId: "ProjectId",
|
|
3379
|
+
ProjectType: "ProjectType",
|
|
3380
|
+
SolutionId: "SolutionId"
|
|
3381
|
+
};
|
|
3382
|
+
var ScopeDimensions = {
|
|
3383
|
+
FolderId: "FolderId"
|
|
3384
|
+
};
|
|
3385
|
+
var ID_DIMENSIONS = new Set([
|
|
3386
|
+
BaseDimensions.CloudUserId,
|
|
3387
|
+
BaseDimensions.CloudTenantId,
|
|
3388
|
+
BaseDimensions.CloudOrganizationId,
|
|
3389
|
+
BaseDimensions.InstallationId,
|
|
3390
|
+
ShipDimensions.ArtifactCorrelationKey,
|
|
3391
|
+
ShipDimensions.PackageVersionKey,
|
|
3392
|
+
ShipDimensions.DeploymentKey,
|
|
3393
|
+
ShipDimensions.SolutionId,
|
|
3394
|
+
ShipDimensions.FolderKey,
|
|
3395
|
+
ShipDimensions.FeedId,
|
|
3396
|
+
PackagerDimensions.ProjectId
|
|
3397
|
+
]);
|
|
3398
|
+
var NON_IDENTIFIER_PLACEHOLDER_PATTERN = /^(?:\[[A-Z_]+\]|<[^>]+>)$/;
|
|
3399
|
+
var RESERVED_DIMENSION_NAMES = new Set([
|
|
3400
|
+
...Object.values(BaseDimensions),
|
|
3401
|
+
...Object.values(CommandDimensions),
|
|
3402
|
+
...Object.values(ShipDimensions),
|
|
3403
|
+
...Object.values(ErrorDimensions),
|
|
3404
|
+
...Object.values(AuthDimensions),
|
|
3405
|
+
...Object.values(SkillsDimensions),
|
|
3406
|
+
...Object.values(PackagerDimensions),
|
|
3407
|
+
...Object.values(ScopeDimensions)
|
|
3408
|
+
]);
|
|
3409
|
+
var CURATED_DIMENSIONS = new Set([
|
|
3410
|
+
BaseDimensions.ApplicationName,
|
|
3411
|
+
BaseDimensions.ProductVersion,
|
|
3412
|
+
BaseDimensions.InstallationId,
|
|
3413
|
+
BaseDimensions.CloudUserId,
|
|
3414
|
+
BaseDimensions.CloudTenantId,
|
|
3415
|
+
BaseDimensions.CloudOrganizationId,
|
|
3416
|
+
BaseDimensions.IsInternalUser,
|
|
3417
|
+
BaseDimensions.Environment,
|
|
3418
|
+
BaseDimensions.BaseUrl,
|
|
3419
|
+
BaseDimensions.Region,
|
|
3420
|
+
BaseDimensions.Agent,
|
|
3421
|
+
BaseDimensions.AgentVersion,
|
|
3422
|
+
BaseDimensions.ToolVersion,
|
|
3423
|
+
BaseDimensions.ExecutionContext,
|
|
3424
|
+
BaseDimensions.CiProvider,
|
|
3425
|
+
BaseDimensions.SessionIdSource,
|
|
3426
|
+
BaseDimensions.SessionId,
|
|
3427
|
+
...Object.values(CommandDimensions),
|
|
3428
|
+
...Object.values(ShipDimensions)
|
|
3429
|
+
]);
|
|
3430
|
+
function lowercaseIdDimensionValues(properties) {
|
|
3431
|
+
let changed = false;
|
|
3432
|
+
const result = {
|
|
3433
|
+
...properties
|
|
3434
|
+
};
|
|
3435
|
+
for (const key of Object.keys(result)) {
|
|
3436
|
+
const value = result[key];
|
|
3437
|
+
if (!ID_DIMENSIONS.has(key) || typeof value !== "string" || NON_IDENTIFIER_PLACEHOLDER_PATTERN.test(value)) {
|
|
3438
|
+
continue;
|
|
3439
|
+
}
|
|
3440
|
+
const lowered = value.toLowerCase();
|
|
3441
|
+
if (lowered !== value) {
|
|
3442
|
+
result[key] = lowered;
|
|
3443
|
+
changed = true;
|
|
3444
|
+
}
|
|
3445
|
+
}
|
|
3446
|
+
return changed ? result : properties;
|
|
3447
|
+
}
|
|
3448
|
+
|
|
3293
3449
|
// ../common/src/telemetry/command-terminal.ts
|
|
3294
3450
|
var recordedFailureSlot = singleton("CommandTelemetryFailure");
|
|
3295
3451
|
var AUTH_ERROR_CODES = new Set([
|
|
3296
3452
|
"authentication_required",
|
|
3297
3453
|
"permission_denied"
|
|
3298
3454
|
]);
|
|
3455
|
+
var LOCAL_PERMISSION_CLI_ERROR_CODES = new Set([
|
|
3456
|
+
"local_permission_denied"
|
|
3457
|
+
]);
|
|
3299
3458
|
var VALIDATION_ERROR_CODES = new Set(["invalid_argument"]);
|
|
3300
3459
|
var NETWORK_HTTP_ERROR_CODES = new Set([
|
|
3301
3460
|
"network_error",
|
|
@@ -3436,6 +3595,9 @@ function classifyFromErrorCode(errorCode) {
|
|
|
3436
3595
|
if (AUTH_ERROR_CODES.has(errorCode)) {
|
|
3437
3596
|
return "auth";
|
|
3438
3597
|
}
|
|
3598
|
+
if (LOCAL_PERMISSION_CLI_ERROR_CODES.has(errorCode)) {
|
|
3599
|
+
return "local_permission";
|
|
3600
|
+
}
|
|
3439
3601
|
if (VALIDATION_ERROR_CODES.has(errorCode)) {
|
|
3440
3602
|
return "validation";
|
|
3441
3603
|
}
|
|
@@ -3447,6 +3609,15 @@ function classifyFromErrorCode(errorCode) {
|
|
|
3447
3609
|
}
|
|
3448
3610
|
return;
|
|
3449
3611
|
}
|
|
3612
|
+
function hasLocalPermissionCode(error) {
|
|
3613
|
+
for (const node of walkErrorGraph(error)) {
|
|
3614
|
+
const code = node.code;
|
|
3615
|
+
if (typeof code === "string" && LOCAL_PERMISSION_ERROR_CODES.has(code)) {
|
|
3616
|
+
return true;
|
|
3617
|
+
}
|
|
3618
|
+
}
|
|
3619
|
+
return false;
|
|
3620
|
+
}
|
|
3450
3621
|
function classifyFromError(error) {
|
|
3451
3622
|
const code = findCodeInCauseChain(error);
|
|
3452
3623
|
if (code) {
|
|
@@ -3463,6 +3634,9 @@ function classifyFromError(error) {
|
|
|
3463
3634
|
return "missing_dependency";
|
|
3464
3635
|
}
|
|
3465
3636
|
}
|
|
3637
|
+
if (hasLocalPermissionCode(error)) {
|
|
3638
|
+
return "local_permission";
|
|
3639
|
+
}
|
|
3466
3640
|
const message = stringField(error, "message");
|
|
3467
3641
|
if (message?.includes("fetch failed") === true) {
|
|
3468
3642
|
return "network_http";
|
|
@@ -3478,7 +3652,7 @@ function classifyError2(input) {
|
|
|
3478
3652
|
if (recorded?.errorClass) {
|
|
3479
3653
|
return recorded.errorClass;
|
|
3480
3654
|
}
|
|
3481
|
-
const status = recorded?.context?.httpStatus;
|
|
3655
|
+
const status = recorded?.context?.httpStatus ?? findHttpStatusInGraph(input.error);
|
|
3482
3656
|
if (status !== undefined) {
|
|
3483
3657
|
return classifyHttpStatus(status);
|
|
3484
3658
|
}
|
|
@@ -3501,17 +3675,18 @@ function buildCommandTerminalTelemetryProperties(input) {
|
|
|
3501
3675
|
const errorClass = outcome === "success" || outcome === "no_op" ? undefined : outcome === "cancelled" ? "user_cancelled" : classifyError2(input);
|
|
3502
3676
|
const terminalSignal = terminalSignalFor(input, outcome);
|
|
3503
3677
|
return {
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
...errorClass ? {
|
|
3507
|
-
...terminalSignal ? {
|
|
3678
|
+
[CommandDimensions.ExitCode]: input.exitCode,
|
|
3679
|
+
[CommandDimensions.TerminalOutcome]: outcome,
|
|
3680
|
+
...errorClass ? { [CommandDimensions.ErrorClass]: errorClass } : {},
|
|
3681
|
+
...terminalSignal ? { [CommandDimensions.TerminalSignal]: terminalSignal } : {}
|
|
3508
3682
|
};
|
|
3509
3683
|
}
|
|
3510
3684
|
|
|
3511
3685
|
// ../common/src/telemetry/telemetry-events.ts
|
|
3512
3686
|
var CommonTelemetryEvents = {
|
|
3513
|
-
|
|
3514
|
-
|
|
3687
|
+
Start: "Application.Start",
|
|
3688
|
+
Error: "Application.Error",
|
|
3689
|
+
ShipSucceeded: "Cli.ShipSucceeded"
|
|
3515
3690
|
};
|
|
3516
3691
|
|
|
3517
3692
|
// ../common/src/registry.ts
|
|
@@ -3719,8 +3894,8 @@ function detectExecutionContext(options = {}) {
|
|
|
3719
3894
|
function getExecutionContextTelemetryProperties() {
|
|
3720
3895
|
const detected = detectExecutionContext();
|
|
3721
3896
|
return {
|
|
3722
|
-
|
|
3723
|
-
...detected.ciProvider ? {
|
|
3897
|
+
[BaseDimensions.ExecutionContext]: detected.executionContext,
|
|
3898
|
+
...detected.ciProvider ? { [BaseDimensions.CiProvider]: detected.ciProvider } : {}
|
|
3724
3899
|
};
|
|
3725
3900
|
}
|
|
3726
3901
|
// ../common/src/telemetry/node-context-storage.ts
|
|
@@ -3763,7 +3938,7 @@ function getInboundTraceContext() {
|
|
|
3763
3938
|
var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
|
|
3764
3939
|
var SESSION_ID_MAX_LENGTH = 64;
|
|
3765
3940
|
var RANDOM_SESSION_ID_LENGTH = 32;
|
|
3766
|
-
var TELEMETRY_SESSION_SOURCE_PROPERTY = "
|
|
3941
|
+
var TELEMETRY_SESSION_SOURCE_PROPERTY = "SessionIdSource";
|
|
3767
3942
|
var CONTROL_CHARACTERS = /\p{Cc}/gu;
|
|
3768
3943
|
var INHERITED_SESSION_SOURCES = [
|
|
3769
3944
|
{ envVar: "CLAUDE_CODE_SESSION_ID", source: "claude-code" },
|
|
@@ -3815,6 +3990,9 @@ function resolveTelemetrySession() {
|
|
|
3815
3990
|
telemetrySessionSlot.set(resolved);
|
|
3816
3991
|
return resolved;
|
|
3817
3992
|
}
|
|
3993
|
+
function getTelemetrySessionId() {
|
|
3994
|
+
return resolveTelemetrySession().id;
|
|
3995
|
+
}
|
|
3818
3996
|
function getTelemetrySessionSource() {
|
|
3819
3997
|
return resolveTelemetrySession().source;
|
|
3820
3998
|
}
|
|
@@ -3895,7 +4073,10 @@ class TelemetryService {
|
|
|
3895
4073
|
} catch (error) {
|
|
3896
4074
|
const durationMs = clock.elapsedMs();
|
|
3897
4075
|
const err = error instanceof Error ? error : new Error(String(error));
|
|
3898
|
-
await this.telemetryProvider.trackRequest(this.spanFor(name, durationMs, false, {
|
|
4076
|
+
await this.telemetryProvider.trackRequest(this.spanFor(name, durationMs, false, {
|
|
4077
|
+
...properties,
|
|
4078
|
+
[CommandDimensions.ErrorMessage]: err.message
|
|
4079
|
+
}, context));
|
|
3899
4080
|
throw error;
|
|
3900
4081
|
}
|
|
3901
4082
|
}
|
|
@@ -3966,7 +4147,10 @@ class TelemetryService {
|
|
|
3966
4147
|
const durationMs = clock.elapsedMs();
|
|
3967
4148
|
const err = error instanceof Error ? error : new Error(String(error));
|
|
3968
4149
|
await this.telemetryProvider.trackDependency({
|
|
3969
|
-
...this.spanFor(name, durationMs, false, {
|
|
4150
|
+
...this.spanFor(name, durationMs, false, {
|
|
4151
|
+
...properties,
|
|
4152
|
+
[CommandDimensions.ErrorMessage]: err.message
|
|
4153
|
+
}, childContext),
|
|
3970
4154
|
type
|
|
3971
4155
|
});
|
|
3972
4156
|
throw error;
|
|
@@ -4001,9 +4185,10 @@ class TelemetryService {
|
|
|
4001
4185
|
...globalProperties,
|
|
4002
4186
|
...this.defaultProperties,
|
|
4003
4187
|
...redactProperties(properties ?? {}),
|
|
4004
|
-
[TELEMETRY_SESSION_SOURCE_PROPERTY]: getTelemetrySessionSource()
|
|
4188
|
+
[TELEMETRY_SESSION_SOURCE_PROPERTY]: getTelemetrySessionSource(),
|
|
4189
|
+
[BaseDimensions.SessionId]: this.telemetryProvider.getSessionId?.() ?? getTelemetrySessionId()
|
|
4005
4190
|
};
|
|
4006
|
-
return enriched;
|
|
4191
|
+
return lowercaseIdDimensionValues(enriched);
|
|
4007
4192
|
}
|
|
4008
4193
|
generateId() {
|
|
4009
4194
|
const bytes = new Uint8Array(8);
|
|
@@ -4758,7 +4943,165 @@ class FilterImplicitLimitError extends Error {
|
|
|
4758
4943
|
this.instructions = "Pass --limit <n> to choose how many records the filter applies to. " + "To filter over all records, pass the command's maximum accepted --limit (see the option's description in --help).";
|
|
4759
4944
|
}
|
|
4760
4945
|
}
|
|
4761
|
-
function
|
|
4946
|
+
function countRecords(data) {
|
|
4947
|
+
if (Array.isArray(data))
|
|
4948
|
+
return data.length;
|
|
4949
|
+
return data == null ? 0 : 1;
|
|
4950
|
+
}
|
|
4951
|
+
function availableFields(data) {
|
|
4952
|
+
const records = Array.isArray(data) ? data : [data];
|
|
4953
|
+
const keys = new Set;
|
|
4954
|
+
for (const record of records) {
|
|
4955
|
+
if (record && typeof record === "object" && !Array.isArray(record)) {
|
|
4956
|
+
for (const key of Object.keys(record))
|
|
4957
|
+
keys.add(key);
|
|
4958
|
+
}
|
|
4959
|
+
}
|
|
4960
|
+
return [...keys];
|
|
4961
|
+
}
|
|
4962
|
+
function decodeQuotedIdentifier(whole, inner) {
|
|
4963
|
+
const [error, decoded] = catchError(() => JSON.parse(whole));
|
|
4964
|
+
if (!error && typeof decoded === "string")
|
|
4965
|
+
return decoded;
|
|
4966
|
+
return inner.replace(/\\(.)/g, "$1");
|
|
4967
|
+
}
|
|
4968
|
+
function referencedFields(filter) {
|
|
4969
|
+
const top = new Set;
|
|
4970
|
+
const nested = new Set;
|
|
4971
|
+
const withoutValueLiterals = filter.replace(/'(?:\\.|[^'\\])*'/g, " ").replace(/`(?:\\.|[^`\\])*`/g, " ");
|
|
4972
|
+
const isPathTail = (text, index) => text[index - 1] === "." && /[A-Za-z0-9_"]/.test(text[index - 2] ?? "");
|
|
4973
|
+
const quoted = [];
|
|
4974
|
+
const withoutLiterals = withoutValueLiterals.replace(/"((?:\\.|[^"\\])*)"/g, (whole, name, index) => {
|
|
4975
|
+
const isAlias = /^\s*:/.test(withoutValueLiterals.slice(index + whole.length));
|
|
4976
|
+
if (!isAlias) {
|
|
4977
|
+
quoted.push({
|
|
4978
|
+
name: decodeQuotedIdentifier(whole, name),
|
|
4979
|
+
index,
|
|
4980
|
+
tail: isPathTail(withoutValueLiterals, index)
|
|
4981
|
+
});
|
|
4982
|
+
}
|
|
4983
|
+
return `"${" ".repeat(whole.length - 2)}"`;
|
|
4984
|
+
});
|
|
4985
|
+
const descent = /[A-Za-z0-9_"]\s*[.[]/.exec(withoutLiterals);
|
|
4986
|
+
const rootEnd = descent ? descent.index + 1 : Number.POSITIVE_INFINITY;
|
|
4987
|
+
const place = (name, index, tail) => {
|
|
4988
|
+
if (tail || index >= rootEnd)
|
|
4989
|
+
nested.add(name);
|
|
4990
|
+
else
|
|
4991
|
+
top.add(name);
|
|
4992
|
+
};
|
|
4993
|
+
for (const entry of quoted)
|
|
4994
|
+
place(entry.name, entry.index, entry.tail);
|
|
4995
|
+
const identifiers = withoutLiterals.matchAll(/([A-Za-z_][A-Za-z0-9_]*)(\s*[:(])?/g);
|
|
4996
|
+
const reserved = new Set(["true", "false", "null", "and", "or", "not"]);
|
|
4997
|
+
for (const match of identifiers) {
|
|
4998
|
+
const [, name, trailing] = match;
|
|
4999
|
+
if (trailing || reserved.has(name))
|
|
5000
|
+
continue;
|
|
5001
|
+
place(name, match.index, isPathTail(withoutLiterals, match.index));
|
|
5002
|
+
}
|
|
5003
|
+
return {
|
|
5004
|
+
top: [...top],
|
|
5005
|
+
nested: [...nested].filter((name) => !top.has(name)),
|
|
5006
|
+
hasPredicate: /\[\s*\?/.test(withoutValueLiterals)
|
|
5007
|
+
};
|
|
5008
|
+
}
|
|
5009
|
+
function appearsBelowTopLevel(data, name) {
|
|
5010
|
+
let budget = 2000;
|
|
5011
|
+
const visit = (value, depth) => {
|
|
5012
|
+
if (budget-- <= 0 || depth > 4)
|
|
5013
|
+
return false;
|
|
5014
|
+
if (value === null || typeof value !== "object")
|
|
5015
|
+
return false;
|
|
5016
|
+
if (Array.isArray(value))
|
|
5017
|
+
return value.some((entry) => visit(entry, depth));
|
|
5018
|
+
const record = value;
|
|
5019
|
+
if (depth > 0 && Object.hasOwn(record, name))
|
|
5020
|
+
return true;
|
|
5021
|
+
return Object.values(record).some((entry) => visit(entry, depth + 1));
|
|
5022
|
+
};
|
|
5023
|
+
return visit(data, 0);
|
|
5024
|
+
}
|
|
5025
|
+
function alwaysNullKeys(records) {
|
|
5026
|
+
const objects = records.filter((r) => r != null && typeof r === "object" && !Array.isArray(r));
|
|
5027
|
+
if (objects.length === 0 || objects.length !== records.length)
|
|
5028
|
+
return [];
|
|
5029
|
+
const keys = [...new Set(objects.flatMap((o) => Object.keys(o)))];
|
|
5030
|
+
if (keys.length === 0)
|
|
5031
|
+
return [];
|
|
5032
|
+
const nullKeys = keys.filter((key) => objects.every((record) => record[key] === null));
|
|
5033
|
+
return nullKeys.length === keys.length ? nullKeys : [];
|
|
5034
|
+
}
|
|
5035
|
+
function carriesOnlyNulls(value) {
|
|
5036
|
+
if (value === null)
|
|
5037
|
+
return true;
|
|
5038
|
+
if (Array.isArray(value)) {
|
|
5039
|
+
return value.length > 0 && value.every(carriesOnlyNulls);
|
|
5040
|
+
}
|
|
5041
|
+
if (typeof value === "object" && value !== undefined) {
|
|
5042
|
+
const values = Object.values(value);
|
|
5043
|
+
return values.length > 0 && values.every(carriesOnlyNulls);
|
|
5044
|
+
}
|
|
5045
|
+
return false;
|
|
5046
|
+
}
|
|
5047
|
+
function nameList(names, cap2 = 12) {
|
|
5048
|
+
const shown = names.slice(0, cap2).map((n) => `\`${n}\``);
|
|
5049
|
+
const rest = names.length - shown.length;
|
|
5050
|
+
return shown.join(", ") + (rest > 0 ? `, and ${rest} more` : "");
|
|
5051
|
+
}
|
|
5052
|
+
function buildFilterWarning(filter, data, outcome) {
|
|
5053
|
+
const present = availableFields(data);
|
|
5054
|
+
const refs = referencedFields(filter);
|
|
5055
|
+
const unknown = refs.top.filter((name) => !present.includes(name) && !appearsBelowTopLevel(data, name));
|
|
5056
|
+
const unchecked = refs.nested.filter((name) => !present.includes(name));
|
|
5057
|
+
const count = countRecords(data);
|
|
5058
|
+
const scope = `${count} record(s)`;
|
|
5059
|
+
const isNotAField = (names) => `${nameList(names)} ${names.length === 1 ? "is not a field" : "are not fields"} on the ${scope} it read`;
|
|
5060
|
+
const soundness = unchecked.length > 0 ? `${nameList(unchecked)} ${unchecked.length === 1 ? "reads" : "read"} below the top level, so ${unchecked.length === 1 ? "it was" : "they were"} not checked against the record keys` : refs.top.length > 0 ? "every field it names exists" : "";
|
|
5061
|
+
const withSoundness = (base) => soundness ? `${base}, and ${soundness}` : base;
|
|
5062
|
+
let detail;
|
|
5063
|
+
let lede;
|
|
5064
|
+
if (outcome.kind === "null-elements") {
|
|
5065
|
+
lede = "returned only null values";
|
|
5066
|
+
const projected = `all ${outcome.count} of the elements it projected are null`;
|
|
5067
|
+
if (unknown.length > 0) {
|
|
5068
|
+
detail = `${projected}, because ${isNotAField(unknown)}`;
|
|
5069
|
+
} else if (unchecked.length > 0) {
|
|
5070
|
+
detail = withSoundness(projected);
|
|
5071
|
+
} else {
|
|
5072
|
+
detail = `${projected}, and every field it names exists — a multi-select list ` + `(\`[A, B]\`) reads each entry against \`Data\` itself, so on a list ` + `result use \`[].[A, B]\` or \`[].{a: A, b: B}\` to read the records`;
|
|
5073
|
+
}
|
|
5074
|
+
} else if (outcome.kind === "null-rows") {
|
|
5075
|
+
lede = "returned only null values";
|
|
5076
|
+
const projected = `every value it projected is null on all ${outcome.count} row(s)`;
|
|
5077
|
+
detail = unknown.length > 0 ? `${projected}, because ${isNotAField(unknown)}` : withSoundness(projected);
|
|
5078
|
+
} else if (outcome.kind === "null-values") {
|
|
5079
|
+
lede = "returned only null values";
|
|
5080
|
+
const projected = `every key it projected (${nameList(outcome.keys)}) is null`;
|
|
5081
|
+
const sameSet = unknown.length === outcome.keys.length && outcome.keys.every((k) => unknown.includes(k));
|
|
5082
|
+
if (sameSet) {
|
|
5083
|
+
detail = `${isNotAField(outcome.keys)}, so every key it projected is null`;
|
|
5084
|
+
} else if (unknown.length > 0) {
|
|
5085
|
+
detail = `${projected}, because ${isNotAField(unknown)}`;
|
|
5086
|
+
} else {
|
|
5087
|
+
detail = withSoundness(`${projected} on all ${scope}`);
|
|
5088
|
+
}
|
|
5089
|
+
} else {
|
|
5090
|
+
lede = "returned nothing";
|
|
5091
|
+
if (unknown.length > 0) {
|
|
5092
|
+
detail = isNotAField(unknown);
|
|
5093
|
+
} else {
|
|
5094
|
+
const selection = refs.hasPredicate ? "no record matched" : "the expression resolved to no value";
|
|
5095
|
+
detail = withSoundness(`${selection} — it read ${scope}`);
|
|
5096
|
+
}
|
|
5097
|
+
}
|
|
5098
|
+
const fields = present.length > 0 ? ` Available fields: ${nameList(present)}.` : "";
|
|
5099
|
+
return `--output-filter ${JSON.stringify(filter)} ${lede}: ${detail}.${fields}`;
|
|
5100
|
+
}
|
|
5101
|
+
function appendWarning(existing, note) {
|
|
5102
|
+
return existing ? `${existing} ${note}` : note;
|
|
5103
|
+
}
|
|
5104
|
+
function applyFilter(data, filter, onWarning) {
|
|
4762
5105
|
const codec = requireJmespath();
|
|
4763
5106
|
let result;
|
|
4764
5107
|
try {
|
|
@@ -4766,9 +5109,34 @@ function applyFilter(data, filter) {
|
|
|
4766
5109
|
} catch (err) {
|
|
4767
5110
|
throw new FilterEvaluationError(filter, err);
|
|
4768
5111
|
}
|
|
4769
|
-
|
|
5112
|
+
const inputCount = countRecords(data);
|
|
5113
|
+
const warn = (outcome) => {
|
|
5114
|
+
if (inputCount === 0)
|
|
5115
|
+
return;
|
|
5116
|
+
const note = buildFilterWarning(filter, data, outcome);
|
|
5117
|
+
getOutputSink().writeErr(`[WARN] ${note}
|
|
5118
|
+
`);
|
|
5119
|
+
onWarning?.(note);
|
|
5120
|
+
};
|
|
5121
|
+
const warnIfAllNull = (records) => {
|
|
5122
|
+
const keys = alwaysNullKeys(records);
|
|
5123
|
+
if (keys.length > 0)
|
|
5124
|
+
warn({ kind: "null-values", keys });
|
|
5125
|
+
};
|
|
5126
|
+
if (result == null) {
|
|
5127
|
+
warn({ kind: "empty" });
|
|
4770
5128
|
return [];
|
|
5129
|
+
}
|
|
4771
5130
|
if (Array.isArray(result)) {
|
|
5131
|
+
if (result.length === 0) {
|
|
5132
|
+
warn({ kind: "empty" });
|
|
5133
|
+
} else if (result.every((entry) => entry === null)) {
|
|
5134
|
+
warn({ kind: "null-elements", count: result.length });
|
|
5135
|
+
} else if (result.every((entry) => Array.isArray(entry)) && carriesOnlyNulls(result)) {
|
|
5136
|
+
warn({ kind: "null-rows", count: result.length });
|
|
5137
|
+
} else {
|
|
5138
|
+
warnIfAllNull(result);
|
|
5139
|
+
}
|
|
4772
5140
|
if (result.length > 0 && typeof result[0] !== "object") {
|
|
4773
5141
|
const fieldMatch = filter.match(/\.(\w+)$/);
|
|
4774
5142
|
const key = fieldMatch ? fieldMatch[1] : "Value";
|
|
@@ -4776,10 +5144,30 @@ function applyFilter(data, filter) {
|
|
|
4776
5144
|
}
|
|
4777
5145
|
return result;
|
|
4778
5146
|
}
|
|
4779
|
-
if (typeof result === "object")
|
|
5147
|
+
if (typeof result === "object") {
|
|
5148
|
+
warnIfAllNull([result]);
|
|
4780
5149
|
return result;
|
|
5150
|
+
}
|
|
4781
5151
|
return { Value: result };
|
|
4782
5152
|
}
|
|
5153
|
+
function filterFailureData(envelope) {
|
|
5154
|
+
const filter = getOutputFilter();
|
|
5155
|
+
const data = envelope.Data;
|
|
5156
|
+
if (!filter || data == null)
|
|
5157
|
+
return;
|
|
5158
|
+
let note;
|
|
5159
|
+
const [filterError, filtered] = catchError(() => applyFilter(data, filter, (n) => {
|
|
5160
|
+
note = n;
|
|
5161
|
+
}));
|
|
5162
|
+
if (filterError) {
|
|
5163
|
+
envelope.Warning = appendWarning(envelope.Warning, `--output-filter was not applied, so Data is shown in full: ${filterError.message}`);
|
|
5164
|
+
return;
|
|
5165
|
+
}
|
|
5166
|
+
envelope.Data = filtered;
|
|
5167
|
+
if (note) {
|
|
5168
|
+
envelope.Warning = appendWarning(envelope.Warning, note);
|
|
5169
|
+
}
|
|
5170
|
+
}
|
|
4783
5171
|
function defaultErrorCodeForResult(result) {
|
|
4784
5172
|
switch (result) {
|
|
4785
5173
|
case RESULTS.AuthenticationError:
|
|
@@ -4823,7 +5211,7 @@ function defaultErrorCodeForHttpStatus(status) {
|
|
|
4823
5211
|
return "server_error";
|
|
4824
5212
|
return;
|
|
4825
5213
|
}
|
|
4826
|
-
var LOCAL_PERMISSION_TEXT_PATTERN =
|
|
5214
|
+
var LOCAL_PERMISSION_TEXT_PATTERN = new RegExp(`(?:\\b|\\()(?:${[...LOCAL_PERMISSION_ERROR_CODES].join("|")})(?::\\s|\\))`);
|
|
4827
5215
|
function defaultErrorCodeForFailure(data) {
|
|
4828
5216
|
if (data.Result === RESULTS.Failure) {
|
|
4829
5217
|
const status = data.Context?.httpStatus ?? parseHttpStatusFromMessage2(data.Message);
|
|
@@ -4862,8 +5250,14 @@ var OutputFormatter;
|
|
|
4862
5250
|
}
|
|
4863
5251
|
const filter = getOutputFilter();
|
|
4864
5252
|
if (filter) {
|
|
4865
|
-
|
|
5253
|
+
let note;
|
|
5254
|
+
const filtered = applyFilter(data.Data, filter, (n) => {
|
|
5255
|
+
note = n;
|
|
5256
|
+
});
|
|
4866
5257
|
data.Data = normalize ? normalizeDataKeys(filtered, verbatim, subtrees && { refs: subtrees.refs, mode: "skip" }) : filtered;
|
|
5258
|
+
if (note) {
|
|
5259
|
+
data.Warning = appendWarning(data.Warning, note);
|
|
5260
|
+
}
|
|
4867
5261
|
}
|
|
4868
5262
|
logOutput(normalizeOutputKeys(data), getOutputFormat(), options?.tableRowStyle);
|
|
4869
5263
|
}
|
|
@@ -4891,12 +5285,13 @@ var OutputFormatter;
|
|
|
4891
5285
|
delete envelope.TelemetryErrorClass;
|
|
4892
5286
|
delete envelope.TelemetryTerminalOutcome;
|
|
4893
5287
|
delete envelope.TelemetryTerminalSignal;
|
|
5288
|
+
filterFailureData(envelope);
|
|
4894
5289
|
if (!suppressTelemetry) {
|
|
4895
5290
|
telemetry.trackEvent(CommonTelemetryEvents.Error, {
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
5291
|
+
[ErrorDimensions.Result]: data.Result,
|
|
5292
|
+
[ErrorDimensions.ErrorCode]: data.ErrorCode,
|
|
5293
|
+
[ErrorDimensions.Retry]: data.Retry,
|
|
5294
|
+
[ErrorDimensions.ErrorMessage]: data.Message
|
|
4900
5295
|
});
|
|
4901
5296
|
}
|
|
4902
5297
|
logOutput(normalizeOutputKeys(envelope), getOutputFormat());
|
|
@@ -4939,13 +5334,20 @@ var OutputFormatter;
|
|
|
4939
5334
|
OutputFormatter.log = log;
|
|
4940
5335
|
function formatToString(data) {
|
|
4941
5336
|
const filter = getOutputFilter();
|
|
5337
|
+
const envelope = data;
|
|
4942
5338
|
if ("Data" in data && data.Data != null) {
|
|
4943
5339
|
data.Data = normalizeDataKeys(data.Data);
|
|
4944
5340
|
if (filter) {
|
|
4945
|
-
|
|
5341
|
+
let note;
|
|
5342
|
+
data.Data = normalizeDataKeys(applyFilter(data.Data, filter, (n) => {
|
|
5343
|
+
note = n;
|
|
5344
|
+
}));
|
|
5345
|
+
if (note) {
|
|
5346
|
+
envelope.Warning = appendWarning(envelope.Warning, note);
|
|
5347
|
+
}
|
|
4946
5348
|
}
|
|
4947
5349
|
}
|
|
4948
|
-
const output = normalizeOutputKeys(
|
|
5350
|
+
const output = normalizeOutputKeys(envelope);
|
|
4949
5351
|
const lines = [];
|
|
4950
5352
|
const sink = getOutputSink();
|
|
4951
5353
|
printOutput(output, getOutputFormat(), (msg) => {
|
|
@@ -5002,7 +5404,7 @@ var LEGACY_SKILL_NAMESPACE = "uipath:";
|
|
|
5002
5404
|
var MAX_SKILL_NAME_LENGTH = 80;
|
|
5003
5405
|
var SKILL_NAME_PATTERN = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
|
|
5004
5406
|
function productMode(productArea, mode) {
|
|
5005
|
-
return {
|
|
5407
|
+
return { ProductArea: productArea, Mode: mode };
|
|
5006
5408
|
}
|
|
5007
5409
|
function attributionRecord(groups) {
|
|
5008
5410
|
const record = {};
|
|
@@ -5060,6 +5462,7 @@ var COMMAND_ATTRIBUTION = commandAttribution([
|
|
|
5060
5462
|
["rpa", "build", ["uip.rpa-legacy"]],
|
|
5061
5463
|
["conversational", "operate", ["uip.conversational"]],
|
|
5062
5464
|
["agents", "build", ["uip.codedagent", "uip.agent"]],
|
|
5465
|
+
["coding-agents", "build", ["uip.coder"]],
|
|
5063
5466
|
["agenthub", "build", ["uip.agenthub"]],
|
|
5064
5467
|
["coded-apps", "build", ["uip.codedapp"]],
|
|
5065
5468
|
["functions", "build", ["uip.function", "uip.functions"]],
|
|
@@ -5145,32 +5548,64 @@ function normalizeSkillName(value) {
|
|
|
5145
5548
|
function buildCommandTelemetryAttribution(commandPath, skillSource) {
|
|
5146
5549
|
const skillName = normalizeSkillName(skillSource);
|
|
5147
5550
|
return {
|
|
5148
|
-
...skillName ? {
|
|
5551
|
+
...skillName ? { SkillName: skillName } : {},
|
|
5149
5552
|
...getCommandProductModeAttribution(commandPath)
|
|
5150
5553
|
};
|
|
5151
5554
|
}
|
|
5555
|
+
var AGENT_SESSION_ENV = {
|
|
5556
|
+
[BaseDimensions.AgentModel]: "UIPATH_AGENT_MODEL",
|
|
5557
|
+
[SkillsDimensions.PermissionMode]: "UIPATH_PERMISSION_MODE",
|
|
5558
|
+
[SkillsDimensions.EffortLevel]: "UIPATH_EFFORT_LEVEL",
|
|
5559
|
+
[SkillsDimensions.SkillsVersion]: "UIPATH_SKILLS_VERSION"
|
|
5560
|
+
};
|
|
5561
|
+
var MAX_TELEMETRY_TOKEN_LENGTH = 120;
|
|
5562
|
+
function sanitizeTelemetryToken(value) {
|
|
5563
|
+
return value.replace(/[^A-Za-z0-9:._/ -]/g, "_").slice(0, MAX_TELEMETRY_TOKEN_LENGTH);
|
|
5564
|
+
}
|
|
5565
|
+
function buildAgentSessionTelemetry(env) {
|
|
5566
|
+
const dimensions = {};
|
|
5567
|
+
for (const [key, variable] of Object.entries(AGENT_SESSION_ENV)) {
|
|
5568
|
+
const value = env[variable]?.trim();
|
|
5569
|
+
if (value) {
|
|
5570
|
+
dimensions[key] = sanitizeTelemetryToken(value);
|
|
5571
|
+
}
|
|
5572
|
+
}
|
|
5573
|
+
return dimensions;
|
|
5574
|
+
}
|
|
5152
5575
|
|
|
5153
5576
|
// ../common/src/telemetry/command-name.ts
|
|
5154
|
-
var
|
|
5577
|
+
var TELEMETRY_NAME_ROOT = "Cli";
|
|
5578
|
+
var CLI_COMMAND_ROOT = "uip";
|
|
5579
|
+
var TELEMETRY_NAME_BARE_ACTION = "Invoke";
|
|
5155
5580
|
function commandTelemetryName(parts) {
|
|
5581
|
+
const action = vetCommandTokens(parts).map(pascalizeToken).join("");
|
|
5582
|
+
return `${TELEMETRY_NAME_ROOT}.${action || TELEMETRY_NAME_BARE_ACTION}`;
|
|
5583
|
+
}
|
|
5584
|
+
function commandInvocationPath(parts) {
|
|
5585
|
+
return [CLI_COMMAND_ROOT, ...vetCommandTokens(parts)].join(" ");
|
|
5586
|
+
}
|
|
5587
|
+
function vetCommandTokens(parts) {
|
|
5156
5588
|
const tokens = [];
|
|
5157
5589
|
for (const part of parts) {
|
|
5158
|
-
const pieces = String(part ?? "").split(/\s+/).filter((token) => token && !token.startsWith("-") && token !==
|
|
5590
|
+
const pieces = String(part ?? "").split(/\s+/).filter((token) => token && !token.startsWith("-") && token !== CLI_COMMAND_ROOT);
|
|
5159
5591
|
if (pieces.every(isCommandToken)) {
|
|
5160
5592
|
tokens.push(...pieces);
|
|
5161
5593
|
continue;
|
|
5162
5594
|
}
|
|
5163
5595
|
tokens.push(UNKNOWN_TOKEN);
|
|
5164
5596
|
}
|
|
5165
|
-
return
|
|
5597
|
+
return tokens;
|
|
5166
5598
|
}
|
|
5167
|
-
|
|
5599
|
+
function pascalizeToken(token) {
|
|
5600
|
+
return token.split("-").filter(Boolean).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join("");
|
|
5601
|
+
}
|
|
5602
|
+
var COMMAND_TOKEN_PATTERN = /^[a-z][a-z0-9-]*$/;
|
|
5168
5603
|
var MAX_COMMAND_TOKEN_LENGTH = 32;
|
|
5169
5604
|
var GUID_TOKEN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
|
|
5170
5605
|
function isCommandToken(token) {
|
|
5171
|
-
return token.length <= MAX_COMMAND_TOKEN_LENGTH && COMMAND_TOKEN_PATTERN.test(token) && !GUID_TOKEN.test(token)
|
|
5606
|
+
return token.length <= MAX_COMMAND_TOKEN_LENGTH && COMMAND_TOKEN_PATTERN.test(token) && !GUID_TOKEN.test(token);
|
|
5172
5607
|
}
|
|
5173
|
-
var UNKNOWN_TOKEN = "
|
|
5608
|
+
var UNKNOWN_TOKEN = "unknown";
|
|
5174
5609
|
|
|
5175
5610
|
// ../common/src/telemetry/invocation-request.ts
|
|
5176
5611
|
var requestContextSlot = singleton("TelemetryInvocationRequestContext");
|
|
@@ -5266,7 +5701,7 @@ function withheldArgumentValues(cmd) {
|
|
|
5266
5701
|
});
|
|
5267
5702
|
return values;
|
|
5268
5703
|
}
|
|
5269
|
-
function
|
|
5704
|
+
function deriveCommandParts(cmd) {
|
|
5270
5705
|
const parts = [];
|
|
5271
5706
|
let current = cmd;
|
|
5272
5707
|
while (current) {
|
|
@@ -5279,14 +5714,13 @@ function deriveCommandPath(cmd) {
|
|
|
5279
5714
|
if (parts.length > 1) {
|
|
5280
5715
|
parts.shift();
|
|
5281
5716
|
}
|
|
5282
|
-
return
|
|
5717
|
+
return parts;
|
|
5283
5718
|
}
|
|
5284
5719
|
function isErrorContext(value) {
|
|
5285
5720
|
return value !== null && typeof value === "object";
|
|
5286
5721
|
}
|
|
5287
5722
|
function commandHelpHint(commandPath) {
|
|
5288
|
-
|
|
5289
|
-
return `An unexpected error occurred. Run '${command} --help' to verify command syntax, or run with --log-level debug for details.`;
|
|
5723
|
+
return `An unexpected error occurred. Run '${commandPath} --help' to verify command syntax, or run with --log-level debug for details.`;
|
|
5290
5724
|
}
|
|
5291
5725
|
function isPromptCancellation(error) {
|
|
5292
5726
|
return error instanceof Error && error.name === "ExitPromptError";
|
|
@@ -5311,7 +5745,9 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
5311
5745
|
yaml: getOutputFormat() === "yaml",
|
|
5312
5746
|
filter: getOutputFilter() !== undefined
|
|
5313
5747
|
});
|
|
5314
|
-
const
|
|
5748
|
+
const commandParts = deriveCommandParts(command);
|
|
5749
|
+
const telemetryName = commandTelemetryName(commandParts);
|
|
5750
|
+
const commandPath = commandInvocationPath(commandParts);
|
|
5315
5751
|
const props = typeof properties === "function" ? properties(...args) : properties;
|
|
5316
5752
|
markCommandStart();
|
|
5317
5753
|
const supplied = recordSuppliedArgumentValues(withheldArgumentValues(command));
|
|
@@ -5346,7 +5782,7 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
5346
5782
|
Result: finalResult,
|
|
5347
5783
|
...customErrorCode ? { ErrorCode: customErrorCode } : {},
|
|
5348
5784
|
Message: errorMessage,
|
|
5349
|
-
Instructions: customInstructions ?? commandHelpHint(
|
|
5785
|
+
Instructions: customInstructions ?? commandHelpHint(commandPath),
|
|
5350
5786
|
...customRetry ? { Retry: customRetry } : {},
|
|
5351
5787
|
...customContext ? { Context: customContext } : {}
|
|
5352
5788
|
});
|
|
@@ -5363,8 +5799,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
5363
5799
|
recordedFailure,
|
|
5364
5800
|
pollSignal: context.pollSignal
|
|
5365
5801
|
});
|
|
5366
|
-
if (terminalTelemetry.
|
|
5367
|
-
telemetry.trackException(error instanceof Error ? error : new Error(String(error)), {
|
|
5802
|
+
if (terminalTelemetry[CommandDimensions.ErrorClass] === "internal" && error) {
|
|
5803
|
+
telemetry.trackException(error instanceof Error ? error : new Error(String(error)), { [CommandDimensions.CommandName]: commandPath }, getInvocationRequestContext());
|
|
5368
5804
|
}
|
|
5369
5805
|
const commandParams = extractCommandParams(command);
|
|
5370
5806
|
if (props) {
|
|
@@ -5375,10 +5811,12 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
5375
5811
|
const baseProperties = redactProperties({
|
|
5376
5812
|
...commandParams,
|
|
5377
5813
|
...props,
|
|
5378
|
-
...buildCommandTelemetryAttribution(
|
|
5379
|
-
|
|
5814
|
+
...buildCommandTelemetryAttribution(commandPath, process.env.UIPATH_SKILL),
|
|
5815
|
+
...buildAgentSessionTelemetry(process.env),
|
|
5816
|
+
[CommandDimensions.CommandName]: commandPath,
|
|
5817
|
+
[CommandDimensions.IsCommand]: "true",
|
|
5380
5818
|
...terminalTelemetry,
|
|
5381
|
-
...errorMessage ? { errorMessage } : {}
|
|
5819
|
+
...errorMessage ? { [CommandDimensions.ErrorMessage]: errorMessage } : {}
|
|
5382
5820
|
});
|
|
5383
5821
|
emitInvocationRequest(telemetryName, success, baseProperties);
|
|
5384
5822
|
} finally {
|
|
@@ -5614,6 +6052,40 @@ var BOOLEAN_FLAGS = new Set(HOST_GLOBAL_FLAGS);
|
|
|
5614
6052
|
// ../common/src/interactivity-context.ts
|
|
5615
6053
|
var modeSlot = singleton("InteractivityMode");
|
|
5616
6054
|
var interactiveFlagSlot = singleton("InteractiveFlag");
|
|
6055
|
+
// ../common/src/mime-types.ts
|
|
6056
|
+
var MIME_TYPES_BY_EXTENSION = Object.freeze({
|
|
6057
|
+
pdf: "application/pdf",
|
|
6058
|
+
png: "image/png",
|
|
6059
|
+
jpg: "image/jpeg",
|
|
6060
|
+
jpeg: "image/jpeg",
|
|
6061
|
+
gif: "image/gif",
|
|
6062
|
+
webp: "image/webp",
|
|
6063
|
+
bmp: "image/bmp",
|
|
6064
|
+
tif: "image/tiff",
|
|
6065
|
+
tiff: "image/tiff",
|
|
6066
|
+
svg: "image/svg+xml",
|
|
6067
|
+
txt: "text/plain",
|
|
6068
|
+
log: "text/plain",
|
|
6069
|
+
md: "text/markdown",
|
|
6070
|
+
csv: "text/csv",
|
|
6071
|
+
tsv: "text/tab-separated-values",
|
|
6072
|
+
json: "application/json",
|
|
6073
|
+
xml: "application/xml",
|
|
6074
|
+
html: "text/html",
|
|
6075
|
+
htm: "text/html",
|
|
6076
|
+
yaml: "application/yaml",
|
|
6077
|
+
yml: "application/yaml",
|
|
6078
|
+
doc: "application/msword",
|
|
6079
|
+
docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
6080
|
+
xls: "application/vnd.ms-excel",
|
|
6081
|
+
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
6082
|
+
ppt: "application/vnd.ms-powerpoint",
|
|
6083
|
+
pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
6084
|
+
zip: "application/zip",
|
|
6085
|
+
mp3: "audio/mpeg",
|
|
6086
|
+
wav: "audio/wav",
|
|
6087
|
+
mp4: "video/mp4"
|
|
6088
|
+
});
|
|
5617
6089
|
// ../common/src/polling/types.ts
|
|
5618
6090
|
var PollOutcome = {
|
|
5619
6091
|
Completed: "completed",
|
|
@@ -5659,6 +6131,7 @@ var ScreenLogger;
|
|
|
5659
6131
|
})(ScreenLogger ||= {});
|
|
5660
6132
|
// ../common/src/sdk-user-agent.ts
|
|
5661
6133
|
var USER_AGENT_HEADER = "User-Agent";
|
|
6134
|
+
var AGENT_PROPERTY = BaseDimensions.Agent;
|
|
5662
6135
|
var sdkUserAgentHostToken = singleton("SdkUserAgentHostToken");
|
|
5663
6136
|
function userAgentPatchKey(userAgent) {
|
|
5664
6137
|
return Symbol.for(`@uipath/common/sdk-user-agent/${userAgent}`);
|
|
@@ -6919,4 +7392,4 @@ function zipSync(data, opts) {
|
|
|
6919
7392
|
|
|
6920
7393
|
export { getSdkUserAgentToken, addSdkUserAgentHeader, installSdkUserAgentHeader, catchError, extractErrorMessage, logger, RESULTS, summarizePlatformBody, isGuid, normalizeProjectType, toPortableRelativePath, readUipxFile, createSolutionManifest, autoScaffoldSolution, prepareProjectLocation, resolveSolutionDir, updateUipxSolutionId, findSolutionFile, updateSolutionFile, tryRegisterProjectInParentSolution, findNearestParentUipxFile, readSolutionManifest, isProjectRegisteredInSolution, findSolutionFileUpward, zipSync };
|
|
6921
7394
|
|
|
6922
|
-
//# debugId=
|
|
7395
|
+
//# debugId=5285F9D90740747F64756E2164756E21
|