@uipath/rules-tool 1.205.0-preview.277 → 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/DmnFactory-L7MABUC6-q2sr3grz.js +10 -0
- package/dist/DmnModelTypes-ATR7FVKZ-h8srwcxk.js +8 -0
- package/dist/KieDmnMarshaller-LGE63WDG-nfkpv8f4.js +8 -0
- package/dist/THIRD-PARTY-NOTICES.md +4 -4
- package/dist/business-rules-z2zw35qd.js +25 -0
- package/dist/{constants-cnn0jfw6.js → constants-1sdwfz26.js} +7 -15
- package/dist/{embedded-file-reader-z4becc02.js → embedded-file-reader-0228j82a.js} +1 -4
- package/dist/first-party-service-hegqxm82.js +8 -0
- package/dist/hitPolicyResult-CGCR73CW-jz89f1aa.js +12 -0
- package/dist/index-4a4x1ygg.js +24 -0
- package/dist/{index-52h8rpew.js → index-egzwtc07.js} +2 -4
- package/dist/{index-sby22td6.js → index-nzr4mx5p.js} +2 -22
- package/dist/index-xaxgkfez.js +23 -0
- package/dist/{tool-tjcg2xje.js → index-y5yffb2s.js} +3525 -236
- package/dist/index-z4kt2kt6.js +8 -0
- package/dist/{index-bhjt1h5c.js → index-zeszs1ra.js} +23 -66
- package/dist/index.js +8 -9
- package/dist/{jmespath-231m3hyn.js → jmespath-ab6tdc42.js} +1 -1
- package/dist/{js-yaml-88tdqrtd.js → js-yaml-a2bk27p6.js} +1 -3
- package/dist/rule-catalog-5qnmp0xp.js +71 -0
- package/dist/rules-command-error-30c8a3n9.js +13 -0
- package/dist/{rules-debug-service-830zfzcy.js → rules-debug-service-xc1cmwwh.js} +37 -38
- package/dist/{rules-init-service-qphmbh3k.js → rules-init-service-frjbgfcs.js} +12 -16
- package/dist/{rules-refresh-service-jn6my893.js → rules-refresh-service-18hrs394.js} +13 -14
- package/dist/{rules-validate-service-hfw8m3dm.js → rules-validate-service-s787ehrr.js} +10 -13
- package/dist/{tool-fk8rznma.js → tool-89e90qrm.js} +173 -223
- package/dist/{tool-fbxe48wd.js → tool-8cnhz30a.js} +13991 -15184
- package/dist/{tool-ey5djkhz.js → tool-8sjyv0xg.js} +659 -14
- package/dist/{tool-h7gn1rar.js → tool-93hqhaj3.js} +402 -417
- package/dist/{tool-c2xarvad.js → tool-cf9810hm.js} +32 -34
- package/dist/{tool-wf2qkrye.js → tool-cs8nyk0r.js} +990 -514
- package/dist/{tool-txp5th7j.js → tool-e23cj2jx.js} +127 -42
- package/dist/{tool-1de529jm.js → tool-epsr41wx.js} +12 -3
- package/dist/{tool-gkbr01gc.js → tool-fkppxa9f.js} +14 -17
- package/dist/{tool-86f1xpxn.js → tool-m59a481n.js} +18 -20
- package/dist/tool-mst6a4dr.js +73 -0
- package/dist/{tool-t4k013ex.js → tool-njnhj05q.js} +8 -8
- package/dist/tool-p7hqn93n.js +455 -0
- package/dist/{tool-z1ay3csx.js → tool-sbtf80ft.js} +66 -24
- package/dist/{tool-yq5jph4h.js → tool-vqm4apm6.js} +207 -216
- package/dist/tool.js +7 -8
- package/package.json +2 -2
- package/dist/DmnFactory-L7MABUC6-98k17dkr.js +0 -46
- package/dist/DmnModelTypes-ATR7FVKZ-jp35cecy.js +0 -18
- package/dist/KieDmnMarshaller-LGE63WDG-3vemswef.js +0 -20
- package/dist/business-rules-pm96sefm.js +0 -26
- package/dist/first-party-service-sd8yaf73.js +0 -27
- package/dist/hitPolicyResult-CGCR73CW-9bmc4nsr.js +0 -36
- package/dist/index-cpm94vee.js +0 -132
- package/dist/index-dqa169gp.js +0 -25
- package/dist/index-x9msn1dj.js +0 -85
- package/dist/index-ybrgtfsg.js +0 -3326
- package/dist/rule-catalog-10fhgevc.js +0 -74
- package/dist/rules-command-error-k6kxwfn7.js +0 -14
- package/dist/tool-1pccj6q3.js +0 -1116
- package/dist/tool-53w8skv5.js +0 -262
- package/dist/tool-7haj67tr.js +0 -19
- package/dist/tool-fbmxx07c.js +0 -73
- package/dist/tool-gdtpsdn7.js +0 -342
- package/dist/tool-jd313s2x.js +0 -10
- package/dist/tool-qgqscsjc.js +0 -46
- /package/dist/{tool-cfrcyxgm.js → tool-2nmqvfmt.js} +0 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
+
__toESM,
|
|
2
3
|
__commonJS,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} from "./tool-
|
|
4
|
+
__exportCjs,
|
|
5
|
+
__require
|
|
6
|
+
} from "./tool-epsr41wx.js";
|
|
6
7
|
|
|
7
8
|
// ../../node_modules/commander/lib/error.js
|
|
8
9
|
var require_error = __commonJS(function(exports) {
|
|
@@ -124,7 +125,7 @@ var require_help = __commonJS(function(exports) {
|
|
|
124
125
|
this.helpWidth = this.helpWidth ?? contextOptions.helpWidth ?? 80;
|
|
125
126
|
}
|
|
126
127
|
visibleCommands(cmd) {
|
|
127
|
-
const visibleCommands = cmd.commands.filter((
|
|
128
|
+
const visibleCommands = cmd.commands.filter((cmd) => !cmd._hidden);
|
|
128
129
|
const helpCommand = cmd._getHelpCommand();
|
|
129
130
|
if (helpCommand && !helpCommand._hidden) {
|
|
130
131
|
visibleCommands.push(helpCommand);
|
|
@@ -604,8 +605,8 @@ var require_option = __commonJS(function(exports) {
|
|
|
604
605
|
}
|
|
605
606
|
}
|
|
606
607
|
function camelcase(str) {
|
|
607
|
-
return str.split("-").reduce((
|
|
608
|
-
return
|
|
608
|
+
return str.split("-").reduce((str, word) => {
|
|
609
|
+
return str + word[0].toUpperCase() + word.slice(1);
|
|
609
610
|
});
|
|
610
611
|
}
|
|
611
612
|
function splitOptionFlags(flags) {
|
|
@@ -726,8 +727,8 @@ var require_suggestSimilar = __commonJS(function(exports) {
|
|
|
726
727
|
var require_command = __commonJS(function(exports) {
|
|
727
728
|
var EventEmitter = __require("node:events").EventEmitter;
|
|
728
729
|
var childProcess = __require("node:child_process");
|
|
729
|
-
var
|
|
730
|
-
var
|
|
730
|
+
var path = __require("node:path");
|
|
731
|
+
var fs = __require("node:fs");
|
|
731
732
|
var process2 = __require("node:process");
|
|
732
733
|
var { Argument, humanReadableArgName } = require_argument();
|
|
733
734
|
var { CommanderError } = require_error();
|
|
@@ -1176,44 +1177,44 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1176
1177
|
});
|
|
1177
1178
|
return source;
|
|
1178
1179
|
}
|
|
1179
|
-
_prepareUserArgs(
|
|
1180
|
-
if (
|
|
1180
|
+
_prepareUserArgs(argv2, parseOptions) {
|
|
1181
|
+
if (argv2 !== undefined && !Array.isArray(argv2)) {
|
|
1181
1182
|
throw new Error("first parameter to parse must be array or undefined");
|
|
1182
1183
|
}
|
|
1183
1184
|
parseOptions = parseOptions || {};
|
|
1184
|
-
if (
|
|
1185
|
+
if (argv2 === undefined && parseOptions.from === undefined) {
|
|
1185
1186
|
if (process2.versions?.electron) {
|
|
1186
1187
|
parseOptions.from = "electron";
|
|
1187
1188
|
}
|
|
1188
|
-
const
|
|
1189
|
-
if (
|
|
1189
|
+
const execArgv2 = process2.execArgv ?? [];
|
|
1190
|
+
if (execArgv2.includes("-e") || execArgv2.includes("--eval") || execArgv2.includes("-p") || execArgv2.includes("--print")) {
|
|
1190
1191
|
parseOptions.from = "eval";
|
|
1191
1192
|
}
|
|
1192
1193
|
}
|
|
1193
|
-
if (
|
|
1194
|
-
|
|
1194
|
+
if (argv2 === undefined) {
|
|
1195
|
+
argv2 = process2.argv;
|
|
1195
1196
|
}
|
|
1196
|
-
this.rawArgs =
|
|
1197
|
+
this.rawArgs = argv2.slice();
|
|
1197
1198
|
let userArgs;
|
|
1198
1199
|
switch (parseOptions.from) {
|
|
1199
1200
|
case undefined:
|
|
1200
1201
|
case "node":
|
|
1201
|
-
this._scriptPath =
|
|
1202
|
-
userArgs =
|
|
1202
|
+
this._scriptPath = argv2[1];
|
|
1203
|
+
userArgs = argv2.slice(2);
|
|
1203
1204
|
break;
|
|
1204
1205
|
case "electron":
|
|
1205
1206
|
if (process2.defaultApp) {
|
|
1206
|
-
this._scriptPath =
|
|
1207
|
-
userArgs =
|
|
1207
|
+
this._scriptPath = argv2[1];
|
|
1208
|
+
userArgs = argv2.slice(2);
|
|
1208
1209
|
} else {
|
|
1209
|
-
userArgs =
|
|
1210
|
+
userArgs = argv2.slice(1);
|
|
1210
1211
|
}
|
|
1211
1212
|
break;
|
|
1212
1213
|
case "user":
|
|
1213
|
-
userArgs =
|
|
1214
|
+
userArgs = argv2.slice(0);
|
|
1214
1215
|
break;
|
|
1215
1216
|
case "eval":
|
|
1216
|
-
userArgs =
|
|
1217
|
+
userArgs = argv2.slice(1);
|
|
1217
1218
|
break;
|
|
1218
1219
|
default:
|
|
1219
1220
|
throw new Error(`unexpected parse option { from: '${parseOptions.from}' }`);
|
|
@@ -1262,7 +1263,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1262
1263
|
this.processedArgs = [];
|
|
1263
1264
|
}
|
|
1264
1265
|
_checkForMissingExecutable(executableFile, executableDir, subcommandName) {
|
|
1265
|
-
if (
|
|
1266
|
+
if (fs.existsSync(executableFile))
|
|
1266
1267
|
return;
|
|
1267
1268
|
const executableDirMessage = executableDir ? `searched for local subcommand relative to directory '${executableDir}'` : "no directory for search for local subcommand, use .executableDir() to supply a custom directory";
|
|
1268
1269
|
const executableMissing = `'${executableFile}' does not exist
|
|
@@ -1276,12 +1277,12 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1276
1277
|
let launchWithNode = false;
|
|
1277
1278
|
const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
|
|
1278
1279
|
function findFile(baseDir, baseName) {
|
|
1279
|
-
const localBin =
|
|
1280
|
-
if (
|
|
1280
|
+
const localBin = path.resolve(baseDir, baseName);
|
|
1281
|
+
if (fs.existsSync(localBin))
|
|
1281
1282
|
return localBin;
|
|
1282
|
-
if (sourceExt.includes(
|
|
1283
|
+
if (sourceExt.includes(path.extname(baseName)))
|
|
1283
1284
|
return;
|
|
1284
|
-
const foundExt = sourceExt.find((ext) =>
|
|
1285
|
+
const foundExt = sourceExt.find((ext) => fs.existsSync(`${localBin}${ext}`));
|
|
1285
1286
|
if (foundExt)
|
|
1286
1287
|
return `${localBin}${foundExt}`;
|
|
1287
1288
|
return;
|
|
@@ -1293,23 +1294,23 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1293
1294
|
if (this._scriptPath) {
|
|
1294
1295
|
let resolvedScriptPath;
|
|
1295
1296
|
try {
|
|
1296
|
-
resolvedScriptPath =
|
|
1297
|
+
resolvedScriptPath = fs.realpathSync(this._scriptPath);
|
|
1297
1298
|
} catch {
|
|
1298
1299
|
resolvedScriptPath = this._scriptPath;
|
|
1299
1300
|
}
|
|
1300
|
-
executableDir =
|
|
1301
|
+
executableDir = path.resolve(path.dirname(resolvedScriptPath), executableDir);
|
|
1301
1302
|
}
|
|
1302
1303
|
if (executableDir) {
|
|
1303
1304
|
let localFile = findFile(executableDir, executableFile);
|
|
1304
1305
|
if (!localFile && !subcommand._executableFile && this._scriptPath) {
|
|
1305
|
-
const legacyName =
|
|
1306
|
+
const legacyName = path.basename(this._scriptPath, path.extname(this._scriptPath));
|
|
1306
1307
|
if (legacyName !== this._name) {
|
|
1307
1308
|
localFile = findFile(executableDir, `${legacyName}-${subcommand._name}`);
|
|
1308
1309
|
}
|
|
1309
1310
|
}
|
|
1310
1311
|
executableFile = localFile || executableFile;
|
|
1311
1312
|
}
|
|
1312
|
-
launchWithNode = sourceExt.includes(
|
|
1313
|
+
launchWithNode = sourceExt.includes(path.extname(executableFile));
|
|
1313
1314
|
let proc;
|
|
1314
1315
|
if (process2.platform !== "win32") {
|
|
1315
1316
|
if (launchWithNode) {
|
|
@@ -1736,18 +1737,18 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1736
1737
|
this.error(message, { code: "commander.missingMandatoryOptionValue" });
|
|
1737
1738
|
}
|
|
1738
1739
|
_conflictingOption(option, conflictingOption) {
|
|
1739
|
-
const findBestOptionFromValue = (
|
|
1740
|
-
const optionKey =
|
|
1740
|
+
const findBestOptionFromValue = (option) => {
|
|
1741
|
+
const optionKey = option.attributeName();
|
|
1741
1742
|
const optionValue = this.getOptionValue(optionKey);
|
|
1742
1743
|
const negativeOption = this.options.find((target) => target.negate && optionKey === target.attributeName());
|
|
1743
1744
|
const positiveOption = this.options.find((target) => !target.negate && optionKey === target.attributeName());
|
|
1744
1745
|
if (negativeOption && (negativeOption.presetArg === undefined && optionValue === false || negativeOption.presetArg !== undefined && optionValue === negativeOption.presetArg)) {
|
|
1745
1746
|
return negativeOption;
|
|
1746
1747
|
}
|
|
1747
|
-
return positiveOption ||
|
|
1748
|
+
return positiveOption || option;
|
|
1748
1749
|
};
|
|
1749
|
-
const getErrorMessage = (
|
|
1750
|
-
const bestOption = findBestOptionFromValue(
|
|
1750
|
+
const getErrorMessage = (option) => {
|
|
1751
|
+
const bestOption = findBestOptionFromValue(option);
|
|
1751
1752
|
const optionKey = bestOption.attributeName();
|
|
1752
1753
|
const source = this.getOptionValueSource(optionKey);
|
|
1753
1754
|
if (source === "env") {
|
|
@@ -1898,13 +1899,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1898
1899
|
cmd.helpGroup(this._defaultCommandGroup);
|
|
1899
1900
|
}
|
|
1900
1901
|
nameFromFilename(filename) {
|
|
1901
|
-
this._name =
|
|
1902
|
+
this._name = path.basename(filename, path.extname(filename));
|
|
1902
1903
|
return this;
|
|
1903
1904
|
}
|
|
1904
|
-
executableDir(
|
|
1905
|
-
if (
|
|
1905
|
+
executableDir(path) {
|
|
1906
|
+
if (path === undefined)
|
|
1906
1907
|
return this._executableDir;
|
|
1907
|
-
this._executableDir =
|
|
1908
|
+
this._executableDir = path;
|
|
1908
1909
|
return this;
|
|
1909
1910
|
}
|
|
1910
1911
|
helpInformation(contextOptions) {
|
|
@@ -2001,11 +2002,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2001
2002
|
}
|
|
2002
2003
|
help(contextOptions) {
|
|
2003
2004
|
this.outputHelp(contextOptions);
|
|
2004
|
-
let
|
|
2005
|
-
if (
|
|
2006
|
-
|
|
2005
|
+
let exitCode2 = Number(process2.exitCode ?? 0);
|
|
2006
|
+
if (exitCode2 === 0 && contextOptions && typeof contextOptions !== "function" && contextOptions.error) {
|
|
2007
|
+
exitCode2 = 1;
|
|
2007
2008
|
}
|
|
2008
|
-
this._exit(
|
|
2009
|
+
this._exit(exitCode2, "commander.help", "(outputHelp)");
|
|
2009
2010
|
}
|
|
2010
2011
|
addHelpText(position, text) {
|
|
2011
2012
|
const allowedValues = ["beforeAll", "before", "after", "afterAll"];
|
|
@@ -2077,28 +2078,8 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2077
2078
|
exports.useColor = useColor;
|
|
2078
2079
|
});
|
|
2079
2080
|
|
|
2080
|
-
// ../../node_modules/commander/index.js
|
|
2081
|
-
var require_commander = __commonJS(function(exports) {
|
|
2082
|
-
var { Argument } = require_argument();
|
|
2083
|
-
var { Command } = require_command();
|
|
2084
|
-
var { CommanderError, InvalidArgumentError } = require_error();
|
|
2085
|
-
var { Help } = require_help();
|
|
2086
|
-
var { Option } = require_option();
|
|
2087
|
-
exports.program = new Command;
|
|
2088
|
-
exports.createCommand = (name) => new Command(name);
|
|
2089
|
-
exports.createOption = (flags, description) => new Option(flags, description);
|
|
2090
|
-
exports.createArgument = (name, description) => new Argument(name, description);
|
|
2091
|
-
exports.Command = Command;
|
|
2092
|
-
exports.Option = Option;
|
|
2093
|
-
exports.Argument = Argument;
|
|
2094
|
-
exports.Help = Help;
|
|
2095
|
-
exports.CommanderError = CommanderError;
|
|
2096
|
-
exports.InvalidArgumentError = InvalidArgumentError;
|
|
2097
|
-
exports.InvalidOptionArgumentError = InvalidArgumentError;
|
|
2098
|
-
});
|
|
2099
|
-
|
|
2100
2081
|
// ../filesystem/src/node.ts
|
|
2101
|
-
import { randomUUID } from "node:crypto";
|
|
2082
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
2102
2083
|
import { existsSync } from "node:fs";
|
|
2103
2084
|
import * as fs from "node:fs/promises";
|
|
2104
2085
|
import * as os from "node:os";
|
|
@@ -2109,6 +2090,9 @@ var LOCK_MAX_WAIT_MS = 20000;
|
|
|
2109
2090
|
var LOCK_MAX_HOLD_MS = 60000;
|
|
2110
2091
|
var LOCK_RETRY_MIN_MS = 100;
|
|
2111
2092
|
var LOCK_RETRY_JITTER_MS = 200;
|
|
2093
|
+
var HASH_CHUNK_BYTES = 256 * 1024;
|
|
2094
|
+
var hashBuffers = [];
|
|
2095
|
+
var HASH_BUFFERS_KEPT = 64;
|
|
2112
2096
|
|
|
2113
2097
|
class NodeFileSystem {
|
|
2114
2098
|
path = {
|
|
@@ -2127,7 +2111,7 @@ class NodeFileSystem {
|
|
|
2127
2111
|
};
|
|
2128
2112
|
utils = {
|
|
2129
2113
|
open: async (url) => {
|
|
2130
|
-
const { default: open } = await import("./index-
|
|
2114
|
+
const { default: open } = await import("./index-nzr4mx5p.js");
|
|
2131
2115
|
await open(url);
|
|
2132
2116
|
}
|
|
2133
2117
|
};
|
|
@@ -2166,6 +2150,15 @@ class NodeFileSystem {
|
|
|
2166
2150
|
throw error;
|
|
2167
2151
|
}
|
|
2168
2152
|
}
|
|
2153
|
+
async readdirEntries(dirPath) {
|
|
2154
|
+
try {
|
|
2155
|
+
return await fs.readdir(dirPath, { withFileTypes: true });
|
|
2156
|
+
} catch (error) {
|
|
2157
|
+
if (this.isEnoent(error))
|
|
2158
|
+
return [];
|
|
2159
|
+
throw error;
|
|
2160
|
+
}
|
|
2161
|
+
}
|
|
2169
2162
|
async stat(filePath) {
|
|
2170
2163
|
try {
|
|
2171
2164
|
const stats = await fs.stat(filePath);
|
|
@@ -2173,7 +2166,8 @@ class NodeFileSystem {
|
|
|
2173
2166
|
isFile: () => stats.isFile(),
|
|
2174
2167
|
isDirectory: () => stats.isDirectory(),
|
|
2175
2168
|
size: stats.size,
|
|
2176
|
-
mtimeMs: stats.mtimeMs
|
|
2169
|
+
mtimeMs: stats.mtimeMs,
|
|
2170
|
+
ctimeMs: stats.ctimeMs
|
|
2177
2171
|
};
|
|
2178
2172
|
} catch (error) {
|
|
2179
2173
|
if (this.isEnoent(error))
|
|
@@ -2287,6 +2281,42 @@ class NodeFileSystem {
|
|
|
2287
2281
|
throw error;
|
|
2288
2282
|
}
|
|
2289
2283
|
}
|
|
2284
|
+
async hashFile(filePath) {
|
|
2285
|
+
let handle;
|
|
2286
|
+
try {
|
|
2287
|
+
handle = await fs.open(filePath, "r");
|
|
2288
|
+
} catch (error) {
|
|
2289
|
+
if (this.isEnoent(error))
|
|
2290
|
+
return null;
|
|
2291
|
+
throw error;
|
|
2292
|
+
}
|
|
2293
|
+
const buffer = hashBuffers.pop() ?? Buffer.allocUnsafe(HASH_CHUNK_BYTES);
|
|
2294
|
+
try {
|
|
2295
|
+
const opened = await handle.stat();
|
|
2296
|
+
const stats = {
|
|
2297
|
+
isFile: () => opened.isFile(),
|
|
2298
|
+
isDirectory: () => opened.isDirectory(),
|
|
2299
|
+
size: opened.size,
|
|
2300
|
+
mtimeMs: opened.mtimeMs,
|
|
2301
|
+
ctimeMs: opened.ctimeMs
|
|
2302
|
+
};
|
|
2303
|
+
const hash = createHash("sha256");
|
|
2304
|
+
let size = 0;
|
|
2305
|
+
for (;; ) {
|
|
2306
|
+
const { bytesRead } = await handle.read(buffer, 0, buffer.byteLength, null);
|
|
2307
|
+
if (bytesRead === 0)
|
|
2308
|
+
break;
|
|
2309
|
+
hash.update(buffer.subarray(0, bytesRead));
|
|
2310
|
+
size += bytesRead;
|
|
2311
|
+
}
|
|
2312
|
+
return { sha256: hash.digest("hex"), size, stats };
|
|
2313
|
+
} finally {
|
|
2314
|
+
if (hashBuffers.length < HASH_BUFFERS_KEPT) {
|
|
2315
|
+
hashBuffers.push(buffer);
|
|
2316
|
+
}
|
|
2317
|
+
await handle.close();
|
|
2318
|
+
}
|
|
2319
|
+
}
|
|
2290
2320
|
async realpath(filePath) {
|
|
2291
2321
|
try {
|
|
2292
2322
|
return await fs.realpath(filePath);
|
|
@@ -2337,6 +2367,208 @@ class NodeFileSystem {
|
|
|
2337
2367
|
var fsInstance = new NodeFileSystem;
|
|
2338
2368
|
var getFileSystem = () => fsInstance;
|
|
2339
2369
|
|
|
2370
|
+
// ../common/src/telemetry/telemetry-dimensions.ts
|
|
2371
|
+
var BaseDimensions = {
|
|
2372
|
+
ApplicationName: "ApplicationName",
|
|
2373
|
+
ProductVersion: "ProductVersion",
|
|
2374
|
+
InstallationId: "InstallationId",
|
|
2375
|
+
CloudUserId: "CloudUserId",
|
|
2376
|
+
CloudTenantId: "CloudTenantId",
|
|
2377
|
+
CloudOrganizationId: "CloudOrganizationId",
|
|
2378
|
+
IsInternalUser: "IsInternalUser",
|
|
2379
|
+
Environment: "Environment",
|
|
2380
|
+
BaseUrl: "BaseUrl",
|
|
2381
|
+
Region: "Region",
|
|
2382
|
+
Agent: "Agent",
|
|
2383
|
+
AgentVersion: "AgentVersion",
|
|
2384
|
+
AgentModel: "AgentModel",
|
|
2385
|
+
ToolName: "ToolName",
|
|
2386
|
+
ToolVersion: "ToolVersion",
|
|
2387
|
+
ExecutionContext: "ExecutionContext",
|
|
2388
|
+
CiProvider: "CiProvider",
|
|
2389
|
+
SessionIdSource: "SessionIdSource",
|
|
2390
|
+
SessionId: "SessionId"
|
|
2391
|
+
};
|
|
2392
|
+
var CommandDimensions = {
|
|
2393
|
+
IsCommand: "IsCommand",
|
|
2394
|
+
IsReexec: "IsReexec",
|
|
2395
|
+
CommandName: "CommandName",
|
|
2396
|
+
ExitCode: "ExitCode",
|
|
2397
|
+
TerminalOutcome: "TerminalOutcome",
|
|
2398
|
+
ErrorClass: "ErrorClass",
|
|
2399
|
+
TerminalSignal: "TerminalSignal",
|
|
2400
|
+
ErrorMessage: "ErrorMessage",
|
|
2401
|
+
SkillName: "SkillName",
|
|
2402
|
+
ProductArea: "ProductArea",
|
|
2403
|
+
Mode: "Mode"
|
|
2404
|
+
};
|
|
2405
|
+
var ProjectDimensions = {
|
|
2406
|
+
ProjectKey: "ProjectKey",
|
|
2407
|
+
ProjectType: "ProjectType",
|
|
2408
|
+
ProjectIdentityStatus: "ProjectIdentityStatus",
|
|
2409
|
+
SolutionKey: "SolutionKey",
|
|
2410
|
+
SolutionProjectKey: "SolutionProjectKey",
|
|
2411
|
+
SolutionIdentityStatus: "SolutionIdentityStatus",
|
|
2412
|
+
PreviousSolutionKey: "PreviousSolutionKey"
|
|
2413
|
+
};
|
|
2414
|
+
var GUID_KEY_DIMENSIONS = new Set([
|
|
2415
|
+
ProjectDimensions.ProjectKey,
|
|
2416
|
+
ProjectDimensions.SolutionKey,
|
|
2417
|
+
ProjectDimensions.SolutionProjectKey,
|
|
2418
|
+
ProjectDimensions.PreviousSolutionKey
|
|
2419
|
+
]);
|
|
2420
|
+
var ShipDimensions = {
|
|
2421
|
+
ShipKind: "ShipKind",
|
|
2422
|
+
Target: "Target",
|
|
2423
|
+
ProjectType: "ProjectType",
|
|
2424
|
+
ProjectTypes: "ProjectTypes",
|
|
2425
|
+
ArtifactCorrelationKey: "ArtifactCorrelationKey",
|
|
2426
|
+
PackageName: "PackageName",
|
|
2427
|
+
PackageVersion: "PackageVersion",
|
|
2428
|
+
PackageVersionKey: "PackageVersionKey",
|
|
2429
|
+
DeploymentKey: "DeploymentKey",
|
|
2430
|
+
SolutionId: "SolutionId",
|
|
2431
|
+
FolderKey: "FolderKey",
|
|
2432
|
+
FeedId: "FeedId"
|
|
2433
|
+
};
|
|
2434
|
+
var ErrorDimensions = {
|
|
2435
|
+
Result: "Result",
|
|
2436
|
+
ErrorCode: "ErrorCode",
|
|
2437
|
+
Retry: "Retry",
|
|
2438
|
+
ErrorMessage: "ErrorMessage",
|
|
2439
|
+
HttpStatus: "HttpStatus",
|
|
2440
|
+
UpstreamErrorCode: "UpstreamErrorCode"
|
|
2441
|
+
};
|
|
2442
|
+
var AuthDimensions = {
|
|
2443
|
+
AuthenticationMethod: "AuthenticationMethod",
|
|
2444
|
+
Success: "Success",
|
|
2445
|
+
Reason: "Reason"
|
|
2446
|
+
};
|
|
2447
|
+
var SkillsDimensions = {
|
|
2448
|
+
SchemaVersion: "SchemaVersion",
|
|
2449
|
+
AgentType: "AgentType",
|
|
2450
|
+
SkillsVersion: "SkillsVersion",
|
|
2451
|
+
UipSubcommand: "UipSubcommand",
|
|
2452
|
+
FileExtension: "FileExtension",
|
|
2453
|
+
SubagentModel: "SubagentModel",
|
|
2454
|
+
SubagentType: "SubagentType",
|
|
2455
|
+
PermissionMode: "PermissionMode",
|
|
2456
|
+
EffortLevel: "EffortLevel",
|
|
2457
|
+
SessionSource: "SessionSource",
|
|
2458
|
+
Outcome: "Outcome",
|
|
2459
|
+
DurationMs: "DurationMs",
|
|
2460
|
+
Source: "Source"
|
|
2461
|
+
};
|
|
2462
|
+
var PackagerDimensions = {
|
|
2463
|
+
ProjectId: "ProjectId",
|
|
2464
|
+
ProjectType: "ProjectType",
|
|
2465
|
+
SolutionId: "SolutionId"
|
|
2466
|
+
};
|
|
2467
|
+
var ScopeDimensions = {
|
|
2468
|
+
FolderId: "FolderId"
|
|
2469
|
+
};
|
|
2470
|
+
var ID_DIMENSIONS = new Set([
|
|
2471
|
+
BaseDimensions.CloudUserId,
|
|
2472
|
+
BaseDimensions.CloudTenantId,
|
|
2473
|
+
BaseDimensions.CloudOrganizationId,
|
|
2474
|
+
BaseDimensions.InstallationId,
|
|
2475
|
+
ShipDimensions.ArtifactCorrelationKey,
|
|
2476
|
+
ShipDimensions.PackageVersionKey,
|
|
2477
|
+
ShipDimensions.DeploymentKey,
|
|
2478
|
+
ShipDimensions.SolutionId,
|
|
2479
|
+
ShipDimensions.FolderKey,
|
|
2480
|
+
ShipDimensions.FeedId,
|
|
2481
|
+
PackagerDimensions.ProjectId
|
|
2482
|
+
]);
|
|
2483
|
+
var NON_IDENTIFIER_PLACEHOLDER_PATTERN = /^(?:\[[A-Z_]+\]|<[^>]+>)$/;
|
|
2484
|
+
var RESERVED_DIMENSION_NAMES = new Set([
|
|
2485
|
+
...Object.values(BaseDimensions),
|
|
2486
|
+
...Object.values(CommandDimensions),
|
|
2487
|
+
...Object.values(ShipDimensions),
|
|
2488
|
+
...Object.values(ProjectDimensions),
|
|
2489
|
+
...Object.values(ErrorDimensions),
|
|
2490
|
+
...Object.values(AuthDimensions),
|
|
2491
|
+
...Object.values(SkillsDimensions),
|
|
2492
|
+
...Object.values(PackagerDimensions),
|
|
2493
|
+
...Object.values(ScopeDimensions)
|
|
2494
|
+
]);
|
|
2495
|
+
var CURATED_DIMENSIONS = new Set([
|
|
2496
|
+
BaseDimensions.ApplicationName,
|
|
2497
|
+
BaseDimensions.ProductVersion,
|
|
2498
|
+
BaseDimensions.InstallationId,
|
|
2499
|
+
BaseDimensions.CloudUserId,
|
|
2500
|
+
BaseDimensions.CloudTenantId,
|
|
2501
|
+
BaseDimensions.CloudOrganizationId,
|
|
2502
|
+
BaseDimensions.IsInternalUser,
|
|
2503
|
+
BaseDimensions.Environment,
|
|
2504
|
+
BaseDimensions.BaseUrl,
|
|
2505
|
+
BaseDimensions.Region,
|
|
2506
|
+
BaseDimensions.Agent,
|
|
2507
|
+
BaseDimensions.AgentVersion,
|
|
2508
|
+
BaseDimensions.ToolVersion,
|
|
2509
|
+
BaseDimensions.ExecutionContext,
|
|
2510
|
+
BaseDimensions.CiProvider,
|
|
2511
|
+
BaseDimensions.SessionIdSource,
|
|
2512
|
+
BaseDimensions.SessionId,
|
|
2513
|
+
...Object.values(CommandDimensions),
|
|
2514
|
+
...Object.values(ShipDimensions),
|
|
2515
|
+
...Object.values(ProjectDimensions)
|
|
2516
|
+
]);
|
|
2517
|
+
function lowercaseIdDimensionValues(properties) {
|
|
2518
|
+
let changed = false;
|
|
2519
|
+
const result = {
|
|
2520
|
+
...properties
|
|
2521
|
+
};
|
|
2522
|
+
for (const key of Object.keys(result)) {
|
|
2523
|
+
const value = result[key];
|
|
2524
|
+
if (!ID_DIMENSIONS.has(key) || typeof value !== "string" || NON_IDENTIFIER_PLACEHOLDER_PATTERN.test(value)) {
|
|
2525
|
+
continue;
|
|
2526
|
+
}
|
|
2527
|
+
const lowered = value.toLowerCase();
|
|
2528
|
+
if (lowered !== value) {
|
|
2529
|
+
result[key] = lowered;
|
|
2530
|
+
changed = true;
|
|
2531
|
+
}
|
|
2532
|
+
}
|
|
2533
|
+
return changed ? result : properties;
|
|
2534
|
+
}
|
|
2535
|
+
|
|
2536
|
+
// ../common/src/telemetry/project-identity.ts
|
|
2537
|
+
function projectKey(id) {
|
|
2538
|
+
if (typeof id !== "string")
|
|
2539
|
+
return;
|
|
2540
|
+
const key = id.trim().toLowerCase().replaceAll("-", "");
|
|
2541
|
+
return /^[0-9a-f]{32}$/.test(key) ? key : undefined;
|
|
2542
|
+
}
|
|
2543
|
+
function projectIdentityProperties(identity) {
|
|
2544
|
+
const key = identity.id ? projectKey(identity.id) : undefined;
|
|
2545
|
+
return {
|
|
2546
|
+
[ProjectDimensions.ProjectIdentityStatus]: identity.status === "resolved" && !key ? "invalid" : identity.status,
|
|
2547
|
+
[ProjectDimensions.ProjectType]: identity.projectType,
|
|
2548
|
+
...identity.status === "resolved" && key ? {
|
|
2549
|
+
[ProjectDimensions.ProjectKey]: key
|
|
2550
|
+
} : {}
|
|
2551
|
+
};
|
|
2552
|
+
}
|
|
2553
|
+
var PROJECT_IDENTITY_LOOKUP_BUDGET_MS = 1000;
|
|
2554
|
+
async function withinProjectIdentityBudget(work, onTimeout) {
|
|
2555
|
+
work.catch(() => {
|
|
2556
|
+
return;
|
|
2557
|
+
});
|
|
2558
|
+
let timer;
|
|
2559
|
+
const expired = new Promise((resolve) => {
|
|
2560
|
+
timer = setTimeout(() => {
|
|
2561
|
+
onTimeout?.();
|
|
2562
|
+
resolve(undefined);
|
|
2563
|
+
}, PROJECT_IDENTITY_LOOKUP_BUDGET_MS);
|
|
2564
|
+
});
|
|
2565
|
+
try {
|
|
2566
|
+
return await Promise.race([work, expired]);
|
|
2567
|
+
} finally {
|
|
2568
|
+
clearTimeout(timer);
|
|
2569
|
+
}
|
|
2570
|
+
}
|
|
2571
|
+
|
|
2340
2572
|
// ../common/src/telemetry/pseudonymize.ts
|
|
2341
2573
|
var PSEUDONYM_DOMAIN = "uipath-cli/telemetry/pseudonym/v1:";
|
|
2342
2574
|
var PSEUDONYM_HEX_LENGTH = 32;
|
|
@@ -2705,8 +2937,8 @@ function redactValueDetectors(value, maxLength = MAX_VALUE_LENGTH) {
|
|
|
2705
2937
|
return `${redactUrl(core)}${trailing}`;
|
|
2706
2938
|
});
|
|
2707
2939
|
out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
2708
|
-
out = out.replace(UNC_PATH_PATTERN, (_match, before,
|
|
2709
|
-
const [core, trailing] = peelTrailingPunctuation(
|
|
2940
|
+
out = out.replace(UNC_PATH_PATTERN, (_match, before, path) => {
|
|
2941
|
+
const [core, trailing] = peelTrailingPunctuation(path);
|
|
2710
2942
|
return `${before}unc#${pseudonymize(core)}${trailing}`;
|
|
2711
2943
|
});
|
|
2712
2944
|
out = out.replace(EMAIL_PATTERN, (match) => `email#${pseudonymize(match)}`);
|
|
@@ -2800,6 +3032,8 @@ function redactProperty(name, value) {
|
|
|
2800
3032
|
if (isSensitiveName(name)) {
|
|
2801
3033
|
return REDACTED;
|
|
2802
3034
|
}
|
|
3035
|
+
if (GUID_KEY_DIMENSIONS.has(name))
|
|
3036
|
+
return projectKey(value);
|
|
2803
3037
|
if (typeof value === "boolean" || typeof value === "number") {
|
|
2804
3038
|
return value;
|
|
2805
3039
|
}
|
|
@@ -2874,6 +3108,63 @@ function settlePromiseLike(thenable) {
|
|
|
2874
3108
|
return Promise.resolve(thenable).then((data) => [undefined, data]).catch((error) => [toError(error), undefined]);
|
|
2875
3109
|
}
|
|
2876
3110
|
|
|
3111
|
+
// ../common/src/error-codes.ts
|
|
3112
|
+
var CLI_ERROR_CODES = [
|
|
3113
|
+
"invalid_argument",
|
|
3114
|
+
"authentication_required",
|
|
3115
|
+
"permission_denied",
|
|
3116
|
+
"local_permission_denied",
|
|
3117
|
+
"not_found",
|
|
3118
|
+
"rate_limited",
|
|
3119
|
+
"network_error",
|
|
3120
|
+
"timeout",
|
|
3121
|
+
"server_error",
|
|
3122
|
+
"method_not_allowed",
|
|
3123
|
+
"not_supported",
|
|
3124
|
+
"configuration_error",
|
|
3125
|
+
"execution_failed",
|
|
3126
|
+
"unknown_error"
|
|
3127
|
+
];
|
|
3128
|
+
var RETRY_HINTS = [
|
|
3129
|
+
"RetryWillNotFix",
|
|
3130
|
+
"RetryLater",
|
|
3131
|
+
"RetryAfter1Second",
|
|
3132
|
+
"RetryAfter10Seconds",
|
|
3133
|
+
"RetryAfter30Seconds",
|
|
3134
|
+
"RetryAfter60Seconds"
|
|
3135
|
+
];
|
|
3136
|
+
var CLI_ERROR_CODE_VALUES = new Set(CLI_ERROR_CODES);
|
|
3137
|
+
var RETRY_HINT_VALUES = new Set(RETRY_HINTS);
|
|
3138
|
+
function isCliErrorCode(value) {
|
|
3139
|
+
return typeof value === "string" && CLI_ERROR_CODE_VALUES.has(value);
|
|
3140
|
+
}
|
|
3141
|
+
function isRetryHint(value) {
|
|
3142
|
+
return typeof value === "string" && RETRY_HINT_VALUES.has(value);
|
|
3143
|
+
}
|
|
3144
|
+
function carriedErrorCode(error) {
|
|
3145
|
+
if (!error || typeof error !== "object")
|
|
3146
|
+
return;
|
|
3147
|
+
const code = error.errorCode;
|
|
3148
|
+
return isCliErrorCode(code) ? code : undefined;
|
|
3149
|
+
}
|
|
3150
|
+
function carriedRetry(error) {
|
|
3151
|
+
if (!error || typeof error !== "object")
|
|
3152
|
+
return;
|
|
3153
|
+
const retry = error.retry;
|
|
3154
|
+
return isRetryHint(retry) ? retry : undefined;
|
|
3155
|
+
}
|
|
3156
|
+
function defaultRetryForErrorCode(errorCode) {
|
|
3157
|
+
switch (errorCode) {
|
|
3158
|
+
case "network_error":
|
|
3159
|
+
case "rate_limited":
|
|
3160
|
+
case "server_error":
|
|
3161
|
+
case "timeout":
|
|
3162
|
+
return "RetryLater";
|
|
3163
|
+
default:
|
|
3164
|
+
return "RetryWillNotFix";
|
|
3165
|
+
}
|
|
3166
|
+
}
|
|
3167
|
+
|
|
2877
3168
|
// ../common/src/error-graph.ts
|
|
2878
3169
|
function* walkErrorGraph(error) {
|
|
2879
3170
|
const queue = [error];
|
|
@@ -2918,19 +3209,55 @@ function findHttpStatusInGraph(error) {
|
|
|
2918
3209
|
return;
|
|
2919
3210
|
}
|
|
2920
3211
|
|
|
2921
|
-
// ../common/src/
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
3212
|
+
// ../common/src/http-status.ts
|
|
3213
|
+
function classifyHttpStatus(status) {
|
|
3214
|
+
if (status === undefined)
|
|
3215
|
+
return;
|
|
3216
|
+
if (status === 400 || status === 409 || status === 413 || status === 422) {
|
|
3217
|
+
return { errorCode: "invalid_argument", retry: "RetryWillNotFix" };
|
|
3218
|
+
}
|
|
3219
|
+
if (status === 401) {
|
|
3220
|
+
return {
|
|
3221
|
+
errorCode: "authentication_required",
|
|
3222
|
+
retry: "RetryWillNotFix"
|
|
3223
|
+
};
|
|
3224
|
+
}
|
|
3225
|
+
if (status === 403) {
|
|
3226
|
+
return { errorCode: "permission_denied", retry: "RetryWillNotFix" };
|
|
3227
|
+
}
|
|
3228
|
+
if (status === 404) {
|
|
3229
|
+
return { errorCode: "not_found", retry: "RetryWillNotFix" };
|
|
3230
|
+
}
|
|
3231
|
+
if (status === 405) {
|
|
3232
|
+
return { errorCode: "method_not_allowed", retry: "RetryWillNotFix" };
|
|
3233
|
+
}
|
|
3234
|
+
if (status === 408) {
|
|
3235
|
+
return { errorCode: "timeout", retry: "RetryLater" };
|
|
3236
|
+
}
|
|
3237
|
+
if (status === 429) {
|
|
3238
|
+
return { errorCode: "rate_limited", retry: "RetryLater" };
|
|
3239
|
+
}
|
|
3240
|
+
if (status >= 500 && status < 600) {
|
|
3241
|
+
return { errorCode: "server_error", retry: "RetryLater" };
|
|
3242
|
+
}
|
|
3243
|
+
return;
|
|
3244
|
+
}
|
|
3245
|
+
|
|
3246
|
+
// ../common/src/local-permission-codes.ts
|
|
3247
|
+
var LOCAL_PERMISSION_ERROR_CODES = new Set([
|
|
3248
|
+
"EACCES",
|
|
3249
|
+
"EPERM",
|
|
3250
|
+
"EROFS"
|
|
3251
|
+
]);
|
|
3252
|
+
|
|
3253
|
+
// ../common/src/error-handler.ts
|
|
3254
|
+
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.";
|
|
3255
|
+
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.";
|
|
3256
|
+
var DEFAULT_405 = "Method Not Allowed (405). The endpoint may not exist or the base URL may be incorrect.";
|
|
3257
|
+
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.";
|
|
3258
|
+
var CLOUDFLARE_BLOCK_403 = "Forbidden (403) by Cloudflare, in front of the service: the answer is a Cloudflare HTML page, not the service's JSON, so the service did not see the request and did not check the account's roles or the token's scopes. Cloudflare blocks a request when its content matches a firewall rule (text that looks like SQL or script code, for example) or when it comes from a network the firewall does not allow.";
|
|
3259
|
+
var CLOUDFLARE_BLOCK_403_INSTRUCTIONS = "If the request carries text that looks like code, change that text and try again. Otherwise send the time of the request and the Cloudflare Ray ID, when the message gives one, to the owner of the service or UiPath support.";
|
|
3260
|
+
var HTML_RESPONSE_MESSAGE = "Received HTML instead of the expected JSON response.";
|
|
2934
3261
|
var NETWORK_ERROR_CODES = new Set([
|
|
2935
3262
|
"ECONNREFUSED",
|
|
2936
3263
|
"ECONNRESET",
|
|
@@ -2955,8 +3282,8 @@ var TLS_ERROR_CODES = new Set([
|
|
|
2955
3282
|
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.";
|
|
2956
3283
|
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.";
|
|
2957
3284
|
var LOCAL_PERMISSION_MESSAGE_PATTERN = new RegExp(`\\b(${[...LOCAL_PERMISSION_ERROR_CODES].join("|")})\\b`);
|
|
2958
|
-
function localPermissionInstructions(code,
|
|
2959
|
-
const target =
|
|
3285
|
+
function localPermissionInstructions(code, path) {
|
|
3286
|
+
const target = path !== undefined ? `'${path}'` : "a local file or resource";
|
|
2960
3287
|
if (code === "EROFS") {
|
|
2961
3288
|
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.";
|
|
2962
3289
|
}
|
|
@@ -2993,12 +3320,12 @@ function describePermissionError(error) {
|
|
|
2993
3320
|
const code = matchLocalPermissionCode(cur.code, message);
|
|
2994
3321
|
if (!code)
|
|
2995
3322
|
continue;
|
|
2996
|
-
const
|
|
3323
|
+
const path = localPermissionPath(cur.path, message);
|
|
2997
3324
|
return {
|
|
2998
3325
|
code,
|
|
2999
3326
|
message: message ?? code,
|
|
3000
|
-
...
|
|
3001
|
-
instructions: localPermissionInstructions(code,
|
|
3327
|
+
...path !== undefined ? { path } : {},
|
|
3328
|
+
instructions: localPermissionInstructions(code, path)
|
|
3002
3329
|
};
|
|
3003
3330
|
}
|
|
3004
3331
|
return;
|
|
@@ -3010,11 +3337,25 @@ function matchLocalPermissionCode(code, message) {
|
|
|
3010
3337
|
const match = message ? LOCAL_PERMISSION_MESSAGE_PATTERN.exec(message) : null;
|
|
3011
3338
|
return match ? match[1] : undefined;
|
|
3012
3339
|
}
|
|
3013
|
-
function localPermissionPath(
|
|
3014
|
-
if (typeof
|
|
3015
|
-
return
|
|
3340
|
+
function localPermissionPath(path, message) {
|
|
3341
|
+
if (typeof path === "string")
|
|
3342
|
+
return path;
|
|
3016
3343
|
return message ? /'([^']+)'/.exec(message)?.[1] : undefined;
|
|
3017
3344
|
}
|
|
3345
|
+
function readHeader(response, name) {
|
|
3346
|
+
const headers = response?.headers;
|
|
3347
|
+
if (!headers || typeof headers !== "object")
|
|
3348
|
+
return;
|
|
3349
|
+
if (typeof headers.get === "function") {
|
|
3350
|
+
const value = headers.get(name);
|
|
3351
|
+
if (value)
|
|
3352
|
+
return value;
|
|
3353
|
+
}
|
|
3354
|
+
const plain = headers;
|
|
3355
|
+
const key = Object.keys(plain).find((k) => k.toLowerCase() === name.toLowerCase());
|
|
3356
|
+
const value = key === undefined ? undefined : plain[key];
|
|
3357
|
+
return typeof value === "string" && value !== "" ? value : undefined;
|
|
3358
|
+
}
|
|
3018
3359
|
function isHtmlDocument(body) {
|
|
3019
3360
|
return /^\s*(<!doctype html|<html\b)/i.test(body);
|
|
3020
3361
|
}
|
|
@@ -3031,36 +3372,9 @@ function retryHintForRetryAfter(seconds) {
|
|
|
3031
3372
|
return "RetryAfter60Seconds";
|
|
3032
3373
|
}
|
|
3033
3374
|
function classifyError(status, error) {
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
if (status === 401) {
|
|
3038
|
-
return {
|
|
3039
|
-
errorCode: "authentication_required",
|
|
3040
|
-
retry: "RetryWillNotFix"
|
|
3041
|
-
};
|
|
3042
|
-
}
|
|
3043
|
-
if (status === 403) {
|
|
3044
|
-
return { errorCode: "permission_denied", retry: "RetryWillNotFix" };
|
|
3045
|
-
}
|
|
3046
|
-
if (status === 404) {
|
|
3047
|
-
return { errorCode: "not_found", retry: "RetryWillNotFix" };
|
|
3048
|
-
}
|
|
3049
|
-
if (status === 405) {
|
|
3050
|
-
return { errorCode: "method_not_allowed", retry: "RetryWillNotFix" };
|
|
3051
|
-
}
|
|
3052
|
-
if (status === 413) {
|
|
3053
|
-
return { errorCode: "invalid_argument", retry: "RetryWillNotFix" };
|
|
3054
|
-
}
|
|
3055
|
-
if (status === 408) {
|
|
3056
|
-
return { errorCode: "timeout", retry: "RetryLater" };
|
|
3057
|
-
}
|
|
3058
|
-
if (status === 429) {
|
|
3059
|
-
return { errorCode: "rate_limited", retry: "RetryLater" };
|
|
3060
|
-
}
|
|
3061
|
-
if (status !== undefined && status >= 500 && status < 600) {
|
|
3062
|
-
return { errorCode: "server_error", retry: "RetryLater" };
|
|
3063
|
-
}
|
|
3375
|
+
const byStatus = classifyHttpStatus(status);
|
|
3376
|
+
if (byStatus)
|
|
3377
|
+
return byStatus;
|
|
3064
3378
|
if (status === undefined && describePermissionError(error)) {
|
|
3065
3379
|
return {
|
|
3066
3380
|
errorCode: "local_permission_denied",
|
|
@@ -3076,6 +3390,17 @@ function classifyError(status, error) {
|
|
|
3076
3390
|
}
|
|
3077
3391
|
return { errorCode: "unknown_error", retry: "RetryWillNotFix" };
|
|
3078
3392
|
}
|
|
3393
|
+
function withCarriedClass(inferred, error) {
|
|
3394
|
+
const errorCode = carriedErrorCode(error);
|
|
3395
|
+
const retry = carriedRetry(error);
|
|
3396
|
+
if (errorCode === undefined || errorCode === inferred.errorCode) {
|
|
3397
|
+
return {
|
|
3398
|
+
errorCode: inferred.errorCode,
|
|
3399
|
+
retry: retry ?? inferred.retry
|
|
3400
|
+
};
|
|
3401
|
+
}
|
|
3402
|
+
return { errorCode, retry: retry ?? defaultRetryForErrorCode(errorCode) };
|
|
3403
|
+
}
|
|
3079
3404
|
function formatHttpStatusMessage(status, rawMessage, extractedMessage, inferredStatus) {
|
|
3080
3405
|
if (extractedMessage) {
|
|
3081
3406
|
return `HTTP ${status}: ${extractedMessage}`;
|
|
@@ -3131,9 +3456,14 @@ async function extractErrorDetails(error, options) {
|
|
|
3131
3456
|
const classificationStatus = status ?? findHttpStatusInGraph(error);
|
|
3132
3457
|
const classification = classifyError(classificationStatus, error);
|
|
3133
3458
|
let retry = classification.retry;
|
|
3459
|
+
const htmlForbidden = status === 403 && rawBody !== undefined && isHtmlDocument(rawBody);
|
|
3460
|
+
const rayId = htmlForbidden ? readHeader(response, "cf-ray") : undefined;
|
|
3461
|
+
const cloudflareBlock = htmlForbidden && (rayId !== undefined || /\bcloudflare\b/i.test(readHeader(response, "server") ?? ""));
|
|
3134
3462
|
if (status === 401) {
|
|
3135
3463
|
message = DEFAULT_401;
|
|
3136
3464
|
result = "AuthenticationError";
|
|
3465
|
+
} else if (cloudflareBlock) {
|
|
3466
|
+
message = rayId ? `${CLOUDFLARE_BLOCK_403} Cloudflare Ray ID: ${rayId}.` : CLOUDFLARE_BLOCK_403;
|
|
3137
3467
|
} else if (status === 403) {
|
|
3138
3468
|
message = options?.forbiddenMessage ?? DEFAULT_403;
|
|
3139
3469
|
result = "AuthenticationError";
|
|
@@ -3181,7 +3511,9 @@ async function extractErrorDetails(error, options) {
|
|
|
3181
3511
|
}
|
|
3182
3512
|
}
|
|
3183
3513
|
let details = rawMessage;
|
|
3184
|
-
if (
|
|
3514
|
+
if (htmlForbidden) {
|
|
3515
|
+
details = cloudflareBlock ? CLOUDFLARE_BLOCK_403_INSTRUCTIONS : HTML_RESPONSE_MESSAGE;
|
|
3516
|
+
} else if (rawBody) {
|
|
3185
3517
|
if (parsedBody) {
|
|
3186
3518
|
const extra = {};
|
|
3187
3519
|
if (parsedBody.errorCode)
|
|
@@ -3215,6 +3547,8 @@ async function extractErrorDetails(error, options) {
|
|
|
3215
3547
|
}
|
|
3216
3548
|
if (parsedBody?.requestId && typeof parsedBody.requestId === "string") {
|
|
3217
3549
|
context.requestId = parsedBody.requestId;
|
|
3550
|
+
} else if (cloudflareBlock && rayId) {
|
|
3551
|
+
context.requestId = rayId;
|
|
3218
3552
|
}
|
|
3219
3553
|
if (parsedBody?.traceId && typeof parsedBody.traceId === "string") {
|
|
3220
3554
|
context.traceId = parsedBody.traceId;
|
|
@@ -3223,16 +3557,7 @@ async function extractErrorDetails(error, options) {
|
|
|
3223
3557
|
context.path = permission.path;
|
|
3224
3558
|
}
|
|
3225
3559
|
if (status === 429) {
|
|
3226
|
-
const
|
|
3227
|
-
const headersObj = resp?.headers;
|
|
3228
|
-
let retryAfterValue;
|
|
3229
|
-
if (headersObj && typeof headersObj === "object" && typeof headersObj.get === "function") {
|
|
3230
|
-
retryAfterValue = headersObj.get("retry-after") ?? undefined;
|
|
3231
|
-
}
|
|
3232
|
-
if (!retryAfterValue && headersObj && typeof headersObj === "object") {
|
|
3233
|
-
const headers = headersObj;
|
|
3234
|
-
retryAfterValue = headers["retry-after"] ?? headers["Retry-After"];
|
|
3235
|
-
}
|
|
3560
|
+
const retryAfterValue = readHeader(response, "retry-after");
|
|
3236
3561
|
if (retryAfterValue) {
|
|
3237
3562
|
const seconds = Number(retryAfterValue);
|
|
3238
3563
|
if (!Number.isNaN(seconds)) {
|
|
@@ -3266,9 +3591,8 @@ async function extractErrorDetails(error, options) {
|
|
|
3266
3591
|
}
|
|
3267
3592
|
return {
|
|
3268
3593
|
result,
|
|
3269
|
-
errorCode: classification.errorCode,
|
|
3594
|
+
...withCarriedClass({ errorCode: classification.errorCode, retry }, error),
|
|
3270
3595
|
message,
|
|
3271
|
-
retry,
|
|
3272
3596
|
details,
|
|
3273
3597
|
...hasContext ? { context } : {},
|
|
3274
3598
|
...parsedErrors ? { parsedErrors } : {}
|
|
@@ -3293,6 +3617,88 @@ function extractErrorMessageSync(error) {
|
|
|
3293
3617
|
return describeThrownValue(error);
|
|
3294
3618
|
}
|
|
3295
3619
|
|
|
3620
|
+
// ../common/src/result-types.ts
|
|
3621
|
+
var RESULTS = {
|
|
3622
|
+
Success: "Success",
|
|
3623
|
+
Failure: "Failure",
|
|
3624
|
+
ConfigError: "ConfigError",
|
|
3625
|
+
AuthenticationError: "AuthenticationError",
|
|
3626
|
+
ValidationError: "ValidationError",
|
|
3627
|
+
TimeoutError: "TimeoutError"
|
|
3628
|
+
};
|
|
3629
|
+
|
|
3630
|
+
// ../common/src/classified-failure.ts
|
|
3631
|
+
async function classifiedFailure(message, error) {
|
|
3632
|
+
const details = await extractErrorDetails(error);
|
|
3633
|
+
return {
|
|
3634
|
+
Result: details.result,
|
|
3635
|
+
ErrorCode: details.errorCode,
|
|
3636
|
+
Message: message,
|
|
3637
|
+
Instructions: details.message,
|
|
3638
|
+
Retry: details.retry,
|
|
3639
|
+
...details.context ? { Context: details.context } : {}
|
|
3640
|
+
};
|
|
3641
|
+
}
|
|
3642
|
+
|
|
3643
|
+
// ../../node_modules/commander/index.js
|
|
3644
|
+
var exports_commander = {};
|
|
3645
|
+
__exportCjs(exports_commander, {
|
|
3646
|
+
program: () => $program,
|
|
3647
|
+
createCommand: () => $createCommand,
|
|
3648
|
+
createOption: () => $createOption,
|
|
3649
|
+
createArgument: () => $createArgument,
|
|
3650
|
+
Command: () => $Command,
|
|
3651
|
+
Option: () => $Option,
|
|
3652
|
+
Argument: () => $Argument,
|
|
3653
|
+
Help: () => $Help,
|
|
3654
|
+
CommanderError: () => $CommanderError,
|
|
3655
|
+
InvalidArgumentError: () => $InvalidArgumentError,
|
|
3656
|
+
InvalidOptionArgumentError: () => $InvalidOptionArgumentError
|
|
3657
|
+
}, {
|
|
3658
|
+
program: (value) => $program = value,
|
|
3659
|
+
createCommand: (value) => $createCommand = value,
|
|
3660
|
+
createOption: (value) => $createOption = value,
|
|
3661
|
+
createArgument: (value) => $createArgument = value,
|
|
3662
|
+
Command: (value) => $Command = value,
|
|
3663
|
+
Option: (value) => $Option = value,
|
|
3664
|
+
Argument: (value) => $Argument = value,
|
|
3665
|
+
Help: (value) => $Help = value,
|
|
3666
|
+
CommanderError: (value) => $CommanderError = value,
|
|
3667
|
+
InvalidArgumentError: (value) => $InvalidArgumentError = value,
|
|
3668
|
+
InvalidOptionArgumentError: (value) => $InvalidOptionArgumentError = value
|
|
3669
|
+
});
|
|
3670
|
+
var { Argument } = require_argument();
|
|
3671
|
+
var { Command: Command2 } = require_command();
|
|
3672
|
+
var { CommanderError, InvalidArgumentError } = require_error();
|
|
3673
|
+
var { Help } = require_help();
|
|
3674
|
+
var { Option: Option2 } = require_option();
|
|
3675
|
+
var $program = new Command2;
|
|
3676
|
+
var $createCommand = (name) => new Command2(name);
|
|
3677
|
+
var $createOption = (flags, description) => new Option2(flags, description);
|
|
3678
|
+
var $createArgument = (name, description) => new Argument(name, description);
|
|
3679
|
+
var $Command = Command2;
|
|
3680
|
+
var $Option = Option2;
|
|
3681
|
+
var $Argument = Argument;
|
|
3682
|
+
var $Help = Help;
|
|
3683
|
+
var $CommanderError = CommanderError;
|
|
3684
|
+
var $InvalidArgumentError = InvalidArgumentError;
|
|
3685
|
+
var $InvalidOptionArgumentError = InvalidArgumentError;
|
|
3686
|
+
|
|
3687
|
+
// ../../node_modules/commander/esm.mjs
|
|
3688
|
+
var {
|
|
3689
|
+
program,
|
|
3690
|
+
createCommand,
|
|
3691
|
+
createArgument,
|
|
3692
|
+
createOption,
|
|
3693
|
+
CommanderError: CommanderError2,
|
|
3694
|
+
InvalidArgumentError: InvalidArgumentError2,
|
|
3695
|
+
InvalidOptionArgumentError,
|
|
3696
|
+
Command,
|
|
3697
|
+
Argument: Argument2,
|
|
3698
|
+
Option,
|
|
3699
|
+
Help: Help2
|
|
3700
|
+
} = exports_commander;
|
|
3701
|
+
|
|
3296
3702
|
// ../common/src/output-context.ts
|
|
3297
3703
|
function createStorage() {
|
|
3298
3704
|
const [error, mod] = catchError(() => __require("node:async_hooks"));
|
|
@@ -3326,8 +3732,8 @@ function getOutputSink() {
|
|
|
3326
3732
|
|
|
3327
3733
|
// ../common/src/logger.ts
|
|
3328
3734
|
var logFilePathSlot = singleton("logFilePath");
|
|
3329
|
-
function setGlobalLogFilePath(
|
|
3330
|
-
logFilePathSlot.set(
|
|
3735
|
+
function setGlobalLogFilePath(path) {
|
|
3736
|
+
logFilePathSlot.set(path);
|
|
3331
3737
|
}
|
|
3332
3738
|
function getGlobalLogFilePath() {
|
|
3333
3739
|
return logFilePathSlot.get("");
|
|
@@ -3395,14 +3801,14 @@ class SimpleLogger {
|
|
|
3395
3801
|
return this.fileLoggingEnabled || !!getGlobalLogFilePath();
|
|
3396
3802
|
}
|
|
3397
3803
|
writeToFile(formatted) {
|
|
3398
|
-
const
|
|
3399
|
-
if (!
|
|
3804
|
+
const path = this.logFilePath || getGlobalLogFilePath();
|
|
3805
|
+
if (!path)
|
|
3400
3806
|
return;
|
|
3401
3807
|
const timestamp = new Date().toISOString();
|
|
3402
3808
|
this.pendingWrites = Promise.all([
|
|
3403
3809
|
this.pendingWrites,
|
|
3404
3810
|
this.pendingInit
|
|
3405
|
-
]).then(() => getFileSystem().appendFile(
|
|
3811
|
+
]).then(() => getFileSystem().appendFile(path, `${timestamp} ${formatted}`).catch(() => {}));
|
|
3406
3812
|
}
|
|
3407
3813
|
write(formatted) {
|
|
3408
3814
|
if (this.isFileLoggingActive()) {
|
|
@@ -3452,17 +3858,17 @@ class SimpleLogger {
|
|
|
3452
3858
|
setGlobalLogFilePath("");
|
|
3453
3859
|
}
|
|
3454
3860
|
}
|
|
3455
|
-
setLogFile(
|
|
3456
|
-
this.logFilePath =
|
|
3457
|
-
setGlobalLogFilePath(
|
|
3458
|
-
if (!
|
|
3861
|
+
setLogFile(path) {
|
|
3862
|
+
this.logFilePath = path;
|
|
3863
|
+
setGlobalLogFilePath(path);
|
|
3864
|
+
if (!path)
|
|
3459
3865
|
return;
|
|
3460
3866
|
this.fileLoggingEnabled = true;
|
|
3461
|
-
const
|
|
3867
|
+
const fs = getFileSystem();
|
|
3462
3868
|
this.pendingInit = (async () => {
|
|
3463
3869
|
const [error] = await catchError((async () => {
|
|
3464
|
-
await
|
|
3465
|
-
await
|
|
3870
|
+
await fs.mkdir(fs.path.dirname(path));
|
|
3871
|
+
await fs.writeFile(path, "");
|
|
3466
3872
|
})());
|
|
3467
3873
|
if (error)
|
|
3468
3874
|
this.fileLoggingEnabled = false;
|
|
@@ -3510,9 +3916,97 @@ function getLogFilePath() {
|
|
|
3510
3916
|
return logger.getLogFilePath();
|
|
3511
3917
|
}
|
|
3512
3918
|
|
|
3919
|
+
// ../common/src/timings.ts
|
|
3920
|
+
var TIMINGS_ENV_VAR = "UIP_TIMINGS";
|
|
3921
|
+
function createStorage2() {
|
|
3922
|
+
const [error, mod] = catchError(() => __require("node:async_hooks"));
|
|
3923
|
+
if (error || typeof mod?.AsyncLocalStorage !== "function") {
|
|
3924
|
+
return {
|
|
3925
|
+
getStore: () => {
|
|
3926
|
+
return;
|
|
3927
|
+
},
|
|
3928
|
+
run: (_store, fn) => fn()
|
|
3929
|
+
};
|
|
3930
|
+
}
|
|
3931
|
+
return new mod.AsyncLocalStorage;
|
|
3932
|
+
}
|
|
3933
|
+
var storageSlot = singleton("TimingStorage");
|
|
3934
|
+
var stateSlot = singleton("Timings");
|
|
3935
|
+
var rootStartedSlot = singleton("TimingsRootStarted");
|
|
3936
|
+
var longLivedHostSlot = singleton("TimingsLongLivedHost");
|
|
3937
|
+
var storage = storageSlot.getOrInit(createStorage2, (value) => ("getStore" in value));
|
|
3938
|
+
function newState(baseline) {
|
|
3939
|
+
return { baseline, httpMs: 0, httpCalls: 0 };
|
|
3940
|
+
}
|
|
3941
|
+
function getState() {
|
|
3942
|
+
const scoped = storage.getStore();
|
|
3943
|
+
if (scoped) {
|
|
3944
|
+
return scoped;
|
|
3945
|
+
}
|
|
3946
|
+
const pinned = livePinnedState();
|
|
3947
|
+
if (pinned !== undefined) {
|
|
3948
|
+
return pinned;
|
|
3949
|
+
}
|
|
3950
|
+
return newState(processStartIsInvocationStart() ? 0 : performance.now());
|
|
3951
|
+
}
|
|
3952
|
+
function livePinnedState() {
|
|
3953
|
+
const pinned = stateSlot.get();
|
|
3954
|
+
return pinned !== undefined && "httpCalls" in pinned && !pinned.finished ? pinned : undefined;
|
|
3955
|
+
}
|
|
3956
|
+
function processStartIsInvocationStart() {
|
|
3957
|
+
return !rootStartedSlot.get(false) && !longLivedHostSlot.get(false);
|
|
3958
|
+
}
|
|
3959
|
+
function timingsEnabled() {
|
|
3960
|
+
if (typeof process === "undefined") {
|
|
3961
|
+
return false;
|
|
3962
|
+
}
|
|
3963
|
+
const value = process.env?.[TIMINGS_ENV_VAR];
|
|
3964
|
+
if (value === undefined) {
|
|
3965
|
+
return false;
|
|
3966
|
+
}
|
|
3967
|
+
const normalized = value.trim().toLowerCase();
|
|
3968
|
+
return normalized === "1" || normalized === "true";
|
|
3969
|
+
}
|
|
3970
|
+
function recordExitCode(exitCode) {
|
|
3971
|
+
if (!timingsEnabled()) {
|
|
3972
|
+
return;
|
|
3973
|
+
}
|
|
3974
|
+
getState().exitCode = exitCode;
|
|
3975
|
+
}
|
|
3976
|
+
function invocationStartedAt() {
|
|
3977
|
+
return new Date(performance.timeOrigin + getState().baseline);
|
|
3978
|
+
}
|
|
3979
|
+
function invocationElapsedMs() {
|
|
3980
|
+
return performance.now() - getState().baseline;
|
|
3981
|
+
}
|
|
3982
|
+
function markCommandStart() {
|
|
3983
|
+
if (!timingsEnabled()) {
|
|
3984
|
+
return;
|
|
3985
|
+
}
|
|
3986
|
+
getState().commandStart = performance.now();
|
|
3987
|
+
}
|
|
3988
|
+
function recordCommandDuration(durationMs) {
|
|
3989
|
+
if (!timingsEnabled()) {
|
|
3990
|
+
return;
|
|
3991
|
+
}
|
|
3992
|
+
getState().commandMs = durationMs;
|
|
3993
|
+
}
|
|
3994
|
+
|
|
3513
3995
|
// ../common/src/exit-code.ts
|
|
3514
3996
|
function setExitCode(code) {
|
|
3515
3997
|
process.exitCode = code;
|
|
3998
|
+
recordExitCode(code);
|
|
3999
|
+
}
|
|
4000
|
+
var GENERIC_FAILURE_EXIT_CODE = 1;
|
|
4001
|
+
function recordCommandExit(code) {
|
|
4002
|
+
if (code === GENERIC_FAILURE_EXIT_CODE && getExitCode() !== 0) {
|
|
4003
|
+
return;
|
|
4004
|
+
}
|
|
4005
|
+
setExitCode(code);
|
|
4006
|
+
}
|
|
4007
|
+
function getExitCode() {
|
|
4008
|
+
const code = process.exitCode;
|
|
4009
|
+
return typeof code === "number" ? code : 0;
|
|
3516
4010
|
}
|
|
3517
4011
|
|
|
3518
4012
|
// ../common/src/output-codecs.ts
|
|
@@ -3521,12 +4015,12 @@ var jmespathSlot = singleton("JmespathCodec");
|
|
|
3521
4015
|
async function loadOutputCodecsAsync(needed) {
|
|
3522
4016
|
const loads = [];
|
|
3523
4017
|
if (needed.yaml && yamlSlot.get() === undefined) {
|
|
3524
|
-
loads.push(import("./js-yaml-
|
|
4018
|
+
loads.push(import("./js-yaml-a2bk27p6.js").then((mod) => {
|
|
3525
4019
|
yamlSlot.set(mod);
|
|
3526
4020
|
}));
|
|
3527
4021
|
}
|
|
3528
4022
|
if (needed.filter && jmespathSlot.get() === undefined) {
|
|
3529
|
-
loads.push(import("./jmespath-
|
|
4023
|
+
loads.push(import("./jmespath-ab6tdc42.js").then((m)=>__toESM(m.default,1)).then((mod) => {
|
|
3530
4024
|
jmespathSlot.set(mod);
|
|
3531
4025
|
}));
|
|
3532
4026
|
}
|
|
@@ -3551,155 +4045,6 @@ function getOutputFilter() {
|
|
|
3551
4045
|
return filterSlot.get();
|
|
3552
4046
|
}
|
|
3553
4047
|
|
|
3554
|
-
// ../common/src/telemetry/telemetry-dimensions.ts
|
|
3555
|
-
var BaseDimensions = {
|
|
3556
|
-
ApplicationName: "ApplicationName",
|
|
3557
|
-
ProductVersion: "ProductVersion",
|
|
3558
|
-
InstallationId: "InstallationId",
|
|
3559
|
-
CloudUserId: "CloudUserId",
|
|
3560
|
-
CloudTenantId: "CloudTenantId",
|
|
3561
|
-
CloudOrganizationId: "CloudOrganizationId",
|
|
3562
|
-
IsInternalUser: "IsInternalUser",
|
|
3563
|
-
Environment: "Environment",
|
|
3564
|
-
BaseUrl: "BaseUrl",
|
|
3565
|
-
Region: "Region",
|
|
3566
|
-
Agent: "Agent",
|
|
3567
|
-
AgentVersion: "AgentVersion",
|
|
3568
|
-
AgentModel: "AgentModel",
|
|
3569
|
-
ToolName: "ToolName",
|
|
3570
|
-
ToolVersion: "ToolVersion",
|
|
3571
|
-
ExecutionContext: "ExecutionContext",
|
|
3572
|
-
CiProvider: "CiProvider",
|
|
3573
|
-
SessionIdSource: "SessionIdSource",
|
|
3574
|
-
SessionId: "SessionId"
|
|
3575
|
-
};
|
|
3576
|
-
var CommandDimensions = {
|
|
3577
|
-
IsCommand: "IsCommand",
|
|
3578
|
-
IsReexec: "IsReexec",
|
|
3579
|
-
CommandName: "CommandName",
|
|
3580
|
-
ExitCode: "ExitCode",
|
|
3581
|
-
TerminalOutcome: "TerminalOutcome",
|
|
3582
|
-
ErrorClass: "ErrorClass",
|
|
3583
|
-
TerminalSignal: "TerminalSignal",
|
|
3584
|
-
ErrorMessage: "ErrorMessage",
|
|
3585
|
-
SkillName: "SkillName",
|
|
3586
|
-
ProductArea: "ProductArea",
|
|
3587
|
-
Mode: "Mode"
|
|
3588
|
-
};
|
|
3589
|
-
var ShipDimensions = {
|
|
3590
|
-
ShipKind: "ShipKind",
|
|
3591
|
-
Target: "Target",
|
|
3592
|
-
ProjectType: "ProjectType",
|
|
3593
|
-
ProjectTypes: "ProjectTypes",
|
|
3594
|
-
ArtifactCorrelationKey: "ArtifactCorrelationKey",
|
|
3595
|
-
PackageName: "PackageName",
|
|
3596
|
-
PackageVersion: "PackageVersion",
|
|
3597
|
-
PackageVersionKey: "PackageVersionKey",
|
|
3598
|
-
DeploymentKey: "DeploymentKey",
|
|
3599
|
-
SolutionId: "SolutionId",
|
|
3600
|
-
FolderKey: "FolderKey",
|
|
3601
|
-
FeedId: "FeedId"
|
|
3602
|
-
};
|
|
3603
|
-
var ErrorDimensions = {
|
|
3604
|
-
Result: "Result",
|
|
3605
|
-
ErrorCode: "ErrorCode",
|
|
3606
|
-
Retry: "Retry",
|
|
3607
|
-
ErrorMessage: "ErrorMessage",
|
|
3608
|
-
HttpStatus: "HttpStatus",
|
|
3609
|
-
UpstreamErrorCode: "UpstreamErrorCode"
|
|
3610
|
-
};
|
|
3611
|
-
var AuthDimensions = {
|
|
3612
|
-
AuthenticationMethod: "AuthenticationMethod",
|
|
3613
|
-
Success: "Success",
|
|
3614
|
-
Reason: "Reason"
|
|
3615
|
-
};
|
|
3616
|
-
var SkillsDimensions = {
|
|
3617
|
-
SchemaVersion: "SchemaVersion",
|
|
3618
|
-
AgentType: "AgentType",
|
|
3619
|
-
SkillsVersion: "SkillsVersion",
|
|
3620
|
-
UipSubcommand: "UipSubcommand",
|
|
3621
|
-
FileExtension: "FileExtension",
|
|
3622
|
-
SubagentModel: "SubagentModel",
|
|
3623
|
-
SubagentType: "SubagentType",
|
|
3624
|
-
PermissionMode: "PermissionMode",
|
|
3625
|
-
EffortLevel: "EffortLevel",
|
|
3626
|
-
SessionSource: "SessionSource",
|
|
3627
|
-
Outcome: "Outcome",
|
|
3628
|
-
DurationMs: "DurationMs",
|
|
3629
|
-
Source: "Source"
|
|
3630
|
-
};
|
|
3631
|
-
var PackagerDimensions = {
|
|
3632
|
-
ProjectId: "ProjectId",
|
|
3633
|
-
ProjectType: "ProjectType",
|
|
3634
|
-
SolutionId: "SolutionId"
|
|
3635
|
-
};
|
|
3636
|
-
var ScopeDimensions = {
|
|
3637
|
-
FolderId: "FolderId"
|
|
3638
|
-
};
|
|
3639
|
-
var ID_DIMENSIONS = new Set([
|
|
3640
|
-
BaseDimensions.CloudUserId,
|
|
3641
|
-
BaseDimensions.CloudTenantId,
|
|
3642
|
-
BaseDimensions.CloudOrganizationId,
|
|
3643
|
-
BaseDimensions.InstallationId,
|
|
3644
|
-
ShipDimensions.ArtifactCorrelationKey,
|
|
3645
|
-
ShipDimensions.PackageVersionKey,
|
|
3646
|
-
ShipDimensions.DeploymentKey,
|
|
3647
|
-
ShipDimensions.SolutionId,
|
|
3648
|
-
ShipDimensions.FolderKey,
|
|
3649
|
-
ShipDimensions.FeedId,
|
|
3650
|
-
PackagerDimensions.ProjectId
|
|
3651
|
-
]);
|
|
3652
|
-
var NON_IDENTIFIER_PLACEHOLDER_PATTERN = /^(?:\[[A-Z_]+\]|<[^>]+>)$/;
|
|
3653
|
-
var RESERVED_DIMENSION_NAMES = new Set([
|
|
3654
|
-
...Object.values(BaseDimensions),
|
|
3655
|
-
...Object.values(CommandDimensions),
|
|
3656
|
-
...Object.values(ShipDimensions),
|
|
3657
|
-
...Object.values(ErrorDimensions),
|
|
3658
|
-
...Object.values(AuthDimensions),
|
|
3659
|
-
...Object.values(SkillsDimensions),
|
|
3660
|
-
...Object.values(PackagerDimensions),
|
|
3661
|
-
...Object.values(ScopeDimensions)
|
|
3662
|
-
]);
|
|
3663
|
-
var CURATED_DIMENSIONS = new Set([
|
|
3664
|
-
BaseDimensions.ApplicationName,
|
|
3665
|
-
BaseDimensions.ProductVersion,
|
|
3666
|
-
BaseDimensions.InstallationId,
|
|
3667
|
-
BaseDimensions.CloudUserId,
|
|
3668
|
-
BaseDimensions.CloudTenantId,
|
|
3669
|
-
BaseDimensions.CloudOrganizationId,
|
|
3670
|
-
BaseDimensions.IsInternalUser,
|
|
3671
|
-
BaseDimensions.Environment,
|
|
3672
|
-
BaseDimensions.BaseUrl,
|
|
3673
|
-
BaseDimensions.Region,
|
|
3674
|
-
BaseDimensions.Agent,
|
|
3675
|
-
BaseDimensions.AgentVersion,
|
|
3676
|
-
BaseDimensions.ToolVersion,
|
|
3677
|
-
BaseDimensions.ExecutionContext,
|
|
3678
|
-
BaseDimensions.CiProvider,
|
|
3679
|
-
BaseDimensions.SessionIdSource,
|
|
3680
|
-
BaseDimensions.SessionId,
|
|
3681
|
-
...Object.values(CommandDimensions),
|
|
3682
|
-
...Object.values(ShipDimensions)
|
|
3683
|
-
]);
|
|
3684
|
-
function lowercaseIdDimensionValues(properties) {
|
|
3685
|
-
let changed = false;
|
|
3686
|
-
const result = {
|
|
3687
|
-
...properties
|
|
3688
|
-
};
|
|
3689
|
-
for (const key of Object.keys(result)) {
|
|
3690
|
-
const value = result[key];
|
|
3691
|
-
if (!ID_DIMENSIONS.has(key) || typeof value !== "string" || NON_IDENTIFIER_PLACEHOLDER_PATTERN.test(value)) {
|
|
3692
|
-
continue;
|
|
3693
|
-
}
|
|
3694
|
-
const lowered = value.toLowerCase();
|
|
3695
|
-
if (lowered !== value) {
|
|
3696
|
-
result[key] = lowered;
|
|
3697
|
-
changed = true;
|
|
3698
|
-
}
|
|
3699
|
-
}
|
|
3700
|
-
return changed ? result : properties;
|
|
3701
|
-
}
|
|
3702
|
-
|
|
3703
4048
|
// ../common/src/telemetry/command-terminal.ts
|
|
3704
4049
|
var recordedFailureSlot = singleton("CommandTelemetryFailure");
|
|
3705
4050
|
var AUTH_ERROR_CODES = new Set([
|
|
@@ -3812,23 +4157,14 @@ function terminalSignalFor(input, outcome) {
|
|
|
3812
4157
|
if (input.recordedFailure?.terminalSignal) {
|
|
3813
4158
|
return input.recordedFailure.terminalSignal;
|
|
3814
4159
|
}
|
|
3815
|
-
const explicit = findStringInCauseChain(input.error, "terminalSignal") ?? findStringInCauseChain(input.error, "signal");
|
|
3816
|
-
if (explicit) {
|
|
3817
|
-
return explicit;
|
|
3818
|
-
}
|
|
3819
|
-
return outcome === "cancelled" ? "SIGINT" : undefined;
|
|
3820
|
-
}
|
|
3821
|
-
function classifyHttpStatus(status) {
|
|
3822
|
-
if (status === 401 || status === 403) {
|
|
3823
|
-
return "auth";
|
|
3824
|
-
}
|
|
3825
|
-
if (status === 400 || status === 409 || status === 422) {
|
|
3826
|
-
return "validation";
|
|
3827
|
-
}
|
|
3828
|
-
if (status === 408) {
|
|
3829
|
-
return "timeout";
|
|
4160
|
+
const explicit = findStringInCauseChain(input.error, "terminalSignal") ?? findStringInCauseChain(input.error, "signal");
|
|
4161
|
+
if (explicit) {
|
|
4162
|
+
return explicit;
|
|
3830
4163
|
}
|
|
3831
|
-
return "
|
|
4164
|
+
return outcome === "cancelled" ? "SIGINT" : undefined;
|
|
4165
|
+
}
|
|
4166
|
+
function classifyFailingHttpStatus(status) {
|
|
4167
|
+
return classifyFromErrorCode(classifyHttpStatus(status)?.errorCode) ?? "network_http";
|
|
3832
4168
|
}
|
|
3833
4169
|
function classifyFromResult(result) {
|
|
3834
4170
|
switch (result) {
|
|
@@ -3908,7 +4244,7 @@ function classifyError2(input) {
|
|
|
3908
4244
|
}
|
|
3909
4245
|
const status = recorded?.context?.httpStatus ?? findHttpStatusInGraph(input.error);
|
|
3910
4246
|
if (status !== undefined) {
|
|
3911
|
-
return
|
|
4247
|
+
return classifyFailingHttpStatus(status);
|
|
3912
4248
|
}
|
|
3913
4249
|
return classifyFromResult(recorded?.result) ?? classifyFromErrorCode(recorded?.errorCode) ?? classifyFromError(input.error) ?? "unknown";
|
|
3914
4250
|
}
|
|
@@ -3940,6 +4276,7 @@ function buildCommandTerminalTelemetryProperties(input) {
|
|
|
3940
4276
|
var CommonTelemetryEvents = {
|
|
3941
4277
|
Start: "Application.Start",
|
|
3942
4278
|
Error: "Application.Error",
|
|
4279
|
+
ProjectActivity: "Cli.ProjectActivity",
|
|
3943
4280
|
ShipSucceeded: "Cli.ShipSucceeded"
|
|
3944
4281
|
};
|
|
3945
4282
|
|
|
@@ -4457,87 +4794,21 @@ class TelemetryService {
|
|
|
4457
4794
|
return hex;
|
|
4458
4795
|
}
|
|
4459
4796
|
}
|
|
4460
|
-
// ../common/src/timings.ts
|
|
4461
|
-
var TIMINGS_ENV_VAR = "UIP_TIMINGS";
|
|
4462
|
-
function createStorage2() {
|
|
4463
|
-
const [error, mod] = catchError(() => __require("node:async_hooks"));
|
|
4464
|
-
if (error || typeof mod?.AsyncLocalStorage !== "function") {
|
|
4465
|
-
return {
|
|
4466
|
-
getStore: () => {
|
|
4467
|
-
return;
|
|
4468
|
-
},
|
|
4469
|
-
run: (_store, fn) => fn()
|
|
4470
|
-
};
|
|
4471
|
-
}
|
|
4472
|
-
return new mod.AsyncLocalStorage;
|
|
4473
|
-
}
|
|
4474
|
-
var storageSlot = singleton("TimingStorage");
|
|
4475
|
-
var stateSlot = singleton("Timings");
|
|
4476
|
-
var rootStartedSlot = singleton("TimingsRootStarted");
|
|
4477
|
-
var longLivedHostSlot = singleton("TimingsLongLivedHost");
|
|
4478
|
-
var storage = storageSlot.getOrInit(createStorage2, (value) => ("getStore" in value));
|
|
4479
|
-
function newState(baseline) {
|
|
4480
|
-
return { baseline, httpMs: 0, httpCalls: 0 };
|
|
4481
|
-
}
|
|
4482
|
-
function getState() {
|
|
4483
|
-
const scoped = storage.getStore();
|
|
4484
|
-
if (scoped) {
|
|
4485
|
-
return scoped;
|
|
4486
|
-
}
|
|
4487
|
-
const pinned = livePinnedState();
|
|
4488
|
-
if (pinned !== undefined) {
|
|
4489
|
-
return pinned;
|
|
4490
|
-
}
|
|
4491
|
-
return newState(processStartIsInvocationStart() ? 0 : performance.now());
|
|
4492
|
-
}
|
|
4493
|
-
function livePinnedState() {
|
|
4494
|
-
const pinned = stateSlot.get();
|
|
4495
|
-
return pinned !== undefined && "httpCalls" in pinned && !pinned.finished ? pinned : undefined;
|
|
4496
|
-
}
|
|
4497
|
-
function processStartIsInvocationStart() {
|
|
4498
|
-
return !rootStartedSlot.get(false) && !longLivedHostSlot.get(false);
|
|
4499
|
-
}
|
|
4500
|
-
function timingsEnabled() {
|
|
4501
|
-
if (typeof process === "undefined") {
|
|
4502
|
-
return false;
|
|
4503
|
-
}
|
|
4504
|
-
const value = process.env?.[TIMINGS_ENV_VAR];
|
|
4505
|
-
if (value === undefined) {
|
|
4506
|
-
return false;
|
|
4507
|
-
}
|
|
4508
|
-
const normalized = value.trim().toLowerCase();
|
|
4509
|
-
return normalized === "1" || normalized === "true";
|
|
4510
|
-
}
|
|
4511
|
-
function recordExitCode(exitCode) {
|
|
4512
|
-
if (!timingsEnabled()) {
|
|
4513
|
-
return;
|
|
4514
|
-
}
|
|
4515
|
-
getState().exitCode = exitCode;
|
|
4516
|
-
}
|
|
4517
|
-
function invocationStartedAt() {
|
|
4518
|
-
return new Date(performance.timeOrigin + getState().baseline);
|
|
4519
|
-
}
|
|
4520
|
-
function invocationElapsedMs() {
|
|
4521
|
-
return performance.now() - getState().baseline;
|
|
4522
|
-
}
|
|
4523
|
-
function markCommandStart() {
|
|
4524
|
-
if (!timingsEnabled()) {
|
|
4525
|
-
return;
|
|
4526
|
-
}
|
|
4527
|
-
getState().commandStart = performance.now();
|
|
4528
|
-
}
|
|
4529
|
-
function recordCommandDuration(durationMs) {
|
|
4530
|
-
if (!timingsEnabled()) {
|
|
4531
|
-
return;
|
|
4532
|
-
}
|
|
4533
|
-
getState().commandMs = durationMs;
|
|
4534
|
-
}
|
|
4535
4797
|
// ../common/src/telemetry/proxy-http-agent.ts
|
|
4536
4798
|
var slot = singleton("ProxyAuthHttpsAgent");
|
|
4537
4799
|
|
|
4538
4800
|
// ../common/src/telemetry/node-appinsights-telemetry-provider.ts
|
|
4539
4801
|
var providerSlot = singleton("TelemetryProvider");
|
|
4540
4802
|
|
|
4803
|
+
// ../common/src/telemetry/telemetry-config.ts
|
|
4804
|
+
function isTelemetryDisabled() {
|
|
4805
|
+
const value = process.env.UIPATH_TELEMETRY_DISABLED;
|
|
4806
|
+
return value === "1" || value === "true";
|
|
4807
|
+
}
|
|
4808
|
+
function isProjectTelemetryDisabled() {
|
|
4809
|
+
return isTelemetryDisabled() || process.env.UIPATH_PROJECT_TELEMETRY_DISABLED === "1" || process.env.UIPATH_PROJECT_TELEMETRY_DISABLED === "true";
|
|
4810
|
+
}
|
|
4811
|
+
|
|
4541
4812
|
// ../common/src/telemetry/telemetry-spool.ts
|
|
4542
4813
|
var sidecarEntrySlot = singleton("TelemetrySidecarEntry");
|
|
4543
4814
|
var MAX_SPOOL_AGE_MS = 72 * 60 * 60 * 1000;
|
|
@@ -4573,7 +4844,6 @@ var telemetry = new Proxy({}, {
|
|
|
4573
4844
|
return typeof value === "function" ? value.bind(instance) : value;
|
|
4574
4845
|
}
|
|
4575
4846
|
});
|
|
4576
|
-
|
|
4577
4847
|
// ../common/src/formatter.ts
|
|
4578
4848
|
var ANSI_STYLES = {
|
|
4579
4849
|
red: "\x1B[31m",
|
|
@@ -4583,46 +4853,6 @@ var ANSI_RESET = "\x1B[0m";
|
|
|
4583
4853
|
function styleLine(line, style) {
|
|
4584
4854
|
return style ? `${ANSI_STYLES[style]}${line}${ANSI_RESET}` : line;
|
|
4585
4855
|
}
|
|
4586
|
-
var CLI_ERROR_CODES = [
|
|
4587
|
-
"invalid_argument",
|
|
4588
|
-
"authentication_required",
|
|
4589
|
-
"permission_denied",
|
|
4590
|
-
"local_permission_denied",
|
|
4591
|
-
"not_found",
|
|
4592
|
-
"rate_limited",
|
|
4593
|
-
"network_error",
|
|
4594
|
-
"timeout",
|
|
4595
|
-
"server_error",
|
|
4596
|
-
"method_not_allowed",
|
|
4597
|
-
"not_supported",
|
|
4598
|
-
"configuration_error",
|
|
4599
|
-
"execution_failed",
|
|
4600
|
-
"unknown_error"
|
|
4601
|
-
];
|
|
4602
|
-
var RETRY_HINTS = [
|
|
4603
|
-
"RetryWillNotFix",
|
|
4604
|
-
"RetryLater",
|
|
4605
|
-
"RetryAfter1Second",
|
|
4606
|
-
"RetryAfter10Seconds",
|
|
4607
|
-
"RetryAfter30Seconds",
|
|
4608
|
-
"RetryAfter60Seconds"
|
|
4609
|
-
];
|
|
4610
|
-
var CLI_ERROR_CODE_VALUES = new Set(CLI_ERROR_CODES);
|
|
4611
|
-
var RETRY_HINT_VALUES = new Set(RETRY_HINTS);
|
|
4612
|
-
function isCliErrorCode(value) {
|
|
4613
|
-
return typeof value === "string" && CLI_ERROR_CODE_VALUES.has(value);
|
|
4614
|
-
}
|
|
4615
|
-
function isRetryHint(value) {
|
|
4616
|
-
return typeof value === "string" && RETRY_HINT_VALUES.has(value);
|
|
4617
|
-
}
|
|
4618
|
-
var RESULTS = {
|
|
4619
|
-
Success: "Success",
|
|
4620
|
-
Failure: "Failure",
|
|
4621
|
-
ConfigError: "ConfigError",
|
|
4622
|
-
AuthenticationError: "AuthenticationError",
|
|
4623
|
-
ValidationError: "ValidationError",
|
|
4624
|
-
TimeoutError: "TimeoutError"
|
|
4625
|
-
};
|
|
4626
4856
|
var EXIT_CODES = {
|
|
4627
4857
|
Success: 0,
|
|
4628
4858
|
Failure: 1,
|
|
@@ -4631,6 +4861,9 @@ var EXIT_CODES = {
|
|
|
4631
4861
|
ValidationError: 3,
|
|
4632
4862
|
TimeoutError: 4
|
|
4633
4863
|
};
|
|
4864
|
+
function exitCodeForResult(result) {
|
|
4865
|
+
return EXIT_CODES[result] ?? EXIT_CODES.Failure;
|
|
4866
|
+
}
|
|
4634
4867
|
|
|
4635
4868
|
class Pagination {
|
|
4636
4869
|
Returned;
|
|
@@ -5339,8 +5572,8 @@ function carriesOnlyNulls(value) {
|
|
|
5339
5572
|
}
|
|
5340
5573
|
return false;
|
|
5341
5574
|
}
|
|
5342
|
-
function nameList(names,
|
|
5343
|
-
const shown = names.slice(0,
|
|
5575
|
+
function nameList(names, cap = 12) {
|
|
5576
|
+
const shown = names.slice(0, cap).map((n) => `\`${n}\``);
|
|
5344
5577
|
const rest = names.length - shown.length;
|
|
5345
5578
|
return shown.join(", ") + (rest > 0 ? `, and ${rest} more` : "");
|
|
5346
5579
|
}
|
|
@@ -5477,40 +5710,11 @@ function defaultErrorCodeForResult(result) {
|
|
|
5477
5710
|
return "unknown_error";
|
|
5478
5711
|
}
|
|
5479
5712
|
}
|
|
5480
|
-
function parseHttpStatusFromMessage2(message) {
|
|
5481
|
-
const match = /^HTTP\s+(\d{3})(?::|\s|-|$)/i.exec(message.trim());
|
|
5482
|
-
if (!match)
|
|
5483
|
-
return;
|
|
5484
|
-
const status = Number(match[1]);
|
|
5485
|
-
return Number.isInteger(status) && status >= 100 && status <= 599 ? status : undefined;
|
|
5486
|
-
}
|
|
5487
|
-
function defaultErrorCodeForHttpStatus(status) {
|
|
5488
|
-
if (status === undefined)
|
|
5489
|
-
return;
|
|
5490
|
-
if (status === 400 || status === 409 || status === 422) {
|
|
5491
|
-
return "invalid_argument";
|
|
5492
|
-
}
|
|
5493
|
-
if (status === 401)
|
|
5494
|
-
return "authentication_required";
|
|
5495
|
-
if (status === 403)
|
|
5496
|
-
return "permission_denied";
|
|
5497
|
-
if (status === 404)
|
|
5498
|
-
return "not_found";
|
|
5499
|
-
if (status === 405)
|
|
5500
|
-
return "method_not_allowed";
|
|
5501
|
-
if (status === 408)
|
|
5502
|
-
return "timeout";
|
|
5503
|
-
if (status === 429)
|
|
5504
|
-
return "rate_limited";
|
|
5505
|
-
if (status >= 500 && status < 600)
|
|
5506
|
-
return "server_error";
|
|
5507
|
-
return;
|
|
5508
|
-
}
|
|
5509
5713
|
var LOCAL_PERMISSION_TEXT_PATTERN = new RegExp(`(?:\\b|\\()(?:${[...LOCAL_PERMISSION_ERROR_CODES].join("|")})(?::\\s|\\))`);
|
|
5510
5714
|
function defaultErrorCodeForFailure(data) {
|
|
5511
5715
|
if (data.Result === RESULTS.Failure) {
|
|
5512
|
-
const status = data.Context?.httpStatus ??
|
|
5513
|
-
const errorCode =
|
|
5716
|
+
const status = data.Context?.httpStatus ?? parseHttpStatusFromMessage(data.Message);
|
|
5717
|
+
const errorCode = classifyHttpStatus(status)?.errorCode;
|
|
5514
5718
|
if (errorCode)
|
|
5515
5719
|
return errorCode;
|
|
5516
5720
|
if (status === undefined && (LOCAL_PERMISSION_TEXT_PATTERN.test(data.Message) || LOCAL_PERMISSION_TEXT_PATTERN.test(data.Instructions))) {
|
|
@@ -5519,17 +5723,6 @@ function defaultErrorCodeForFailure(data) {
|
|
|
5519
5723
|
}
|
|
5520
5724
|
return defaultErrorCodeForResult(data.Result);
|
|
5521
5725
|
}
|
|
5522
|
-
function defaultRetryForErrorCode(errorCode) {
|
|
5523
|
-
switch (errorCode) {
|
|
5524
|
-
case "network_error":
|
|
5525
|
-
case "rate_limited":
|
|
5526
|
-
case "server_error":
|
|
5527
|
-
case "timeout":
|
|
5528
|
-
return "RetryLater";
|
|
5529
|
-
default:
|
|
5530
|
-
return "RetryWillNotFix";
|
|
5531
|
-
}
|
|
5532
|
-
}
|
|
5533
5726
|
var OutputFormatter;
|
|
5534
5727
|
((OutputFormatter) => {
|
|
5535
5728
|
function success(data, options) {
|
|
@@ -5561,7 +5754,7 @@ var OutputFormatter;
|
|
|
5561
5754
|
data.Log ??= getLogFilePath() || undefined;
|
|
5562
5755
|
data.ErrorCode ??= defaultErrorCodeForFailure(data);
|
|
5563
5756
|
data.Retry ??= defaultRetryForErrorCode(data.ErrorCode);
|
|
5564
|
-
const exitCode =
|
|
5757
|
+
const exitCode = exitCodeForResult(data.Result);
|
|
5565
5758
|
setExitCode(exitCode);
|
|
5566
5759
|
recordCommandFailureTelemetry({
|
|
5567
5760
|
result: data.Result,
|
|
@@ -5656,34 +5849,227 @@ var OutputFormatter;
|
|
|
5656
5849
|
OutputFormatter.formatToString = formatToString;
|
|
5657
5850
|
})(OutputFormatter ||= {});
|
|
5658
5851
|
|
|
5659
|
-
// ../common/src/
|
|
5660
|
-
|
|
5661
|
-
|
|
5662
|
-
|
|
5663
|
-
|
|
5664
|
-
|
|
5665
|
-
|
|
5666
|
-
|
|
5667
|
-
|
|
5668
|
-
|
|
5669
|
-
|
|
5852
|
+
// ../common/src/pass-through-tail.ts
|
|
5853
|
+
function maybeOption(arg) {
|
|
5854
|
+
return arg.length > 1 && arg[0] === "-";
|
|
5855
|
+
}
|
|
5856
|
+
function tokenizeTail(cmd, tail) {
|
|
5857
|
+
const find = (flag) => cmd.options.find((option) => option.long === flag || option.short === flag);
|
|
5858
|
+
const digitShort = cmd.options.some((option) => option.short !== undefined && /^-\d$/.test(option.short));
|
|
5859
|
+
const negativeNumber = (arg) => !digitShort && /^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(arg);
|
|
5860
|
+
const tokens = [];
|
|
5861
|
+
let firstUnknown = -1;
|
|
5862
|
+
let sentinel = -1;
|
|
5863
|
+
let variadic;
|
|
5864
|
+
let group;
|
|
5865
|
+
let groupIndex = 0;
|
|
5866
|
+
let i = 0;
|
|
5867
|
+
while (i < tail.length || group !== undefined) {
|
|
5868
|
+
const index = group === undefined ? i : groupIndex;
|
|
5869
|
+
const arg = group ?? tail[i++];
|
|
5870
|
+
group = undefined;
|
|
5871
|
+
if (arg === "--") {
|
|
5872
|
+
sentinel = index;
|
|
5873
|
+
tokens.push({ kind: "sentinel", index });
|
|
5874
|
+
for (let j = i;j < tail.length; j++) {
|
|
5875
|
+
tokens.push({
|
|
5876
|
+
kind: "operand",
|
|
5877
|
+
index: j,
|
|
5878
|
+
text: tail[j],
|
|
5879
|
+
literal: true
|
|
5880
|
+
});
|
|
5881
|
+
}
|
|
5882
|
+
break;
|
|
5883
|
+
}
|
|
5884
|
+
if (variadic && (!maybeOption(arg) || negativeNumber(arg))) {
|
|
5885
|
+
tokens.push({
|
|
5886
|
+
kind: "option",
|
|
5887
|
+
index,
|
|
5888
|
+
text: arg,
|
|
5889
|
+
option: variadic,
|
|
5890
|
+
value: arg
|
|
5891
|
+
});
|
|
5892
|
+
continue;
|
|
5893
|
+
}
|
|
5894
|
+
variadic = undefined;
|
|
5895
|
+
if (maybeOption(arg)) {
|
|
5896
|
+
const option = find(arg);
|
|
5897
|
+
if (option) {
|
|
5898
|
+
let value;
|
|
5899
|
+
if (option.required) {
|
|
5900
|
+
value = tail[i];
|
|
5901
|
+
if (value !== undefined)
|
|
5902
|
+
i++;
|
|
5903
|
+
} else if (option.optional) {
|
|
5904
|
+
const next = tail[i];
|
|
5905
|
+
if (next !== undefined && (!maybeOption(next) || negativeNumber(next))) {
|
|
5906
|
+
value = next;
|
|
5907
|
+
i++;
|
|
5908
|
+
}
|
|
5909
|
+
}
|
|
5910
|
+
tokens.push({
|
|
5911
|
+
kind: "option",
|
|
5912
|
+
index,
|
|
5913
|
+
text: arg,
|
|
5914
|
+
option,
|
|
5915
|
+
...value === undefined ? {} : { value }
|
|
5916
|
+
});
|
|
5917
|
+
variadic = option.variadic ? option : undefined;
|
|
5918
|
+
continue;
|
|
5919
|
+
}
|
|
5920
|
+
}
|
|
5921
|
+
if (arg.length > 2 && arg[0] === "-" && arg[1] !== "-") {
|
|
5922
|
+
const option = find(`-${arg[1]}`);
|
|
5923
|
+
if (option) {
|
|
5924
|
+
if (option.required || option.optional) {
|
|
5925
|
+
tokens.push({
|
|
5926
|
+
kind: "option",
|
|
5927
|
+
index,
|
|
5928
|
+
text: arg,
|
|
5929
|
+
option,
|
|
5930
|
+
value: arg.slice(2)
|
|
5931
|
+
});
|
|
5932
|
+
} else {
|
|
5933
|
+
tokens.push({ kind: "option", index, text: arg, option });
|
|
5934
|
+
group = `-${arg.slice(2)}`;
|
|
5935
|
+
groupIndex = index;
|
|
5936
|
+
}
|
|
5937
|
+
continue;
|
|
5938
|
+
}
|
|
5939
|
+
}
|
|
5940
|
+
if (/^--[^=]+=/.test(arg)) {
|
|
5941
|
+
const equals = arg.indexOf("=");
|
|
5942
|
+
const option = find(arg.slice(0, equals));
|
|
5943
|
+
if (option && (option.required || option.optional)) {
|
|
5944
|
+
tokens.push({
|
|
5945
|
+
kind: "option",
|
|
5946
|
+
index,
|
|
5947
|
+
text: arg,
|
|
5948
|
+
option,
|
|
5949
|
+
value: arg.slice(equals + 1)
|
|
5950
|
+
});
|
|
5951
|
+
continue;
|
|
5952
|
+
}
|
|
5953
|
+
}
|
|
5954
|
+
if (maybeOption(arg) && !negativeNumber(arg)) {
|
|
5955
|
+
const equals = arg.startsWith("--") ? arg.indexOf("=") : -1;
|
|
5956
|
+
if (firstUnknown === -1)
|
|
5957
|
+
firstUnknown = index;
|
|
5958
|
+
tokens.push({
|
|
5959
|
+
kind: "unknown",
|
|
5960
|
+
index,
|
|
5961
|
+
text: arg,
|
|
5962
|
+
flag: equals > 0 ? arg.slice(0, equals) : arg,
|
|
5963
|
+
...equals > 0 ? { inlineValue: arg.slice(equals + 1) } : {}
|
|
5964
|
+
});
|
|
5965
|
+
continue;
|
|
5966
|
+
}
|
|
5967
|
+
tokens.push({ kind: "operand", index, text: arg, literal: false });
|
|
5968
|
+
}
|
|
5969
|
+
return { tokens, firstUnknown, sentinel };
|
|
5670
5970
|
}
|
|
5671
5971
|
|
|
5672
|
-
//
|
|
5673
|
-
var
|
|
5674
|
-
var
|
|
5675
|
-
|
|
5676
|
-
|
|
5677
|
-
|
|
5678
|
-
|
|
5679
|
-
|
|
5680
|
-
|
|
5681
|
-
|
|
5682
|
-
|
|
5683
|
-
|
|
5684
|
-
|
|
5685
|
-
|
|
5686
|
-
|
|
5972
|
+
// ../common/src/project-telemetry.ts
|
|
5973
|
+
var RESOLVER = Symbol.for("@uipath/common/projectTelemetryResolver");
|
|
5974
|
+
var CAPTURE = Symbol.for("@uipath/common/projectTelemetryCapture");
|
|
5975
|
+
var CONTEXT_RESOLVER = Symbol.for("@uipath/common/projectContextTelemetryResolver");
|
|
5976
|
+
var RULES = Symbol.for("@uipath/common/projectTargetRules");
|
|
5977
|
+
function logSkipped(what, error) {
|
|
5978
|
+
logger.debug(`[project-telemetry] ${what} skipped: ${error instanceof Error ? error.message : String(error)}`);
|
|
5979
|
+
}
|
|
5980
|
+
function bounded(work, what) {
|
|
5981
|
+
return withinProjectIdentityBudget(work, () => logSkipped(what, `no answer within ${PROJECT_IDENTITY_LOOKUP_BUDGET_MS} ms`));
|
|
5982
|
+
}
|
|
5983
|
+
async function identityWithContext(command, identity) {
|
|
5984
|
+
const props = projectIdentityProperties(identity);
|
|
5985
|
+
if (!identity.projectDirectory || isProjectTelemetryDisabled())
|
|
5986
|
+
return props;
|
|
5987
|
+
for (let node = command;node; node = node.parent ?? undefined) {
|
|
5988
|
+
const resolver = node[CONTEXT_RESOLVER];
|
|
5989
|
+
if (typeof resolver !== "function")
|
|
5990
|
+
continue;
|
|
5991
|
+
try {
|
|
5992
|
+
return {
|
|
5993
|
+
...await resolver(identity.projectDirectory),
|
|
5994
|
+
...props
|
|
5995
|
+
};
|
|
5996
|
+
} catch (error) {
|
|
5997
|
+
logSkipped("solution context lookup", error);
|
|
5998
|
+
return props;
|
|
5999
|
+
}
|
|
6000
|
+
}
|
|
6001
|
+
return props;
|
|
6002
|
+
}
|
|
6003
|
+
function getProjectTelemetryResolver(command) {
|
|
6004
|
+
for (let node = command;node; node = node.parent) {
|
|
6005
|
+
const resolver = node[RESOLVER];
|
|
6006
|
+
if (typeof resolver === "function")
|
|
6007
|
+
return resolver;
|
|
6008
|
+
}
|
|
6009
|
+
return;
|
|
6010
|
+
}
|
|
6011
|
+
function attachProjectTelemetryCapture(command, capture) {
|
|
6012
|
+
command[CAPTURE] = capture;
|
|
6013
|
+
}
|
|
6014
|
+
class ProjectTelemetrySession {
|
|
6015
|
+
resolver;
|
|
6016
|
+
command;
|
|
6017
|
+
target;
|
|
6018
|
+
props = {};
|
|
6019
|
+
explicit = false;
|
|
6020
|
+
input;
|
|
6021
|
+
constructor(resolver, command) {
|
|
6022
|
+
this.resolver = resolver;
|
|
6023
|
+
this.command = command;
|
|
6024
|
+
}
|
|
6025
|
+
async setTarget(path) {
|
|
6026
|
+
this.target = path;
|
|
6027
|
+
if (this.input) {
|
|
6028
|
+
await this.resolve({
|
|
6029
|
+
...this.input,
|
|
6030
|
+
phase: "after",
|
|
6031
|
+
success: true
|
|
6032
|
+
});
|
|
6033
|
+
this.explicit = true;
|
|
6034
|
+
}
|
|
6035
|
+
}
|
|
6036
|
+
async setIdentity(identity) {
|
|
6037
|
+
try {
|
|
6038
|
+
const props = await bounded(identityWithContext(this.command, identity), "project identity capture");
|
|
6039
|
+
if (props !== undefined)
|
|
6040
|
+
this.setProperties(props);
|
|
6041
|
+
} catch (error) {
|
|
6042
|
+
logSkipped("project identity capture", error);
|
|
6043
|
+
}
|
|
6044
|
+
}
|
|
6045
|
+
setProperties(properties) {
|
|
6046
|
+
try {
|
|
6047
|
+
this.props = { ...properties };
|
|
6048
|
+
this.explicit = true;
|
|
6049
|
+
} catch (error) {
|
|
6050
|
+
logSkipped("project identity properties", error);
|
|
6051
|
+
}
|
|
6052
|
+
}
|
|
6053
|
+
properties() {
|
|
6054
|
+
return { ...this.props };
|
|
6055
|
+
}
|
|
6056
|
+
async resolve(input) {
|
|
6057
|
+
this.input = input;
|
|
6058
|
+
if (this.explicit)
|
|
6059
|
+
return;
|
|
6060
|
+
try {
|
|
6061
|
+
const props = await bounded(this.resolver({
|
|
6062
|
+
...input,
|
|
6063
|
+
target: this.target
|
|
6064
|
+
}), `project identity (${input.phase})`);
|
|
6065
|
+
if (props !== undefined) {
|
|
6066
|
+
this.props = props;
|
|
6067
|
+
}
|
|
6068
|
+
} catch (error) {
|
|
6069
|
+
logSkipped(`project identity (${input.phase})`, error);
|
|
6070
|
+
}
|
|
6071
|
+
}
|
|
6072
|
+
}
|
|
5687
6073
|
|
|
5688
6074
|
// ../common/src/telemetry/command-attribution.ts
|
|
5689
6075
|
var LEGACY_SKILL_NAMESPACE = "uipath:";
|
|
@@ -5929,8 +6315,7 @@ var pollSignalSlot = singleton("PollSignal");
|
|
|
5929
6315
|
var TELEMETRY_COMMAND_ARG_PREFIX = "uip.cmd.arg.";
|
|
5930
6316
|
var processContext = {
|
|
5931
6317
|
exit: (code) => {
|
|
5932
|
-
|
|
5933
|
-
setExitCode(code);
|
|
6318
|
+
recordCommandExit(code);
|
|
5934
6319
|
},
|
|
5935
6320
|
get pollSignal() {
|
|
5936
6321
|
return pollSignalSlot.get();
|
|
@@ -5955,6 +6340,8 @@ function recordableArgValue(value, choices) {
|
|
|
5955
6340
|
function extractCommandParams(cmd) {
|
|
5956
6341
|
const params = {};
|
|
5957
6342
|
forEachSuppliedArgument(cmd, (name, value, choices, defaulted) => {
|
|
6343
|
+
if (name === undefined)
|
|
6344
|
+
return;
|
|
5958
6345
|
const recordable = recordableArgValue(value, choices);
|
|
5959
6346
|
params[`${TELEMETRY_COMMAND_ARG_PREFIX}${name}`] = recordable === TELEMETRY_ARG_VALUE_WITHHELD && defaulted ? TELEMETRY_ARG_VALUE_DEFAULTED : recordable;
|
|
5960
6347
|
});
|
|
@@ -5970,7 +6357,8 @@ function isDefaultedPositional(cmd, index) {
|
|
|
5970
6357
|
function forEachSuppliedArgument(cmd, visit) {
|
|
5971
6358
|
const registered = cmd.registeredArguments ?? [];
|
|
5972
6359
|
const processed = cmd.processedArgs ?? [];
|
|
5973
|
-
|
|
6360
|
+
const bound = boundPositionalCount(cmd);
|
|
6361
|
+
for (let i = 0;i < bound; i++) {
|
|
5974
6362
|
const name = registered[i].name();
|
|
5975
6363
|
if (name && processed[i] !== undefined) {
|
|
5976
6364
|
visit(name, processed[i], registered[i].argChoices, isDefaultedPositional(cmd, i));
|
|
@@ -5985,6 +6373,71 @@ function forEachSuppliedArgument(cmd, visit) {
|
|
|
5985
6373
|
visit(key, value, choicesByAttribute.get(key), isDefaultedOption(cmd, key));
|
|
5986
6374
|
}
|
|
5987
6375
|
}
|
|
6376
|
+
forEachPassThroughToken(cmd, bound, (name, value) => {
|
|
6377
|
+
visit(name, value, name === undefined ? undefined : choicesByAttribute.get(name), false);
|
|
6378
|
+
});
|
|
6379
|
+
}
|
|
6380
|
+
function boundPositionalCount(cmd) {
|
|
6381
|
+
const registered = cmd.registeredArguments ?? [];
|
|
6382
|
+
if (registered.some((argument) => argument.variadic)) {
|
|
6383
|
+
return registered.length;
|
|
6384
|
+
}
|
|
6385
|
+
if ((cmd.args ?? []).length <= registered.length) {
|
|
6386
|
+
return registered.length;
|
|
6387
|
+
}
|
|
6388
|
+
const firstFlag = tokenizeTail(cmd, (cmd.args ?? []).slice(1)).tokens.find((token) => token.kind !== "operand")?.index ?? -1;
|
|
6389
|
+
return firstFlag === -1 ? registered.length : Math.min(registered.length, firstFlag + 1);
|
|
6390
|
+
}
|
|
6391
|
+
function forEachPassThroughToken(cmd, bound, visit) {
|
|
6392
|
+
const registered = cmd.registeredArguments ?? [];
|
|
6393
|
+
const fillsPositionals = !registered.some((argument) => argument.variadic);
|
|
6394
|
+
const { tokens, firstUnknown } = tokenizeTail(cmd, (cmd.args ?? []).slice(bound));
|
|
6395
|
+
const repeated = new Map;
|
|
6396
|
+
let nextPositional = bound;
|
|
6397
|
+
for (const token of tokens) {
|
|
6398
|
+
const pastUnknown = firstUnknown !== -1 && token.index > firstUnknown;
|
|
6399
|
+
if (token.kind === "sentinel")
|
|
6400
|
+
continue;
|
|
6401
|
+
if (token.kind === "operand") {
|
|
6402
|
+
const claimable = !pastUnknown && fillsPositionals && nextPositional < registered.length;
|
|
6403
|
+
const name = claimable ? registered[nextPositional++].name() : undefined;
|
|
6404
|
+
visit(name || undefined, token.text);
|
|
6405
|
+
continue;
|
|
6406
|
+
}
|
|
6407
|
+
if (token.kind === "unknown") {
|
|
6408
|
+
const bare = token.flag.replace(/^-+/, "");
|
|
6409
|
+
const key = bare.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
|
|
6410
|
+
const keyable = token.flag.startsWith("--") || token.flag.length === 2;
|
|
6411
|
+
if (!pastUnknown && keyable && /^[a-z][a-z0-9-]*$/i.test(bare) && key) {
|
|
6412
|
+
visit(key, token.inlineValue ?? true);
|
|
6413
|
+
} else {
|
|
6414
|
+
visit(undefined, token.text);
|
|
6415
|
+
if (token.inlineValue !== undefined) {
|
|
6416
|
+
visit(undefined, token.inlineValue);
|
|
6417
|
+
} else if (!token.flag.startsWith("--") && token.flag.length > 2) {
|
|
6418
|
+
visit(undefined, token.flag.slice(2));
|
|
6419
|
+
}
|
|
6420
|
+
}
|
|
6421
|
+
continue;
|
|
6422
|
+
}
|
|
6423
|
+
if (pastUnknown) {
|
|
6424
|
+
visit(undefined, token.text);
|
|
6425
|
+
if (token.value !== undefined)
|
|
6426
|
+
visit(undefined, token.value);
|
|
6427
|
+
continue;
|
|
6428
|
+
}
|
|
6429
|
+
const option = token.option;
|
|
6430
|
+
const name = option.attributeName();
|
|
6431
|
+
const value = option.negate ? false : option.required || option.optional ? token.value ?? true : true;
|
|
6432
|
+
const previous = repeated.get(name);
|
|
6433
|
+
if (previous) {
|
|
6434
|
+
previous.push(value);
|
|
6435
|
+
visit(name, previous);
|
|
6436
|
+
} else {
|
|
6437
|
+
repeated.set(name, [value]);
|
|
6438
|
+
visit(name, value);
|
|
6439
|
+
}
|
|
6440
|
+
}
|
|
5988
6441
|
}
|
|
5989
6442
|
function withheldArgumentValues(cmd) {
|
|
5990
6443
|
const values = [];
|
|
@@ -6046,6 +6499,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
6046
6499
|
const telemetryName = commandTelemetryName(commandParts);
|
|
6047
6500
|
const commandPath = commandInvocationPath(commandParts);
|
|
6048
6501
|
const props = typeof properties === "function" ? properties(...args) : properties;
|
|
6502
|
+
const projectResolver = getProjectTelemetryResolver(command);
|
|
6503
|
+
const projectSession = projectResolver && !isProjectTelemetryDisabled() ? new ProjectTelemetrySession(projectResolver, command) : undefined;
|
|
6049
6504
|
markCommandStart();
|
|
6050
6505
|
const supplied = recordSuppliedArgumentValues(withheldArgumentValues(command));
|
|
6051
6506
|
try {
|
|
@@ -6058,6 +6513,12 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
6058
6513
|
if (violation) {
|
|
6059
6514
|
return Promise.reject(violation);
|
|
6060
6515
|
}
|
|
6516
|
+
if (projectSession) {
|
|
6517
|
+
return projectSession.resolve({ command, args, phase: "before" }).then(() => {
|
|
6518
|
+
attachProjectTelemetryCapture(command, projectSession);
|
|
6519
|
+
return fn(...args);
|
|
6520
|
+
});
|
|
6521
|
+
}
|
|
6061
6522
|
return fn(...args);
|
|
6062
6523
|
}));
|
|
6063
6524
|
if (error) {
|
|
@@ -6066,22 +6527,26 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
6066
6527
|
const typed = error;
|
|
6067
6528
|
const customInstructions = typeof typed.instructions === "string" ? typed.instructions : undefined;
|
|
6068
6529
|
const customResult = typeof typed.result === "string" && typed.result !== RESULTS.Success && Object.values(RESULTS).includes(typed.result) ? typed.result : undefined;
|
|
6069
|
-
const
|
|
6530
|
+
const cancellationExitCode = typed.exitCode === 130 || isPromptCancellation(error) ? 130 : undefined;
|
|
6531
|
+
const classified = cancellationExitCode === undefined ? await extractErrorDetails(error) : undefined;
|
|
6532
|
+
const finalResult = customResult ?? classified?.result ?? RESULTS.Failure;
|
|
6070
6533
|
const typedErrorCode = typed.errorCode ?? typed.ErrorCode;
|
|
6071
6534
|
const customErrorCode = isCliErrorCode(typedErrorCode) ? typedErrorCode : undefined;
|
|
6072
6535
|
const typedRetry = typed.retry ?? typed.Retry;
|
|
6073
6536
|
const customRetry = isRetryHint(typedRetry) ? typedRetry : undefined;
|
|
6074
6537
|
const typedContext = typed.context ?? typed.Context;
|
|
6075
6538
|
const customContext = isErrorContext(typedContext) ? typedContext : undefined;
|
|
6076
|
-
const cancellationExitCode = typed.exitCode === 130 || isPromptCancellation(error) ? 130 : undefined;
|
|
6077
6539
|
fallbackExitCode = cancellationExitCode ?? EXIT_CODES[finalResult];
|
|
6540
|
+
const errorCode = customErrorCode ?? classified?.errorCode;
|
|
6541
|
+
const retry = customRetry ?? classified?.retry;
|
|
6542
|
+
const errorContext = customContext ?? classified?.context;
|
|
6078
6543
|
OutputFormatter.error({
|
|
6079
6544
|
Result: finalResult,
|
|
6080
|
-
...
|
|
6545
|
+
...errorCode ? { ErrorCode: errorCode } : {},
|
|
6081
6546
|
Message: errorMessage,
|
|
6082
6547
|
Instructions: customInstructions ?? commandHelpHint(commandPath),
|
|
6083
|
-
...
|
|
6084
|
-
...
|
|
6548
|
+
...retry ? { Retry: retry } : {},
|
|
6549
|
+
...errorContext ? { Context: errorContext } : {}
|
|
6085
6550
|
});
|
|
6086
6551
|
context.exit(fallbackExitCode);
|
|
6087
6552
|
}
|
|
@@ -6090,6 +6555,14 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
6090
6555
|
const exitCode = fallbackExitCode === 130 ? fallbackExitCode : exitCodeFromProcess(fallbackExitCode);
|
|
6091
6556
|
const recordedFailure = takeRecordedCommandFailureTelemetry();
|
|
6092
6557
|
const success = !error && exitCode === 0;
|
|
6558
|
+
if (projectSession) {
|
|
6559
|
+
await projectSession.resolve({
|
|
6560
|
+
command,
|
|
6561
|
+
args,
|
|
6562
|
+
phase: "after",
|
|
6563
|
+
success
|
|
6564
|
+
});
|
|
6565
|
+
}
|
|
6093
6566
|
const terminalTelemetry = buildCommandTerminalTelemetryProperties({
|
|
6094
6567
|
error,
|
|
6095
6568
|
exitCode,
|
|
@@ -6107,6 +6580,7 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
6107
6580
|
}
|
|
6108
6581
|
const baseProperties = redactProperties({
|
|
6109
6582
|
...commandParams,
|
|
6583
|
+
...projectSession?.properties(),
|
|
6110
6584
|
...props,
|
|
6111
6585
|
...buildCommandTelemetryAttribution(commandPath, process.env.UIPATH_SKILL),
|
|
6112
6586
|
...buildAgentSessionTelemetry(process.env),
|
|
@@ -6117,6 +6591,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
6117
6591
|
});
|
|
6118
6592
|
emitInvocationRequest(telemetryName, success, baseProperties);
|
|
6119
6593
|
} finally {
|
|
6594
|
+
if (projectSession)
|
|
6595
|
+
attachProjectTelemetryCapture(command, undefined);
|
|
6120
6596
|
releaseSuppliedArgumentValues(supplied);
|
|
6121
6597
|
}
|
|
6122
6598
|
});
|
|
@@ -6428,14 +6904,14 @@ function parseOffset(raw, _previous) {
|
|
|
6428
6904
|
function parseBoundedInt(raw, optionName, bounds) {
|
|
6429
6905
|
const normalized = raw.trim();
|
|
6430
6906
|
if (normalized === "") {
|
|
6431
|
-
throw new
|
|
6907
|
+
throw new InvalidArgumentError2(`${optionName} requires a value (got empty).`);
|
|
6432
6908
|
}
|
|
6433
6909
|
if (!/^-?\d+$/.test(normalized)) {
|
|
6434
|
-
throw new
|
|
6910
|
+
throw new InvalidArgumentError2(`${optionName} must be an integer, got '${normalized}'.`);
|
|
6435
6911
|
}
|
|
6436
6912
|
const n = parseInt(normalized, 10);
|
|
6437
6913
|
if (n < bounds.min || n > bounds.max) {
|
|
6438
|
-
throw new
|
|
6914
|
+
throw new InvalidArgumentError2(`${optionName} must be between ${bounds.min} and ${bounds.max}, got ${n}.`);
|
|
6439
6915
|
}
|
|
6440
6916
|
return n;
|
|
6441
6917
|
}
|
|
@@ -6573,6 +7049,6 @@ function unsupportedSolutionProjectType(projectType) {
|
|
|
6573
7049
|
var shippedKeysSlot = singleton("ShipSucceededDedupeKeys");
|
|
6574
7050
|
// ../common/src/tool-provider.ts
|
|
6575
7051
|
var factorySlot = singleton("PackagerFactoryProvider");
|
|
6576
|
-
export { getFileSystem, catchError, extractErrorMessage, extractErrorMessageSync,
|
|
7052
|
+
export { getFileSystem, catchError, extractErrorMessage, extractErrorMessageSync, RESULTS, classifiedFailure, Command, Option, logger, Pagination, OutputFormatter, processContext, DEFAULT_PAGE_SIZE, isGuid, createHiddenDeprecatedTenantOption, parseLimit, parseOffset, parseBoundedInt, getSdkUserAgentToken, addSdkUserAgentHeader, installSdkUserAgentHeader, quoteForShell, unsupportedSolutionProjectType };
|
|
6577
7053
|
|
|
6578
|
-
//# debugId=
|
|
7054
|
+
//# debugId=FD054BA0E2F9D09664756E2164756E21
|