norn-cli 1.11.0 → 1.12.0
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/CHANGELOG.md +19 -0
- package/README.md +1 -1
- package/dist/cli.js +571 -370
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -35,8 +35,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
35
35
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
36
36
|
|
|
37
37
|
// src/pathAccess.ts
|
|
38
|
-
function getPathSegments(
|
|
39
|
-
return
|
|
38
|
+
function getPathSegments(path16) {
|
|
39
|
+
return path16.replace(/\[(\d+)\]/g, ".$1").split(".").filter((part) => part !== "");
|
|
40
40
|
}
|
|
41
41
|
function getPathPartValue(current, part) {
|
|
42
42
|
if (Array.isArray(current) && part === "count") {
|
|
@@ -44,12 +44,12 @@ function getPathPartValue(current, part) {
|
|
|
44
44
|
}
|
|
45
45
|
return current[part];
|
|
46
46
|
}
|
|
47
|
-
function getNestedPathValue(obj,
|
|
48
|
-
if (!
|
|
47
|
+
function getNestedPathValue(obj, path16) {
|
|
48
|
+
if (!path16 || obj === null || obj === void 0) {
|
|
49
49
|
return obj;
|
|
50
50
|
}
|
|
51
51
|
let current = obj;
|
|
52
|
-
for (const part of getPathSegments(
|
|
52
|
+
for (const part of getPathSegments(path16)) {
|
|
53
53
|
if (current === null || current === void 0) {
|
|
54
54
|
return void 0;
|
|
55
55
|
}
|
|
@@ -8910,11 +8910,11 @@ var require_mime_types = __commonJS({
|
|
|
8910
8910
|
}
|
|
8911
8911
|
return exts[0];
|
|
8912
8912
|
}
|
|
8913
|
-
function lookup(
|
|
8914
|
-
if (!
|
|
8913
|
+
function lookup(path16) {
|
|
8914
|
+
if (!path16 || typeof path16 !== "string") {
|
|
8915
8915
|
return false;
|
|
8916
8916
|
}
|
|
8917
|
-
var extension2 = extname3("x." +
|
|
8917
|
+
var extension2 = extname3("x." + path16).toLowerCase().substr(1);
|
|
8918
8918
|
if (!extension2) {
|
|
8919
8919
|
return false;
|
|
8920
8920
|
}
|
|
@@ -10019,11 +10019,11 @@ var require_form_data = __commonJS({
|
|
|
10019
10019
|
"use strict";
|
|
10020
10020
|
var CombinedStream = require_combined_stream();
|
|
10021
10021
|
var util4 = require("util");
|
|
10022
|
-
var
|
|
10022
|
+
var path16 = require("path");
|
|
10023
10023
|
var http3 = require("http");
|
|
10024
10024
|
var https3 = require("https");
|
|
10025
10025
|
var parseUrl = require("url").parse;
|
|
10026
|
-
var
|
|
10026
|
+
var fs20 = require("fs");
|
|
10027
10027
|
var Stream = require("stream").Stream;
|
|
10028
10028
|
var crypto8 = require("crypto");
|
|
10029
10029
|
var mime = require_mime_types();
|
|
@@ -10090,7 +10090,7 @@ var require_form_data = __commonJS({
|
|
|
10090
10090
|
if (value.end != void 0 && value.end != Infinity && value.start != void 0) {
|
|
10091
10091
|
callback(null, value.end + 1 - (value.start ? value.start : 0));
|
|
10092
10092
|
} else {
|
|
10093
|
-
|
|
10093
|
+
fs20.stat(value.path, function(err, stat) {
|
|
10094
10094
|
if (err) {
|
|
10095
10095
|
callback(err);
|
|
10096
10096
|
return;
|
|
@@ -10147,11 +10147,11 @@ var require_form_data = __commonJS({
|
|
|
10147
10147
|
FormData3.prototype._getContentDisposition = function(value, options) {
|
|
10148
10148
|
var filename;
|
|
10149
10149
|
if (typeof options.filepath === "string") {
|
|
10150
|
-
filename =
|
|
10150
|
+
filename = path16.normalize(options.filepath).replace(/\\/g, "/");
|
|
10151
10151
|
} else if (options.filename || value && (value.name || value.path)) {
|
|
10152
|
-
filename =
|
|
10152
|
+
filename = path16.basename(options.filename || value && (value.name || value.path));
|
|
10153
10153
|
} else if (value && value.readable && hasOwn(value, "httpVersion")) {
|
|
10154
|
-
filename =
|
|
10154
|
+
filename = path16.basename(value.client._httpMessage.path || "");
|
|
10155
10155
|
}
|
|
10156
10156
|
if (filename) {
|
|
10157
10157
|
return 'filename="' + filename + '"';
|
|
@@ -15360,8 +15360,8 @@ var require_utils = __commonJS({
|
|
|
15360
15360
|
}
|
|
15361
15361
|
return ind;
|
|
15362
15362
|
}
|
|
15363
|
-
function removeDotSegments(
|
|
15364
|
-
let input2 =
|
|
15363
|
+
function removeDotSegments(path16) {
|
|
15364
|
+
let input2 = path16;
|
|
15365
15365
|
const output2 = [];
|
|
15366
15366
|
let nextSlash = -1;
|
|
15367
15367
|
let len = 0;
|
|
@@ -15560,8 +15560,8 @@ var require_schemes = __commonJS({
|
|
|
15560
15560
|
wsComponent.secure = void 0;
|
|
15561
15561
|
}
|
|
15562
15562
|
if (wsComponent.resourceName) {
|
|
15563
|
-
const [
|
|
15564
|
-
wsComponent.path =
|
|
15563
|
+
const [path16, query] = wsComponent.resourceName.split("?");
|
|
15564
|
+
wsComponent.path = path16 && path16 !== "/" ? path16 : void 0;
|
|
15565
15565
|
wsComponent.query = query;
|
|
15566
15566
|
wsComponent.resourceName = void 0;
|
|
15567
15567
|
}
|
|
@@ -18767,8 +18767,8 @@ function validateAgainstSchemaDetailed(value, schemaPath, basePath, workspaceRoo
|
|
|
18767
18767
|
if (!valid && validate3.errors) {
|
|
18768
18768
|
const errors = validate3.errors.map((err) => convertAjvError(err, value));
|
|
18769
18769
|
const errorStrings = validate3.errors.map((err) => {
|
|
18770
|
-
const
|
|
18771
|
-
return `${
|
|
18770
|
+
const path16 = err.instancePath || "(root)";
|
|
18771
|
+
return `${path16}: ${err.message}`;
|
|
18772
18772
|
});
|
|
18773
18773
|
return {
|
|
18774
18774
|
valid: false,
|
|
@@ -18806,8 +18806,8 @@ function validateAgainstSchemaObjectDetailed(value, schema) {
|
|
|
18806
18806
|
if (!valid && validate3.errors) {
|
|
18807
18807
|
const errors = validate3.errors.map((err) => convertAjvError(err, value));
|
|
18808
18808
|
const errorStrings = validate3.errors.map((err) => {
|
|
18809
|
-
const
|
|
18810
|
-
return `${
|
|
18809
|
+
const path16 = err.instancePath || "(root)";
|
|
18810
|
+
return `${path16}: ${err.message}`;
|
|
18811
18811
|
});
|
|
18812
18812
|
return {
|
|
18813
18813
|
valid: false,
|
|
@@ -18977,7 +18977,7 @@ function resolveValue(expr, responses, variables, getValueByPath2, responseIndex
|
|
|
18977
18977
|
if (refMatch) {
|
|
18978
18978
|
const responseIdx = parseInt(refMatch[1], 10);
|
|
18979
18979
|
const responseIndex = responseIdx - 1;
|
|
18980
|
-
const
|
|
18980
|
+
const path16 = refMatch[2];
|
|
18981
18981
|
if (responseIndex < 0 || responseIndex >= responses.length) {
|
|
18982
18982
|
return {
|
|
18983
18983
|
value: void 0,
|
|
@@ -18985,12 +18985,12 @@ function resolveValue(expr, responses, variables, getValueByPath2, responseIndex
|
|
|
18985
18985
|
};
|
|
18986
18986
|
}
|
|
18987
18987
|
const response = responses[responseIndex];
|
|
18988
|
-
const value = getValueByPath2(response,
|
|
18988
|
+
const value = getValueByPath2(response, path16);
|
|
18989
18989
|
return {
|
|
18990
18990
|
value,
|
|
18991
18991
|
responseIndex: responseIdx,
|
|
18992
18992
|
response,
|
|
18993
|
-
jsonPath:
|
|
18993
|
+
jsonPath: path16,
|
|
18994
18994
|
variableName: responseIndexToVariable?.get(responseIdx)
|
|
18995
18995
|
};
|
|
18996
18996
|
}
|
|
@@ -19007,22 +19007,22 @@ function resolveValue(expr, responses, variables, getValueByPath2, responseIndex
|
|
|
19007
19007
|
if (varName in variables) {
|
|
19008
19008
|
const varValue = variables[varName];
|
|
19009
19009
|
if (typeof varValue === "object" && varValue !== null) {
|
|
19010
|
-
const
|
|
19011
|
-
const value = getNestedValue2(varValue,
|
|
19010
|
+
const path16 = pathPart.replace(/^\./, "");
|
|
19011
|
+
const value = getNestedValue2(varValue, path16);
|
|
19012
19012
|
const isHttpResponse = "status" in varValue && "body" in varValue;
|
|
19013
19013
|
return {
|
|
19014
19014
|
value,
|
|
19015
19015
|
variableName: varName,
|
|
19016
|
-
jsonPath:
|
|
19016
|
+
jsonPath: path16,
|
|
19017
19017
|
response: isHttpResponse ? varValue : void 0
|
|
19018
19018
|
};
|
|
19019
19019
|
}
|
|
19020
19020
|
if (typeof varValue === "string") {
|
|
19021
19021
|
try {
|
|
19022
19022
|
const parsed = JSON.parse(varValue);
|
|
19023
|
-
const
|
|
19024
|
-
const value = getNestedValue2(parsed,
|
|
19025
|
-
return { value, variableName: varName, jsonPath:
|
|
19023
|
+
const path16 = pathPart.replace(/^\./, "");
|
|
19024
|
+
const value = getNestedValue2(parsed, path16);
|
|
19025
|
+
return { value, variableName: varName, jsonPath: path16 };
|
|
19026
19026
|
} catch {
|
|
19027
19027
|
return { value: void 0, error: `Cannot access path on non-object variable: ${varName}` };
|
|
19028
19028
|
}
|
|
@@ -19051,14 +19051,14 @@ function resolveValue(expr, responses, variables, getValueByPath2, responseIndex
|
|
|
19051
19051
|
const varValue = variables[varName];
|
|
19052
19052
|
if (pathPart) {
|
|
19053
19053
|
if (typeof varValue === "object" && varValue !== null) {
|
|
19054
|
-
const
|
|
19055
|
-
return { value: getNestedValue2(varValue,
|
|
19054
|
+
const path16 = pathPart.replace(/^\./, "");
|
|
19055
|
+
return { value: getNestedValue2(varValue, path16) };
|
|
19056
19056
|
}
|
|
19057
19057
|
if (typeof varValue === "string") {
|
|
19058
19058
|
try {
|
|
19059
19059
|
const parsed = JSON.parse(varValue);
|
|
19060
|
-
const
|
|
19061
|
-
return { value: getNestedValue2(parsed,
|
|
19060
|
+
const path16 = pathPart.replace(/^\./, "");
|
|
19061
|
+
return { value: getNestedValue2(parsed, path16) };
|
|
19062
19062
|
} catch {
|
|
19063
19063
|
return { value: void 0, error: `Cannot access path on non-object variable: ${varName}` };
|
|
19064
19064
|
}
|
|
@@ -19095,8 +19095,8 @@ function resolveValue(expr, responses, variables, getValueByPath2, responseIndex
|
|
|
19095
19095
|
}
|
|
19096
19096
|
return { value: void 0, error: `Cannot resolve expression: ${trimmed}` };
|
|
19097
19097
|
}
|
|
19098
|
-
function getNestedValue2(obj,
|
|
19099
|
-
return getNestedPathValue(obj,
|
|
19098
|
+
function getNestedValue2(obj, path16) {
|
|
19099
|
+
return getNestedPathValue(obj, path16);
|
|
19100
19100
|
}
|
|
19101
19101
|
function areValuesEqual(leftValue, rightValue) {
|
|
19102
19102
|
if (leftValue === rightValue) {
|
|
@@ -20978,15 +20978,15 @@ var require_pg_connection_string = __commonJS({
|
|
|
20978
20978
|
if (config2.sslcert || config2.sslkey || config2.sslrootcert || config2.sslmode) {
|
|
20979
20979
|
config2.ssl = {};
|
|
20980
20980
|
}
|
|
20981
|
-
const
|
|
20981
|
+
const fs20 = config2.sslcert || config2.sslkey || config2.sslrootcert ? require("fs") : null;
|
|
20982
20982
|
if (config2.sslcert) {
|
|
20983
|
-
config2.ssl.cert =
|
|
20983
|
+
config2.ssl.cert = fs20.readFileSync(config2.sslcert).toString();
|
|
20984
20984
|
}
|
|
20985
20985
|
if (config2.sslkey) {
|
|
20986
|
-
config2.ssl.key =
|
|
20986
|
+
config2.ssl.key = fs20.readFileSync(config2.sslkey).toString();
|
|
20987
20987
|
}
|
|
20988
20988
|
if (config2.sslrootcert) {
|
|
20989
|
-
config2.ssl.ca =
|
|
20989
|
+
config2.ssl.ca = fs20.readFileSync(config2.sslrootcert).toString();
|
|
20990
20990
|
}
|
|
20991
20991
|
if (options.useLibpqCompat && config2.uselibpqcompat) {
|
|
20992
20992
|
throw new Error("Both useLibpqCompat and uselibpqcompat are set. Please use only one of them.");
|
|
@@ -22751,7 +22751,7 @@ var require_split2 = __commonJS({
|
|
|
22751
22751
|
var require_helper = __commonJS({
|
|
22752
22752
|
"node_modules/pgpass/lib/helper.js"(exports2, module2) {
|
|
22753
22753
|
"use strict";
|
|
22754
|
-
var
|
|
22754
|
+
var path16 = require("path");
|
|
22755
22755
|
var Stream = require("stream").Stream;
|
|
22756
22756
|
var split = require_split2();
|
|
22757
22757
|
var util4 = require("util");
|
|
@@ -22790,7 +22790,7 @@ var require_helper = __commonJS({
|
|
|
22790
22790
|
};
|
|
22791
22791
|
module2.exports.getFileName = function(rawEnv) {
|
|
22792
22792
|
var env3 = rawEnv || process.env;
|
|
22793
|
-
var file2 = env3.PGPASSFILE || (isWin ?
|
|
22793
|
+
var file2 = env3.PGPASSFILE || (isWin ? path16.join(env3.APPDATA || "./", "postgresql", "pgpass.conf") : path16.join(env3.HOME || "./", ".pgpass"));
|
|
22794
22794
|
return file2;
|
|
22795
22795
|
};
|
|
22796
22796
|
module2.exports.usePgPass = function(stats, fname) {
|
|
@@ -22922,16 +22922,16 @@ var require_helper = __commonJS({
|
|
|
22922
22922
|
var require_lib = __commonJS({
|
|
22923
22923
|
"node_modules/pgpass/lib/index.js"(exports2, module2) {
|
|
22924
22924
|
"use strict";
|
|
22925
|
-
var
|
|
22926
|
-
var
|
|
22925
|
+
var path16 = require("path");
|
|
22926
|
+
var fs20 = require("fs");
|
|
22927
22927
|
var helper = require_helper();
|
|
22928
22928
|
module2.exports = function(connInfo, cb) {
|
|
22929
22929
|
var file2 = helper.getFileName();
|
|
22930
|
-
|
|
22930
|
+
fs20.stat(file2, function(err, stat) {
|
|
22931
22931
|
if (err || !helper.usePgPass(stat, file2)) {
|
|
22932
22932
|
return cb(void 0);
|
|
22933
22933
|
}
|
|
22934
|
-
var st =
|
|
22934
|
+
var st = fs20.createReadStream(file2);
|
|
22935
22935
|
helper.getPassword(connInfo, st, cb);
|
|
22936
22936
|
});
|
|
22937
22937
|
};
|
|
@@ -25995,7 +25995,7 @@ var require_table = __commonJS({
|
|
|
25995
25995
|
let cursor = -1;
|
|
25996
25996
|
let buffer = "";
|
|
25997
25997
|
let escaped = false;
|
|
25998
|
-
const
|
|
25998
|
+
const path16 = [];
|
|
25999
25999
|
while (++cursor < length) {
|
|
26000
26000
|
const char = name.charAt(cursor);
|
|
26001
26001
|
if (char === "[") {
|
|
@@ -26014,7 +26014,7 @@ var require_table = __commonJS({
|
|
|
26014
26014
|
if (escaped) {
|
|
26015
26015
|
buffer += char;
|
|
26016
26016
|
} else {
|
|
26017
|
-
|
|
26017
|
+
path16.push(buffer);
|
|
26018
26018
|
buffer = "";
|
|
26019
26019
|
}
|
|
26020
26020
|
} else {
|
|
@@ -26022,26 +26022,26 @@ var require_table = __commonJS({
|
|
|
26022
26022
|
}
|
|
26023
26023
|
}
|
|
26024
26024
|
if (buffer) {
|
|
26025
|
-
|
|
26025
|
+
path16.push(buffer);
|
|
26026
26026
|
}
|
|
26027
|
-
switch (
|
|
26027
|
+
switch (path16.length) {
|
|
26028
26028
|
case 1:
|
|
26029
26029
|
return {
|
|
26030
|
-
name:
|
|
26030
|
+
name: path16[0],
|
|
26031
26031
|
schema: null,
|
|
26032
26032
|
database: null
|
|
26033
26033
|
};
|
|
26034
26034
|
case 2:
|
|
26035
26035
|
return {
|
|
26036
|
-
name:
|
|
26037
|
-
schema:
|
|
26036
|
+
name: path16[1],
|
|
26037
|
+
schema: path16[0],
|
|
26038
26038
|
database: null
|
|
26039
26039
|
};
|
|
26040
26040
|
case 3:
|
|
26041
26041
|
return {
|
|
26042
|
-
name:
|
|
26043
|
-
schema:
|
|
26044
|
-
database:
|
|
26042
|
+
name: path16[2],
|
|
26043
|
+
schema: path16[1],
|
|
26044
|
+
database: path16[0]
|
|
26045
26045
|
};
|
|
26046
26046
|
default:
|
|
26047
26047
|
throw new Error("Invalid table name.");
|
|
@@ -29527,13 +29527,13 @@ function __disposeResources(env3) {
|
|
|
29527
29527
|
}
|
|
29528
29528
|
return next();
|
|
29529
29529
|
}
|
|
29530
|
-
function __rewriteRelativeImportExtension(
|
|
29531
|
-
if (typeof
|
|
29532
|
-
return
|
|
29530
|
+
function __rewriteRelativeImportExtension(path16, preserveJsx) {
|
|
29531
|
+
if (typeof path16 === "string" && /^\.\.?\//.test(path16)) {
|
|
29532
|
+
return path16.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) {
|
|
29533
29533
|
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js";
|
|
29534
29534
|
});
|
|
29535
29535
|
}
|
|
29536
|
-
return
|
|
29536
|
+
return path16;
|
|
29537
29537
|
}
|
|
29538
29538
|
var extendStatics, __assign, __createBinding, __setModuleDefault, ownKeys, _SuppressedError, tslib_es6_default;
|
|
29539
29539
|
var init_tslib_es6 = __esm({
|
|
@@ -29680,8 +29680,8 @@ var require_msalPlugins = __commonJS({
|
|
|
29680
29680
|
}
|
|
29681
29681
|
};
|
|
29682
29682
|
exports2.msalNodeFlowVSCodeCredentialControl = {
|
|
29683
|
-
setVSCodeAuthRecordPath(
|
|
29684
|
-
exports2.vsCodeAuthRecordPath =
|
|
29683
|
+
setVSCodeAuthRecordPath(path16) {
|
|
29684
|
+
exports2.vsCodeAuthRecordPath = path16;
|
|
29685
29685
|
},
|
|
29686
29686
|
setVSCodeBroker(broker) {
|
|
29687
29687
|
exports2.vsCodeBrokerInfo = {
|
|
@@ -42422,8 +42422,8 @@ var require_msal_node = __commonJS({
|
|
|
42422
42422
|
var crypto8 = require("crypto");
|
|
42423
42423
|
var msalCommon = require_lib4();
|
|
42424
42424
|
var jwt2 = require_jsonwebtoken();
|
|
42425
|
-
var
|
|
42426
|
-
var
|
|
42425
|
+
var fs20 = require("fs");
|
|
42426
|
+
var path16 = require("path");
|
|
42427
42427
|
var Serializer = class {
|
|
42428
42428
|
/**
|
|
42429
42429
|
* serialize the JSON blob
|
|
@@ -52171,7 +52171,7 @@ Headers: ${JSON.stringify(headers)}`
|
|
|
52171
52171
|
if (!identityEndpoint || !imdsEndpoint) {
|
|
52172
52172
|
const fileDetectionPath = AZURE_ARC_FILE_DETECTION[process.platform];
|
|
52173
52173
|
try {
|
|
52174
|
-
|
|
52174
|
+
fs20.accessSync(fileDetectionPath, fs20.constants.F_OK | fs20.constants.R_OK);
|
|
52175
52175
|
identityEndpoint = DEFAULT_AZURE_ARC_IDENTITY_ENDPOINT;
|
|
52176
52176
|
imdsEndpoint = HIMDS_EXECUTABLE_HELPER_STRING;
|
|
52177
52177
|
} catch (err) {
|
|
@@ -52274,7 +52274,7 @@ Headers: ${JSON.stringify(headers)}`
|
|
|
52274
52274
|
throw createManagedIdentityError(platformNotSupported);
|
|
52275
52275
|
}
|
|
52276
52276
|
const expectedSecretFilePath = SUPPORTED_AZURE_ARC_PLATFORMS[process.platform];
|
|
52277
|
-
const fileName =
|
|
52277
|
+
const fileName = path16.basename(secretFilePath);
|
|
52278
52278
|
if (!fileName.endsWith(".key")) {
|
|
52279
52279
|
throw createManagedIdentityError(invalidFileExtension);
|
|
52280
52280
|
}
|
|
@@ -52283,7 +52283,7 @@ Headers: ${JSON.stringify(headers)}`
|
|
|
52283
52283
|
}
|
|
52284
52284
|
let secretFileSize;
|
|
52285
52285
|
try {
|
|
52286
|
-
secretFileSize = await
|
|
52286
|
+
secretFileSize = await fs20.statSync(secretFilePath).size;
|
|
52287
52287
|
} catch (e) {
|
|
52288
52288
|
throw createManagedIdentityError(unableToReadSecretFile);
|
|
52289
52289
|
}
|
|
@@ -52292,7 +52292,7 @@ Headers: ${JSON.stringify(headers)}`
|
|
|
52292
52292
|
}
|
|
52293
52293
|
let secret;
|
|
52294
52294
|
try {
|
|
52295
|
-
secret =
|
|
52295
|
+
secret = fs20.readFileSync(secretFilePath, EncodingTypes.UTF8);
|
|
52296
52296
|
} catch (e) {
|
|
52297
52297
|
throw createManagedIdentityError(unableToReadSecretFile);
|
|
52298
52298
|
}
|
|
@@ -58671,8 +58671,8 @@ var require_getClient = __commonJS({
|
|
|
58671
58671
|
}
|
|
58672
58672
|
const { allowInsecureConnection, httpClient } = clientOptions;
|
|
58673
58673
|
const endpointUrl = clientOptions.endpoint ?? endpoint;
|
|
58674
|
-
const client = (
|
|
58675
|
-
const getUrl = (requestOptions) => (0, import_urlHelpers.buildRequestUrl)(endpointUrl,
|
|
58674
|
+
const client = (path16, ...args) => {
|
|
58675
|
+
const getUrl = (requestOptions) => (0, import_urlHelpers.buildRequestUrl)(endpointUrl, path16, args, { allowInsecureConnection, ...requestOptions });
|
|
58676
58676
|
return {
|
|
58677
58677
|
get: (requestOptions = {}) => {
|
|
58678
58678
|
return buildOperation(
|
|
@@ -61577,15 +61577,15 @@ var require_urlHelpers2 = __commonJS({
|
|
|
61577
61577
|
let isAbsolutePath = false;
|
|
61578
61578
|
let requestUrl = replaceAll(baseUri, urlReplacements);
|
|
61579
61579
|
if (operationSpec.path) {
|
|
61580
|
-
let
|
|
61581
|
-
if (operationSpec.path === "/{nextLink}" &&
|
|
61582
|
-
|
|
61580
|
+
let path16 = replaceAll(operationSpec.path, urlReplacements);
|
|
61581
|
+
if (operationSpec.path === "/{nextLink}" && path16.startsWith("/")) {
|
|
61582
|
+
path16 = path16.substring(1);
|
|
61583
61583
|
}
|
|
61584
|
-
if (isAbsoluteUrl(
|
|
61585
|
-
requestUrl =
|
|
61584
|
+
if (isAbsoluteUrl(path16)) {
|
|
61585
|
+
requestUrl = path16;
|
|
61586
61586
|
isAbsolutePath = true;
|
|
61587
61587
|
} else {
|
|
61588
|
-
requestUrl = appendPath(requestUrl,
|
|
61588
|
+
requestUrl = appendPath(requestUrl, path16);
|
|
61589
61589
|
}
|
|
61590
61590
|
}
|
|
61591
61591
|
const { queryParams, sequenceParams } = calculateQueryParameters(operationSpec, operationArguments, fallbackObject);
|
|
@@ -61631,9 +61631,9 @@ var require_urlHelpers2 = __commonJS({
|
|
|
61631
61631
|
}
|
|
61632
61632
|
const searchStart = pathToAppend.indexOf("?");
|
|
61633
61633
|
if (searchStart !== -1) {
|
|
61634
|
-
const
|
|
61634
|
+
const path16 = pathToAppend.substring(0, searchStart);
|
|
61635
61635
|
const search = pathToAppend.substring(searchStart + 1);
|
|
61636
|
-
newPath = newPath +
|
|
61636
|
+
newPath = newPath + path16;
|
|
61637
61637
|
if (search) {
|
|
61638
61638
|
parsedUrl.search = parsedUrl.search ? `${parsedUrl.search}&${search}` : search;
|
|
61639
61639
|
}
|
|
@@ -101542,12 +101542,12 @@ var require_dist5 = __commonJS({
|
|
|
101542
101542
|
throw new Error(`Unknown format "${name}"`);
|
|
101543
101543
|
return f;
|
|
101544
101544
|
};
|
|
101545
|
-
function addFormats(ajv2, list,
|
|
101545
|
+
function addFormats(ajv2, list, fs20, exportName) {
|
|
101546
101546
|
var _a2;
|
|
101547
101547
|
var _b;
|
|
101548
101548
|
(_a2 = (_b = ajv2.opts.code).formats) !== null && _a2 !== void 0 ? _a2 : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
|
|
101549
101549
|
for (const f of list)
|
|
101550
|
-
ajv2.addFormat(f,
|
|
101550
|
+
ajv2.addFormat(f, fs20[f]);
|
|
101551
101551
|
}
|
|
101552
101552
|
module2.exports = exports2 = formatsPlugin;
|
|
101553
101553
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
@@ -101560,8 +101560,8 @@ var require_windows = __commonJS({
|
|
|
101560
101560
|
"node_modules/isexe/windows.js"(exports2, module2) {
|
|
101561
101561
|
module2.exports = isexe;
|
|
101562
101562
|
isexe.sync = sync;
|
|
101563
|
-
var
|
|
101564
|
-
function checkPathExt(
|
|
101563
|
+
var fs20 = require("fs");
|
|
101564
|
+
function checkPathExt(path16, options) {
|
|
101565
101565
|
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
101566
101566
|
if (!pathext) {
|
|
101567
101567
|
return true;
|
|
@@ -101572,25 +101572,25 @@ var require_windows = __commonJS({
|
|
|
101572
101572
|
}
|
|
101573
101573
|
for (var i = 0; i < pathext.length; i++) {
|
|
101574
101574
|
var p = pathext[i].toLowerCase();
|
|
101575
|
-
if (p &&
|
|
101575
|
+
if (p && path16.substr(-p.length).toLowerCase() === p) {
|
|
101576
101576
|
return true;
|
|
101577
101577
|
}
|
|
101578
101578
|
}
|
|
101579
101579
|
return false;
|
|
101580
101580
|
}
|
|
101581
|
-
function checkStat(stat,
|
|
101581
|
+
function checkStat(stat, path16, options) {
|
|
101582
101582
|
if (!stat.isSymbolicLink() && !stat.isFile()) {
|
|
101583
101583
|
return false;
|
|
101584
101584
|
}
|
|
101585
|
-
return checkPathExt(
|
|
101585
|
+
return checkPathExt(path16, options);
|
|
101586
101586
|
}
|
|
101587
|
-
function isexe(
|
|
101588
|
-
|
|
101589
|
-
cb(er, er ? false : checkStat(stat,
|
|
101587
|
+
function isexe(path16, options, cb) {
|
|
101588
|
+
fs20.stat(path16, function(er, stat) {
|
|
101589
|
+
cb(er, er ? false : checkStat(stat, path16, options));
|
|
101590
101590
|
});
|
|
101591
101591
|
}
|
|
101592
|
-
function sync(
|
|
101593
|
-
return checkStat(
|
|
101592
|
+
function sync(path16, options) {
|
|
101593
|
+
return checkStat(fs20.statSync(path16), path16, options);
|
|
101594
101594
|
}
|
|
101595
101595
|
}
|
|
101596
101596
|
});
|
|
@@ -101600,14 +101600,14 @@ var require_mode = __commonJS({
|
|
|
101600
101600
|
"node_modules/isexe/mode.js"(exports2, module2) {
|
|
101601
101601
|
module2.exports = isexe;
|
|
101602
101602
|
isexe.sync = sync;
|
|
101603
|
-
var
|
|
101604
|
-
function isexe(
|
|
101605
|
-
|
|
101603
|
+
var fs20 = require("fs");
|
|
101604
|
+
function isexe(path16, options, cb) {
|
|
101605
|
+
fs20.stat(path16, function(er, stat) {
|
|
101606
101606
|
cb(er, er ? false : checkStat(stat, options));
|
|
101607
101607
|
});
|
|
101608
101608
|
}
|
|
101609
|
-
function sync(
|
|
101610
|
-
return checkStat(
|
|
101609
|
+
function sync(path16, options) {
|
|
101610
|
+
return checkStat(fs20.statSync(path16), options);
|
|
101611
101611
|
}
|
|
101612
101612
|
function checkStat(stat, options) {
|
|
101613
101613
|
return stat.isFile() && checkMode(stat, options);
|
|
@@ -101631,7 +101631,7 @@ var require_mode = __commonJS({
|
|
|
101631
101631
|
// node_modules/isexe/index.js
|
|
101632
101632
|
var require_isexe = __commonJS({
|
|
101633
101633
|
"node_modules/isexe/index.js"(exports2, module2) {
|
|
101634
|
-
var
|
|
101634
|
+
var fs20 = require("fs");
|
|
101635
101635
|
var core;
|
|
101636
101636
|
if (process.platform === "win32" || global.TESTING_WINDOWS) {
|
|
101637
101637
|
core = require_windows();
|
|
@@ -101640,7 +101640,7 @@ var require_isexe = __commonJS({
|
|
|
101640
101640
|
}
|
|
101641
101641
|
module2.exports = isexe;
|
|
101642
101642
|
isexe.sync = sync;
|
|
101643
|
-
function isexe(
|
|
101643
|
+
function isexe(path16, options, cb) {
|
|
101644
101644
|
if (typeof options === "function") {
|
|
101645
101645
|
cb = options;
|
|
101646
101646
|
options = {};
|
|
@@ -101650,7 +101650,7 @@ var require_isexe = __commonJS({
|
|
|
101650
101650
|
throw new TypeError("callback not provided");
|
|
101651
101651
|
}
|
|
101652
101652
|
return new Promise(function(resolve13, reject) {
|
|
101653
|
-
isexe(
|
|
101653
|
+
isexe(path16, options || {}, function(er, is) {
|
|
101654
101654
|
if (er) {
|
|
101655
101655
|
reject(er);
|
|
101656
101656
|
} else {
|
|
@@ -101659,7 +101659,7 @@ var require_isexe = __commonJS({
|
|
|
101659
101659
|
});
|
|
101660
101660
|
});
|
|
101661
101661
|
}
|
|
101662
|
-
core(
|
|
101662
|
+
core(path16, options || {}, function(er, is) {
|
|
101663
101663
|
if (er) {
|
|
101664
101664
|
if (er.code === "EACCES" || options && options.ignoreErrors) {
|
|
101665
101665
|
er = null;
|
|
@@ -101669,9 +101669,9 @@ var require_isexe = __commonJS({
|
|
|
101669
101669
|
cb(er, is);
|
|
101670
101670
|
});
|
|
101671
101671
|
}
|
|
101672
|
-
function sync(
|
|
101672
|
+
function sync(path16, options) {
|
|
101673
101673
|
try {
|
|
101674
|
-
return core.sync(
|
|
101674
|
+
return core.sync(path16, options || {});
|
|
101675
101675
|
} catch (er) {
|
|
101676
101676
|
if (options && options.ignoreErrors || er.code === "EACCES") {
|
|
101677
101677
|
return false;
|
|
@@ -101687,7 +101687,7 @@ var require_isexe = __commonJS({
|
|
|
101687
101687
|
var require_which = __commonJS({
|
|
101688
101688
|
"node_modules/which/which.js"(exports2, module2) {
|
|
101689
101689
|
var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
101690
|
-
var
|
|
101690
|
+
var path16 = require("path");
|
|
101691
101691
|
var COLON = isWindows ? ";" : ":";
|
|
101692
101692
|
var isexe = require_isexe();
|
|
101693
101693
|
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
@@ -101725,7 +101725,7 @@ var require_which = __commonJS({
|
|
|
101725
101725
|
return opt.all && found.length ? resolve13(found) : reject(getNotFoundError(cmd));
|
|
101726
101726
|
const ppRaw = pathEnv[i];
|
|
101727
101727
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
101728
|
-
const pCmd =
|
|
101728
|
+
const pCmd = path16.join(pathPart, cmd);
|
|
101729
101729
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
101730
101730
|
resolve13(subStep(p, i, 0));
|
|
101731
101731
|
});
|
|
@@ -101752,7 +101752,7 @@ var require_which = __commonJS({
|
|
|
101752
101752
|
for (let i = 0; i < pathEnv.length; i++) {
|
|
101753
101753
|
const ppRaw = pathEnv[i];
|
|
101754
101754
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
101755
|
-
const pCmd =
|
|
101755
|
+
const pCmd = path16.join(pathPart, cmd);
|
|
101756
101756
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
101757
101757
|
for (let j = 0; j < pathExt.length; j++) {
|
|
101758
101758
|
const cur = p + pathExt[j];
|
|
@@ -101800,7 +101800,7 @@ var require_path_key = __commonJS({
|
|
|
101800
101800
|
var require_resolveCommand = __commonJS({
|
|
101801
101801
|
"node_modules/cross-spawn/lib/util/resolveCommand.js"(exports2, module2) {
|
|
101802
101802
|
"use strict";
|
|
101803
|
-
var
|
|
101803
|
+
var path16 = require("path");
|
|
101804
101804
|
var which = require_which();
|
|
101805
101805
|
var getPathKey = require_path_key();
|
|
101806
101806
|
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
@@ -101818,7 +101818,7 @@ var require_resolveCommand = __commonJS({
|
|
|
101818
101818
|
try {
|
|
101819
101819
|
resolved = which.sync(parsed.command, {
|
|
101820
101820
|
path: env3[getPathKey({ env: env3 })],
|
|
101821
|
-
pathExt: withoutPathExt ?
|
|
101821
|
+
pathExt: withoutPathExt ? path16.delimiter : void 0
|
|
101822
101822
|
});
|
|
101823
101823
|
} catch (e) {
|
|
101824
101824
|
} finally {
|
|
@@ -101827,7 +101827,7 @@ var require_resolveCommand = __commonJS({
|
|
|
101827
101827
|
}
|
|
101828
101828
|
}
|
|
101829
101829
|
if (resolved) {
|
|
101830
|
-
resolved =
|
|
101830
|
+
resolved = path16.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
|
|
101831
101831
|
}
|
|
101832
101832
|
return resolved;
|
|
101833
101833
|
}
|
|
@@ -101881,8 +101881,8 @@ var require_shebang_command = __commonJS({
|
|
|
101881
101881
|
if (!match) {
|
|
101882
101882
|
return null;
|
|
101883
101883
|
}
|
|
101884
|
-
const [
|
|
101885
|
-
const binary =
|
|
101884
|
+
const [path16, argument] = match[0].replace(/#! ?/, "").split(" ");
|
|
101885
|
+
const binary = path16.split("/").pop();
|
|
101886
101886
|
if (binary === "env") {
|
|
101887
101887
|
return argument;
|
|
101888
101888
|
}
|
|
@@ -101895,16 +101895,16 @@ var require_shebang_command = __commonJS({
|
|
|
101895
101895
|
var require_readShebang = __commonJS({
|
|
101896
101896
|
"node_modules/cross-spawn/lib/util/readShebang.js"(exports2, module2) {
|
|
101897
101897
|
"use strict";
|
|
101898
|
-
var
|
|
101898
|
+
var fs20 = require("fs");
|
|
101899
101899
|
var shebangCommand = require_shebang_command();
|
|
101900
101900
|
function readShebang(command) {
|
|
101901
101901
|
const size = 150;
|
|
101902
101902
|
const buffer = Buffer.alloc(size);
|
|
101903
101903
|
let fd;
|
|
101904
101904
|
try {
|
|
101905
|
-
fd =
|
|
101906
|
-
|
|
101907
|
-
|
|
101905
|
+
fd = fs20.openSync(command, "r");
|
|
101906
|
+
fs20.readSync(fd, buffer, 0, size, 0);
|
|
101907
|
+
fs20.closeSync(fd);
|
|
101908
101908
|
} catch (e) {
|
|
101909
101909
|
}
|
|
101910
101910
|
return shebangCommand(buffer.toString());
|
|
@@ -101917,7 +101917,7 @@ var require_readShebang = __commonJS({
|
|
|
101917
101917
|
var require_parse2 = __commonJS({
|
|
101918
101918
|
"node_modules/cross-spawn/lib/parse.js"(exports2, module2) {
|
|
101919
101919
|
"use strict";
|
|
101920
|
-
var
|
|
101920
|
+
var path16 = require("path");
|
|
101921
101921
|
var resolveCommand = require_resolveCommand();
|
|
101922
101922
|
var escape2 = require_escape();
|
|
101923
101923
|
var readShebang = require_readShebang();
|
|
@@ -101942,7 +101942,7 @@ var require_parse2 = __commonJS({
|
|
|
101942
101942
|
const needsShell = !isExecutableRegExp.test(commandFile);
|
|
101943
101943
|
if (parsed.options.forceShell || needsShell) {
|
|
101944
101944
|
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
101945
|
-
parsed.command =
|
|
101945
|
+
parsed.command = path16.normalize(parsed.command);
|
|
101946
101946
|
parsed.command = escape2.command(parsed.command);
|
|
101947
101947
|
parsed.args = parsed.args.map((arg) => escape2.argument(arg, needsDoubleEscapeMetaChars));
|
|
101948
101948
|
const shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
@@ -102591,19 +102591,19 @@ var init_source = __esm({
|
|
|
102591
102591
|
});
|
|
102592
102592
|
|
|
102593
102593
|
// src/cli.ts
|
|
102594
|
-
var
|
|
102594
|
+
var fs19 = __toESM(require("fs"));
|
|
102595
102595
|
var fsPromises = __toESM(require("fs/promises"));
|
|
102596
|
-
var
|
|
102596
|
+
var path15 = __toESM(require("path"));
|
|
102597
102597
|
|
|
102598
102598
|
// src/parser.ts
|
|
102599
102599
|
var path = __toESM(require("path"));
|
|
102600
102600
|
|
|
102601
102601
|
// src/nornapiParser.ts
|
|
102602
|
-
function extractPathParameters(
|
|
102602
|
+
function extractPathParameters(path16) {
|
|
102603
102603
|
const params = [];
|
|
102604
102604
|
const regex = /(?<!\{)\{([a-zA-Z_][a-zA-Z0-9_]*)\}(?!\})/g;
|
|
102605
102605
|
let match;
|
|
102606
|
-
while ((match = regex.exec(
|
|
102606
|
+
while ((match = regex.exec(path16)) !== null) {
|
|
102607
102607
|
params.push(match[1]);
|
|
102608
102608
|
}
|
|
102609
102609
|
return params;
|
|
@@ -102653,12 +102653,12 @@ function parseNornApiFile(content) {
|
|
|
102653
102653
|
if (inEndpointsBlock) {
|
|
102654
102654
|
const endpointMatch = trimmed.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\s*:\s*(GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS)\s+(.+)$/i);
|
|
102655
102655
|
if (endpointMatch) {
|
|
102656
|
-
const
|
|
102656
|
+
const path16 = endpointMatch[3].trim();
|
|
102657
102657
|
endpoints.push({
|
|
102658
102658
|
name: endpointMatch[1],
|
|
102659
102659
|
method: endpointMatch[2].toUpperCase(),
|
|
102660
|
-
path:
|
|
102661
|
-
parameters: extractPathParameters(
|
|
102660
|
+
path: path16,
|
|
102661
|
+
parameters: extractPathParameters(path16)
|
|
102662
102662
|
});
|
|
102663
102663
|
}
|
|
102664
102664
|
continue;
|
|
@@ -103241,8 +103241,8 @@ function extractFileLevelVariables(text) {
|
|
|
103241
103241
|
}
|
|
103242
103242
|
return variables;
|
|
103243
103243
|
}
|
|
103244
|
-
function getNestedValue(obj,
|
|
103245
|
-
return getNestedPathValue(obj,
|
|
103244
|
+
function getNestedValue(obj, path16) {
|
|
103245
|
+
return getNestedPathValue(obj, path16);
|
|
103246
103246
|
}
|
|
103247
103247
|
function valueToString(value) {
|
|
103248
103248
|
if (value === null) {
|
|
@@ -103286,8 +103286,8 @@ function substituteVariables(text, variables) {
|
|
|
103286
103286
|
const value = variables[varName];
|
|
103287
103287
|
if (typeof value === "object" && value !== null) {
|
|
103288
103288
|
if (pathPart) {
|
|
103289
|
-
const
|
|
103290
|
-
const nestedValue = getNestedValue(value,
|
|
103289
|
+
const path16 = pathPart.replace(/^\./, "");
|
|
103290
|
+
const nestedValue = getNestedValue(value, path16);
|
|
103291
103291
|
if (nestedValue === void 0 && varName === ENV_SCOPE_KEY) {
|
|
103292
103292
|
return match;
|
|
103293
103293
|
}
|
|
@@ -103301,8 +103301,8 @@ function substituteVariables(text, variables) {
|
|
|
103301
103301
|
if (pathPart && typeof value === "string") {
|
|
103302
103302
|
try {
|
|
103303
103303
|
const parsed = JSON.parse(value);
|
|
103304
|
-
const
|
|
103305
|
-
const nestedValue = getNestedValue(parsed,
|
|
103304
|
+
const path16 = pathPart.replace(/^\./, "");
|
|
103305
|
+
const nestedValue = getNestedValue(parsed, path16);
|
|
103306
103306
|
if (nestedValue === void 0 && varName === ENV_SCOPE_KEY) {
|
|
103307
103307
|
return match;
|
|
103308
103308
|
}
|
|
@@ -104151,9 +104151,9 @@ function isVisitable(thing) {
|
|
|
104151
104151
|
function removeBrackets(key) {
|
|
104152
104152
|
return utils_default.endsWith(key, "[]") ? key.slice(0, -2) : key;
|
|
104153
104153
|
}
|
|
104154
|
-
function renderKey(
|
|
104155
|
-
if (!
|
|
104156
|
-
return
|
|
104154
|
+
function renderKey(path16, key, dots) {
|
|
104155
|
+
if (!path16) return key;
|
|
104156
|
+
return path16.concat(key).map(function each(token, i) {
|
|
104157
104157
|
token = removeBrackets(token);
|
|
104158
104158
|
return !dots && i ? "[" + token + "]" : token;
|
|
104159
104159
|
}).join(dots ? "." : "");
|
|
@@ -104201,9 +104201,9 @@ function toFormData(obj, formData, options) {
|
|
|
104201
104201
|
}
|
|
104202
104202
|
return value;
|
|
104203
104203
|
}
|
|
104204
|
-
function defaultVisitor(value, key,
|
|
104204
|
+
function defaultVisitor(value, key, path16) {
|
|
104205
104205
|
let arr = value;
|
|
104206
|
-
if (value && !
|
|
104206
|
+
if (value && !path16 && typeof value === "object") {
|
|
104207
104207
|
if (utils_default.endsWith(key, "{}")) {
|
|
104208
104208
|
key = metaTokens ? key : key.slice(0, -2);
|
|
104209
104209
|
value = JSON.stringify(value);
|
|
@@ -104222,7 +104222,7 @@ function toFormData(obj, formData, options) {
|
|
|
104222
104222
|
if (isVisitable(value)) {
|
|
104223
104223
|
return true;
|
|
104224
104224
|
}
|
|
104225
|
-
formData.append(renderKey(
|
|
104225
|
+
formData.append(renderKey(path16, key, dots), convertValue(value));
|
|
104226
104226
|
return false;
|
|
104227
104227
|
}
|
|
104228
104228
|
const stack = [];
|
|
@@ -104231,10 +104231,10 @@ function toFormData(obj, formData, options) {
|
|
|
104231
104231
|
convertValue,
|
|
104232
104232
|
isVisitable
|
|
104233
104233
|
});
|
|
104234
|
-
function build(value,
|
|
104234
|
+
function build(value, path16) {
|
|
104235
104235
|
if (utils_default.isUndefined(value)) return;
|
|
104236
104236
|
if (stack.indexOf(value) !== -1) {
|
|
104237
|
-
throw Error("Circular reference detected in " +
|
|
104237
|
+
throw Error("Circular reference detected in " + path16.join("."));
|
|
104238
104238
|
}
|
|
104239
104239
|
stack.push(value);
|
|
104240
104240
|
utils_default.forEach(value, function each(el, key) {
|
|
@@ -104242,11 +104242,11 @@ function toFormData(obj, formData, options) {
|
|
|
104242
104242
|
formData,
|
|
104243
104243
|
el,
|
|
104244
104244
|
utils_default.isString(key) ? key.trim() : key,
|
|
104245
|
-
|
|
104245
|
+
path16,
|
|
104246
104246
|
exposedHelpers
|
|
104247
104247
|
);
|
|
104248
104248
|
if (result === true) {
|
|
104249
|
-
build(el,
|
|
104249
|
+
build(el, path16 ? path16.concat(key) : [key]);
|
|
104250
104250
|
}
|
|
104251
104251
|
});
|
|
104252
104252
|
stack.pop();
|
|
@@ -104458,7 +104458,7 @@ var platform_default = {
|
|
|
104458
104458
|
// node_modules/axios/lib/helpers/toURLEncodedForm.js
|
|
104459
104459
|
function toURLEncodedForm(data, options) {
|
|
104460
104460
|
return toFormData_default(data, new platform_default.classes.URLSearchParams(), {
|
|
104461
|
-
visitor: function(value, key,
|
|
104461
|
+
visitor: function(value, key, path16, helpers) {
|
|
104462
104462
|
if (platform_default.isNode && utils_default.isBuffer(value)) {
|
|
104463
104463
|
this.append(key, value.toString("base64"));
|
|
104464
104464
|
return false;
|
|
@@ -104488,11 +104488,11 @@ function arrayToObject(arr) {
|
|
|
104488
104488
|
return obj;
|
|
104489
104489
|
}
|
|
104490
104490
|
function formDataToJSON(formData) {
|
|
104491
|
-
function buildPath(
|
|
104492
|
-
let name =
|
|
104491
|
+
function buildPath(path16, value, target, index) {
|
|
104492
|
+
let name = path16[index++];
|
|
104493
104493
|
if (name === "__proto__") return true;
|
|
104494
104494
|
const isNumericKey = Number.isFinite(+name);
|
|
104495
|
-
const isLast = index >=
|
|
104495
|
+
const isLast = index >= path16.length;
|
|
104496
104496
|
name = !name && utils_default.isArray(target) ? target.length : name;
|
|
104497
104497
|
if (isLast) {
|
|
104498
104498
|
if (utils_default.hasOwnProp(target, name)) {
|
|
@@ -104505,7 +104505,7 @@ function formDataToJSON(formData) {
|
|
|
104505
104505
|
if (!target[name] || !utils_default.isObject(target[name])) {
|
|
104506
104506
|
target[name] = [];
|
|
104507
104507
|
}
|
|
104508
|
-
const result = buildPath(
|
|
104508
|
+
const result = buildPath(path16, value, target[name], index);
|
|
104509
104509
|
if (result && utils_default.isArray(target[name])) {
|
|
104510
104510
|
target[name] = arrayToObject(target[name]);
|
|
104511
104511
|
}
|
|
@@ -105827,9 +105827,9 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config2) {
|
|
|
105827
105827
|
auth2 = urlUsername + ":" + urlPassword;
|
|
105828
105828
|
}
|
|
105829
105829
|
auth2 && headers.delete("authorization");
|
|
105830
|
-
let
|
|
105830
|
+
let path16;
|
|
105831
105831
|
try {
|
|
105832
|
-
|
|
105832
|
+
path16 = buildURL(
|
|
105833
105833
|
parsed.pathname + parsed.search,
|
|
105834
105834
|
config2.params,
|
|
105835
105835
|
config2.paramsSerializer
|
|
@@ -105847,7 +105847,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config2) {
|
|
|
105847
105847
|
false
|
|
105848
105848
|
);
|
|
105849
105849
|
const options = {
|
|
105850
|
-
path:
|
|
105850
|
+
path: path16,
|
|
105851
105851
|
method,
|
|
105852
105852
|
headers: headers.toJSON(),
|
|
105853
105853
|
agents: { http: config2.httpAgent, https: config2.httpsAgent },
|
|
@@ -106083,14 +106083,14 @@ var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? /* @__PUR
|
|
|
106083
106083
|
var cookies_default = platform_default.hasStandardBrowserEnv ? (
|
|
106084
106084
|
// Standard browser envs support document.cookie
|
|
106085
106085
|
{
|
|
106086
|
-
write(name, value, expires,
|
|
106086
|
+
write(name, value, expires, path16, domain2, secure, sameSite) {
|
|
106087
106087
|
if (typeof document === "undefined") return;
|
|
106088
106088
|
const cookie = [`${name}=${encodeURIComponent(value)}`];
|
|
106089
106089
|
if (utils_default.isNumber(expires)) {
|
|
106090
106090
|
cookie.push(`expires=${new Date(expires).toUTCString()}`);
|
|
106091
106091
|
}
|
|
106092
|
-
if (utils_default.isString(
|
|
106093
|
-
cookie.push(`path=${
|
|
106092
|
+
if (utils_default.isString(path16)) {
|
|
106093
|
+
cookie.push(`path=${path16}`);
|
|
106094
106094
|
}
|
|
106095
106095
|
if (utils_default.isString(domain2)) {
|
|
106096
106096
|
cookie.push(`domain=${domain2}`);
|
|
@@ -107490,18 +107490,18 @@ var MemoryCookieStore = class extends Store {
|
|
|
107490
107490
|
/**
|
|
107491
107491
|
* @internal No doc because this is an overload that supports the implementation
|
|
107492
107492
|
*/
|
|
107493
|
-
findCookie(domain2,
|
|
107493
|
+
findCookie(domain2, path16, key, callback) {
|
|
107494
107494
|
const promiseCallback = createPromiseCallback(callback);
|
|
107495
|
-
if (domain2 == null ||
|
|
107495
|
+
if (domain2 == null || path16 == null || key == null) {
|
|
107496
107496
|
return promiseCallback.resolve(void 0);
|
|
107497
107497
|
}
|
|
107498
|
-
const result = this.idx[domain2]?.[
|
|
107498
|
+
const result = this.idx[domain2]?.[path16]?.[key];
|
|
107499
107499
|
return promiseCallback.resolve(result);
|
|
107500
107500
|
}
|
|
107501
107501
|
/**
|
|
107502
107502
|
* @internal No doc because this is an overload that supports the implementation
|
|
107503
107503
|
*/
|
|
107504
|
-
findCookies(domain2,
|
|
107504
|
+
findCookies(domain2, path16, allowSpecialUseDomain = false, callback) {
|
|
107505
107505
|
if (typeof allowSpecialUseDomain === "function") {
|
|
107506
107506
|
callback = allowSpecialUseDomain;
|
|
107507
107507
|
allowSpecialUseDomain = true;
|
|
@@ -107512,7 +107512,7 @@ var MemoryCookieStore = class extends Store {
|
|
|
107512
107512
|
return promiseCallback.resolve([]);
|
|
107513
107513
|
}
|
|
107514
107514
|
let pathMatcher;
|
|
107515
|
-
if (!
|
|
107515
|
+
if (!path16) {
|
|
107516
107516
|
pathMatcher = function matchAll2(domainIndex) {
|
|
107517
107517
|
for (const curPath in domainIndex) {
|
|
107518
107518
|
const pathIndex = domainIndex[curPath];
|
|
@@ -107527,7 +107527,7 @@ var MemoryCookieStore = class extends Store {
|
|
|
107527
107527
|
} else {
|
|
107528
107528
|
pathMatcher = function matchRFC(domainIndex) {
|
|
107529
107529
|
for (const cookiePath in domainIndex) {
|
|
107530
|
-
if (pathMatch(
|
|
107530
|
+
if (pathMatch(path16, cookiePath)) {
|
|
107531
107531
|
const pathIndex = domainIndex[cookiePath];
|
|
107532
107532
|
for (const key in pathIndex) {
|
|
107533
107533
|
const value = pathIndex[key];
|
|
@@ -107555,14 +107555,14 @@ var MemoryCookieStore = class extends Store {
|
|
|
107555
107555
|
*/
|
|
107556
107556
|
putCookie(cookie, callback) {
|
|
107557
107557
|
const promiseCallback = createPromiseCallback(callback);
|
|
107558
|
-
const { domain: domain2, path:
|
|
107559
|
-
if (domain2 == null ||
|
|
107558
|
+
const { domain: domain2, path: path16, key } = cookie;
|
|
107559
|
+
if (domain2 == null || path16 == null || key == null) {
|
|
107560
107560
|
return promiseCallback.resolve(void 0);
|
|
107561
107561
|
}
|
|
107562
107562
|
const domainEntry = this.idx[domain2] ?? /* @__PURE__ */ Object.create(null);
|
|
107563
107563
|
this.idx[domain2] = domainEntry;
|
|
107564
|
-
const pathEntry = domainEntry[
|
|
107565
|
-
domainEntry[
|
|
107564
|
+
const pathEntry = domainEntry[path16] ?? /* @__PURE__ */ Object.create(null);
|
|
107565
|
+
domainEntry[path16] = pathEntry;
|
|
107566
107566
|
pathEntry[key] = cookie;
|
|
107567
107567
|
return promiseCallback.resolve(void 0);
|
|
107568
107568
|
}
|
|
@@ -107576,20 +107576,20 @@ var MemoryCookieStore = class extends Store {
|
|
|
107576
107576
|
/**
|
|
107577
107577
|
* @internal No doc because this is an overload that supports the implementation
|
|
107578
107578
|
*/
|
|
107579
|
-
removeCookie(domain2,
|
|
107579
|
+
removeCookie(domain2, path16, key, callback) {
|
|
107580
107580
|
const promiseCallback = createPromiseCallback(callback);
|
|
107581
|
-
delete this.idx[domain2]?.[
|
|
107581
|
+
delete this.idx[domain2]?.[path16]?.[key];
|
|
107582
107582
|
return promiseCallback.resolve(void 0);
|
|
107583
107583
|
}
|
|
107584
107584
|
/**
|
|
107585
107585
|
* @internal No doc because this is an overload that supports the implementation
|
|
107586
107586
|
*/
|
|
107587
|
-
removeCookies(domain2,
|
|
107587
|
+
removeCookies(domain2, path16, callback) {
|
|
107588
107588
|
const promiseCallback = createPromiseCallback(callback);
|
|
107589
107589
|
const domainEntry = this.idx[domain2];
|
|
107590
107590
|
if (domainEntry) {
|
|
107591
|
-
if (
|
|
107592
|
-
delete domainEntry[
|
|
107591
|
+
if (path16) {
|
|
107592
|
+
delete domainEntry[path16];
|
|
107593
107593
|
} else {
|
|
107594
107594
|
delete this.idx[domain2];
|
|
107595
107595
|
}
|
|
@@ -107615,8 +107615,8 @@ var MemoryCookieStore = class extends Store {
|
|
|
107615
107615
|
domains.forEach((domain2) => {
|
|
107616
107616
|
const domainEntry = idx[domain2] ?? {};
|
|
107617
107617
|
const paths = Object.keys(domainEntry);
|
|
107618
|
-
paths.forEach((
|
|
107619
|
-
const pathEntry = domainEntry[
|
|
107618
|
+
paths.forEach((path16) => {
|
|
107619
|
+
const pathEntry = domainEntry[path16] ?? {};
|
|
107620
107620
|
const keys = Object.keys(pathEntry);
|
|
107621
107621
|
keys.forEach((key) => {
|
|
107622
107622
|
const keyEntry = pathEntry[key];
|
|
@@ -108500,18 +108500,18 @@ function cookieCompare(a, b) {
|
|
|
108500
108500
|
cmp = (a.creationIndex || 0) - (b.creationIndex || 0);
|
|
108501
108501
|
return cmp;
|
|
108502
108502
|
}
|
|
108503
|
-
function defaultPath(
|
|
108504
|
-
if (!
|
|
108503
|
+
function defaultPath(path16) {
|
|
108504
|
+
if (!path16 || path16.slice(0, 1) !== "/") {
|
|
108505
108505
|
return "/";
|
|
108506
108506
|
}
|
|
108507
|
-
if (
|
|
108508
|
-
return
|
|
108507
|
+
if (path16 === "/") {
|
|
108508
|
+
return path16;
|
|
108509
108509
|
}
|
|
108510
|
-
const rightSlash =
|
|
108510
|
+
const rightSlash = path16.lastIndexOf("/");
|
|
108511
108511
|
if (rightSlash === 0) {
|
|
108512
108512
|
return "/";
|
|
108513
108513
|
}
|
|
108514
|
-
return
|
|
108514
|
+
return path16.slice(0, rightSlash);
|
|
108515
108515
|
}
|
|
108516
108516
|
var IP_REGEX_LOWERCASE = /(?:^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$)|(?:^(?:(?:[a-f\d]{1,4}:){7}(?:[a-f\d]{1,4}|:)|(?:[a-f\d]{1,4}:){6}(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|:[a-f\d]{1,4}|:)|(?:[a-f\d]{1,4}:){5}(?::(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,2}|:)|(?:[a-f\d]{1,4}:){4}(?:(?::[a-f\d]{1,4}){0,1}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,3}|:)|(?:[a-f\d]{1,4}:){3}(?:(?::[a-f\d]{1,4}){0,2}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,4}|:)|(?:[a-f\d]{1,4}:){2}(?:(?::[a-f\d]{1,4}){0,3}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,5}|:)|(?:[a-f\d]{1,4}:){1}(?:(?::[a-f\d]{1,4}){0,4}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,6}|:)|(?::(?:(?::[a-f\d]{1,4}){0,5}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,7}|:)))$)/;
|
|
108517
108517
|
function domainMatch(domain2, cookieDomain, canonicalize) {
|
|
@@ -108913,7 +108913,7 @@ var CookieJar = class _CookieJar {
|
|
|
108913
108913
|
return promiseCallback.reject(parameterError);
|
|
108914
108914
|
}
|
|
108915
108915
|
const host = canonicalDomain(context.hostname);
|
|
108916
|
-
const
|
|
108916
|
+
const path16 = context.pathname || "/";
|
|
108917
108917
|
const potentiallyTrustworthy = isPotentiallyTrustworthy(
|
|
108918
108918
|
url3,
|
|
108919
108919
|
this.allowSecureOnLocal
|
|
@@ -108944,7 +108944,7 @@ var CookieJar = class _CookieJar {
|
|
|
108944
108944
|
return false;
|
|
108945
108945
|
}
|
|
108946
108946
|
}
|
|
108947
|
-
if (!allPaths && typeof c.path === "string" && !pathMatch(
|
|
108947
|
+
if (!allPaths && typeof c.path === "string" && !pathMatch(path16, c.path)) {
|
|
108948
108948
|
return false;
|
|
108949
108949
|
}
|
|
108950
108950
|
if (c.secure && !potentiallyTrustworthy) {
|
|
@@ -108976,7 +108976,7 @@ var CookieJar = class _CookieJar {
|
|
|
108976
108976
|
}
|
|
108977
108977
|
store.findCookies(
|
|
108978
108978
|
host,
|
|
108979
|
-
allPaths ? null :
|
|
108979
|
+
allPaths ? null : path16,
|
|
108980
108980
|
this.allowSpecialUseDomain,
|
|
108981
108981
|
(err, cookies) => {
|
|
108982
108982
|
if (err) {
|
|
@@ -110086,11 +110086,11 @@ function readJsonFile(filePath, workingDir) {
|
|
|
110086
110086
|
};
|
|
110087
110087
|
}
|
|
110088
110088
|
}
|
|
110089
|
-
function setNestedValue(obj,
|
|
110090
|
-
if (!
|
|
110089
|
+
function setNestedValue(obj, path16, value) {
|
|
110090
|
+
if (!path16 || obj === null || obj === void 0 || typeof obj !== "object") {
|
|
110091
110091
|
return false;
|
|
110092
110092
|
}
|
|
110093
|
-
const parts =
|
|
110093
|
+
const parts = path16.replace(/\[(\d+)\]/g, ".$1").split(".").filter((p) => p !== "");
|
|
110094
110094
|
if (parts.length === 0) {
|
|
110095
110095
|
return false;
|
|
110096
110096
|
}
|
|
@@ -111580,8 +111580,8 @@ function getErrorMap() {
|
|
|
111580
111580
|
|
|
111581
111581
|
// node_modules/zod/v3/helpers/parseUtil.js
|
|
111582
111582
|
var makeIssue = (params) => {
|
|
111583
|
-
const { data, path:
|
|
111584
|
-
const fullPath = [...
|
|
111583
|
+
const { data, path: path16, errorMaps, issueData } = params;
|
|
111584
|
+
const fullPath = [...path16, ...issueData.path || []];
|
|
111585
111585
|
const fullIssue = {
|
|
111586
111586
|
...issueData,
|
|
111587
111587
|
path: fullPath
|
|
@@ -111696,11 +111696,11 @@ var errorUtil;
|
|
|
111696
111696
|
|
|
111697
111697
|
// node_modules/zod/v3/types.js
|
|
111698
111698
|
var ParseInputLazyPath = class {
|
|
111699
|
-
constructor(parent, value,
|
|
111699
|
+
constructor(parent, value, path16, key) {
|
|
111700
111700
|
this._cachedPath = [];
|
|
111701
111701
|
this.parent = parent;
|
|
111702
111702
|
this.data = value;
|
|
111703
|
-
this._path =
|
|
111703
|
+
this._path = path16;
|
|
111704
111704
|
this._key = key;
|
|
111705
111705
|
}
|
|
111706
111706
|
get path() {
|
|
@@ -115344,10 +115344,10 @@ function mergeDefs(...defs) {
|
|
|
115344
115344
|
function cloneDef(schema) {
|
|
115345
115345
|
return mergeDefs(schema._zod.def);
|
|
115346
115346
|
}
|
|
115347
|
-
function getElementAtPath(obj,
|
|
115348
|
-
if (!
|
|
115347
|
+
function getElementAtPath(obj, path16) {
|
|
115348
|
+
if (!path16)
|
|
115349
115349
|
return obj;
|
|
115350
|
-
return
|
|
115350
|
+
return path16.reduce((acc, key) => acc?.[key], obj);
|
|
115351
115351
|
}
|
|
115352
115352
|
function promiseAllObject(promisesObj) {
|
|
115353
115353
|
const keys = Object.keys(promisesObj);
|
|
@@ -115730,11 +115730,11 @@ function aborted(x, startIndex = 0) {
|
|
|
115730
115730
|
}
|
|
115731
115731
|
return false;
|
|
115732
115732
|
}
|
|
115733
|
-
function prefixIssues(
|
|
115733
|
+
function prefixIssues(path16, issues) {
|
|
115734
115734
|
return issues.map((iss) => {
|
|
115735
115735
|
var _a2;
|
|
115736
115736
|
(_a2 = iss).path ?? (_a2.path = []);
|
|
115737
|
-
iss.path.unshift(
|
|
115737
|
+
iss.path.unshift(path16);
|
|
115738
115738
|
return iss;
|
|
115739
115739
|
});
|
|
115740
115740
|
}
|
|
@@ -127140,6 +127140,129 @@ function resolveMcpServer(startPath, alias, envVariables) {
|
|
|
127140
127140
|
return { filePath, server };
|
|
127141
127141
|
}
|
|
127142
127142
|
|
|
127143
|
+
// src/mcpToolIntellisenseCache.ts
|
|
127144
|
+
var fs12 = __toESM(require("fs"));
|
|
127145
|
+
var path10 = __toESM(require("path"));
|
|
127146
|
+
|
|
127147
|
+
// src/cacheDir.ts
|
|
127148
|
+
var fs11 = __toESM(require("fs"));
|
|
127149
|
+
var path9 = __toESM(require("path"));
|
|
127150
|
+
var NORN_CACHE_DIR = ".norn-cache";
|
|
127151
|
+
var CACHE_GITIGNORE_FILE = ".gitignore";
|
|
127152
|
+
var CACHE_GITIGNORE_CONTENT = "*\n";
|
|
127153
|
+
var PROJECT_ROOT_MARKERS = [".git", "package.json", "pnpm-workspace.yaml", "package-lock.json", "yarn.lock", ".nornenv"];
|
|
127154
|
+
function getSearchStartDirectory(targetPath) {
|
|
127155
|
+
const resolvedPath = path9.resolve(targetPath);
|
|
127156
|
+
try {
|
|
127157
|
+
const stats = fs11.statSync(resolvedPath);
|
|
127158
|
+
return stats.isDirectory() ? resolvedPath : path9.dirname(resolvedPath);
|
|
127159
|
+
} catch {
|
|
127160
|
+
return path9.dirname(resolvedPath);
|
|
127161
|
+
}
|
|
127162
|
+
}
|
|
127163
|
+
function findProjectRoot(targetPath) {
|
|
127164
|
+
let dir = getSearchStartDirectory(targetPath);
|
|
127165
|
+
let projectRoot;
|
|
127166
|
+
while (true) {
|
|
127167
|
+
if (PROJECT_ROOT_MARKERS.some((marker) => fs11.existsSync(path9.join(dir, marker)))) {
|
|
127168
|
+
projectRoot = dir;
|
|
127169
|
+
}
|
|
127170
|
+
const parent = path9.dirname(dir);
|
|
127171
|
+
if (parent === dir) {
|
|
127172
|
+
break;
|
|
127173
|
+
}
|
|
127174
|
+
dir = parent;
|
|
127175
|
+
}
|
|
127176
|
+
return projectRoot ?? getSearchStartDirectory(targetPath);
|
|
127177
|
+
}
|
|
127178
|
+
function ensureNornCacheGitignore(cacheDir) {
|
|
127179
|
+
const gitignorePath = path9.join(cacheDir, CACHE_GITIGNORE_FILE);
|
|
127180
|
+
try {
|
|
127181
|
+
const hasDesiredContent = fs11.existsSync(gitignorePath) && fs11.readFileSync(gitignorePath, "utf8") === CACHE_GITIGNORE_CONTENT;
|
|
127182
|
+
if (hasDesiredContent) {
|
|
127183
|
+
return;
|
|
127184
|
+
}
|
|
127185
|
+
fs11.writeFileSync(gitignorePath, CACHE_GITIGNORE_CONTENT, "utf8");
|
|
127186
|
+
} catch {
|
|
127187
|
+
}
|
|
127188
|
+
}
|
|
127189
|
+
function ensureNornCacheDir(rootPath) {
|
|
127190
|
+
const cacheDir = path9.join(rootPath, NORN_CACHE_DIR);
|
|
127191
|
+
try {
|
|
127192
|
+
if (!fs11.existsSync(cacheDir)) {
|
|
127193
|
+
fs11.mkdirSync(cacheDir, { recursive: true });
|
|
127194
|
+
}
|
|
127195
|
+
ensureNornCacheGitignore(cacheDir);
|
|
127196
|
+
return cacheDir;
|
|
127197
|
+
} catch {
|
|
127198
|
+
return void 0;
|
|
127199
|
+
}
|
|
127200
|
+
}
|
|
127201
|
+
|
|
127202
|
+
// src/mcpToolIntellisenseCache.ts
|
|
127203
|
+
var CACHE_VERSION = 1;
|
|
127204
|
+
var CACHE_FILE = "mcp-tool-intellisense.json";
|
|
127205
|
+
function getCachePathForConfig(configPath) {
|
|
127206
|
+
return path10.join(path10.dirname(configPath), NORN_CACHE_DIR, CACHE_FILE);
|
|
127207
|
+
}
|
|
127208
|
+
function ensureCacheDirForConfig(configPath) {
|
|
127209
|
+
return !!ensureNornCacheDir(path10.dirname(configPath));
|
|
127210
|
+
}
|
|
127211
|
+
function loadCacheForConfig(configPath) {
|
|
127212
|
+
const cachePath = getCachePathForConfig(configPath);
|
|
127213
|
+
if (!fs12.existsSync(cachePath)) {
|
|
127214
|
+
return { version: CACHE_VERSION, servers: {} };
|
|
127215
|
+
}
|
|
127216
|
+
try {
|
|
127217
|
+
const content = fs12.readFileSync(cachePath, "utf-8");
|
|
127218
|
+
const parsed = JSON.parse(content);
|
|
127219
|
+
if (parsed.version !== CACHE_VERSION || !parsed.servers || typeof parsed.servers !== "object") {
|
|
127220
|
+
return { version: CACHE_VERSION, servers: {} };
|
|
127221
|
+
}
|
|
127222
|
+
return parsed;
|
|
127223
|
+
} catch {
|
|
127224
|
+
return { version: CACHE_VERSION, servers: {} };
|
|
127225
|
+
}
|
|
127226
|
+
}
|
|
127227
|
+
function saveCacheForConfig(configPath, cache) {
|
|
127228
|
+
if (!ensureCacheDirForConfig(configPath)) {
|
|
127229
|
+
return false;
|
|
127230
|
+
}
|
|
127231
|
+
const cachePath = getCachePathForConfig(configPath);
|
|
127232
|
+
try {
|
|
127233
|
+
fs12.writeFileSync(cachePath, JSON.stringify(cache, null, 2), "utf-8");
|
|
127234
|
+
return true;
|
|
127235
|
+
} catch {
|
|
127236
|
+
return false;
|
|
127237
|
+
}
|
|
127238
|
+
}
|
|
127239
|
+
function cloneJsonValue(value) {
|
|
127240
|
+
if (value === void 0) {
|
|
127241
|
+
return void 0;
|
|
127242
|
+
}
|
|
127243
|
+
try {
|
|
127244
|
+
return JSON.parse(JSON.stringify(value));
|
|
127245
|
+
} catch {
|
|
127246
|
+
return void 0;
|
|
127247
|
+
}
|
|
127248
|
+
}
|
|
127249
|
+
function toCachedMcpTool(tool) {
|
|
127250
|
+
return {
|
|
127251
|
+
name: tool.name,
|
|
127252
|
+
description: typeof tool.description === "string" ? tool.description : void 0,
|
|
127253
|
+
inputSchema: cloneJsonValue(tool.inputSchema)
|
|
127254
|
+
};
|
|
127255
|
+
}
|
|
127256
|
+
function saveMcpToolsForAlias(configPath, alias, tools) {
|
|
127257
|
+
const cache = loadCacheForConfig(configPath);
|
|
127258
|
+
cache.servers[alias.toLowerCase()] = {
|
|
127259
|
+
alias,
|
|
127260
|
+
cachedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
127261
|
+
tools: tools.map((tool) => toCachedMcpTool(tool))
|
|
127262
|
+
};
|
|
127263
|
+
saveCacheForConfig(configPath, cache);
|
|
127264
|
+
}
|
|
127265
|
+
|
|
127143
127266
|
// src/mcpClient.ts
|
|
127144
127267
|
init_schemaGenerator();
|
|
127145
127268
|
var NornJsonSchemaValidator = class {
|
|
@@ -127235,16 +127358,27 @@ var McpSessionManager = class {
|
|
|
127235
127358
|
}
|
|
127236
127359
|
cursor = response.nextCursor;
|
|
127237
127360
|
} while (cursor);
|
|
127361
|
+
const { filePath } = resolveMcpServer(startPath, alias, envVariables);
|
|
127362
|
+
saveMcpToolsForAlias(filePath, alias, tools);
|
|
127238
127363
|
return { tools };
|
|
127239
127364
|
}
|
|
127240
|
-
async
|
|
127365
|
+
async getToolDefinition(startPath, alias, toolName, envVariables) {
|
|
127241
127366
|
const session = await this.getSession(startPath, alias, envVariables);
|
|
127242
|
-
|
|
127243
|
-
|
|
127244
|
-
|
|
127245
|
-
|
|
127246
|
-
}
|
|
127367
|
+
const normalizedToolName = toolName.toLowerCase();
|
|
127368
|
+
const cached2 = session.toolsByName.get(normalizedToolName);
|
|
127369
|
+
if (cached2) {
|
|
127370
|
+
return cached2;
|
|
127247
127371
|
}
|
|
127372
|
+
const listed = await this.listTools(startPath, alias, envVariables);
|
|
127373
|
+
const resolved = listed.tools.find((tool) => tool.name.toLowerCase() === normalizedToolName);
|
|
127374
|
+
if (!resolved) {
|
|
127375
|
+
throw new Error(`Tool '${toolName}' was not found on MCP server '${alias}'.`);
|
|
127376
|
+
}
|
|
127377
|
+
return resolved;
|
|
127378
|
+
}
|
|
127379
|
+
async callTool(startPath, alias, toolName, args, envVariables) {
|
|
127380
|
+
const session = await this.getSession(startPath, alias, envVariables);
|
|
127381
|
+
await this.getToolDefinition(startPath, alias, toolName, envVariables);
|
|
127248
127382
|
const result = await session.client.callTool(
|
|
127249
127383
|
{
|
|
127250
127384
|
name: toolName,
|
|
@@ -127270,6 +127404,51 @@ var McpSessionManager = class {
|
|
|
127270
127404
|
}
|
|
127271
127405
|
};
|
|
127272
127406
|
|
|
127407
|
+
// src/mcpToolSchema.ts
|
|
127408
|
+
function getInputSchemaObject(source) {
|
|
127409
|
+
if (!source.inputSchema || typeof source.inputSchema !== "object" || Array.isArray(source.inputSchema)) {
|
|
127410
|
+
return void 0;
|
|
127411
|
+
}
|
|
127412
|
+
return source.inputSchema;
|
|
127413
|
+
}
|
|
127414
|
+
function getMcpToolInputPropertyMap(source) {
|
|
127415
|
+
const schema = getInputSchemaObject(source);
|
|
127416
|
+
if (!schema) {
|
|
127417
|
+
return {};
|
|
127418
|
+
}
|
|
127419
|
+
const properties = schema.properties;
|
|
127420
|
+
if (!properties || typeof properties !== "object" || Array.isArray(properties)) {
|
|
127421
|
+
return {};
|
|
127422
|
+
}
|
|
127423
|
+
return properties;
|
|
127424
|
+
}
|
|
127425
|
+
function getMcpToolInputParameterNames(source) {
|
|
127426
|
+
const propertyMap = getMcpToolInputPropertyMap(source);
|
|
127427
|
+
const propertyNames = Object.keys(propertyMap);
|
|
127428
|
+
if (propertyNames.length > 0) {
|
|
127429
|
+
return propertyNames;
|
|
127430
|
+
}
|
|
127431
|
+
const schema = getInputSchemaObject(source);
|
|
127432
|
+
if (!schema || !Array.isArray(schema.required)) {
|
|
127433
|
+
return [];
|
|
127434
|
+
}
|
|
127435
|
+
return schema.required.filter((entry) => typeof entry === "string");
|
|
127436
|
+
}
|
|
127437
|
+
function getMcpToolRequiredParameterNames(source) {
|
|
127438
|
+
const schema = getInputSchemaObject(source);
|
|
127439
|
+
if (!schema || !Array.isArray(schema.required)) {
|
|
127440
|
+
return [];
|
|
127441
|
+
}
|
|
127442
|
+
return schema.required.filter((entry) => typeof entry === "string");
|
|
127443
|
+
}
|
|
127444
|
+
function mcpToolAllowsAdditionalProperties(source) {
|
|
127445
|
+
const schema = getInputSchemaObject(source);
|
|
127446
|
+
if (!schema) {
|
|
127447
|
+
return true;
|
|
127448
|
+
}
|
|
127449
|
+
return schema.additionalProperties !== false;
|
|
127450
|
+
}
|
|
127451
|
+
|
|
127273
127452
|
// src/sequenceRunner.ts
|
|
127274
127453
|
init_assertionRunner();
|
|
127275
127454
|
function applyHeaderGroupsToRequest(parsed, requestText, headerGroups, variables) {
|
|
@@ -127613,21 +127792,29 @@ function parseMcpArguments(argsStr) {
|
|
|
127613
127792
|
}
|
|
127614
127793
|
const parts = splitNamedArgumentList(argsStr);
|
|
127615
127794
|
const args = [];
|
|
127795
|
+
let sawNamedArgument = false;
|
|
127616
127796
|
for (const part of parts) {
|
|
127617
127797
|
const trimmed = part.trim();
|
|
127618
127798
|
if (!trimmed) {
|
|
127619
127799
|
continue;
|
|
127620
127800
|
}
|
|
127621
127801
|
const match = trimmed.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\s*:\s*(.+)$/);
|
|
127622
|
-
if (
|
|
127802
|
+
if (match) {
|
|
127803
|
+
sawNamedArgument = true;
|
|
127804
|
+
args.push({
|
|
127805
|
+
name: match[1],
|
|
127806
|
+
valueExpression: match[2].trim()
|
|
127807
|
+
});
|
|
127808
|
+
continue;
|
|
127809
|
+
}
|
|
127810
|
+
if (sawNamedArgument) {
|
|
127623
127811
|
return {
|
|
127624
127812
|
args: [],
|
|
127625
|
-
error: "MCP
|
|
127813
|
+
error: "Positional MCP arguments cannot follow named arguments."
|
|
127626
127814
|
};
|
|
127627
127815
|
}
|
|
127628
127816
|
args.push({
|
|
127629
|
-
|
|
127630
|
-
valueExpression: match[2].trim()
|
|
127817
|
+
valueExpression: trimmed
|
|
127631
127818
|
});
|
|
127632
127819
|
}
|
|
127633
127820
|
return { args };
|
|
@@ -127745,20 +127932,56 @@ function evaluateMcpArgumentExpression(expr, runtimeVariables) {
|
|
|
127745
127932
|
}
|
|
127746
127933
|
return evaluateSqlArgumentExpression(expr, runtimeVariables);
|
|
127747
127934
|
}
|
|
127748
|
-
function bindMcpArguments(args, runtimeVariables) {
|
|
127935
|
+
function bindMcpArguments(tool, args, runtimeVariables) {
|
|
127936
|
+
const parameterNames = getMcpToolInputParameterNames(tool);
|
|
127937
|
+
const requiredParameterNames = getMcpToolRequiredParameterNames(tool);
|
|
127938
|
+
const allowsAdditionalProperties = mcpToolAllowsAdditionalProperties(tool);
|
|
127749
127939
|
const resolvedParams = {};
|
|
127750
127940
|
const boundNames = /* @__PURE__ */ new Set();
|
|
127941
|
+
let positionalIndex = 0;
|
|
127942
|
+
let sawNamedArgument = false;
|
|
127751
127943
|
for (const arg of args) {
|
|
127752
|
-
|
|
127753
|
-
|
|
127754
|
-
|
|
127944
|
+
if (arg.name) {
|
|
127945
|
+
sawNamedArgument = true;
|
|
127946
|
+
const declaredParam = parameterNames.find((param) => param.toLowerCase() === arg.name.toLowerCase());
|
|
127947
|
+
const resolvedName2 = declaredParam ?? arg.name;
|
|
127948
|
+
const normalizedName = resolvedName2.toLowerCase();
|
|
127949
|
+
if (!declaredParam && !allowsAdditionalProperties) {
|
|
127950
|
+
return { error: `Unknown MCP parameter '${arg.name}' for tool '${tool.name}'.` };
|
|
127951
|
+
}
|
|
127952
|
+
if (boundNames.has(normalizedName)) {
|
|
127953
|
+
return { error: `Duplicate MCP parameter '${resolvedName2}' in tool call.` };
|
|
127954
|
+
}
|
|
127955
|
+
const valueResult2 = evaluateMcpArgumentExpression(arg.valueExpression, runtimeVariables);
|
|
127956
|
+
if (valueResult2.error) {
|
|
127957
|
+
return { error: valueResult2.error };
|
|
127958
|
+
}
|
|
127959
|
+
resolvedParams[resolvedName2] = valueResult2.value;
|
|
127960
|
+
boundNames.add(normalizedName);
|
|
127961
|
+
continue;
|
|
127962
|
+
}
|
|
127963
|
+
if (sawNamedArgument) {
|
|
127964
|
+
return { error: "Positional MCP arguments cannot follow named arguments." };
|
|
127965
|
+
}
|
|
127966
|
+
if (positionalIndex >= parameterNames.length) {
|
|
127967
|
+
if (parameterNames.length === 0) {
|
|
127968
|
+
return { error: `Tool '${tool.name}' does not declare positional parameters.` };
|
|
127969
|
+
}
|
|
127970
|
+
return { error: `Too many MCP arguments for tool '${tool.name}': expected at most ${parameterNames.length}.` };
|
|
127755
127971
|
}
|
|
127756
127972
|
const valueResult = evaluateMcpArgumentExpression(arg.valueExpression, runtimeVariables);
|
|
127757
127973
|
if (valueResult.error) {
|
|
127758
127974
|
return { error: valueResult.error };
|
|
127759
127975
|
}
|
|
127760
|
-
|
|
127761
|
-
|
|
127976
|
+
const resolvedName = parameterNames[positionalIndex];
|
|
127977
|
+
resolvedParams[resolvedName] = valueResult.value;
|
|
127978
|
+
boundNames.add(resolvedName.toLowerCase());
|
|
127979
|
+
positionalIndex++;
|
|
127980
|
+
}
|
|
127981
|
+
for (const requiredName of requiredParameterNames) {
|
|
127982
|
+
if (!boundNames.has(requiredName.toLowerCase())) {
|
|
127983
|
+
return { error: `Missing required MCP parameter '${requiredName}' for tool '${tool.name}'.` };
|
|
127984
|
+
}
|
|
127762
127985
|
}
|
|
127763
127986
|
return { params: resolvedParams };
|
|
127764
127987
|
}
|
|
@@ -127856,8 +128079,8 @@ function parseJsonBackedValue(value) {
|
|
|
127856
128079
|
return value;
|
|
127857
128080
|
}
|
|
127858
128081
|
}
|
|
127859
|
-
function getVariableValueByPath(
|
|
127860
|
-
const parts = getPathSegments(
|
|
128082
|
+
function getVariableValueByPath(path16, variables) {
|
|
128083
|
+
const parts = getPathSegments(path16);
|
|
127861
128084
|
let current = variables;
|
|
127862
128085
|
for (const part of parts) {
|
|
127863
128086
|
if (current === null || current === void 0) {
|
|
@@ -128210,8 +128433,8 @@ function evaluateValueExpression(expr, runtimeVariables) {
|
|
|
128210
128433
|
if (typeof dataToNavigate !== "object" || dataToNavigate === null) {
|
|
128211
128434
|
return { value: String(varValue), error: `Cannot access path on non-object value` };
|
|
128212
128435
|
}
|
|
128213
|
-
const
|
|
128214
|
-
const parts = getPathSegments(
|
|
128436
|
+
const path16 = pathPart.replace(/^\./, "");
|
|
128437
|
+
const parts = getPathSegments(path16);
|
|
128215
128438
|
let current = dataToNavigate;
|
|
128216
128439
|
for (const part of parts) {
|
|
128217
128440
|
if (current === null || current === void 0) {
|
|
@@ -128346,8 +128569,8 @@ function resolveBareVariables(text, variables) {
|
|
|
128346
128569
|
if (varName in variables) {
|
|
128347
128570
|
const value = variables[varName];
|
|
128348
128571
|
if (pathPart) {
|
|
128349
|
-
const
|
|
128350
|
-
const nestedValue = getNestedValueFromObject(value,
|
|
128572
|
+
const path16 = pathPart.replace(/^\./, "");
|
|
128573
|
+
const nestedValue = getNestedValueFromObject(value, path16);
|
|
128351
128574
|
return valueToString2(nestedValue);
|
|
128352
128575
|
}
|
|
128353
128576
|
return valueToString2(value);
|
|
@@ -128367,8 +128590,8 @@ function resolveBareVariables(text, variables) {
|
|
|
128367
128590
|
if (varName in variables) {
|
|
128368
128591
|
const value = variables[varName];
|
|
128369
128592
|
if (pathPart) {
|
|
128370
|
-
const
|
|
128371
|
-
return valueToString2(getNestedValueFromObject(value,
|
|
128593
|
+
const path16 = pathPart.replace(/^\./, "");
|
|
128594
|
+
return valueToString2(getNestedValueFromObject(value, path16));
|
|
128372
128595
|
}
|
|
128373
128596
|
return valueToString2(value);
|
|
128374
128597
|
}
|
|
@@ -128416,11 +128639,11 @@ function splitExpressionParts(expr) {
|
|
|
128416
128639
|
}
|
|
128417
128640
|
return parts;
|
|
128418
128641
|
}
|
|
128419
|
-
function getNestedValueFromObject(obj,
|
|
128420
|
-
if (!
|
|
128642
|
+
function getNestedValueFromObject(obj, path16) {
|
|
128643
|
+
if (!path16) {
|
|
128421
128644
|
return obj;
|
|
128422
128645
|
}
|
|
128423
|
-
const parts =
|
|
128646
|
+
const parts = path16.split(/\.|\[(\d+)\]/).filter((p) => p !== "" && p !== void 0);
|
|
128424
128647
|
let current = obj;
|
|
128425
128648
|
for (const part of parts) {
|
|
128426
128649
|
if (current === null || current === void 0) {
|
|
@@ -128819,24 +129042,24 @@ function extractCaptureDirectives(content) {
|
|
|
128819
129042
|
for (const line2 of content.split("\n")) {
|
|
128820
129043
|
const match = line2.trim().match(captureRegex);
|
|
128821
129044
|
if (match) {
|
|
128822
|
-
let
|
|
128823
|
-
if (
|
|
128824
|
-
|
|
129045
|
+
let path16 = match[3] || "";
|
|
129046
|
+
if (path16.startsWith(".")) {
|
|
129047
|
+
path16 = path16.substring(1);
|
|
128825
129048
|
}
|
|
128826
129049
|
captures.push({
|
|
128827
129050
|
varName: match[1],
|
|
128828
129051
|
afterRequest: parseInt(match[2], 10),
|
|
128829
|
-
path:
|
|
129052
|
+
path: path16
|
|
128830
129053
|
});
|
|
128831
129054
|
}
|
|
128832
129055
|
}
|
|
128833
129056
|
return captures;
|
|
128834
129057
|
}
|
|
128835
|
-
function getValueByPath(response,
|
|
128836
|
-
if (!
|
|
129058
|
+
function getValueByPath(response, path16) {
|
|
129059
|
+
if (!path16) {
|
|
128837
129060
|
return void 0;
|
|
128838
129061
|
}
|
|
128839
|
-
const parts = getPathSegments(
|
|
129062
|
+
const parts = getPathSegments(path16);
|
|
128840
129063
|
if (parts.length === 0) {
|
|
128841
129064
|
return void 0;
|
|
128842
129065
|
}
|
|
@@ -129215,8 +129438,8 @@ async function runSequenceWithJar(sequenceContent, fileVariables, cookieJar, wor
|
|
|
129215
129438
|
}
|
|
129216
129439
|
}
|
|
129217
129440
|
if (pathPart) {
|
|
129218
|
-
const
|
|
129219
|
-
newValue = getNestedValueFromObject(value,
|
|
129441
|
+
const path16 = pathPart.replace(/^\./, "");
|
|
129442
|
+
newValue = getNestedValueFromObject(value, path16);
|
|
129220
129443
|
} else {
|
|
129221
129444
|
newValue = value;
|
|
129222
129445
|
}
|
|
@@ -129513,7 +129736,30 @@ async function runSequenceWithJar(sequenceContent, fileVariables, cookieJar, wor
|
|
|
129513
129736
|
duration: Date.now() - startTime
|
|
129514
129737
|
};
|
|
129515
129738
|
}
|
|
129516
|
-
|
|
129739
|
+
let toolDefinition;
|
|
129740
|
+
try {
|
|
129741
|
+
toolDefinition = await mcpSessionManager.getToolDefinition(
|
|
129742
|
+
getCurrentMcpStartPath(),
|
|
129743
|
+
parsed.serverAlias,
|
|
129744
|
+
parsed.toolName,
|
|
129745
|
+
getRuntimeEnvironmentVariables(runtimeVariables)
|
|
129746
|
+
);
|
|
129747
|
+
} catch (error2) {
|
|
129748
|
+
const message = `MCP call failed for '${parsed.serverAlias}.${parsed.toolName}': ${error2?.message || String(error2)}`;
|
|
129749
|
+
errors.push(message);
|
|
129750
|
+
await emitFailure(message, step, stepIdx);
|
|
129751
|
+
return {
|
|
129752
|
+
name: "",
|
|
129753
|
+
success: false,
|
|
129754
|
+
responses,
|
|
129755
|
+
scriptResults,
|
|
129756
|
+
assertionResults,
|
|
129757
|
+
steps: orderedSteps,
|
|
129758
|
+
errors,
|
|
129759
|
+
duration: Date.now() - startTime
|
|
129760
|
+
};
|
|
129761
|
+
}
|
|
129762
|
+
const boundArgs = bindMcpArguments(toolDefinition, parsed.args, runtimeVariables);
|
|
129517
129763
|
if ("error" in boundArgs) {
|
|
129518
129764
|
errors.push(`Step ${stepIdx + 1}: ${boundArgs.error}`);
|
|
129519
129765
|
return {
|
|
@@ -129885,8 +130131,8 @@ ${indentMultiline(userMessage)}`;
|
|
|
129885
130131
|
if (sequenceSources) {
|
|
129886
130132
|
const sourceFile = sequenceSources.get(targetName.toLowerCase());
|
|
129887
130133
|
if (sourceFile) {
|
|
129888
|
-
const
|
|
129889
|
-
subWorkingDir =
|
|
130134
|
+
const path16 = await import("path");
|
|
130135
|
+
subWorkingDir = path16.dirname(sourceFile);
|
|
129890
130136
|
}
|
|
129891
130137
|
}
|
|
129892
130138
|
const targetLocation = executionContext?.sequenceLocationIndex?.get(targetName.toLowerCase());
|
|
@@ -130192,8 +130438,8 @@ ${indentMultiline(userMessage)}`;
|
|
|
130192
130438
|
if (sequenceSources) {
|
|
130193
130439
|
const sourceFile = sequenceSources.get(sequenceName.toLowerCase());
|
|
130194
130440
|
if (sourceFile) {
|
|
130195
|
-
const
|
|
130196
|
-
subWorkingDir =
|
|
130441
|
+
const path16 = await import("path");
|
|
130442
|
+
subWorkingDir = path16.dirname(sourceFile);
|
|
130197
130443
|
}
|
|
130198
130444
|
}
|
|
130199
130445
|
const targetLocation = executionContext?.sequenceLocationIndex?.get(sequenceName.toLowerCase());
|
|
@@ -131030,7 +131276,7 @@ function formatRunSummary(results, totalDuration, colors) {
|
|
|
131030
131276
|
}
|
|
131031
131277
|
|
|
131032
131278
|
// src/cli/reporters/junit.ts
|
|
131033
|
-
var
|
|
131279
|
+
var fs13 = __toESM(require("fs"));
|
|
131034
131280
|
function escapeXml(text) {
|
|
131035
131281
|
return text.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
131036
131282
|
}
|
|
@@ -131050,7 +131296,7 @@ function generateJUnitReport(results, options) {
|
|
|
131050
131296
|
xml += generateTestSuite(result, redaction);
|
|
131051
131297
|
}
|
|
131052
131298
|
xml += "</testsuites>\n";
|
|
131053
|
-
|
|
131299
|
+
fs13.writeFileSync(outputPath, xml, "utf-8");
|
|
131054
131300
|
}
|
|
131055
131301
|
function generateTestSuite(result, redaction) {
|
|
131056
131302
|
const assertions = result.assertionResults || [];
|
|
@@ -131176,11 +131422,11 @@ Response: ${bodyStr}`;
|
|
|
131176
131422
|
xml += " </testcase>\n";
|
|
131177
131423
|
xml += " </testsuite>\n";
|
|
131178
131424
|
xml += "</testsuites>\n";
|
|
131179
|
-
|
|
131425
|
+
fs13.writeFileSync(outputPath, xml, "utf-8");
|
|
131180
131426
|
}
|
|
131181
131427
|
|
|
131182
131428
|
// src/cli/reporters/html.ts
|
|
131183
|
-
var
|
|
131429
|
+
var fs14 = __toESM(require("fs"));
|
|
131184
131430
|
function escapeHtml(text) {
|
|
131185
131431
|
return text.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
131186
131432
|
}
|
|
@@ -131292,7 +131538,7 @@ function generateHtmlReport(results, options) {
|
|
|
131292
131538
|
</script>
|
|
131293
131539
|
</body>
|
|
131294
131540
|
</html>`;
|
|
131295
|
-
|
|
131541
|
+
fs14.writeFileSync(outputPath, html, "utf-8");
|
|
131296
131542
|
}
|
|
131297
131543
|
function generateSequenceHtml(result, index, redaction) {
|
|
131298
131544
|
const statusClass = result.success ? "passed" : "failed";
|
|
@@ -131734,8 +131980,8 @@ function generateHtmlReportFromResponse(response, testName, options) {
|
|
|
131734
131980
|
}
|
|
131735
131981
|
|
|
131736
131982
|
// src/environmentParser.ts
|
|
131737
|
-
var
|
|
131738
|
-
var
|
|
131983
|
+
var fs16 = __toESM(require("fs"));
|
|
131984
|
+
var path12 = __toESM(require("path"));
|
|
131739
131985
|
|
|
131740
131986
|
// src/secrets/crypto.ts
|
|
131741
131987
|
var crypto7 = __toESM(require("crypto"));
|
|
@@ -131803,65 +132049,20 @@ function decryptSecretValue(encryptedValue, sharedKey) {
|
|
|
131803
132049
|
}
|
|
131804
132050
|
|
|
131805
132051
|
// src/secrets/keyStore.ts
|
|
131806
|
-
var
|
|
131807
|
-
var
|
|
131808
|
-
|
|
131809
|
-
|
|
131810
|
-
var fs13 = __toESM(require("fs"));
|
|
131811
|
-
var path9 = __toESM(require("path"));
|
|
131812
|
-
var NORN_CACHE_DIR = ".norn-cache";
|
|
131813
|
-
var CACHE_GITIGNORE_FILE = ".gitignore";
|
|
131814
|
-
var CACHE_GITIGNORE_CONTENT = "*\n";
|
|
131815
|
-
var PROJECT_ROOT_MARKERS = [".git", "package.json", "pnpm-workspace.yaml", "package-lock.json", "yarn.lock", ".nornenv"];
|
|
131816
|
-
function getSearchStartDirectory(targetPath) {
|
|
131817
|
-
const resolvedPath = path9.resolve(targetPath);
|
|
131818
|
-
try {
|
|
131819
|
-
const stats = fs13.statSync(resolvedPath);
|
|
131820
|
-
return stats.isDirectory() ? resolvedPath : path9.dirname(resolvedPath);
|
|
131821
|
-
} catch {
|
|
131822
|
-
return path9.dirname(resolvedPath);
|
|
131823
|
-
}
|
|
131824
|
-
}
|
|
131825
|
-
function findProjectRoot(targetPath) {
|
|
131826
|
-
let dir = getSearchStartDirectory(targetPath);
|
|
131827
|
-
let projectRoot;
|
|
131828
|
-
while (true) {
|
|
131829
|
-
if (PROJECT_ROOT_MARKERS.some((marker) => fs13.existsSync(path9.join(dir, marker)))) {
|
|
131830
|
-
projectRoot = dir;
|
|
131831
|
-
}
|
|
131832
|
-
const parent = path9.dirname(dir);
|
|
131833
|
-
if (parent === dir) {
|
|
131834
|
-
break;
|
|
131835
|
-
}
|
|
131836
|
-
dir = parent;
|
|
131837
|
-
}
|
|
131838
|
-
return projectRoot ?? getSearchStartDirectory(targetPath);
|
|
131839
|
-
}
|
|
131840
|
-
function ensureNornCacheGitignore(cacheDir) {
|
|
131841
|
-
const gitignorePath = path9.join(cacheDir, CACHE_GITIGNORE_FILE);
|
|
131842
|
-
try {
|
|
131843
|
-
const hasDesiredContent = fs13.existsSync(gitignorePath) && fs13.readFileSync(gitignorePath, "utf8") === CACHE_GITIGNORE_CONTENT;
|
|
131844
|
-
if (hasDesiredContent) {
|
|
131845
|
-
return;
|
|
131846
|
-
}
|
|
131847
|
-
fs13.writeFileSync(gitignorePath, CACHE_GITIGNORE_CONTENT, "utf8");
|
|
131848
|
-
} catch {
|
|
131849
|
-
}
|
|
131850
|
-
}
|
|
131851
|
-
|
|
131852
|
-
// src/secrets/keyStore.ts
|
|
131853
|
-
var CACHE_FILE = "secret-keys.json";
|
|
131854
|
-
var CACHE_VERSION = 1;
|
|
132052
|
+
var fs15 = __toESM(require("fs"));
|
|
132053
|
+
var path11 = __toESM(require("path"));
|
|
132054
|
+
var CACHE_FILE2 = "secret-keys.json";
|
|
132055
|
+
var CACHE_VERSION2 = 1;
|
|
131855
132056
|
var CACHE_SCAN_IGNORED_DIRS = /* @__PURE__ */ new Set(["node_modules", ".git", "dist", "out"]);
|
|
131856
132057
|
var sessionKeys = /* @__PURE__ */ new Map();
|
|
131857
132058
|
var projectSecretKeyCacheDirs = /* @__PURE__ */ new Map();
|
|
131858
132059
|
function getCacheFilePath(cacheDir) {
|
|
131859
|
-
return
|
|
132060
|
+
return path11.join(cacheDir, CACHE_FILE2);
|
|
131860
132061
|
}
|
|
131861
132062
|
function cacheFileExists(cacheDir) {
|
|
131862
132063
|
const cacheFilePath = getCacheFilePath(cacheDir);
|
|
131863
132064
|
try {
|
|
131864
|
-
return
|
|
132065
|
+
return fs15.existsSync(cacheFilePath) && fs15.statSync(cacheFilePath).isFile();
|
|
131865
132066
|
} catch {
|
|
131866
132067
|
return false;
|
|
131867
132068
|
}
|
|
@@ -131878,13 +132079,13 @@ function getProjectSecretKeyCacheDirs(projectRoot) {
|
|
|
131878
132079
|
if (!dir) {
|
|
131879
132080
|
continue;
|
|
131880
132081
|
}
|
|
131881
|
-
const cacheDir =
|
|
132082
|
+
const cacheDir = path11.join(dir, NORN_CACHE_DIR);
|
|
131882
132083
|
if (cacheFileExists(cacheDir)) {
|
|
131883
132084
|
results.push(cacheDir);
|
|
131884
132085
|
}
|
|
131885
132086
|
let entries;
|
|
131886
132087
|
try {
|
|
131887
|
-
entries =
|
|
132088
|
+
entries = fs15.readdirSync(dir, { withFileTypes: true });
|
|
131888
132089
|
} catch {
|
|
131889
132090
|
continue;
|
|
131890
132091
|
}
|
|
@@ -131895,7 +132096,7 @@ function getProjectSecretKeyCacheDirs(projectRoot) {
|
|
|
131895
132096
|
if (entry.name === NORN_CACHE_DIR || CACHE_SCAN_IGNORED_DIRS.has(entry.name)) {
|
|
131896
132097
|
continue;
|
|
131897
132098
|
}
|
|
131898
|
-
queue.push(
|
|
132099
|
+
queue.push(path11.join(dir, entry.name));
|
|
131899
132100
|
}
|
|
131900
132101
|
}
|
|
131901
132102
|
results.sort();
|
|
@@ -131903,11 +132104,11 @@ function getProjectSecretKeyCacheDirs(projectRoot) {
|
|
|
131903
132104
|
return results;
|
|
131904
132105
|
}
|
|
131905
132106
|
function getCacheDistance(targetPath, cacheDir) {
|
|
131906
|
-
const relative5 =
|
|
132107
|
+
const relative5 = path11.relative(getSearchStartDirectory(targetPath), cacheDir);
|
|
131907
132108
|
if (!relative5 || relative5 === ".") {
|
|
131908
132109
|
return 0;
|
|
131909
132110
|
}
|
|
131910
|
-
return relative5.split(
|
|
132111
|
+
return relative5.split(path11.sep).filter((segment) => segment !== "").length;
|
|
131911
132112
|
}
|
|
131912
132113
|
function findExistingSecretKeyCacheDir(targetPath) {
|
|
131913
132114
|
const projectRoot = findProjectRoot(targetPath);
|
|
@@ -131934,9 +132135,9 @@ function rememberSecretKeyCacheDir(targetPath, cacheDir) {
|
|
|
131934
132135
|
function ensureCacheDir(targetPath) {
|
|
131935
132136
|
const existing = findExistingSecretKeyCacheDir(targetPath);
|
|
131936
132137
|
const projectRoot = findProjectRoot(targetPath);
|
|
131937
|
-
const cacheDir = existing ??
|
|
131938
|
-
if (!
|
|
131939
|
-
|
|
132138
|
+
const cacheDir = existing ?? path11.join(projectRoot, NORN_CACHE_DIR);
|
|
132139
|
+
if (!fs15.existsSync(cacheDir)) {
|
|
132140
|
+
fs15.mkdirSync(cacheDir, { recursive: true });
|
|
131940
132141
|
}
|
|
131941
132142
|
ensureNornCacheGitignore(cacheDir);
|
|
131942
132143
|
rememberSecretKeyCacheDir(targetPath, cacheDir);
|
|
@@ -131948,8 +132149,8 @@ function getReadCachePath(targetPath) {
|
|
|
131948
132149
|
return getCacheFilePath(existing);
|
|
131949
132150
|
}
|
|
131950
132151
|
const projectRoot = findProjectRoot(targetPath);
|
|
131951
|
-
const projectCacheDir =
|
|
131952
|
-
if (
|
|
132152
|
+
const projectCacheDir = path11.join(projectRoot, NORN_CACHE_DIR);
|
|
132153
|
+
if (fs15.existsSync(projectCacheDir) && fs15.statSync(projectCacheDir).isDirectory()) {
|
|
131953
132154
|
return getCacheFilePath(projectCacheDir);
|
|
131954
132155
|
}
|
|
131955
132156
|
return void 0;
|
|
@@ -131959,24 +132160,24 @@ function getWriteCachePath(targetPath) {
|
|
|
131959
132160
|
}
|
|
131960
132161
|
function readCache(targetPath) {
|
|
131961
132162
|
const cachePath = getReadCachePath(targetPath);
|
|
131962
|
-
if (!cachePath || !
|
|
131963
|
-
return { version:
|
|
132163
|
+
if (!cachePath || !fs15.existsSync(cachePath)) {
|
|
132164
|
+
return { version: CACHE_VERSION2, keys: {} };
|
|
131964
132165
|
}
|
|
131965
132166
|
try {
|
|
131966
|
-
const parsed = JSON.parse(
|
|
131967
|
-
if (parsed.version !==
|
|
131968
|
-
return { version:
|
|
132167
|
+
const parsed = JSON.parse(fs15.readFileSync(cachePath, "utf8"));
|
|
132168
|
+
if (parsed.version !== CACHE_VERSION2 || typeof parsed.keys !== "object" || parsed.keys === null) {
|
|
132169
|
+
return { version: CACHE_VERSION2, keys: {} };
|
|
131969
132170
|
}
|
|
131970
132171
|
return parsed;
|
|
131971
132172
|
} catch {
|
|
131972
|
-
return { version:
|
|
132173
|
+
return { version: CACHE_VERSION2, keys: {} };
|
|
131973
132174
|
}
|
|
131974
132175
|
}
|
|
131975
132176
|
function writeCache(targetPath, cache) {
|
|
131976
132177
|
const cachePath = getWriteCachePath(targetPath);
|
|
131977
|
-
|
|
132178
|
+
fs15.writeFileSync(cachePath, JSON.stringify(cache, null, 2), { encoding: "utf8", mode: 384 });
|
|
131978
132179
|
try {
|
|
131979
|
-
|
|
132180
|
+
fs15.chmodSync(cachePath, 384);
|
|
131980
132181
|
} catch {
|
|
131981
132182
|
}
|
|
131982
132183
|
}
|
|
@@ -132167,22 +132368,22 @@ function parseEnvFile(content, sourceFilePath) {
|
|
|
132167
132368
|
return config2;
|
|
132168
132369
|
}
|
|
132169
132370
|
function getEnvSearchStartDirectory(targetPath) {
|
|
132170
|
-
const resolvedPath =
|
|
132371
|
+
const resolvedPath = path12.resolve(targetPath);
|
|
132171
132372
|
try {
|
|
132172
|
-
const stats =
|
|
132173
|
-
return stats.isDirectory() ? resolvedPath :
|
|
132373
|
+
const stats = fs16.statSync(resolvedPath);
|
|
132374
|
+
return stats.isDirectory() ? resolvedPath : path12.dirname(resolvedPath);
|
|
132174
132375
|
} catch {
|
|
132175
|
-
return
|
|
132376
|
+
return path12.dirname(resolvedPath);
|
|
132176
132377
|
}
|
|
132177
132378
|
}
|
|
132178
132379
|
function findEnvFileFromPath(filePath) {
|
|
132179
132380
|
let dir = getEnvSearchStartDirectory(filePath);
|
|
132180
132381
|
while (true) {
|
|
132181
|
-
const envPath =
|
|
132182
|
-
if (
|
|
132382
|
+
const envPath = path12.join(dir, ENV_FILENAME);
|
|
132383
|
+
if (fs16.existsSync(envPath)) {
|
|
132183
132384
|
return envPath;
|
|
132184
132385
|
}
|
|
132185
|
-
const parentDir =
|
|
132386
|
+
const parentDir = path12.dirname(dir);
|
|
132186
132387
|
if (parentDir === dir) {
|
|
132187
132388
|
break;
|
|
132188
132389
|
}
|
|
@@ -132207,7 +132408,7 @@ function resolveNornenvImports(config2, baseDir, entryFilePath, readFile2, impor
|
|
|
132207
132408
|
}
|
|
132208
132409
|
for (const imp of config2.imports) {
|
|
132209
132410
|
const resolvedImportPath = resolveImportPath(imp.path, baseDir);
|
|
132210
|
-
if (!resolvedImportPath || !
|
|
132411
|
+
if (!resolvedImportPath || !fs16.existsSync(resolvedImportPath)) {
|
|
132211
132412
|
errors.push({
|
|
132212
132413
|
message: `Imported file not found: '${imp.path}'`,
|
|
132213
132414
|
filePath: entryFilePath,
|
|
@@ -132223,10 +132424,10 @@ function resolveNornenvImports(config2, baseDir, entryFilePath, readFile2, impor
|
|
|
132223
132424
|
});
|
|
132224
132425
|
continue;
|
|
132225
132426
|
}
|
|
132226
|
-
const normalizedPath =
|
|
132427
|
+
const normalizedPath = path12.resolve(resolvedImportPath);
|
|
132227
132428
|
if (stack.includes(normalizedPath)) {
|
|
132228
|
-
const entryDir =
|
|
132229
|
-
const cycle = [...stack, normalizedPath].map((p) =>
|
|
132429
|
+
const entryDir = path12.dirname(stack[0]);
|
|
132430
|
+
const cycle = [...stack, normalizedPath].map((p) => path12.relative(entryDir, p) || path12.basename(p)).join(" \u2192 ");
|
|
132230
132431
|
errors.push({
|
|
132231
132432
|
message: `Circular import detected: ${cycle}`,
|
|
132232
132433
|
filePath: entryFilePath,
|
|
@@ -132255,7 +132456,7 @@ function resolveNornenvImports(config2, baseDir, entryFilePath, readFile2, impor
|
|
|
132255
132456
|
if (importedConfig.imports.length > 0) {
|
|
132256
132457
|
const childResult = resolveNornenvImports(
|
|
132257
132458
|
importedConfig,
|
|
132258
|
-
|
|
132459
|
+
path12.dirname(normalizedPath),
|
|
132259
132460
|
normalizedPath,
|
|
132260
132461
|
readFile2,
|
|
132261
132462
|
[...stack, normalizedPath],
|
|
@@ -132273,7 +132474,7 @@ function resolveNornenvImports(config2, baseDir, entryFilePath, readFile2, impor
|
|
|
132273
132474
|
}
|
|
132274
132475
|
function resolveImportPath(importPath, baseDir) {
|
|
132275
132476
|
const cleaned = importPath.replace(/^["']|["']$/g, "");
|
|
132276
|
-
return
|
|
132477
|
+
return path12.resolve(baseDir, cleaned);
|
|
132277
132478
|
}
|
|
132278
132479
|
function registerVariableOrigins(config2, filePath, origins) {
|
|
132279
132480
|
for (const varName of Object.keys(config2.common)) {
|
|
@@ -132337,12 +132538,12 @@ function mergeConfigs(target, source, targetFilePath, sourceFilePath, variableOr
|
|
|
132337
132538
|
}
|
|
132338
132539
|
}
|
|
132339
132540
|
function toDisplayPath(filePath, entryFilePath) {
|
|
132340
|
-
const entryDir =
|
|
132341
|
-
const relative5 =
|
|
132342
|
-
return relative5 && relative5 !== "" ? relative5 :
|
|
132541
|
+
const entryDir = path12.dirname(entryFilePath);
|
|
132542
|
+
const relative5 = path12.relative(entryDir, filePath);
|
|
132543
|
+
return relative5 && relative5 !== "" ? relative5 : path12.basename(filePath);
|
|
132343
132544
|
}
|
|
132344
132545
|
function loadAndResolveEnvFile(filePath) {
|
|
132345
|
-
const content =
|
|
132546
|
+
const content = fs16.readFileSync(filePath, "utf-8");
|
|
132346
132547
|
const config2 = parseEnvFile(content, filePath);
|
|
132347
132548
|
if (config2.imports.length === 0) {
|
|
132348
132549
|
const secretErrors = resolveEncryptedSecretValues(config2, filePath);
|
|
@@ -132350,9 +132551,9 @@ function loadAndResolveEnvFile(filePath) {
|
|
|
132350
132551
|
}
|
|
132351
132552
|
const result = resolveNornenvImports(
|
|
132352
132553
|
config2,
|
|
132353
|
-
|
|
132554
|
+
path12.dirname(filePath),
|
|
132354
132555
|
filePath,
|
|
132355
|
-
(p) =>
|
|
132556
|
+
(p) => fs16.readFileSync(p, "utf-8")
|
|
132356
132557
|
);
|
|
132357
132558
|
result.secretErrors.push(...resolveEncryptedSecretValues(result.config, filePath));
|
|
132358
132559
|
return result;
|
|
@@ -132418,14 +132619,14 @@ function resolveEncryptedSecretValues(config2, entryFilePath) {
|
|
|
132418
132619
|
}
|
|
132419
132620
|
|
|
132420
132621
|
// src/secrets/cliSecrets.ts
|
|
132421
|
-
var
|
|
132422
|
-
var
|
|
132622
|
+
var fs18 = __toESM(require("fs"));
|
|
132623
|
+
var path14 = __toESM(require("path"));
|
|
132423
132624
|
var readline = __toESM(require("readline"));
|
|
132424
132625
|
var import_process = require("process");
|
|
132425
132626
|
|
|
132426
132627
|
// src/secrets/envFileSecrets.ts
|
|
132427
|
-
var
|
|
132428
|
-
var
|
|
132628
|
+
var fs17 = __toESM(require("fs"));
|
|
132629
|
+
var path13 = __toESM(require("path"));
|
|
132429
132630
|
var envRegex2 = /^\s*\[env:([a-zA-Z_][a-zA-Z0-9_-]*)\]\s*$/;
|
|
132430
132631
|
var secretConnectionStringRegex2 = /^(\s*secret\s+connectionString\s+)([a-zA-Z_][a-zA-Z0-9_]*)(\s*=\s*)(.+)$/;
|
|
132431
132632
|
var secretRegex2 = /^(\s*secret\s+)([a-zA-Z_][a-zA-Z0-9_]*)(\s*=\s*)(.+)$/;
|
|
@@ -132436,7 +132637,7 @@ function detectEol(content) {
|
|
|
132436
132637
|
return content.includes("\r\n") ? "\r\n" : "\n";
|
|
132437
132638
|
}
|
|
132438
132639
|
function isNornenvFilePath(filePath) {
|
|
132439
|
-
return
|
|
132640
|
+
return path13.basename(filePath).toLowerCase() === ".nornenv";
|
|
132440
132641
|
}
|
|
132441
132642
|
function extractSecretLines(content, filePath) {
|
|
132442
132643
|
const lines = splitContentLines(content);
|
|
@@ -132510,7 +132711,7 @@ function findSecretLine(content, variableName, envName) {
|
|
|
132510
132711
|
return secretLines.find((secret) => secret.name === variableName);
|
|
132511
132712
|
}
|
|
132512
132713
|
function loadSecretLine(filePath, variableName, envName) {
|
|
132513
|
-
const content =
|
|
132714
|
+
const content = fs17.readFileSync(filePath, "utf8");
|
|
132514
132715
|
const secret = findSecretLine(content, variableName, envName);
|
|
132515
132716
|
if (!secret) {
|
|
132516
132717
|
const envLabel = envName ? ` in [env:${envName}]` : "";
|
|
@@ -132519,22 +132720,22 @@ function loadSecretLine(filePath, variableName, envName) {
|
|
|
132519
132720
|
return { content, secret };
|
|
132520
132721
|
}
|
|
132521
132722
|
function writeSecretLine(filePath, content) {
|
|
132522
|
-
|
|
132723
|
+
fs17.writeFileSync(filePath, content, "utf8");
|
|
132523
132724
|
}
|
|
132524
132725
|
function discoverNornenvFiles(targetPath) {
|
|
132525
|
-
const resolved =
|
|
132526
|
-
if (!
|
|
132726
|
+
const resolved = path13.resolve(targetPath);
|
|
132727
|
+
if (!fs17.existsSync(resolved)) {
|
|
132527
132728
|
return [];
|
|
132528
132729
|
}
|
|
132529
|
-
const stats =
|
|
132730
|
+
const stats = fs17.statSync(resolved);
|
|
132530
132731
|
if (stats.isFile()) {
|
|
132531
132732
|
return isNornenvFilePath(resolved) ? [resolved] : [];
|
|
132532
132733
|
}
|
|
132533
132734
|
const results = [];
|
|
132534
132735
|
const walk = (dir) => {
|
|
132535
|
-
const entries =
|
|
132736
|
+
const entries = fs17.readdirSync(dir, { withFileTypes: true });
|
|
132536
132737
|
for (const entry of entries) {
|
|
132537
|
-
const fullPath =
|
|
132738
|
+
const fullPath = path13.join(dir, entry.name);
|
|
132538
132739
|
if (entry.isDirectory()) {
|
|
132539
132740
|
if (entry.name === "node_modules" || entry.name === ".git" || entry.name === "dist" || entry.name === "out") {
|
|
132540
132741
|
continue;
|
|
@@ -132593,8 +132794,8 @@ function formatSecretError(err, envFilePath) {
|
|
|
132593
132794
|
if (!envFilePath) {
|
|
132594
132795
|
return `${err.message}`;
|
|
132595
132796
|
}
|
|
132596
|
-
const relative5 =
|
|
132597
|
-
const fileLabel = relative5 && relative5 !== "" ? relative5 :
|
|
132797
|
+
const relative5 = path14.relative(path14.dirname(envFilePath), err.filePath);
|
|
132798
|
+
const fileLabel = relative5 && relative5 !== "" ? relative5 : path14.basename(err.filePath);
|
|
132598
132799
|
const lineLabel = err.line >= 0 ? `${fileLabel}:${err.line + 1}` : fileLabel;
|
|
132599
132800
|
return `${lineLabel} - ${err.message}`;
|
|
132600
132801
|
}
|
|
@@ -132690,7 +132891,7 @@ async function handleEncrypt(args) {
|
|
|
132690
132891
|
console.error(`Error: encrypt requires --file and --var.`);
|
|
132691
132892
|
return 1;
|
|
132692
132893
|
}
|
|
132693
|
-
const absoluteFilePath =
|
|
132894
|
+
const absoluteFilePath = path14.resolve(filePath);
|
|
132694
132895
|
const { content, secret } = loadSecretLine(absoluteFilePath, variableName, envName);
|
|
132695
132896
|
if (secret.encrypted) {
|
|
132696
132897
|
console.error(`Error: Secret '${variableName}' is already encrypted. Use rotate instead.`);
|
|
@@ -132722,7 +132923,7 @@ async function handleRotate(args) {
|
|
|
132722
132923
|
console.error(`Error: rotate requires --file and --var.`);
|
|
132723
132924
|
return 1;
|
|
132724
132925
|
}
|
|
132725
|
-
const absoluteFilePath =
|
|
132926
|
+
const absoluteFilePath = path14.resolve(filePath);
|
|
132726
132927
|
const { content, secret } = loadSecretLine(absoluteFilePath, variableName, envName);
|
|
132727
132928
|
let kid = explicitKid;
|
|
132728
132929
|
if (!kid && secret.encrypted) {
|
|
@@ -132753,7 +132954,7 @@ async function handleRotate(args) {
|
|
|
132753
132954
|
}
|
|
132754
132955
|
async function handleRekey(args) {
|
|
132755
132956
|
const positional = args.filter((arg) => !arg.startsWith("-"));
|
|
132756
|
-
const targetPath = positional[0] ?
|
|
132957
|
+
const targetPath = positional[0] ? path14.resolve(positional[0]) : process.cwd();
|
|
132757
132958
|
const targetKid = getFlagValue(args, "--kid");
|
|
132758
132959
|
const files = discoverNornenvFiles(targetPath);
|
|
132759
132960
|
if (files.length === 0) {
|
|
@@ -132763,7 +132964,7 @@ async function handleRekey(args) {
|
|
|
132763
132964
|
let updatedFiles = 0;
|
|
132764
132965
|
let updatedSecrets = 0;
|
|
132765
132966
|
for (const filePath of files) {
|
|
132766
|
-
const original =
|
|
132967
|
+
const original = fs18.readFileSync(filePath, "utf8");
|
|
132767
132968
|
const secretLines = extractSecretLines(original, filePath);
|
|
132768
132969
|
if (secretLines.length === 0) {
|
|
132769
132970
|
continue;
|
|
@@ -132814,7 +133015,7 @@ async function handleRekey(args) {
|
|
|
132814
133015
|
updatedSecrets += 1;
|
|
132815
133016
|
}
|
|
132816
133017
|
if (updated !== original) {
|
|
132817
|
-
|
|
133018
|
+
fs18.writeFileSync(filePath, updated, "utf8");
|
|
132818
133019
|
updatedFiles += 1;
|
|
132819
133020
|
}
|
|
132820
133021
|
}
|
|
@@ -132823,7 +133024,7 @@ async function handleRekey(args) {
|
|
|
132823
133024
|
}
|
|
132824
133025
|
async function handleAudit(args) {
|
|
132825
133026
|
const positional = args.filter((arg) => !arg.startsWith("-"));
|
|
132826
|
-
const targetPath = positional[0] ?
|
|
133027
|
+
const targetPath = positional[0] ? path14.resolve(positional[0]) : process.cwd();
|
|
132827
133028
|
const files = discoverNornenvFiles(targetPath);
|
|
132828
133029
|
if (files.length === 0) {
|
|
132829
133030
|
console.log(`No .nornenv files found under ${targetPath}`);
|
|
@@ -132831,7 +133032,7 @@ async function handleAudit(args) {
|
|
|
132831
133032
|
}
|
|
132832
133033
|
const issues = [];
|
|
132833
133034
|
for (const filePath of files) {
|
|
132834
|
-
const content =
|
|
133035
|
+
const content = fs18.readFileSync(filePath, "utf8");
|
|
132835
133036
|
const secrets = extractSecretLines(content, filePath);
|
|
132836
133037
|
for (const secret of secrets) {
|
|
132837
133038
|
if (!secret.encrypted) {
|
|
@@ -132918,9 +133119,9 @@ function printSecretResolutionErrors(errors, envFilePath) {
|
|
|
132918
133119
|
|
|
132919
133120
|
// src/cli.ts
|
|
132920
133121
|
function formatNornenvErrorLocation(rootEnvFilePath, errorFilePath, line2) {
|
|
132921
|
-
const baseDir =
|
|
132922
|
-
const relativePath =
|
|
132923
|
-
const fileLabel = relativePath && relativePath !== "" ? relativePath :
|
|
133122
|
+
const baseDir = path15.dirname(rootEnvFilePath);
|
|
133123
|
+
const relativePath = path15.relative(baseDir, errorFilePath);
|
|
133124
|
+
const fileLabel = relativePath && relativePath !== "" ? relativePath : path15.basename(errorFilePath);
|
|
132924
133125
|
return line2 >= 0 ? `${fileLabel}:${line2 + 1}` : fileLabel;
|
|
132925
133126
|
}
|
|
132926
133127
|
function resolveEnvironmentForPath(targetPath, selectedEnv) {
|
|
@@ -133002,10 +133203,10 @@ function generateTimestamp() {
|
|
|
133002
133203
|
return `${year}-${month}-${day}-${hours}${minutes}${seconds}`;
|
|
133003
133204
|
}
|
|
133004
133205
|
function generateReportPaths(outputDir, inputFile, timestamp) {
|
|
133005
|
-
const baseName =
|
|
133206
|
+
const baseName = path15.basename(inputFile, path15.extname(inputFile));
|
|
133006
133207
|
return {
|
|
133007
|
-
junitPath:
|
|
133008
|
-
htmlPath:
|
|
133208
|
+
junitPath: path15.join(outputDir, `${baseName}-${timestamp}-results.xml`),
|
|
133209
|
+
htmlPath: path15.join(outputDir, `${baseName}-${timestamp}-report.html`)
|
|
133009
133210
|
};
|
|
133010
133211
|
}
|
|
133011
133212
|
function parseArgs(args) {
|
|
@@ -133270,9 +133471,9 @@ async function runSingleRequest(fileContent, variables, cookieJar, apiDefinition
|
|
|
133270
133471
|
function discoverNornFiles(dirPath) {
|
|
133271
133472
|
const files = [];
|
|
133272
133473
|
function walkDir(currentPath) {
|
|
133273
|
-
const entries =
|
|
133474
|
+
const entries = fs19.readdirSync(currentPath, { withFileTypes: true });
|
|
133274
133475
|
for (const entry of entries) {
|
|
133275
|
-
const fullPath =
|
|
133476
|
+
const fullPath = path15.join(currentPath, entry.name);
|
|
133276
133477
|
if (entry.isDirectory()) {
|
|
133277
133478
|
if (!entry.name.startsWith(".") && entry.name !== "node_modules") {
|
|
133278
133479
|
walkDir(fullPath);
|
|
@@ -133292,7 +133493,7 @@ function countTestSequences(fileContent, tagFilterOptions) {
|
|
|
133292
133493
|
return { total: testSequences.length, filtered };
|
|
133293
133494
|
}
|
|
133294
133495
|
async function loadTheoryFile(theoryPath, workingDir) {
|
|
133295
|
-
const absolutePath =
|
|
133496
|
+
const absolutePath = path15.resolve(workingDir, theoryPath);
|
|
133296
133497
|
const content = await fsPromises.readFile(absolutePath, "utf-8");
|
|
133297
133498
|
return JSON.parse(content);
|
|
133298
133499
|
}
|
|
@@ -133413,12 +133614,12 @@ async function main() {
|
|
|
133413
133614
|
if (options.insecure) {
|
|
133414
133615
|
console.error(colors.warning("Warning: TLS certificate verification is disabled (--insecure). Use this only for local development."));
|
|
133415
133616
|
}
|
|
133416
|
-
const inputPath =
|
|
133417
|
-
if (!
|
|
133617
|
+
const inputPath = path15.resolve(options.file);
|
|
133618
|
+
if (!fs19.existsSync(inputPath)) {
|
|
133418
133619
|
console.error(`Error: Path not found: ${inputPath}`);
|
|
133419
133620
|
process.exit(1);
|
|
133420
133621
|
}
|
|
133421
|
-
const isDirectory =
|
|
133622
|
+
const isDirectory = fs19.statSync(inputPath).isDirectory();
|
|
133422
133623
|
let filesToRun;
|
|
133423
133624
|
if (isDirectory) {
|
|
133424
133625
|
filesToRun = discoverNornFiles(inputPath);
|
|
@@ -133485,11 +133686,11 @@ async function main() {
|
|
|
133485
133686
|
}
|
|
133486
133687
|
mergeSecrets(combinedSecretNames, combinedSecretValues, resolvedEnv.secretNames, resolvedEnv.secretValues);
|
|
133487
133688
|
const redaction2 = createRedactionOptions(combinedSecretNames, combinedSecretValues, !options.noRedact);
|
|
133488
|
-
const fileContent =
|
|
133689
|
+
const fileContent = fs19.readFileSync(filePath, "utf-8");
|
|
133489
133690
|
const fileVariables = extractFileLevelVariables(fileContent);
|
|
133490
133691
|
const variables = attachEnvironmentScope({ ...resolvedEnv.variables, ...fileVariables }, resolvedEnv.variables);
|
|
133491
133692
|
const cookieJar = createCookieJar();
|
|
133492
|
-
const workingDir =
|
|
133693
|
+
const workingDir = path15.dirname(filePath);
|
|
133493
133694
|
const importResult = await resolveImports(
|
|
133494
133695
|
fileContent,
|
|
133495
133696
|
workingDir,
|
|
@@ -133657,7 +133858,7 @@ ${fileContent}` : fileContent;
|
|
|
133657
133858
|
let totalTestCount = 0;
|
|
133658
133859
|
let filteredTestCount = 0;
|
|
133659
133860
|
for (const filePath of filesToRun) {
|
|
133660
|
-
const fileContent =
|
|
133861
|
+
const fileContent = fs19.readFileSync(filePath, "utf-8");
|
|
133661
133862
|
const counts = countTestSequences(fileContent, tagFilterOptions);
|
|
133662
133863
|
totalTestCount += counts.total;
|
|
133663
133864
|
filteredTestCount += counts.filtered;
|
|
@@ -133699,16 +133900,16 @@ ${fileContent}` : fileContent;
|
|
|
133699
133900
|
process.exit(1);
|
|
133700
133901
|
}
|
|
133701
133902
|
if (!resolvedEnv.envFilePath && options.env) {
|
|
133702
|
-
const relPath = isDirectory ?
|
|
133903
|
+
const relPath = isDirectory ? path15.relative(inputPath, filePath) : path15.basename(filePath);
|
|
133703
133904
|
console.error(colors.warning(`Warning: --env specified but no .nornenv file found for ${relPath}`));
|
|
133704
133905
|
}
|
|
133705
133906
|
mergeSecrets(combinedSecretNames, combinedSecretValues, resolvedEnv.secretNames, resolvedEnv.secretValues);
|
|
133706
133907
|
const redaction2 = createRedactionOptions(combinedSecretNames, combinedSecretValues, !options.noRedact);
|
|
133707
|
-
const fileContent =
|
|
133908
|
+
const fileContent = fs19.readFileSync(filePath, "utf-8");
|
|
133708
133909
|
const fileVariables = extractFileLevelVariables(fileContent);
|
|
133709
133910
|
const variables = attachEnvironmentScope({ ...resolvedEnv.variables, ...fileVariables }, resolvedEnv.variables);
|
|
133710
133911
|
const cookieJar = createCookieJar();
|
|
133711
|
-
const workingDir =
|
|
133912
|
+
const workingDir = path15.dirname(filePath);
|
|
133712
133913
|
const importResult = await resolveImports(
|
|
133713
133914
|
fileContent,
|
|
133714
133915
|
workingDir,
|
|
@@ -133741,7 +133942,7 @@ ${fileContent}` : fileContent;
|
|
|
133741
133942
|
continue;
|
|
133742
133943
|
}
|
|
133743
133944
|
if (isDirectory && options.output !== "json") {
|
|
133744
|
-
const relPath =
|
|
133945
|
+
const relPath = path15.relative(inputPath, filePath);
|
|
133745
133946
|
console.log(colors.info(`
|
|
133746
133947
|
\u2501\u2501\u2501 ${relPath} \u2501\u2501\u2501`));
|
|
133747
133948
|
}
|
|
@@ -133786,7 +133987,7 @@ ${fileContent}` : fileContent;
|
|
|
133786
133987
|
let htmlOutputPath = options.htmlOutput;
|
|
133787
133988
|
if (options.outputDir) {
|
|
133788
133989
|
const timestamp = generateTimestamp();
|
|
133789
|
-
const baseName = isDirectory ?
|
|
133990
|
+
const baseName = isDirectory ? path15.basename(inputPath) : path15.basename(inputPath, path15.extname(inputPath));
|
|
133790
133991
|
const generatedPaths = generateReportPaths(options.outputDir, baseName + ".norn", timestamp);
|
|
133791
133992
|
if (!junitOutputPath) {
|
|
133792
133993
|
junitOutputPath = generatedPaths.junitPath;
|
|
@@ -133794,12 +133995,12 @@ ${fileContent}` : fileContent;
|
|
|
133794
133995
|
if (!htmlOutputPath) {
|
|
133795
133996
|
htmlOutputPath = generatedPaths.htmlPath;
|
|
133796
133997
|
}
|
|
133797
|
-
if (!
|
|
133798
|
-
|
|
133998
|
+
if (!fs19.existsSync(options.outputDir)) {
|
|
133999
|
+
fs19.mkdirSync(options.outputDir, { recursive: true });
|
|
133799
134000
|
}
|
|
133800
134001
|
}
|
|
133801
134002
|
if (junitOutputPath) {
|
|
133802
|
-
const suiteName = isDirectory ?
|
|
134003
|
+
const suiteName = isDirectory ? path15.basename(inputPath) : path15.basename(inputPath, path15.extname(inputPath));
|
|
133803
134004
|
if (result.type === "request") {
|
|
133804
134005
|
generateJUnitReportFromResponse(
|
|
133805
134006
|
result.results[0],
|
|
@@ -133815,11 +134016,11 @@ ${fileContent}` : fileContent;
|
|
|
133815
134016
|
console.log(colors.info(`JUnit report written to: ${junitOutputPath}`));
|
|
133816
134017
|
}
|
|
133817
134018
|
if (htmlOutputPath) {
|
|
133818
|
-
const title = `Norn Test Report - ${
|
|
134019
|
+
const title = `Norn Test Report - ${path15.basename(inputPath)}`;
|
|
133819
134020
|
if (result.type === "request") {
|
|
133820
134021
|
generateHtmlReportFromResponse(
|
|
133821
134022
|
result.results[0],
|
|
133822
|
-
options.request ||
|
|
134023
|
+
options.request || path15.basename(inputPath),
|
|
133823
134024
|
{ outputPath: htmlOutputPath, redaction, title }
|
|
133824
134025
|
);
|
|
133825
134026
|
} else {
|