@uipath/aops-tool 1.203.0-preview.205 → 1.204.0-preview.206
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 +1 -1
- package/dist/{tool-pa4qktap.js → tool-db3svht2.js} +589 -99
- package/dist/tool.js +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2101,7 +2101,7 @@ var package_default = {
|
|
|
2101
2101
|
name: "@uipath/aops-tool",
|
|
2102
2102
|
author: "UiPath",
|
|
2103
2103
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
2104
|
-
version: "1.
|
|
2104
|
+
version: "1.204.0-preview.206",
|
|
2105
2105
|
description: "Manage UiPath StudioAdmin AOps — connections, repos, projects, solutions, pipelines, executions.",
|
|
2106
2106
|
private: false,
|
|
2107
2107
|
repository: {
|
|
@@ -2912,9 +2912,60 @@ function settlePromiseLike(thenable) {
|
|
|
2912
2912
|
return Promise.resolve(thenable).then((data) => [undefined, data]).catch((error) => [toError(error), undefined]);
|
|
2913
2913
|
}
|
|
2914
2914
|
|
|
2915
|
+
// ../common/src/error-graph.ts
|
|
2916
|
+
function* walkErrorGraph(error) {
|
|
2917
|
+
const queue = [error];
|
|
2918
|
+
const seen = new Set;
|
|
2919
|
+
for (let steps = 0;queue.length > 0 && steps < 32; steps++) {
|
|
2920
|
+
const current = queue.shift();
|
|
2921
|
+
if (current === null || typeof current !== "object")
|
|
2922
|
+
continue;
|
|
2923
|
+
if (seen.has(current))
|
|
2924
|
+
continue;
|
|
2925
|
+
seen.add(current);
|
|
2926
|
+
const cur = current;
|
|
2927
|
+
yield cur;
|
|
2928
|
+
if (cur.cause !== undefined)
|
|
2929
|
+
queue.push(cur.cause);
|
|
2930
|
+
if (Array.isArray(cur.errors))
|
|
2931
|
+
queue.push(...cur.errors);
|
|
2932
|
+
}
|
|
2933
|
+
return;
|
|
2934
|
+
}
|
|
2935
|
+
function parseHttpStatusFromMessage(message) {
|
|
2936
|
+
const match = /^HTTP\s+(\d{3})(?::|\s|-|$)/i.exec(message.trim());
|
|
2937
|
+
if (!match)
|
|
2938
|
+
return;
|
|
2939
|
+
const status = Number(match[1]);
|
|
2940
|
+
return Number.isInteger(status) && status >= 100 && status <= 599 ? status : undefined;
|
|
2941
|
+
}
|
|
2942
|
+
function findHttpStatusInGraph(error) {
|
|
2943
|
+
for (const node of walkErrorGraph(error)) {
|
|
2944
|
+
const response = node.response;
|
|
2945
|
+
const explicit = typeof node.status === "number" ? node.status : response?.status;
|
|
2946
|
+
if (typeof explicit === "number" && explicit >= 400 && explicit <= 599) {
|
|
2947
|
+
return explicit;
|
|
2948
|
+
}
|
|
2949
|
+
if (typeof node.message === "string") {
|
|
2950
|
+
const parsed = parseHttpStatusFromMessage(node.message);
|
|
2951
|
+
if (parsed !== undefined && parsed >= 400) {
|
|
2952
|
+
return parsed;
|
|
2953
|
+
}
|
|
2954
|
+
}
|
|
2955
|
+
}
|
|
2956
|
+
return;
|
|
2957
|
+
}
|
|
2958
|
+
|
|
2959
|
+
// ../common/src/local-permission-codes.ts
|
|
2960
|
+
var LOCAL_PERMISSION_ERROR_CODES = new Set([
|
|
2961
|
+
"EACCES",
|
|
2962
|
+
"EPERM",
|
|
2963
|
+
"EROFS"
|
|
2964
|
+
]);
|
|
2965
|
+
|
|
2915
2966
|
// ../common/src/error-handler.ts
|
|
2916
|
-
var DEFAULT_401 = "Unauthorized (401). Run `uip login` to
|
|
2917
|
-
var DEFAULT_403 = "Forbidden (403).
|
|
2967
|
+
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.";
|
|
2968
|
+
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.";
|
|
2918
2969
|
var DEFAULT_405 = "Method Not Allowed (405). The endpoint may not exist or the base URL may be incorrect.";
|
|
2919
2970
|
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.";
|
|
2920
2971
|
var HTML_RESPONSE_MESSAGE = "Received HTML instead of the expected JSON response.";
|
|
@@ -2941,14 +2992,14 @@ var TLS_ERROR_CODES = new Set([
|
|
|
2941
2992
|
]);
|
|
2942
2993
|
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.";
|
|
2943
2994
|
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.";
|
|
2944
|
-
var
|
|
2945
|
-
var LOCAL_PERMISSION_MESSAGE_PATTERN = /\b(EACCES|EPERM|EROFS)\b/;
|
|
2995
|
+
var LOCAL_PERMISSION_MESSAGE_PATTERN = new RegExp(`\\b(${[...LOCAL_PERMISSION_ERROR_CODES].join("|")})\\b`);
|
|
2946
2996
|
function localPermissionInstructions(code, path2) {
|
|
2947
2997
|
const target = path2 !== undefined ? `'${path2}'` : "a local file or resource";
|
|
2948
2998
|
if (code === "EROFS") {
|
|
2949
2999
|
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.";
|
|
2950
3000
|
}
|
|
2951
|
-
const
|
|
3001
|
+
const onWindows = typeof process !== "undefined" && process.platform === "win32";
|
|
3002
|
+
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.";
|
|
2952
3003
|
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}`;
|
|
2953
3004
|
}
|
|
2954
3005
|
function describeConnectivityError(error) {
|
|
@@ -3002,48 +3053,6 @@ function localPermissionPath(path2, message) {
|
|
|
3002
3053
|
return path2;
|
|
3003
3054
|
return message ? /'([^']+)'/.exec(message)?.[1] : undefined;
|
|
3004
3055
|
}
|
|
3005
|
-
function* walkErrorGraph(error) {
|
|
3006
|
-
const queue = [error];
|
|
3007
|
-
const seen = new Set;
|
|
3008
|
-
for (let steps = 0;queue.length > 0 && steps < 32; steps++) {
|
|
3009
|
-
const current = queue.shift();
|
|
3010
|
-
if (current === null || typeof current !== "object")
|
|
3011
|
-
continue;
|
|
3012
|
-
if (seen.has(current))
|
|
3013
|
-
continue;
|
|
3014
|
-
seen.add(current);
|
|
3015
|
-
const cur = current;
|
|
3016
|
-
yield cur;
|
|
3017
|
-
if (cur.cause !== undefined)
|
|
3018
|
-
queue.push(cur.cause);
|
|
3019
|
-
if (Array.isArray(cur.errors))
|
|
3020
|
-
queue.push(...cur.errors);
|
|
3021
|
-
}
|
|
3022
|
-
return;
|
|
3023
|
-
}
|
|
3024
|
-
function parseHttpStatusFromMessage(message) {
|
|
3025
|
-
const match = /^HTTP\s+(\d{3})(?::|\s|-|$)/i.exec(message.trim());
|
|
3026
|
-
if (!match)
|
|
3027
|
-
return;
|
|
3028
|
-
const status = Number(match[1]);
|
|
3029
|
-
return Number.isInteger(status) && status >= 100 && status <= 599 ? status : undefined;
|
|
3030
|
-
}
|
|
3031
|
-
function findHttpStatusInGraph(error) {
|
|
3032
|
-
for (const node of walkErrorGraph(error)) {
|
|
3033
|
-
const response = node.response;
|
|
3034
|
-
const explicit = typeof node.status === "number" ? node.status : response?.status;
|
|
3035
|
-
if (typeof explicit === "number" && explicit >= 400 && explicit <= 599) {
|
|
3036
|
-
return explicit;
|
|
3037
|
-
}
|
|
3038
|
-
if (typeof node.message === "string") {
|
|
3039
|
-
const parsed = parseHttpStatusFromMessage(node.message);
|
|
3040
|
-
if (parsed !== undefined && parsed >= 400) {
|
|
3041
|
-
return parsed;
|
|
3042
|
-
}
|
|
3043
|
-
}
|
|
3044
|
-
}
|
|
3045
|
-
return;
|
|
3046
|
-
}
|
|
3047
3056
|
function isHtmlDocument(body) {
|
|
3048
3057
|
return /^\s*(<!doctype html|<html\b)/i.test(body);
|
|
3049
3058
|
}
|
|
@@ -3565,12 +3574,162 @@ function getOutputFilter() {
|
|
|
3565
3574
|
return filterSlot.get();
|
|
3566
3575
|
}
|
|
3567
3576
|
|
|
3577
|
+
// ../common/src/telemetry/telemetry-dimensions.ts
|
|
3578
|
+
var BaseDimensions = {
|
|
3579
|
+
ApplicationName: "ApplicationName",
|
|
3580
|
+
ProductVersion: "ProductVersion",
|
|
3581
|
+
InstallationId: "InstallationId",
|
|
3582
|
+
CloudUserId: "CloudUserId",
|
|
3583
|
+
CloudTenantId: "CloudTenantId",
|
|
3584
|
+
CloudOrganizationId: "CloudOrganizationId",
|
|
3585
|
+
IsInternalUser: "IsInternalUser",
|
|
3586
|
+
Environment: "Environment",
|
|
3587
|
+
BaseUrl: "BaseUrl",
|
|
3588
|
+
Region: "Region",
|
|
3589
|
+
Agent: "Agent",
|
|
3590
|
+
AgentVersion: "AgentVersion",
|
|
3591
|
+
AgentModel: "AgentModel",
|
|
3592
|
+
ToolName: "ToolName",
|
|
3593
|
+
ToolVersion: "ToolVersion",
|
|
3594
|
+
ExecutionContext: "ExecutionContext",
|
|
3595
|
+
CiProvider: "CiProvider",
|
|
3596
|
+
SessionIdSource: "SessionIdSource",
|
|
3597
|
+
SessionId: "SessionId"
|
|
3598
|
+
};
|
|
3599
|
+
var CommandDimensions = {
|
|
3600
|
+
IsCommand: "IsCommand",
|
|
3601
|
+
IsReexec: "IsReexec",
|
|
3602
|
+
CommandName: "CommandName",
|
|
3603
|
+
ExitCode: "ExitCode",
|
|
3604
|
+
TerminalOutcome: "TerminalOutcome",
|
|
3605
|
+
ErrorClass: "ErrorClass",
|
|
3606
|
+
TerminalSignal: "TerminalSignal",
|
|
3607
|
+
ErrorMessage: "ErrorMessage",
|
|
3608
|
+
SkillName: "SkillName",
|
|
3609
|
+
ProductArea: "ProductArea",
|
|
3610
|
+
Mode: "Mode"
|
|
3611
|
+
};
|
|
3612
|
+
var ShipDimensions = {
|
|
3613
|
+
ShipKind: "ShipKind",
|
|
3614
|
+
Target: "Target",
|
|
3615
|
+
ProjectType: "ProjectType",
|
|
3616
|
+
ProjectTypes: "ProjectTypes",
|
|
3617
|
+
ArtifactCorrelationKey: "ArtifactCorrelationKey",
|
|
3618
|
+
PackageName: "PackageName",
|
|
3619
|
+
PackageVersion: "PackageVersion",
|
|
3620
|
+
PackageVersionKey: "PackageVersionKey",
|
|
3621
|
+
DeploymentKey: "DeploymentKey",
|
|
3622
|
+
SolutionId: "SolutionId",
|
|
3623
|
+
FolderKey: "FolderKey",
|
|
3624
|
+
FeedId: "FeedId"
|
|
3625
|
+
};
|
|
3626
|
+
var ErrorDimensions = {
|
|
3627
|
+
Result: "Result",
|
|
3628
|
+
ErrorCode: "ErrorCode",
|
|
3629
|
+
Retry: "Retry",
|
|
3630
|
+
ErrorMessage: "ErrorMessage"
|
|
3631
|
+
};
|
|
3632
|
+
var AuthDimensions = {
|
|
3633
|
+
AuthenticationMethod: "AuthenticationMethod",
|
|
3634
|
+
Success: "Success",
|
|
3635
|
+
Reason: "Reason"
|
|
3636
|
+
};
|
|
3637
|
+
var SkillsDimensions = {
|
|
3638
|
+
SchemaVersion: "SchemaVersion",
|
|
3639
|
+
AgentType: "AgentType",
|
|
3640
|
+
SkillsVersion: "SkillsVersion",
|
|
3641
|
+
UipSubcommand: "UipSubcommand",
|
|
3642
|
+
FileExtension: "FileExtension",
|
|
3643
|
+
SubagentModel: "SubagentModel",
|
|
3644
|
+
SubagentType: "SubagentType",
|
|
3645
|
+
PermissionMode: "PermissionMode",
|
|
3646
|
+
EffortLevel: "EffortLevel",
|
|
3647
|
+
SessionSource: "SessionSource",
|
|
3648
|
+
Outcome: "Outcome",
|
|
3649
|
+
DurationMs: "DurationMs",
|
|
3650
|
+
Source: "Source"
|
|
3651
|
+
};
|
|
3652
|
+
var PackagerDimensions = {
|
|
3653
|
+
ProjectId: "ProjectId",
|
|
3654
|
+
ProjectType: "ProjectType",
|
|
3655
|
+
SolutionId: "SolutionId"
|
|
3656
|
+
};
|
|
3657
|
+
var ScopeDimensions = {
|
|
3658
|
+
FolderId: "FolderId"
|
|
3659
|
+
};
|
|
3660
|
+
var ID_DIMENSIONS = new Set([
|
|
3661
|
+
BaseDimensions.CloudUserId,
|
|
3662
|
+
BaseDimensions.CloudTenantId,
|
|
3663
|
+
BaseDimensions.CloudOrganizationId,
|
|
3664
|
+
BaseDimensions.InstallationId,
|
|
3665
|
+
ShipDimensions.ArtifactCorrelationKey,
|
|
3666
|
+
ShipDimensions.PackageVersionKey,
|
|
3667
|
+
ShipDimensions.DeploymentKey,
|
|
3668
|
+
ShipDimensions.SolutionId,
|
|
3669
|
+
ShipDimensions.FolderKey,
|
|
3670
|
+
ShipDimensions.FeedId,
|
|
3671
|
+
PackagerDimensions.ProjectId
|
|
3672
|
+
]);
|
|
3673
|
+
var NON_IDENTIFIER_PLACEHOLDER_PATTERN = /^(?:\[[A-Z_]+\]|<[^>]+>)$/;
|
|
3674
|
+
var RESERVED_DIMENSION_NAMES = new Set([
|
|
3675
|
+
...Object.values(BaseDimensions),
|
|
3676
|
+
...Object.values(CommandDimensions),
|
|
3677
|
+
...Object.values(ShipDimensions),
|
|
3678
|
+
...Object.values(ErrorDimensions),
|
|
3679
|
+
...Object.values(AuthDimensions),
|
|
3680
|
+
...Object.values(SkillsDimensions),
|
|
3681
|
+
...Object.values(PackagerDimensions),
|
|
3682
|
+
...Object.values(ScopeDimensions)
|
|
3683
|
+
]);
|
|
3684
|
+
var CURATED_DIMENSIONS = new Set([
|
|
3685
|
+
BaseDimensions.ApplicationName,
|
|
3686
|
+
BaseDimensions.ProductVersion,
|
|
3687
|
+
BaseDimensions.InstallationId,
|
|
3688
|
+
BaseDimensions.CloudUserId,
|
|
3689
|
+
BaseDimensions.CloudTenantId,
|
|
3690
|
+
BaseDimensions.CloudOrganizationId,
|
|
3691
|
+
BaseDimensions.IsInternalUser,
|
|
3692
|
+
BaseDimensions.Environment,
|
|
3693
|
+
BaseDimensions.BaseUrl,
|
|
3694
|
+
BaseDimensions.Region,
|
|
3695
|
+
BaseDimensions.Agent,
|
|
3696
|
+
BaseDimensions.AgentVersion,
|
|
3697
|
+
BaseDimensions.ToolVersion,
|
|
3698
|
+
BaseDimensions.ExecutionContext,
|
|
3699
|
+
BaseDimensions.CiProvider,
|
|
3700
|
+
BaseDimensions.SessionIdSource,
|
|
3701
|
+
BaseDimensions.SessionId,
|
|
3702
|
+
...Object.values(CommandDimensions),
|
|
3703
|
+
...Object.values(ShipDimensions)
|
|
3704
|
+
]);
|
|
3705
|
+
function lowercaseIdDimensionValues(properties) {
|
|
3706
|
+
let changed = false;
|
|
3707
|
+
const result = {
|
|
3708
|
+
...properties
|
|
3709
|
+
};
|
|
3710
|
+
for (const key of Object.keys(result)) {
|
|
3711
|
+
const value = result[key];
|
|
3712
|
+
if (!ID_DIMENSIONS.has(key) || typeof value !== "string" || NON_IDENTIFIER_PLACEHOLDER_PATTERN.test(value)) {
|
|
3713
|
+
continue;
|
|
3714
|
+
}
|
|
3715
|
+
const lowered = value.toLowerCase();
|
|
3716
|
+
if (lowered !== value) {
|
|
3717
|
+
result[key] = lowered;
|
|
3718
|
+
changed = true;
|
|
3719
|
+
}
|
|
3720
|
+
}
|
|
3721
|
+
return changed ? result : properties;
|
|
3722
|
+
}
|
|
3723
|
+
|
|
3568
3724
|
// ../common/src/telemetry/command-terminal.ts
|
|
3569
3725
|
var recordedFailureSlot = singleton("CommandTelemetryFailure");
|
|
3570
3726
|
var AUTH_ERROR_CODES = new Set([
|
|
3571
3727
|
"authentication_required",
|
|
3572
3728
|
"permission_denied"
|
|
3573
3729
|
]);
|
|
3730
|
+
var LOCAL_PERMISSION_CLI_ERROR_CODES = new Set([
|
|
3731
|
+
"local_permission_denied"
|
|
3732
|
+
]);
|
|
3574
3733
|
var VALIDATION_ERROR_CODES = new Set(["invalid_argument"]);
|
|
3575
3734
|
var NETWORK_HTTP_ERROR_CODES = new Set([
|
|
3576
3735
|
"network_error",
|
|
@@ -3711,6 +3870,9 @@ function classifyFromErrorCode(errorCode) {
|
|
|
3711
3870
|
if (AUTH_ERROR_CODES.has(errorCode)) {
|
|
3712
3871
|
return "auth";
|
|
3713
3872
|
}
|
|
3873
|
+
if (LOCAL_PERMISSION_CLI_ERROR_CODES.has(errorCode)) {
|
|
3874
|
+
return "local_permission";
|
|
3875
|
+
}
|
|
3714
3876
|
if (VALIDATION_ERROR_CODES.has(errorCode)) {
|
|
3715
3877
|
return "validation";
|
|
3716
3878
|
}
|
|
@@ -3722,6 +3884,15 @@ function classifyFromErrorCode(errorCode) {
|
|
|
3722
3884
|
}
|
|
3723
3885
|
return;
|
|
3724
3886
|
}
|
|
3887
|
+
function hasLocalPermissionCode(error) {
|
|
3888
|
+
for (const node of walkErrorGraph(error)) {
|
|
3889
|
+
const code = node.code;
|
|
3890
|
+
if (typeof code === "string" && LOCAL_PERMISSION_ERROR_CODES.has(code)) {
|
|
3891
|
+
return true;
|
|
3892
|
+
}
|
|
3893
|
+
}
|
|
3894
|
+
return false;
|
|
3895
|
+
}
|
|
3725
3896
|
function classifyFromError(error) {
|
|
3726
3897
|
const code = findCodeInCauseChain(error);
|
|
3727
3898
|
if (code) {
|
|
@@ -3738,6 +3909,9 @@ function classifyFromError(error) {
|
|
|
3738
3909
|
return "missing_dependency";
|
|
3739
3910
|
}
|
|
3740
3911
|
}
|
|
3912
|
+
if (hasLocalPermissionCode(error)) {
|
|
3913
|
+
return "local_permission";
|
|
3914
|
+
}
|
|
3741
3915
|
const message = stringField(error, "message");
|
|
3742
3916
|
if (message?.includes("fetch failed") === true) {
|
|
3743
3917
|
return "network_http";
|
|
@@ -3753,7 +3927,7 @@ function classifyError2(input) {
|
|
|
3753
3927
|
if (recorded?.errorClass) {
|
|
3754
3928
|
return recorded.errorClass;
|
|
3755
3929
|
}
|
|
3756
|
-
const status = recorded?.context?.httpStatus;
|
|
3930
|
+
const status = recorded?.context?.httpStatus ?? findHttpStatusInGraph(input.error);
|
|
3757
3931
|
if (status !== undefined) {
|
|
3758
3932
|
return classifyHttpStatus(status);
|
|
3759
3933
|
}
|
|
@@ -3776,17 +3950,18 @@ function buildCommandTerminalTelemetryProperties(input) {
|
|
|
3776
3950
|
const errorClass = outcome === "success" || outcome === "no_op" ? undefined : outcome === "cancelled" ? "user_cancelled" : classifyError2(input);
|
|
3777
3951
|
const terminalSignal = terminalSignalFor(input, outcome);
|
|
3778
3952
|
return {
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
...errorClass ? {
|
|
3782
|
-
...terminalSignal ? {
|
|
3953
|
+
[CommandDimensions.ExitCode]: input.exitCode,
|
|
3954
|
+
[CommandDimensions.TerminalOutcome]: outcome,
|
|
3955
|
+
...errorClass ? { [CommandDimensions.ErrorClass]: errorClass } : {},
|
|
3956
|
+
...terminalSignal ? { [CommandDimensions.TerminalSignal]: terminalSignal } : {}
|
|
3783
3957
|
};
|
|
3784
3958
|
}
|
|
3785
3959
|
|
|
3786
3960
|
// ../common/src/telemetry/telemetry-events.ts
|
|
3787
3961
|
var CommonTelemetryEvents = {
|
|
3788
|
-
|
|
3789
|
-
|
|
3962
|
+
Start: "Application.Start",
|
|
3963
|
+
Error: "Application.Error",
|
|
3964
|
+
ShipSucceeded: "Cli.ShipSucceeded"
|
|
3790
3965
|
};
|
|
3791
3966
|
|
|
3792
3967
|
// ../common/src/registry.ts
|
|
@@ -3994,8 +4169,8 @@ function detectExecutionContext(options = {}) {
|
|
|
3994
4169
|
function getExecutionContextTelemetryProperties() {
|
|
3995
4170
|
const detected = detectExecutionContext();
|
|
3996
4171
|
return {
|
|
3997
|
-
|
|
3998
|
-
...detected.ciProvider ? {
|
|
4172
|
+
[BaseDimensions.ExecutionContext]: detected.executionContext,
|
|
4173
|
+
...detected.ciProvider ? { [BaseDimensions.CiProvider]: detected.ciProvider } : {}
|
|
3999
4174
|
};
|
|
4000
4175
|
}
|
|
4001
4176
|
// ../common/src/telemetry/node-context-storage.ts
|
|
@@ -4038,7 +4213,7 @@ function getInboundTraceContext() {
|
|
|
4038
4213
|
var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
|
|
4039
4214
|
var SESSION_ID_MAX_LENGTH = 64;
|
|
4040
4215
|
var RANDOM_SESSION_ID_LENGTH = 32;
|
|
4041
|
-
var TELEMETRY_SESSION_SOURCE_PROPERTY = "
|
|
4216
|
+
var TELEMETRY_SESSION_SOURCE_PROPERTY = "SessionIdSource";
|
|
4042
4217
|
var CONTROL_CHARACTERS = /\p{Cc}/gu;
|
|
4043
4218
|
var INHERITED_SESSION_SOURCES = [
|
|
4044
4219
|
{ envVar: "CLAUDE_CODE_SESSION_ID", source: "claude-code" },
|
|
@@ -4090,6 +4265,9 @@ function resolveTelemetrySession() {
|
|
|
4090
4265
|
telemetrySessionSlot.set(resolved);
|
|
4091
4266
|
return resolved;
|
|
4092
4267
|
}
|
|
4268
|
+
function getTelemetrySessionId() {
|
|
4269
|
+
return resolveTelemetrySession().id;
|
|
4270
|
+
}
|
|
4093
4271
|
function getTelemetrySessionSource() {
|
|
4094
4272
|
return resolveTelemetrySession().source;
|
|
4095
4273
|
}
|
|
@@ -4170,7 +4348,10 @@ class TelemetryService {
|
|
|
4170
4348
|
} catch (error) {
|
|
4171
4349
|
const durationMs = clock.elapsedMs();
|
|
4172
4350
|
const err = error instanceof Error ? error : new Error(String(error));
|
|
4173
|
-
await this.telemetryProvider.trackRequest(this.spanFor(name, durationMs, false, {
|
|
4351
|
+
await this.telemetryProvider.trackRequest(this.spanFor(name, durationMs, false, {
|
|
4352
|
+
...properties,
|
|
4353
|
+
[CommandDimensions.ErrorMessage]: err.message
|
|
4354
|
+
}, context));
|
|
4174
4355
|
throw error;
|
|
4175
4356
|
}
|
|
4176
4357
|
}
|
|
@@ -4241,7 +4422,10 @@ class TelemetryService {
|
|
|
4241
4422
|
const durationMs = clock.elapsedMs();
|
|
4242
4423
|
const err = error instanceof Error ? error : new Error(String(error));
|
|
4243
4424
|
await this.telemetryProvider.trackDependency({
|
|
4244
|
-
...this.spanFor(name, durationMs, false, {
|
|
4425
|
+
...this.spanFor(name, durationMs, false, {
|
|
4426
|
+
...properties,
|
|
4427
|
+
[CommandDimensions.ErrorMessage]: err.message
|
|
4428
|
+
}, childContext),
|
|
4245
4429
|
type
|
|
4246
4430
|
});
|
|
4247
4431
|
throw error;
|
|
@@ -4276,9 +4460,10 @@ class TelemetryService {
|
|
|
4276
4460
|
...globalProperties,
|
|
4277
4461
|
...this.defaultProperties,
|
|
4278
4462
|
...redactProperties(properties ?? {}),
|
|
4279
|
-
[TELEMETRY_SESSION_SOURCE_PROPERTY]: getTelemetrySessionSource()
|
|
4463
|
+
[TELEMETRY_SESSION_SOURCE_PROPERTY]: getTelemetrySessionSource(),
|
|
4464
|
+
[BaseDimensions.SessionId]: this.telemetryProvider.getSessionId?.() ?? getTelemetrySessionId()
|
|
4280
4465
|
};
|
|
4281
|
-
return enriched;
|
|
4466
|
+
return lowercaseIdDimensionValues(enriched);
|
|
4282
4467
|
}
|
|
4283
4468
|
generateId() {
|
|
4284
4469
|
const bytes = new Uint8Array(8);
|
|
@@ -5039,7 +5224,165 @@ class FilterImplicitLimitError extends Error {
|
|
|
5039
5224
|
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).";
|
|
5040
5225
|
}
|
|
5041
5226
|
}
|
|
5042
|
-
function
|
|
5227
|
+
function countRecords(data) {
|
|
5228
|
+
if (Array.isArray(data))
|
|
5229
|
+
return data.length;
|
|
5230
|
+
return data == null ? 0 : 1;
|
|
5231
|
+
}
|
|
5232
|
+
function availableFields(data) {
|
|
5233
|
+
const records = Array.isArray(data) ? data : [data];
|
|
5234
|
+
const keys = new Set;
|
|
5235
|
+
for (const record of records) {
|
|
5236
|
+
if (record && typeof record === "object" && !Array.isArray(record)) {
|
|
5237
|
+
for (const key of Object.keys(record))
|
|
5238
|
+
keys.add(key);
|
|
5239
|
+
}
|
|
5240
|
+
}
|
|
5241
|
+
return [...keys];
|
|
5242
|
+
}
|
|
5243
|
+
function decodeQuotedIdentifier(whole, inner) {
|
|
5244
|
+
const [error, decoded] = catchError(() => JSON.parse(whole));
|
|
5245
|
+
if (!error && typeof decoded === "string")
|
|
5246
|
+
return decoded;
|
|
5247
|
+
return inner.replace(/\\(.)/g, "$1");
|
|
5248
|
+
}
|
|
5249
|
+
function referencedFields(filter) {
|
|
5250
|
+
const top = new Set;
|
|
5251
|
+
const nested = new Set;
|
|
5252
|
+
const withoutValueLiterals = filter.replace(/'(?:\\.|[^'\\])*'/g, " ").replace(/`(?:\\.|[^`\\])*`/g, " ");
|
|
5253
|
+
const isPathTail = (text, index) => text[index - 1] === "." && /[A-Za-z0-9_"]/.test(text[index - 2] ?? "");
|
|
5254
|
+
const quoted = [];
|
|
5255
|
+
const withoutLiterals = withoutValueLiterals.replace(/"((?:\\.|[^"\\])*)"/g, (whole, name, index) => {
|
|
5256
|
+
const isAlias = /^\s*:/.test(withoutValueLiterals.slice(index + whole.length));
|
|
5257
|
+
if (!isAlias) {
|
|
5258
|
+
quoted.push({
|
|
5259
|
+
name: decodeQuotedIdentifier(whole, name),
|
|
5260
|
+
index,
|
|
5261
|
+
tail: isPathTail(withoutValueLiterals, index)
|
|
5262
|
+
});
|
|
5263
|
+
}
|
|
5264
|
+
return `"${" ".repeat(whole.length - 2)}"`;
|
|
5265
|
+
});
|
|
5266
|
+
const descent = /[A-Za-z0-9_"]\s*[.[]/.exec(withoutLiterals);
|
|
5267
|
+
const rootEnd = descent ? descent.index + 1 : Number.POSITIVE_INFINITY;
|
|
5268
|
+
const place = (name, index, tail) => {
|
|
5269
|
+
if (tail || index >= rootEnd)
|
|
5270
|
+
nested.add(name);
|
|
5271
|
+
else
|
|
5272
|
+
top.add(name);
|
|
5273
|
+
};
|
|
5274
|
+
for (const entry of quoted)
|
|
5275
|
+
place(entry.name, entry.index, entry.tail);
|
|
5276
|
+
const identifiers = withoutLiterals.matchAll(/([A-Za-z_][A-Za-z0-9_]*)(\s*[:(])?/g);
|
|
5277
|
+
const reserved = new Set(["true", "false", "null", "and", "or", "not"]);
|
|
5278
|
+
for (const match of identifiers) {
|
|
5279
|
+
const [, name, trailing] = match;
|
|
5280
|
+
if (trailing || reserved.has(name))
|
|
5281
|
+
continue;
|
|
5282
|
+
place(name, match.index, isPathTail(withoutLiterals, match.index));
|
|
5283
|
+
}
|
|
5284
|
+
return {
|
|
5285
|
+
top: [...top],
|
|
5286
|
+
nested: [...nested].filter((name) => !top.has(name)),
|
|
5287
|
+
hasPredicate: /\[\s*\?/.test(withoutValueLiterals)
|
|
5288
|
+
};
|
|
5289
|
+
}
|
|
5290
|
+
function appearsBelowTopLevel(data, name) {
|
|
5291
|
+
let budget = 2000;
|
|
5292
|
+
const visit = (value, depth) => {
|
|
5293
|
+
if (budget-- <= 0 || depth > 4)
|
|
5294
|
+
return false;
|
|
5295
|
+
if (value === null || typeof value !== "object")
|
|
5296
|
+
return false;
|
|
5297
|
+
if (Array.isArray(value))
|
|
5298
|
+
return value.some((entry) => visit(entry, depth));
|
|
5299
|
+
const record = value;
|
|
5300
|
+
if (depth > 0 && Object.hasOwn(record, name))
|
|
5301
|
+
return true;
|
|
5302
|
+
return Object.values(record).some((entry) => visit(entry, depth + 1));
|
|
5303
|
+
};
|
|
5304
|
+
return visit(data, 0);
|
|
5305
|
+
}
|
|
5306
|
+
function alwaysNullKeys(records) {
|
|
5307
|
+
const objects = records.filter((r) => r != null && typeof r === "object" && !Array.isArray(r));
|
|
5308
|
+
if (objects.length === 0 || objects.length !== records.length)
|
|
5309
|
+
return [];
|
|
5310
|
+
const keys = [...new Set(objects.flatMap((o) => Object.keys(o)))];
|
|
5311
|
+
if (keys.length === 0)
|
|
5312
|
+
return [];
|
|
5313
|
+
const nullKeys = keys.filter((key) => objects.every((record) => record[key] === null));
|
|
5314
|
+
return nullKeys.length === keys.length ? nullKeys : [];
|
|
5315
|
+
}
|
|
5316
|
+
function carriesOnlyNulls(value) {
|
|
5317
|
+
if (value === null)
|
|
5318
|
+
return true;
|
|
5319
|
+
if (Array.isArray(value)) {
|
|
5320
|
+
return value.length > 0 && value.every(carriesOnlyNulls);
|
|
5321
|
+
}
|
|
5322
|
+
if (typeof value === "object" && value !== undefined) {
|
|
5323
|
+
const values = Object.values(value);
|
|
5324
|
+
return values.length > 0 && values.every(carriesOnlyNulls);
|
|
5325
|
+
}
|
|
5326
|
+
return false;
|
|
5327
|
+
}
|
|
5328
|
+
function nameList(names, cap2 = 12) {
|
|
5329
|
+
const shown = names.slice(0, cap2).map((n) => `\`${n}\``);
|
|
5330
|
+
const rest = names.length - shown.length;
|
|
5331
|
+
return shown.join(", ") + (rest > 0 ? `, and ${rest} more` : "");
|
|
5332
|
+
}
|
|
5333
|
+
function buildFilterWarning(filter, data, outcome) {
|
|
5334
|
+
const present = availableFields(data);
|
|
5335
|
+
const refs = referencedFields(filter);
|
|
5336
|
+
const unknown = refs.top.filter((name) => !present.includes(name) && !appearsBelowTopLevel(data, name));
|
|
5337
|
+
const unchecked = refs.nested.filter((name) => !present.includes(name));
|
|
5338
|
+
const count = countRecords(data);
|
|
5339
|
+
const scope = `${count} record(s)`;
|
|
5340
|
+
const isNotAField = (names) => `${nameList(names)} ${names.length === 1 ? "is not a field" : "are not fields"} on the ${scope} it read`;
|
|
5341
|
+
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" : "";
|
|
5342
|
+
const withSoundness = (base) => soundness ? `${base}, and ${soundness}` : base;
|
|
5343
|
+
let detail;
|
|
5344
|
+
let lede;
|
|
5345
|
+
if (outcome.kind === "null-elements") {
|
|
5346
|
+
lede = "returned only null values";
|
|
5347
|
+
const projected = `all ${outcome.count} of the elements it projected are null`;
|
|
5348
|
+
if (unknown.length > 0) {
|
|
5349
|
+
detail = `${projected}, because ${isNotAField(unknown)}`;
|
|
5350
|
+
} else if (unchecked.length > 0) {
|
|
5351
|
+
detail = withSoundness(projected);
|
|
5352
|
+
} else {
|
|
5353
|
+
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`;
|
|
5354
|
+
}
|
|
5355
|
+
} else if (outcome.kind === "null-rows") {
|
|
5356
|
+
lede = "returned only null values";
|
|
5357
|
+
const projected = `every value it projected is null on all ${outcome.count} row(s)`;
|
|
5358
|
+
detail = unknown.length > 0 ? `${projected}, because ${isNotAField(unknown)}` : withSoundness(projected);
|
|
5359
|
+
} else if (outcome.kind === "null-values") {
|
|
5360
|
+
lede = "returned only null values";
|
|
5361
|
+
const projected = `every key it projected (${nameList(outcome.keys)}) is null`;
|
|
5362
|
+
const sameSet = unknown.length === outcome.keys.length && outcome.keys.every((k) => unknown.includes(k));
|
|
5363
|
+
if (sameSet) {
|
|
5364
|
+
detail = `${isNotAField(outcome.keys)}, so every key it projected is null`;
|
|
5365
|
+
} else if (unknown.length > 0) {
|
|
5366
|
+
detail = `${projected}, because ${isNotAField(unknown)}`;
|
|
5367
|
+
} else {
|
|
5368
|
+
detail = withSoundness(`${projected} on all ${scope}`);
|
|
5369
|
+
}
|
|
5370
|
+
} else {
|
|
5371
|
+
lede = "returned nothing";
|
|
5372
|
+
if (unknown.length > 0) {
|
|
5373
|
+
detail = isNotAField(unknown);
|
|
5374
|
+
} else {
|
|
5375
|
+
const selection = refs.hasPredicate ? "no record matched" : "the expression resolved to no value";
|
|
5376
|
+
detail = withSoundness(`${selection} — it read ${scope}`);
|
|
5377
|
+
}
|
|
5378
|
+
}
|
|
5379
|
+
const fields = present.length > 0 ? ` Available fields: ${nameList(present)}.` : "";
|
|
5380
|
+
return `--output-filter ${JSON.stringify(filter)} ${lede}: ${detail}.${fields}`;
|
|
5381
|
+
}
|
|
5382
|
+
function appendWarning(existing, note) {
|
|
5383
|
+
return existing ? `${existing} ${note}` : note;
|
|
5384
|
+
}
|
|
5385
|
+
function applyFilter(data, filter, onWarning) {
|
|
5043
5386
|
const codec = requireJmespath();
|
|
5044
5387
|
let result;
|
|
5045
5388
|
try {
|
|
@@ -5047,9 +5390,34 @@ function applyFilter(data, filter) {
|
|
|
5047
5390
|
} catch (err) {
|
|
5048
5391
|
throw new FilterEvaluationError(filter, err);
|
|
5049
5392
|
}
|
|
5050
|
-
|
|
5393
|
+
const inputCount = countRecords(data);
|
|
5394
|
+
const warn = (outcome) => {
|
|
5395
|
+
if (inputCount === 0)
|
|
5396
|
+
return;
|
|
5397
|
+
const note = buildFilterWarning(filter, data, outcome);
|
|
5398
|
+
getOutputSink().writeErr(`[WARN] ${note}
|
|
5399
|
+
`);
|
|
5400
|
+
onWarning?.(note);
|
|
5401
|
+
};
|
|
5402
|
+
const warnIfAllNull = (records) => {
|
|
5403
|
+
const keys = alwaysNullKeys(records);
|
|
5404
|
+
if (keys.length > 0)
|
|
5405
|
+
warn({ kind: "null-values", keys });
|
|
5406
|
+
};
|
|
5407
|
+
if (result == null) {
|
|
5408
|
+
warn({ kind: "empty" });
|
|
5051
5409
|
return [];
|
|
5410
|
+
}
|
|
5052
5411
|
if (Array.isArray(result)) {
|
|
5412
|
+
if (result.length === 0) {
|
|
5413
|
+
warn({ kind: "empty" });
|
|
5414
|
+
} else if (result.every((entry) => entry === null)) {
|
|
5415
|
+
warn({ kind: "null-elements", count: result.length });
|
|
5416
|
+
} else if (result.every((entry) => Array.isArray(entry)) && carriesOnlyNulls(result)) {
|
|
5417
|
+
warn({ kind: "null-rows", count: result.length });
|
|
5418
|
+
} else {
|
|
5419
|
+
warnIfAllNull(result);
|
|
5420
|
+
}
|
|
5053
5421
|
if (result.length > 0 && typeof result[0] !== "object") {
|
|
5054
5422
|
const fieldMatch = filter.match(/\.(\w+)$/);
|
|
5055
5423
|
const key = fieldMatch ? fieldMatch[1] : "Value";
|
|
@@ -5057,10 +5425,30 @@ function applyFilter(data, filter) {
|
|
|
5057
5425
|
}
|
|
5058
5426
|
return result;
|
|
5059
5427
|
}
|
|
5060
|
-
if (typeof result === "object")
|
|
5428
|
+
if (typeof result === "object") {
|
|
5429
|
+
warnIfAllNull([result]);
|
|
5061
5430
|
return result;
|
|
5431
|
+
}
|
|
5062
5432
|
return { Value: result };
|
|
5063
5433
|
}
|
|
5434
|
+
function filterFailureData(envelope) {
|
|
5435
|
+
const filter = getOutputFilter();
|
|
5436
|
+
const data = envelope.Data;
|
|
5437
|
+
if (!filter || data == null)
|
|
5438
|
+
return;
|
|
5439
|
+
let note;
|
|
5440
|
+
const [filterError, filtered] = catchError(() => applyFilter(data, filter, (n) => {
|
|
5441
|
+
note = n;
|
|
5442
|
+
}));
|
|
5443
|
+
if (filterError) {
|
|
5444
|
+
envelope.Warning = appendWarning(envelope.Warning, `--output-filter was not applied, so Data is shown in full: ${filterError.message}`);
|
|
5445
|
+
return;
|
|
5446
|
+
}
|
|
5447
|
+
envelope.Data = filtered;
|
|
5448
|
+
if (note) {
|
|
5449
|
+
envelope.Warning = appendWarning(envelope.Warning, note);
|
|
5450
|
+
}
|
|
5451
|
+
}
|
|
5064
5452
|
function defaultErrorCodeForResult(result) {
|
|
5065
5453
|
switch (result) {
|
|
5066
5454
|
case RESULTS.AuthenticationError:
|
|
@@ -5104,7 +5492,7 @@ function defaultErrorCodeForHttpStatus(status) {
|
|
|
5104
5492
|
return "server_error";
|
|
5105
5493
|
return;
|
|
5106
5494
|
}
|
|
5107
|
-
var LOCAL_PERMISSION_TEXT_PATTERN =
|
|
5495
|
+
var LOCAL_PERMISSION_TEXT_PATTERN = new RegExp(`(?:\\b|\\()(?:${[...LOCAL_PERMISSION_ERROR_CODES].join("|")})(?::\\s|\\))`);
|
|
5108
5496
|
function defaultErrorCodeForFailure(data) {
|
|
5109
5497
|
if (data.Result === RESULTS.Failure) {
|
|
5110
5498
|
const status = data.Context?.httpStatus ?? parseHttpStatusFromMessage2(data.Message);
|
|
@@ -5143,8 +5531,14 @@ var OutputFormatter;
|
|
|
5143
5531
|
}
|
|
5144
5532
|
const filter = getOutputFilter();
|
|
5145
5533
|
if (filter) {
|
|
5146
|
-
|
|
5534
|
+
let note;
|
|
5535
|
+
const filtered = applyFilter(data.Data, filter, (n) => {
|
|
5536
|
+
note = n;
|
|
5537
|
+
});
|
|
5147
5538
|
data.Data = normalize ? normalizeDataKeys(filtered, verbatim, subtrees && { refs: subtrees.refs, mode: "skip" }) : filtered;
|
|
5539
|
+
if (note) {
|
|
5540
|
+
data.Warning = appendWarning(data.Warning, note);
|
|
5541
|
+
}
|
|
5148
5542
|
}
|
|
5149
5543
|
logOutput(normalizeOutputKeys(data), getOutputFormat(), options?.tableRowStyle);
|
|
5150
5544
|
}
|
|
@@ -5172,12 +5566,13 @@ var OutputFormatter;
|
|
|
5172
5566
|
delete envelope.TelemetryErrorClass;
|
|
5173
5567
|
delete envelope.TelemetryTerminalOutcome;
|
|
5174
5568
|
delete envelope.TelemetryTerminalSignal;
|
|
5569
|
+
filterFailureData(envelope);
|
|
5175
5570
|
if (!suppressTelemetry) {
|
|
5176
5571
|
telemetry.trackEvent(CommonTelemetryEvents.Error, {
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5572
|
+
[ErrorDimensions.Result]: data.Result,
|
|
5573
|
+
[ErrorDimensions.ErrorCode]: data.ErrorCode,
|
|
5574
|
+
[ErrorDimensions.Retry]: data.Retry,
|
|
5575
|
+
[ErrorDimensions.ErrorMessage]: data.Message
|
|
5181
5576
|
});
|
|
5182
5577
|
}
|
|
5183
5578
|
logOutput(normalizeOutputKeys(envelope), getOutputFormat());
|
|
@@ -5220,13 +5615,20 @@ var OutputFormatter;
|
|
|
5220
5615
|
OutputFormatter.log = log;
|
|
5221
5616
|
function formatToString(data) {
|
|
5222
5617
|
const filter = getOutputFilter();
|
|
5618
|
+
const envelope = data;
|
|
5223
5619
|
if ("Data" in data && data.Data != null) {
|
|
5224
5620
|
data.Data = normalizeDataKeys(data.Data);
|
|
5225
5621
|
if (filter) {
|
|
5226
|
-
|
|
5622
|
+
let note;
|
|
5623
|
+
data.Data = normalizeDataKeys(applyFilter(data.Data, filter, (n) => {
|
|
5624
|
+
note = n;
|
|
5625
|
+
}));
|
|
5626
|
+
if (note) {
|
|
5627
|
+
envelope.Warning = appendWarning(envelope.Warning, note);
|
|
5628
|
+
}
|
|
5227
5629
|
}
|
|
5228
5630
|
}
|
|
5229
|
-
const output = normalizeOutputKeys(
|
|
5631
|
+
const output = normalizeOutputKeys(envelope);
|
|
5230
5632
|
const lines = [];
|
|
5231
5633
|
const sink = getOutputSink();
|
|
5232
5634
|
printOutput(output, getOutputFormat(), (msg) => {
|
|
@@ -5276,7 +5678,7 @@ var LEGACY_SKILL_NAMESPACE = "uipath:";
|
|
|
5276
5678
|
var MAX_SKILL_NAME_LENGTH = 80;
|
|
5277
5679
|
var SKILL_NAME_PATTERN = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
|
|
5278
5680
|
function productMode(productArea, mode) {
|
|
5279
|
-
return {
|
|
5681
|
+
return { ProductArea: productArea, Mode: mode };
|
|
5280
5682
|
}
|
|
5281
5683
|
function attributionRecord(groups) {
|
|
5282
5684
|
const record = {};
|
|
@@ -5334,6 +5736,7 @@ var COMMAND_ATTRIBUTION = commandAttribution([
|
|
|
5334
5736
|
["rpa", "build", ["uip.rpa-legacy"]],
|
|
5335
5737
|
["conversational", "operate", ["uip.conversational"]],
|
|
5336
5738
|
["agents", "build", ["uip.codedagent", "uip.agent"]],
|
|
5739
|
+
["coding-agents", "build", ["uip.coder"]],
|
|
5337
5740
|
["agenthub", "build", ["uip.agenthub"]],
|
|
5338
5741
|
["coded-apps", "build", ["uip.codedapp"]],
|
|
5339
5742
|
["functions", "build", ["uip.function", "uip.functions"]],
|
|
@@ -5419,32 +5822,64 @@ function normalizeSkillName(value) {
|
|
|
5419
5822
|
function buildCommandTelemetryAttribution(commandPath, skillSource) {
|
|
5420
5823
|
const skillName = normalizeSkillName(skillSource);
|
|
5421
5824
|
return {
|
|
5422
|
-
...skillName ? {
|
|
5825
|
+
...skillName ? { SkillName: skillName } : {},
|
|
5423
5826
|
...getCommandProductModeAttribution(commandPath)
|
|
5424
5827
|
};
|
|
5425
5828
|
}
|
|
5829
|
+
var AGENT_SESSION_ENV = {
|
|
5830
|
+
[BaseDimensions.AgentModel]: "UIPATH_AGENT_MODEL",
|
|
5831
|
+
[SkillsDimensions.PermissionMode]: "UIPATH_PERMISSION_MODE",
|
|
5832
|
+
[SkillsDimensions.EffortLevel]: "UIPATH_EFFORT_LEVEL",
|
|
5833
|
+
[SkillsDimensions.SkillsVersion]: "UIPATH_SKILLS_VERSION"
|
|
5834
|
+
};
|
|
5835
|
+
var MAX_TELEMETRY_TOKEN_LENGTH = 120;
|
|
5836
|
+
function sanitizeTelemetryToken(value) {
|
|
5837
|
+
return value.replace(/[^A-Za-z0-9:._/ -]/g, "_").slice(0, MAX_TELEMETRY_TOKEN_LENGTH);
|
|
5838
|
+
}
|
|
5839
|
+
function buildAgentSessionTelemetry(env) {
|
|
5840
|
+
const dimensions = {};
|
|
5841
|
+
for (const [key, variable] of Object.entries(AGENT_SESSION_ENV)) {
|
|
5842
|
+
const value = env[variable]?.trim();
|
|
5843
|
+
if (value) {
|
|
5844
|
+
dimensions[key] = sanitizeTelemetryToken(value);
|
|
5845
|
+
}
|
|
5846
|
+
}
|
|
5847
|
+
return dimensions;
|
|
5848
|
+
}
|
|
5426
5849
|
|
|
5427
5850
|
// ../common/src/telemetry/command-name.ts
|
|
5428
|
-
var
|
|
5851
|
+
var TELEMETRY_NAME_ROOT = "Cli";
|
|
5852
|
+
var CLI_COMMAND_ROOT = "uip";
|
|
5853
|
+
var TELEMETRY_NAME_BARE_ACTION = "Invoke";
|
|
5429
5854
|
function commandTelemetryName(parts) {
|
|
5855
|
+
const action = vetCommandTokens(parts).map(pascalizeToken).join("");
|
|
5856
|
+
return `${TELEMETRY_NAME_ROOT}.${action || TELEMETRY_NAME_BARE_ACTION}`;
|
|
5857
|
+
}
|
|
5858
|
+
function commandInvocationPath(parts) {
|
|
5859
|
+
return [CLI_COMMAND_ROOT, ...vetCommandTokens(parts)].join(" ");
|
|
5860
|
+
}
|
|
5861
|
+
function vetCommandTokens(parts) {
|
|
5430
5862
|
const tokens = [];
|
|
5431
5863
|
for (const part of parts) {
|
|
5432
|
-
const pieces = String(part ?? "").split(/\s+/).filter((token) => token && !token.startsWith("-") && token !==
|
|
5864
|
+
const pieces = String(part ?? "").split(/\s+/).filter((token) => token && !token.startsWith("-") && token !== CLI_COMMAND_ROOT);
|
|
5433
5865
|
if (pieces.every(isCommandToken)) {
|
|
5434
5866
|
tokens.push(...pieces);
|
|
5435
5867
|
continue;
|
|
5436
5868
|
}
|
|
5437
5869
|
tokens.push(UNKNOWN_TOKEN);
|
|
5438
5870
|
}
|
|
5439
|
-
return
|
|
5871
|
+
return tokens;
|
|
5872
|
+
}
|
|
5873
|
+
function pascalizeToken(token) {
|
|
5874
|
+
return token.split("-").filter(Boolean).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join("");
|
|
5440
5875
|
}
|
|
5441
|
-
var COMMAND_TOKEN_PATTERN = /^[a-
|
|
5876
|
+
var COMMAND_TOKEN_PATTERN = /^[a-z][a-z0-9-]*$/;
|
|
5442
5877
|
var MAX_COMMAND_TOKEN_LENGTH = 32;
|
|
5443
5878
|
var GUID_TOKEN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
|
|
5444
5879
|
function isCommandToken(token) {
|
|
5445
|
-
return token.length <= MAX_COMMAND_TOKEN_LENGTH && COMMAND_TOKEN_PATTERN.test(token) && !GUID_TOKEN.test(token)
|
|
5880
|
+
return token.length <= MAX_COMMAND_TOKEN_LENGTH && COMMAND_TOKEN_PATTERN.test(token) && !GUID_TOKEN.test(token);
|
|
5446
5881
|
}
|
|
5447
|
-
var UNKNOWN_TOKEN = "
|
|
5882
|
+
var UNKNOWN_TOKEN = "unknown";
|
|
5448
5883
|
|
|
5449
5884
|
// ../common/src/telemetry/invocation-request.ts
|
|
5450
5885
|
var requestContextSlot = singleton("TelemetryInvocationRequestContext");
|
|
@@ -5549,7 +5984,7 @@ function withheldArgumentValues(cmd) {
|
|
|
5549
5984
|
});
|
|
5550
5985
|
return values;
|
|
5551
5986
|
}
|
|
5552
|
-
function
|
|
5987
|
+
function deriveCommandParts(cmd) {
|
|
5553
5988
|
const parts = [];
|
|
5554
5989
|
let current = cmd;
|
|
5555
5990
|
while (current) {
|
|
@@ -5562,14 +5997,13 @@ function deriveCommandPath(cmd) {
|
|
|
5562
5997
|
if (parts.length > 1) {
|
|
5563
5998
|
parts.shift();
|
|
5564
5999
|
}
|
|
5565
|
-
return
|
|
6000
|
+
return parts;
|
|
5566
6001
|
}
|
|
5567
6002
|
function isErrorContext(value) {
|
|
5568
6003
|
return value !== null && typeof value === "object";
|
|
5569
6004
|
}
|
|
5570
6005
|
function commandHelpHint(commandPath) {
|
|
5571
|
-
|
|
5572
|
-
return `An unexpected error occurred. Run '${command} --help' to verify command syntax, or run with --log-level debug for details.`;
|
|
6006
|
+
return `An unexpected error occurred. Run '${commandPath} --help' to verify command syntax, or run with --log-level debug for details.`;
|
|
5573
6007
|
}
|
|
5574
6008
|
function isPromptCancellation(error) {
|
|
5575
6009
|
return error instanceof Error && error.name === "ExitPromptError";
|
|
@@ -5594,7 +6028,9 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
5594
6028
|
yaml: getOutputFormat() === "yaml",
|
|
5595
6029
|
filter: getOutputFilter() !== undefined
|
|
5596
6030
|
});
|
|
5597
|
-
const
|
|
6031
|
+
const commandParts = deriveCommandParts(command);
|
|
6032
|
+
const telemetryName = commandTelemetryName(commandParts);
|
|
6033
|
+
const commandPath = commandInvocationPath(commandParts);
|
|
5598
6034
|
const props = typeof properties === "function" ? properties(...args) : properties;
|
|
5599
6035
|
markCommandStart();
|
|
5600
6036
|
const supplied = recordSuppliedArgumentValues(withheldArgumentValues(command));
|
|
@@ -5629,7 +6065,7 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
5629
6065
|
Result: finalResult,
|
|
5630
6066
|
...customErrorCode ? { ErrorCode: customErrorCode } : {},
|
|
5631
6067
|
Message: errorMessage,
|
|
5632
|
-
Instructions: customInstructions ?? commandHelpHint(
|
|
6068
|
+
Instructions: customInstructions ?? commandHelpHint(commandPath),
|
|
5633
6069
|
...customRetry ? { Retry: customRetry } : {},
|
|
5634
6070
|
...customContext ? { Context: customContext } : {}
|
|
5635
6071
|
});
|
|
@@ -5646,8 +6082,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
5646
6082
|
recordedFailure,
|
|
5647
6083
|
pollSignal: context.pollSignal
|
|
5648
6084
|
});
|
|
5649
|
-
if (terminalTelemetry.
|
|
5650
|
-
telemetry.trackException(error instanceof Error ? error : new Error(String(error)), {
|
|
6085
|
+
if (terminalTelemetry[CommandDimensions.ErrorClass] === "internal" && error) {
|
|
6086
|
+
telemetry.trackException(error instanceof Error ? error : new Error(String(error)), { [CommandDimensions.CommandName]: commandPath }, getInvocationRequestContext());
|
|
5651
6087
|
}
|
|
5652
6088
|
const commandParams = extractCommandParams(command);
|
|
5653
6089
|
if (props) {
|
|
@@ -5658,10 +6094,12 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
5658
6094
|
const baseProperties = redactProperties({
|
|
5659
6095
|
...commandParams,
|
|
5660
6096
|
...props,
|
|
5661
|
-
...buildCommandTelemetryAttribution(
|
|
5662
|
-
|
|
6097
|
+
...buildCommandTelemetryAttribution(commandPath, process.env.UIPATH_SKILL),
|
|
6098
|
+
...buildAgentSessionTelemetry(process.env),
|
|
6099
|
+
[CommandDimensions.CommandName]: commandPath,
|
|
6100
|
+
[CommandDimensions.IsCommand]: "true",
|
|
5663
6101
|
...terminalTelemetry,
|
|
5664
|
-
...errorMessage ? { errorMessage } : {}
|
|
6102
|
+
...errorMessage ? { [CommandDimensions.ErrorMessage]: errorMessage } : {}
|
|
5665
6103
|
});
|
|
5666
6104
|
emitInvocationRequest(telemetryName, success, baseProperties);
|
|
5667
6105
|
} finally {
|
|
@@ -5905,6 +6343,40 @@ var BOOLEAN_FLAGS = new Set(HOST_GLOBAL_FLAGS);
|
|
|
5905
6343
|
// ../common/src/interactivity-context.ts
|
|
5906
6344
|
var modeSlot = singleton("InteractivityMode");
|
|
5907
6345
|
var interactiveFlagSlot = singleton("InteractiveFlag");
|
|
6346
|
+
// ../common/src/mime-types.ts
|
|
6347
|
+
var MIME_TYPES_BY_EXTENSION = Object.freeze({
|
|
6348
|
+
pdf: "application/pdf",
|
|
6349
|
+
png: "image/png",
|
|
6350
|
+
jpg: "image/jpeg",
|
|
6351
|
+
jpeg: "image/jpeg",
|
|
6352
|
+
gif: "image/gif",
|
|
6353
|
+
webp: "image/webp",
|
|
6354
|
+
bmp: "image/bmp",
|
|
6355
|
+
tif: "image/tiff",
|
|
6356
|
+
tiff: "image/tiff",
|
|
6357
|
+
svg: "image/svg+xml",
|
|
6358
|
+
txt: "text/plain",
|
|
6359
|
+
log: "text/plain",
|
|
6360
|
+
md: "text/markdown",
|
|
6361
|
+
csv: "text/csv",
|
|
6362
|
+
tsv: "text/tab-separated-values",
|
|
6363
|
+
json: "application/json",
|
|
6364
|
+
xml: "application/xml",
|
|
6365
|
+
html: "text/html",
|
|
6366
|
+
htm: "text/html",
|
|
6367
|
+
yaml: "application/yaml",
|
|
6368
|
+
yml: "application/yaml",
|
|
6369
|
+
doc: "application/msword",
|
|
6370
|
+
docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
6371
|
+
xls: "application/vnd.ms-excel",
|
|
6372
|
+
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
6373
|
+
ppt: "application/vnd.ms-powerpoint",
|
|
6374
|
+
pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
6375
|
+
zip: "application/zip",
|
|
6376
|
+
mp3: "audio/mpeg",
|
|
6377
|
+
wav: "audio/wav",
|
|
6378
|
+
mp4: "video/mp4"
|
|
6379
|
+
});
|
|
5908
6380
|
// ../common/src/option-aliases.ts
|
|
5909
6381
|
function resolveDeprecatedOptionAlias({
|
|
5910
6382
|
preferredValue,
|
|
@@ -6401,6 +6873,7 @@ var ScreenLogger;
|
|
|
6401
6873
|
})(ScreenLogger ||= {});
|
|
6402
6874
|
// ../common/src/sdk-user-agent.ts
|
|
6403
6875
|
var USER_AGENT_HEADER = "User-Agent";
|
|
6876
|
+
var AGENT_PROPERTY = BaseDimensions.Agent;
|
|
6404
6877
|
var sdkUserAgentHostToken = singleton("SdkUserAgentHostToken");
|
|
6405
6878
|
function userAgentPatchKey(userAgent) {
|
|
6406
6879
|
return Symbol.for(`@uipath/common/sdk-user-agent/${userAgent}`);
|
|
@@ -6743,7 +7216,7 @@ var package_default2 = {
|
|
|
6743
7216
|
name: "@uipath/sc-sdk",
|
|
6744
7217
|
author: "UiPath",
|
|
6745
7218
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
6746
|
-
version: "1.
|
|
7219
|
+
version: "1.204.0",
|
|
6747
7220
|
description: "SDK for the UiPath SourceControl API — connections, repositories, automation projects, solutions.",
|
|
6748
7221
|
repository: {
|
|
6749
7222
|
type: "git",
|
|
@@ -6774,6 +7247,7 @@ var package_default2 = {
|
|
|
6774
7247
|
private: true,
|
|
6775
7248
|
scripts: {
|
|
6776
7249
|
build: "bun build ./src/index.ts --outdir dist --format esm --target node --sourcemap=linked && tsc -p tsconfig.build.json --noCheck",
|
|
7250
|
+
typecheck: "tsc --noEmit",
|
|
6777
7251
|
generate: "bun run src/scripts/generate-sdk.ts",
|
|
6778
7252
|
lint: "biome check ."
|
|
6779
7253
|
},
|
|
@@ -8239,6 +8713,11 @@ var pickName = (claims) => {
|
|
|
8239
8713
|
const username = asString(claims?.preferred_username);
|
|
8240
8714
|
return asString(claims?.name) ?? (looksLikeEmail(username) ? undefined : username);
|
|
8241
8715
|
};
|
|
8716
|
+
var pickScopes = (claims) => {
|
|
8717
|
+
const raw = claims?.scope;
|
|
8718
|
+
const scopes = Array.isArray(raw) ? raw.filter((entry) => asString(entry) !== undefined) : typeof raw === "string" ? raw.split(/\s+/).filter(Boolean) : [];
|
|
8719
|
+
return scopes.length > 0 ? scopes : undefined;
|
|
8720
|
+
};
|
|
8242
8721
|
var resolveSessionIdentity = (accessToken, authFlow) => {
|
|
8243
8722
|
const claims = accessToken ? decodeClaims(accessToken) : undefined;
|
|
8244
8723
|
const email = pickEmail(claims);
|
|
@@ -8264,6 +8743,7 @@ var resolveSessionIdentity = (accessToken, authFlow) => {
|
|
|
8264
8743
|
identity.clientId = clientId;
|
|
8265
8744
|
return identity;
|
|
8266
8745
|
};
|
|
8746
|
+
var readTokenScopes = (accessToken) => accessToken ? pickScopes(decodeClaims(accessToken)) : undefined;
|
|
8267
8747
|
|
|
8268
8748
|
// ../auth/src/envAuth.ts
|
|
8269
8749
|
var ENV_AUTH_ENABLE_VAR = "UIPATH_CLI_ENABLE_ENV_AUTH";
|
|
@@ -8336,6 +8816,7 @@ var readAuthFromEnv = () => {
|
|
|
8336
8816
|
const expiration = getTokenExpiration(accessToken);
|
|
8337
8817
|
const loginStatus = expiration && expiration <= new Date ? "Expired" : "Logged in";
|
|
8338
8818
|
const identity = resolveSessionIdentity(accessToken);
|
|
8819
|
+
const scopes = readTokenScopes(accessToken);
|
|
8339
8820
|
return {
|
|
8340
8821
|
loginStatus,
|
|
8341
8822
|
accessToken,
|
|
@@ -8346,7 +8827,8 @@ var readAuthFromEnv = () => {
|
|
|
8346
8827
|
tenantId,
|
|
8347
8828
|
expiration,
|
|
8348
8829
|
source: "env-vars" /* EnvironmentVariables */,
|
|
8349
|
-
...identity ? { identity } : {}
|
|
8830
|
+
...identity ? { identity } : {},
|
|
8831
|
+
...scopes ? { scopes } : {}
|
|
8350
8832
|
};
|
|
8351
8833
|
};
|
|
8352
8834
|
|
|
@@ -8984,10 +9466,15 @@ async function buildFileStatus(tokens, credentials, globalHint) {
|
|
|
8984
9466
|
}
|
|
8985
9467
|
function identityFields(accessToken, credentials) {
|
|
8986
9468
|
const identity = resolveSessionIdentity(accessToken, parseAuthFlow(credentials[AUTH_FLOW_ENV_VAR]));
|
|
8987
|
-
|
|
9469
|
+
const scopes = readTokenScopes(accessToken);
|
|
9470
|
+
return {
|
|
9471
|
+
...identity ? { identity } : {},
|
|
9472
|
+
...scopes ? { scopes } : {}
|
|
9473
|
+
};
|
|
8988
9474
|
}
|
|
8989
9475
|
function buildRobotStatus(robotCreds) {
|
|
8990
9476
|
const identity = resolveSessionIdentity(robotCreds.accessToken);
|
|
9477
|
+
const scopes = readTokenScopes(robotCreds.accessToken);
|
|
8991
9478
|
return {
|
|
8992
9479
|
loginStatus: "Logged in",
|
|
8993
9480
|
accessToken: robotCreds.accessToken,
|
|
@@ -8999,7 +9486,8 @@ function buildRobotStatus(robotCreds) {
|
|
|
8999
9486
|
issuer: robotCreds.issuer,
|
|
9000
9487
|
expiration: getTokenExpiration(robotCreds.accessToken),
|
|
9001
9488
|
source: "robot" /* Robot */,
|
|
9002
|
-
...identity ? { identity } : {}
|
|
9489
|
+
...identity ? { identity } : {},
|
|
9490
|
+
...scopes ? { scopes } : {}
|
|
9003
9491
|
};
|
|
9004
9492
|
}
|
|
9005
9493
|
var isFileNotFoundError = (error) => {
|
|
@@ -9266,7 +9754,8 @@ var getAuthContext = async (options = {}) => {
|
|
|
9266
9754
|
organizationId: status.organizationId,
|
|
9267
9755
|
organizationName: status.organizationName,
|
|
9268
9756
|
tenantId: status.tenantId,
|
|
9269
|
-
tenantName
|
|
9757
|
+
tenantName,
|
|
9758
|
+
identity: status.identity
|
|
9270
9759
|
};
|
|
9271
9760
|
};
|
|
9272
9761
|
// ../auth/src/tenantSelection.ts
|
|
@@ -9564,7 +10053,7 @@ var package_default3 = {
|
|
|
9564
10053
|
name: "@uipath/cicd-sdk",
|
|
9565
10054
|
author: "UiPath",
|
|
9566
10055
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
9567
|
-
version: "1.
|
|
10056
|
+
version: "1.204.0",
|
|
9568
10057
|
description: "SDK for the UiPath StudioAdmin CICD API — pipelines, pipeline executions, partition configuration.",
|
|
9569
10058
|
repository: {
|
|
9570
10059
|
type: "git",
|
|
@@ -9596,6 +10085,7 @@ var package_default3 = {
|
|
|
9596
10085
|
private: true,
|
|
9597
10086
|
scripts: {
|
|
9598
10087
|
build: "bun build ./src/index.ts --outdir dist --format esm --target node --sourcemap=linked && tsc -p tsconfig.build.json --noCheck",
|
|
10088
|
+
typecheck: "tsc --noEmit",
|
|
9599
10089
|
generate: "bun run src/scripts/generate-sdk.ts",
|
|
9600
10090
|
lint: "biome check ."
|
|
9601
10091
|
},
|
|
@@ -13414,4 +13904,4 @@ var registerCommands = async (program2) => {
|
|
|
13414
13904
|
|
|
13415
13905
|
export { Command, metadata, registerCommands };
|
|
13416
13906
|
|
|
13417
|
-
//# debugId=
|
|
13907
|
+
//# debugId=25810350DDA56CFC64756E2164756E21
|
package/dist/tool.js
CHANGED
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@uipath/aops-tool",
|
|
3
3
|
"author": "UiPath",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.204.0-preview.206",
|
|
6
6
|
"description": "Manage UiPath StudioAdmin AOps — connections, repos, projects, solutions, pipelines, executions.",
|
|
7
7
|
"private": false,
|
|
8
8
|
"repository": {
|
|
@@ -27,5 +27,5 @@
|
|
|
27
27
|
"files": [
|
|
28
28
|
"dist"
|
|
29
29
|
],
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "ea7fd32a02acccf14e8e83522e69101430627b83"
|
|
31
31
|
}
|