@uipath/solution-tool 1.205.0-preview.281 → 1.206.0-preview.279
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/{archive-extract-x35t9ktj.js → archive-extract-136rn3ja.js} +13 -15
- package/dist/{cleanup-command-service-je9d70vv.js → cleanup-command-service-ejakyhea.js} +34 -31
- package/dist/deploy-delete-service-r7abfh28.js +23 -0
- package/dist/deploy-run-service-rnthz10q.js +23 -0
- package/dist/{deploy-status-service-919yn8wn.js → deploy-status-service-6my5vm61.js} +72 -62
- package/dist/deploy.js +35 -37
- package/dist/deployment-search-gfm907tx.js +54 -0
- package/dist/{embedded-file-reader-z4becc02.js → embedded-file-reader-0228j82a.js} +1 -4
- package/dist/feed-resolver-14crsx5y.js +27 -0
- package/dist/feed-scope-failure-67cyybn0.js +20 -0
- package/dist/feed-session-g94q2bjc.js +23 -0
- package/dist/first-party-service-n3vva2m4.js +8 -0
- package/dist/governance-options-t20vsznh.js +19 -0
- package/dist/index-aspmac9f.js +24 -0
- package/dist/index-ddk6v1ej.js +60 -0
- package/dist/{index-sby22td6.js → index-nzr4mx5p.js} +2 -22
- package/dist/index-qq4kre7a.js +93 -0
- package/dist/index-t262f2xv.js +16 -0
- package/dist/index.js +33 -34
- package/dist/init.js +18 -21
- package/dist/{jmespath-231m3hyn.js → jmespath-ab6tdc42.js} +1 -1
- package/dist/{js-yaml-88tdqrtd.js → js-yaml-a2bk27p6.js} +1 -3
- package/dist/{list-5fke71jn.js → list-jntan9tx.js} +23 -23
- package/dist/models/pack-command-types.d.ts +3 -1
- package/dist/node-kwzcw5ex.js +25 -0
- package/dist/pack-command-service-pwaeha7y.js +29 -0
- package/dist/{pack-project-ha0pxw3h.js → pack-project-ztt1hfrs.js} +33 -40
- package/dist/pack.js +26 -30
- package/dist/package-id-4tsg5jsb.js +11 -0
- package/dist/{packager-tool-4pa108k7.js → packager-tool-1bz9h5ca.js} +11 -11
- package/dist/{packager-tool-gs3f3tf7.js → packager-tool-1ctvbx0h.js} +1 -1
- package/dist/{packager-tool-f23a485e.js → packager-tool-55ztfccd.js} +176 -196
- package/dist/{packager-tool-45a8fkw0.js → packager-tool-95y24705.js} +37 -39
- package/dist/{packager-tool-2vmz56qh.js → packager-tool-9j8e5q1z.js} +184 -33
- package/dist/{packager-tool-tx834spe.js → packager-tool-9vrwpgt3.js} +757 -309
- package/dist/packager-tool-a6va4gc5.js +1178 -0
- package/dist/{packager-tool-pbmqk39a.js → packager-tool-a7s0gbxs.js} +33 -28
- package/dist/{packager-tool-47wzvqw0.js → packager-tool-aws5w512.js} +6 -6
- package/dist/{packager-tool-97rcgwvv.js → packager-tool-bs1jn1yn.js} +331 -55
- package/dist/packager-tool-c64hqa8n.js +106 -0
- package/dist/{packager-tool-5ddtwzva.js → packager-tool-ca5ngmqv.js} +12 -12
- package/dist/{packager-tool-6kz1pv9f.js → packager-tool-d1texmvn.js} +828 -338
- package/dist/{packager-tool-1de529jm.js → packager-tool-epsr41wx.js} +12 -3
- package/dist/packager-tool-f84z7nds.js +130 -0
- package/dist/{packager-tool-8ptbmmmp.js → packager-tool-fp46ebde.js} +147 -76
- package/dist/packager-tool-fqs6hdcy.js +290 -0
- package/dist/{packager-tool-3bwnkjdq.js → packager-tool-fx4ws49n.js} +12 -12
- package/dist/{packager-tool-6ybywxxn.js → packager-tool-m07vyk89.js} +371 -221
- package/dist/{packager-tool-gyqfs04e.js → packager-tool-nrhqgr4z.js} +273 -255
- package/dist/{packager-tool-61pwb567.js → packager-tool-ppj5f4y7.js} +6 -7
- package/dist/{packager-tool-d78ww4hb.js → packager-tool-pyt9fvty.js} +51 -48
- package/dist/packager-tool-q5d9df2q.js +74 -0
- package/dist/{packager-tool-cvf46scg.js → packager-tool-q8ryk6q9.js} +122 -89
- package/dist/{packager-tool-t8gh825q.js → packager-tool-qf8753ee.js} +53 -41
- package/dist/{packager-tool-60af1hw2.js → packager-tool-qzcd5c9s.js} +3 -3
- package/dist/packager-tool-resolver-td3bhccd.js +20 -0
- package/dist/{packager-tool-dfrk01gn.js → packager-tool-rj2d1g0w.js} +154 -154
- package/dist/{packager-tool-2t72aez8.js → packager-tool-snm6s7b5.js} +15 -15
- package/dist/{packager-tool-43ahv5mn.js → packager-tool-t39pjz7n.js} +35 -18
- package/dist/{packager-tool-wm0jaz7p.js → packager-tool-t3a48ys5.js} +305 -657
- package/dist/{packager-tool-dnrk1gg6.js → packager-tool-t3ahzjh1.js} +356 -298
- package/dist/{packager-tool-v1f5e8t9.js → packager-tool-vgrswa8p.js} +53 -8
- package/dist/packager-tool-vrtabg73.js +2307 -0
- package/dist/{packager-tool-gmwva4yv.js → packager-tool-vx2c68sb.js} +2 -2
- package/dist/{packager-tool-h1tq7bqf.js → packager-tool-vx39dhvn.js} +65 -35
- package/dist/{packager-tool-5qzgdb66.js → packager-tool-w34wyhwf.js} +13 -15
- package/dist/packager-tool-w8bcwfd3.js +280 -0
- package/dist/{packager-tool-1ybnxbp9.js → packager-tool-wm0h0wa1.js} +18 -18
- package/dist/{packager-tool-b2nhscfk.js → packager-tool-wm8nj6e9.js} +18 -18
- package/dist/{packager-tool-amhyxzz6.js → packager-tool-x33sdw6n.js} +16 -16
- package/dist/{packager-tool-wy4fx250.js → packager-tool-yetmzme9.js} +89 -30
- package/dist/{packager-tool-056k8w2f.js → packager-tool-z5r49ky9.js} +75 -9
- package/dist/packager-tool.js +6 -7
- package/dist/prepare-solution-resources-pwnyvtza.js +26 -0
- package/dist/{project-command-utils-t6pmpvq3.js → project-command-utils-zcmbecfy.js} +23 -26
- package/dist/project-contributions-kh9yftvg.js +27 -0
- package/dist/publish.js +17 -17
- package/dist/resource-mutations-mfn5k1hb.js +27 -0
- package/dist/{resource-version-lookup-0e3e2j58.js → resource-version-lookup-6ejh1hwd.js} +20 -23
- package/dist/resource.js +13 -16
- package/dist/{restore-command-service-pzpet021.js → restore-command-service-n880dxre.js} +37 -34
- package/dist/{run-service-hk8w2h31.js → run-service-4vhn6mtb.js} +144 -66
- package/dist/services/deploy-activate-service.d.ts +2 -1
- package/dist/services/deployment-search-client.d.ts +2 -1
- package/dist/services/deployment-search.d.ts +39 -0
- package/dist/services/feed-resolver.d.ts +13 -1
- package/dist/services/feed-selection.d.ts +8 -5
- package/dist/services/feed-session.d.ts +34 -0
- package/dist/services/install-run.d.ts +92 -0
- package/dist/services/prepare-solution-resources.d.ts +11 -2
- package/dist/services/project-contributions.d.ts +2 -0
- package/dist/services/project-identity-telemetry.d.ts +3 -0
- package/dist/services/publish-service.d.ts +20 -3
- package/dist/services/solution-identity.d.ts +18 -0
- package/dist/ship-telemetry-bkf3800w.js +16 -0
- package/dist/solution-auth-jxcgd2m0.js +10 -0
- package/dist/solution-identity-92h2fbpa.js +19 -0
- package/dist/templates/AGENTS.md +27 -29
- package/dist/tool.js +32 -33
- package/package.json +2 -2
- package/dist/deploy-delete-service-0tm600d1.js +0 -25
- package/dist/deploy-run-service-hne5w17k.js +0 -25
- package/dist/deployment-search-32zvxn35.js +0 -55
- package/dist/feed-resolver-pdeb4wkq.js +0 -28
- package/dist/feed-scope-failure-4baame72.js +0 -19
- package/dist/feed-session-7xqphdrg.js +0 -17
- package/dist/first-party-service-sd8yaf73.js +0 -27
- package/dist/governance-options-bqgv5fte.js +0 -32
- package/dist/index-dqa169gp.js +0 -25
- package/dist/index-prm27bvm.js +0 -138
- package/dist/index-wdndcwab.js +0 -667
- package/dist/node-v7xhqwe2.js +0 -86
- package/dist/pack-command-service-b1v9c8cw.js +0 -35
- package/dist/package-id-rpzgy31w.js +0 -13
- package/dist/packager-tool-53w8skv5.js +0 -262
- package/dist/packager-tool-5edvzz80.js +0 -543
- package/dist/packager-tool-99jaqabz.js +0 -171
- package/dist/packager-tool-9hsmn8th.js +0 -418
- package/dist/packager-tool-azre7mm1.js +0 -182
- package/dist/packager-tool-fn13r8e1.js +0 -188
- package/dist/packager-tool-gdtpsdn7.js +0 -342
- package/dist/packager-tool-qw47eyw7.js +0 -43
- package/dist/packager-tool-resolver-994z3jkj.js +0 -23
- package/dist/packager-tool-tedbebpq.js +0 -5367
- package/dist/packager-tool-x1ah4eez.js +0 -68
- package/dist/prepare-solution-resources-m1djfj62.js +0 -29
- package/dist/project-contributions-79ndycrx.js +0 -32
- package/dist/resource-mutations-c3krjqze.js +0 -36
- package/dist/ship-telemetry-myes7ak5.js +0 -21
- package/dist/solution-auth-aead70sw.js +0 -11
- /package/dist/{packager-tool-act5r386.js → packager-tool-2pxe2r4j.js} +0 -0
- /package/dist/{packager-tool-kkfb5kgn.js → packager-tool-vrqbbh01.js} +0 -0
|
@@ -1,27 +1,42 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getFileSystem
|
|
3
|
+
} from "./packager-tool-vgrswa8p.js";
|
|
1
4
|
import {
|
|
2
5
|
CommandDimensions,
|
|
6
|
+
GUID_KEY_DIMENSIONS,
|
|
3
7
|
ErrorDimensions,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
buildCommandTelemetryAttribution,
|
|
8
|
-
catchError,
|
|
9
|
-
findHttpStatusInGraph,
|
|
8
|
+
projectIdentityProperties,
|
|
9
|
+
PROJECT_IDENTITY_LOOKUP_BUDGET_MS,
|
|
10
|
+
withinProjectIdentityBudget,
|
|
10
11
|
pseudonymize,
|
|
12
|
+
singleton,
|
|
11
13
|
recordSuppliedArgumentValues,
|
|
12
|
-
redactProperties,
|
|
13
14
|
releaseSuppliedArgumentValues,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
redactProperties,
|
|
16
|
+
catchError,
|
|
17
|
+
isCliErrorCode,
|
|
18
|
+
isRetryHint,
|
|
19
|
+
defaultRetryForErrorCode,
|
|
20
|
+
walkErrorGraph,
|
|
21
|
+
parseHttpStatusFromMessage,
|
|
22
|
+
findHttpStatusInGraph,
|
|
23
|
+
classifyHttpStatus,
|
|
24
|
+
LOCAL_PERMISSION_ERROR_CODES,
|
|
25
|
+
describeConnectivityError,
|
|
26
|
+
describePermissionError,
|
|
27
|
+
classifyThrownError,
|
|
28
|
+
extractErrorDetails,
|
|
29
|
+
TelemetryService,
|
|
30
|
+
isProjectTelemetryDisabled,
|
|
31
|
+
buildCommandTelemetryAttribution,
|
|
32
|
+
buildAgentSessionTelemetry
|
|
33
|
+
} from "./packager-tool-m07vyk89.js";
|
|
20
34
|
import {
|
|
35
|
+
__toESM,
|
|
21
36
|
__commonJS,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
} from "./packager-tool-
|
|
37
|
+
__exportCjs,
|
|
38
|
+
__require
|
|
39
|
+
} from "./packager-tool-epsr41wx.js";
|
|
25
40
|
|
|
26
41
|
// ../../node_modules/commander/lib/error.js
|
|
27
42
|
var require_error = __commonJS(function(exports) {
|
|
@@ -143,7 +158,7 @@ var require_help = __commonJS(function(exports) {
|
|
|
143
158
|
this.helpWidth = this.helpWidth ?? contextOptions.helpWidth ?? 80;
|
|
144
159
|
}
|
|
145
160
|
visibleCommands(cmd) {
|
|
146
|
-
const visibleCommands = cmd.commands.filter((
|
|
161
|
+
const visibleCommands = cmd.commands.filter((cmd) => !cmd._hidden);
|
|
147
162
|
const helpCommand = cmd._getHelpCommand();
|
|
148
163
|
if (helpCommand && !helpCommand._hidden) {
|
|
149
164
|
visibleCommands.push(helpCommand);
|
|
@@ -623,8 +638,8 @@ var require_option = __commonJS(function(exports) {
|
|
|
623
638
|
}
|
|
624
639
|
}
|
|
625
640
|
function camelcase(str) {
|
|
626
|
-
return str.split("-").reduce((
|
|
627
|
-
return
|
|
641
|
+
return str.split("-").reduce((str, word) => {
|
|
642
|
+
return str + word[0].toUpperCase() + word.slice(1);
|
|
628
643
|
});
|
|
629
644
|
}
|
|
630
645
|
function splitOptionFlags(flags) {
|
|
@@ -1195,44 +1210,44 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1195
1210
|
});
|
|
1196
1211
|
return source;
|
|
1197
1212
|
}
|
|
1198
|
-
_prepareUserArgs(
|
|
1199
|
-
if (
|
|
1213
|
+
_prepareUserArgs(argv2, parseOptions) {
|
|
1214
|
+
if (argv2 !== undefined && !Array.isArray(argv2)) {
|
|
1200
1215
|
throw new Error("first parameter to parse must be array or undefined");
|
|
1201
1216
|
}
|
|
1202
1217
|
parseOptions = parseOptions || {};
|
|
1203
|
-
if (
|
|
1218
|
+
if (argv2 === undefined && parseOptions.from === undefined) {
|
|
1204
1219
|
if (process2.versions?.electron) {
|
|
1205
1220
|
parseOptions.from = "electron";
|
|
1206
1221
|
}
|
|
1207
|
-
const
|
|
1208
|
-
if (
|
|
1222
|
+
const execArgv2 = process2.execArgv ?? [];
|
|
1223
|
+
if (execArgv2.includes("-e") || execArgv2.includes("--eval") || execArgv2.includes("-p") || execArgv2.includes("--print")) {
|
|
1209
1224
|
parseOptions.from = "eval";
|
|
1210
1225
|
}
|
|
1211
1226
|
}
|
|
1212
|
-
if (
|
|
1213
|
-
|
|
1227
|
+
if (argv2 === undefined) {
|
|
1228
|
+
argv2 = process2.argv;
|
|
1214
1229
|
}
|
|
1215
|
-
this.rawArgs =
|
|
1230
|
+
this.rawArgs = argv2.slice();
|
|
1216
1231
|
let userArgs;
|
|
1217
1232
|
switch (parseOptions.from) {
|
|
1218
1233
|
case undefined:
|
|
1219
1234
|
case "node":
|
|
1220
|
-
this._scriptPath =
|
|
1221
|
-
userArgs =
|
|
1235
|
+
this._scriptPath = argv2[1];
|
|
1236
|
+
userArgs = argv2.slice(2);
|
|
1222
1237
|
break;
|
|
1223
1238
|
case "electron":
|
|
1224
1239
|
if (process2.defaultApp) {
|
|
1225
|
-
this._scriptPath =
|
|
1226
|
-
userArgs =
|
|
1240
|
+
this._scriptPath = argv2[1];
|
|
1241
|
+
userArgs = argv2.slice(2);
|
|
1227
1242
|
} else {
|
|
1228
|
-
userArgs =
|
|
1243
|
+
userArgs = argv2.slice(1);
|
|
1229
1244
|
}
|
|
1230
1245
|
break;
|
|
1231
1246
|
case "user":
|
|
1232
|
-
userArgs =
|
|
1247
|
+
userArgs = argv2.slice(0);
|
|
1233
1248
|
break;
|
|
1234
1249
|
case "eval":
|
|
1235
|
-
userArgs =
|
|
1250
|
+
userArgs = argv2.slice(1);
|
|
1236
1251
|
break;
|
|
1237
1252
|
default:
|
|
1238
1253
|
throw new Error(`unexpected parse option { from: '${parseOptions.from}' }`);
|
|
@@ -1755,18 +1770,18 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1755
1770
|
this.error(message, { code: "commander.missingMandatoryOptionValue" });
|
|
1756
1771
|
}
|
|
1757
1772
|
_conflictingOption(option, conflictingOption) {
|
|
1758
|
-
const findBestOptionFromValue = (
|
|
1759
|
-
const optionKey =
|
|
1773
|
+
const findBestOptionFromValue = (option) => {
|
|
1774
|
+
const optionKey = option.attributeName();
|
|
1760
1775
|
const optionValue = this.getOptionValue(optionKey);
|
|
1761
1776
|
const negativeOption = this.options.find((target) => target.negate && optionKey === target.attributeName());
|
|
1762
1777
|
const positiveOption = this.options.find((target) => !target.negate && optionKey === target.attributeName());
|
|
1763
1778
|
if (negativeOption && (negativeOption.presetArg === undefined && optionValue === false || negativeOption.presetArg !== undefined && optionValue === negativeOption.presetArg)) {
|
|
1764
1779
|
return negativeOption;
|
|
1765
1780
|
}
|
|
1766
|
-
return positiveOption ||
|
|
1781
|
+
return positiveOption || option;
|
|
1767
1782
|
};
|
|
1768
|
-
const getErrorMessage = (
|
|
1769
|
-
const bestOption = findBestOptionFromValue(
|
|
1783
|
+
const getErrorMessage = (option) => {
|
|
1784
|
+
const bestOption = findBestOptionFromValue(option);
|
|
1770
1785
|
const optionKey = bestOption.attributeName();
|
|
1771
1786
|
const source = this.getOptionValueSource(optionKey);
|
|
1772
1787
|
if (source === "env") {
|
|
@@ -1920,10 +1935,10 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1920
1935
|
this._name = path.basename(filename, path.extname(filename));
|
|
1921
1936
|
return this;
|
|
1922
1937
|
}
|
|
1923
|
-
executableDir(
|
|
1924
|
-
if (
|
|
1938
|
+
executableDir(path) {
|
|
1939
|
+
if (path === undefined)
|
|
1925
1940
|
return this._executableDir;
|
|
1926
|
-
this._executableDir =
|
|
1941
|
+
this._executableDir = path;
|
|
1927
1942
|
return this;
|
|
1928
1943
|
}
|
|
1929
1944
|
helpInformation(contextOptions) {
|
|
@@ -2020,11 +2035,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2020
2035
|
}
|
|
2021
2036
|
help(contextOptions) {
|
|
2022
2037
|
this.outputHelp(contextOptions);
|
|
2023
|
-
let
|
|
2024
|
-
if (
|
|
2025
|
-
|
|
2038
|
+
let exitCode2 = Number(process2.exitCode ?? 0);
|
|
2039
|
+
if (exitCode2 === 0 && contextOptions && typeof contextOptions !== "function" && contextOptions.error) {
|
|
2040
|
+
exitCode2 = 1;
|
|
2026
2041
|
}
|
|
2027
|
-
this._exit(
|
|
2042
|
+
this._exit(exitCode2, "commander.help", "(outputHelp)");
|
|
2028
2043
|
}
|
|
2029
2044
|
addHelpText(position, text) {
|
|
2030
2045
|
const allowedValues = ["beforeAll", "before", "after", "afterAll"];
|
|
@@ -2096,25 +2111,86 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2096
2111
|
exports.useColor = useColor;
|
|
2097
2112
|
});
|
|
2098
2113
|
|
|
2114
|
+
// ../common/src/result-types.ts
|
|
2115
|
+
var RESULTS = {
|
|
2116
|
+
Success: "Success",
|
|
2117
|
+
Failure: "Failure",
|
|
2118
|
+
ConfigError: "ConfigError",
|
|
2119
|
+
AuthenticationError: "AuthenticationError",
|
|
2120
|
+
ValidationError: "ValidationError",
|
|
2121
|
+
TimeoutError: "TimeoutError"
|
|
2122
|
+
};
|
|
2123
|
+
|
|
2099
2124
|
// ../../node_modules/commander/index.js
|
|
2100
|
-
var
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2125
|
+
var exports_commander = {};
|
|
2126
|
+
__exportCjs(exports_commander, {
|
|
2127
|
+
program: () => $program,
|
|
2128
|
+
createCommand: () => $createCommand,
|
|
2129
|
+
createOption: () => $createOption,
|
|
2130
|
+
createArgument: () => $createArgument,
|
|
2131
|
+
Command: () => $Command,
|
|
2132
|
+
Option: () => $Option,
|
|
2133
|
+
Argument: () => $Argument,
|
|
2134
|
+
Help: () => $Help,
|
|
2135
|
+
CommanderError: () => $CommanderError,
|
|
2136
|
+
InvalidArgumentError: () => $InvalidArgumentError,
|
|
2137
|
+
InvalidOptionArgumentError: () => $InvalidOptionArgumentError
|
|
2138
|
+
}, {
|
|
2139
|
+
program: (value) => $program = value,
|
|
2140
|
+
createCommand: (value) => $createCommand = value,
|
|
2141
|
+
createOption: (value) => $createOption = value,
|
|
2142
|
+
createArgument: (value) => $createArgument = value,
|
|
2143
|
+
Command: (value) => $Command = value,
|
|
2144
|
+
Option: (value) => $Option = value,
|
|
2145
|
+
Argument: (value) => $Argument = value,
|
|
2146
|
+
Help: (value) => $Help = value,
|
|
2147
|
+
CommanderError: (value) => $CommanderError = value,
|
|
2148
|
+
InvalidArgumentError: (value) => $InvalidArgumentError = value,
|
|
2149
|
+
InvalidOptionArgumentError: (value) => $InvalidOptionArgumentError = value
|
|
2117
2150
|
});
|
|
2151
|
+
var { Argument } = require_argument();
|
|
2152
|
+
var { Command: Command2 } = require_command();
|
|
2153
|
+
var { CommanderError, InvalidArgumentError } = require_error();
|
|
2154
|
+
var { Help } = require_help();
|
|
2155
|
+
var { Option: Option2 } = require_option();
|
|
2156
|
+
var $program = new Command2;
|
|
2157
|
+
var $createCommand = (name) => new Command2(name);
|
|
2158
|
+
var $createOption = (flags, description) => new Option2(flags, description);
|
|
2159
|
+
var $createArgument = (name, description) => new Argument(name, description);
|
|
2160
|
+
var $Command = Command2;
|
|
2161
|
+
var $Option = Option2;
|
|
2162
|
+
var $Argument = Argument;
|
|
2163
|
+
var $Help = Help;
|
|
2164
|
+
var $CommanderError = CommanderError;
|
|
2165
|
+
var $InvalidArgumentError = InvalidArgumentError;
|
|
2166
|
+
var $InvalidOptionArgumentError = InvalidArgumentError;
|
|
2167
|
+
|
|
2168
|
+
// ../../node_modules/commander/esm.mjs
|
|
2169
|
+
var {
|
|
2170
|
+
program,
|
|
2171
|
+
createCommand,
|
|
2172
|
+
createArgument,
|
|
2173
|
+
createOption,
|
|
2174
|
+
CommanderError: CommanderError2,
|
|
2175
|
+
InvalidArgumentError: InvalidArgumentError2,
|
|
2176
|
+
InvalidOptionArgumentError,
|
|
2177
|
+
Command,
|
|
2178
|
+
Argument: Argument2,
|
|
2179
|
+
Option,
|
|
2180
|
+
Help: Help2
|
|
2181
|
+
} = exports_commander;
|
|
2182
|
+
|
|
2183
|
+
// ../common/src/preview.ts
|
|
2184
|
+
var previewSlot = singleton("PreviewBuild");
|
|
2185
|
+
function isPreviewBuild() {
|
|
2186
|
+
return previewSlot.get(false) ?? false;
|
|
2187
|
+
}
|
|
2188
|
+
Command.prototype.previewCommand = function(nameAndArgs, opts) {
|
|
2189
|
+
if (isPreviewBuild()) {
|
|
2190
|
+
return this.command(nameAndArgs, opts);
|
|
2191
|
+
}
|
|
2192
|
+
return new Command(nameAndArgs.split(/\s+/)[0] ?? nameAndArgs);
|
|
2193
|
+
};
|
|
2118
2194
|
|
|
2119
2195
|
// ../common/src/output-context.ts
|
|
2120
2196
|
function createStorage() {
|
|
@@ -2333,6 +2409,86 @@ function getLogFilePath() {
|
|
|
2333
2409
|
return logger.getLogFilePath();
|
|
2334
2410
|
}
|
|
2335
2411
|
|
|
2412
|
+
// ../common/src/registry.ts
|
|
2413
|
+
import { execFileSync } from "node:child_process";
|
|
2414
|
+
function readRegistryValue(keyPath, valueName) {
|
|
2415
|
+
if (process.platform !== "win32") {
|
|
2416
|
+
return "";
|
|
2417
|
+
}
|
|
2418
|
+
const [error, output] = catchError(() => execFileSync("reg", ["query", keyPath, "/v", valueName], {
|
|
2419
|
+
encoding: "utf-8",
|
|
2420
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
2421
|
+
windowsHide: true
|
|
2422
|
+
}));
|
|
2423
|
+
if (error) {
|
|
2424
|
+
return "";
|
|
2425
|
+
}
|
|
2426
|
+
const match = output.match(new RegExp(`${valueName}\\s+REG_SZ\\s+(.+)`));
|
|
2427
|
+
return match?.[1]?.trim() ?? "";
|
|
2428
|
+
}
|
|
2429
|
+
|
|
2430
|
+
// ../common/src/telemetry/logger-telemetry-provider.ts
|
|
2431
|
+
class LoggerTelemetryProvider {
|
|
2432
|
+
analyticsUniqueId;
|
|
2433
|
+
constructor() {
|
|
2434
|
+
this.analyticsUniqueId = readRegistryValue("HKCU\\Software\\UiPath", "AnalyticsUniqueId");
|
|
2435
|
+
}
|
|
2436
|
+
enrich(properties) {
|
|
2437
|
+
return {
|
|
2438
|
+
...properties,
|
|
2439
|
+
...this.analyticsUniqueId ? { analyticsUniqueId: this.analyticsUniqueId } : {}
|
|
2440
|
+
};
|
|
2441
|
+
}
|
|
2442
|
+
async trackEvent({ name, properties }) {
|
|
2443
|
+
logger.debug(formatMessage("Event", name, this.enrich(properties)));
|
|
2444
|
+
}
|
|
2445
|
+
async trackException({
|
|
2446
|
+
error,
|
|
2447
|
+
properties
|
|
2448
|
+
}) {
|
|
2449
|
+
logger.error(formatMessage("Exception", error.message, this.enrich({
|
|
2450
|
+
...properties,
|
|
2451
|
+
stack: error.stack
|
|
2452
|
+
})));
|
|
2453
|
+
}
|
|
2454
|
+
async trackRequest({
|
|
2455
|
+
name,
|
|
2456
|
+
durationMs,
|
|
2457
|
+
success,
|
|
2458
|
+
properties
|
|
2459
|
+
}) {
|
|
2460
|
+
logger.debug(formatMessage("Request", name, this.enrich({
|
|
2461
|
+
...properties,
|
|
2462
|
+
duration: `${durationMs}ms`,
|
|
2463
|
+
success
|
|
2464
|
+
})));
|
|
2465
|
+
}
|
|
2466
|
+
async trackDependency({
|
|
2467
|
+
name,
|
|
2468
|
+
type,
|
|
2469
|
+
durationMs,
|
|
2470
|
+
success,
|
|
2471
|
+
properties
|
|
2472
|
+
}) {
|
|
2473
|
+
logger.debug(formatMessage("Dependency", name, this.enrich({
|
|
2474
|
+
...properties,
|
|
2475
|
+
type,
|
|
2476
|
+
duration: `${durationMs}ms`,
|
|
2477
|
+
success
|
|
2478
|
+
})));
|
|
2479
|
+
}
|
|
2480
|
+
}
|
|
2481
|
+
function formatMessage(category, name, properties) {
|
|
2482
|
+
let message = `[Telemetry] [${category}] ${name}`;
|
|
2483
|
+
if (properties && Object.keys(properties).length > 0) {
|
|
2484
|
+
const propsStr = Object.entries(properties).filter(([_, value]) => value !== undefined).map(([key, value]) => `${key}=${value}`).join(", ");
|
|
2485
|
+
if (propsStr) {
|
|
2486
|
+
message += ` | ${propsStr}`;
|
|
2487
|
+
}
|
|
2488
|
+
}
|
|
2489
|
+
return message;
|
|
2490
|
+
}
|
|
2491
|
+
|
|
2336
2492
|
// ../common/src/telemetry/debug-telemetry-provider.ts
|
|
2337
2493
|
class DebugTelemetryProvider {
|
|
2338
2494
|
async trackEvent({ name }) {
|
|
@@ -2357,7 +2513,6 @@ class DebugTelemetryProvider {
|
|
|
2357
2513
|
logger.debug(`[Telemetry] Dependency: ${name} [${type}] (${durationMs}ms, ${success ? "ok" : "fail"})`);
|
|
2358
2514
|
}
|
|
2359
2515
|
}
|
|
2360
|
-
|
|
2361
2516
|
// ../common/src/telemetry/node-context-storage.ts
|
|
2362
2517
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2363
2518
|
|
|
@@ -2445,87 +2600,6 @@ function recordCommandDuration(durationMs) {
|
|
|
2445
2600
|
}
|
|
2446
2601
|
getState().commandMs = durationMs;
|
|
2447
2602
|
}
|
|
2448
|
-
|
|
2449
|
-
// ../common/src/registry.ts
|
|
2450
|
-
import { execFileSync } from "node:child_process";
|
|
2451
|
-
function readRegistryValue(keyPath, valueName) {
|
|
2452
|
-
if (process.platform !== "win32") {
|
|
2453
|
-
return "";
|
|
2454
|
-
}
|
|
2455
|
-
const [error, output] = catchError(() => execFileSync("reg", ["query", keyPath, "/v", valueName], {
|
|
2456
|
-
encoding: "utf-8",
|
|
2457
|
-
stdio: ["pipe", "pipe", "pipe"],
|
|
2458
|
-
windowsHide: true
|
|
2459
|
-
}));
|
|
2460
|
-
if (error) {
|
|
2461
|
-
return "";
|
|
2462
|
-
}
|
|
2463
|
-
const match = output.match(new RegExp(`${valueName}\\s+REG_SZ\\s+(.+)`));
|
|
2464
|
-
return match?.[1]?.trim() ?? "";
|
|
2465
|
-
}
|
|
2466
|
-
|
|
2467
|
-
// ../common/src/telemetry/logger-telemetry-provider.ts
|
|
2468
|
-
class LoggerTelemetryProvider {
|
|
2469
|
-
analyticsUniqueId;
|
|
2470
|
-
constructor() {
|
|
2471
|
-
this.analyticsUniqueId = readRegistryValue("HKCU\\Software\\UiPath", "AnalyticsUniqueId");
|
|
2472
|
-
}
|
|
2473
|
-
enrich(properties) {
|
|
2474
|
-
return {
|
|
2475
|
-
...properties,
|
|
2476
|
-
...this.analyticsUniqueId ? { analyticsUniqueId: this.analyticsUniqueId } : {}
|
|
2477
|
-
};
|
|
2478
|
-
}
|
|
2479
|
-
async trackEvent({ name, properties }) {
|
|
2480
|
-
logger.debug(formatMessage("Event", name, this.enrich(properties)));
|
|
2481
|
-
}
|
|
2482
|
-
async trackException({
|
|
2483
|
-
error,
|
|
2484
|
-
properties
|
|
2485
|
-
}) {
|
|
2486
|
-
logger.error(formatMessage("Exception", error.message, this.enrich({
|
|
2487
|
-
...properties,
|
|
2488
|
-
stack: error.stack
|
|
2489
|
-
})));
|
|
2490
|
-
}
|
|
2491
|
-
async trackRequest({
|
|
2492
|
-
name,
|
|
2493
|
-
durationMs,
|
|
2494
|
-
success,
|
|
2495
|
-
properties
|
|
2496
|
-
}) {
|
|
2497
|
-
logger.debug(formatMessage("Request", name, this.enrich({
|
|
2498
|
-
...properties,
|
|
2499
|
-
duration: `${durationMs}ms`,
|
|
2500
|
-
success
|
|
2501
|
-
})));
|
|
2502
|
-
}
|
|
2503
|
-
async trackDependency({
|
|
2504
|
-
name,
|
|
2505
|
-
type,
|
|
2506
|
-
durationMs,
|
|
2507
|
-
success,
|
|
2508
|
-
properties
|
|
2509
|
-
}) {
|
|
2510
|
-
logger.debug(formatMessage("Dependency", name, this.enrich({
|
|
2511
|
-
...properties,
|
|
2512
|
-
type,
|
|
2513
|
-
duration: `${durationMs}ms`,
|
|
2514
|
-
success
|
|
2515
|
-
})));
|
|
2516
|
-
}
|
|
2517
|
-
}
|
|
2518
|
-
function formatMessage(category, name, properties) {
|
|
2519
|
-
let message = `[Telemetry] [${category}] ${name}`;
|
|
2520
|
-
if (properties && Object.keys(properties).length > 0) {
|
|
2521
|
-
const propsStr = Object.entries(properties).filter(([_, value]) => value !== undefined).map(([key, value]) => `${key}=${value}`).join(", ");
|
|
2522
|
-
if (propsStr) {
|
|
2523
|
-
message += ` | ${propsStr}`;
|
|
2524
|
-
}
|
|
2525
|
-
}
|
|
2526
|
-
return message;
|
|
2527
|
-
}
|
|
2528
|
-
|
|
2529
2603
|
// ../common/src/telemetry/proxy-http-agent.ts
|
|
2530
2604
|
var slot = singleton("ProxyAuthHttpsAgent");
|
|
2531
2605
|
|
|
@@ -2567,9 +2641,22 @@ var telemetry = new Proxy({}, {
|
|
|
2567
2641
|
return typeof value === "function" ? value.bind(instance) : value;
|
|
2568
2642
|
}
|
|
2569
2643
|
});
|
|
2644
|
+
|
|
2570
2645
|
// ../common/src/exit-code.ts
|
|
2571
2646
|
function setExitCode(code) {
|
|
2572
2647
|
process.exitCode = code;
|
|
2648
|
+
recordExitCode(code);
|
|
2649
|
+
}
|
|
2650
|
+
var GENERIC_FAILURE_EXIT_CODE = 1;
|
|
2651
|
+
function recordCommandExit(code) {
|
|
2652
|
+
if (code === GENERIC_FAILURE_EXIT_CODE && getExitCode() !== 0) {
|
|
2653
|
+
return;
|
|
2654
|
+
}
|
|
2655
|
+
setExitCode(code);
|
|
2656
|
+
}
|
|
2657
|
+
function getExitCode() {
|
|
2658
|
+
const code = process.exitCode;
|
|
2659
|
+
return typeof code === "number" ? code : 0;
|
|
2573
2660
|
}
|
|
2574
2661
|
|
|
2575
2662
|
// ../common/src/output-codecs.ts
|
|
@@ -2578,12 +2665,12 @@ var jmespathSlot = singleton("JmespathCodec");
|
|
|
2578
2665
|
async function loadOutputCodecsAsync(needed) {
|
|
2579
2666
|
const loads = [];
|
|
2580
2667
|
if (needed.yaml && yamlSlot.get() === undefined) {
|
|
2581
|
-
loads.push(import("./js-yaml-
|
|
2668
|
+
loads.push(import("./js-yaml-a2bk27p6.js").then((mod) => {
|
|
2582
2669
|
yamlSlot.set(mod);
|
|
2583
2670
|
}));
|
|
2584
2671
|
}
|
|
2585
2672
|
if (needed.filter && jmespathSlot.get() === undefined) {
|
|
2586
|
-
loads.push(import("./jmespath-
|
|
2673
|
+
loads.push(import("./jmespath-ab6tdc42.js").then((m)=>__toESM(m.default,1)).then((mod) => {
|
|
2587
2674
|
jmespathSlot.set(mod);
|
|
2588
2675
|
}));
|
|
2589
2676
|
}
|
|
@@ -2726,17 +2813,8 @@ function terminalSignalFor(input, outcome) {
|
|
|
2726
2813
|
}
|
|
2727
2814
|
return outcome === "cancelled" ? "SIGINT" : undefined;
|
|
2728
2815
|
}
|
|
2729
|
-
function
|
|
2730
|
-
|
|
2731
|
-
return "auth";
|
|
2732
|
-
}
|
|
2733
|
-
if (status === 400 || status === 409 || status === 422) {
|
|
2734
|
-
return "validation";
|
|
2735
|
-
}
|
|
2736
|
-
if (status === 408) {
|
|
2737
|
-
return "timeout";
|
|
2738
|
-
}
|
|
2739
|
-
return "network_http";
|
|
2816
|
+
function classifyFailingHttpStatus(status) {
|
|
2817
|
+
return classifyFromErrorCode(classifyHttpStatus(status)?.errorCode) ?? "network_http";
|
|
2740
2818
|
}
|
|
2741
2819
|
function classifyFromResult(result) {
|
|
2742
2820
|
switch (result) {
|
|
@@ -2816,7 +2894,7 @@ function classifyError(input) {
|
|
|
2816
2894
|
}
|
|
2817
2895
|
const status = recorded?.context?.httpStatus ?? findHttpStatusInGraph(input.error);
|
|
2818
2896
|
if (status !== undefined) {
|
|
2819
|
-
return
|
|
2897
|
+
return classifyFailingHttpStatus(status);
|
|
2820
2898
|
}
|
|
2821
2899
|
return classifyFromResult(recorded?.result) ?? classifyFromErrorCode(recorded?.errorCode) ?? classifyFromError(input.error) ?? "unknown";
|
|
2822
2900
|
}
|
|
@@ -2848,9 +2926,9 @@ function buildCommandTerminalTelemetryProperties(input) {
|
|
|
2848
2926
|
var CommonTelemetryEvents = {
|
|
2849
2927
|
Start: "Application.Start",
|
|
2850
2928
|
Error: "Application.Error",
|
|
2929
|
+
ProjectActivity: "Cli.ProjectActivity",
|
|
2851
2930
|
ShipSucceeded: "Cli.ShipSucceeded"
|
|
2852
2931
|
};
|
|
2853
|
-
|
|
2854
2932
|
// ../common/src/formatter.ts
|
|
2855
2933
|
var ANSI_STYLES = {
|
|
2856
2934
|
red: "\x1B[31m",
|
|
@@ -2860,58 +2938,6 @@ var ANSI_RESET = "\x1B[0m";
|
|
|
2860
2938
|
function styleLine(line, style) {
|
|
2861
2939
|
return style ? `${ANSI_STYLES[style]}${line}${ANSI_RESET}` : line;
|
|
2862
2940
|
}
|
|
2863
|
-
var CLI_ERROR_CODES = [
|
|
2864
|
-
"invalid_argument",
|
|
2865
|
-
"authentication_required",
|
|
2866
|
-
"permission_denied",
|
|
2867
|
-
"local_permission_denied",
|
|
2868
|
-
"not_found",
|
|
2869
|
-
"rate_limited",
|
|
2870
|
-
"network_error",
|
|
2871
|
-
"timeout",
|
|
2872
|
-
"server_error",
|
|
2873
|
-
"method_not_allowed",
|
|
2874
|
-
"not_supported",
|
|
2875
|
-
"configuration_error",
|
|
2876
|
-
"execution_failed",
|
|
2877
|
-
"unknown_error"
|
|
2878
|
-
];
|
|
2879
|
-
var RETRY_HINTS = [
|
|
2880
|
-
"RetryWillNotFix",
|
|
2881
|
-
"RetryLater",
|
|
2882
|
-
"RetryAfter1Second",
|
|
2883
|
-
"RetryAfter10Seconds",
|
|
2884
|
-
"RetryAfter30Seconds",
|
|
2885
|
-
"RetryAfter60Seconds"
|
|
2886
|
-
];
|
|
2887
|
-
var CLI_ERROR_CODE_VALUES = new Set(CLI_ERROR_CODES);
|
|
2888
|
-
var RETRY_HINT_VALUES = new Set(RETRY_HINTS);
|
|
2889
|
-
function isCliErrorCode(value) {
|
|
2890
|
-
return typeof value === "string" && CLI_ERROR_CODE_VALUES.has(value);
|
|
2891
|
-
}
|
|
2892
|
-
function isRetryHint(value) {
|
|
2893
|
-
return typeof value === "string" && RETRY_HINT_VALUES.has(value);
|
|
2894
|
-
}
|
|
2895
|
-
function carriedErrorCode(error) {
|
|
2896
|
-
if (!error || typeof error !== "object")
|
|
2897
|
-
return;
|
|
2898
|
-
const code = error.errorCode;
|
|
2899
|
-
return isCliErrorCode(code) ? code : undefined;
|
|
2900
|
-
}
|
|
2901
|
-
function carriedRetry(error) {
|
|
2902
|
-
if (!error || typeof error !== "object")
|
|
2903
|
-
return;
|
|
2904
|
-
const retry = error.retry;
|
|
2905
|
-
return isRetryHint(retry) ? retry : undefined;
|
|
2906
|
-
}
|
|
2907
|
-
var RESULTS = {
|
|
2908
|
-
Success: "Success",
|
|
2909
|
-
Failure: "Failure",
|
|
2910
|
-
ConfigError: "ConfigError",
|
|
2911
|
-
AuthenticationError: "AuthenticationError",
|
|
2912
|
-
ValidationError: "ValidationError",
|
|
2913
|
-
TimeoutError: "TimeoutError"
|
|
2914
|
-
};
|
|
2915
2941
|
var EXIT_CODES = {
|
|
2916
2942
|
Success: 0,
|
|
2917
2943
|
Failure: 1,
|
|
@@ -2920,6 +2946,9 @@ var EXIT_CODES = {
|
|
|
2920
2946
|
ValidationError: 3,
|
|
2921
2947
|
TimeoutError: 4
|
|
2922
2948
|
};
|
|
2949
|
+
function exitCodeForResult(result) {
|
|
2950
|
+
return EXIT_CODES[result] ?? EXIT_CODES.Failure;
|
|
2951
|
+
}
|
|
2923
2952
|
|
|
2924
2953
|
class Pagination {
|
|
2925
2954
|
Returned;
|
|
@@ -3766,40 +3795,11 @@ function defaultErrorCodeForResult(result) {
|
|
|
3766
3795
|
return "unknown_error";
|
|
3767
3796
|
}
|
|
3768
3797
|
}
|
|
3769
|
-
function parseHttpStatusFromMessage(message) {
|
|
3770
|
-
const match = /^HTTP\s+(\d{3})(?::|\s|-|$)/i.exec(message.trim());
|
|
3771
|
-
if (!match)
|
|
3772
|
-
return;
|
|
3773
|
-
const status = Number(match[1]);
|
|
3774
|
-
return Number.isInteger(status) && status >= 100 && status <= 599 ? status : undefined;
|
|
3775
|
-
}
|
|
3776
|
-
function defaultErrorCodeForHttpStatus(status) {
|
|
3777
|
-
if (status === undefined)
|
|
3778
|
-
return;
|
|
3779
|
-
if (status === 400 || status === 409 || status === 422) {
|
|
3780
|
-
return "invalid_argument";
|
|
3781
|
-
}
|
|
3782
|
-
if (status === 401)
|
|
3783
|
-
return "authentication_required";
|
|
3784
|
-
if (status === 403)
|
|
3785
|
-
return "permission_denied";
|
|
3786
|
-
if (status === 404)
|
|
3787
|
-
return "not_found";
|
|
3788
|
-
if (status === 405)
|
|
3789
|
-
return "method_not_allowed";
|
|
3790
|
-
if (status === 408)
|
|
3791
|
-
return "timeout";
|
|
3792
|
-
if (status === 429)
|
|
3793
|
-
return "rate_limited";
|
|
3794
|
-
if (status >= 500 && status < 600)
|
|
3795
|
-
return "server_error";
|
|
3796
|
-
return;
|
|
3797
|
-
}
|
|
3798
3798
|
var LOCAL_PERMISSION_TEXT_PATTERN = new RegExp(`(?:\\b|\\()(?:${[...LOCAL_PERMISSION_ERROR_CODES].join("|")})(?::\\s|\\))`);
|
|
3799
3799
|
function defaultErrorCodeForFailure(data) {
|
|
3800
3800
|
if (data.Result === RESULTS.Failure) {
|
|
3801
3801
|
const status = data.Context?.httpStatus ?? parseHttpStatusFromMessage(data.Message);
|
|
3802
|
-
const errorCode =
|
|
3802
|
+
const errorCode = classifyHttpStatus(status)?.errorCode;
|
|
3803
3803
|
if (errorCode)
|
|
3804
3804
|
return errorCode;
|
|
3805
3805
|
if (status === undefined && (LOCAL_PERMISSION_TEXT_PATTERN.test(data.Message) || LOCAL_PERMISSION_TEXT_PATTERN.test(data.Instructions))) {
|
|
@@ -3808,17 +3808,6 @@ function defaultErrorCodeForFailure(data) {
|
|
|
3808
3808
|
}
|
|
3809
3809
|
return defaultErrorCodeForResult(data.Result);
|
|
3810
3810
|
}
|
|
3811
|
-
function defaultRetryForErrorCode(errorCode) {
|
|
3812
|
-
switch (errorCode) {
|
|
3813
|
-
case "network_error":
|
|
3814
|
-
case "rate_limited":
|
|
3815
|
-
case "server_error":
|
|
3816
|
-
case "timeout":
|
|
3817
|
-
return "RetryLater";
|
|
3818
|
-
default:
|
|
3819
|
-
return "RetryWillNotFix";
|
|
3820
|
-
}
|
|
3821
|
-
}
|
|
3822
3811
|
var OutputFormatter;
|
|
3823
3812
|
((OutputFormatter) => {
|
|
3824
3813
|
function success(data, options) {
|
|
@@ -3850,7 +3839,7 @@ var OutputFormatter;
|
|
|
3850
3839
|
data.Log ??= getLogFilePath() || undefined;
|
|
3851
3840
|
data.ErrorCode ??= defaultErrorCodeForFailure(data);
|
|
3852
3841
|
data.Retry ??= defaultRetryForErrorCode(data.ErrorCode);
|
|
3853
|
-
const exitCode =
|
|
3842
|
+
const exitCode = exitCodeForResult(data.Result);
|
|
3854
3843
|
setExitCode(exitCode);
|
|
3855
3844
|
recordCommandFailureTelemetry({
|
|
3856
3845
|
result: data.Result,
|
|
@@ -3945,33 +3934,271 @@ var OutputFormatter;
|
|
|
3945
3934
|
OutputFormatter.formatToString = formatToString;
|
|
3946
3935
|
})(OutputFormatter ||= {});
|
|
3947
3936
|
|
|
3948
|
-
//
|
|
3949
|
-
var
|
|
3950
|
-
var
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3937
|
+
// ../common/src/project-telemetry.ts
|
|
3938
|
+
var RESOLVER = Symbol.for("@uipath/common/projectTelemetryResolver");
|
|
3939
|
+
var CAPTURE = Symbol.for("@uipath/common/projectTelemetryCapture");
|
|
3940
|
+
var CONTEXT_RESOLVER = Symbol.for("@uipath/common/projectContextTelemetryResolver");
|
|
3941
|
+
var RULES = Symbol.for("@uipath/common/projectTargetRules");
|
|
3942
|
+
function logSkipped(what, error) {
|
|
3943
|
+
logger.debug(`[project-telemetry] ${what} skipped: ${error instanceof Error ? error.message : String(error)}`);
|
|
3944
|
+
}
|
|
3945
|
+
function bounded(work, what) {
|
|
3946
|
+
return withinProjectIdentityBudget(work, () => logSkipped(what, `no answer within ${PROJECT_IDENTITY_LOOKUP_BUDGET_MS} ms`));
|
|
3947
|
+
}
|
|
3948
|
+
async function identityWithContext(command, identity) {
|
|
3949
|
+
const props = projectIdentityProperties(identity);
|
|
3950
|
+
if (!identity.projectDirectory || isProjectTelemetryDisabled())
|
|
3951
|
+
return props;
|
|
3952
|
+
for (let node = command;node; node = node.parent ?? undefined) {
|
|
3953
|
+
const resolver = node[CONTEXT_RESOLVER];
|
|
3954
|
+
if (typeof resolver !== "function")
|
|
3955
|
+
continue;
|
|
3956
|
+
try {
|
|
3957
|
+
return {
|
|
3958
|
+
...await resolver(identity.projectDirectory),
|
|
3959
|
+
...props
|
|
3960
|
+
};
|
|
3961
|
+
} catch (error) {
|
|
3962
|
+
logSkipped("solution context lookup", error);
|
|
3963
|
+
return props;
|
|
3964
|
+
}
|
|
3965
|
+
}
|
|
3966
|
+
return props;
|
|
3967
|
+
}
|
|
3968
|
+
function configureProjectTelemetry(command, resolver) {
|
|
3969
|
+
command[RESOLVER] = resolver;
|
|
3970
|
+
}
|
|
3971
|
+
function getProjectTelemetryResolver(command) {
|
|
3972
|
+
for (let node = command;node; node = node.parent) {
|
|
3973
|
+
const resolver = node[RESOLVER];
|
|
3974
|
+
if (typeof resolver === "function")
|
|
3975
|
+
return resolver;
|
|
3976
|
+
}
|
|
3977
|
+
return;
|
|
3978
|
+
}
|
|
3979
|
+
function getProjectTelemetryCapture(command) {
|
|
3980
|
+
const capture = command?.[CAPTURE];
|
|
3981
|
+
return capture !== null && typeof capture === "object" ? capture : undefined;
|
|
3982
|
+
}
|
|
3983
|
+
function attachProjectTelemetryCapture(command, capture) {
|
|
3984
|
+
command[CAPTURE] = capture;
|
|
3985
|
+
}
|
|
3986
|
+
function createIdentityCommandResolver(root, rules, read) {
|
|
3987
|
+
const record = root;
|
|
3988
|
+
record[RULES] = [...ruleSets(root), rules];
|
|
3989
|
+
return async ({ command, args, phase, target, success }) => {
|
|
3990
|
+
const parts = [];
|
|
3991
|
+
for (let node = command;node && node !== root; node = node.parent) {
|
|
3992
|
+
parts.unshift(node.name());
|
|
3993
|
+
}
|
|
3994
|
+
const rule = rules[parts.join(" ")] ?? rules[parts[0]];
|
|
3995
|
+
if (!rule || rule.create && phase === "before")
|
|
3996
|
+
return;
|
|
3997
|
+
if (rule.create && !success)
|
|
3998
|
+
return;
|
|
3999
|
+
if (phase === "after" && !rule.create && target === undefined)
|
|
4000
|
+
return;
|
|
4001
|
+
const opts = command.opts();
|
|
4002
|
+
let selected = target;
|
|
4003
|
+
for (const name of rule.options ?? []) {
|
|
4004
|
+
if (selected === undefined && typeof opts[name] === "string")
|
|
4005
|
+
selected = opts[name];
|
|
4006
|
+
}
|
|
4007
|
+
for (const name of rule.arguments ?? []) {
|
|
4008
|
+
const index = command.registeredArguments.findIndex((arg) => arg.name() === name);
|
|
4009
|
+
if (selected === undefined && index >= 0 && typeof args[index] === "string")
|
|
4010
|
+
selected = args[index];
|
|
4011
|
+
}
|
|
4012
|
+
selected ??= rule.defaultTarget;
|
|
4013
|
+
if (selected === undefined)
|
|
4014
|
+
return;
|
|
4015
|
+
return read(selected, command);
|
|
4016
|
+
};
|
|
4017
|
+
}
|
|
3963
4018
|
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
4019
|
+
class ProjectTelemetrySession {
|
|
4020
|
+
resolver;
|
|
4021
|
+
command;
|
|
4022
|
+
target;
|
|
4023
|
+
props = {};
|
|
4024
|
+
explicit = false;
|
|
4025
|
+
input;
|
|
4026
|
+
constructor(resolver, command) {
|
|
4027
|
+
this.resolver = resolver;
|
|
4028
|
+
this.command = command;
|
|
4029
|
+
}
|
|
4030
|
+
async setTarget(path) {
|
|
4031
|
+
this.target = path;
|
|
4032
|
+
if (this.input) {
|
|
4033
|
+
await this.resolve({
|
|
4034
|
+
...this.input,
|
|
4035
|
+
phase: "after",
|
|
4036
|
+
success: true
|
|
4037
|
+
});
|
|
4038
|
+
this.explicit = true;
|
|
4039
|
+
}
|
|
4040
|
+
}
|
|
4041
|
+
async setIdentity(identity) {
|
|
4042
|
+
try {
|
|
4043
|
+
const props = await bounded(identityWithContext(this.command, identity), "project identity capture");
|
|
4044
|
+
if (props !== undefined)
|
|
4045
|
+
this.setProperties(props);
|
|
4046
|
+
} catch (error) {
|
|
4047
|
+
logSkipped("project identity capture", error);
|
|
4048
|
+
}
|
|
4049
|
+
}
|
|
4050
|
+
setProperties(properties) {
|
|
4051
|
+
try {
|
|
4052
|
+
this.props = { ...properties };
|
|
4053
|
+
this.explicit = true;
|
|
4054
|
+
} catch (error) {
|
|
4055
|
+
logSkipped("project identity properties", error);
|
|
4056
|
+
}
|
|
4057
|
+
}
|
|
4058
|
+
properties() {
|
|
4059
|
+
return { ...this.props };
|
|
4060
|
+
}
|
|
4061
|
+
async resolve(input) {
|
|
4062
|
+
this.input = input;
|
|
4063
|
+
if (this.explicit)
|
|
4064
|
+
return;
|
|
4065
|
+
try {
|
|
4066
|
+
const props = await bounded(this.resolver({
|
|
4067
|
+
...input,
|
|
4068
|
+
target: this.target
|
|
4069
|
+
}), `project identity (${input.phase})`);
|
|
4070
|
+
if (props !== undefined) {
|
|
4071
|
+
this.props = props;
|
|
4072
|
+
}
|
|
4073
|
+
} catch (error) {
|
|
4074
|
+
logSkipped(`project identity (${input.phase})`, error);
|
|
4075
|
+
}
|
|
4076
|
+
}
|
|
3968
4077
|
}
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
4078
|
+
function ruleSets(root) {
|
|
4079
|
+
const sets = root[RULES];
|
|
4080
|
+
return Array.isArray(sets) ? sets : [];
|
|
4081
|
+
}
|
|
4082
|
+
|
|
4083
|
+
// ../common/src/pass-through-tail.ts
|
|
4084
|
+
function maybeOption(arg) {
|
|
4085
|
+
return arg.length > 1 && arg[0] === "-";
|
|
4086
|
+
}
|
|
4087
|
+
function tokenizeTail(cmd, tail) {
|
|
4088
|
+
const find = (flag) => cmd.options.find((option) => option.long === flag || option.short === flag);
|
|
4089
|
+
const digitShort = cmd.options.some((option) => option.short !== undefined && /^-\d$/.test(option.short));
|
|
4090
|
+
const negativeNumber = (arg) => !digitShort && /^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(arg);
|
|
4091
|
+
const tokens = [];
|
|
4092
|
+
let firstUnknown = -1;
|
|
4093
|
+
let sentinel = -1;
|
|
4094
|
+
let variadic;
|
|
4095
|
+
let group;
|
|
4096
|
+
let groupIndex = 0;
|
|
4097
|
+
let i = 0;
|
|
4098
|
+
while (i < tail.length || group !== undefined) {
|
|
4099
|
+
const index = group === undefined ? i : groupIndex;
|
|
4100
|
+
const arg = group ?? tail[i++];
|
|
4101
|
+
group = undefined;
|
|
4102
|
+
if (arg === "--") {
|
|
4103
|
+
sentinel = index;
|
|
4104
|
+
tokens.push({ kind: "sentinel", index });
|
|
4105
|
+
for (let j = i;j < tail.length; j++) {
|
|
4106
|
+
tokens.push({
|
|
4107
|
+
kind: "operand",
|
|
4108
|
+
index: j,
|
|
4109
|
+
text: tail[j],
|
|
4110
|
+
literal: true
|
|
4111
|
+
});
|
|
4112
|
+
}
|
|
4113
|
+
break;
|
|
4114
|
+
}
|
|
4115
|
+
if (variadic && (!maybeOption(arg) || negativeNumber(arg))) {
|
|
4116
|
+
tokens.push({
|
|
4117
|
+
kind: "option",
|
|
4118
|
+
index,
|
|
4119
|
+
text: arg,
|
|
4120
|
+
option: variadic,
|
|
4121
|
+
value: arg
|
|
4122
|
+
});
|
|
4123
|
+
continue;
|
|
4124
|
+
}
|
|
4125
|
+
variadic = undefined;
|
|
4126
|
+
if (maybeOption(arg)) {
|
|
4127
|
+
const option = find(arg);
|
|
4128
|
+
if (option) {
|
|
4129
|
+
let value;
|
|
4130
|
+
if (option.required) {
|
|
4131
|
+
value = tail[i];
|
|
4132
|
+
if (value !== undefined)
|
|
4133
|
+
i++;
|
|
4134
|
+
} else if (option.optional) {
|
|
4135
|
+
const next = tail[i];
|
|
4136
|
+
if (next !== undefined && (!maybeOption(next) || negativeNumber(next))) {
|
|
4137
|
+
value = next;
|
|
4138
|
+
i++;
|
|
4139
|
+
}
|
|
4140
|
+
}
|
|
4141
|
+
tokens.push({
|
|
4142
|
+
kind: "option",
|
|
4143
|
+
index,
|
|
4144
|
+
text: arg,
|
|
4145
|
+
option,
|
|
4146
|
+
...value === undefined ? {} : { value }
|
|
4147
|
+
});
|
|
4148
|
+
variadic = option.variadic ? option : undefined;
|
|
4149
|
+
continue;
|
|
4150
|
+
}
|
|
4151
|
+
}
|
|
4152
|
+
if (arg.length > 2 && arg[0] === "-" && arg[1] !== "-") {
|
|
4153
|
+
const option = find(`-${arg[1]}`);
|
|
4154
|
+
if (option) {
|
|
4155
|
+
if (option.required || option.optional) {
|
|
4156
|
+
tokens.push({
|
|
4157
|
+
kind: "option",
|
|
4158
|
+
index,
|
|
4159
|
+
text: arg,
|
|
4160
|
+
option,
|
|
4161
|
+
value: arg.slice(2)
|
|
4162
|
+
});
|
|
4163
|
+
} else {
|
|
4164
|
+
tokens.push({ kind: "option", index, text: arg, option });
|
|
4165
|
+
group = `-${arg.slice(2)}`;
|
|
4166
|
+
groupIndex = index;
|
|
4167
|
+
}
|
|
4168
|
+
continue;
|
|
4169
|
+
}
|
|
4170
|
+
}
|
|
4171
|
+
if (/^--[^=]+=/.test(arg)) {
|
|
4172
|
+
const equals = arg.indexOf("=");
|
|
4173
|
+
const option = find(arg.slice(0, equals));
|
|
4174
|
+
if (option && (option.required || option.optional)) {
|
|
4175
|
+
tokens.push({
|
|
4176
|
+
kind: "option",
|
|
4177
|
+
index,
|
|
4178
|
+
text: arg,
|
|
4179
|
+
option,
|
|
4180
|
+
value: arg.slice(equals + 1)
|
|
4181
|
+
});
|
|
4182
|
+
continue;
|
|
4183
|
+
}
|
|
4184
|
+
}
|
|
4185
|
+
if (maybeOption(arg) && !negativeNumber(arg)) {
|
|
4186
|
+
const equals = arg.startsWith("--") ? arg.indexOf("=") : -1;
|
|
4187
|
+
if (firstUnknown === -1)
|
|
4188
|
+
firstUnknown = index;
|
|
4189
|
+
tokens.push({
|
|
4190
|
+
kind: "unknown",
|
|
4191
|
+
index,
|
|
4192
|
+
text: arg,
|
|
4193
|
+
flag: equals > 0 ? arg.slice(0, equals) : arg,
|
|
4194
|
+
...equals > 0 ? { inlineValue: arg.slice(equals + 1) } : {}
|
|
4195
|
+
});
|
|
4196
|
+
continue;
|
|
4197
|
+
}
|
|
4198
|
+
tokens.push({ kind: "operand", index, text: arg, literal: false });
|
|
3972
4199
|
}
|
|
3973
|
-
return
|
|
3974
|
-
}
|
|
4200
|
+
return { tokens, firstUnknown, sentinel };
|
|
4201
|
+
}
|
|
3975
4202
|
|
|
3976
4203
|
// ../common/src/telemetry/command-name.ts
|
|
3977
4204
|
var TELEMETRY_NAME_ROOT = "Cli";
|
|
@@ -4041,8 +4268,7 @@ var pollSignalSlot = singleton("PollSignal");
|
|
|
4041
4268
|
var TELEMETRY_COMMAND_ARG_PREFIX = "uip.cmd.arg.";
|
|
4042
4269
|
var processContext = {
|
|
4043
4270
|
exit: (code) => {
|
|
4044
|
-
|
|
4045
|
-
setExitCode(code);
|
|
4271
|
+
recordCommandExit(code);
|
|
4046
4272
|
},
|
|
4047
4273
|
get pollSignal() {
|
|
4048
4274
|
return pollSignalSlot.get();
|
|
@@ -4067,6 +4293,8 @@ function recordableArgValue(value, choices) {
|
|
|
4067
4293
|
function extractCommandParams(cmd) {
|
|
4068
4294
|
const params = {};
|
|
4069
4295
|
forEachSuppliedArgument(cmd, (name, value, choices, defaulted) => {
|
|
4296
|
+
if (name === undefined)
|
|
4297
|
+
return;
|
|
4070
4298
|
const recordable = recordableArgValue(value, choices);
|
|
4071
4299
|
params[`${TELEMETRY_COMMAND_ARG_PREFIX}${name}`] = recordable === TELEMETRY_ARG_VALUE_WITHHELD && defaulted ? TELEMETRY_ARG_VALUE_DEFAULTED : recordable;
|
|
4072
4300
|
});
|
|
@@ -4082,7 +4310,8 @@ function isDefaultedPositional(cmd, index) {
|
|
|
4082
4310
|
function forEachSuppliedArgument(cmd, visit) {
|
|
4083
4311
|
const registered = cmd.registeredArguments ?? [];
|
|
4084
4312
|
const processed = cmd.processedArgs ?? [];
|
|
4085
|
-
|
|
4313
|
+
const bound = boundPositionalCount(cmd);
|
|
4314
|
+
for (let i = 0;i < bound; i++) {
|
|
4086
4315
|
const name = registered[i].name();
|
|
4087
4316
|
if (name && processed[i] !== undefined) {
|
|
4088
4317
|
visit(name, processed[i], registered[i].argChoices, isDefaultedPositional(cmd, i));
|
|
@@ -4097,6 +4326,71 @@ function forEachSuppliedArgument(cmd, visit) {
|
|
|
4097
4326
|
visit(key, value, choicesByAttribute.get(key), isDefaultedOption(cmd, key));
|
|
4098
4327
|
}
|
|
4099
4328
|
}
|
|
4329
|
+
forEachPassThroughToken(cmd, bound, (name, value) => {
|
|
4330
|
+
visit(name, value, name === undefined ? undefined : choicesByAttribute.get(name), false);
|
|
4331
|
+
});
|
|
4332
|
+
}
|
|
4333
|
+
function boundPositionalCount(cmd) {
|
|
4334
|
+
const registered = cmd.registeredArguments ?? [];
|
|
4335
|
+
if (registered.some((argument) => argument.variadic)) {
|
|
4336
|
+
return registered.length;
|
|
4337
|
+
}
|
|
4338
|
+
if ((cmd.args ?? []).length <= registered.length) {
|
|
4339
|
+
return registered.length;
|
|
4340
|
+
}
|
|
4341
|
+
const firstFlag = tokenizeTail(cmd, (cmd.args ?? []).slice(1)).tokens.find((token) => token.kind !== "operand")?.index ?? -1;
|
|
4342
|
+
return firstFlag === -1 ? registered.length : Math.min(registered.length, firstFlag + 1);
|
|
4343
|
+
}
|
|
4344
|
+
function forEachPassThroughToken(cmd, bound, visit) {
|
|
4345
|
+
const registered = cmd.registeredArguments ?? [];
|
|
4346
|
+
const fillsPositionals = !registered.some((argument) => argument.variadic);
|
|
4347
|
+
const { tokens, firstUnknown } = tokenizeTail(cmd, (cmd.args ?? []).slice(bound));
|
|
4348
|
+
const repeated = new Map;
|
|
4349
|
+
let nextPositional = bound;
|
|
4350
|
+
for (const token of tokens) {
|
|
4351
|
+
const pastUnknown = firstUnknown !== -1 && token.index > firstUnknown;
|
|
4352
|
+
if (token.kind === "sentinel")
|
|
4353
|
+
continue;
|
|
4354
|
+
if (token.kind === "operand") {
|
|
4355
|
+
const claimable = !pastUnknown && fillsPositionals && nextPositional < registered.length;
|
|
4356
|
+
const name = claimable ? registered[nextPositional++].name() : undefined;
|
|
4357
|
+
visit(name || undefined, token.text);
|
|
4358
|
+
continue;
|
|
4359
|
+
}
|
|
4360
|
+
if (token.kind === "unknown") {
|
|
4361
|
+
const bare = token.flag.replace(/^-+/, "");
|
|
4362
|
+
const key = bare.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
|
|
4363
|
+
const keyable = token.flag.startsWith("--") || token.flag.length === 2;
|
|
4364
|
+
if (!pastUnknown && keyable && /^[a-z][a-z0-9-]*$/i.test(bare) && key) {
|
|
4365
|
+
visit(key, token.inlineValue ?? true);
|
|
4366
|
+
} else {
|
|
4367
|
+
visit(undefined, token.text);
|
|
4368
|
+
if (token.inlineValue !== undefined) {
|
|
4369
|
+
visit(undefined, token.inlineValue);
|
|
4370
|
+
} else if (!token.flag.startsWith("--") && token.flag.length > 2) {
|
|
4371
|
+
visit(undefined, token.flag.slice(2));
|
|
4372
|
+
}
|
|
4373
|
+
}
|
|
4374
|
+
continue;
|
|
4375
|
+
}
|
|
4376
|
+
if (pastUnknown) {
|
|
4377
|
+
visit(undefined, token.text);
|
|
4378
|
+
if (token.value !== undefined)
|
|
4379
|
+
visit(undefined, token.value);
|
|
4380
|
+
continue;
|
|
4381
|
+
}
|
|
4382
|
+
const option = token.option;
|
|
4383
|
+
const name = option.attributeName();
|
|
4384
|
+
const value = option.negate ? false : option.required || option.optional ? token.value ?? true : true;
|
|
4385
|
+
const previous = repeated.get(name);
|
|
4386
|
+
if (previous) {
|
|
4387
|
+
previous.push(value);
|
|
4388
|
+
visit(name, previous);
|
|
4389
|
+
} else {
|
|
4390
|
+
repeated.set(name, [value]);
|
|
4391
|
+
visit(name, value);
|
|
4392
|
+
}
|
|
4393
|
+
}
|
|
4100
4394
|
}
|
|
4101
4395
|
function withheldArgumentValues(cmd) {
|
|
4102
4396
|
const values = [];
|
|
@@ -4158,6 +4452,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
4158
4452
|
const telemetryName = commandTelemetryName(commandParts);
|
|
4159
4453
|
const commandPath = commandInvocationPath(commandParts);
|
|
4160
4454
|
const props = typeof properties === "function" ? properties(...args) : properties;
|
|
4455
|
+
const projectResolver = getProjectTelemetryResolver(command);
|
|
4456
|
+
const projectSession = projectResolver && !isProjectTelemetryDisabled() ? new ProjectTelemetrySession(projectResolver, command) : undefined;
|
|
4161
4457
|
markCommandStart();
|
|
4162
4458
|
const supplied = recordSuppliedArgumentValues(withheldArgumentValues(command));
|
|
4163
4459
|
try {
|
|
@@ -4170,6 +4466,12 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
4170
4466
|
if (violation) {
|
|
4171
4467
|
return Promise.reject(violation);
|
|
4172
4468
|
}
|
|
4469
|
+
if (projectSession) {
|
|
4470
|
+
return projectSession.resolve({ command, args, phase: "before" }).then(() => {
|
|
4471
|
+
attachProjectTelemetryCapture(command, projectSession);
|
|
4472
|
+
return fn(...args);
|
|
4473
|
+
});
|
|
4474
|
+
}
|
|
4173
4475
|
return fn(...args);
|
|
4174
4476
|
}));
|
|
4175
4477
|
if (error) {
|
|
@@ -4178,22 +4480,26 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
4178
4480
|
const typed = error;
|
|
4179
4481
|
const customInstructions = typeof typed.instructions === "string" ? typed.instructions : undefined;
|
|
4180
4482
|
const customResult = typeof typed.result === "string" && typed.result !== RESULTS.Success && Object.values(RESULTS).includes(typed.result) ? typed.result : undefined;
|
|
4181
|
-
const
|
|
4483
|
+
const cancellationExitCode = typed.exitCode === 130 || isPromptCancellation(error) ? 130 : undefined;
|
|
4484
|
+
const classified = cancellationExitCode === undefined ? await extractErrorDetails(error) : undefined;
|
|
4485
|
+
const finalResult = customResult ?? classified?.result ?? RESULTS.Failure;
|
|
4182
4486
|
const typedErrorCode = typed.errorCode ?? typed.ErrorCode;
|
|
4183
4487
|
const customErrorCode = isCliErrorCode(typedErrorCode) ? typedErrorCode : undefined;
|
|
4184
4488
|
const typedRetry = typed.retry ?? typed.Retry;
|
|
4185
4489
|
const customRetry = isRetryHint(typedRetry) ? typedRetry : undefined;
|
|
4186
4490
|
const typedContext = typed.context ?? typed.Context;
|
|
4187
4491
|
const customContext = isErrorContext(typedContext) ? typedContext : undefined;
|
|
4188
|
-
const cancellationExitCode = typed.exitCode === 130 || isPromptCancellation(error) ? 130 : undefined;
|
|
4189
4492
|
fallbackExitCode = cancellationExitCode ?? EXIT_CODES[finalResult];
|
|
4493
|
+
const errorCode = customErrorCode ?? classified?.errorCode;
|
|
4494
|
+
const retry = customRetry ?? classified?.retry;
|
|
4495
|
+
const errorContext = customContext ?? classified?.context;
|
|
4190
4496
|
OutputFormatter.error({
|
|
4191
4497
|
Result: finalResult,
|
|
4192
|
-
...
|
|
4498
|
+
...errorCode ? { ErrorCode: errorCode } : {},
|
|
4193
4499
|
Message: errorMessage,
|
|
4194
4500
|
Instructions: customInstructions ?? commandHelpHint(commandPath),
|
|
4195
|
-
...
|
|
4196
|
-
...
|
|
4501
|
+
...retry ? { Retry: retry } : {},
|
|
4502
|
+
...errorContext ? { Context: errorContext } : {}
|
|
4197
4503
|
});
|
|
4198
4504
|
context.exit(fallbackExitCode);
|
|
4199
4505
|
}
|
|
@@ -4202,6 +4508,14 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
4202
4508
|
const exitCode = fallbackExitCode === 130 ? fallbackExitCode : exitCodeFromProcess(fallbackExitCode);
|
|
4203
4509
|
const recordedFailure = takeRecordedCommandFailureTelemetry();
|
|
4204
4510
|
const success = !error && exitCode === 0;
|
|
4511
|
+
if (projectSession) {
|
|
4512
|
+
await projectSession.resolve({
|
|
4513
|
+
command,
|
|
4514
|
+
args,
|
|
4515
|
+
phase: "after",
|
|
4516
|
+
success
|
|
4517
|
+
});
|
|
4518
|
+
}
|
|
4205
4519
|
const terminalTelemetry = buildCommandTerminalTelemetryProperties({
|
|
4206
4520
|
error,
|
|
4207
4521
|
exitCode,
|
|
@@ -4219,6 +4533,7 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
4219
4533
|
}
|
|
4220
4534
|
const baseProperties = redactProperties({
|
|
4221
4535
|
...commandParams,
|
|
4536
|
+
...projectSession?.properties(),
|
|
4222
4537
|
...props,
|
|
4223
4538
|
...buildCommandTelemetryAttribution(commandPath, process.env.UIPATH_SKILL),
|
|
4224
4539
|
...buildAgentSessionTelemetry(process.env),
|
|
@@ -4229,6 +4544,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
4229
4544
|
});
|
|
4230
4545
|
emitInvocationRequest(telemetryName, success, baseProperties);
|
|
4231
4546
|
} finally {
|
|
4547
|
+
if (projectSession)
|
|
4548
|
+
attachProjectTelemetryCapture(command, undefined);
|
|
4232
4549
|
releaseSuppliedArgumentValues(supplied);
|
|
4233
4550
|
}
|
|
4234
4551
|
});
|
|
@@ -4244,17 +4561,6 @@ function isGuid(value) {
|
|
|
4244
4561
|
return GUID_REGEX.test(value);
|
|
4245
4562
|
}
|
|
4246
4563
|
|
|
4247
|
-
// ../common/src/http-status.ts
|
|
4248
|
-
function httpStatusOf(error) {
|
|
4249
|
-
if (!error || typeof error !== "object") {
|
|
4250
|
-
return;
|
|
4251
|
-
}
|
|
4252
|
-
if ("response" in error && error.response && typeof error.response === "object" && "status" in error.response && typeof error.response.status === "number") {
|
|
4253
|
-
return error.response.status;
|
|
4254
|
-
}
|
|
4255
|
-
return "status" in error && typeof error.status === "number" ? error.status : undefined;
|
|
4256
|
-
}
|
|
4257
|
-
|
|
4258
4564
|
// ../common/src/option-validators.ts
|
|
4259
4565
|
function parseLimit(raw, _previous) {
|
|
4260
4566
|
return parseBoundedInt(raw, "--limit", { min: 1, max: 1e4 });
|
|
@@ -4265,14 +4571,14 @@ function parseOffset(raw, _previous) {
|
|
|
4265
4571
|
function parseBoundedInt(raw, optionName, bounds) {
|
|
4266
4572
|
const normalized = raw.trim();
|
|
4267
4573
|
if (normalized === "") {
|
|
4268
|
-
throw new
|
|
4574
|
+
throw new InvalidArgumentError2(`${optionName} requires a value (got empty).`);
|
|
4269
4575
|
}
|
|
4270
4576
|
if (!/^-?\d+$/.test(normalized)) {
|
|
4271
|
-
throw new
|
|
4577
|
+
throw new InvalidArgumentError2(`${optionName} must be an integer, got '${normalized}'.`);
|
|
4272
4578
|
}
|
|
4273
4579
|
const n = parseInt(normalized, 10);
|
|
4274
4580
|
if (n < bounds.min || n > bounds.max) {
|
|
4275
|
-
throw new
|
|
4581
|
+
throw new InvalidArgumentError2(`${optionName} must be between ${bounds.min} and ${bounds.max}, got ${n}.`);
|
|
4276
4582
|
}
|
|
4277
4583
|
return n;
|
|
4278
4584
|
}
|
|
@@ -4310,6 +4616,15 @@ var REASON_BY_OUTCOME = {
|
|
|
4310
4616
|
[PollOutcome.Interrupted]: "poll_failed",
|
|
4311
4617
|
[PollOutcome.Aborted]: "poll_aborted"
|
|
4312
4618
|
};
|
|
4619
|
+
function classifyOutcome(outcome, error) {
|
|
4620
|
+
if (outcome === PollOutcome.Timeout) {
|
|
4621
|
+
return { errorCode: "timeout", retry: "RetryLater" };
|
|
4622
|
+
}
|
|
4623
|
+
if (outcome === PollOutcome.Failed && error !== undefined) {
|
|
4624
|
+
return classifyThrownError(error);
|
|
4625
|
+
}
|
|
4626
|
+
return {};
|
|
4627
|
+
}
|
|
4313
4628
|
function mapPollFailure(pollResult, label) {
|
|
4314
4629
|
const outcome = pollResult.outcome;
|
|
4315
4630
|
const errMsg = pollResult.error?.message ?? "too many consecutive errors";
|
|
@@ -4319,13 +4634,11 @@ function mapPollFailure(pollResult, label) {
|
|
|
4319
4634
|
[PollOutcome.Interrupted]: `${label} polling was interrupted`,
|
|
4320
4635
|
[PollOutcome.Aborted]: `${label} polling was aborted`
|
|
4321
4636
|
};
|
|
4322
|
-
const timedOut = outcome === PollOutcome.Timeout;
|
|
4323
4637
|
return {
|
|
4324
4638
|
reason: REASON_BY_OUTCOME[outcome],
|
|
4325
4639
|
message: messageByOutcome[outcome],
|
|
4326
|
-
exitCode:
|
|
4327
|
-
|
|
4328
|
-
retry: timedOut ? "RetryLater" : undefined
|
|
4640
|
+
exitCode: outcome === PollOutcome.Timeout ? 2 : 1,
|
|
4641
|
+
...classifyOutcome(outcome, pollResult.error)
|
|
4329
4642
|
};
|
|
4330
4643
|
}
|
|
4331
4644
|
// ../common/src/polling/format-utils.ts
|
|
@@ -4420,11 +4733,31 @@ function interruptibleSleep(ms, signal) {
|
|
|
4420
4733
|
function sanitizeMaxErrors(value) {
|
|
4421
4734
|
if (value === undefined)
|
|
4422
4735
|
return POLL_DEFAULTS.maxConsecutiveErrors;
|
|
4423
|
-
if (
|
|
4736
|
+
if (value < 0)
|
|
4424
4737
|
return 0;
|
|
4425
4738
|
return Math.floor(value);
|
|
4426
4739
|
}
|
|
4740
|
+
function requireFinite(value, field) {
|
|
4741
|
+
if (value !== undefined && !Number.isFinite(value)) {
|
|
4742
|
+
throw new RangeError(`pollUntil: ${field} must be a finite number, got ${String(value)}.`);
|
|
4743
|
+
}
|
|
4744
|
+
}
|
|
4745
|
+
function assertFiniteSettings(options) {
|
|
4746
|
+
requireFinite(options.timeoutMs, "timeoutMs");
|
|
4747
|
+
if (typeof options.intervalMs === "number") {
|
|
4748
|
+
requireFinite(options.intervalMs, "intervalMs");
|
|
4749
|
+
}
|
|
4750
|
+
requireFinite(options.maxConsecutiveErrors, "maxConsecutiveErrors");
|
|
4751
|
+
requireFinite(options.logIntervalMs, "logIntervalMs");
|
|
4752
|
+
if (typeof options.backoff === "object" && options.backoff !== null) {
|
|
4753
|
+
requireFinite(options.backoff.initialMs, "backoff.initialMs");
|
|
4754
|
+
requireFinite(options.backoff.multiplier, "backoff.multiplier");
|
|
4755
|
+
requireFinite(options.backoff.maxMs, "backoff.maxMs");
|
|
4756
|
+
requireFinite(options.backoff.jitter, "backoff.jitter");
|
|
4757
|
+
}
|
|
4758
|
+
}
|
|
4427
4759
|
function resolveConfig(options) {
|
|
4760
|
+
assertFiniteSettings(options);
|
|
4428
4761
|
const timeoutMs = Math.max(0, options.timeoutMs ?? POLL_DEFAULTS.timeoutMs);
|
|
4429
4762
|
const startTime = Date.now();
|
|
4430
4763
|
return {
|
|
@@ -4782,14 +5115,39 @@ function withPseudonymizedIdentifiers(payload) {
|
|
|
4782
5115
|
}
|
|
4783
5116
|
};
|
|
4784
5117
|
}
|
|
4785
|
-
function
|
|
5118
|
+
function identityKeysOf(capture) {
|
|
5119
|
+
if (!capture) {
|
|
5120
|
+
return {};
|
|
5121
|
+
}
|
|
5122
|
+
try {
|
|
5123
|
+
const properties = capture.properties?.();
|
|
5124
|
+
if (typeof properties !== "object" || properties === null) {
|
|
5125
|
+
return {};
|
|
5126
|
+
}
|
|
5127
|
+
const keys = {};
|
|
5128
|
+
for (const key of GUID_KEY_DIMENSIONS) {
|
|
5129
|
+
const value = properties[key];
|
|
5130
|
+
if (value !== undefined) {
|
|
5131
|
+
keys[key] = value;
|
|
5132
|
+
}
|
|
5133
|
+
}
|
|
5134
|
+
return keys;
|
|
5135
|
+
} catch (error) {
|
|
5136
|
+
logSkipped("ship identity", error);
|
|
5137
|
+
return {};
|
|
5138
|
+
}
|
|
5139
|
+
}
|
|
5140
|
+
function trackShipSucceeded(payload, capture) {
|
|
4786
5141
|
const keys = getShippedKeys();
|
|
4787
5142
|
const key = dedupeKey(payload);
|
|
4788
5143
|
if (keys.has(key)) {
|
|
4789
5144
|
return false;
|
|
4790
5145
|
}
|
|
4791
5146
|
keys.add(key);
|
|
4792
|
-
telemetry.trackEvent(CommonTelemetryEvents.ShipSucceeded, redactProperties(
|
|
5147
|
+
telemetry.trackEvent(CommonTelemetryEvents.ShipSucceeded, redactProperties({
|
|
5148
|
+
...withPseudonymizedIdentifiers(payload),
|
|
5149
|
+
...identityKeysOf(capture)
|
|
5150
|
+
}));
|
|
4793
5151
|
return true;
|
|
4794
5152
|
}
|
|
4795
5153
|
|
|
@@ -4832,8 +5190,98 @@ async function loadPackagerTool(specifier) {
|
|
|
4832
5190
|
logger.debug(`No packager factory provider registered; loaded '${specifier}' directly.`);
|
|
4833
5191
|
return;
|
|
4834
5192
|
}
|
|
5193
|
+
// ../common/src/error-instructions.ts
|
|
5194
|
+
function extractHttpStatus(err) {
|
|
5195
|
+
if (!err || typeof err !== "object")
|
|
5196
|
+
return;
|
|
5197
|
+
const e = err;
|
|
5198
|
+
const structured = e.response?.status ?? e.status ?? e.statusCode;
|
|
5199
|
+
if (structured !== undefined)
|
|
5200
|
+
return structured;
|
|
5201
|
+
return typeof e.message === "string" ? parseHttpStatusFromMessage(e.message) : undefined;
|
|
5202
|
+
}
|
|
5203
|
+
var GENERIC = "Check authentication and parameters";
|
|
5204
|
+
function hasIdentityInstructionContext(err) {
|
|
5205
|
+
return err !== null && typeof err === "object" && "instructionContext" in err && err.instructionContext === "identity";
|
|
5206
|
+
}
|
|
5207
|
+
function instructionsFor(ctx, err) {
|
|
5208
|
+
if (ctx === "auth" && hasIdentityInstructionContext(err)) {
|
|
5209
|
+
return instructionsFor("identity");
|
|
5210
|
+
}
|
|
5211
|
+
switch (ctx) {
|
|
5212
|
+
case "auth":
|
|
5213
|
+
return "Run 'uip login' to authenticate. To inspect the current session, run 'uip whoami'.";
|
|
5214
|
+
case "auth-configuration":
|
|
5215
|
+
return "Fix the authentication settings named in Message, then retry.";
|
|
5216
|
+
case "identity":
|
|
5217
|
+
return "Select an active tenant with 'uip login tenant set <tenant>' and ensure your login includes an organization";
|
|
5218
|
+
case "input-parse":
|
|
5219
|
+
return "Ensure --inputs is valid JSON or pipe JSON via stdin";
|
|
5220
|
+
case "input-validate":
|
|
5221
|
+
return "Fix the flagged input fields to match the process's input schema";
|
|
5222
|
+
case "flag-format":
|
|
5223
|
+
return "Check the flag value format — see --help for the expected shape";
|
|
5224
|
+
case "permissions":
|
|
5225
|
+
return "Confirm your user has the required permissions in this folder/tenant, or re-authenticate with 'uip login' if your session has lapsed";
|
|
5226
|
+
case "backend": {
|
|
5227
|
+
const status = extractHttpStatus(err);
|
|
5228
|
+
if (status === 401) {
|
|
5229
|
+
return "Re-authenticate with 'uip login' — your session is invalid or expired";
|
|
5230
|
+
}
|
|
5231
|
+
if (status === 403) {
|
|
5232
|
+
return "Confirm your user has access to the resource, and the required permissions in this folder or tenant";
|
|
5233
|
+
}
|
|
5234
|
+
if (status === 404) {
|
|
5235
|
+
return "Verify the resource exists in the current folder/tenant";
|
|
5236
|
+
}
|
|
5237
|
+
if (status === 400 || status === 422) {
|
|
5238
|
+
return "Request was rejected — check flag values and inputs";
|
|
5239
|
+
}
|
|
5240
|
+
if (status === 405) {
|
|
5241
|
+
return "Check the command name and the base URL in use — the endpoint may not exist";
|
|
5242
|
+
}
|
|
5243
|
+
if (status === 408) {
|
|
5244
|
+
return "The request timed out — retry; if it persists, narrow the request (e.g. --limit on list commands)";
|
|
5245
|
+
}
|
|
5246
|
+
if (status === 409) {
|
|
5247
|
+
return "The resource already exists, or changed since it was read — list it to see the current state";
|
|
5248
|
+
}
|
|
5249
|
+
if (status === 413) {
|
|
5250
|
+
return "The upload is over the size limit — exclude unused dependencies or drop large files, then retry";
|
|
5251
|
+
}
|
|
5252
|
+
if (status === 429) {
|
|
5253
|
+
return "Rate limit reached — wait and retry; when the service suggests a delay, Retry and Context.retryAfter carry it";
|
|
5254
|
+
}
|
|
5255
|
+
if (status !== undefined && status >= 500 && status < 600) {
|
|
5256
|
+
return "The service returned a server error — retry; if it persists, check service status";
|
|
5257
|
+
}
|
|
5258
|
+
const permission = describePermissionError(err);
|
|
5259
|
+
if (permission) {
|
|
5260
|
+
return permission.instructions;
|
|
5261
|
+
}
|
|
5262
|
+
const connectivity = describeConnectivityError(err);
|
|
5263
|
+
if (connectivity) {
|
|
5264
|
+
return connectivity.instructions;
|
|
5265
|
+
}
|
|
5266
|
+
return GENERIC;
|
|
5267
|
+
}
|
|
5268
|
+
}
|
|
5269
|
+
}
|
|
5270
|
+
|
|
4835
5271
|
// ../common/src/classified-failure.ts
|
|
4836
5272
|
var MAX_QUOTED_BODY_CHARS = 200;
|
|
5273
|
+
async function authContextFailure(error, sessionInstructions) {
|
|
5274
|
+
const details = await extractErrorDetails(error);
|
|
5275
|
+
const missingIdentity = hasIdentityInstructionContext(error);
|
|
5276
|
+
return {
|
|
5277
|
+
Result: details.errorCode === "configuration_error" ? RESULTS.ConfigError : details.errorCode === "authentication_required" ? RESULTS.AuthenticationError : details.result,
|
|
5278
|
+
ErrorCode: details.errorCode,
|
|
5279
|
+
Message: details.message,
|
|
5280
|
+
Instructions: details.errorCode === "configuration_error" ? instructionsFor("auth-configuration") : details.errorCode === "authentication_required" && !missingIdentity && sessionInstructions !== undefined ? sessionInstructions : instructionsFor(details.errorCode === "authentication_required" ? "auth" : "backend", error),
|
|
5281
|
+
Retry: details.retry,
|
|
5282
|
+
...details.context ? { Context: details.context } : {}
|
|
5283
|
+
};
|
|
5284
|
+
}
|
|
4837
5285
|
function summarizePlatformBody(body) {
|
|
4838
5286
|
const trimmed = body.trim().replace(/\s+/g, " ");
|
|
4839
5287
|
return trimmed.length > MAX_QUOTED_BODY_CHARS ? `${trimmed.slice(0, MAX_QUOTED_BODY_CHARS)}…` : trimmed;
|
|
@@ -5235,6 +5683,6 @@ var ScreenLogger;
|
|
|
5235
5683
|
}
|
|
5236
5684
|
ScreenLogger.progress = progress;
|
|
5237
5685
|
})(ScreenLogger ||= {});
|
|
5238
|
-
export {
|
|
5686
|
+
export { RESULTS, authContextFailure, summarizePlatformBody, Command, Option, isPreviewBuild, logger, CommonTelemetryEvents, DebugTelemetryProvider, NodeContextStorage, telemetry, Pagination, OutputFormatter, configureProjectTelemetry, getProjectTelemetryCapture, createIdentityCommandResolver, processContext, withCompleter, requireConfirmation, DEFAULT_PAGE_SIZE, resolveEnvReference, isGuid, resolveDeprecatedOptionAlias, warnDeprecatedOptionAlias, addDeprecatedOptionAlias, createHiddenDeprecatedTenantOption, parseLimit, parseOffset, parseBoundedInt, registerPackageMetadataOptions, mapPackageMetadataOptions, PollOutcome, mapPollFailure, pollUntil, quoteForShell, unsupportedSolutionProjectType, trackShipSucceeded, ensurePackagerFactory };
|
|
5239
5687
|
|
|
5240
|
-
//# debugId=
|
|
5688
|
+
//# debugId=BB19AE5D12C6BE5664756E2164756E21
|