@uipath/docsai-tool 1.201.0-preview.133 → 1.202.0-preview.134
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{index-hsadteg4.js → index-h8cph72k.js} +4 -4
- package/dist/{index-9f8q2ege.js → index-p3vk57z7.js} +27 -27
- package/dist/index.js +3 -6
- package/dist/{js-yaml-cggj6w7q.js → js-yaml-87tvr6f6.js} +16 -16
- package/dist/{tool-wckvcay0.js → tool-1yh8g550.js} +9 -7
- package/dist/{tool-3hyzbkk8.js → tool-76x29nq4.js} +1841 -758
- package/dist/tool.js +5 -8
- package/package.json +2 -2
- package/dist/browser-strategy-rkcvc6tn.js +0 -99
- package/dist/node-strategy-nrq2egrd.js +0 -348
- package/dist/tool-4pvh3k50.js +0 -265
- package/dist/tool-5arsyj36.js +0 -11
- package/dist/tool-9qecd4wb.js +0 -14
|
@@ -1,24 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
isBrowser
|
|
3
|
-
} from "./tool-9qecd4wb.js";
|
|
4
|
-
import {
|
|
5
|
-
catchError,
|
|
6
|
-
getFileSystem
|
|
7
|
-
} from "./tool-4pvh3k50.js";
|
|
8
|
-
import {
|
|
9
|
-
AUTH_FILENAME,
|
|
10
|
-
DEFAULT_BASE_URL,
|
|
11
|
-
UIPATH_HOME_DIR
|
|
12
|
-
} from "./tool-5arsyj36.js";
|
|
13
1
|
import {
|
|
14
2
|
__commonJS,
|
|
15
3
|
__export,
|
|
16
4
|
__require,
|
|
17
5
|
__toESM
|
|
18
|
-
} from "./tool-
|
|
6
|
+
} from "./tool-1yh8g550.js";
|
|
19
7
|
|
|
20
8
|
// ../../node_modules/commander/lib/error.js
|
|
21
|
-
var require_error = __commonJS((exports)
|
|
9
|
+
var require_error = __commonJS(function(exports) {
|
|
22
10
|
class CommanderError extends Error {
|
|
23
11
|
constructor(exitCode, code, message) {
|
|
24
12
|
super(message);
|
|
@@ -42,7 +30,7 @@ var require_error = __commonJS((exports) => {
|
|
|
42
30
|
});
|
|
43
31
|
|
|
44
32
|
// ../../node_modules/commander/lib/argument.js
|
|
45
|
-
var require_argument = __commonJS((exports)
|
|
33
|
+
var require_argument = __commonJS(function(exports) {
|
|
46
34
|
var { InvalidArgumentError } = require_error();
|
|
47
35
|
|
|
48
36
|
class Argument {
|
|
@@ -122,7 +110,7 @@ var require_argument = __commonJS((exports) => {
|
|
|
122
110
|
});
|
|
123
111
|
|
|
124
112
|
// ../../node_modules/commander/lib/help.js
|
|
125
|
-
var require_help = __commonJS((exports)
|
|
113
|
+
var require_help = __commonJS(function(exports) {
|
|
126
114
|
var { humanReadableArgName } = require_argument();
|
|
127
115
|
|
|
128
116
|
class Help {
|
|
@@ -479,7 +467,7 @@ ${itemIndentStr}`);
|
|
|
479
467
|
});
|
|
480
468
|
|
|
481
469
|
// ../../node_modules/commander/lib/option.js
|
|
482
|
-
var require_option = __commonJS((exports)
|
|
470
|
+
var require_option = __commonJS(function(exports) {
|
|
483
471
|
var { InvalidArgumentError } = require_error();
|
|
484
472
|
|
|
485
473
|
class Option {
|
|
@@ -663,7 +651,7 @@ var require_option = __commonJS((exports) => {
|
|
|
663
651
|
});
|
|
664
652
|
|
|
665
653
|
// ../../node_modules/commander/lib/suggestSimilar.js
|
|
666
|
-
var require_suggestSimilar = __commonJS((exports)
|
|
654
|
+
var require_suggestSimilar = __commonJS(function(exports) {
|
|
667
655
|
var maxDistance = 3;
|
|
668
656
|
function editDistance(a, b) {
|
|
669
657
|
if (Math.abs(a.length - b.length) > maxDistance)
|
|
@@ -736,11 +724,11 @@ var require_suggestSimilar = __commonJS((exports) => {
|
|
|
736
724
|
});
|
|
737
725
|
|
|
738
726
|
// ../../node_modules/commander/lib/command.js
|
|
739
|
-
var require_command = __commonJS((exports)
|
|
727
|
+
var require_command = __commonJS(function(exports) {
|
|
740
728
|
var EventEmitter = __require("node:events").EventEmitter;
|
|
741
729
|
var childProcess = __require("node:child_process");
|
|
742
|
-
var
|
|
743
|
-
var
|
|
730
|
+
var path2 = __require("node:path");
|
|
731
|
+
var fs2 = __require("node:fs");
|
|
744
732
|
var process2 = __require("node:process");
|
|
745
733
|
var { Argument, humanReadableArgName } = require_argument();
|
|
746
734
|
var { CommanderError } = require_error();
|
|
@@ -1275,7 +1263,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1275
1263
|
this.processedArgs = [];
|
|
1276
1264
|
}
|
|
1277
1265
|
_checkForMissingExecutable(executableFile, executableDir, subcommandName) {
|
|
1278
|
-
if (
|
|
1266
|
+
if (fs2.existsSync(executableFile))
|
|
1279
1267
|
return;
|
|
1280
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";
|
|
1281
1269
|
const executableMissing = `'${executableFile}' does not exist
|
|
@@ -1289,12 +1277,12 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1289
1277
|
let launchWithNode = false;
|
|
1290
1278
|
const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
|
|
1291
1279
|
function findFile(baseDir, baseName) {
|
|
1292
|
-
const localBin =
|
|
1293
|
-
if (
|
|
1280
|
+
const localBin = path2.resolve(baseDir, baseName);
|
|
1281
|
+
if (fs2.existsSync(localBin))
|
|
1294
1282
|
return localBin;
|
|
1295
|
-
if (sourceExt.includes(
|
|
1283
|
+
if (sourceExt.includes(path2.extname(baseName)))
|
|
1296
1284
|
return;
|
|
1297
|
-
const foundExt = sourceExt.find((ext) =>
|
|
1285
|
+
const foundExt = sourceExt.find((ext) => fs2.existsSync(`${localBin}${ext}`));
|
|
1298
1286
|
if (foundExt)
|
|
1299
1287
|
return `${localBin}${foundExt}`;
|
|
1300
1288
|
return;
|
|
@@ -1306,23 +1294,23 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1306
1294
|
if (this._scriptPath) {
|
|
1307
1295
|
let resolvedScriptPath;
|
|
1308
1296
|
try {
|
|
1309
|
-
resolvedScriptPath =
|
|
1297
|
+
resolvedScriptPath = fs2.realpathSync(this._scriptPath);
|
|
1310
1298
|
} catch {
|
|
1311
1299
|
resolvedScriptPath = this._scriptPath;
|
|
1312
1300
|
}
|
|
1313
|
-
executableDir =
|
|
1301
|
+
executableDir = path2.resolve(path2.dirname(resolvedScriptPath), executableDir);
|
|
1314
1302
|
}
|
|
1315
1303
|
if (executableDir) {
|
|
1316
1304
|
let localFile = findFile(executableDir, executableFile);
|
|
1317
1305
|
if (!localFile && !subcommand._executableFile && this._scriptPath) {
|
|
1318
|
-
const legacyName =
|
|
1306
|
+
const legacyName = path2.basename(this._scriptPath, path2.extname(this._scriptPath));
|
|
1319
1307
|
if (legacyName !== this._name) {
|
|
1320
1308
|
localFile = findFile(executableDir, `${legacyName}-${subcommand._name}`);
|
|
1321
1309
|
}
|
|
1322
1310
|
}
|
|
1323
1311
|
executableFile = localFile || executableFile;
|
|
1324
1312
|
}
|
|
1325
|
-
launchWithNode = sourceExt.includes(
|
|
1313
|
+
launchWithNode = sourceExt.includes(path2.extname(executableFile));
|
|
1326
1314
|
let proc;
|
|
1327
1315
|
if (process2.platform !== "win32") {
|
|
1328
1316
|
if (launchWithNode) {
|
|
@@ -1911,13 +1899,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1911
1899
|
cmd.helpGroup(this._defaultCommandGroup);
|
|
1912
1900
|
}
|
|
1913
1901
|
nameFromFilename(filename) {
|
|
1914
|
-
this._name =
|
|
1902
|
+
this._name = path2.basename(filename, path2.extname(filename));
|
|
1915
1903
|
return this;
|
|
1916
1904
|
}
|
|
1917
|
-
executableDir(
|
|
1918
|
-
if (
|
|
1905
|
+
executableDir(path3) {
|
|
1906
|
+
if (path3 === undefined)
|
|
1919
1907
|
return this._executableDir;
|
|
1920
|
-
this._executableDir =
|
|
1908
|
+
this._executableDir = path3;
|
|
1921
1909
|
return this;
|
|
1922
1910
|
}
|
|
1923
1911
|
helpInformation(contextOptions) {
|
|
@@ -2091,7 +2079,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2091
2079
|
});
|
|
2092
2080
|
|
|
2093
2081
|
// ../../node_modules/commander/index.js
|
|
2094
|
-
var require_commander = __commonJS((exports)
|
|
2082
|
+
var require_commander = __commonJS(function(exports) {
|
|
2095
2083
|
var { Argument } = require_argument();
|
|
2096
2084
|
var { Command } = require_command();
|
|
2097
2085
|
var { CommanderError, InvalidArgumentError } = require_error();
|
|
@@ -2111,7 +2099,7 @@ var require_commander = __commonJS((exports) => {
|
|
|
2111
2099
|
});
|
|
2112
2100
|
|
|
2113
2101
|
// ../../node_modules/ajv/dist/compile/codegen/code.js
|
|
2114
|
-
var require_code = __commonJS((exports)
|
|
2102
|
+
var require_code = __commonJS(function(exports) {
|
|
2115
2103
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2116
2104
|
exports.regexpCode = exports.getEsmExportName = exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = undefined;
|
|
2117
2105
|
|
|
@@ -2265,7 +2253,7 @@ var require_code = __commonJS((exports) => {
|
|
|
2265
2253
|
});
|
|
2266
2254
|
|
|
2267
2255
|
// ../../node_modules/ajv/dist/compile/codegen/scope.js
|
|
2268
|
-
var require_scope = __commonJS((exports)
|
|
2256
|
+
var require_scope = __commonJS(function(exports) {
|
|
2269
2257
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2270
2258
|
exports.ValueScope = exports.ValueScopeName = exports.Scope = exports.varKinds = exports.UsedValueState = undefined;
|
|
2271
2259
|
var code_1 = require_code();
|
|
@@ -2411,7 +2399,7 @@ var require_scope = __commonJS((exports) => {
|
|
|
2411
2399
|
});
|
|
2412
2400
|
|
|
2413
2401
|
// ../../node_modules/ajv/dist/compile/codegen/index.js
|
|
2414
|
-
var require_codegen = __commonJS((exports)
|
|
2402
|
+
var require_codegen = __commonJS(function(exports) {
|
|
2415
2403
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2416
2404
|
exports.or = exports.and = exports.not = exports.CodeGen = exports.operators = exports.varKinds = exports.ValueScopeName = exports.ValueScope = exports.Scope = exports.Name = exports.regexpCode = exports.stringify = exports.getProperty = exports.nil = exports.strConcat = exports.str = exports._ = undefined;
|
|
2417
2405
|
var code_1 = require_code();
|
|
@@ -3121,7 +3109,7 @@ var require_codegen = __commonJS((exports) => {
|
|
|
3121
3109
|
});
|
|
3122
3110
|
|
|
3123
3111
|
// ../../node_modules/ajv/dist/compile/util.js
|
|
3124
|
-
var require_util = __commonJS((exports)
|
|
3112
|
+
var require_util = __commonJS(function(exports) {
|
|
3125
3113
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3126
3114
|
exports.checkStrictMode = exports.getErrorPath = exports.Type = exports.useFunc = exports.setEvaluated = exports.evaluatedPropsToName = exports.mergeEvaluated = exports.eachItem = exports.unescapeJsonPointer = exports.escapeJsonPointer = exports.escapeFragment = exports.unescapeFragment = exports.schemaRefOrVal = exports.schemaHasRulesButRef = exports.schemaHasRules = exports.checkUnknownRules = exports.alwaysValidSchema = exports.toHash = undefined;
|
|
3127
3115
|
var codegen_1 = require_codegen();
|
|
@@ -3285,7 +3273,7 @@ var require_util = __commonJS((exports) => {
|
|
|
3285
3273
|
});
|
|
3286
3274
|
|
|
3287
3275
|
// ../../node_modules/ajv/dist/compile/names.js
|
|
3288
|
-
var require_names = __commonJS((exports)
|
|
3276
|
+
var require_names = __commonJS(function(exports) {
|
|
3289
3277
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3290
3278
|
var codegen_1 = require_codegen();
|
|
3291
3279
|
var names = {
|
|
@@ -3310,7 +3298,7 @@ var require_names = __commonJS((exports) => {
|
|
|
3310
3298
|
});
|
|
3311
3299
|
|
|
3312
3300
|
// ../../node_modules/ajv/dist/compile/errors.js
|
|
3313
|
-
var require_errors = __commonJS((exports)
|
|
3301
|
+
var require_errors = __commonJS(function(exports) {
|
|
3314
3302
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3315
3303
|
exports.extendErrors = exports.resetErrorsCount = exports.reportExtraError = exports.reportError = exports.keyword$DataError = exports.keywordError = undefined;
|
|
3316
3304
|
var codegen_1 = require_codegen();
|
|
@@ -3428,7 +3416,7 @@ var require_errors = __commonJS((exports) => {
|
|
|
3428
3416
|
});
|
|
3429
3417
|
|
|
3430
3418
|
// ../../node_modules/ajv/dist/compile/validate/boolSchema.js
|
|
3431
|
-
var require_boolSchema = __commonJS((exports)
|
|
3419
|
+
var require_boolSchema = __commonJS(function(exports) {
|
|
3432
3420
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3433
3421
|
exports.boolOrEmptySchema = exports.topBoolOrEmptySchema = undefined;
|
|
3434
3422
|
var errors_1 = require_errors();
|
|
@@ -3476,7 +3464,7 @@ var require_boolSchema = __commonJS((exports) => {
|
|
|
3476
3464
|
});
|
|
3477
3465
|
|
|
3478
3466
|
// ../../node_modules/ajv/dist/compile/rules.js
|
|
3479
|
-
var require_rules = __commonJS((exports)
|
|
3467
|
+
var require_rules = __commonJS(function(exports) {
|
|
3480
3468
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3481
3469
|
exports.getRules = exports.isJSONType = undefined;
|
|
3482
3470
|
var _jsonTypes = ["string", "number", "integer", "boolean", "null", "object", "array"];
|
|
@@ -3504,7 +3492,7 @@ var require_rules = __commonJS((exports) => {
|
|
|
3504
3492
|
});
|
|
3505
3493
|
|
|
3506
3494
|
// ../../node_modules/ajv/dist/compile/validate/applicability.js
|
|
3507
|
-
var require_applicability = __commonJS((exports)
|
|
3495
|
+
var require_applicability = __commonJS(function(exports) {
|
|
3508
3496
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3509
3497
|
exports.shouldUseRule = exports.shouldUseGroup = exports.schemaHasRulesForType = undefined;
|
|
3510
3498
|
function schemaHasRulesForType({ schema, self }, type) {
|
|
@@ -3524,7 +3512,7 @@ var require_applicability = __commonJS((exports) => {
|
|
|
3524
3512
|
});
|
|
3525
3513
|
|
|
3526
3514
|
// ../../node_modules/ajv/dist/compile/validate/dataType.js
|
|
3527
|
-
var require_dataType = __commonJS((exports)
|
|
3515
|
+
var require_dataType = __commonJS(function(exports) {
|
|
3528
3516
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3529
3517
|
exports.reportTypeError = exports.checkDataTypes = exports.checkDataType = exports.coerceAndCheckDataType = exports.getJSONTypes = exports.getSchemaTypes = exports.DataType = undefined;
|
|
3530
3518
|
var rules_1 = require_rules();
|
|
@@ -3705,7 +3693,7 @@ var require_dataType = __commonJS((exports) => {
|
|
|
3705
3693
|
});
|
|
3706
3694
|
|
|
3707
3695
|
// ../../node_modules/ajv/dist/compile/validate/defaults.js
|
|
3708
|
-
var require_defaults = __commonJS((exports)
|
|
3696
|
+
var require_defaults = __commonJS(function(exports) {
|
|
3709
3697
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3710
3698
|
exports.assignDefaults = undefined;
|
|
3711
3699
|
var codegen_1 = require_codegen();
|
|
@@ -3739,7 +3727,7 @@ var require_defaults = __commonJS((exports) => {
|
|
|
3739
3727
|
});
|
|
3740
3728
|
|
|
3741
3729
|
// ../../node_modules/ajv/dist/vocabularies/code.js
|
|
3742
|
-
var require_code2 = __commonJS((exports)
|
|
3730
|
+
var require_code2 = __commonJS(function(exports) {
|
|
3743
3731
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3744
3732
|
exports.validateUnion = exports.validateArray = exports.usePattern = exports.callValidateCode = exports.schemaProperties = exports.allSchemaProperties = exports.noPropertyInData = exports.propertyInData = exports.isOwnProperty = exports.hasPropFunc = exports.reportMissingProp = exports.checkMissingProp = exports.checkReportMissingProp = undefined;
|
|
3745
3733
|
var codegen_1 = require_codegen();
|
|
@@ -3868,7 +3856,7 @@ var require_code2 = __commonJS((exports) => {
|
|
|
3868
3856
|
});
|
|
3869
3857
|
|
|
3870
3858
|
// ../../node_modules/ajv/dist/compile/validate/keyword.js
|
|
3871
|
-
var require_keyword = __commonJS((exports)
|
|
3859
|
+
var require_keyword = __commonJS(function(exports) {
|
|
3872
3860
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3873
3861
|
exports.validateKeywordUsage = exports.validSchemaType = exports.funcKeywordCode = exports.macroKeywordCode = undefined;
|
|
3874
3862
|
var codegen_1 = require_codegen();
|
|
@@ -3983,7 +3971,7 @@ var require_keyword = __commonJS((exports) => {
|
|
|
3983
3971
|
});
|
|
3984
3972
|
|
|
3985
3973
|
// ../../node_modules/ajv/dist/compile/validate/subschema.js
|
|
3986
|
-
var require_subschema = __commonJS((exports)
|
|
3974
|
+
var require_subschema = __commonJS(function(exports) {
|
|
3987
3975
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3988
3976
|
exports.extendSubschemaMode = exports.extendSubschemaData = exports.getSubschema = undefined;
|
|
3989
3977
|
var codegen_1 = require_codegen();
|
|
@@ -4063,7 +4051,7 @@ var require_subschema = __commonJS((exports) => {
|
|
|
4063
4051
|
});
|
|
4064
4052
|
|
|
4065
4053
|
// ../../node_modules/fast-deep-equal/index.js
|
|
4066
|
-
var require_fast_deep_equal = __commonJS((exports, module)
|
|
4054
|
+
var require_fast_deep_equal = __commonJS(function(exports, module) {
|
|
4067
4055
|
module.exports = function equal(a, b) {
|
|
4068
4056
|
if (a === b)
|
|
4069
4057
|
return true;
|
|
@@ -4105,7 +4093,7 @@ var require_fast_deep_equal = __commonJS((exports, module) => {
|
|
|
4105
4093
|
});
|
|
4106
4094
|
|
|
4107
4095
|
// ../../node_modules/json-schema-traverse/index.js
|
|
4108
|
-
var require_json_schema_traverse = __commonJS((exports, module)
|
|
4096
|
+
var require_json_schema_traverse = __commonJS(function(exports, module) {
|
|
4109
4097
|
var traverse = module.exports = function(schema, opts, cb) {
|
|
4110
4098
|
if (typeof opts == "function") {
|
|
4111
4099
|
cb = opts;
|
|
@@ -4188,7 +4176,7 @@ var require_json_schema_traverse = __commonJS((exports, module) => {
|
|
|
4188
4176
|
});
|
|
4189
4177
|
|
|
4190
4178
|
// ../../node_modules/ajv/dist/compile/resolve.js
|
|
4191
|
-
var require_resolve = __commonJS((exports)
|
|
4179
|
+
var require_resolve = __commonJS(function(exports) {
|
|
4192
4180
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4193
4181
|
exports.getSchemaRefs = exports.resolveUrl = exports.normalizeId = exports._getFullPath = exports.getFullPath = exports.inlineRef = undefined;
|
|
4194
4182
|
var util_1 = require_util();
|
|
@@ -4341,7 +4329,7 @@ var require_resolve = __commonJS((exports) => {
|
|
|
4341
4329
|
});
|
|
4342
4330
|
|
|
4343
4331
|
// ../../node_modules/ajv/dist/compile/validate/index.js
|
|
4344
|
-
var require_validate = __commonJS((exports)
|
|
4332
|
+
var require_validate = __commonJS(function(exports) {
|
|
4345
4333
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4346
4334
|
exports.getData = exports.KeywordCxt = exports.validateFunctionCode = undefined;
|
|
4347
4335
|
var boolSchema_1 = require_boolSchema();
|
|
@@ -4846,7 +4834,7 @@ var require_validate = __commonJS((exports) => {
|
|
|
4846
4834
|
});
|
|
4847
4835
|
|
|
4848
4836
|
// ../../node_modules/ajv/dist/runtime/validation_error.js
|
|
4849
|
-
var require_validation_error = __commonJS((exports)
|
|
4837
|
+
var require_validation_error = __commonJS(function(exports) {
|
|
4850
4838
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4851
4839
|
|
|
4852
4840
|
class ValidationError extends Error {
|
|
@@ -4860,7 +4848,7 @@ var require_validation_error = __commonJS((exports) => {
|
|
|
4860
4848
|
});
|
|
4861
4849
|
|
|
4862
4850
|
// ../../node_modules/ajv/dist/compile/ref_error.js
|
|
4863
|
-
var require_ref_error = __commonJS((exports)
|
|
4851
|
+
var require_ref_error = __commonJS(function(exports) {
|
|
4864
4852
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4865
4853
|
var resolve_1 = require_resolve();
|
|
4866
4854
|
|
|
@@ -4875,7 +4863,7 @@ var require_ref_error = __commonJS((exports) => {
|
|
|
4875
4863
|
});
|
|
4876
4864
|
|
|
4877
4865
|
// ../../node_modules/ajv/dist/compile/index.js
|
|
4878
|
-
var require_compile = __commonJS((exports)
|
|
4866
|
+
var require_compile = __commonJS(function(exports) {
|
|
4879
4867
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4880
4868
|
exports.resolveSchema = exports.getCompilingSchema = exports.resolveRef = exports.compileSchema = exports.SchemaEnv = undefined;
|
|
4881
4869
|
var codegen_1 = require_codegen();
|
|
@@ -4996,7 +4984,7 @@ var require_compile = __commonJS((exports) => {
|
|
|
4996
4984
|
const schOrFunc = root.refs[ref];
|
|
4997
4985
|
if (schOrFunc)
|
|
4998
4986
|
return schOrFunc;
|
|
4999
|
-
let _sch =
|
|
4987
|
+
let _sch = resolve2.call(this, root, ref);
|
|
5000
4988
|
if (_sch === undefined) {
|
|
5001
4989
|
const schema = (_a3 = root.localRefs) === null || _a3 === undefined ? undefined : _a3[ref];
|
|
5002
4990
|
const { schemaId } = this.opts;
|
|
@@ -5023,7 +5011,7 @@ var require_compile = __commonJS((exports) => {
|
|
|
5023
5011
|
function sameSchemaEnv(s1, s2) {
|
|
5024
5012
|
return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
|
|
5025
5013
|
}
|
|
5026
|
-
function
|
|
5014
|
+
function resolve2(root, ref) {
|
|
5027
5015
|
let sch;
|
|
5028
5016
|
while (typeof (sch = this.refs[ref]) == "string")
|
|
5029
5017
|
ref = sch;
|
|
@@ -5096,7 +5084,7 @@ var require_compile = __commonJS((exports) => {
|
|
|
5096
5084
|
});
|
|
5097
5085
|
|
|
5098
5086
|
// ../../node_modules/ajv/dist/refs/data.json
|
|
5099
|
-
var require_data = __commonJS((exports, module)
|
|
5087
|
+
var require_data = __commonJS(function(exports, module) {
|
|
5100
5088
|
module.exports = {
|
|
5101
5089
|
$id: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",
|
|
5102
5090
|
description: "Meta-schema for $data reference (JSON AnySchema extension proposal)",
|
|
@@ -5113,7 +5101,7 @@ var require_data = __commonJS((exports, module) => {
|
|
|
5113
5101
|
});
|
|
5114
5102
|
|
|
5115
5103
|
// ../../node_modules/fast-uri/lib/utils.js
|
|
5116
|
-
var require_utils = __commonJS((exports, module)
|
|
5104
|
+
var require_utils = __commonJS(function(exports, module) {
|
|
5117
5105
|
var isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);
|
|
5118
5106
|
var isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);
|
|
5119
5107
|
var isPort = RegExp.prototype.test.bind(/^\d*$/u);
|
|
@@ -5287,8 +5275,8 @@ var require_utils = __commonJS((exports, module) => {
|
|
|
5287
5275
|
}
|
|
5288
5276
|
return ind;
|
|
5289
5277
|
}
|
|
5290
|
-
function removeDotSegments(
|
|
5291
|
-
let input =
|
|
5278
|
+
function removeDotSegments(path2) {
|
|
5279
|
+
let input = path2;
|
|
5292
5280
|
const output = [];
|
|
5293
5281
|
let nextSlash = -1;
|
|
5294
5282
|
let len = 0;
|
|
@@ -5630,7 +5618,7 @@ var require_utils = __commonJS((exports, module) => {
|
|
|
5630
5618
|
});
|
|
5631
5619
|
|
|
5632
5620
|
// ../../node_modules/fast-uri/lib/schemes.js
|
|
5633
|
-
var require_schemes = __commonJS((exports, module)
|
|
5621
|
+
var require_schemes = __commonJS(function(exports, module) {
|
|
5634
5622
|
var { isUUID } = require_utils();
|
|
5635
5623
|
var URN_REG = /^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu;
|
|
5636
5624
|
var supportedSchemeNames = [
|
|
@@ -5688,8 +5676,8 @@ var require_schemes = __commonJS((exports, module) => {
|
|
|
5688
5676
|
}
|
|
5689
5677
|
if (wsComponent.resourceName) {
|
|
5690
5678
|
const queryIndex = wsComponent.resourceName.indexOf("?");
|
|
5691
|
-
const
|
|
5692
|
-
wsComponent.path =
|
|
5679
|
+
const path2 = queryIndex === -1 ? wsComponent.resourceName : wsComponent.resourceName.slice(0, queryIndex);
|
|
5680
|
+
wsComponent.path = path2 && path2 !== "/" ? path2 : undefined;
|
|
5693
5681
|
wsComponent.query = queryIndex === -1 ? undefined : wsComponent.resourceName.slice(queryIndex + 1);
|
|
5694
5682
|
wsComponent.resourceName = undefined;
|
|
5695
5683
|
}
|
|
@@ -5805,7 +5793,7 @@ var require_schemes = __commonJS((exports, module) => {
|
|
|
5805
5793
|
});
|
|
5806
5794
|
|
|
5807
5795
|
// ../../node_modules/fast-uri/index.js
|
|
5808
|
-
var require_fast_uri = __commonJS((exports, module)
|
|
5796
|
+
var require_fast_uri = __commonJS(function(exports, module) {
|
|
5809
5797
|
var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, serializePathEncoding, normalizeQueryFragmentEncoding, encodeQuery, encodeFragment, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
|
|
5810
5798
|
var { SCHEMES, getSchemeHandler } = require_schemes();
|
|
5811
5799
|
var VALID_SCHEME = /^[A-Za-z][A-Za-z0-9+.-]*$/u;
|
|
@@ -5825,7 +5813,7 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
5825
5813
|
}
|
|
5826
5814
|
return uri;
|
|
5827
5815
|
}
|
|
5828
|
-
function
|
|
5816
|
+
function resolve2(baseURI, relativeURI, options) {
|
|
5829
5817
|
const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
|
|
5830
5818
|
const {
|
|
5831
5819
|
parsed: baseParsed,
|
|
@@ -5858,49 +5846,49 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
5858
5846
|
schemelessOptions.skipEscape = true;
|
|
5859
5847
|
return serialize(resolved, schemelessOptions);
|
|
5860
5848
|
}
|
|
5861
|
-
function resolveComponent(base,
|
|
5849
|
+
function resolveComponent(base, relative2, options, skipNormalization) {
|
|
5862
5850
|
const target = {};
|
|
5863
5851
|
if (!skipNormalization) {
|
|
5864
5852
|
base = parse5(serialize(base, options), options);
|
|
5865
|
-
|
|
5853
|
+
relative2 = parse5(serialize(relative2, options), options);
|
|
5866
5854
|
}
|
|
5867
5855
|
options = options || {};
|
|
5868
|
-
if (!options.tolerant &&
|
|
5869
|
-
target.scheme =
|
|
5870
|
-
target.userinfo =
|
|
5871
|
-
target.host =
|
|
5872
|
-
target.port =
|
|
5873
|
-
target.path = removeDotSegments(
|
|
5874
|
-
target.query =
|
|
5856
|
+
if (!options.tolerant && relative2.scheme) {
|
|
5857
|
+
target.scheme = relative2.scheme;
|
|
5858
|
+
target.userinfo = relative2.userinfo;
|
|
5859
|
+
target.host = relative2.host;
|
|
5860
|
+
target.port = relative2.port;
|
|
5861
|
+
target.path = removeDotSegments(relative2.path || "");
|
|
5862
|
+
target.query = relative2.query;
|
|
5875
5863
|
} else {
|
|
5876
|
-
if (
|
|
5877
|
-
target.userinfo =
|
|
5878
|
-
target.host =
|
|
5879
|
-
target.port =
|
|
5880
|
-
target.path = removeDotSegments(
|
|
5881
|
-
target.query =
|
|
5864
|
+
if (relative2.userinfo !== undefined || relative2.host !== undefined || relative2.port !== undefined) {
|
|
5865
|
+
target.userinfo = relative2.userinfo;
|
|
5866
|
+
target.host = relative2.host;
|
|
5867
|
+
target.port = relative2.port;
|
|
5868
|
+
target.path = removeDotSegments(relative2.path || "");
|
|
5869
|
+
target.query = relative2.query;
|
|
5882
5870
|
} else {
|
|
5883
|
-
if (!
|
|
5871
|
+
if (!relative2.path) {
|
|
5884
5872
|
target.path = base.path;
|
|
5885
|
-
if (
|
|
5886
|
-
target.query =
|
|
5873
|
+
if (relative2.query !== undefined) {
|
|
5874
|
+
target.query = relative2.query;
|
|
5887
5875
|
} else {
|
|
5888
5876
|
target.query = base.query;
|
|
5889
5877
|
}
|
|
5890
5878
|
} else {
|
|
5891
|
-
if (
|
|
5892
|
-
target.path = removeDotSegments(
|
|
5879
|
+
if (relative2.path[0] === "/") {
|
|
5880
|
+
target.path = removeDotSegments(relative2.path);
|
|
5893
5881
|
} else {
|
|
5894
5882
|
if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {
|
|
5895
|
-
target.path = "/" +
|
|
5883
|
+
target.path = "/" + relative2.path;
|
|
5896
5884
|
} else if (!base.path) {
|
|
5897
|
-
target.path =
|
|
5885
|
+
target.path = relative2.path;
|
|
5898
5886
|
} else {
|
|
5899
|
-
target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) +
|
|
5887
|
+
target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative2.path;
|
|
5900
5888
|
}
|
|
5901
5889
|
target.path = removeDotSegments(target.path);
|
|
5902
5890
|
}
|
|
5903
|
-
target.query =
|
|
5891
|
+
target.query = relative2.query;
|
|
5904
5892
|
}
|
|
5905
5893
|
target.userinfo = base.userinfo;
|
|
5906
5894
|
target.host = base.host;
|
|
@@ -5908,7 +5896,7 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
5908
5896
|
}
|
|
5909
5897
|
target.scheme = base.scheme;
|
|
5910
5898
|
}
|
|
5911
|
-
target.fragment =
|
|
5899
|
+
target.fragment = relative2.fragment;
|
|
5912
5900
|
return target;
|
|
5913
5901
|
}
|
|
5914
5902
|
function equal(uriA, uriB, options) {
|
|
@@ -6195,7 +6183,7 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
6195
6183
|
var fastUri = {
|
|
6196
6184
|
SCHEMES,
|
|
6197
6185
|
normalize,
|
|
6198
|
-
resolve,
|
|
6186
|
+
resolve: resolve2,
|
|
6199
6187
|
resolveComponent,
|
|
6200
6188
|
equal,
|
|
6201
6189
|
serialize,
|
|
@@ -6207,7 +6195,7 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
6207
6195
|
});
|
|
6208
6196
|
|
|
6209
6197
|
// ../../node_modules/ajv/dist/runtime/uri.js
|
|
6210
|
-
var require_uri = __commonJS((exports)
|
|
6198
|
+
var require_uri = __commonJS(function(exports) {
|
|
6211
6199
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6212
6200
|
var uri = require_fast_uri();
|
|
6213
6201
|
uri.code = 'require("ajv/dist/runtime/uri").default';
|
|
@@ -6215,7 +6203,7 @@ var require_uri = __commonJS((exports) => {
|
|
|
6215
6203
|
});
|
|
6216
6204
|
|
|
6217
6205
|
// ../../node_modules/ajv/dist/core.js
|
|
6218
|
-
var require_core = __commonJS((exports)
|
|
6206
|
+
var require_core = __commonJS(function(exports) {
|
|
6219
6207
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6220
6208
|
exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = undefined;
|
|
6221
6209
|
var validate_1 = require_validate();
|
|
@@ -6808,7 +6796,7 @@ var require_core = __commonJS((exports) => {
|
|
|
6808
6796
|
});
|
|
6809
6797
|
|
|
6810
6798
|
// ../../node_modules/ajv/dist/vocabularies/core/id.js
|
|
6811
|
-
var require_id = __commonJS((exports)
|
|
6799
|
+
var require_id = __commonJS(function(exports) {
|
|
6812
6800
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6813
6801
|
var def = {
|
|
6814
6802
|
keyword: "id",
|
|
@@ -6820,7 +6808,7 @@ var require_id = __commonJS((exports) => {
|
|
|
6820
6808
|
});
|
|
6821
6809
|
|
|
6822
6810
|
// ../../node_modules/ajv/dist/vocabularies/core/ref.js
|
|
6823
|
-
var require_ref = __commonJS((exports)
|
|
6811
|
+
var require_ref = __commonJS(function(exports) {
|
|
6824
6812
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6825
6813
|
exports.callRef = exports.getValidate = undefined;
|
|
6826
6814
|
var ref_error_1 = require_ref_error();
|
|
@@ -6939,7 +6927,7 @@ var require_ref = __commonJS((exports) => {
|
|
|
6939
6927
|
});
|
|
6940
6928
|
|
|
6941
6929
|
// ../../node_modules/ajv/dist/vocabularies/core/index.js
|
|
6942
|
-
var require_core2 = __commonJS((exports)
|
|
6930
|
+
var require_core2 = __commonJS(function(exports) {
|
|
6943
6931
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6944
6932
|
var id_1 = require_id();
|
|
6945
6933
|
var ref_1 = require_ref();
|
|
@@ -6957,7 +6945,7 @@ var require_core2 = __commonJS((exports) => {
|
|
|
6957
6945
|
});
|
|
6958
6946
|
|
|
6959
6947
|
// ../../node_modules/ajv/dist/vocabularies/validation/limitNumber.js
|
|
6960
|
-
var require_limitNumber = __commonJS((exports)
|
|
6948
|
+
var require_limitNumber = __commonJS(function(exports) {
|
|
6961
6949
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6962
6950
|
var codegen_1 = require_codegen();
|
|
6963
6951
|
var ops = codegen_1.operators;
|
|
@@ -6986,7 +6974,7 @@ var require_limitNumber = __commonJS((exports) => {
|
|
|
6986
6974
|
});
|
|
6987
6975
|
|
|
6988
6976
|
// ../../node_modules/ajv/dist/vocabularies/validation/multipleOf.js
|
|
6989
|
-
var require_multipleOf = __commonJS((exports)
|
|
6977
|
+
var require_multipleOf = __commonJS(function(exports) {
|
|
6990
6978
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6991
6979
|
var codegen_1 = require_codegen();
|
|
6992
6980
|
var error2 = {
|
|
@@ -7011,7 +6999,7 @@ var require_multipleOf = __commonJS((exports) => {
|
|
|
7011
6999
|
});
|
|
7012
7000
|
|
|
7013
7001
|
// ../../node_modules/ajv/dist/runtime/ucs2length.js
|
|
7014
|
-
var require_ucs2length = __commonJS((exports)
|
|
7002
|
+
var require_ucs2length = __commonJS(function(exports) {
|
|
7015
7003
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7016
7004
|
function ucs2length(str) {
|
|
7017
7005
|
const len = str.length;
|
|
@@ -7034,7 +7022,7 @@ var require_ucs2length = __commonJS((exports) => {
|
|
|
7034
7022
|
});
|
|
7035
7023
|
|
|
7036
7024
|
// ../../node_modules/ajv/dist/vocabularies/validation/limitLength.js
|
|
7037
|
-
var require_limitLength = __commonJS((exports)
|
|
7025
|
+
var require_limitLength = __commonJS(function(exports) {
|
|
7038
7026
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7039
7027
|
var codegen_1 = require_codegen();
|
|
7040
7028
|
var util_1 = require_util();
|
|
@@ -7063,7 +7051,7 @@ var require_limitLength = __commonJS((exports) => {
|
|
|
7063
7051
|
});
|
|
7064
7052
|
|
|
7065
7053
|
// ../../node_modules/ajv/dist/vocabularies/validation/pattern.js
|
|
7066
|
-
var require_pattern = __commonJS((exports)
|
|
7054
|
+
var require_pattern = __commonJS(function(exports) {
|
|
7067
7055
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7068
7056
|
var code_1 = require_code2();
|
|
7069
7057
|
var util_1 = require_util();
|
|
@@ -7097,7 +7085,7 @@ var require_pattern = __commonJS((exports) => {
|
|
|
7097
7085
|
});
|
|
7098
7086
|
|
|
7099
7087
|
// ../../node_modules/ajv/dist/vocabularies/validation/limitProperties.js
|
|
7100
|
-
var require_limitProperties = __commonJS((exports)
|
|
7088
|
+
var require_limitProperties = __commonJS(function(exports) {
|
|
7101
7089
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7102
7090
|
var codegen_1 = require_codegen();
|
|
7103
7091
|
var error2 = {
|
|
@@ -7123,7 +7111,7 @@ var require_limitProperties = __commonJS((exports) => {
|
|
|
7123
7111
|
});
|
|
7124
7112
|
|
|
7125
7113
|
// ../../node_modules/ajv/dist/vocabularies/validation/required.js
|
|
7126
|
-
var require_required = __commonJS((exports)
|
|
7114
|
+
var require_required = __commonJS(function(exports) {
|
|
7127
7115
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7128
7116
|
var code_1 = require_code2();
|
|
7129
7117
|
var codegen_1 = require_codegen();
|
|
@@ -7202,7 +7190,7 @@ var require_required = __commonJS((exports) => {
|
|
|
7202
7190
|
});
|
|
7203
7191
|
|
|
7204
7192
|
// ../../node_modules/ajv/dist/vocabularies/validation/limitItems.js
|
|
7205
|
-
var require_limitItems = __commonJS((exports)
|
|
7193
|
+
var require_limitItems = __commonJS(function(exports) {
|
|
7206
7194
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7207
7195
|
var codegen_1 = require_codegen();
|
|
7208
7196
|
var error2 = {
|
|
@@ -7228,7 +7216,7 @@ var require_limitItems = __commonJS((exports) => {
|
|
|
7228
7216
|
});
|
|
7229
7217
|
|
|
7230
7218
|
// ../../node_modules/ajv/dist/runtime/equal.js
|
|
7231
|
-
var require_equal = __commonJS((exports)
|
|
7219
|
+
var require_equal = __commonJS(function(exports) {
|
|
7232
7220
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7233
7221
|
var equal = require_fast_deep_equal();
|
|
7234
7222
|
equal.code = 'require("ajv/dist/runtime/equal").default';
|
|
@@ -7236,7 +7224,7 @@ var require_equal = __commonJS((exports) => {
|
|
|
7236
7224
|
});
|
|
7237
7225
|
|
|
7238
7226
|
// ../../node_modules/ajv/dist/vocabularies/validation/uniqueItems.js
|
|
7239
|
-
var require_uniqueItems = __commonJS((exports)
|
|
7227
|
+
var require_uniqueItems = __commonJS(function(exports) {
|
|
7240
7228
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7241
7229
|
var dataType_1 = require_dataType();
|
|
7242
7230
|
var codegen_1 = require_codegen();
|
|
@@ -7300,7 +7288,7 @@ var require_uniqueItems = __commonJS((exports) => {
|
|
|
7300
7288
|
});
|
|
7301
7289
|
|
|
7302
7290
|
// ../../node_modules/ajv/dist/vocabularies/validation/const.js
|
|
7303
|
-
var require_const = __commonJS((exports)
|
|
7291
|
+
var require_const = __commonJS(function(exports) {
|
|
7304
7292
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7305
7293
|
var codegen_1 = require_codegen();
|
|
7306
7294
|
var util_1 = require_util();
|
|
@@ -7326,7 +7314,7 @@ var require_const = __commonJS((exports) => {
|
|
|
7326
7314
|
});
|
|
7327
7315
|
|
|
7328
7316
|
// ../../node_modules/ajv/dist/vocabularies/validation/enum.js
|
|
7329
|
-
var require_enum = __commonJS((exports)
|
|
7317
|
+
var require_enum = __commonJS(function(exports) {
|
|
7330
7318
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7331
7319
|
var codegen_1 = require_codegen();
|
|
7332
7320
|
var util_1 = require_util();
|
|
@@ -7372,7 +7360,7 @@ var require_enum = __commonJS((exports) => {
|
|
|
7372
7360
|
});
|
|
7373
7361
|
|
|
7374
7362
|
// ../../node_modules/ajv/dist/vocabularies/validation/index.js
|
|
7375
|
-
var require_validation = __commonJS((exports)
|
|
7363
|
+
var require_validation = __commonJS(function(exports) {
|
|
7376
7364
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7377
7365
|
var limitNumber_1 = require_limitNumber();
|
|
7378
7366
|
var multipleOf_1 = require_multipleOf();
|
|
@@ -7402,7 +7390,7 @@ var require_validation = __commonJS((exports) => {
|
|
|
7402
7390
|
});
|
|
7403
7391
|
|
|
7404
7392
|
// ../../node_modules/ajv/dist/vocabularies/applicator/additionalItems.js
|
|
7405
|
-
var require_additionalItems = __commonJS((exports)
|
|
7393
|
+
var require_additionalItems = __commonJS(function(exports) {
|
|
7406
7394
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7407
7395
|
exports.validateAdditionalItems = undefined;
|
|
7408
7396
|
var codegen_1 = require_codegen();
|
|
@@ -7452,7 +7440,7 @@ var require_additionalItems = __commonJS((exports) => {
|
|
|
7452
7440
|
});
|
|
7453
7441
|
|
|
7454
7442
|
// ../../node_modules/ajv/dist/vocabularies/applicator/items.js
|
|
7455
|
-
var require_items = __commonJS((exports)
|
|
7443
|
+
var require_items = __commonJS(function(exports) {
|
|
7456
7444
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7457
7445
|
exports.validateTuple = undefined;
|
|
7458
7446
|
var codegen_1 = require_codegen();
|
|
@@ -7506,7 +7494,7 @@ var require_items = __commonJS((exports) => {
|
|
|
7506
7494
|
});
|
|
7507
7495
|
|
|
7508
7496
|
// ../../node_modules/ajv/dist/vocabularies/applicator/prefixItems.js
|
|
7509
|
-
var require_prefixItems = __commonJS((exports)
|
|
7497
|
+
var require_prefixItems = __commonJS(function(exports) {
|
|
7510
7498
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7511
7499
|
var items_1 = require_items();
|
|
7512
7500
|
var def = {
|
|
@@ -7520,7 +7508,7 @@ var require_prefixItems = __commonJS((exports) => {
|
|
|
7520
7508
|
});
|
|
7521
7509
|
|
|
7522
7510
|
// ../../node_modules/ajv/dist/vocabularies/applicator/items2020.js
|
|
7523
|
-
var require_items2020 = __commonJS((exports)
|
|
7511
|
+
var require_items2020 = __commonJS(function(exports) {
|
|
7524
7512
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7525
7513
|
var codegen_1 = require_codegen();
|
|
7526
7514
|
var util_1 = require_util();
|
|
@@ -7552,7 +7540,7 @@ var require_items2020 = __commonJS((exports) => {
|
|
|
7552
7540
|
});
|
|
7553
7541
|
|
|
7554
7542
|
// ../../node_modules/ajv/dist/vocabularies/applicator/contains.js
|
|
7555
|
-
var require_contains = __commonJS((exports)
|
|
7543
|
+
var require_contains = __commonJS(function(exports) {
|
|
7556
7544
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7557
7545
|
var codegen_1 = require_codegen();
|
|
7558
7546
|
var util_1 = require_util();
|
|
@@ -7643,7 +7631,7 @@ var require_contains = __commonJS((exports) => {
|
|
|
7643
7631
|
});
|
|
7644
7632
|
|
|
7645
7633
|
// ../../node_modules/ajv/dist/vocabularies/applicator/dependencies.js
|
|
7646
|
-
var require_dependencies = __commonJS((exports)
|
|
7634
|
+
var require_dependencies = __commonJS(function(exports) {
|
|
7647
7635
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7648
7636
|
exports.validateSchemaDeps = exports.validatePropertyDeps = exports.error = undefined;
|
|
7649
7637
|
var codegen_1 = require_codegen();
|
|
@@ -7728,7 +7716,7 @@ var require_dependencies = __commonJS((exports) => {
|
|
|
7728
7716
|
});
|
|
7729
7717
|
|
|
7730
7718
|
// ../../node_modules/ajv/dist/vocabularies/applicator/propertyNames.js
|
|
7731
|
-
var require_propertyNames = __commonJS((exports)
|
|
7719
|
+
var require_propertyNames = __commonJS(function(exports) {
|
|
7732
7720
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7733
7721
|
var codegen_1 = require_codegen();
|
|
7734
7722
|
var util_1 = require_util();
|
|
@@ -7768,7 +7756,7 @@ var require_propertyNames = __commonJS((exports) => {
|
|
|
7768
7756
|
});
|
|
7769
7757
|
|
|
7770
7758
|
// ../../node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js
|
|
7771
|
-
var require_additionalProperties = __commonJS((exports)
|
|
7759
|
+
var require_additionalProperties = __commonJS(function(exports) {
|
|
7772
7760
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7773
7761
|
var code_1 = require_code2();
|
|
7774
7762
|
var codegen_1 = require_codegen();
|
|
@@ -7871,7 +7859,7 @@ var require_additionalProperties = __commonJS((exports) => {
|
|
|
7871
7859
|
});
|
|
7872
7860
|
|
|
7873
7861
|
// ../../node_modules/ajv/dist/vocabularies/applicator/properties.js
|
|
7874
|
-
var require_properties = __commonJS((exports)
|
|
7862
|
+
var require_properties = __commonJS(function(exports) {
|
|
7875
7863
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7876
7864
|
var validate_1 = require_validate();
|
|
7877
7865
|
var code_1 = require_code2();
|
|
@@ -7926,7 +7914,7 @@ var require_properties = __commonJS((exports) => {
|
|
|
7926
7914
|
});
|
|
7927
7915
|
|
|
7928
7916
|
// ../../node_modules/ajv/dist/vocabularies/applicator/patternProperties.js
|
|
7929
|
-
var require_patternProperties = __commonJS((exports)
|
|
7917
|
+
var require_patternProperties = __commonJS(function(exports) {
|
|
7930
7918
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7931
7919
|
var code_1 = require_code2();
|
|
7932
7920
|
var codegen_1 = require_codegen();
|
|
@@ -7997,7 +7985,7 @@ var require_patternProperties = __commonJS((exports) => {
|
|
|
7997
7985
|
});
|
|
7998
7986
|
|
|
7999
7987
|
// ../../node_modules/ajv/dist/vocabularies/applicator/not.js
|
|
8000
|
-
var require_not = __commonJS((exports)
|
|
7988
|
+
var require_not = __commonJS(function(exports) {
|
|
8001
7989
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8002
7990
|
var util_1 = require_util();
|
|
8003
7991
|
var def = {
|
|
@@ -8025,7 +8013,7 @@ var require_not = __commonJS((exports) => {
|
|
|
8025
8013
|
});
|
|
8026
8014
|
|
|
8027
8015
|
// ../../node_modules/ajv/dist/vocabularies/applicator/anyOf.js
|
|
8028
|
-
var require_anyOf = __commonJS((exports)
|
|
8016
|
+
var require_anyOf = __commonJS(function(exports) {
|
|
8029
8017
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8030
8018
|
var code_1 = require_code2();
|
|
8031
8019
|
var def = {
|
|
@@ -8039,7 +8027,7 @@ var require_anyOf = __commonJS((exports) => {
|
|
|
8039
8027
|
});
|
|
8040
8028
|
|
|
8041
8029
|
// ../../node_modules/ajv/dist/vocabularies/applicator/oneOf.js
|
|
8042
|
-
var require_oneOf = __commonJS((exports)
|
|
8030
|
+
var require_oneOf = __commonJS(function(exports) {
|
|
8043
8031
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8044
8032
|
var codegen_1 = require_codegen();
|
|
8045
8033
|
var util_1 = require_util();
|
|
@@ -8094,7 +8082,7 @@ var require_oneOf = __commonJS((exports) => {
|
|
|
8094
8082
|
});
|
|
8095
8083
|
|
|
8096
8084
|
// ../../node_modules/ajv/dist/vocabularies/applicator/allOf.js
|
|
8097
|
-
var require_allOf = __commonJS((exports)
|
|
8085
|
+
var require_allOf = __commonJS(function(exports) {
|
|
8098
8086
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8099
8087
|
var util_1 = require_util();
|
|
8100
8088
|
var def = {
|
|
@@ -8118,7 +8106,7 @@ var require_allOf = __commonJS((exports) => {
|
|
|
8118
8106
|
});
|
|
8119
8107
|
|
|
8120
8108
|
// ../../node_modules/ajv/dist/vocabularies/applicator/if.js
|
|
8121
|
-
var require_if = __commonJS((exports)
|
|
8109
|
+
var require_if = __commonJS(function(exports) {
|
|
8122
8110
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8123
8111
|
var codegen_1 = require_codegen();
|
|
8124
8112
|
var util_1 = require_util();
|
|
@@ -8184,7 +8172,7 @@ var require_if = __commonJS((exports) => {
|
|
|
8184
8172
|
});
|
|
8185
8173
|
|
|
8186
8174
|
// ../../node_modules/ajv/dist/vocabularies/applicator/thenElse.js
|
|
8187
|
-
var require_thenElse = __commonJS((exports)
|
|
8175
|
+
var require_thenElse = __commonJS(function(exports) {
|
|
8188
8176
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8189
8177
|
var util_1 = require_util();
|
|
8190
8178
|
var def = {
|
|
@@ -8199,7 +8187,7 @@ var require_thenElse = __commonJS((exports) => {
|
|
|
8199
8187
|
});
|
|
8200
8188
|
|
|
8201
8189
|
// ../../node_modules/ajv/dist/vocabularies/applicator/index.js
|
|
8202
|
-
var require_applicator = __commonJS((exports)
|
|
8190
|
+
var require_applicator = __commonJS(function(exports) {
|
|
8203
8191
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8204
8192
|
var additionalItems_1 = require_additionalItems();
|
|
8205
8193
|
var prefixItems_1 = require_prefixItems();
|
|
@@ -8242,7 +8230,7 @@ var require_applicator = __commonJS((exports) => {
|
|
|
8242
8230
|
});
|
|
8243
8231
|
|
|
8244
8232
|
// ../../node_modules/ajv/dist/vocabularies/format/format.js
|
|
8245
|
-
var require_format = __commonJS((exports)
|
|
8233
|
+
var require_format = __commonJS(function(exports) {
|
|
8246
8234
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8247
8235
|
var codegen_1 = require_codegen();
|
|
8248
8236
|
var error2 = {
|
|
@@ -8329,7 +8317,7 @@ var require_format = __commonJS((exports) => {
|
|
|
8329
8317
|
});
|
|
8330
8318
|
|
|
8331
8319
|
// ../../node_modules/ajv/dist/vocabularies/format/index.js
|
|
8332
|
-
var require_format2 = __commonJS((exports)
|
|
8320
|
+
var require_format2 = __commonJS(function(exports) {
|
|
8333
8321
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8334
8322
|
var format_1 = require_format();
|
|
8335
8323
|
var format = [format_1.default];
|
|
@@ -8337,7 +8325,7 @@ var require_format2 = __commonJS((exports) => {
|
|
|
8337
8325
|
});
|
|
8338
8326
|
|
|
8339
8327
|
// ../../node_modules/ajv/dist/vocabularies/metadata.js
|
|
8340
|
-
var require_metadata = __commonJS((exports)
|
|
8328
|
+
var require_metadata = __commonJS(function(exports) {
|
|
8341
8329
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8342
8330
|
exports.contentVocabulary = exports.metadataVocabulary = undefined;
|
|
8343
8331
|
exports.metadataVocabulary = [
|
|
@@ -8357,7 +8345,7 @@ var require_metadata = __commonJS((exports) => {
|
|
|
8357
8345
|
});
|
|
8358
8346
|
|
|
8359
8347
|
// ../../node_modules/ajv/dist/vocabularies/draft7.js
|
|
8360
|
-
var require_draft7 = __commonJS((exports)
|
|
8348
|
+
var require_draft7 = __commonJS(function(exports) {
|
|
8361
8349
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8362
8350
|
var core_1 = require_core2();
|
|
8363
8351
|
var validation_1 = require_validation();
|
|
@@ -8376,7 +8364,7 @@ var require_draft7 = __commonJS((exports) => {
|
|
|
8376
8364
|
});
|
|
8377
8365
|
|
|
8378
8366
|
// ../../node_modules/ajv/dist/vocabularies/discriminator/types.js
|
|
8379
|
-
var require_types = __commonJS((exports)
|
|
8367
|
+
var require_types = __commonJS(function(exports) {
|
|
8380
8368
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8381
8369
|
exports.DiscrError = undefined;
|
|
8382
8370
|
var DiscrError;
|
|
@@ -8387,7 +8375,7 @@ var require_types = __commonJS((exports) => {
|
|
|
8387
8375
|
});
|
|
8388
8376
|
|
|
8389
8377
|
// ../../node_modules/ajv/dist/vocabularies/discriminator/index.js
|
|
8390
|
-
var require_discriminator = __commonJS((exports)
|
|
8378
|
+
var require_discriminator = __commonJS(function(exports) {
|
|
8391
8379
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8392
8380
|
var codegen_1 = require_codegen();
|
|
8393
8381
|
var types_1 = require_types();
|
|
@@ -8489,7 +8477,7 @@ var require_discriminator = __commonJS((exports) => {
|
|
|
8489
8477
|
});
|
|
8490
8478
|
|
|
8491
8479
|
// ../../node_modules/ajv/dist/refs/json-schema-draft-07.json
|
|
8492
|
-
var require_json_schema_draft_07 = __commonJS((exports, module)
|
|
8480
|
+
var require_json_schema_draft_07 = __commonJS(function(exports, module) {
|
|
8493
8481
|
module.exports = {
|
|
8494
8482
|
$schema: "http://json-schema.org/draft-07/schema#",
|
|
8495
8483
|
$id: "http://json-schema.org/draft-07/schema#",
|
|
@@ -8644,7 +8632,7 @@ var require_json_schema_draft_07 = __commonJS((exports, module) => {
|
|
|
8644
8632
|
});
|
|
8645
8633
|
|
|
8646
8634
|
// ../../node_modules/ajv/dist/ajv.js
|
|
8647
|
-
var require_ajv = __commonJS((exports, module)
|
|
8635
|
+
var require_ajv = __commonJS(function(exports, module) {
|
|
8648
8636
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8649
8637
|
exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv = undefined;
|
|
8650
8638
|
var core_1 = require_core();
|
|
@@ -8712,7 +8700,7 @@ var require_ajv = __commonJS((exports, module) => {
|
|
|
8712
8700
|
});
|
|
8713
8701
|
|
|
8714
8702
|
// ../../node_modules/ajv-formats/dist/formats.js
|
|
8715
|
-
var require_formats = __commonJS((exports)
|
|
8703
|
+
var require_formats = __commonJS(function(exports) {
|
|
8716
8704
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8717
8705
|
exports.formatNames = exports.fastFormats = exports.fullFormats = undefined;
|
|
8718
8706
|
function fmtDef(validate, compare) {
|
|
@@ -8889,7 +8877,7 @@ var require_formats = __commonJS((exports) => {
|
|
|
8889
8877
|
});
|
|
8890
8878
|
|
|
8891
8879
|
// ../../node_modules/ajv-formats/dist/limit.js
|
|
8892
|
-
var require_limit = __commonJS((exports)
|
|
8880
|
+
var require_limit = __commonJS(function(exports) {
|
|
8893
8881
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8894
8882
|
exports.formatLimitDefinition = undefined;
|
|
8895
8883
|
var ajv_1 = require_ajv();
|
|
@@ -8958,7 +8946,7 @@ var require_limit = __commonJS((exports) => {
|
|
|
8958
8946
|
});
|
|
8959
8947
|
|
|
8960
8948
|
// ../../node_modules/ajv-formats/dist/index.js
|
|
8961
|
-
var require_dist = __commonJS((exports, module)
|
|
8949
|
+
var require_dist = __commonJS(function(exports, module) {
|
|
8962
8950
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8963
8951
|
var formats_1 = require_formats();
|
|
8964
8952
|
var limit_1 = require_limit();
|
|
@@ -8984,12 +8972,12 @@ var require_dist = __commonJS((exports, module) => {
|
|
|
8984
8972
|
throw new Error(`Unknown format "${name}"`);
|
|
8985
8973
|
return f;
|
|
8986
8974
|
};
|
|
8987
|
-
function addFormats(ajv, list,
|
|
8975
|
+
function addFormats(ajv, list, fs2, exportName) {
|
|
8988
8976
|
var _a3;
|
|
8989
8977
|
var _b;
|
|
8990
8978
|
(_a3 = (_b = ajv.opts.code).formats) !== null && _a3 !== undefined || (_b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`);
|
|
8991
8979
|
for (const f of list)
|
|
8992
|
-
ajv.addFormat(f,
|
|
8980
|
+
ajv.addFormat(f, fs2[f]);
|
|
8993
8981
|
}
|
|
8994
8982
|
module.exports = exports = formatsPlugin;
|
|
8995
8983
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -8999,7 +8987,7 @@ var require_dist = __commonJS((exports, module) => {
|
|
|
8999
8987
|
var package_default = {
|
|
9000
8988
|
name: "@uipath/docsai-tool",
|
|
9001
8989
|
license: "MIT",
|
|
9002
|
-
version: "1.
|
|
8990
|
+
version: "1.202.0-preview.134",
|
|
9003
8991
|
description: "Search UiPath documentation with AI-powered answers.",
|
|
9004
8992
|
private: false,
|
|
9005
8993
|
repository: {
|
|
@@ -9042,96 +9030,402 @@ var package_default = {
|
|
|
9042
9030
|
}
|
|
9043
9031
|
};
|
|
9044
9032
|
|
|
9045
|
-
// ../
|
|
9046
|
-
|
|
9047
|
-
|
|
9048
|
-
|
|
9049
|
-
|
|
9050
|
-
|
|
9051
|
-
|
|
9033
|
+
// ../filesystem/src/node.ts
|
|
9034
|
+
import { randomUUID } from "node:crypto";
|
|
9035
|
+
import { existsSync } from "node:fs";
|
|
9036
|
+
import * as fs from "node:fs/promises";
|
|
9037
|
+
import * as os from "node:os";
|
|
9038
|
+
import * as path from "node:path";
|
|
9039
|
+
var LOCK_HEARTBEAT_MS = 5000;
|
|
9040
|
+
var LOCK_STALE_MS = 15000;
|
|
9041
|
+
var LOCK_MAX_WAIT_MS = 20000;
|
|
9042
|
+
var LOCK_MAX_HOLD_MS = 60000;
|
|
9043
|
+
var LOCK_RETRY_MIN_MS = 100;
|
|
9044
|
+
var LOCK_RETRY_JITTER_MS = 200;
|
|
9045
|
+
|
|
9046
|
+
class NodeFileSystem {
|
|
9047
|
+
path = {
|
|
9048
|
+
join: path.join,
|
|
9049
|
+
resolve: path.resolve,
|
|
9050
|
+
relative: path.relative,
|
|
9051
|
+
dirname: path.dirname,
|
|
9052
|
+
isAbsolute: path.isAbsolute,
|
|
9053
|
+
basename: path.basename
|
|
9054
|
+
};
|
|
9055
|
+
env = {
|
|
9056
|
+
cwd: process.cwd,
|
|
9057
|
+
homedir: os.homedir,
|
|
9058
|
+
tmpdir: os.tmpdir,
|
|
9059
|
+
getenv: (key) => process.env[key]
|
|
9060
|
+
};
|
|
9061
|
+
utils = {
|
|
9062
|
+
open: async (url) => {
|
|
9063
|
+
const { default: open } = await import("./index-h8cph72k.js");
|
|
9064
|
+
await open(url);
|
|
9065
|
+
}
|
|
9066
|
+
};
|
|
9067
|
+
async readFile(path2, options) {
|
|
9068
|
+
try {
|
|
9069
|
+
if (options) {
|
|
9070
|
+
return await fs.readFile(path2, "utf-8");
|
|
9071
|
+
}
|
|
9072
|
+
return await fs.readFile(path2);
|
|
9073
|
+
} catch (error) {
|
|
9074
|
+
if (this.isEnoent(error))
|
|
9075
|
+
return null;
|
|
9076
|
+
throw error;
|
|
9077
|
+
}
|
|
9052
9078
|
}
|
|
9053
|
-
|
|
9054
|
-
const
|
|
9055
|
-
if (
|
|
9056
|
-
|
|
9079
|
+
async writeFile(filePath, data) {
|
|
9080
|
+
const dir = path.dirname(filePath);
|
|
9081
|
+
if (dir) {
|
|
9082
|
+
await fs.mkdir(dir, { recursive: true });
|
|
9057
9083
|
}
|
|
9058
|
-
|
|
9059
|
-
}
|
|
9060
|
-
|
|
9061
|
-
|
|
9062
|
-
|
|
9063
|
-
|
|
9084
|
+
await fs.writeFile(filePath, data);
|
|
9085
|
+
}
|
|
9086
|
+
async appendFile(filePath, data) {
|
|
9087
|
+
const dir = path.dirname(filePath);
|
|
9088
|
+
if (dir) {
|
|
9089
|
+
await fs.mkdir(dir, { recursive: true });
|
|
9090
|
+
}
|
|
9091
|
+
await fs.appendFile(filePath, data);
|
|
9092
|
+
}
|
|
9093
|
+
async readdir(dirPath) {
|
|
9094
|
+
try {
|
|
9095
|
+
return await fs.readdir(dirPath);
|
|
9096
|
+
} catch (error) {
|
|
9097
|
+
if (this.isEnoent(error))
|
|
9098
|
+
return [];
|
|
9099
|
+
throw error;
|
|
9100
|
+
}
|
|
9101
|
+
}
|
|
9102
|
+
async stat(filePath) {
|
|
9103
|
+
try {
|
|
9104
|
+
const stats = await fs.stat(filePath);
|
|
9105
|
+
return {
|
|
9106
|
+
isFile: () => stats.isFile(),
|
|
9107
|
+
isDirectory: () => stats.isDirectory(),
|
|
9108
|
+
size: stats.size,
|
|
9109
|
+
mtimeMs: stats.mtimeMs
|
|
9110
|
+
};
|
|
9111
|
+
} catch (error) {
|
|
9112
|
+
if (this.isEnoent(error))
|
|
9113
|
+
return null;
|
|
9114
|
+
throw error;
|
|
9115
|
+
}
|
|
9116
|
+
}
|
|
9117
|
+
async exists(filePath) {
|
|
9118
|
+
return existsSync(filePath);
|
|
9119
|
+
}
|
|
9120
|
+
async mkdir(dirPath) {
|
|
9121
|
+
await fs.mkdir(dirPath, { recursive: true });
|
|
9122
|
+
}
|
|
9123
|
+
async acquireLock(lockPath) {
|
|
9124
|
+
const canonicalPath = await this.canonicalizeLockTarget(lockPath);
|
|
9125
|
+
const lockFile = `${canonicalPath}.lock`;
|
|
9126
|
+
const ownerId = randomUUID();
|
|
9127
|
+
const start = Date.now();
|
|
9128
|
+
while (true) {
|
|
9129
|
+
try {
|
|
9130
|
+
await fs.writeFile(lockFile, ownerId, { flag: "wx" });
|
|
9131
|
+
return this.createLockRelease(lockFile, ownerId);
|
|
9132
|
+
} catch (error) {
|
|
9133
|
+
if (!this.hasErrnoCode(error, "EEXIST")) {
|
|
9134
|
+
throw error;
|
|
9135
|
+
}
|
|
9136
|
+
const stats = await fs.stat(lockFile).catch(() => null);
|
|
9137
|
+
if (stats && Date.now() - stats.mtimeMs > LOCK_STALE_MS) {
|
|
9138
|
+
const reclaimed = await fs.rm(lockFile, { force: true }).then(() => true).catch(() => false);
|
|
9139
|
+
if (reclaimed)
|
|
9140
|
+
continue;
|
|
9141
|
+
}
|
|
9142
|
+
if (Date.now() - start > LOCK_MAX_WAIT_MS) {
|
|
9143
|
+
throw new Error(`ELOCKED: timed out waiting for lock on ${canonicalPath}`);
|
|
9144
|
+
}
|
|
9145
|
+
await new Promise((resolve2) => setTimeout(resolve2, LOCK_RETRY_MIN_MS + Math.random() * LOCK_RETRY_JITTER_MS));
|
|
9146
|
+
}
|
|
9147
|
+
}
|
|
9148
|
+
}
|
|
9149
|
+
async canonicalizeLockTarget(lockPath) {
|
|
9150
|
+
const absolute = path.resolve(lockPath);
|
|
9151
|
+
const fullReal = await fs.realpath(absolute).catch(() => null);
|
|
9152
|
+
if (fullReal)
|
|
9153
|
+
return fullReal;
|
|
9154
|
+
const parent = path.dirname(absolute);
|
|
9155
|
+
const base = path.basename(absolute);
|
|
9156
|
+
const canonicalParent = await fs.realpath(parent).catch(() => parent);
|
|
9157
|
+
return path.join(canonicalParent, base);
|
|
9158
|
+
}
|
|
9159
|
+
createLockRelease(lockFile, ownerId) {
|
|
9160
|
+
const heartbeatStart = Date.now();
|
|
9161
|
+
let heartbeatTimer;
|
|
9162
|
+
let stopped = false;
|
|
9163
|
+
const stopHeartbeat = () => {
|
|
9164
|
+
stopped = true;
|
|
9165
|
+
if (heartbeatTimer)
|
|
9166
|
+
clearTimeout(heartbeatTimer);
|
|
9167
|
+
};
|
|
9168
|
+
const scheduleNextHeartbeat = () => {
|
|
9169
|
+
if (stopped)
|
|
9170
|
+
return;
|
|
9171
|
+
if (Date.now() - heartbeatStart >= LOCK_MAX_HOLD_MS) {
|
|
9172
|
+
stopped = true;
|
|
9173
|
+
return;
|
|
9174
|
+
}
|
|
9175
|
+
heartbeatTimer = setTimeout(() => {
|
|
9176
|
+
runHeartbeat();
|
|
9177
|
+
}, LOCK_HEARTBEAT_MS);
|
|
9178
|
+
heartbeatTimer.unref?.();
|
|
9179
|
+
};
|
|
9180
|
+
const runHeartbeat = async () => {
|
|
9181
|
+
if (stopped)
|
|
9182
|
+
return;
|
|
9183
|
+
const current = await fs.readFile(lockFile, "utf-8").catch(() => null);
|
|
9184
|
+
if (stopped)
|
|
9185
|
+
return;
|
|
9186
|
+
if (current !== ownerId) {
|
|
9187
|
+
stopped = true;
|
|
9188
|
+
return;
|
|
9189
|
+
}
|
|
9190
|
+
const now = Date.now() / 1000;
|
|
9191
|
+
await fs.utimes(lockFile, now, now).catch(() => {});
|
|
9192
|
+
scheduleNextHeartbeat();
|
|
9193
|
+
};
|
|
9194
|
+
scheduleNextHeartbeat();
|
|
9195
|
+
let released = false;
|
|
9196
|
+
return async () => {
|
|
9197
|
+
if (released)
|
|
9198
|
+
return;
|
|
9199
|
+
released = true;
|
|
9200
|
+
stopHeartbeat();
|
|
9201
|
+
const current = await fs.readFile(lockFile, "utf-8").catch(() => null);
|
|
9202
|
+
if (current === ownerId) {
|
|
9203
|
+
await fs.rm(lockFile, { force: true });
|
|
9204
|
+
}
|
|
9205
|
+
};
|
|
9206
|
+
}
|
|
9207
|
+
async rm(filePath) {
|
|
9208
|
+
await fs.rm(filePath, { recursive: true, force: true });
|
|
9209
|
+
}
|
|
9210
|
+
async rename(oldPath, newPath) {
|
|
9211
|
+
await fs.rename(oldPath, newPath);
|
|
9212
|
+
}
|
|
9213
|
+
async realpath(filePath) {
|
|
9214
|
+
try {
|
|
9215
|
+
return await fs.realpath(filePath);
|
|
9216
|
+
} catch (error) {
|
|
9217
|
+
if (this.isEnoent(error))
|
|
9218
|
+
return filePath;
|
|
9219
|
+
throw error;
|
|
9220
|
+
}
|
|
9221
|
+
}
|
|
9222
|
+
async getTempDir() {
|
|
9223
|
+
return await fs.mkdtemp(path.join(os.tmpdir(), "uipath-fs-"));
|
|
9224
|
+
}
|
|
9225
|
+
async copyDirectory(sourcePath, destPath) {
|
|
9226
|
+
const sourceStats = await this.stat(sourcePath);
|
|
9227
|
+
if (!sourceStats) {
|
|
9228
|
+
throw new Error(`Source directory does not exist: ${sourcePath}`);
|
|
9229
|
+
}
|
|
9230
|
+
if (!sourceStats.isDirectory()) {
|
|
9231
|
+
throw new Error(`Source path is not a directory: ${sourcePath}`);
|
|
9232
|
+
}
|
|
9233
|
+
await this.mkdir(destPath);
|
|
9234
|
+
const entries = await this.readdir(sourcePath);
|
|
9235
|
+
for (const entry of entries) {
|
|
9236
|
+
const srcEntry = path.join(sourcePath, entry);
|
|
9237
|
+
const destEntry = path.join(destPath, entry);
|
|
9238
|
+
const entryStats = await this.stat(srcEntry);
|
|
9239
|
+
if (!entryStats)
|
|
9240
|
+
continue;
|
|
9241
|
+
if (entryStats.isDirectory()) {
|
|
9242
|
+
await this.copyDirectory(srcEntry, destEntry);
|
|
9243
|
+
} else if (entryStats.isFile()) {
|
|
9244
|
+
const content = await this.readFile(srcEntry);
|
|
9245
|
+
if (content !== null) {
|
|
9246
|
+
await this.writeFile(destEntry, content);
|
|
9247
|
+
}
|
|
9248
|
+
}
|
|
9249
|
+
}
|
|
9250
|
+
}
|
|
9251
|
+
isEnoent(error) {
|
|
9252
|
+
return this.hasErrnoCode(error, "ENOENT");
|
|
9253
|
+
}
|
|
9254
|
+
hasErrnoCode(error, code) {
|
|
9255
|
+
return typeof error === "object" && error !== null && "code" in error && error.code === code;
|
|
9064
9256
|
}
|
|
9065
|
-
}
|
|
9066
|
-
function settlePromiseLike(thenable) {
|
|
9067
|
-
return Promise.resolve(thenable).then((data) => [undefined, data]).catch((error) => [
|
|
9068
|
-
error instanceof Error ? error : new Error(String(error)),
|
|
9069
|
-
undefined
|
|
9070
|
-
]);
|
|
9071
9257
|
}
|
|
9072
9258
|
|
|
9073
|
-
// ../
|
|
9074
|
-
var
|
|
9075
|
-
var
|
|
9076
|
-
|
|
9077
|
-
|
|
9078
|
-
|
|
9079
|
-
|
|
9080
|
-
|
|
9081
|
-
|
|
9082
|
-
|
|
9083
|
-
|
|
9084
|
-
|
|
9259
|
+
// ../filesystem/src/index.ts
|
|
9260
|
+
var fsInstance = new NodeFileSystem;
|
|
9261
|
+
var getFileSystem = () => fsInstance;
|
|
9262
|
+
|
|
9263
|
+
// ../common/src/telemetry/pseudonymize.ts
|
|
9264
|
+
var PSEUDONYM_DOMAIN = "uipath-cli/telemetry/pseudonym/v1:";
|
|
9265
|
+
var PSEUDONYM_HEX_LENGTH = 32;
|
|
9266
|
+
var SHA256_K = new Uint32Array([
|
|
9267
|
+
1116352408,
|
|
9268
|
+
1899447441,
|
|
9269
|
+
3049323471,
|
|
9270
|
+
3921009573,
|
|
9271
|
+
961987163,
|
|
9272
|
+
1508970993,
|
|
9273
|
+
2453635748,
|
|
9274
|
+
2870763221,
|
|
9275
|
+
3624381080,
|
|
9276
|
+
310598401,
|
|
9277
|
+
607225278,
|
|
9278
|
+
1426881987,
|
|
9279
|
+
1925078388,
|
|
9280
|
+
2162078206,
|
|
9281
|
+
2614888103,
|
|
9282
|
+
3248222580,
|
|
9283
|
+
3835390401,
|
|
9284
|
+
4022224774,
|
|
9285
|
+
264347078,
|
|
9286
|
+
604807628,
|
|
9287
|
+
770255983,
|
|
9288
|
+
1249150122,
|
|
9289
|
+
1555081692,
|
|
9290
|
+
1996064986,
|
|
9291
|
+
2554220882,
|
|
9292
|
+
2821834349,
|
|
9293
|
+
2952996808,
|
|
9294
|
+
3210313671,
|
|
9295
|
+
3336571891,
|
|
9296
|
+
3584528711,
|
|
9297
|
+
113926993,
|
|
9298
|
+
338241895,
|
|
9299
|
+
666307205,
|
|
9300
|
+
773529912,
|
|
9301
|
+
1294757372,
|
|
9302
|
+
1396182291,
|
|
9303
|
+
1695183700,
|
|
9304
|
+
1986661051,
|
|
9305
|
+
2177026350,
|
|
9306
|
+
2456956037,
|
|
9307
|
+
2730485921,
|
|
9308
|
+
2820302411,
|
|
9309
|
+
3259730800,
|
|
9310
|
+
3345764771,
|
|
9311
|
+
3516065817,
|
|
9312
|
+
3600352804,
|
|
9313
|
+
4094571909,
|
|
9314
|
+
275423344,
|
|
9315
|
+
430227734,
|
|
9316
|
+
506948616,
|
|
9317
|
+
659060556,
|
|
9318
|
+
883997877,
|
|
9319
|
+
958139571,
|
|
9320
|
+
1322822218,
|
|
9321
|
+
1537002063,
|
|
9322
|
+
1747873779,
|
|
9323
|
+
1955562222,
|
|
9324
|
+
2024104815,
|
|
9325
|
+
2227730452,
|
|
9326
|
+
2361852424,
|
|
9327
|
+
2428436474,
|
|
9328
|
+
2756734187,
|
|
9329
|
+
3204031479,
|
|
9330
|
+
3329325298
|
|
9085
9331
|
]);
|
|
9086
|
-
var
|
|
9087
|
-
|
|
9088
|
-
|
|
9089
|
-
|
|
9090
|
-
|
|
9091
|
-
|
|
9092
|
-
|
|
9093
|
-
|
|
9094
|
-
|
|
9332
|
+
var SHA256_INITIAL_STATE = new Uint32Array([
|
|
9333
|
+
1779033703,
|
|
9334
|
+
3144134277,
|
|
9335
|
+
1013904242,
|
|
9336
|
+
2773480762,
|
|
9337
|
+
1359893119,
|
|
9338
|
+
2600822924,
|
|
9339
|
+
528734635,
|
|
9340
|
+
1541459225
|
|
9095
9341
|
]);
|
|
9096
|
-
|
|
9097
|
-
|
|
9098
|
-
|
|
9099
|
-
function
|
|
9100
|
-
|
|
9101
|
-
|
|
9342
|
+
function rotr(value, bits) {
|
|
9343
|
+
return (value >>> bits | value << 32 - bits) >>> 0;
|
|
9344
|
+
}
|
|
9345
|
+
function sha256Hex(input) {
|
|
9346
|
+
const bytes = new TextEncoder().encode(input);
|
|
9347
|
+
const paddedLength = bytes.length + 9 + 63 >> 6 << 6;
|
|
9348
|
+
const buffer = new Uint8Array(paddedLength);
|
|
9349
|
+
buffer.set(bytes);
|
|
9350
|
+
buffer[bytes.length] = 128;
|
|
9351
|
+
const view = new DataView(buffer.buffer);
|
|
9352
|
+
const bitLength = bytes.length * 8;
|
|
9353
|
+
view.setUint32(paddedLength - 8, Math.floor(bitLength / 4294967296));
|
|
9354
|
+
view.setUint32(paddedLength - 4, bitLength >>> 0);
|
|
9355
|
+
const state = SHA256_INITIAL_STATE.slice();
|
|
9356
|
+
const schedule = new Uint32Array(64);
|
|
9357
|
+
for (let offset = 0;offset < paddedLength; offset += 64) {
|
|
9358
|
+
for (let i = 0;i < 16; i++) {
|
|
9359
|
+
schedule[i] = view.getUint32(offset + i * 4);
|
|
9360
|
+
}
|
|
9361
|
+
for (let i = 16;i < 64; i++) {
|
|
9362
|
+
const x = schedule[i - 15];
|
|
9363
|
+
const y = schedule[i - 2];
|
|
9364
|
+
const s0 = (rotr(x, 7) ^ rotr(x, 18) ^ x >>> 3) >>> 0;
|
|
9365
|
+
const s1 = (rotr(y, 17) ^ rotr(y, 19) ^ y >>> 10) >>> 0;
|
|
9366
|
+
schedule[i] = schedule[i - 16] + s0 + schedule[i - 7] + s1 >>> 0;
|
|
9367
|
+
}
|
|
9368
|
+
let a = state[0];
|
|
9369
|
+
let b = state[1];
|
|
9370
|
+
let c = state[2];
|
|
9371
|
+
let d = state[3];
|
|
9372
|
+
let e = state[4];
|
|
9373
|
+
let f = state[5];
|
|
9374
|
+
let g = state[6];
|
|
9375
|
+
let h = state[7];
|
|
9376
|
+
for (let i = 0;i < 64; i++) {
|
|
9377
|
+
const s1 = (rotr(e, 6) ^ rotr(e, 11) ^ rotr(e, 25)) >>> 0;
|
|
9378
|
+
const ch = (e & f ^ ~e & g) >>> 0;
|
|
9379
|
+
const temp1 = h + s1 + ch + SHA256_K[i] + schedule[i] >>> 0;
|
|
9380
|
+
const s0 = (rotr(a, 2) ^ rotr(a, 13) ^ rotr(a, 22)) >>> 0;
|
|
9381
|
+
const maj = (a & b ^ a & c ^ b & c) >>> 0;
|
|
9382
|
+
const temp2 = s0 + maj >>> 0;
|
|
9383
|
+
h = g;
|
|
9384
|
+
g = f;
|
|
9385
|
+
f = e;
|
|
9386
|
+
e = d + temp1 >>> 0;
|
|
9387
|
+
d = c;
|
|
9388
|
+
c = b;
|
|
9389
|
+
b = a;
|
|
9390
|
+
a = temp1 + temp2 >>> 0;
|
|
9391
|
+
}
|
|
9392
|
+
state[0] = state[0] + a >>> 0;
|
|
9393
|
+
state[1] = state[1] + b >>> 0;
|
|
9394
|
+
state[2] = state[2] + c >>> 0;
|
|
9395
|
+
state[3] = state[3] + d >>> 0;
|
|
9396
|
+
state[4] = state[4] + e >>> 0;
|
|
9397
|
+
state[5] = state[5] + f >>> 0;
|
|
9398
|
+
state[6] = state[6] + g >>> 0;
|
|
9399
|
+
state[7] = state[7] + h >>> 0;
|
|
9102
9400
|
}
|
|
9103
|
-
|
|
9104
|
-
|
|
9105
|
-
|
|
9106
|
-
|
|
9107
|
-
|
|
9108
|
-
|
|
9401
|
+
let hex = "";
|
|
9402
|
+
for (const word of state) {
|
|
9403
|
+
hex += word.toString(16).padStart(8, "0");
|
|
9404
|
+
}
|
|
9405
|
+
return hex;
|
|
9406
|
+
}
|
|
9407
|
+
function resolveSha256Hex() {
|
|
9408
|
+
try {
|
|
9409
|
+
const nodeCrypto = __require("node:crypto");
|
|
9410
|
+
const createHash = nodeCrypto?.createHash;
|
|
9411
|
+
if (typeof createHash !== "function") {
|
|
9412
|
+
return sha256Hex;
|
|
9109
9413
|
}
|
|
9414
|
+
const native = (input) => createHash("sha256").update(input, "utf8").digest("hex");
|
|
9415
|
+
return native("abc") === sha256Hex("abc") ? native : sha256Hex;
|
|
9416
|
+
} catch {
|
|
9417
|
+
return sha256Hex;
|
|
9110
9418
|
}
|
|
9111
|
-
return String(error);
|
|
9112
9419
|
}
|
|
9113
|
-
|
|
9114
|
-
|
|
9115
|
-
|
|
9116
|
-
|
|
9117
|
-
|
|
9118
|
-
|
|
9119
|
-
|
|
9120
|
-
|
|
9121
|
-
InvalidArgumentError,
|
|
9122
|
-
InvalidOptionArgumentError,
|
|
9123
|
-
Command,
|
|
9124
|
-
Argument,
|
|
9125
|
-
Option,
|
|
9126
|
-
Help
|
|
9127
|
-
} = import__.default;
|
|
9420
|
+
var cachedSha256Hex;
|
|
9421
|
+
function digest(input) {
|
|
9422
|
+
cachedSha256Hex ??= resolveSha256Hex();
|
|
9423
|
+
return cachedSha256Hex(input);
|
|
9424
|
+
}
|
|
9425
|
+
function pseudonymize(input) {
|
|
9426
|
+
return digest(`${PSEUDONYM_DOMAIN}${input}`).slice(0, PSEUDONYM_HEX_LENGTH);
|
|
9427
|
+
}
|
|
9128
9428
|
|
|
9129
|
-
// ../common/src/command-examples.ts
|
|
9130
|
-
var examplesByCommand = new WeakMap;
|
|
9131
|
-
Command.prototype.examples = function(examples) {
|
|
9132
|
-
examplesByCommand.set(this, examples);
|
|
9133
|
-
return this;
|
|
9134
|
-
};
|
|
9135
9429
|
// ../common/src/singleton.ts
|
|
9136
9430
|
var PREFIX = "@uipath/common/";
|
|
9137
9431
|
var _g = globalThis;
|
|
@@ -9162,60 +9456,431 @@ function singleton(ctorOrName) {
|
|
|
9162
9456
|
};
|
|
9163
9457
|
}
|
|
9164
9458
|
|
|
9165
|
-
// ../common/src/
|
|
9166
|
-
var
|
|
9167
|
-
function
|
|
9168
|
-
|
|
9459
|
+
// ../common/src/telemetry/supplied-values.ts
|
|
9460
|
+
var suppliedValuesSlot = singleton("TelemetrySuppliedArgumentValues");
|
|
9461
|
+
function activeEntries() {
|
|
9462
|
+
const existing = suppliedValuesSlot.get();
|
|
9463
|
+
return Array.isArray(existing) ? existing : [];
|
|
9464
|
+
}
|
|
9465
|
+
var MIN_SCRUBBABLE_LENGTH = 4;
|
|
9466
|
+
function recordSuppliedArgumentValues(values) {
|
|
9467
|
+
const flat = [];
|
|
9468
|
+
const push = (value) => {
|
|
9469
|
+
if (Array.isArray(value)) {
|
|
9470
|
+
for (const item of value) {
|
|
9471
|
+
push(item);
|
|
9472
|
+
}
|
|
9473
|
+
return;
|
|
9474
|
+
}
|
|
9475
|
+
if (typeof value === "string" && value.length >= MIN_SCRUBBABLE_LENGTH) {
|
|
9476
|
+
flat.push(value);
|
|
9477
|
+
}
|
|
9478
|
+
};
|
|
9479
|
+
push(values);
|
|
9480
|
+
const entry = { values: flat };
|
|
9481
|
+
suppliedValuesSlot.set([...activeEntries(), entry]);
|
|
9482
|
+
return entry;
|
|
9169
9483
|
}
|
|
9170
|
-
|
|
9171
|
-
|
|
9172
|
-
|
|
9484
|
+
function releaseSuppliedArgumentValues(entry) {
|
|
9485
|
+
suppliedValuesSlot.set(activeEntries().filter((held) => held !== entry));
|
|
9486
|
+
}
|
|
9487
|
+
function getSuppliedArgumentValues() {
|
|
9488
|
+
const all = new Set;
|
|
9489
|
+
for (const entry of activeEntries()) {
|
|
9490
|
+
for (const value of entry.values) {
|
|
9491
|
+
all.add(value);
|
|
9492
|
+
}
|
|
9173
9493
|
}
|
|
9174
|
-
return
|
|
9175
|
-
}
|
|
9494
|
+
return [...all].sort((a, b) => b.length - a.length);
|
|
9495
|
+
}
|
|
9176
9496
|
|
|
9177
|
-
// ../common/src/
|
|
9178
|
-
|
|
9179
|
-
|
|
9180
|
-
|
|
9181
|
-
|
|
9182
|
-
|
|
9183
|
-
|
|
9184
|
-
},
|
|
9185
|
-
run: (_store, fn) => fn()
|
|
9186
|
-
};
|
|
9187
|
-
}
|
|
9188
|
-
return new mod.AsyncLocalStorage;
|
|
9497
|
+
// ../common/src/telemetry/pii-redactor.ts
|
|
9498
|
+
var REDACTED = "[REDACTED]";
|
|
9499
|
+
var MAX_VALUE_LENGTH = 280;
|
|
9500
|
+
var MAX_STACK_LENGTH = 4096;
|
|
9501
|
+
var MAX_SCAN_LENGTH = MAX_STACK_LENGTH;
|
|
9502
|
+
function truncate(value, maxLength) {
|
|
9503
|
+
return value.length > maxLength ? `${value.slice(0, maxLength)}…` : value;
|
|
9189
9504
|
}
|
|
9190
|
-
var
|
|
9191
|
-
|
|
9192
|
-
|
|
9193
|
-
|
|
9194
|
-
|
|
9195
|
-
|
|
9196
|
-
|
|
9197
|
-
|
|
9198
|
-
|
|
9199
|
-
|
|
9200
|
-
|
|
9201
|
-
|
|
9505
|
+
var SENSITIVE_NAME_TOKENS = new Set([
|
|
9506
|
+
"token",
|
|
9507
|
+
"tokens",
|
|
9508
|
+
"secret",
|
|
9509
|
+
"secrets",
|
|
9510
|
+
"password",
|
|
9511
|
+
"passwords",
|
|
9512
|
+
"pwd",
|
|
9513
|
+
"credential",
|
|
9514
|
+
"credentials",
|
|
9515
|
+
"auth",
|
|
9516
|
+
"authentication",
|
|
9517
|
+
"authorization",
|
|
9518
|
+
"authority",
|
|
9519
|
+
"cert",
|
|
9520
|
+
"certificate",
|
|
9521
|
+
"certificates"
|
|
9522
|
+
]);
|
|
9523
|
+
var SENSITIVE_KEY_PREFIXES = new Set([
|
|
9524
|
+
"api",
|
|
9525
|
+
"access",
|
|
9526
|
+
"client",
|
|
9527
|
+
"private",
|
|
9528
|
+
"public",
|
|
9529
|
+
"signing",
|
|
9530
|
+
"encryption",
|
|
9531
|
+
"session",
|
|
9532
|
+
"master",
|
|
9533
|
+
"shared",
|
|
9534
|
+
"root",
|
|
9535
|
+
"ssh",
|
|
9536
|
+
"rsa",
|
|
9537
|
+
"aes",
|
|
9538
|
+
"hmac",
|
|
9539
|
+
"oauth"
|
|
9540
|
+
]);
|
|
9541
|
+
var UUID_PATTERN = /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi;
|
|
9542
|
+
var EMAIL_PATTERN = /\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
9543
|
+
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
9544
|
+
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
9545
|
+
var PADDED_BASE64_PATTERN = /[A-Za-z0-9+/]{16,}={1,2}(?![A-Za-z0-9+/=])/g;
|
|
9546
|
+
var BASE64_WITH_PLUS_PATTERN = /[A-Za-z0-9+/]{40,}/g;
|
|
9547
|
+
var USER_HOME_PATTERN = /(?<![A-Za-z0-9._-])([/\\])(Users|home|Profiles)([/\\])([^/\\]+)/gi;
|
|
9548
|
+
var UNC_PATH_PATTERN = /(^|[\s"'<>|=,;([{])(\\\\[^\s"'<>|]+)/g;
|
|
9549
|
+
var HOST_PORT_PATTERN = /(?<![/@.\w-])(?!\d+\.\d+\.\d+\.\d+:)[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?(?:\.[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?)+:\d{1,5}\b/g;
|
|
9550
|
+
var SOURCE_FILE_EXTENSIONS = new Set([
|
|
9551
|
+
"ts",
|
|
9552
|
+
"tsx",
|
|
9553
|
+
"js",
|
|
9554
|
+
"jsx",
|
|
9555
|
+
"mjs",
|
|
9556
|
+
"cjs",
|
|
9557
|
+
"cts",
|
|
9558
|
+
"mts",
|
|
9559
|
+
"py",
|
|
9560
|
+
"cs",
|
|
9561
|
+
"java",
|
|
9562
|
+
"go",
|
|
9563
|
+
"rs",
|
|
9564
|
+
"rb",
|
|
9565
|
+
"php",
|
|
9566
|
+
"sh",
|
|
9567
|
+
"ps1",
|
|
9568
|
+
"json",
|
|
9569
|
+
"jsonc",
|
|
9570
|
+
"yaml",
|
|
9571
|
+
"yml",
|
|
9572
|
+
"xml",
|
|
9573
|
+
"xaml",
|
|
9574
|
+
"md",
|
|
9575
|
+
"txt",
|
|
9576
|
+
"log",
|
|
9577
|
+
"css",
|
|
9578
|
+
"html",
|
|
9579
|
+
"htm",
|
|
9580
|
+
"csproj",
|
|
9581
|
+
"nuspec",
|
|
9582
|
+
"sql"
|
|
9583
|
+
]);
|
|
9584
|
+
var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
9585
|
+
var QUOTED_LITERAL_MAX_SPAN = 200;
|
|
9586
|
+
var QUOTED_LITERAL_PATTERN = new RegExp([
|
|
9587
|
+
`(?<![A-Za-z0-9])'(?:[^\\
|
|
9588
|
+
]|\\.){2,${QUOTED_LITERAL_MAX_SPAN}}?'(?![A-Za-z0-9])`,
|
|
9589
|
+
`(?<![A-Za-z0-9])"(?:[^\\
|
|
9590
|
+
]|\\.){2,${QUOTED_LITERAL_MAX_SPAN}}?"(?![A-Za-z0-9])`
|
|
9591
|
+
].join("|"), "g");
|
|
9592
|
+
var JSON_BODY_PATTERN = /[{[][^{}[\]]*[:,][^{}[\]]*[\]}]/g;
|
|
9593
|
+
var COLLAPSED_BODY = "{…}";
|
|
9594
|
+
var COLLAPSED_BODY_MARKER = "\x01body\x01";
|
|
9595
|
+
var MAX_BODY_NESTING = 8;
|
|
9596
|
+
function collapseJsonBodies(text) {
|
|
9597
|
+
let out = text;
|
|
9598
|
+
for (let pass = 0;pass < MAX_BODY_NESTING; pass++) {
|
|
9599
|
+
const next = out.replace(JSON_BODY_PATTERN, COLLAPSED_BODY_MARKER);
|
|
9600
|
+
if (next === out) {
|
|
9601
|
+
break;
|
|
9602
|
+
}
|
|
9603
|
+
out = next;
|
|
9202
9604
|
}
|
|
9203
|
-
|
|
9204
|
-
function getOutputSink() {
|
|
9205
|
-
return outputStorage.getStore() ?? sinkSlot.get() ?? CONSOLE_FALLBACK;
|
|
9605
|
+
return out.split(COLLAPSED_BODY_MARKER).join(COLLAPSED_BODY);
|
|
9206
9606
|
}
|
|
9207
|
-
|
|
9208
|
-
|
|
9209
|
-
|
|
9210
|
-
|
|
9211
|
-
logFilePathSlot.set(path);
|
|
9607
|
+
var TRAILING_PROSE_PUNCT = /[.,;:!?)\]}>'"]+$/;
|
|
9608
|
+
function peelTrailingPunctuation(match) {
|
|
9609
|
+
const trailing = match.match(TRAILING_PROSE_PUNCT)?.[0] ?? "";
|
|
9610
|
+
return trailing ? [match.slice(0, -trailing.length), trailing] : [match, ""];
|
|
9212
9611
|
}
|
|
9213
|
-
function
|
|
9214
|
-
|
|
9612
|
+
function redactUrl(raw) {
|
|
9613
|
+
try {
|
|
9614
|
+
const url = new URL(raw);
|
|
9615
|
+
return `${url.protocol}//${url.host}`;
|
|
9616
|
+
} catch {
|
|
9617
|
+
return `url#${pseudonymize(raw)}`;
|
|
9618
|
+
}
|
|
9215
9619
|
}
|
|
9216
|
-
|
|
9217
|
-
|
|
9218
|
-
|
|
9620
|
+
function redactValueDetectors(value, maxLength = MAX_VALUE_LENGTH) {
|
|
9621
|
+
let out = truncate(value, MAX_SCAN_LENGTH);
|
|
9622
|
+
out = out.replace(JWT_PATTERN, () => REDACTED);
|
|
9623
|
+
out = out.replace(URL_PATTERN, (match) => {
|
|
9624
|
+
const [core, trailing] = peelTrailingPunctuation(match);
|
|
9625
|
+
return `${redactUrl(core)}${trailing}`;
|
|
9626
|
+
});
|
|
9627
|
+
out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
9628
|
+
out = out.replace(UNC_PATH_PATTERN, (_match, before, path2) => {
|
|
9629
|
+
const [core, trailing] = peelTrailingPunctuation(path2);
|
|
9630
|
+
return `${before}unc#${pseudonymize(core)}${trailing}`;
|
|
9631
|
+
});
|
|
9632
|
+
out = out.replace(EMAIL_PATTERN, (match) => `email#${pseudonymize(match)}`);
|
|
9633
|
+
out = out.replace(UUID_PATTERN, (match) => `uuid#${pseudonymize(match)}`);
|
|
9634
|
+
out = out.replace(HOST_PORT_PATTERN, (match) => {
|
|
9635
|
+
const split = match.lastIndexOf(":");
|
|
9636
|
+
const host = match.slice(0, split);
|
|
9637
|
+
const extension = host.slice(host.lastIndexOf(".") + 1).toLowerCase();
|
|
9638
|
+
if (SOURCE_FILE_EXTENSIONS.has(extension)) {
|
|
9639
|
+
return match;
|
|
9640
|
+
}
|
|
9641
|
+
return `host#${pseudonymize(host)}:${match.slice(split + 1)}`;
|
|
9642
|
+
});
|
|
9643
|
+
out = out.replace(PADDED_BASE64_PATTERN, () => REDACTED);
|
|
9644
|
+
out = out.replace(BASE64_WITH_PLUS_PATTERN, (match) => match.includes("+") ? REDACTED : match);
|
|
9645
|
+
out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
|
|
9646
|
+
return truncate(out, maxLength);
|
|
9647
|
+
}
|
|
9648
|
+
function redactSpanName(name) {
|
|
9649
|
+
return redactValueDetectors(truncate(name, MAX_SCAN_LENGTH).replace(QUOTED_LITERAL_PATTERN, (match) => `${match[0]}<redacted>${match[0]}`));
|
|
9650
|
+
}
|
|
9651
|
+
var HTTP_DEPENDENCY_NAME = /^([A-Z]+) (\/.*)$/s;
|
|
9652
|
+
function redactHttpDependencyName(name) {
|
|
9653
|
+
const parts = HTTP_DEPENDENCY_NAME.exec(name);
|
|
9654
|
+
if (!parts) {
|
|
9655
|
+
return redactMessage(name);
|
|
9656
|
+
}
|
|
9657
|
+
return `${parts[1]} ${redactMessage(parts[2])}`;
|
|
9658
|
+
}
|
|
9659
|
+
function redactMessage(value) {
|
|
9660
|
+
let out = collapseJsonBodies(truncate(value, MAX_SCAN_LENGTH)).replace(QUOTED_LITERAL_PATTERN, (match) => `${match[0]}<redacted>${match[0]}`);
|
|
9661
|
+
for (const supplied of getSuppliedArgumentValues()) {
|
|
9662
|
+
out = out.split(supplied).join(REDACTED);
|
|
9663
|
+
}
|
|
9664
|
+
return redactValueDetectors(out);
|
|
9665
|
+
}
|
|
9666
|
+
var MESSAGE_NAMES = new Set([
|
|
9667
|
+
"message",
|
|
9668
|
+
"errormessage",
|
|
9669
|
+
"errmessage",
|
|
9670
|
+
"error_message",
|
|
9671
|
+
"msg",
|
|
9672
|
+
"detail",
|
|
9673
|
+
"details",
|
|
9674
|
+
"reason",
|
|
9675
|
+
"instructions",
|
|
9676
|
+
"warning"
|
|
9677
|
+
]);
|
|
9678
|
+
function isFreeFormValue(name, value) {
|
|
9679
|
+
return MESSAGE_NAMES.has(name.toLowerCase()) || /['"{[]/.test(value);
|
|
9680
|
+
}
|
|
9681
|
+
function redactError(error) {
|
|
9682
|
+
const safe = new Error(redactMessage(error.message ?? ""));
|
|
9683
|
+
safe.name = error.name;
|
|
9684
|
+
safe.stack = typeof error.stack === "string" ? redactStack(error.stack) : undefined;
|
|
9685
|
+
return safe;
|
|
9686
|
+
}
|
|
9687
|
+
function redactStack(stack) {
|
|
9688
|
+
const bounded = truncate(stack, MAX_STACK_LENGTH);
|
|
9689
|
+
const firstBreak = bounded.indexOf(`
|
|
9690
|
+
`);
|
|
9691
|
+
if (firstBreak === -1) {
|
|
9692
|
+
return redactMessage(bounded);
|
|
9693
|
+
}
|
|
9694
|
+
return `${redactMessage(bounded.slice(0, firstBreak))}
|
|
9695
|
+
${redactValueDetectors(bounded.slice(firstBreak + 1), MAX_STACK_LENGTH)}`;
|
|
9696
|
+
}
|
|
9697
|
+
function nameTokens(name) {
|
|
9698
|
+
return name.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").split(/[\s._-]+/).map((t) => t.toLowerCase()).filter(Boolean);
|
|
9699
|
+
}
|
|
9700
|
+
function isSensitiveName(name) {
|
|
9701
|
+
const tokens = nameTokens(name);
|
|
9702
|
+
for (let i = 0;i < tokens.length; i++) {
|
|
9703
|
+
const token = tokens[i];
|
|
9704
|
+
if (SENSITIVE_NAME_TOKENS.has(token)) {
|
|
9705
|
+
return true;
|
|
9706
|
+
}
|
|
9707
|
+
if (token === "key" || token === "keys") {
|
|
9708
|
+
const prev = tokens[i - 1];
|
|
9709
|
+
if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
|
|
9710
|
+
return true;
|
|
9711
|
+
}
|
|
9712
|
+
}
|
|
9713
|
+
}
|
|
9714
|
+
return false;
|
|
9715
|
+
}
|
|
9716
|
+
function redactProperty(name, value) {
|
|
9717
|
+
if (value === undefined || value === null) {
|
|
9718
|
+
return;
|
|
9719
|
+
}
|
|
9720
|
+
if (isSensitiveName(name)) {
|
|
9721
|
+
return REDACTED;
|
|
9722
|
+
}
|
|
9723
|
+
if (typeof value === "boolean" || typeof value === "number") {
|
|
9724
|
+
return value;
|
|
9725
|
+
}
|
|
9726
|
+
if (typeof value !== "string") {
|
|
9727
|
+
return "[OBJECT]";
|
|
9728
|
+
}
|
|
9729
|
+
return isFreeFormValue(name, value) ? redactMessage(value) : redactValueDetectors(value);
|
|
9730
|
+
}
|
|
9731
|
+
function redactProperties(properties) {
|
|
9732
|
+
const out = {};
|
|
9733
|
+
for (const [name, value] of Object.entries(properties)) {
|
|
9734
|
+
const redacted = redactProperty(name, value);
|
|
9735
|
+
if (redacted !== undefined) {
|
|
9736
|
+
out[name] = redacted;
|
|
9737
|
+
}
|
|
9738
|
+
}
|
|
9739
|
+
return out;
|
|
9740
|
+
}
|
|
9741
|
+
|
|
9742
|
+
// ../common/src/catch-error.ts
|
|
9743
|
+
var MAX_SERIALIZED_LENGTH = 500;
|
|
9744
|
+
var TRUNCATION_SUFFIX = "…(truncated)";
|
|
9745
|
+
var REDACTED2 = "[REDACTED]";
|
|
9746
|
+
function cap(text) {
|
|
9747
|
+
return text.length > MAX_SERIALIZED_LENGTH ? `${text.slice(0, MAX_SERIALIZED_LENGTH)}${TRUNCATION_SUFFIX}` : text;
|
|
9748
|
+
}
|
|
9749
|
+
function omitSensitive(key, value) {
|
|
9750
|
+
return key.length > 0 && isSensitiveName(key) ? REDACTED2 : value;
|
|
9751
|
+
}
|
|
9752
|
+
function describeThrownValue(value) {
|
|
9753
|
+
if (typeof value !== "object" || value === null) {
|
|
9754
|
+
return String(value);
|
|
9755
|
+
}
|
|
9756
|
+
let message;
|
|
9757
|
+
try {
|
|
9758
|
+
message = value.message;
|
|
9759
|
+
} catch {
|
|
9760
|
+
message = undefined;
|
|
9761
|
+
}
|
|
9762
|
+
if (typeof message === "string" && message.length > 0) {
|
|
9763
|
+
return cap(message);
|
|
9764
|
+
}
|
|
9765
|
+
try {
|
|
9766
|
+
const json = JSON.stringify(value, omitSensitive);
|
|
9767
|
+
if (json !== undefined) {
|
|
9768
|
+
return cap(json);
|
|
9769
|
+
}
|
|
9770
|
+
} catch {}
|
|
9771
|
+
return String(value);
|
|
9772
|
+
}
|
|
9773
|
+
function toError(error) {
|
|
9774
|
+
return error instanceof Error ? error : new Error(describeThrownValue(error), { cause: error });
|
|
9775
|
+
}
|
|
9776
|
+
function isPromiseLike(value) {
|
|
9777
|
+
return value !== null && typeof value === "object" && typeof value.then === "function";
|
|
9778
|
+
}
|
|
9779
|
+
function catchError(fnOrPromise) {
|
|
9780
|
+
if (isPromiseLike(fnOrPromise)) {
|
|
9781
|
+
return settlePromiseLike(fnOrPromise);
|
|
9782
|
+
}
|
|
9783
|
+
try {
|
|
9784
|
+
const result = fnOrPromise();
|
|
9785
|
+
if (isPromiseLike(result)) {
|
|
9786
|
+
return settlePromiseLike(result);
|
|
9787
|
+
}
|
|
9788
|
+
return [undefined, result];
|
|
9789
|
+
} catch (error) {
|
|
9790
|
+
return [toError(error), undefined];
|
|
9791
|
+
}
|
|
9792
|
+
}
|
|
9793
|
+
function settlePromiseLike(thenable) {
|
|
9794
|
+
return Promise.resolve(thenable).then((data) => [undefined, data]).catch((error) => [toError(error), undefined]);
|
|
9795
|
+
}
|
|
9796
|
+
|
|
9797
|
+
// ../common/src/error-handler.ts
|
|
9798
|
+
var DEFAULT_401 = "Unauthorized (401). Run `uip login` to authenticate.";
|
|
9799
|
+
var NETWORK_ERROR_CODES = new Set([
|
|
9800
|
+
"ECONNREFUSED",
|
|
9801
|
+
"ECONNRESET",
|
|
9802
|
+
"ENOTFOUND",
|
|
9803
|
+
"EAI_AGAIN",
|
|
9804
|
+
"ETIMEDOUT",
|
|
9805
|
+
"EPIPE",
|
|
9806
|
+
"EHOSTUNREACH",
|
|
9807
|
+
"ENETUNREACH",
|
|
9808
|
+
"EAI_FAIL"
|
|
9809
|
+
]);
|
|
9810
|
+
var TLS_ERROR_CODES = new Set([
|
|
9811
|
+
"SELF_SIGNED_CERT_IN_CHAIN",
|
|
9812
|
+
"DEPTH_ZERO_SELF_SIGNED_CERT",
|
|
9813
|
+
"UNABLE_TO_VERIFY_LEAF_SIGNATURE",
|
|
9814
|
+
"UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
|
|
9815
|
+
"UNABLE_TO_GET_ISSUER_CERT",
|
|
9816
|
+
"CERT_HAS_EXPIRED",
|
|
9817
|
+
"CERT_UNTRUSTED",
|
|
9818
|
+
"ERR_TLS_CERT_ALTNAME_INVALID"
|
|
9819
|
+
]);
|
|
9820
|
+
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.";
|
|
9821
|
+
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.";
|
|
9822
|
+
var LOCAL_PERMISSION_ERROR_CODES = new Set(["EACCES", "EPERM", "EROFS"]);
|
|
9823
|
+
function extractErrorMessageSync(error) {
|
|
9824
|
+
if (error instanceof Error) {
|
|
9825
|
+
return error.message;
|
|
9826
|
+
}
|
|
9827
|
+
if (typeof error === "object" && error !== null) {
|
|
9828
|
+
if ("status" in error && error.status === 401) {
|
|
9829
|
+
return DEFAULT_401;
|
|
9830
|
+
}
|
|
9831
|
+
if ("message" in error && typeof error.message === "string") {
|
|
9832
|
+
return error.message;
|
|
9833
|
+
}
|
|
9834
|
+
}
|
|
9835
|
+
return describeThrownValue(error);
|
|
9836
|
+
}
|
|
9837
|
+
// ../common/src/exit-code.ts
|
|
9838
|
+
function setExitCode(code) {
|
|
9839
|
+
process.exitCode = code;
|
|
9840
|
+
}
|
|
9841
|
+
|
|
9842
|
+
// ../common/src/output-context.ts
|
|
9843
|
+
function createStorage() {
|
|
9844
|
+
const [error, mod] = catchError(() => __require("node:async_hooks"));
|
|
9845
|
+
if (error || typeof mod?.AsyncLocalStorage !== "function") {
|
|
9846
|
+
return {
|
|
9847
|
+
getStore: () => {
|
|
9848
|
+
return;
|
|
9849
|
+
},
|
|
9850
|
+
run: (_store, fn) => fn()
|
|
9851
|
+
};
|
|
9852
|
+
}
|
|
9853
|
+
return new mod.AsyncLocalStorage;
|
|
9854
|
+
}
|
|
9855
|
+
var storageSingleton = singleton("OutputStorage");
|
|
9856
|
+
var sinkSlot = singleton("OutputSink");
|
|
9857
|
+
var outputStorage = storageSingleton.getOrInit(createStorage, (v) => ("getStore" in v));
|
|
9858
|
+
var CONSOLE_FALLBACK = {
|
|
9859
|
+
writeOut: (str) => process.stdout.write(str),
|
|
9860
|
+
writeErr: (str) => process.stderr.write(str),
|
|
9861
|
+
writeLog: (str) => process.stdout.write(str),
|
|
9862
|
+
capabilities: {
|
|
9863
|
+
isInteractive: false,
|
|
9864
|
+
canReadInput: false,
|
|
9865
|
+
supportsColor: false,
|
|
9866
|
+
outputWidth: 80
|
|
9867
|
+
}
|
|
9868
|
+
};
|
|
9869
|
+
function getOutputSink() {
|
|
9870
|
+
return outputStorage.getStore() ?? sinkSlot.get() ?? CONSOLE_FALLBACK;
|
|
9871
|
+
}
|
|
9872
|
+
|
|
9873
|
+
// ../common/src/logger.ts
|
|
9874
|
+
var logFilePathSlot = singleton("logFilePath");
|
|
9875
|
+
function setGlobalLogFilePath(path2) {
|
|
9876
|
+
logFilePathSlot.set(path2);
|
|
9877
|
+
}
|
|
9878
|
+
function getGlobalLogFilePath() {
|
|
9879
|
+
return logFilePathSlot.get("");
|
|
9880
|
+
}
|
|
9881
|
+
var DEFAULT_LOG_LEVEL = 3 /* ERROR */;
|
|
9882
|
+
|
|
9883
|
+
class SimpleLogger {
|
|
9219
9884
|
__brand = "SimpleLogger";
|
|
9220
9885
|
level;
|
|
9221
9886
|
logFilePath;
|
|
@@ -9245,7 +9910,7 @@ class SimpleLogger {
|
|
|
9245
9910
|
}
|
|
9246
9911
|
return DEFAULT_LOG_LEVEL;
|
|
9247
9912
|
}
|
|
9248
|
-
const [localStorageError, hasDebug] =
|
|
9913
|
+
const [localStorageError, hasDebug] = catchError(() => typeof localStorage !== "undefined" && !!localStorage.getItem("debug"));
|
|
9249
9914
|
if (!localStorageError && hasDebug) {
|
|
9250
9915
|
return 0 /* DEBUG */;
|
|
9251
9916
|
}
|
|
@@ -9276,54 +9941,49 @@ class SimpleLogger {
|
|
|
9276
9941
|
return this.fileLoggingEnabled || !!getGlobalLogFilePath();
|
|
9277
9942
|
}
|
|
9278
9943
|
writeToFile(formatted) {
|
|
9279
|
-
const
|
|
9280
|
-
if (!
|
|
9944
|
+
const path2 = this.logFilePath || getGlobalLogFilePath();
|
|
9945
|
+
if (!path2)
|
|
9281
9946
|
return;
|
|
9282
9947
|
const timestamp = new Date().toISOString();
|
|
9283
9948
|
this.pendingWrites = Promise.all([
|
|
9284
9949
|
this.pendingWrites,
|
|
9285
9950
|
this.pendingInit
|
|
9286
|
-
]).then(() => getFileSystem().appendFile(
|
|
9951
|
+
]).then(() => getFileSystem().appendFile(path2, `${timestamp} ${formatted}`).catch(() => {}));
|
|
9287
9952
|
}
|
|
9288
|
-
|
|
9289
|
-
if (this.level > 0 /* DEBUG */)
|
|
9290
|
-
return;
|
|
9291
|
-
const formatted = this.format(`[DEBUG] ${message}`, args);
|
|
9953
|
+
write(formatted) {
|
|
9292
9954
|
if (this.isFileLoggingActive()) {
|
|
9293
9955
|
this.writeToFile(formatted);
|
|
9294
9956
|
} else {
|
|
9295
9957
|
getOutputSink().writeErr(formatted);
|
|
9296
9958
|
}
|
|
9297
9959
|
}
|
|
9960
|
+
debug(message, ...args) {
|
|
9961
|
+
if (this.level > 0 /* DEBUG */)
|
|
9962
|
+
return;
|
|
9963
|
+
const formatted = this.format(`[DEBUG] ${message}`, args);
|
|
9964
|
+
this.write(formatted);
|
|
9965
|
+
}
|
|
9298
9966
|
info(message, ...args) {
|
|
9299
9967
|
if (this.level > 1 /* INFO */)
|
|
9300
9968
|
return;
|
|
9301
9969
|
const formatted = this.format(message, args);
|
|
9302
|
-
|
|
9303
|
-
this.writeToFile(formatted);
|
|
9304
|
-
} else {
|
|
9305
|
-
getOutputSink().writeErr(formatted);
|
|
9306
|
-
}
|
|
9970
|
+
this.write(formatted);
|
|
9307
9971
|
}
|
|
9308
9972
|
warn(message, ...args) {
|
|
9309
9973
|
if (this.level > 2 /* WARN */)
|
|
9310
9974
|
return;
|
|
9311
9975
|
const formatted = this.format(`[WARN] ${message}`, args);
|
|
9312
|
-
|
|
9313
|
-
this.writeToFile(formatted);
|
|
9314
|
-
} else {
|
|
9315
|
-
getOutputSink().writeErr(formatted);
|
|
9316
|
-
}
|
|
9976
|
+
this.write(formatted);
|
|
9317
9977
|
}
|
|
9318
9978
|
error(message, ...args) {
|
|
9319
9979
|
if (this.level > 3 /* ERROR */)
|
|
9320
9980
|
return;
|
|
9321
9981
|
const formatted = this.format(`[ERROR] ${message}`, args);
|
|
9322
|
-
|
|
9323
|
-
|
|
9324
|
-
|
|
9325
|
-
|
|
9326
|
-
|
|
9982
|
+
this.write(formatted);
|
|
9983
|
+
}
|
|
9984
|
+
report(message) {
|
|
9985
|
+
const formatted = this.format(message, []);
|
|
9986
|
+
this.write(formatted);
|
|
9327
9987
|
}
|
|
9328
9988
|
getLevel() {
|
|
9329
9989
|
return this.level;
|
|
@@ -9338,17 +9998,17 @@ class SimpleLogger {
|
|
|
9338
9998
|
setGlobalLogFilePath("");
|
|
9339
9999
|
}
|
|
9340
10000
|
}
|
|
9341
|
-
setLogFile(
|
|
9342
|
-
this.logFilePath =
|
|
9343
|
-
setGlobalLogFilePath(
|
|
9344
|
-
if (!
|
|
10001
|
+
setLogFile(path2) {
|
|
10002
|
+
this.logFilePath = path2;
|
|
10003
|
+
setGlobalLogFilePath(path2);
|
|
10004
|
+
if (!path2)
|
|
9345
10005
|
return;
|
|
9346
10006
|
this.fileLoggingEnabled = true;
|
|
9347
|
-
const
|
|
10007
|
+
const fs2 = getFileSystem();
|
|
9348
10008
|
this.pendingInit = (async () => {
|
|
9349
|
-
const [error] = await
|
|
9350
|
-
await
|
|
9351
|
-
await
|
|
10009
|
+
const [error] = await catchError((async () => {
|
|
10010
|
+
await fs2.mkdir(fs2.path.dirname(path2));
|
|
10011
|
+
await fs2.writeFile(path2, "");
|
|
9352
10012
|
})());
|
|
9353
10013
|
if (error)
|
|
9354
10014
|
this.fileLoggingEnabled = false;
|
|
@@ -9402,12 +10062,12 @@ var jmespathSlot = singleton("JmespathCodec");
|
|
|
9402
10062
|
async function loadOutputCodecsAsync(needed) {
|
|
9403
10063
|
const loads = [];
|
|
9404
10064
|
if (needed.yaml && yamlSlot.get() === undefined) {
|
|
9405
|
-
loads.push(import("./js-yaml-
|
|
10065
|
+
loads.push(import("./js-yaml-87tvr6f6.js").then((mod) => {
|
|
9406
10066
|
yamlSlot.set(mod);
|
|
9407
10067
|
}));
|
|
9408
10068
|
}
|
|
9409
10069
|
if (needed.filter && jmespathSlot.get() === undefined) {
|
|
9410
|
-
loads.push(import("./index-
|
|
10070
|
+
loads.push(import("./index-p3vk57z7.js").then((mod) => {
|
|
9411
10071
|
jmespathSlot.set(mod);
|
|
9412
10072
|
}));
|
|
9413
10073
|
}
|
|
@@ -9662,7 +10322,7 @@ function readRegistryValue(keyPath, valueName) {
|
|
|
9662
10322
|
if (process.platform !== "win32") {
|
|
9663
10323
|
return "";
|
|
9664
10324
|
}
|
|
9665
|
-
const [error, output] =
|
|
10325
|
+
const [error, output] = catchError(() => execFileSync("reg", ["query", keyPath, "/v", valueName], {
|
|
9666
10326
|
encoding: "utf-8",
|
|
9667
10327
|
stdio: ["pipe", "pipe", "pipe"]
|
|
9668
10328
|
}));
|
|
@@ -9685,27 +10345,41 @@ class LoggerTelemetryProvider {
|
|
|
9685
10345
|
...this.analyticsUniqueId ? { analyticsUniqueId: this.analyticsUniqueId } : {}
|
|
9686
10346
|
};
|
|
9687
10347
|
}
|
|
9688
|
-
async trackEvent(
|
|
9689
|
-
logger.debug(formatMessage("Event",
|
|
10348
|
+
async trackEvent({ name, properties }) {
|
|
10349
|
+
logger.debug(formatMessage("Event", name, this.enrich(properties)));
|
|
9690
10350
|
}
|
|
9691
|
-
async trackException(
|
|
10351
|
+
async trackException({
|
|
10352
|
+
error,
|
|
10353
|
+
properties
|
|
10354
|
+
}) {
|
|
9692
10355
|
logger.error(formatMessage("Exception", error.message, this.enrich({
|
|
9693
10356
|
...properties,
|
|
9694
10357
|
stack: error.stack
|
|
9695
10358
|
})));
|
|
9696
10359
|
}
|
|
9697
|
-
async trackRequest(
|
|
10360
|
+
async trackRequest({
|
|
10361
|
+
name,
|
|
10362
|
+
durationMs,
|
|
10363
|
+
success,
|
|
10364
|
+
properties
|
|
10365
|
+
}) {
|
|
9698
10366
|
logger.debug(formatMessage("Request", name, this.enrich({
|
|
9699
10367
|
...properties,
|
|
9700
|
-
duration: `${
|
|
10368
|
+
duration: `${durationMs}ms`,
|
|
9701
10369
|
success
|
|
9702
10370
|
})));
|
|
9703
10371
|
}
|
|
9704
|
-
async trackDependency(
|
|
10372
|
+
async trackDependency({
|
|
10373
|
+
name,
|
|
10374
|
+
type,
|
|
10375
|
+
durationMs,
|
|
10376
|
+
success,
|
|
10377
|
+
properties
|
|
10378
|
+
}) {
|
|
9705
10379
|
logger.debug(formatMessage("Dependency", name, this.enrich({
|
|
9706
10380
|
...properties,
|
|
9707
10381
|
type,
|
|
9708
|
-
duration: `${
|
|
10382
|
+
duration: `${durationMs}ms`,
|
|
9709
10383
|
success
|
|
9710
10384
|
})));
|
|
9711
10385
|
}
|
|
@@ -9961,144 +10635,16 @@ function getGlobalTelemetryProperties() {
|
|
|
9961
10635
|
return telemetryPropsSlot.get();
|
|
9962
10636
|
}
|
|
9963
10637
|
|
|
9964
|
-
// ../common/src/telemetry/
|
|
9965
|
-
|
|
9966
|
-
|
|
9967
|
-
|
|
9968
|
-
|
|
9969
|
-
|
|
9970
|
-
|
|
9971
|
-
"secrets",
|
|
9972
|
-
"password",
|
|
9973
|
-
"passwords",
|
|
9974
|
-
"pwd",
|
|
9975
|
-
"credential",
|
|
9976
|
-
"credentials",
|
|
9977
|
-
"auth",
|
|
9978
|
-
"authentication",
|
|
9979
|
-
"authorization",
|
|
9980
|
-
"authority",
|
|
9981
|
-
"cert",
|
|
9982
|
-
"certificate",
|
|
9983
|
-
"certificates"
|
|
9984
|
-
]);
|
|
9985
|
-
var SENSITIVE_KEY_PREFIXES = new Set([
|
|
9986
|
-
"api",
|
|
9987
|
-
"access",
|
|
9988
|
-
"client",
|
|
9989
|
-
"private",
|
|
9990
|
-
"public",
|
|
9991
|
-
"signing",
|
|
9992
|
-
"encryption",
|
|
9993
|
-
"session",
|
|
9994
|
-
"master",
|
|
9995
|
-
"shared",
|
|
9996
|
-
"root",
|
|
9997
|
-
"ssh",
|
|
9998
|
-
"rsa",
|
|
9999
|
-
"aes",
|
|
10000
|
-
"hmac",
|
|
10001
|
-
"oauth"
|
|
10002
|
-
]);
|
|
10003
|
-
var UUID_PATTERN = /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi;
|
|
10004
|
-
var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
10005
|
-
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
10006
|
-
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
10007
|
-
var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
10008
|
-
var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
10009
|
-
var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
|
|
10010
|
-
function shortHash(input) {
|
|
10011
|
-
let hash = 2166136261;
|
|
10012
|
-
for (let i = 0;i < input.length; i++) {
|
|
10013
|
-
hash ^= input.charCodeAt(i);
|
|
10014
|
-
hash = Math.imul(hash, 16777619);
|
|
10015
|
-
}
|
|
10016
|
-
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
10017
|
-
}
|
|
10018
|
-
function redactUrl(raw) {
|
|
10019
|
-
try {
|
|
10020
|
-
const url = new URL(raw);
|
|
10021
|
-
return `${url.protocol}//${url.host}`;
|
|
10022
|
-
} catch {
|
|
10023
|
-
return `url#${shortHash(raw)}`;
|
|
10024
|
-
}
|
|
10025
|
-
}
|
|
10026
|
-
function redactValueDetectors(value) {
|
|
10027
|
-
let out = value;
|
|
10028
|
-
out = out.replace(JWT_PATTERN, () => REDACTED);
|
|
10029
|
-
out = out.replace(URL_PATTERN, (match) => {
|
|
10030
|
-
const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
|
|
10031
|
-
const core = trailing ? match.slice(0, -trailing.length) : match;
|
|
10032
|
-
return `${redactUrl(core)}${trailing}`;
|
|
10033
|
-
});
|
|
10034
|
-
out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
10035
|
-
out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
|
|
10036
|
-
out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
|
|
10037
|
-
out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
|
|
10038
|
-
if (out.length > MAX_VALUE_LENGTH) {
|
|
10039
|
-
out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
|
|
10040
|
-
}
|
|
10041
|
-
return out;
|
|
10042
|
-
}
|
|
10043
|
-
function redactValue(value) {
|
|
10044
|
-
return redactValueDetectors(value);
|
|
10045
|
-
}
|
|
10046
|
-
function redactError(error) {
|
|
10047
|
-
const safe = new Error(redactValueDetectors(error.message ?? ""));
|
|
10048
|
-
safe.name = error.name;
|
|
10049
|
-
safe.stack = typeof error.stack === "string" ? redactValueDetectors(error.stack) : undefined;
|
|
10050
|
-
return safe;
|
|
10051
|
-
}
|
|
10052
|
-
function nameTokens(name) {
|
|
10053
|
-
return name.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").split(/[\s._-]+/).map((t) => t.toLowerCase()).filter(Boolean);
|
|
10054
|
-
}
|
|
10055
|
-
function isSensitiveName(name) {
|
|
10056
|
-
const tokens = nameTokens(name);
|
|
10057
|
-
for (let i = 0;i < tokens.length; i++) {
|
|
10058
|
-
const token = tokens[i];
|
|
10059
|
-
if (SENSITIVE_NAME_TOKENS.has(token)) {
|
|
10060
|
-
return true;
|
|
10061
|
-
}
|
|
10062
|
-
if (token === "key" || token === "keys") {
|
|
10063
|
-
const prev = tokens[i - 1];
|
|
10064
|
-
if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
|
|
10065
|
-
return true;
|
|
10066
|
-
}
|
|
10067
|
-
}
|
|
10068
|
-
}
|
|
10069
|
-
return false;
|
|
10070
|
-
}
|
|
10071
|
-
function redactProperty(name, value) {
|
|
10072
|
-
if (value === undefined || value === null) {
|
|
10073
|
-
return;
|
|
10074
|
-
}
|
|
10075
|
-
if (isSensitiveName(name)) {
|
|
10076
|
-
return REDACTED;
|
|
10077
|
-
}
|
|
10078
|
-
if (typeof value === "boolean" || typeof value === "number") {
|
|
10079
|
-
return value;
|
|
10080
|
-
}
|
|
10081
|
-
if (typeof value !== "string") {
|
|
10082
|
-
return "[OBJECT]";
|
|
10083
|
-
}
|
|
10084
|
-
return redactValueDetectors(value);
|
|
10085
|
-
}
|
|
10086
|
-
function redactProperties(properties) {
|
|
10087
|
-
const out = {};
|
|
10088
|
-
for (const [name, value] of Object.entries(properties)) {
|
|
10089
|
-
const redacted = redactProperty(name, value);
|
|
10090
|
-
if (redacted !== undefined) {
|
|
10091
|
-
out[name] = redacted;
|
|
10092
|
-
}
|
|
10093
|
-
}
|
|
10094
|
-
return out;
|
|
10638
|
+
// ../common/src/telemetry/span-clock.ts
|
|
10639
|
+
function startSpanClock() {
|
|
10640
|
+
const started = performance.now();
|
|
10641
|
+
return {
|
|
10642
|
+
startedAt: new Date(performance.timeOrigin + started),
|
|
10643
|
+
elapsedMs: () => performance.now() - started
|
|
10644
|
+
};
|
|
10095
10645
|
}
|
|
10096
10646
|
|
|
10097
10647
|
// ../common/src/telemetry/telemetry-service.ts
|
|
10098
|
-
var TELEMETRY_OPERATION_ID_PROPERTY = "uip.trace.operation_id";
|
|
10099
|
-
var TELEMETRY_PARENT_ID_PROPERTY = "uip.trace.parent_id";
|
|
10100
|
-
var TELEMETRY_SPAN_ID_PROPERTY = "uip.trace.span_id";
|
|
10101
|
-
|
|
10102
10648
|
class TelemetryService {
|
|
10103
10649
|
telemetryProvider;
|
|
10104
10650
|
contextStorage;
|
|
@@ -10118,36 +10664,39 @@ class TelemetryService {
|
|
|
10118
10664
|
this.defaultProperties = properties === undefined ? undefined : { ...this.defaultProperties, ...properties };
|
|
10119
10665
|
}
|
|
10120
10666
|
trackEvent(name, properties) {
|
|
10121
|
-
|
|
10122
|
-
|
|
10123
|
-
|
|
10667
|
+
this.telemetryProvider.trackEvent({
|
|
10668
|
+
name: redactSpanName(name),
|
|
10669
|
+
properties: this.enrichProperties(properties),
|
|
10670
|
+
...this.leafCorrelation()
|
|
10671
|
+
});
|
|
10124
10672
|
}
|
|
10125
|
-
trackException(error, properties) {
|
|
10126
|
-
|
|
10127
|
-
|
|
10128
|
-
|
|
10673
|
+
trackException(error, properties, context) {
|
|
10674
|
+
this.telemetryProvider.trackException({
|
|
10675
|
+
error: redactError(error),
|
|
10676
|
+
properties: this.enrichProperties(properties),
|
|
10677
|
+
...this.leafCorrelation(context)
|
|
10678
|
+
});
|
|
10129
10679
|
}
|
|
10130
10680
|
async trackRequest(name, fn, properties) {
|
|
10131
|
-
const parentContext = this.
|
|
10681
|
+
const parentContext = this.getActiveContext();
|
|
10132
10682
|
const operationId = parentContext?.operationId ?? this.operationId ?? getTelemetryOperationId();
|
|
10133
10683
|
const parentId = parentContext ? parentContext.id : this.inboundParentIdFor(operationId);
|
|
10684
|
+
const clock = startSpanClock();
|
|
10134
10685
|
const context = {
|
|
10135
10686
|
operationId,
|
|
10136
10687
|
...parentId !== undefined ? { parentId } : {},
|
|
10137
|
-
id: this.generateId()
|
|
10688
|
+
id: this.generateId(),
|
|
10689
|
+
startedAt: clock.startedAt
|
|
10138
10690
|
};
|
|
10139
|
-
const startTime = performance.now();
|
|
10140
10691
|
try {
|
|
10141
10692
|
const result = await this.contextStorage.run(context, fn);
|
|
10142
|
-
const durationMs =
|
|
10143
|
-
|
|
10144
|
-
await this.telemetryProvider.trackRequest(name, durationMs, true, enrichedProperties);
|
|
10693
|
+
const durationMs = clock.elapsedMs();
|
|
10694
|
+
await this.telemetryProvider.trackRequest(this.spanFor(name, durationMs, true, properties, context));
|
|
10145
10695
|
return result;
|
|
10146
10696
|
} catch (error) {
|
|
10147
|
-
const durationMs =
|
|
10697
|
+
const durationMs = clock.elapsedMs();
|
|
10148
10698
|
const err = error instanceof Error ? error : new Error(String(error));
|
|
10149
|
-
|
|
10150
|
-
await this.telemetryProvider.trackRequest(name, durationMs, false, enrichedProperties);
|
|
10699
|
+
await this.telemetryProvider.trackRequest(this.spanFor(name, durationMs, false, { ...properties, errorMessage: err.message }, context));
|
|
10151
10700
|
throw error;
|
|
10152
10701
|
}
|
|
10153
10702
|
}
|
|
@@ -10156,8 +10705,7 @@ class TelemetryService {
|
|
|
10156
10705
|
operationId: this.operationId ?? getTelemetryOperationId(),
|
|
10157
10706
|
id: this.generateId()
|
|
10158
10707
|
};
|
|
10159
|
-
|
|
10160
|
-
this.telemetryProvider.trackRequest(name, durationMs, success, enrichedProperties);
|
|
10708
|
+
this.telemetryProvider.trackRequest(this.spanFor(name, durationMs, success, properties, requestContext));
|
|
10161
10709
|
}
|
|
10162
10710
|
createRequestContext() {
|
|
10163
10711
|
const operationId = this.operationId ?? getTelemetryOperationId();
|
|
@@ -10165,7 +10713,8 @@ class TelemetryService {
|
|
|
10165
10713
|
return {
|
|
10166
10714
|
operationId,
|
|
10167
10715
|
...parentId !== undefined ? { parentId } : {},
|
|
10168
|
-
id: this.generateId()
|
|
10716
|
+
id: this.generateId(),
|
|
10717
|
+
startedAt: startSpanClock().startedAt
|
|
10169
10718
|
};
|
|
10170
10719
|
}
|
|
10171
10720
|
inboundParentIdFor(operationId) {
|
|
@@ -10176,58 +10725,84 @@ class TelemetryService {
|
|
|
10176
10725
|
return this.contextStorage.run(context, fn);
|
|
10177
10726
|
}
|
|
10178
10727
|
createDependencyContext() {
|
|
10179
|
-
const parentContext = this.
|
|
10728
|
+
const parentContext = this.getActiveContext();
|
|
10180
10729
|
if (!parentContext) {
|
|
10181
10730
|
return;
|
|
10182
10731
|
}
|
|
10183
10732
|
return {
|
|
10184
10733
|
operationId: parentContext.operationId,
|
|
10185
10734
|
parentId: parentContext.id,
|
|
10186
|
-
id: this.generateId()
|
|
10735
|
+
id: this.generateId(),
|
|
10736
|
+
startedAt: startSpanClock().startedAt
|
|
10187
10737
|
};
|
|
10188
10738
|
}
|
|
10189
10739
|
trackDependencyResult(name, type, durationMs, success, properties, context, resultCode) {
|
|
10190
|
-
|
|
10191
|
-
|
|
10740
|
+
this.telemetryProvider.trackDependency({
|
|
10741
|
+
...this.spanFor(redactHttpDependencyName(name), durationMs, success, properties, context),
|
|
10742
|
+
type,
|
|
10743
|
+
...resultCode !== undefined ? { resultCode } : {}
|
|
10744
|
+
});
|
|
10192
10745
|
}
|
|
10193
10746
|
async trackDependencyOperation(name, type, fn, properties) {
|
|
10194
|
-
const
|
|
10747
|
+
const clock = startSpanClock();
|
|
10748
|
+
const parentContext = this.getActiveContext();
|
|
10195
10749
|
const childContext = parentContext !== undefined ? {
|
|
10196
10750
|
operationId: parentContext.operationId,
|
|
10197
10751
|
parentId: parentContext.id,
|
|
10198
|
-
id: this.generateId()
|
|
10199
|
-
|
|
10200
|
-
|
|
10752
|
+
id: this.generateId(),
|
|
10753
|
+
startedAt: clock.startedAt
|
|
10754
|
+
} : {
|
|
10755
|
+
...this.createRequestContext(),
|
|
10756
|
+
startedAt: clock.startedAt
|
|
10757
|
+
};
|
|
10201
10758
|
try {
|
|
10202
10759
|
const result = await this.contextStorage.run(childContext, fn);
|
|
10203
|
-
const durationMs =
|
|
10204
|
-
|
|
10205
|
-
|
|
10760
|
+
const durationMs = clock.elapsedMs();
|
|
10761
|
+
await this.telemetryProvider.trackDependency({
|
|
10762
|
+
...this.spanFor(name, durationMs, true, properties, childContext),
|
|
10763
|
+
type
|
|
10764
|
+
});
|
|
10206
10765
|
return result;
|
|
10207
10766
|
} catch (error) {
|
|
10208
|
-
const durationMs =
|
|
10767
|
+
const durationMs = clock.elapsedMs();
|
|
10209
10768
|
const err = error instanceof Error ? error : new Error(String(error));
|
|
10210
|
-
|
|
10211
|
-
|
|
10769
|
+
await this.telemetryProvider.trackDependency({
|
|
10770
|
+
...this.spanFor(name, durationMs, false, { ...properties, errorMessage: err.message }, childContext),
|
|
10771
|
+
type
|
|
10772
|
+
});
|
|
10212
10773
|
throw error;
|
|
10213
10774
|
}
|
|
10214
10775
|
}
|
|
10215
|
-
|
|
10776
|
+
getActiveContext() {
|
|
10216
10777
|
return this.contextStorage.getContext();
|
|
10217
10778
|
}
|
|
10218
|
-
|
|
10779
|
+
leafCorrelation(explicit) {
|
|
10780
|
+
const context = explicit ?? this.getActiveContext();
|
|
10781
|
+
return {
|
|
10782
|
+
operationId: context?.operationId ?? this.operationId ?? getTelemetryOperationId(),
|
|
10783
|
+
...context !== undefined ? { parentId: context.id } : {}
|
|
10784
|
+
};
|
|
10785
|
+
}
|
|
10786
|
+
spanFor(name, durationMs, success, properties, context) {
|
|
10787
|
+
return {
|
|
10788
|
+
name: redactSpanName(name),
|
|
10789
|
+
durationMs,
|
|
10790
|
+
success,
|
|
10791
|
+
properties: this.enrichProperties(properties),
|
|
10792
|
+
operationId: context.operationId,
|
|
10793
|
+
...context.parentId !== undefined ? { parentId: context.parentId } : {},
|
|
10794
|
+
id: context.id,
|
|
10795
|
+
...context.startedAt !== undefined ? { startedAt: context.startedAt } : {}
|
|
10796
|
+
};
|
|
10797
|
+
}
|
|
10798
|
+
enrichProperties(properties) {
|
|
10219
10799
|
const globalProperties = getGlobalTelemetryProperties();
|
|
10220
10800
|
const enriched = {
|
|
10221
10801
|
...getExecutionContextTelemetryProperties(),
|
|
10222
10802
|
...globalProperties,
|
|
10223
10803
|
...this.defaultProperties,
|
|
10224
10804
|
...redactProperties(properties ?? {}),
|
|
10225
|
-
[TELEMETRY_SESSION_SOURCE_PROPERTY]: getTelemetrySessionSource()
|
|
10226
|
-
...context ? {
|
|
10227
|
-
[TELEMETRY_OPERATION_ID_PROPERTY]: context.operationId,
|
|
10228
|
-
...context.parentId !== undefined ? { [TELEMETRY_PARENT_ID_PROPERTY]: context.parentId } : {},
|
|
10229
|
-
[TELEMETRY_SPAN_ID_PROPERTY]: context.id
|
|
10230
|
-
} : {}
|
|
10805
|
+
[TELEMETRY_SESSION_SOURCE_PROPERTY]: getTelemetrySessionSource()
|
|
10231
10806
|
};
|
|
10232
10807
|
return enriched;
|
|
10233
10808
|
}
|
|
@@ -10244,6 +10819,81 @@ class TelemetryService {
|
|
|
10244
10819
|
return hex;
|
|
10245
10820
|
}
|
|
10246
10821
|
}
|
|
10822
|
+
// ../common/src/timings.ts
|
|
10823
|
+
var TIMINGS_ENV_VAR = "UIP_TIMINGS";
|
|
10824
|
+
function createStorage2() {
|
|
10825
|
+
const [error, mod] = catchError(() => __require("node:async_hooks"));
|
|
10826
|
+
if (error || typeof mod?.AsyncLocalStorage !== "function") {
|
|
10827
|
+
return {
|
|
10828
|
+
getStore: () => {
|
|
10829
|
+
return;
|
|
10830
|
+
},
|
|
10831
|
+
run: (_store, fn) => fn()
|
|
10832
|
+
};
|
|
10833
|
+
}
|
|
10834
|
+
return new mod.AsyncLocalStorage;
|
|
10835
|
+
}
|
|
10836
|
+
var storageSlot = singleton("TimingStorage");
|
|
10837
|
+
var stateSlot = singleton("Timings");
|
|
10838
|
+
var rootStartedSlot = singleton("TimingsRootStarted");
|
|
10839
|
+
var longLivedHostSlot = singleton("TimingsLongLivedHost");
|
|
10840
|
+
var storage = storageSlot.getOrInit(createStorage2, (value) => ("getStore" in value));
|
|
10841
|
+
function newState(baseline) {
|
|
10842
|
+
return { baseline, httpMs: 0, httpCalls: 0 };
|
|
10843
|
+
}
|
|
10844
|
+
function getState() {
|
|
10845
|
+
const scoped = storage.getStore();
|
|
10846
|
+
if (scoped) {
|
|
10847
|
+
return scoped;
|
|
10848
|
+
}
|
|
10849
|
+
const pinned = livePinnedState();
|
|
10850
|
+
if (pinned !== undefined) {
|
|
10851
|
+
return pinned;
|
|
10852
|
+
}
|
|
10853
|
+
return newState(processStartIsInvocationStart() ? 0 : performance.now());
|
|
10854
|
+
}
|
|
10855
|
+
function livePinnedState() {
|
|
10856
|
+
const pinned = stateSlot.get();
|
|
10857
|
+
return pinned !== undefined && "httpCalls" in pinned && !pinned.finished ? pinned : undefined;
|
|
10858
|
+
}
|
|
10859
|
+
function processStartIsInvocationStart() {
|
|
10860
|
+
return !rootStartedSlot.get(false) && !longLivedHostSlot.get(false);
|
|
10861
|
+
}
|
|
10862
|
+
function timingsEnabled() {
|
|
10863
|
+
if (typeof process === "undefined") {
|
|
10864
|
+
return false;
|
|
10865
|
+
}
|
|
10866
|
+
const value = process.env?.[TIMINGS_ENV_VAR];
|
|
10867
|
+
if (value === undefined) {
|
|
10868
|
+
return false;
|
|
10869
|
+
}
|
|
10870
|
+
const normalized = value.trim().toLowerCase();
|
|
10871
|
+
return normalized === "1" || normalized === "true";
|
|
10872
|
+
}
|
|
10873
|
+
function recordExitCode(exitCode) {
|
|
10874
|
+
if (!timingsEnabled()) {
|
|
10875
|
+
return;
|
|
10876
|
+
}
|
|
10877
|
+
getState().exitCode = exitCode;
|
|
10878
|
+
}
|
|
10879
|
+
function invocationStartedAt() {
|
|
10880
|
+
return new Date(performance.timeOrigin + getState().baseline);
|
|
10881
|
+
}
|
|
10882
|
+
function invocationElapsedMs() {
|
|
10883
|
+
return performance.now() - getState().baseline;
|
|
10884
|
+
}
|
|
10885
|
+
function markCommandStart() {
|
|
10886
|
+
if (!timingsEnabled()) {
|
|
10887
|
+
return;
|
|
10888
|
+
}
|
|
10889
|
+
getState().commandStart = performance.now();
|
|
10890
|
+
}
|
|
10891
|
+
function recordCommandDuration(durationMs) {
|
|
10892
|
+
if (!timingsEnabled()) {
|
|
10893
|
+
return;
|
|
10894
|
+
}
|
|
10895
|
+
getState().commandMs = durationMs;
|
|
10896
|
+
}
|
|
10247
10897
|
// ../common/src/telemetry/proxy-http-agent.ts
|
|
10248
10898
|
var slot = singleton("ProxyAuthHttpsAgent");
|
|
10249
10899
|
|
|
@@ -10264,6 +10914,9 @@ function getGlobalTelemetryInstance() {
|
|
|
10264
10914
|
}
|
|
10265
10915
|
return;
|
|
10266
10916
|
}
|
|
10917
|
+
function setGlobalTelemetryInstance(instance) {
|
|
10918
|
+
telemetryInstanceSlot.set(instance);
|
|
10919
|
+
}
|
|
10267
10920
|
var _localTelemetryInstance;
|
|
10268
10921
|
function getTelemetryInstance() {
|
|
10269
10922
|
const global = getGlobalTelemetryInstance();
|
|
@@ -10271,6 +10924,7 @@ function getTelemetryInstance() {
|
|
|
10271
10924
|
return global;
|
|
10272
10925
|
if (!_localTelemetryInstance) {
|
|
10273
10926
|
_localTelemetryInstance = new TelemetryService(new LoggerTelemetryProvider, new NodeContextStorage);
|
|
10927
|
+
setGlobalTelemetryInstance(_localTelemetryInstance);
|
|
10274
10928
|
}
|
|
10275
10929
|
return _localTelemetryInstance;
|
|
10276
10930
|
}
|
|
@@ -10283,6 +10937,14 @@ var telemetry = new Proxy({}, {
|
|
|
10283
10937
|
});
|
|
10284
10938
|
|
|
10285
10939
|
// ../common/src/formatter.ts
|
|
10940
|
+
var ANSI_STYLES = {
|
|
10941
|
+
red: "\x1B[31m",
|
|
10942
|
+
dim: "\x1B[2m"
|
|
10943
|
+
};
|
|
10944
|
+
var ANSI_RESET = "\x1B[0m";
|
|
10945
|
+
function styleLine(line, style) {
|
|
10946
|
+
return style ? `${ANSI_STYLES[style]}${line}${ANSI_RESET}` : line;
|
|
10947
|
+
}
|
|
10286
10948
|
var CLI_ERROR_CODES = [
|
|
10287
10949
|
"invalid_argument",
|
|
10288
10950
|
"authentication_required",
|
|
@@ -10321,22 +10983,6 @@ var EXIT_CODES = {
|
|
|
10321
10983
|
ValidationError: 3,
|
|
10322
10984
|
TimeoutError: 4
|
|
10323
10985
|
};
|
|
10324
|
-
class SuccessOutput {
|
|
10325
|
-
Result = RESULTS.Success;
|
|
10326
|
-
Code;
|
|
10327
|
-
Data;
|
|
10328
|
-
Pagination;
|
|
10329
|
-
Instructions;
|
|
10330
|
-
Log;
|
|
10331
|
-
constructor(code, data) {
|
|
10332
|
-
this.Code = code;
|
|
10333
|
-
this.Data = data;
|
|
10334
|
-
const logPath = getLogFilePath();
|
|
10335
|
-
if (logPath) {
|
|
10336
|
-
this.Log = logPath;
|
|
10337
|
-
}
|
|
10338
|
-
}
|
|
10339
|
-
}
|
|
10340
10986
|
function escapeNonAscii(jsonText) {
|
|
10341
10987
|
return jsonText.replace(/[\u0080-\uffff]/g, (c) => {
|
|
10342
10988
|
const hex = c.charCodeAt(0).toString(16).padStart(4, "0");
|
|
@@ -10401,19 +11047,45 @@ function toPascalCaseKey(key) {
|
|
|
10401
11047
|
const lowerCamelKey = toLowerCamelCaseKey(key);
|
|
10402
11048
|
return lowerCamelKey ? lowerCamelKey.charAt(0).toUpperCase() + lowerCamelKey.slice(1) : lowerCamelKey;
|
|
10403
11049
|
}
|
|
10404
|
-
function
|
|
11050
|
+
function collectVerbatimRefs(value, into) {
|
|
11051
|
+
if (typeof value !== "object" || value === null)
|
|
11052
|
+
return;
|
|
11053
|
+
if (into.has(value))
|
|
11054
|
+
return;
|
|
11055
|
+
into.add(value);
|
|
11056
|
+
for (const nested of Array.isArray(value) ? value : Object.values(value)) {
|
|
11057
|
+
collectVerbatimRefs(nested, into);
|
|
11058
|
+
}
|
|
11059
|
+
}
|
|
11060
|
+
function toPascalCaseData(value, verbatimKeys, subtrees) {
|
|
11061
|
+
if (subtrees?.mode === "skip" && typeof value === "object" && value !== null && subtrees.refs.has(value)) {
|
|
11062
|
+
return value;
|
|
11063
|
+
}
|
|
10405
11064
|
if (Array.isArray(value))
|
|
10406
|
-
return value.map(toPascalCaseData);
|
|
11065
|
+
return value.map((entry) => toPascalCaseData(entry, verbatimKeys, subtrees));
|
|
10407
11066
|
if (!isPlainRecord(value))
|
|
10408
11067
|
return value;
|
|
10409
11068
|
const result = {};
|
|
10410
11069
|
for (const [key, nestedValue] of Object.entries(value)) {
|
|
10411
|
-
|
|
11070
|
+
const pascalKey = toPascalCaseKey(key);
|
|
11071
|
+
if (verbatimKeys?.has(pascalKey)) {
|
|
11072
|
+
result[pascalKey] = nestedValue;
|
|
11073
|
+
if (subtrees?.mode === "collect") {
|
|
11074
|
+
collectVerbatimRefs(nestedValue, subtrees.refs);
|
|
11075
|
+
}
|
|
11076
|
+
continue;
|
|
11077
|
+
}
|
|
11078
|
+
result[pascalKey] = toPascalCaseData(nestedValue, verbatimKeys, subtrees);
|
|
10412
11079
|
}
|
|
10413
11080
|
return result;
|
|
10414
11081
|
}
|
|
10415
|
-
function normalizeDataKeys(data) {
|
|
10416
|
-
return toPascalCaseData(data);
|
|
11082
|
+
function normalizeDataKeys(data, verbatimKeys, subtrees) {
|
|
11083
|
+
return toPascalCaseData(data, verbatimKeys, subtrees);
|
|
11084
|
+
}
|
|
11085
|
+
function toVerbatimKeySet(preserve) {
|
|
11086
|
+
if (!Array.isArray(preserve))
|
|
11087
|
+
return;
|
|
11088
|
+
return new Set(preserve.map(toPascalCaseKey));
|
|
10417
11089
|
}
|
|
10418
11090
|
function normalizeOutputKeys(data) {
|
|
10419
11091
|
const result = {};
|
|
@@ -10423,7 +11095,7 @@ function normalizeOutputKeys(data) {
|
|
|
10423
11095
|
}
|
|
10424
11096
|
return result;
|
|
10425
11097
|
}
|
|
10426
|
-
function printOutput(data, format = "json", logFn, asciiSafe = false) {
|
|
11098
|
+
function printOutput(data, format = "json", logFn, asciiSafe = false, tableRowStyle) {
|
|
10427
11099
|
if (!data) {
|
|
10428
11100
|
logFn("Empty response object. No data to display.");
|
|
10429
11101
|
return;
|
|
@@ -10458,7 +11130,7 @@ function printOutput(data, format = "json", logFn, asciiSafe = false) {
|
|
|
10458
11130
|
if (hasData && !(rows !== null && rows.length === 0)) {
|
|
10459
11131
|
const logValue = data.Log;
|
|
10460
11132
|
if (rows !== null) {
|
|
10461
|
-
printResizableTable(rows, logFn, logValue);
|
|
11133
|
+
printResizableTable(rows, logFn, logValue, undefined, tableRowStyle);
|
|
10462
11134
|
} else {
|
|
10463
11135
|
printVerticalTable(data.Data, logFn, logValue);
|
|
10464
11136
|
}
|
|
@@ -10469,10 +11141,11 @@ function printOutput(data, format = "json", logFn, asciiSafe = false) {
|
|
|
10469
11141
|
}
|
|
10470
11142
|
}
|
|
10471
11143
|
}
|
|
10472
|
-
function logOutput(data, format = "json") {
|
|
11144
|
+
function logOutput(data, format = "json", tableRowStyle) {
|
|
10473
11145
|
const sink = getOutputSink();
|
|
11146
|
+
const styleFn = sink.capabilities.isInteractive && sink.capabilities.supportsColor ? tableRowStyle : undefined;
|
|
10474
11147
|
printOutput(data, format, (msg) => sink.writeOut(`${msg}
|
|
10475
|
-
`), needsAsciiSafeJson(sink));
|
|
11148
|
+
`), needsAsciiSafeJson(sink), styleFn);
|
|
10476
11149
|
}
|
|
10477
11150
|
function cellToString(val) {
|
|
10478
11151
|
return val != null && typeof val === "object" ? JSON.stringify(val) : String(val ?? "");
|
|
@@ -10486,7 +11159,7 @@ function wrapText(text, width) {
|
|
|
10486
11159
|
}
|
|
10487
11160
|
return lines;
|
|
10488
11161
|
}
|
|
10489
|
-
function printTable(data, logFn, externalLogValue) {
|
|
11162
|
+
function printTable(data, logFn, externalLogValue, tableRowStyle) {
|
|
10490
11163
|
if (data.length === 0)
|
|
10491
11164
|
return;
|
|
10492
11165
|
const keys = Object.keys(data[0]).filter((key) => !["code", "log"].includes(key.toLowerCase()));
|
|
@@ -10496,7 +11169,7 @@ function printTable(data, logFn, externalLogValue) {
|
|
|
10496
11169
|
logFn(keys.map((_, i) => "-".repeat(maxWidths[i])).join("-|-"));
|
|
10497
11170
|
data.forEach((item) => {
|
|
10498
11171
|
const row = keys.map((key, i) => cellToString(item[key]).padEnd(maxWidths[i])).join(" | ");
|
|
10499
|
-
logFn(row);
|
|
11172
|
+
logFn(styleLine(row, tableRowStyle?.(item)));
|
|
10500
11173
|
});
|
|
10501
11174
|
if (externalLogValue) {
|
|
10502
11175
|
logFn("");
|
|
@@ -10539,14 +11212,14 @@ function printVerticalTable(data, logFn = console.log, externalLogValue) {
|
|
|
10539
11212
|
logFn(`Log: ${externalLogValue}`);
|
|
10540
11213
|
}
|
|
10541
11214
|
}
|
|
10542
|
-
function printResizableTable(data, logFn = console.log, externalLogValue, availableWidth) {
|
|
11215
|
+
function printResizableTable(data, logFn = console.log, externalLogValue, availableWidth, tableRowStyle) {
|
|
10543
11216
|
if (data.length === 0)
|
|
10544
11217
|
return;
|
|
10545
11218
|
const keys = Object.keys(data[0]).filter((key) => !["code", "log"].includes(key.toLowerCase()));
|
|
10546
11219
|
if (keys.length === 0)
|
|
10547
11220
|
return;
|
|
10548
11221
|
if (!process.stdout.isTTY) {
|
|
10549
|
-
printTable(data, logFn, externalLogValue);
|
|
11222
|
+
printTable(data, logFn, externalLogValue, tableRowStyle);
|
|
10550
11223
|
return;
|
|
10551
11224
|
}
|
|
10552
11225
|
const naturalWidths = keys.map((key) => Math.max(key.length, ...data.map((item) => cellToString(item[key]).length)));
|
|
@@ -10554,7 +11227,7 @@ function printResizableTable(data, logFn = console.log, externalLogValue, availa
|
|
|
10554
11227
|
const totalWidth = naturalWidths.reduce((a, b) => a + b, 0) + separatorTotal;
|
|
10555
11228
|
const termWidth = availableWidth ?? (process.stdout.columns || 120);
|
|
10556
11229
|
if (totalWidth <= termWidth) {
|
|
10557
|
-
printTable(data, logFn, externalLogValue);
|
|
11230
|
+
printTable(data, logFn, externalLogValue, tableRowStyle);
|
|
10558
11231
|
return;
|
|
10559
11232
|
}
|
|
10560
11233
|
const overflow = totalWidth - termWidth;
|
|
@@ -10600,6 +11273,7 @@ function printResizableTable(data, logFn = console.log, externalLogValue, availa
|
|
|
10600
11273
|
logFn(header);
|
|
10601
11274
|
logFn(keys.map((_, i) => "-".repeat(finalWidths[i])).join("-|-"));
|
|
10602
11275
|
data.forEach((item) => {
|
|
11276
|
+
const style = tableRowStyle?.(item);
|
|
10603
11277
|
const cellLines = keys.map((key, i) => wrapText(cellToString(item[key]), finalWidths[i]));
|
|
10604
11278
|
const lineCount = Math.max(...cellLines.map((l) => l.length));
|
|
10605
11279
|
for (let line = 0;line < lineCount; line++) {
|
|
@@ -10607,7 +11281,7 @@ function printResizableTable(data, logFn = console.log, externalLogValue, availa
|
|
|
10607
11281
|
const val = line < cellLines[i].length ? cellLines[i][line] : "";
|
|
10608
11282
|
return val.padEnd(finalWidths[i]);
|
|
10609
11283
|
}).join(" | ");
|
|
10610
|
-
logFn(row);
|
|
11284
|
+
logFn(styleLine(row, style));
|
|
10611
11285
|
}
|
|
10612
11286
|
});
|
|
10613
11287
|
if (externalLogValue) {
|
|
@@ -10751,30 +11425,36 @@ var OutputFormatter;
|
|
|
10751
11425
|
((OutputFormatter) => {
|
|
10752
11426
|
function success(data, options) {
|
|
10753
11427
|
data.Log ??= getLogFilePath() || undefined;
|
|
10754
|
-
const normalize =
|
|
11428
|
+
const normalize = options?.preserveDataKeys !== true;
|
|
11429
|
+
const verbatim = toVerbatimKeySet(options?.preserveDataKeys);
|
|
11430
|
+
const subtrees = verbatim && {
|
|
11431
|
+
refs: new Set,
|
|
11432
|
+
mode: "collect"
|
|
11433
|
+
};
|
|
10755
11434
|
if (normalize) {
|
|
10756
|
-
data.Data = normalizeDataKeys(data.Data);
|
|
11435
|
+
data.Data = normalizeDataKeys(data.Data, verbatim, subtrees);
|
|
10757
11436
|
}
|
|
10758
11437
|
const filter = getOutputFilter();
|
|
10759
11438
|
if (filter) {
|
|
10760
11439
|
const filtered = applyFilter(data.Data, filter);
|
|
10761
|
-
data.Data = normalize ? normalizeDataKeys(filtered) : filtered;
|
|
11440
|
+
data.Data = normalize ? normalizeDataKeys(filtered, verbatim, subtrees && { refs: subtrees.refs, mode: "skip" }) : filtered;
|
|
10762
11441
|
}
|
|
10763
|
-
logOutput(normalizeOutputKeys(data), getOutputFormat());
|
|
11442
|
+
logOutput(normalizeOutputKeys(data), getOutputFormat(), options?.tableRowStyle);
|
|
10764
11443
|
}
|
|
10765
11444
|
OutputFormatter.success = success;
|
|
10766
11445
|
function error(data) {
|
|
10767
11446
|
data.Log ??= getLogFilePath() || undefined;
|
|
10768
11447
|
data.ErrorCode ??= defaultErrorCodeForFailure(data);
|
|
10769
11448
|
data.Retry ??= defaultRetryForErrorCode(data.ErrorCode);
|
|
10770
|
-
|
|
11449
|
+
const exitCode = EXIT_CODES[data.Result] ?? 1;
|
|
11450
|
+
setExitCode(exitCode);
|
|
10771
11451
|
recordCommandFailureTelemetry({
|
|
10772
11452
|
result: data.Result,
|
|
10773
11453
|
errorCode: data.ErrorCode,
|
|
10774
11454
|
retry: data.Retry,
|
|
10775
11455
|
message: data.Message,
|
|
10776
11456
|
context: data.Context,
|
|
10777
|
-
exitCode
|
|
11457
|
+
exitCode,
|
|
10778
11458
|
errorClass: data.TelemetryErrorClass,
|
|
10779
11459
|
terminalOutcome: data.TelemetryTerminalOutcome,
|
|
10780
11460
|
terminalSignal: data.TelemetryTerminalSignal
|
|
@@ -10848,8 +11528,41 @@ var OutputFormatter;
|
|
|
10848
11528
|
return lines.join(`
|
|
10849
11529
|
`);
|
|
10850
11530
|
}
|
|
10851
|
-
OutputFormatter.formatToString = formatToString;
|
|
10852
|
-
})(OutputFormatter ||= {});
|
|
11531
|
+
OutputFormatter.formatToString = formatToString;
|
|
11532
|
+
})(OutputFormatter ||= {});
|
|
11533
|
+
// ../../node_modules/commander/esm.mjs
|
|
11534
|
+
var import__ = __toESM(require_commander(), 1);
|
|
11535
|
+
var {
|
|
11536
|
+
program,
|
|
11537
|
+
createCommand,
|
|
11538
|
+
createArgument,
|
|
11539
|
+
createOption,
|
|
11540
|
+
CommanderError,
|
|
11541
|
+
InvalidArgumentError,
|
|
11542
|
+
InvalidOptionArgumentError,
|
|
11543
|
+
Command,
|
|
11544
|
+
Argument,
|
|
11545
|
+
Option,
|
|
11546
|
+
Help
|
|
11547
|
+
} = import__.default;
|
|
11548
|
+
|
|
11549
|
+
// ../common/src/command-examples.ts
|
|
11550
|
+
var examplesByCommand = new WeakMap;
|
|
11551
|
+
Command.prototype.examples = function(examples) {
|
|
11552
|
+
examplesByCommand.set(this, examples);
|
|
11553
|
+
return this;
|
|
11554
|
+
};
|
|
11555
|
+
// ../common/src/preview.ts
|
|
11556
|
+
var previewSlot = singleton("PreviewBuild");
|
|
11557
|
+
function isPreviewBuild() {
|
|
11558
|
+
return previewSlot.get(false) ?? false;
|
|
11559
|
+
}
|
|
11560
|
+
Command.prototype.previewCommand = function(nameAndArgs, opts) {
|
|
11561
|
+
if (isPreviewBuild()) {
|
|
11562
|
+
return this.command(nameAndArgs, opts);
|
|
11563
|
+
}
|
|
11564
|
+
return new Command(nameAndArgs.split(/\s+/)[0] ?? nameAndArgs);
|
|
11565
|
+
};
|
|
10853
11566
|
|
|
10854
11567
|
// ../common/src/telemetry/command-attribution.ts
|
|
10855
11568
|
var LEGACY_SKILL_NAMESPACE = "uipath:";
|
|
@@ -11004,6 +11717,57 @@ function buildCommandTelemetryAttribution(commandPath, skillSource) {
|
|
|
11004
11717
|
};
|
|
11005
11718
|
}
|
|
11006
11719
|
|
|
11720
|
+
// ../common/src/telemetry/command-name.ts
|
|
11721
|
+
var TELEMETRY_COMMAND_ROOT = "uip";
|
|
11722
|
+
function commandTelemetryName(parts) {
|
|
11723
|
+
const tokens = [];
|
|
11724
|
+
for (const part of parts) {
|
|
11725
|
+
const pieces = String(part ?? "").split(/\s+/).filter((token) => token && !token.startsWith("-") && token !== TELEMETRY_COMMAND_ROOT);
|
|
11726
|
+
if (pieces.every(isCommandToken)) {
|
|
11727
|
+
tokens.push(...pieces);
|
|
11728
|
+
continue;
|
|
11729
|
+
}
|
|
11730
|
+
tokens.push(UNKNOWN_TOKEN);
|
|
11731
|
+
}
|
|
11732
|
+
return [TELEMETRY_COMMAND_ROOT, ...tokens].join(".");
|
|
11733
|
+
}
|
|
11734
|
+
var COMMAND_TOKEN_PATTERN = /^[a-z0-9][a-z0-9-]*$/;
|
|
11735
|
+
var MAX_COMMAND_TOKEN_LENGTH = 32;
|
|
11736
|
+
var GUID_TOKEN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
|
|
11737
|
+
function isCommandToken(token) {
|
|
11738
|
+
return token.length <= MAX_COMMAND_TOKEN_LENGTH && COMMAND_TOKEN_PATTERN.test(token) && !GUID_TOKEN.test(token) && !/^\d+$/.test(token);
|
|
11739
|
+
}
|
|
11740
|
+
var UNKNOWN_TOKEN = "<unknown>";
|
|
11741
|
+
|
|
11742
|
+
// ../common/src/telemetry/invocation-request.ts
|
|
11743
|
+
var requestContextSlot = singleton("TelemetryInvocationRequestContext");
|
|
11744
|
+
function activeContext() {
|
|
11745
|
+
return telemetry.getActiveContext?.();
|
|
11746
|
+
}
|
|
11747
|
+
function runWithInvocationRequest(fn) {
|
|
11748
|
+
const context = telemetry.createRequestContext();
|
|
11749
|
+
context.startedAt = invocationStartedAt();
|
|
11750
|
+
requestContextSlot.set(context);
|
|
11751
|
+
return telemetry.runWithContext(context, fn);
|
|
11752
|
+
}
|
|
11753
|
+
function ensureInvocationRequestScope(fn) {
|
|
11754
|
+
if (activeContext() !== undefined) {
|
|
11755
|
+
return fn();
|
|
11756
|
+
}
|
|
11757
|
+
const kept = requestContextSlot.get();
|
|
11758
|
+
return kept === undefined ? runWithInvocationRequest(fn) : telemetry.runWithContext(kept, fn);
|
|
11759
|
+
}
|
|
11760
|
+
function getInvocationRequestContext() {
|
|
11761
|
+
return activeContext() ?? requestContextSlot.get();
|
|
11762
|
+
}
|
|
11763
|
+
function emitInvocationRequest(name, success, properties) {
|
|
11764
|
+
const context = getInvocationRequestContext();
|
|
11765
|
+
telemetry.trackRequestResult(name, invocationElapsedMs(), success, properties, context);
|
|
11766
|
+
if (context !== undefined && requestContextSlot.get() === context) {
|
|
11767
|
+
requestContextSlot.clear();
|
|
11768
|
+
}
|
|
11769
|
+
}
|
|
11770
|
+
|
|
11007
11771
|
// ../common/src/trackedAction.ts
|
|
11008
11772
|
var pollSignalSlot = singleton("PollSignal");
|
|
11009
11773
|
var cliErrorCodeValues = new Set(CLI_ERROR_CODES);
|
|
@@ -11011,28 +11775,74 @@ var retryHintValues = new Set(RETRY_HINTS);
|
|
|
11011
11775
|
var TELEMETRY_COMMAND_ARG_PREFIX = "uip.cmd.arg.";
|
|
11012
11776
|
var processContext = {
|
|
11013
11777
|
exit: (code) => {
|
|
11014
|
-
|
|
11778
|
+
recordExitCode(code);
|
|
11779
|
+
setExitCode(code);
|
|
11015
11780
|
},
|
|
11016
11781
|
get pollSignal() {
|
|
11017
11782
|
return pollSignalSlot.get();
|
|
11018
11783
|
}
|
|
11019
11784
|
};
|
|
11785
|
+
var TELEMETRY_ARG_VALUE_WITHHELD = "<provided>";
|
|
11786
|
+
var TELEMETRY_ARG_VALUE_DEFAULTED = "<default>";
|
|
11787
|
+
function recordableArgValue(value, choices) {
|
|
11788
|
+
if (typeof value === "boolean" || typeof value === "number") {
|
|
11789
|
+
return value;
|
|
11790
|
+
}
|
|
11791
|
+
if (choices && choices.length > 0) {
|
|
11792
|
+
if (typeof value === "string" && choices.includes(value)) {
|
|
11793
|
+
return value;
|
|
11794
|
+
}
|
|
11795
|
+
if (Array.isArray(value) && value.length > 0 && value.every((entry) => typeof entry === "string" && choices.includes(entry))) {
|
|
11796
|
+
return value.join(",");
|
|
11797
|
+
}
|
|
11798
|
+
}
|
|
11799
|
+
return TELEMETRY_ARG_VALUE_WITHHELD;
|
|
11800
|
+
}
|
|
11020
11801
|
function extractCommandParams(cmd) {
|
|
11021
11802
|
const params = {};
|
|
11022
|
-
|
|
11023
|
-
|
|
11024
|
-
|
|
11025
|
-
|
|
11026
|
-
|
|
11803
|
+
forEachSuppliedArgument(cmd, (name, value, choices, defaulted) => {
|
|
11804
|
+
const recordable = recordableArgValue(value, choices);
|
|
11805
|
+
params[`${TELEMETRY_COMMAND_ARG_PREFIX}${name}`] = recordable === TELEMETRY_ARG_VALUE_WITHHELD && defaulted ? TELEMETRY_ARG_VALUE_DEFAULTED : recordable;
|
|
11806
|
+
});
|
|
11807
|
+
return params;
|
|
11808
|
+
}
|
|
11809
|
+
function isDefaultedOption(cmd, name) {
|
|
11810
|
+
const source = cmd.getOptionValueSource?.(name);
|
|
11811
|
+
return source === "default" || source === "implied";
|
|
11812
|
+
}
|
|
11813
|
+
function isDefaultedPositional(cmd, index) {
|
|
11814
|
+
return index >= (cmd.args?.length ?? 0);
|
|
11815
|
+
}
|
|
11816
|
+
function forEachSuppliedArgument(cmd, visit) {
|
|
11027
11817
|
const registered = cmd.registeredArguments ?? [];
|
|
11028
11818
|
const processed = cmd.processedArgs ?? [];
|
|
11029
11819
|
for (let i = 0;i < registered.length; i++) {
|
|
11030
|
-
|
|
11820
|
+
const name = registered[i].name();
|
|
11821
|
+
if (name && processed[i] !== undefined) {
|
|
11822
|
+
visit(name, processed[i], registered[i].argChoices, isDefaultedPositional(cmd, i));
|
|
11823
|
+
}
|
|
11824
|
+
}
|
|
11825
|
+
const choicesByAttribute = new Map;
|
|
11826
|
+
for (const option of cmd.options) {
|
|
11827
|
+
choicesByAttribute.set(option.attributeName(), option.argChoices);
|
|
11031
11828
|
}
|
|
11032
11829
|
for (const [key, value] of Object.entries(cmd.opts())) {
|
|
11033
|
-
|
|
11830
|
+
if (key && value !== undefined) {
|
|
11831
|
+
visit(key, value, choicesByAttribute.get(key), isDefaultedOption(cmd, key));
|
|
11832
|
+
}
|
|
11034
11833
|
}
|
|
11035
|
-
|
|
11834
|
+
}
|
|
11835
|
+
function withheldArgumentValues(cmd) {
|
|
11836
|
+
const values = [];
|
|
11837
|
+
forEachSuppliedArgument(cmd, (_name, value, choices, defaulted) => {
|
|
11838
|
+
if (defaulted) {
|
|
11839
|
+
return;
|
|
11840
|
+
}
|
|
11841
|
+
if (recordableArgValue(value, choices) === TELEMETRY_ARG_VALUE_WITHHELD) {
|
|
11842
|
+
values.push(value);
|
|
11843
|
+
}
|
|
11844
|
+
});
|
|
11845
|
+
return values;
|
|
11036
11846
|
}
|
|
11037
11847
|
function deriveCommandPath(cmd) {
|
|
11038
11848
|
const parts = [];
|
|
@@ -11047,7 +11857,7 @@ function deriveCommandPath(cmd) {
|
|
|
11047
11857
|
if (parts.length > 1) {
|
|
11048
11858
|
parts.shift();
|
|
11049
11859
|
}
|
|
11050
|
-
return
|
|
11860
|
+
return commandTelemetryName(parts);
|
|
11051
11861
|
}
|
|
11052
11862
|
function isCliErrorCode(value) {
|
|
11053
11863
|
return typeof value === "string" && cliErrorCodeValues.has(value);
|
|
@@ -11087,68 +11897,77 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
11087
11897
|
});
|
|
11088
11898
|
const telemetryName = deriveCommandPath(command);
|
|
11089
11899
|
const props = typeof properties === "function" ? properties(...args) : properties;
|
|
11090
|
-
|
|
11091
|
-
const
|
|
11092
|
-
|
|
11093
|
-
|
|
11094
|
-
|
|
11095
|
-
|
|
11096
|
-
|
|
11097
|
-
|
|
11098
|
-
|
|
11099
|
-
|
|
11100
|
-
|
|
11101
|
-
|
|
11102
|
-
|
|
11103
|
-
|
|
11104
|
-
|
|
11105
|
-
|
|
11106
|
-
|
|
11107
|
-
|
|
11108
|
-
|
|
11109
|
-
|
|
11110
|
-
|
|
11111
|
-
|
|
11112
|
-
|
|
11113
|
-
|
|
11114
|
-
|
|
11115
|
-
|
|
11116
|
-
|
|
11117
|
-
|
|
11118
|
-
|
|
11119
|
-
|
|
11120
|
-
|
|
11121
|
-
|
|
11122
|
-
|
|
11123
|
-
|
|
11900
|
+
markCommandStart();
|
|
11901
|
+
const supplied = recordSuppliedArgumentValues(withheldArgumentValues(command));
|
|
11902
|
+
try {
|
|
11903
|
+
const startTime = performance.now();
|
|
11904
|
+
let errorMessage;
|
|
11905
|
+
let fallbackExitCode = EXIT_CODES.Success;
|
|
11906
|
+
clearRecordedCommandFailureTelemetry();
|
|
11907
|
+
const [error] = await catchError(ensureInvocationRequestScope(() => {
|
|
11908
|
+
const violation = implicitLimitViolation(command);
|
|
11909
|
+
if (violation) {
|
|
11910
|
+
return Promise.reject(violation);
|
|
11911
|
+
}
|
|
11912
|
+
return fn(...args);
|
|
11913
|
+
}));
|
|
11914
|
+
if (error) {
|
|
11915
|
+
errorMessage = error instanceof Error ? error.message : String(error);
|
|
11916
|
+
logger.debug(`[trackedAction] ${telemetryName} failed: ${errorMessage}`);
|
|
11917
|
+
const typed = error;
|
|
11918
|
+
const customInstructions = typeof typed.instructions === "string" ? typed.instructions : undefined;
|
|
11919
|
+
const customResult = typeof typed.result === "string" && typed.result !== RESULTS.Success && Object.values(RESULTS).includes(typed.result) ? typed.result : undefined;
|
|
11920
|
+
const finalResult = customResult ?? RESULTS.Failure;
|
|
11921
|
+
const typedErrorCode = typed.errorCode ?? typed.ErrorCode;
|
|
11922
|
+
const customErrorCode = isCliErrorCode(typedErrorCode) ? typedErrorCode : undefined;
|
|
11923
|
+
const typedRetry = typed.retry ?? typed.Retry;
|
|
11924
|
+
const customRetry = isRetryHint(typedRetry) ? typedRetry : undefined;
|
|
11925
|
+
const typedContext = typed.context ?? typed.Context;
|
|
11926
|
+
const customContext = isErrorContext(typedContext) ? typedContext : undefined;
|
|
11927
|
+
const cancellationExitCode = typed.exitCode === 130 || isPromptCancellation(error) ? 130 : undefined;
|
|
11928
|
+
fallbackExitCode = cancellationExitCode ?? EXIT_CODES[finalResult];
|
|
11929
|
+
OutputFormatter.error({
|
|
11930
|
+
Result: finalResult,
|
|
11931
|
+
...customErrorCode ? { ErrorCode: customErrorCode } : {},
|
|
11932
|
+
Message: errorMessage,
|
|
11933
|
+
Instructions: customInstructions ?? commandHelpHint(telemetryName),
|
|
11934
|
+
...customRetry ? { Retry: customRetry } : {},
|
|
11935
|
+
...customContext ? { Context: customContext } : {}
|
|
11936
|
+
});
|
|
11937
|
+
context.exit(fallbackExitCode);
|
|
11938
|
+
}
|
|
11939
|
+
const durationMs = performance.now() - startTime;
|
|
11940
|
+
recordCommandDuration(durationMs);
|
|
11941
|
+
const exitCode = fallbackExitCode === 130 ? fallbackExitCode : exitCodeFromProcess(fallbackExitCode);
|
|
11942
|
+
const recordedFailure = takeRecordedCommandFailureTelemetry();
|
|
11943
|
+
const success = !error && exitCode === 0;
|
|
11944
|
+
const terminalTelemetry = buildCommandTerminalTelemetryProperties({
|
|
11945
|
+
error,
|
|
11946
|
+
exitCode,
|
|
11947
|
+
recordedFailure,
|
|
11948
|
+
pollSignal: context.pollSignal
|
|
11124
11949
|
});
|
|
11125
|
-
|
|
11126
|
-
|
|
11127
|
-
|
|
11128
|
-
|
|
11129
|
-
|
|
11130
|
-
|
|
11131
|
-
|
|
11132
|
-
|
|
11133
|
-
|
|
11134
|
-
|
|
11135
|
-
|
|
11136
|
-
|
|
11137
|
-
|
|
11138
|
-
|
|
11139
|
-
|
|
11140
|
-
|
|
11141
|
-
}
|
|
11142
|
-
|
|
11143
|
-
|
|
11144
|
-
|
|
11145
|
-
|
|
11146
|
-
...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
|
|
11147
|
-
command: "true",
|
|
11148
|
-
...terminalTelemetry,
|
|
11149
|
-
...errorMessage ? { errorMessage } : {}
|
|
11150
|
-
});
|
|
11151
|
-
telemetry.trackRequestResult(telemetryName, durationMs, success, baseProperties, requestContext);
|
|
11950
|
+
if (terminalTelemetry.error_class === "internal" && error) {
|
|
11951
|
+
telemetry.trackException(error instanceof Error ? error : new Error(String(error)), { command_name: telemetryName }, getInvocationRequestContext());
|
|
11952
|
+
}
|
|
11953
|
+
const commandParams = extractCommandParams(command);
|
|
11954
|
+
if (props) {
|
|
11955
|
+
for (const key of Object.keys(props)) {
|
|
11956
|
+
delete commandParams[`${TELEMETRY_COMMAND_ARG_PREFIX}${key}`];
|
|
11957
|
+
}
|
|
11958
|
+
}
|
|
11959
|
+
const baseProperties = redactProperties({
|
|
11960
|
+
...commandParams,
|
|
11961
|
+
...props,
|
|
11962
|
+
...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
|
|
11963
|
+
command: "true",
|
|
11964
|
+
...terminalTelemetry,
|
|
11965
|
+
...errorMessage ? { errorMessage } : {}
|
|
11966
|
+
});
|
|
11967
|
+
emitInvocationRequest(telemetryName, success, baseProperties);
|
|
11968
|
+
} finally {
|
|
11969
|
+
releaseSuppliedArgumentValues(supplied);
|
|
11970
|
+
}
|
|
11152
11971
|
});
|
|
11153
11972
|
};
|
|
11154
11973
|
// ../common/src/completer.ts
|
|
@@ -11158,6 +11977,204 @@ var guardInstalledSlot = singleton("ConsoleGuardInstalled");
|
|
|
11158
11977
|
var savedOriginalsSlot = singleton("ConsoleGuardOriginals");
|
|
11159
11978
|
// ../common/src/constants.ts
|
|
11160
11979
|
var DEFAULT_AUTH_TIMEOUT_MS = 5 * 60 * 1000;
|
|
11980
|
+
// ../common/src/entity-name-rules.ts
|
|
11981
|
+
var RESERVED_SQL_KEYWORDS_LOWER = new Set(["group", "order"]);
|
|
11982
|
+
var RESERVED_FIELD_NAMES_LOWER = new Set([
|
|
11983
|
+
"id",
|
|
11984
|
+
"createdby",
|
|
11985
|
+
"createtime",
|
|
11986
|
+
"updatedby",
|
|
11987
|
+
"updatetime",
|
|
11988
|
+
"recordowner",
|
|
11989
|
+
"version"
|
|
11990
|
+
]);
|
|
11991
|
+
var RESERVED_KEYWORDS_LOWER = new Set([
|
|
11992
|
+
"abstract",
|
|
11993
|
+
"as",
|
|
11994
|
+
"base",
|
|
11995
|
+
"bool",
|
|
11996
|
+
"break",
|
|
11997
|
+
"byte",
|
|
11998
|
+
"case",
|
|
11999
|
+
"catch",
|
|
12000
|
+
"char",
|
|
12001
|
+
"checked",
|
|
12002
|
+
"class",
|
|
12003
|
+
"const",
|
|
12004
|
+
"continue",
|
|
12005
|
+
"decimal",
|
|
12006
|
+
"default",
|
|
12007
|
+
"delegate",
|
|
12008
|
+
"do",
|
|
12009
|
+
"double",
|
|
12010
|
+
"else",
|
|
12011
|
+
"enum",
|
|
12012
|
+
"event",
|
|
12013
|
+
"explicit",
|
|
12014
|
+
"extern",
|
|
12015
|
+
"false",
|
|
12016
|
+
"finally",
|
|
12017
|
+
"fixed",
|
|
12018
|
+
"float",
|
|
12019
|
+
"for",
|
|
12020
|
+
"foreach",
|
|
12021
|
+
"goto",
|
|
12022
|
+
"if",
|
|
12023
|
+
"implicit",
|
|
12024
|
+
"in",
|
|
12025
|
+
"int",
|
|
12026
|
+
"interface",
|
|
12027
|
+
"internal",
|
|
12028
|
+
"is",
|
|
12029
|
+
"lock",
|
|
12030
|
+
"long",
|
|
12031
|
+
"namespace",
|
|
12032
|
+
"new",
|
|
12033
|
+
"null",
|
|
12034
|
+
"object",
|
|
12035
|
+
"operator",
|
|
12036
|
+
"out",
|
|
12037
|
+
"override",
|
|
12038
|
+
"params",
|
|
12039
|
+
"private",
|
|
12040
|
+
"protected",
|
|
12041
|
+
"public",
|
|
12042
|
+
"readonly",
|
|
12043
|
+
"ref",
|
|
12044
|
+
"return",
|
|
12045
|
+
"sbyte",
|
|
12046
|
+
"sealed",
|
|
12047
|
+
"short",
|
|
12048
|
+
"sizeof",
|
|
12049
|
+
"stackalloc",
|
|
12050
|
+
"static",
|
|
12051
|
+
"string",
|
|
12052
|
+
"struct",
|
|
12053
|
+
"switch",
|
|
12054
|
+
"this",
|
|
12055
|
+
"throw",
|
|
12056
|
+
"true",
|
|
12057
|
+
"try",
|
|
12058
|
+
"typeof",
|
|
12059
|
+
"uint",
|
|
12060
|
+
"ulong",
|
|
12061
|
+
"unchecked",
|
|
12062
|
+
"unsafe",
|
|
12063
|
+
"ushort",
|
|
12064
|
+
"using",
|
|
12065
|
+
"virtual",
|
|
12066
|
+
"void",
|
|
12067
|
+
"volatile",
|
|
12068
|
+
"while",
|
|
12069
|
+
"addhandler",
|
|
12070
|
+
"addressof",
|
|
12071
|
+
"alias",
|
|
12072
|
+
"and",
|
|
12073
|
+
"andalso",
|
|
12074
|
+
"boolean",
|
|
12075
|
+
"byref",
|
|
12076
|
+
"byval",
|
|
12077
|
+
"call",
|
|
12078
|
+
"cbool",
|
|
12079
|
+
"cbyte",
|
|
12080
|
+
"cchar",
|
|
12081
|
+
"cdate",
|
|
12082
|
+
"cdbl",
|
|
12083
|
+
"cdec",
|
|
12084
|
+
"cint",
|
|
12085
|
+
"clng",
|
|
12086
|
+
"cobj",
|
|
12087
|
+
"csbyte",
|
|
12088
|
+
"cshort",
|
|
12089
|
+
"csng",
|
|
12090
|
+
"cstr",
|
|
12091
|
+
"ctype",
|
|
12092
|
+
"cuint",
|
|
12093
|
+
"culng",
|
|
12094
|
+
"cushort",
|
|
12095
|
+
"date",
|
|
12096
|
+
"declare",
|
|
12097
|
+
"dim",
|
|
12098
|
+
"directcast",
|
|
12099
|
+
"each",
|
|
12100
|
+
"elseif",
|
|
12101
|
+
"end",
|
|
12102
|
+
"endif",
|
|
12103
|
+
"erase",
|
|
12104
|
+
"error",
|
|
12105
|
+
"exit",
|
|
12106
|
+
"friend",
|
|
12107
|
+
"function",
|
|
12108
|
+
"get",
|
|
12109
|
+
"gettype",
|
|
12110
|
+
"getxmlnamespace",
|
|
12111
|
+
"global",
|
|
12112
|
+
"gosub",
|
|
12113
|
+
"goto",
|
|
12114
|
+
"handles",
|
|
12115
|
+
"implements",
|
|
12116
|
+
"imports",
|
|
12117
|
+
"inherits",
|
|
12118
|
+
"integer",
|
|
12119
|
+
"isnot",
|
|
12120
|
+
"let",
|
|
12121
|
+
"lib",
|
|
12122
|
+
"like",
|
|
12123
|
+
"loop",
|
|
12124
|
+
"me",
|
|
12125
|
+
"mod",
|
|
12126
|
+
"module",
|
|
12127
|
+
"mustinherit",
|
|
12128
|
+
"mustoverride",
|
|
12129
|
+
"mybase",
|
|
12130
|
+
"myclass",
|
|
12131
|
+
"narrowing",
|
|
12132
|
+
"next",
|
|
12133
|
+
"not",
|
|
12134
|
+
"nothing",
|
|
12135
|
+
"notinheritable",
|
|
12136
|
+
"notoverridable",
|
|
12137
|
+
"of",
|
|
12138
|
+
"on",
|
|
12139
|
+
"option",
|
|
12140
|
+
"optional",
|
|
12141
|
+
"or",
|
|
12142
|
+
"orelse",
|
|
12143
|
+
"overloads",
|
|
12144
|
+
"overridable",
|
|
12145
|
+
"overrides",
|
|
12146
|
+
"paramarray",
|
|
12147
|
+
"partial",
|
|
12148
|
+
"property",
|
|
12149
|
+
"raiseevent",
|
|
12150
|
+
"redim",
|
|
12151
|
+
"rem",
|
|
12152
|
+
"removehandler",
|
|
12153
|
+
"resume",
|
|
12154
|
+
"select",
|
|
12155
|
+
"set",
|
|
12156
|
+
"shadows",
|
|
12157
|
+
"shared",
|
|
12158
|
+
"single",
|
|
12159
|
+
"step",
|
|
12160
|
+
"stop",
|
|
12161
|
+
"structure",
|
|
12162
|
+
"sub",
|
|
12163
|
+
"synclock",
|
|
12164
|
+
"then",
|
|
12165
|
+
"to",
|
|
12166
|
+
"trycast",
|
|
12167
|
+
"uinteger",
|
|
12168
|
+
"ushort",
|
|
12169
|
+
"variant",
|
|
12170
|
+
"wend",
|
|
12171
|
+
"when",
|
|
12172
|
+
"widening",
|
|
12173
|
+
"with",
|
|
12174
|
+
"withevents",
|
|
12175
|
+
"writeonly",
|
|
12176
|
+
"xor"
|
|
12177
|
+
]);
|
|
11161
12178
|
// ../common/src/host-global-options.ts
|
|
11162
12179
|
var HOST_GLOBAL_OPTIONS_WITH_VALUE = [
|
|
11163
12180
|
"--output",
|
|
@@ -11242,6 +12259,40 @@ var sdkUserAgentHostToken = singleton("SdkUserAgentHostToken");
|
|
|
11242
12259
|
var shippedKeysSlot = singleton("ShipSucceededDedupeKeys");
|
|
11243
12260
|
// ../common/src/tool-provider.ts
|
|
11244
12261
|
var factorySlot = singleton("PackagerFactoryProvider");
|
|
12262
|
+
// ../auth/src/catch-error.ts
|
|
12263
|
+
function isPromiseLike2(value) {
|
|
12264
|
+
return value !== null && typeof value === "object" && typeof value.then === "function";
|
|
12265
|
+
}
|
|
12266
|
+
function catchError2(fnOrPromise) {
|
|
12267
|
+
if (isPromiseLike2(fnOrPromise)) {
|
|
12268
|
+
return settlePromiseLike2(fnOrPromise);
|
|
12269
|
+
}
|
|
12270
|
+
try {
|
|
12271
|
+
const result = fnOrPromise();
|
|
12272
|
+
if (isPromiseLike2(result)) {
|
|
12273
|
+
return settlePromiseLike2(result);
|
|
12274
|
+
}
|
|
12275
|
+
return [undefined, result];
|
|
12276
|
+
} catch (error) {
|
|
12277
|
+
return [
|
|
12278
|
+
error instanceof Error ? error : new Error(String(error)),
|
|
12279
|
+
undefined
|
|
12280
|
+
];
|
|
12281
|
+
}
|
|
12282
|
+
}
|
|
12283
|
+
function settlePromiseLike2(thenable) {
|
|
12284
|
+
return Promise.resolve(thenable).then((data) => [undefined, data]).catch((error) => [
|
|
12285
|
+
error instanceof Error ? error : new Error(String(error)),
|
|
12286
|
+
undefined
|
|
12287
|
+
]);
|
|
12288
|
+
}
|
|
12289
|
+
|
|
12290
|
+
// ../auth/src/constants.ts
|
|
12291
|
+
var UIPATH_HOME_DIR = ".uipath";
|
|
12292
|
+
var AUTH_FILENAME = ".auth";
|
|
12293
|
+
var DEFAULT_BASE_URL = "https://cloud.uipath.com";
|
|
12294
|
+
var DEFAULT_AUTH_TIMEOUT_MS2 = 5 * 60 * 1000;
|
|
12295
|
+
|
|
11245
12296
|
// ../auth/src/config.ts
|
|
11246
12297
|
var DEFAULT_CLIENT_ID = "36dea5b8-e8bb-423d-8e7b-c808df8f1c00";
|
|
11247
12298
|
var AUTH_FILE_CONFIG_KEY = Symbol.for("@uipath/auth/AuthFileConfig");
|
|
@@ -11255,7 +12306,7 @@ class InvalidBaseUrlError extends Error {
|
|
|
11255
12306
|
super(`Invalid base URL: "${url}"
|
|
11256
12307
|
` + `Reason: ${reason}
|
|
11257
12308
|
|
|
11258
|
-
` + `Expected format: an https:// URL, e.g. https://cloud.uipath.com (commercial), https://govcloud.uipath.us (Public Sector), or your Automation Suite host (https://<your-host>).
|
|
12309
|
+
` + `Expected format: an https:// URL (or bare host — https:// is assumed), e.g. https://cloud.uipath.com (commercial), https://govcloud.uipath.us (Public Sector), or your Automation Suite host (https://<your-host>).
|
|
11259
12310
|
` + `You can specify the URL via:
|
|
11260
12311
|
` + ` • --authority flag
|
|
11261
12312
|
` + ` • UIPATH_URL environment variable
|
|
@@ -11276,10 +12327,16 @@ var normalizeAndValidateBaseUrl = (rawUrl) => {
|
|
|
11276
12327
|
while (baseUrl.endsWith("/")) {
|
|
11277
12328
|
baseUrl = baseUrl.slice(0, -1);
|
|
11278
12329
|
}
|
|
12330
|
+
const hasScheme = /^[a-z][a-z0-9+.-]*:\/\//i.test(baseUrl);
|
|
12331
|
+
const [hostCandidate] = baseUrl.split(/[/?#]/, 1);
|
|
12332
|
+
if (!hasScheme && hostCandidate.includes(".")) {
|
|
12333
|
+
baseUrl = `https://${baseUrl}`;
|
|
12334
|
+
}
|
|
11279
12335
|
const resolvedBaseUrl = baseUrl;
|
|
11280
|
-
const [urlError, url] =
|
|
12336
|
+
const [urlError, url] = catchError2(() => new URL(resolvedBaseUrl));
|
|
11281
12337
|
if (urlError) {
|
|
11282
|
-
|
|
12338
|
+
const shapeHint = !hasScheme && !hostCandidate.includes(".") ? ` "${rawUrl.trim()}" is not a URL or a host name. Pass the full authority URL — https://<host>, or just <host> (https:// is assumed).` : ` ${urlError instanceof Error ? urlError.message : "Unknown error"}`;
|
|
12339
|
+
throw new InvalidBaseUrlError(baseUrl, `Malformed URL.${shapeHint}`);
|
|
11283
12340
|
}
|
|
11284
12341
|
if (url.protocol !== "https:") {
|
|
11285
12342
|
throw new InvalidBaseUrlError(baseUrl, `Authority must use https:// scheme, got ${url.protocol}//. OIDC token exchange requires TLS end-to-end.`);
|
|
@@ -11334,6 +12391,11 @@ var resolveConfigAsync = async ({
|
|
|
11334
12391
|
};
|
|
11335
12392
|
};
|
|
11336
12393
|
|
|
12394
|
+
// ../auth/src/utils/platform.ts
|
|
12395
|
+
function isBrowser() {
|
|
12396
|
+
return typeof globalThis !== "undefined" && "window" in globalThis && "document" in globalThis;
|
|
12397
|
+
}
|
|
12398
|
+
|
|
11337
12399
|
// ../auth/src/authProfile.ts
|
|
11338
12400
|
var DEFAULT_AUTH_PROFILE = "default";
|
|
11339
12401
|
var PROFILE_DIR = "profiles";
|
|
@@ -11345,7 +12407,7 @@ function isAuthProfileStorage(value) {
|
|
|
11345
12407
|
return value !== null && typeof value === "object" && "getStore" in value && "run" in value;
|
|
11346
12408
|
}
|
|
11347
12409
|
function createProfileStorage() {
|
|
11348
|
-
const [error, mod] =
|
|
12410
|
+
const [error, mod] = catchError2(() => __require("node:async_hooks"));
|
|
11349
12411
|
if (error || typeof mod?.AsyncLocalStorage !== "function") {
|
|
11350
12412
|
return {
|
|
11351
12413
|
getStore: () => {
|
|
@@ -11361,9 +12423,9 @@ function getProfileStorage() {
|
|
|
11361
12423
|
if (isAuthProfileStorage(existing)) {
|
|
11362
12424
|
return existing;
|
|
11363
12425
|
}
|
|
11364
|
-
const
|
|
11365
|
-
globalSlot2[AUTH_PROFILE_STORAGE_KEY] =
|
|
11366
|
-
return
|
|
12426
|
+
const storage2 = createProfileStorage();
|
|
12427
|
+
globalSlot2[AUTH_PROFILE_STORAGE_KEY] = storage2;
|
|
12428
|
+
return storage2;
|
|
11367
12429
|
}
|
|
11368
12430
|
var profileStorage = getProfileStorage();
|
|
11369
12431
|
|
|
@@ -11394,8 +12456,8 @@ function resolveAuthProfileFilePath(profile) {
|
|
|
11394
12456
|
if (normalized === undefined) {
|
|
11395
12457
|
throw new AuthProfileValidationError(`"${DEFAULT_AUTH_PROFILE}" is the built-in profile and does not have a profile file path.`);
|
|
11396
12458
|
}
|
|
11397
|
-
const
|
|
11398
|
-
return
|
|
12459
|
+
const fs2 = getFileSystem();
|
|
12460
|
+
return fs2.path.join(fs2.env.homedir(), UIPATH_HOME_DIR, PROFILE_DIR, normalized, AUTH_FILENAME);
|
|
11399
12461
|
}
|
|
11400
12462
|
function getActiveAuthProfileFilePath() {
|
|
11401
12463
|
const profile = getActiveAuthProfile();
|
|
@@ -11476,7 +12538,7 @@ var getTokenExpiration = (accessToken) => {
|
|
|
11476
12538
|
// ../auth/src/sessionIdentity.ts
|
|
11477
12539
|
var parseAuthFlow = (value) => value === "authorization_code" || value === "client_credentials" || value === "federated_credentials" ? value : undefined;
|
|
11478
12540
|
var decodeClaims = (accessToken) => {
|
|
11479
|
-
const [error, claims] =
|
|
12541
|
+
const [error, claims] = catchError2(() => parseJWT(accessToken));
|
|
11480
12542
|
return error ? undefined : claims;
|
|
11481
12543
|
};
|
|
11482
12544
|
var asString = (value) => typeof value === "string" && value.length > 0 ? value : undefined;
|
|
@@ -11560,27 +12622,48 @@ var requireEnv = (name) => {
|
|
|
11560
12622
|
}
|
|
11561
12623
|
return value;
|
|
11562
12624
|
};
|
|
12625
|
+
var OPAQUE_TOKEN_BASE_URL_VAR = "UIPATH_URL";
|
|
12626
|
+
var resolveBaseUrl = (rawUrl, failureContext) => {
|
|
12627
|
+
const [baseUrlError, baseUrl] = catchError2(() => normalizeAndValidateBaseUrl(rawUrl));
|
|
12628
|
+
if (baseUrlError) {
|
|
12629
|
+
if (baseUrlError instanceof InvalidBaseUrlError) {
|
|
12630
|
+
throw baseUrlError;
|
|
12631
|
+
}
|
|
12632
|
+
throw new EnvAuthConfigError(`${failureContext}: ` + `${baseUrlError instanceof Error ? baseUrlError.message : String(baseUrlError)}`);
|
|
12633
|
+
}
|
|
12634
|
+
return baseUrl;
|
|
12635
|
+
};
|
|
11563
12636
|
var readAuthFromEnv = () => {
|
|
11564
12637
|
const accessToken = requireEnv(ENV_AUTH_VARS.token);
|
|
11565
12638
|
const organizationName = requireEnv(ENV_AUTH_VARS.organizationName);
|
|
11566
12639
|
const organizationId = requireEnv(ENV_AUTH_VARS.organizationId);
|
|
11567
12640
|
const tenantName = requireEnv(ENV_AUTH_VARS.tenantName);
|
|
11568
12641
|
const tenantId = requireEnv(ENV_AUTH_VARS.tenantId);
|
|
11569
|
-
const [parseError, payload] =
|
|
12642
|
+
const [parseError, payload] = catchError2(() => parseJWT(accessToken));
|
|
11570
12643
|
if (parseError) {
|
|
11571
|
-
|
|
12644
|
+
const parseErrorMessage = parseError instanceof Error ? parseError.message : String(parseError);
|
|
12645
|
+
const rawUrl = process.env[OPAQUE_TOKEN_BASE_URL_VAR];
|
|
12646
|
+
if (!rawUrl) {
|
|
12647
|
+
throw new EnvAuthConfigError(`${ENV_AUTH_VARS.token} is not a JWT (treating it as an opaque token, ` + `e.g. a Personal Access Token). Set ${OPAQUE_TOKEN_BASE_URL_VAR} to the ` + `UiPath base URL if this is a PAT, or fix the token if it was meant to ` + `be a JWT (parse error: ${parseErrorMessage}).`);
|
|
12648
|
+
}
|
|
12649
|
+
const baseUrl2 = resolveBaseUrl(rawUrl, `Failed to validate ${OPAQUE_TOKEN_BASE_URL_VAR}`);
|
|
12650
|
+
return {
|
|
12651
|
+
loginStatus: "Logged in",
|
|
12652
|
+
accessToken,
|
|
12653
|
+
baseUrl: baseUrl2,
|
|
12654
|
+
organizationName,
|
|
12655
|
+
organizationId,
|
|
12656
|
+
tenantName,
|
|
12657
|
+
tenantId,
|
|
12658
|
+
source: "env-vars" /* EnvironmentVariables */,
|
|
12659
|
+
hint: "Token is opaque (not a JWT) - expiration and identity cannot be " + "determined locally. Commands will fail with 401 once it is revoked or " + `expired. If this was meant to be a JWT instead of a PAT, note: ${parseErrorMessage}`
|
|
12660
|
+
};
|
|
11572
12661
|
}
|
|
11573
12662
|
const iss = payload.iss;
|
|
11574
12663
|
if (typeof iss !== "string" || iss.length === 0) {
|
|
11575
12664
|
throw new EnvAuthConfigError(`${ENV_AUTH_VARS.token} has no 'iss' claim; cannot determine ` + `the UiPath server. Ensure the token was issued by a UiPath identity server.`);
|
|
11576
12665
|
}
|
|
11577
|
-
const
|
|
11578
|
-
if (baseUrlError) {
|
|
11579
|
-
if (baseUrlError instanceof InvalidBaseUrlError) {
|
|
11580
|
-
throw baseUrlError;
|
|
11581
|
-
}
|
|
11582
|
-
throw new EnvAuthConfigError(`Failed to derive server URL from token 'iss' claim: ` + `${baseUrlError instanceof Error ? baseUrlError.message : String(baseUrlError)}`);
|
|
11583
|
-
}
|
|
12666
|
+
const baseUrl = resolveBaseUrl(iss, "Failed to derive server URL from token 'iss' claim");
|
|
11584
12667
|
const expiration = getTokenExpiration(accessToken);
|
|
11585
12668
|
const loginStatus = expiration && expiration <= new Date ? "Expired" : "Logged in";
|
|
11586
12669
|
const identity = resolveSessionIdentity(accessToken);
|
|
@@ -11606,8 +12689,8 @@ var SURFACE_WINDOW_MS = 60 * 60 * 1000;
|
|
|
11606
12689
|
async function refreshTokenFingerprint(refreshToken) {
|
|
11607
12690
|
const bytes = new TextEncoder().encode(refreshToken);
|
|
11608
12691
|
if (globalThis.crypto?.subtle) {
|
|
11609
|
-
const
|
|
11610
|
-
return Array.from(new Uint8Array(
|
|
12692
|
+
const digest2 = await globalThis.crypto.subtle.digest("SHA-256", bytes);
|
|
12693
|
+
return Array.from(new Uint8Array(digest2), (b) => b.toString(16).padStart(2, "0")).join("").slice(0, 16);
|
|
11611
12694
|
}
|
|
11612
12695
|
const { createHash } = await import("node:crypto");
|
|
11613
12696
|
return createHash("sha256").update(refreshToken).digest("hex").slice(0, 16);
|
|
@@ -11616,9 +12699,9 @@ function breakerPathFor(authPath) {
|
|
|
11616
12699
|
return `${authPath}${BREAKER_SUFFIX}`;
|
|
11617
12700
|
}
|
|
11618
12701
|
async function loadRefreshBreaker(authPath) {
|
|
11619
|
-
const
|
|
12702
|
+
const fs2 = getFileSystem();
|
|
11620
12703
|
try {
|
|
11621
|
-
const content = await
|
|
12704
|
+
const content = await fs2.readFile(breakerPathFor(authPath), "utf-8");
|
|
11622
12705
|
if (!content)
|
|
11623
12706
|
return {};
|
|
11624
12707
|
const parsed = JSON.parse(content);
|
|
@@ -11629,20 +12712,20 @@ async function loadRefreshBreaker(authPath) {
|
|
|
11629
12712
|
}
|
|
11630
12713
|
async function saveRefreshBreaker(authPath, state) {
|
|
11631
12714
|
try {
|
|
11632
|
-
const
|
|
11633
|
-
const
|
|
11634
|
-
await
|
|
11635
|
-
const tempPath = `${
|
|
11636
|
-
await
|
|
11637
|
-
await
|
|
12715
|
+
const fs2 = getFileSystem();
|
|
12716
|
+
const path2 = breakerPathFor(authPath);
|
|
12717
|
+
await fs2.mkdir(fs2.path.dirname(path2));
|
|
12718
|
+
const tempPath = `${path2}.tmp`;
|
|
12719
|
+
await fs2.writeFile(tempPath, JSON.stringify(state));
|
|
12720
|
+
await fs2.rename(tempPath, path2);
|
|
11638
12721
|
} catch {}
|
|
11639
12722
|
}
|
|
11640
12723
|
async function clearRefreshBreaker(authPath) {
|
|
11641
|
-
const
|
|
11642
|
-
const
|
|
12724
|
+
const fs2 = getFileSystem();
|
|
12725
|
+
const path2 = breakerPathFor(authPath);
|
|
11643
12726
|
try {
|
|
11644
|
-
if (await
|
|
11645
|
-
await
|
|
12727
|
+
if (await fs2.exists(path2)) {
|
|
12728
|
+
await fs2.rm(path2);
|
|
11646
12729
|
}
|
|
11647
12730
|
} catch {}
|
|
11648
12731
|
}
|
|
@@ -11663,43 +12746,43 @@ var ROBOT_USER_SERVICES_PIPE = "UiPathUserServices";
|
|
|
11663
12746
|
var ROBOT_USER_SERVICES_ALTERNATE_PIPE = `${ROBOT_USER_SERVICES_PIPE}Alternate`;
|
|
11664
12747
|
var PIPE_NAME_MAX_LENGTH = 103;
|
|
11665
12748
|
var getRobotIpcPipeNames = async () => {
|
|
11666
|
-
const
|
|
11667
|
-
const username =
|
|
12749
|
+
const fs2 = getFileSystem();
|
|
12750
|
+
const username = fs2.env.getenv("USER") ?? fs2.env.getenv("USERNAME");
|
|
11668
12751
|
if (!username) {
|
|
11669
12752
|
throw new Error("Unable to determine current username");
|
|
11670
12753
|
}
|
|
11671
|
-
const tempPath =
|
|
11672
|
-
return [ROBOT_USER_SERVICES_PIPE, ROBOT_USER_SERVICES_ALTERNATE_PIPE].map((baseName) =>
|
|
12754
|
+
const tempPath = fs2.env.getenv("TMPDIR") ?? "/tmp/";
|
|
12755
|
+
return [ROBOT_USER_SERVICES_PIPE, ROBOT_USER_SERVICES_ALTERNATE_PIPE].map((baseName) => fs2.path.join(tempPath, `${baseName}_${username}`).substring(0, PIPE_NAME_MAX_LENGTH));
|
|
11673
12756
|
};
|
|
11674
12757
|
var defaultIsRobotIpcAvailable = async () => {
|
|
11675
12758
|
if (process.platform === "win32") {
|
|
11676
12759
|
return true;
|
|
11677
12760
|
}
|
|
11678
|
-
const [pipeNamesError, pipeNames] = await
|
|
12761
|
+
const [pipeNamesError, pipeNames] = await catchError2(getRobotIpcPipeNames());
|
|
11679
12762
|
if (pipeNamesError || !pipeNames) {
|
|
11680
12763
|
return false;
|
|
11681
12764
|
}
|
|
11682
|
-
const
|
|
12765
|
+
const fs2 = getFileSystem();
|
|
11683
12766
|
for (const pipeName of pipeNames) {
|
|
11684
|
-
const [existsError, exists] = await
|
|
12767
|
+
const [existsError, exists] = await catchError2(fs2.exists(pipeName));
|
|
11685
12768
|
if (!existsError && exists === true) {
|
|
11686
12769
|
return true;
|
|
11687
12770
|
}
|
|
11688
12771
|
}
|
|
11689
12772
|
return false;
|
|
11690
12773
|
};
|
|
11691
|
-
var withTimeout = (promise, timeoutMs) => new Promise((
|
|
12774
|
+
var withTimeout = (promise, timeoutMs) => new Promise((resolve2, reject) => {
|
|
11692
12775
|
const timer = setTimeout(() => reject(new Error(`Robot IPC call timed out after ${timeoutMs}ms`)), timeoutMs);
|
|
11693
12776
|
promise.then((value) => {
|
|
11694
12777
|
clearTimeout(timer);
|
|
11695
|
-
|
|
12778
|
+
resolve2(value);
|
|
11696
12779
|
}, (error) => {
|
|
11697
12780
|
clearTimeout(timer);
|
|
11698
12781
|
reject(error);
|
|
11699
12782
|
});
|
|
11700
12783
|
});
|
|
11701
12784
|
var parseResourceUrl = (url) => {
|
|
11702
|
-
const [error, parsed] =
|
|
12785
|
+
const [error, parsed] = catchError2(() => new URL(url));
|
|
11703
12786
|
if (error || !parsed)
|
|
11704
12787
|
return;
|
|
11705
12788
|
const segments = parsed.pathname.split("/").filter(Boolean);
|
|
@@ -11719,7 +12802,7 @@ var defaultLoadModule = async () => {
|
|
|
11719
12802
|
if (!hostLoader) {
|
|
11720
12803
|
return;
|
|
11721
12804
|
}
|
|
11722
|
-
const [error, mod] = await
|
|
12805
|
+
const [error, mod] = await catchError2(() => hostLoader());
|
|
11723
12806
|
if (error || !mod) {
|
|
11724
12807
|
return;
|
|
11725
12808
|
}
|
|
@@ -11745,7 +12828,7 @@ var tryRobotClientFallback = async (options = {}) => {
|
|
|
11745
12828
|
const mod = await loadModule();
|
|
11746
12829
|
if (!mod)
|
|
11747
12830
|
return;
|
|
11748
|
-
const [ctorError, proxy] =
|
|
12831
|
+
const [ctorError, proxy] = catchError2(() => new mod.RobotProxyConstructor);
|
|
11749
12832
|
if (ctorError || !proxy) {
|
|
11750
12833
|
return;
|
|
11751
12834
|
}
|
|
@@ -11768,7 +12851,7 @@ var tryRobotClientFallback = async (options = {}) => {
|
|
|
11768
12851
|
let organizationIdFromToken;
|
|
11769
12852
|
let tenantIdFromToken;
|
|
11770
12853
|
let issuerFromToken;
|
|
11771
|
-
const [jwtError, claims] =
|
|
12854
|
+
const [jwtError, claims] = catchError2(() => parseJWT(accessToken));
|
|
11772
12855
|
if (!jwtError && claims) {
|
|
11773
12856
|
const rawOrgId = claims.prtId ?? claims.organizationId ?? claims.prt_id;
|
|
11774
12857
|
if (typeof rawOrgId === "string" && rawOrgId.length > 0) {
|
|
@@ -11795,7 +12878,7 @@ var tryRobotClientFallback = async (options = {}) => {
|
|
|
11795
12878
|
} catch {
|
|
11796
12879
|
return;
|
|
11797
12880
|
} finally {
|
|
11798
|
-
await
|
|
12881
|
+
await catchError2(() => withTimeout(proxy.CloseAsync(), CLOSE_TIMEOUT_MS));
|
|
11799
12882
|
}
|
|
11800
12883
|
};
|
|
11801
12884
|
|
|
@@ -11865,9 +12948,9 @@ var errorCode = (err) => {
|
|
|
11865
12948
|
}
|
|
11866
12949
|
return "EUNKNOWN";
|
|
11867
12950
|
};
|
|
11868
|
-
var probeAsync = async (
|
|
12951
|
+
var probeAsync = async (fs2, candidate) => {
|
|
11869
12952
|
try {
|
|
11870
|
-
const stats = await
|
|
12953
|
+
const stats = await fs2.stat(candidate);
|
|
11871
12954
|
if (stats === null) {
|
|
11872
12955
|
return { exists: false };
|
|
11873
12956
|
}
|
|
@@ -11894,9 +12977,9 @@ var probeAsync = async (fs, candidate) => {
|
|
|
11894
12977
|
}
|
|
11895
12978
|
};
|
|
11896
12979
|
var resolveEnvFileLocationAsync = async (envFilePath = DEFAULT_ENV_FILENAME, opts) => {
|
|
11897
|
-
const
|
|
11898
|
-
if (
|
|
11899
|
-
const probe2 = await probeAsync(
|
|
12980
|
+
const fs2 = getFileSystem();
|
|
12981
|
+
if (fs2.path.isAbsolute(envFilePath)) {
|
|
12982
|
+
const probe2 = await probeAsync(fs2, envFilePath);
|
|
11900
12983
|
return probe2.exists ? { exists: true, absolutePath: envFilePath, source: "absolute" } : {
|
|
11901
12984
|
exists: false,
|
|
11902
12985
|
absolutePath: envFilePath,
|
|
@@ -11904,11 +12987,11 @@ var resolveEnvFileLocationAsync = async (envFilePath = DEFAULT_ENV_FILENAME, opt
|
|
|
11904
12987
|
...probe2.unusable ? { unusable: probe2.unusable } : {}
|
|
11905
12988
|
};
|
|
11906
12989
|
}
|
|
11907
|
-
const cwd = opts?.cwd ??
|
|
12990
|
+
const cwd = opts?.cwd ?? fs2.env.cwd();
|
|
11908
12991
|
let searchDir = cwd;
|
|
11909
12992
|
while (true) {
|
|
11910
|
-
const candidate =
|
|
11911
|
-
const probe2 = await probeAsync(
|
|
12993
|
+
const candidate = fs2.path.join(searchDir, envFilePath);
|
|
12994
|
+
const probe2 = await probeAsync(fs2, candidate);
|
|
11912
12995
|
if (probe2.exists) {
|
|
11913
12996
|
return {
|
|
11914
12997
|
exists: true,
|
|
@@ -11916,14 +12999,14 @@ var resolveEnvFileLocationAsync = async (envFilePath = DEFAULT_ENV_FILENAME, opt
|
|
|
11916
12999
|
source: searchDir === cwd ? "cwd" : "ancestor"
|
|
11917
13000
|
};
|
|
11918
13001
|
}
|
|
11919
|
-
const parentDir =
|
|
13002
|
+
const parentDir = fs2.path.dirname(searchDir);
|
|
11920
13003
|
if (parentDir === searchDir) {
|
|
11921
13004
|
break;
|
|
11922
13005
|
}
|
|
11923
13006
|
searchDir = parentDir;
|
|
11924
13007
|
}
|
|
11925
|
-
const homePath =
|
|
11926
|
-
const probe = await probeAsync(
|
|
13008
|
+
const homePath = fs2.path.join(fs2.env.homedir(), envFilePath);
|
|
13009
|
+
const probe = await probeAsync(fs2, homePath);
|
|
11927
13010
|
if (probe.exists) {
|
|
11928
13011
|
return { exists: true, absolutePath: homePath, source: "home" };
|
|
11929
13012
|
}
|
|
@@ -11945,12 +13028,12 @@ var resolveEnvFilePathAsync = async (envFilePath = DEFAULT_ENV_FILENAME, opts) =
|
|
|
11945
13028
|
};
|
|
11946
13029
|
};
|
|
11947
13030
|
var loadEnvFileAsync = async ({ envPath }) => {
|
|
11948
|
-
const
|
|
11949
|
-
const absolutePath =
|
|
11950
|
-
if (!await
|
|
13031
|
+
const fs2 = getFileSystem();
|
|
13032
|
+
const absolutePath = fs2.path.isAbsolute(envPath) ? envPath : fs2.path.join(fs2.env.cwd(), envPath);
|
|
13033
|
+
if (!await fs2.exists(absolutePath)) {
|
|
11951
13034
|
throw new Error(`Environment file not found: ${envPath}`);
|
|
11952
13035
|
}
|
|
11953
|
-
const content = await
|
|
13036
|
+
const content = await fs2.readFile(absolutePath, "utf-8");
|
|
11954
13037
|
if (content === null) {
|
|
11955
13038
|
throw new Error(`Environment file not found: ${envPath}`);
|
|
11956
13039
|
}
|
|
@@ -11979,10 +13062,10 @@ var saveEnvFileAsync = async ({
|
|
|
11979
13062
|
data,
|
|
11980
13063
|
merge = true
|
|
11981
13064
|
}) => {
|
|
11982
|
-
const
|
|
11983
|
-
const absolutePath =
|
|
13065
|
+
const fs2 = getFileSystem();
|
|
13066
|
+
const absolutePath = fs2.path.isAbsolute(envPath) ? envPath : fs2.path.join(fs2.env.homedir(), envPath);
|
|
11984
13067
|
let existingData = {};
|
|
11985
|
-
if (merge && await
|
|
13068
|
+
if (merge && await fs2.exists(absolutePath)) {
|
|
11986
13069
|
try {
|
|
11987
13070
|
existingData = await loadEnvFileAsync({ envPath: absolutePath });
|
|
11988
13071
|
} catch {}
|
|
@@ -12000,11 +13083,11 @@ var saveEnvFileAsync = async ({
|
|
|
12000
13083
|
const content = `${lines.join(`
|
|
12001
13084
|
`)}
|
|
12002
13085
|
`;
|
|
12003
|
-
const dir =
|
|
12004
|
-
await
|
|
13086
|
+
const dir = fs2.path.dirname(absolutePath);
|
|
13087
|
+
await fs2.mkdir(dir);
|
|
12005
13088
|
const tempPath = `${absolutePath}.tmp`;
|
|
12006
|
-
await
|
|
12007
|
-
await
|
|
13089
|
+
await fs2.writeFile(tempPath, content);
|
|
13090
|
+
await fs2.rename(tempPath, absolutePath);
|
|
12008
13091
|
};
|
|
12009
13092
|
|
|
12010
13093
|
// ../auth/src/loginStatus.ts
|
|
@@ -12118,11 +13201,11 @@ async function loadFileCredentials(loadEnvFile, absolutePath) {
|
|
|
12118
13201
|
return { credentials };
|
|
12119
13202
|
}
|
|
12120
13203
|
async function getGlobalCredsHint(getFs, loadEnvFile, absolutePath, envFilePath) {
|
|
12121
|
-
const
|
|
12122
|
-
const globalPath =
|
|
13204
|
+
const fs2 = getFs();
|
|
13205
|
+
const globalPath = fs2.path.join(fs2.env.homedir(), envFilePath);
|
|
12123
13206
|
if (absolutePath === globalPath)
|
|
12124
13207
|
return;
|
|
12125
|
-
if (!await
|
|
13208
|
+
if (!await fs2.exists(globalPath))
|
|
12126
13209
|
return;
|
|
12127
13210
|
try {
|
|
12128
13211
|
const globalCreds = await loadEnvFile({ envPath: globalPath });
|
|
@@ -12573,69 +13656,69 @@ function config(newConfig) {
|
|
|
12573
13656
|
// ../../node_modules/zod/v4/core/util.js
|
|
12574
13657
|
var exports_util = {};
|
|
12575
13658
|
__export(exports_util, {
|
|
12576
|
-
|
|
12577
|
-
uint8ArrayToHex: () => uint8ArrayToHex,
|
|
12578
|
-
uint8ArrayToBase64url: () => uint8ArrayToBase64url,
|
|
12579
|
-
uint8ArrayToBase64: () => uint8ArrayToBase64,
|
|
12580
|
-
stringifyPrimitive: () => stringifyPrimitive,
|
|
12581
|
-
slugify: () => slugify,
|
|
12582
|
-
shallowClone: () => shallowClone,
|
|
12583
|
-
safeExtend: () => safeExtend,
|
|
12584
|
-
required: () => required,
|
|
12585
|
-
randomString: () => randomString,
|
|
12586
|
-
propertyKeyTypes: () => propertyKeyTypes,
|
|
12587
|
-
promiseAllObject: () => promiseAllObject,
|
|
12588
|
-
primitiveTypes: () => primitiveTypes,
|
|
12589
|
-
prefixIssues: () => prefixIssues,
|
|
12590
|
-
pick: () => pick,
|
|
12591
|
-
partial: () => partial,
|
|
12592
|
-
parsedType: () => parsedType,
|
|
12593
|
-
optionalKeys: () => optionalKeys,
|
|
12594
|
-
omit: () => omit,
|
|
12595
|
-
objectClone: () => objectClone,
|
|
12596
|
-
numKeys: () => numKeys,
|
|
12597
|
-
nullish: () => nullish,
|
|
12598
|
-
normalizeParams: () => normalizeParams,
|
|
12599
|
-
mergeDefs: () => mergeDefs,
|
|
12600
|
-
merge: () => merge,
|
|
12601
|
-
jsonStringifyReplacer: () => jsonStringifyReplacer,
|
|
12602
|
-
joinValues: () => joinValues,
|
|
12603
|
-
issue: () => issue,
|
|
12604
|
-
isPlainObject: () => isPlainObject,
|
|
12605
|
-
isObject: () => isObject,
|
|
12606
|
-
hexToUint8Array: () => hexToUint8Array,
|
|
12607
|
-
getSizableOrigin: () => getSizableOrigin,
|
|
12608
|
-
getParsedType: () => getParsedType,
|
|
12609
|
-
getLengthableOrigin: () => getLengthableOrigin,
|
|
12610
|
-
getEnumValues: () => getEnumValues,
|
|
12611
|
-
getElementAtPath: () => getElementAtPath,
|
|
12612
|
-
floatSafeRemainder: () => floatSafeRemainder,
|
|
12613
|
-
finalizeIssue: () => finalizeIssue,
|
|
12614
|
-
extend: () => extend,
|
|
12615
|
-
explicitlyAborted: () => explicitlyAborted,
|
|
12616
|
-
escapeRegex: () => escapeRegex,
|
|
12617
|
-
esc: () => esc,
|
|
12618
|
-
defineLazy: () => defineLazy,
|
|
12619
|
-
createTransparentProxy: () => createTransparentProxy,
|
|
12620
|
-
cloneDef: () => cloneDef,
|
|
12621
|
-
clone: () => clone,
|
|
12622
|
-
cleanRegex: () => cleanRegex,
|
|
12623
|
-
cleanEnum: () => cleanEnum,
|
|
12624
|
-
captureStackTrace: () => captureStackTrace,
|
|
12625
|
-
cached: () => cached,
|
|
12626
|
-
base64urlToUint8Array: () => base64urlToUint8Array,
|
|
12627
|
-
base64ToUint8Array: () => base64ToUint8Array,
|
|
12628
|
-
assignProp: () => assignProp,
|
|
12629
|
-
assertNotEqual: () => assertNotEqual,
|
|
12630
|
-
assertNever: () => assertNever,
|
|
12631
|
-
assertIs: () => assertIs,
|
|
12632
|
-
assertEqual: () => assertEqual,
|
|
12633
|
-
assert: () => assert,
|
|
12634
|
-
allowsEval: () => allowsEval,
|
|
12635
|
-
aborted: () => aborted,
|
|
12636
|
-
NUMBER_FORMAT_RANGES: () => NUMBER_FORMAT_RANGES,
|
|
13659
|
+
BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES,
|
|
12637
13660
|
Class: () => Class,
|
|
12638
|
-
|
|
13661
|
+
NUMBER_FORMAT_RANGES: () => NUMBER_FORMAT_RANGES,
|
|
13662
|
+
aborted: () => aborted,
|
|
13663
|
+
allowsEval: () => allowsEval,
|
|
13664
|
+
assert: () => assert,
|
|
13665
|
+
assertEqual: () => assertEqual,
|
|
13666
|
+
assertIs: () => assertIs,
|
|
13667
|
+
assertNever: () => assertNever,
|
|
13668
|
+
assertNotEqual: () => assertNotEqual,
|
|
13669
|
+
assignProp: () => assignProp,
|
|
13670
|
+
base64ToUint8Array: () => base64ToUint8Array,
|
|
13671
|
+
base64urlToUint8Array: () => base64urlToUint8Array,
|
|
13672
|
+
cached: () => cached,
|
|
13673
|
+
captureStackTrace: () => captureStackTrace,
|
|
13674
|
+
cleanEnum: () => cleanEnum,
|
|
13675
|
+
cleanRegex: () => cleanRegex,
|
|
13676
|
+
clone: () => clone,
|
|
13677
|
+
cloneDef: () => cloneDef,
|
|
13678
|
+
createTransparentProxy: () => createTransparentProxy,
|
|
13679
|
+
defineLazy: () => defineLazy,
|
|
13680
|
+
esc: () => esc,
|
|
13681
|
+
escapeRegex: () => escapeRegex,
|
|
13682
|
+
explicitlyAborted: () => explicitlyAborted,
|
|
13683
|
+
extend: () => extend,
|
|
13684
|
+
finalizeIssue: () => finalizeIssue,
|
|
13685
|
+
floatSafeRemainder: () => floatSafeRemainder,
|
|
13686
|
+
getElementAtPath: () => getElementAtPath,
|
|
13687
|
+
getEnumValues: () => getEnumValues,
|
|
13688
|
+
getLengthableOrigin: () => getLengthableOrigin,
|
|
13689
|
+
getParsedType: () => getParsedType,
|
|
13690
|
+
getSizableOrigin: () => getSizableOrigin,
|
|
13691
|
+
hexToUint8Array: () => hexToUint8Array,
|
|
13692
|
+
isObject: () => isObject,
|
|
13693
|
+
isPlainObject: () => isPlainObject,
|
|
13694
|
+
issue: () => issue,
|
|
13695
|
+
joinValues: () => joinValues,
|
|
13696
|
+
jsonStringifyReplacer: () => jsonStringifyReplacer,
|
|
13697
|
+
merge: () => merge,
|
|
13698
|
+
mergeDefs: () => mergeDefs,
|
|
13699
|
+
normalizeParams: () => normalizeParams,
|
|
13700
|
+
nullish: () => nullish,
|
|
13701
|
+
numKeys: () => numKeys,
|
|
13702
|
+
objectClone: () => objectClone,
|
|
13703
|
+
omit: () => omit,
|
|
13704
|
+
optionalKeys: () => optionalKeys,
|
|
13705
|
+
parsedType: () => parsedType,
|
|
13706
|
+
partial: () => partial,
|
|
13707
|
+
pick: () => pick,
|
|
13708
|
+
prefixIssues: () => prefixIssues,
|
|
13709
|
+
primitiveTypes: () => primitiveTypes,
|
|
13710
|
+
promiseAllObject: () => promiseAllObject,
|
|
13711
|
+
propertyKeyTypes: () => propertyKeyTypes,
|
|
13712
|
+
randomString: () => randomString,
|
|
13713
|
+
required: () => required,
|
|
13714
|
+
safeExtend: () => safeExtend,
|
|
13715
|
+
shallowClone: () => shallowClone,
|
|
13716
|
+
slugify: () => slugify,
|
|
13717
|
+
stringifyPrimitive: () => stringifyPrimitive,
|
|
13718
|
+
uint8ArrayToBase64: () => uint8ArrayToBase64,
|
|
13719
|
+
uint8ArrayToBase64url: () => uint8ArrayToBase64url,
|
|
13720
|
+
uint8ArrayToHex: () => uint8ArrayToHex,
|
|
13721
|
+
unwrapMessage: () => unwrapMessage
|
|
12639
13722
|
});
|
|
12640
13723
|
function assertEqual(val) {
|
|
12641
13724
|
return val;
|
|
@@ -12734,10 +13817,10 @@ function mergeDefs(...defs) {
|
|
|
12734
13817
|
function cloneDef(schema) {
|
|
12735
13818
|
return mergeDefs(schema._zod.def);
|
|
12736
13819
|
}
|
|
12737
|
-
function getElementAtPath(obj,
|
|
12738
|
-
if (!
|
|
13820
|
+
function getElementAtPath(obj, path2) {
|
|
13821
|
+
if (!path2)
|
|
12739
13822
|
return obj;
|
|
12740
|
-
return
|
|
13823
|
+
return path2.reduce((acc, key) => acc?.[key], obj);
|
|
12741
13824
|
}
|
|
12742
13825
|
function promiseAllObject(promisesObj) {
|
|
12743
13826
|
const keys = Object.keys(promisesObj);
|
|
@@ -13145,11 +14228,11 @@ function explicitlyAborted(x, startIndex = 0) {
|
|
|
13145
14228
|
}
|
|
13146
14229
|
return false;
|
|
13147
14230
|
}
|
|
13148
|
-
function prefixIssues(
|
|
14231
|
+
function prefixIssues(path2, issues) {
|
|
13149
14232
|
return issues.map((iss) => {
|
|
13150
14233
|
var _a2;
|
|
13151
14234
|
(_a2 = iss).path ?? (_a2.path = []);
|
|
13152
|
-
iss.path.unshift(
|
|
14235
|
+
iss.path.unshift(path2);
|
|
13153
14236
|
return iss;
|
|
13154
14237
|
});
|
|
13155
14238
|
}
|
|
@@ -13296,16 +14379,16 @@ function flattenError(error, mapper = (issue2) => issue2.message) {
|
|
|
13296
14379
|
}
|
|
13297
14380
|
function formatError(error, mapper = (issue2) => issue2.message) {
|
|
13298
14381
|
const fieldErrors = { _errors: [] };
|
|
13299
|
-
const processError = (error2,
|
|
14382
|
+
const processError = (error2, path2 = []) => {
|
|
13300
14383
|
for (const issue2 of error2.issues) {
|
|
13301
14384
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
13302
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
14385
|
+
issue2.errors.map((issues) => processError({ issues }, [...path2, ...issue2.path]));
|
|
13303
14386
|
} else if (issue2.code === "invalid_key") {
|
|
13304
|
-
processError({ issues: issue2.issues }, [...
|
|
14387
|
+
processError({ issues: issue2.issues }, [...path2, ...issue2.path]);
|
|
13305
14388
|
} else if (issue2.code === "invalid_element") {
|
|
13306
|
-
processError({ issues: issue2.issues }, [...
|
|
14389
|
+
processError({ issues: issue2.issues }, [...path2, ...issue2.path]);
|
|
13307
14390
|
} else {
|
|
13308
|
-
const fullpath = [...
|
|
14391
|
+
const fullpath = [...path2, ...issue2.path];
|
|
13309
14392
|
if (fullpath.length === 0) {
|
|
13310
14393
|
fieldErrors._errors.push(mapper(issue2));
|
|
13311
14394
|
} else {
|
|
@@ -16843,14 +17926,14 @@ function getLiteralValue(schema) {
|
|
|
16843
17926
|
// ../../node_modules/zod/v4/classic/iso.js
|
|
16844
17927
|
var exports_iso = {};
|
|
16845
17928
|
__export(exports_iso, {
|
|
16846
|
-
|
|
16847
|
-
duration: () => duration2,
|
|
16848
|
-
datetime: () => datetime2,
|
|
16849
|
-
date: () => date2,
|
|
16850
|
-
ZodISOTime: () => ZodISOTime,
|
|
16851
|
-
ZodISODuration: () => ZodISODuration,
|
|
17929
|
+
ZodISODate: () => ZodISODate,
|
|
16852
17930
|
ZodISODateTime: () => ZodISODateTime,
|
|
16853
|
-
|
|
17931
|
+
ZodISODuration: () => ZodISODuration,
|
|
17932
|
+
ZodISOTime: () => ZodISOTime,
|
|
17933
|
+
date: () => date2,
|
|
17934
|
+
datetime: () => datetime2,
|
|
17935
|
+
duration: () => duration2,
|
|
17936
|
+
time: () => time2
|
|
16854
17937
|
});
|
|
16855
17938
|
var ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def) => {
|
|
16856
17939
|
$ZodISODateTime.init(inst, def);
|
|
@@ -17831,11 +18914,11 @@ var ZodFirstPartyTypeKind;
|
|
|
17831
18914
|
// ../../node_modules/zod/v4/classic/coerce.js
|
|
17832
18915
|
var exports_coerce = {};
|
|
17833
18916
|
__export(exports_coerce, {
|
|
17834
|
-
|
|
17835
|
-
number: () => number3,
|
|
17836
|
-
date: () => date3,
|
|
18917
|
+
bigint: () => bigint2,
|
|
17837
18918
|
boolean: () => boolean3,
|
|
17838
|
-
|
|
18919
|
+
date: () => date3,
|
|
18920
|
+
number: () => number3,
|
|
18921
|
+
string: () => string3
|
|
17839
18922
|
});
|
|
17840
18923
|
function string3(params) {
|
|
17841
18924
|
return _coercedString(ZodString, params);
|
|
@@ -19184,7 +20267,7 @@ class Protocol {
|
|
|
19184
20267
|
return;
|
|
19185
20268
|
}
|
|
19186
20269
|
const pollInterval = task2.pollInterval ?? this._options?.defaultTaskPollInterval ?? 1000;
|
|
19187
|
-
await new Promise((
|
|
20270
|
+
await new Promise((resolve2) => setTimeout(resolve2, pollInterval));
|
|
19188
20271
|
options?.signal?.throwIfAborted();
|
|
19189
20272
|
}
|
|
19190
20273
|
} catch (error2) {
|
|
@@ -19196,7 +20279,7 @@ class Protocol {
|
|
|
19196
20279
|
}
|
|
19197
20280
|
request(request, resultSchema, options) {
|
|
19198
20281
|
const { relatedRequestId, resumptionToken, onresumptiontoken, task, relatedTask } = options ?? {};
|
|
19199
|
-
return new Promise((
|
|
20282
|
+
return new Promise((resolve2, reject) => {
|
|
19200
20283
|
const earlyReject = (error2) => {
|
|
19201
20284
|
reject(error2);
|
|
19202
20285
|
};
|
|
@@ -19274,7 +20357,7 @@ class Protocol {
|
|
|
19274
20357
|
if (!parseResult.success) {
|
|
19275
20358
|
reject(parseResult.error);
|
|
19276
20359
|
} else {
|
|
19277
|
-
|
|
20360
|
+
resolve2(parseResult.data);
|
|
19278
20361
|
}
|
|
19279
20362
|
} catch (error2) {
|
|
19280
20363
|
reject(error2);
|
|
@@ -19465,12 +20548,12 @@ class Protocol {
|
|
|
19465
20548
|
interval = task.pollInterval;
|
|
19466
20549
|
}
|
|
19467
20550
|
} catch {}
|
|
19468
|
-
return new Promise((
|
|
20551
|
+
return new Promise((resolve2, reject) => {
|
|
19469
20552
|
if (signal.aborted) {
|
|
19470
20553
|
reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
|
|
19471
20554
|
return;
|
|
19472
20555
|
}
|
|
19473
|
-
const timeoutId = setTimeout(
|
|
20556
|
+
const timeoutId = setTimeout(resolve2, interval);
|
|
19474
20557
|
signal.addEventListener("abort", () => {
|
|
19475
20558
|
clearTimeout(timeoutId);
|
|
19476
20559
|
reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
|
|
@@ -21682,7 +22765,7 @@ function parseSearchResponse(content) {
|
|
|
21682
22765
|
if (!textItem?.text) {
|
|
21683
22766
|
return;
|
|
21684
22767
|
}
|
|
21685
|
-
const [error2, parsed] =
|
|
22768
|
+
const [error2, parsed] = catchError(() => JSON.parse(textItem.text));
|
|
21686
22769
|
if (error2) {
|
|
21687
22770
|
return;
|
|
21688
22771
|
}
|
|
@@ -21721,7 +22804,7 @@ var registerAskCommand = (program2) => {
|
|
|
21721
22804
|
processContext.exit(1);
|
|
21722
22805
|
return;
|
|
21723
22806
|
}
|
|
21724
|
-
const [clientError, client] = await
|
|
22807
|
+
const [clientError, client] = await catchError(createMcpClient(options.tenant));
|
|
21725
22808
|
if (clientError) {
|
|
21726
22809
|
const errorMessage2 = extractErrorMessageSync(clientError);
|
|
21727
22810
|
OutputFormatter.error({
|
|
@@ -21732,11 +22815,11 @@ var registerAskCommand = (program2) => {
|
|
|
21732
22815
|
processContext.exit(1);
|
|
21733
22816
|
return;
|
|
21734
22817
|
}
|
|
21735
|
-
const [callError, result] = await
|
|
22818
|
+
const [callError, result] = await catchError(client.callTool("SearchDocumentation", {
|
|
21736
22819
|
question: query,
|
|
21737
22820
|
sources: [options.source]
|
|
21738
22821
|
}));
|
|
21739
|
-
await
|
|
22822
|
+
await catchError(client.close());
|
|
21740
22823
|
if (callError) {
|
|
21741
22824
|
const errorMessage2 = extractErrorMessageSync(callError);
|
|
21742
22825
|
OutputFormatter.error({
|
|
@@ -21783,4 +22866,4 @@ var registerCommands = async (program2) => {
|
|
|
21783
22866
|
|
|
21784
22867
|
export { Command, metadata, registerCommands };
|
|
21785
22868
|
|
|
21786
|
-
//# debugId=
|
|
22869
|
+
//# debugId=5DB8B2DEED8C0C9E64756E2164756E21
|