norn-cli 2.0.0 → 2.1.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/dist/cli.js
CHANGED
|
@@ -8881,11 +8881,11 @@ var require_mime_types = __commonJS({
|
|
|
8881
8881
|
}
|
|
8882
8882
|
return exts[0];
|
|
8883
8883
|
}
|
|
8884
|
-
function lookup(
|
|
8885
|
-
if (!
|
|
8884
|
+
function lookup(path20) {
|
|
8885
|
+
if (!path20 || typeof path20 !== "string") {
|
|
8886
8886
|
return false;
|
|
8887
8887
|
}
|
|
8888
|
-
var extension2 = extname3("x." +
|
|
8888
|
+
var extension2 = extname3("x." + path20).toLowerCase().substr(1);
|
|
8889
8889
|
if (!extension2) {
|
|
8890
8890
|
return false;
|
|
8891
8891
|
}
|
|
@@ -9990,7 +9990,7 @@ var require_form_data = __commonJS({
|
|
|
9990
9990
|
"use strict";
|
|
9991
9991
|
var CombinedStream = require_combined_stream();
|
|
9992
9992
|
var util4 = require("util");
|
|
9993
|
-
var
|
|
9993
|
+
var path20 = require("path");
|
|
9994
9994
|
var http3 = require("http");
|
|
9995
9995
|
var https3 = require("https");
|
|
9996
9996
|
var parseUrl = require("url").parse;
|
|
@@ -10118,11 +10118,11 @@ var require_form_data = __commonJS({
|
|
|
10118
10118
|
FormData3.prototype._getContentDisposition = function(value, options) {
|
|
10119
10119
|
var filename;
|
|
10120
10120
|
if (typeof options.filepath === "string") {
|
|
10121
|
-
filename =
|
|
10121
|
+
filename = path20.normalize(options.filepath).replace(/\\/g, "/");
|
|
10122
10122
|
} else if (options.filename || value && (value.name || value.path)) {
|
|
10123
|
-
filename =
|
|
10123
|
+
filename = path20.basename(options.filename || value && (value.name || value.path));
|
|
10124
10124
|
} else if (value && value.readable && hasOwn(value, "httpVersion")) {
|
|
10125
|
-
filename =
|
|
10125
|
+
filename = path20.basename(value.client._httpMessage.path || "");
|
|
10126
10126
|
}
|
|
10127
10127
|
if (filename) {
|
|
10128
10128
|
return 'filename="' + filename + '"';
|
|
@@ -15331,8 +15331,8 @@ var require_utils = __commonJS({
|
|
|
15331
15331
|
}
|
|
15332
15332
|
return ind;
|
|
15333
15333
|
}
|
|
15334
|
-
function removeDotSegments(
|
|
15335
|
-
let input2 =
|
|
15334
|
+
function removeDotSegments(path20) {
|
|
15335
|
+
let input2 = path20;
|
|
15336
15336
|
const output2 = [];
|
|
15337
15337
|
let nextSlash = -1;
|
|
15338
15338
|
let len = 0;
|
|
@@ -15531,8 +15531,8 @@ var require_schemes = __commonJS({
|
|
|
15531
15531
|
wsComponent.secure = void 0;
|
|
15532
15532
|
}
|
|
15533
15533
|
if (wsComponent.resourceName) {
|
|
15534
|
-
const [
|
|
15535
|
-
wsComponent.path =
|
|
15534
|
+
const [path20, query] = wsComponent.resourceName.split("?");
|
|
15535
|
+
wsComponent.path = path20 && path20 !== "/" ? path20 : void 0;
|
|
15536
15536
|
wsComponent.query = query;
|
|
15537
15537
|
wsComponent.resourceName = void 0;
|
|
15538
15538
|
}
|
|
@@ -21985,7 +21985,7 @@ var require_split2 = __commonJS({
|
|
|
21985
21985
|
var require_helper = __commonJS({
|
|
21986
21986
|
"node_modules/pgpass/lib/helper.js"(exports2, module2) {
|
|
21987
21987
|
"use strict";
|
|
21988
|
-
var
|
|
21988
|
+
var path20 = require("path");
|
|
21989
21989
|
var Stream = require("stream").Stream;
|
|
21990
21990
|
var split = require_split2();
|
|
21991
21991
|
var util4 = require("util");
|
|
@@ -22024,7 +22024,7 @@ var require_helper = __commonJS({
|
|
|
22024
22024
|
};
|
|
22025
22025
|
module2.exports.getFileName = function(rawEnv) {
|
|
22026
22026
|
var env3 = rawEnv || process.env;
|
|
22027
|
-
var file2 = env3.PGPASSFILE || (isWin ?
|
|
22027
|
+
var file2 = env3.PGPASSFILE || (isWin ? path20.join(env3.APPDATA || "./", "postgresql", "pgpass.conf") : path20.join(env3.HOME || "./", ".pgpass"));
|
|
22028
22028
|
return file2;
|
|
22029
22029
|
};
|
|
22030
22030
|
module2.exports.usePgPass = function(stats, fname) {
|
|
@@ -22156,7 +22156,7 @@ var require_helper = __commonJS({
|
|
|
22156
22156
|
var require_lib = __commonJS({
|
|
22157
22157
|
"node_modules/pgpass/lib/index.js"(exports2, module2) {
|
|
22158
22158
|
"use strict";
|
|
22159
|
-
var
|
|
22159
|
+
var path20 = require("path");
|
|
22160
22160
|
var fs20 = require("fs");
|
|
22161
22161
|
var helper = require_helper();
|
|
22162
22162
|
module2.exports = function(connInfo, cb) {
|
|
@@ -25229,7 +25229,7 @@ var require_table = __commonJS({
|
|
|
25229
25229
|
let cursor = -1;
|
|
25230
25230
|
let buffer = "";
|
|
25231
25231
|
let escaped = false;
|
|
25232
|
-
const
|
|
25232
|
+
const path20 = [];
|
|
25233
25233
|
while (++cursor < length) {
|
|
25234
25234
|
const char = name.charAt(cursor);
|
|
25235
25235
|
if (char === "[") {
|
|
@@ -25248,7 +25248,7 @@ var require_table = __commonJS({
|
|
|
25248
25248
|
if (escaped) {
|
|
25249
25249
|
buffer += char;
|
|
25250
25250
|
} else {
|
|
25251
|
-
|
|
25251
|
+
path20.push(buffer);
|
|
25252
25252
|
buffer = "";
|
|
25253
25253
|
}
|
|
25254
25254
|
} else {
|
|
@@ -25256,26 +25256,26 @@ var require_table = __commonJS({
|
|
|
25256
25256
|
}
|
|
25257
25257
|
}
|
|
25258
25258
|
if (buffer) {
|
|
25259
|
-
|
|
25259
|
+
path20.push(buffer);
|
|
25260
25260
|
}
|
|
25261
|
-
switch (
|
|
25261
|
+
switch (path20.length) {
|
|
25262
25262
|
case 1:
|
|
25263
25263
|
return {
|
|
25264
|
-
name:
|
|
25264
|
+
name: path20[0],
|
|
25265
25265
|
schema: null,
|
|
25266
25266
|
database: null
|
|
25267
25267
|
};
|
|
25268
25268
|
case 2:
|
|
25269
25269
|
return {
|
|
25270
|
-
name:
|
|
25271
|
-
schema:
|
|
25270
|
+
name: path20[1],
|
|
25271
|
+
schema: path20[0],
|
|
25272
25272
|
database: null
|
|
25273
25273
|
};
|
|
25274
25274
|
case 3:
|
|
25275
25275
|
return {
|
|
25276
|
-
name:
|
|
25277
|
-
schema:
|
|
25278
|
-
database:
|
|
25276
|
+
name: path20[2],
|
|
25277
|
+
schema: path20[1],
|
|
25278
|
+
database: path20[0]
|
|
25279
25279
|
};
|
|
25280
25280
|
default:
|
|
25281
25281
|
throw new Error("Invalid table name.");
|
|
@@ -28761,13 +28761,13 @@ function __disposeResources(env3) {
|
|
|
28761
28761
|
}
|
|
28762
28762
|
return next();
|
|
28763
28763
|
}
|
|
28764
|
-
function __rewriteRelativeImportExtension(
|
|
28765
|
-
if (typeof
|
|
28766
|
-
return
|
|
28764
|
+
function __rewriteRelativeImportExtension(path20, preserveJsx) {
|
|
28765
|
+
if (typeof path20 === "string" && /^\.\.?\//.test(path20)) {
|
|
28766
|
+
return path20.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) {
|
|
28767
28767
|
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js";
|
|
28768
28768
|
});
|
|
28769
28769
|
}
|
|
28770
|
-
return
|
|
28770
|
+
return path20;
|
|
28771
28771
|
}
|
|
28772
28772
|
var extendStatics, __assign, __createBinding, __setModuleDefault, ownKeys, _SuppressedError, tslib_es6_default;
|
|
28773
28773
|
var init_tslib_es6 = __esm({
|
|
@@ -28914,8 +28914,8 @@ var require_msalPlugins = __commonJS({
|
|
|
28914
28914
|
}
|
|
28915
28915
|
};
|
|
28916
28916
|
exports2.msalNodeFlowVSCodeCredentialControl = {
|
|
28917
|
-
setVSCodeAuthRecordPath(
|
|
28918
|
-
exports2.vsCodeAuthRecordPath =
|
|
28917
|
+
setVSCodeAuthRecordPath(path20) {
|
|
28918
|
+
exports2.vsCodeAuthRecordPath = path20;
|
|
28919
28919
|
},
|
|
28920
28920
|
setVSCodeBroker(broker) {
|
|
28921
28921
|
exports2.vsCodeBrokerInfo = {
|
|
@@ -41657,7 +41657,7 @@ var require_msal_node = __commonJS({
|
|
|
41657
41657
|
var msalCommon = require_lib4();
|
|
41658
41658
|
var jwt2 = require_jsonwebtoken();
|
|
41659
41659
|
var fs20 = require("fs");
|
|
41660
|
-
var
|
|
41660
|
+
var path20 = require("path");
|
|
41661
41661
|
var Serializer = class {
|
|
41662
41662
|
/**
|
|
41663
41663
|
* serialize the JSON blob
|
|
@@ -51508,7 +51508,7 @@ Headers: ${JSON.stringify(headers)}`
|
|
|
51508
51508
|
throw createManagedIdentityError(platformNotSupported);
|
|
51509
51509
|
}
|
|
51510
51510
|
const expectedSecretFilePath = SUPPORTED_AZURE_ARC_PLATFORMS[process.platform];
|
|
51511
|
-
const fileName =
|
|
51511
|
+
const fileName = path20.basename(secretFilePath);
|
|
51512
51512
|
if (!fileName.endsWith(".key")) {
|
|
51513
51513
|
throw createManagedIdentityError(invalidFileExtension);
|
|
51514
51514
|
}
|
|
@@ -57905,8 +57905,8 @@ var require_getClient = __commonJS({
|
|
|
57905
57905
|
}
|
|
57906
57906
|
const { allowInsecureConnection, httpClient } = clientOptions;
|
|
57907
57907
|
const endpointUrl = clientOptions.endpoint ?? endpoint;
|
|
57908
|
-
const client = (
|
|
57909
|
-
const getUrl = (requestOptions) => (0, import_urlHelpers.buildRequestUrl)(endpointUrl,
|
|
57908
|
+
const client = (path20, ...args) => {
|
|
57909
|
+
const getUrl = (requestOptions) => (0, import_urlHelpers.buildRequestUrl)(endpointUrl, path20, args, { allowInsecureConnection, ...requestOptions });
|
|
57910
57910
|
return {
|
|
57911
57911
|
get: (requestOptions = {}) => {
|
|
57912
57912
|
return buildOperation(
|
|
@@ -60811,15 +60811,15 @@ var require_urlHelpers2 = __commonJS({
|
|
|
60811
60811
|
let isAbsolutePath = false;
|
|
60812
60812
|
let requestUrl = replaceAll(baseUri, urlReplacements);
|
|
60813
60813
|
if (operationSpec.path) {
|
|
60814
|
-
let
|
|
60815
|
-
if (operationSpec.path === "/{nextLink}" &&
|
|
60816
|
-
|
|
60814
|
+
let path20 = replaceAll(operationSpec.path, urlReplacements);
|
|
60815
|
+
if (operationSpec.path === "/{nextLink}" && path20.startsWith("/")) {
|
|
60816
|
+
path20 = path20.substring(1);
|
|
60817
60817
|
}
|
|
60818
|
-
if (isAbsoluteUrl(
|
|
60819
|
-
requestUrl =
|
|
60818
|
+
if (isAbsoluteUrl(path20)) {
|
|
60819
|
+
requestUrl = path20;
|
|
60820
60820
|
isAbsolutePath = true;
|
|
60821
60821
|
} else {
|
|
60822
|
-
requestUrl = appendPath(requestUrl,
|
|
60822
|
+
requestUrl = appendPath(requestUrl, path20);
|
|
60823
60823
|
}
|
|
60824
60824
|
}
|
|
60825
60825
|
const { queryParams, sequenceParams } = calculateQueryParameters(operationSpec, operationArguments, fallbackObject);
|
|
@@ -60865,9 +60865,9 @@ var require_urlHelpers2 = __commonJS({
|
|
|
60865
60865
|
}
|
|
60866
60866
|
const searchStart = pathToAppend.indexOf("?");
|
|
60867
60867
|
if (searchStart !== -1) {
|
|
60868
|
-
const
|
|
60868
|
+
const path20 = pathToAppend.substring(0, searchStart);
|
|
60869
60869
|
const search = pathToAppend.substring(searchStart + 1);
|
|
60870
|
-
newPath = newPath +
|
|
60870
|
+
newPath = newPath + path20;
|
|
60871
60871
|
if (search) {
|
|
60872
60872
|
parsedUrl.search = parsedUrl.search ? `${parsedUrl.search}&${search}` : search;
|
|
60873
60873
|
}
|
|
@@ -100795,7 +100795,7 @@ var require_windows = __commonJS({
|
|
|
100795
100795
|
module2.exports = isexe;
|
|
100796
100796
|
isexe.sync = sync;
|
|
100797
100797
|
var fs20 = require("fs");
|
|
100798
|
-
function checkPathExt(
|
|
100798
|
+
function checkPathExt(path20, options) {
|
|
100799
100799
|
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
100800
100800
|
if (!pathext) {
|
|
100801
100801
|
return true;
|
|
@@ -100806,25 +100806,25 @@ var require_windows = __commonJS({
|
|
|
100806
100806
|
}
|
|
100807
100807
|
for (var i = 0; i < pathext.length; i++) {
|
|
100808
100808
|
var p = pathext[i].toLowerCase();
|
|
100809
|
-
if (p &&
|
|
100809
|
+
if (p && path20.substr(-p.length).toLowerCase() === p) {
|
|
100810
100810
|
return true;
|
|
100811
100811
|
}
|
|
100812
100812
|
}
|
|
100813
100813
|
return false;
|
|
100814
100814
|
}
|
|
100815
|
-
function checkStat(stat,
|
|
100815
|
+
function checkStat(stat, path20, options) {
|
|
100816
100816
|
if (!stat.isSymbolicLink() && !stat.isFile()) {
|
|
100817
100817
|
return false;
|
|
100818
100818
|
}
|
|
100819
|
-
return checkPathExt(
|
|
100819
|
+
return checkPathExt(path20, options);
|
|
100820
100820
|
}
|
|
100821
|
-
function isexe(
|
|
100822
|
-
fs20.stat(
|
|
100823
|
-
cb(er, er ? false : checkStat(stat,
|
|
100821
|
+
function isexe(path20, options, cb) {
|
|
100822
|
+
fs20.stat(path20, function(er, stat) {
|
|
100823
|
+
cb(er, er ? false : checkStat(stat, path20, options));
|
|
100824
100824
|
});
|
|
100825
100825
|
}
|
|
100826
|
-
function sync(
|
|
100827
|
-
return checkStat(fs20.statSync(
|
|
100826
|
+
function sync(path20, options) {
|
|
100827
|
+
return checkStat(fs20.statSync(path20), path20, options);
|
|
100828
100828
|
}
|
|
100829
100829
|
}
|
|
100830
100830
|
});
|
|
@@ -100835,13 +100835,13 @@ var require_mode = __commonJS({
|
|
|
100835
100835
|
module2.exports = isexe;
|
|
100836
100836
|
isexe.sync = sync;
|
|
100837
100837
|
var fs20 = require("fs");
|
|
100838
|
-
function isexe(
|
|
100839
|
-
fs20.stat(
|
|
100838
|
+
function isexe(path20, options, cb) {
|
|
100839
|
+
fs20.stat(path20, function(er, stat) {
|
|
100840
100840
|
cb(er, er ? false : checkStat(stat, options));
|
|
100841
100841
|
});
|
|
100842
100842
|
}
|
|
100843
|
-
function sync(
|
|
100844
|
-
return checkStat(fs20.statSync(
|
|
100843
|
+
function sync(path20, options) {
|
|
100844
|
+
return checkStat(fs20.statSync(path20), options);
|
|
100845
100845
|
}
|
|
100846
100846
|
function checkStat(stat, options) {
|
|
100847
100847
|
return stat.isFile() && checkMode(stat, options);
|
|
@@ -100874,7 +100874,7 @@ var require_isexe = __commonJS({
|
|
|
100874
100874
|
}
|
|
100875
100875
|
module2.exports = isexe;
|
|
100876
100876
|
isexe.sync = sync;
|
|
100877
|
-
function isexe(
|
|
100877
|
+
function isexe(path20, options, cb) {
|
|
100878
100878
|
if (typeof options === "function") {
|
|
100879
100879
|
cb = options;
|
|
100880
100880
|
options = {};
|
|
@@ -100884,7 +100884,7 @@ var require_isexe = __commonJS({
|
|
|
100884
100884
|
throw new TypeError("callback not provided");
|
|
100885
100885
|
}
|
|
100886
100886
|
return new Promise(function(resolve16, reject) {
|
|
100887
|
-
isexe(
|
|
100887
|
+
isexe(path20, options || {}, function(er, is) {
|
|
100888
100888
|
if (er) {
|
|
100889
100889
|
reject(er);
|
|
100890
100890
|
} else {
|
|
@@ -100893,7 +100893,7 @@ var require_isexe = __commonJS({
|
|
|
100893
100893
|
});
|
|
100894
100894
|
});
|
|
100895
100895
|
}
|
|
100896
|
-
core(
|
|
100896
|
+
core(path20, options || {}, function(er, is) {
|
|
100897
100897
|
if (er) {
|
|
100898
100898
|
if (er.code === "EACCES" || options && options.ignoreErrors) {
|
|
100899
100899
|
er = null;
|
|
@@ -100903,9 +100903,9 @@ var require_isexe = __commonJS({
|
|
|
100903
100903
|
cb(er, is);
|
|
100904
100904
|
});
|
|
100905
100905
|
}
|
|
100906
|
-
function sync(
|
|
100906
|
+
function sync(path20, options) {
|
|
100907
100907
|
try {
|
|
100908
|
-
return core.sync(
|
|
100908
|
+
return core.sync(path20, options || {});
|
|
100909
100909
|
} catch (er) {
|
|
100910
100910
|
if (options && options.ignoreErrors || er.code === "EACCES") {
|
|
100911
100911
|
return false;
|
|
@@ -100921,7 +100921,7 @@ var require_isexe = __commonJS({
|
|
|
100921
100921
|
var require_which = __commonJS({
|
|
100922
100922
|
"node_modules/which/which.js"(exports2, module2) {
|
|
100923
100923
|
var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
100924
|
-
var
|
|
100924
|
+
var path20 = require("path");
|
|
100925
100925
|
var COLON = isWindows ? ";" : ":";
|
|
100926
100926
|
var isexe = require_isexe();
|
|
100927
100927
|
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
@@ -100959,7 +100959,7 @@ var require_which = __commonJS({
|
|
|
100959
100959
|
return opt.all && found.length ? resolve16(found) : reject(getNotFoundError(cmd));
|
|
100960
100960
|
const ppRaw = pathEnv[i];
|
|
100961
100961
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
100962
|
-
const pCmd =
|
|
100962
|
+
const pCmd = path20.join(pathPart, cmd);
|
|
100963
100963
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
100964
100964
|
resolve16(subStep(p, i, 0));
|
|
100965
100965
|
});
|
|
@@ -100986,7 +100986,7 @@ var require_which = __commonJS({
|
|
|
100986
100986
|
for (let i = 0; i < pathEnv.length; i++) {
|
|
100987
100987
|
const ppRaw = pathEnv[i];
|
|
100988
100988
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
100989
|
-
const pCmd =
|
|
100989
|
+
const pCmd = path20.join(pathPart, cmd);
|
|
100990
100990
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
100991
100991
|
for (let j = 0; j < pathExt.length; j++) {
|
|
100992
100992
|
const cur = p + pathExt[j];
|
|
@@ -101034,7 +101034,7 @@ var require_path_key = __commonJS({
|
|
|
101034
101034
|
var require_resolveCommand = __commonJS({
|
|
101035
101035
|
"node_modules/cross-spawn/lib/util/resolveCommand.js"(exports2, module2) {
|
|
101036
101036
|
"use strict";
|
|
101037
|
-
var
|
|
101037
|
+
var path20 = require("path");
|
|
101038
101038
|
var which = require_which();
|
|
101039
101039
|
var getPathKey = require_path_key();
|
|
101040
101040
|
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
@@ -101052,7 +101052,7 @@ var require_resolveCommand = __commonJS({
|
|
|
101052
101052
|
try {
|
|
101053
101053
|
resolved = which.sync(parsed.command, {
|
|
101054
101054
|
path: env3[getPathKey({ env: env3 })],
|
|
101055
|
-
pathExt: withoutPathExt ?
|
|
101055
|
+
pathExt: withoutPathExt ? path20.delimiter : void 0
|
|
101056
101056
|
});
|
|
101057
101057
|
} catch (e) {
|
|
101058
101058
|
} finally {
|
|
@@ -101061,7 +101061,7 @@ var require_resolveCommand = __commonJS({
|
|
|
101061
101061
|
}
|
|
101062
101062
|
}
|
|
101063
101063
|
if (resolved) {
|
|
101064
|
-
resolved =
|
|
101064
|
+
resolved = path20.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
|
|
101065
101065
|
}
|
|
101066
101066
|
return resolved;
|
|
101067
101067
|
}
|
|
@@ -101115,8 +101115,8 @@ var require_shebang_command = __commonJS({
|
|
|
101115
101115
|
if (!match) {
|
|
101116
101116
|
return null;
|
|
101117
101117
|
}
|
|
101118
|
-
const [
|
|
101119
|
-
const binary =
|
|
101118
|
+
const [path20, argument] = match[0].replace(/#! ?/, "").split(" ");
|
|
101119
|
+
const binary = path20.split("/").pop();
|
|
101120
101120
|
if (binary === "env") {
|
|
101121
101121
|
return argument;
|
|
101122
101122
|
}
|
|
@@ -101151,7 +101151,7 @@ var require_readShebang = __commonJS({
|
|
|
101151
101151
|
var require_parse2 = __commonJS({
|
|
101152
101152
|
"node_modules/cross-spawn/lib/parse.js"(exports2, module2) {
|
|
101153
101153
|
"use strict";
|
|
101154
|
-
var
|
|
101154
|
+
var path20 = require("path");
|
|
101155
101155
|
var resolveCommand = require_resolveCommand();
|
|
101156
101156
|
var escape2 = require_escape();
|
|
101157
101157
|
var readShebang = require_readShebang();
|
|
@@ -101176,7 +101176,7 @@ var require_parse2 = __commonJS({
|
|
|
101176
101176
|
const needsShell = !isExecutableRegExp.test(commandFile);
|
|
101177
101177
|
if (parsed.options.forceShell || needsShell) {
|
|
101178
101178
|
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
101179
|
-
parsed.command =
|
|
101179
|
+
parsed.command = path20.normalize(parsed.command);
|
|
101180
101180
|
parsed.command = escape2.command(parsed.command);
|
|
101181
101181
|
parsed.args = parsed.args.map((arg) => escape2.argument(arg, needsDoubleEscapeMetaChars));
|
|
101182
101182
|
const shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
@@ -101827,17 +101827,17 @@ var init_source = __esm({
|
|
|
101827
101827
|
// src/cli.ts
|
|
101828
101828
|
var fs19 = __toESM(require("fs"));
|
|
101829
101829
|
var fsPromises = __toESM(require("fs/promises"));
|
|
101830
|
-
var
|
|
101830
|
+
var path19 = __toESM(require("path"));
|
|
101831
101831
|
|
|
101832
101832
|
// src/parser.ts
|
|
101833
101833
|
var path = __toESM(require("path"));
|
|
101834
101834
|
|
|
101835
101835
|
// src/nornapiParser.ts
|
|
101836
|
-
function extractPathParameters(
|
|
101836
|
+
function extractPathParameters(path20) {
|
|
101837
101837
|
const params = [];
|
|
101838
101838
|
const regex = /(?<!\{)\{([a-zA-Z_][a-zA-Z0-9_]*)\}(?!\})/g;
|
|
101839
101839
|
let match;
|
|
101840
|
-
while ((match = regex.exec(
|
|
101840
|
+
while ((match = regex.exec(path20)) !== null) {
|
|
101841
101841
|
params.push(match[1]);
|
|
101842
101842
|
}
|
|
101843
101843
|
return params;
|
|
@@ -101887,12 +101887,12 @@ function parseNornApiFile(content) {
|
|
|
101887
101887
|
if (inEndpointsBlock) {
|
|
101888
101888
|
const endpointMatch = trimmed.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\s*:\s*(GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS)\s+(.+)$/i);
|
|
101889
101889
|
if (endpointMatch) {
|
|
101890
|
-
const
|
|
101890
|
+
const path20 = endpointMatch[3].trim();
|
|
101891
101891
|
endpoints.push({
|
|
101892
101892
|
name: endpointMatch[1],
|
|
101893
101893
|
method: endpointMatch[2].toUpperCase(),
|
|
101894
|
-
path:
|
|
101895
|
-
parameters: extractPathParameters(
|
|
101894
|
+
path: path20,
|
|
101895
|
+
parameters: extractPathParameters(path20)
|
|
101896
101896
|
});
|
|
101897
101897
|
}
|
|
101898
101898
|
continue;
|
|
@@ -102340,8 +102340,8 @@ function parseNornSqlFile(text, sourcePath) {
|
|
|
102340
102340
|
}
|
|
102341
102341
|
|
|
102342
102342
|
// src/pathAccess.ts
|
|
102343
|
-
function getPathSegments(
|
|
102344
|
-
return
|
|
102343
|
+
function getPathSegments(path20) {
|
|
102344
|
+
return path20.replace(/\[(\d+)\]/g, ".$1").split(".").filter((part) => part !== "");
|
|
102345
102345
|
}
|
|
102346
102346
|
function getPathPartValue(current, part) {
|
|
102347
102347
|
if (Array.isArray(current) && part === "count") {
|
|
@@ -102349,12 +102349,12 @@ function getPathPartValue(current, part) {
|
|
|
102349
102349
|
}
|
|
102350
102350
|
return current[part];
|
|
102351
102351
|
}
|
|
102352
|
-
function getNestedPathValue(obj,
|
|
102353
|
-
if (!
|
|
102352
|
+
function getNestedPathValue(obj, path20) {
|
|
102353
|
+
if (!path20 || obj === null || obj === void 0) {
|
|
102354
102354
|
return obj;
|
|
102355
102355
|
}
|
|
102356
102356
|
let current = obj;
|
|
102357
|
-
for (const part of getPathSegments(
|
|
102357
|
+
for (const part of getPathSegments(path20)) {
|
|
102358
102358
|
if (current === null || current === void 0) {
|
|
102359
102359
|
return void 0;
|
|
102360
102360
|
}
|
|
@@ -102500,8 +102500,8 @@ function extractFileLevelVariables(text) {
|
|
|
102500
102500
|
}
|
|
102501
102501
|
return variables;
|
|
102502
102502
|
}
|
|
102503
|
-
function getNestedValue(obj,
|
|
102504
|
-
return getNestedPathValue(obj,
|
|
102503
|
+
function getNestedValue(obj, path20) {
|
|
102504
|
+
return getNestedPathValue(obj, path20);
|
|
102505
102505
|
}
|
|
102506
102506
|
function valueToString(value) {
|
|
102507
102507
|
if (value === null) {
|
|
@@ -102545,8 +102545,8 @@ function substituteVariables(text, variables) {
|
|
|
102545
102545
|
const value = variables[varName];
|
|
102546
102546
|
if (typeof value === "object" && value !== null) {
|
|
102547
102547
|
if (pathPart) {
|
|
102548
|
-
const
|
|
102549
|
-
const nestedValue = getNestedValue(value,
|
|
102548
|
+
const path20 = pathPart.replace(/^\./, "");
|
|
102549
|
+
const nestedValue = getNestedValue(value, path20);
|
|
102550
102550
|
if (nestedValue === void 0 && varName === ENV_SCOPE_KEY) {
|
|
102551
102551
|
return match;
|
|
102552
102552
|
}
|
|
@@ -102560,8 +102560,8 @@ function substituteVariables(text, variables) {
|
|
|
102560
102560
|
if (pathPart && typeof value === "string") {
|
|
102561
102561
|
try {
|
|
102562
102562
|
const parsed = JSON.parse(value);
|
|
102563
|
-
const
|
|
102564
|
-
const nestedValue = getNestedValue(parsed,
|
|
102563
|
+
const path20 = pathPart.replace(/^\./, "");
|
|
102564
|
+
const nestedValue = getNestedValue(parsed, path20);
|
|
102565
102565
|
if (nestedValue === void 0 && varName === ENV_SCOPE_KEY) {
|
|
102566
102566
|
return match;
|
|
102567
102567
|
}
|
|
@@ -103410,9 +103410,9 @@ function isVisitable(thing) {
|
|
|
103410
103410
|
function removeBrackets(key) {
|
|
103411
103411
|
return utils_default.endsWith(key, "[]") ? key.slice(0, -2) : key;
|
|
103412
103412
|
}
|
|
103413
|
-
function renderKey(
|
|
103414
|
-
if (!
|
|
103415
|
-
return
|
|
103413
|
+
function renderKey(path20, key, dots) {
|
|
103414
|
+
if (!path20) return key;
|
|
103415
|
+
return path20.concat(key).map(function each(token, i) {
|
|
103416
103416
|
token = removeBrackets(token);
|
|
103417
103417
|
return !dots && i ? "[" + token + "]" : token;
|
|
103418
103418
|
}).join(dots ? "." : "");
|
|
@@ -103460,9 +103460,9 @@ function toFormData(obj, formData, options) {
|
|
|
103460
103460
|
}
|
|
103461
103461
|
return value;
|
|
103462
103462
|
}
|
|
103463
|
-
function defaultVisitor(value, key,
|
|
103463
|
+
function defaultVisitor(value, key, path20) {
|
|
103464
103464
|
let arr = value;
|
|
103465
|
-
if (value && !
|
|
103465
|
+
if (value && !path20 && typeof value === "object") {
|
|
103466
103466
|
if (utils_default.endsWith(key, "{}")) {
|
|
103467
103467
|
key = metaTokens ? key : key.slice(0, -2);
|
|
103468
103468
|
value = JSON.stringify(value);
|
|
@@ -103481,7 +103481,7 @@ function toFormData(obj, formData, options) {
|
|
|
103481
103481
|
if (isVisitable(value)) {
|
|
103482
103482
|
return true;
|
|
103483
103483
|
}
|
|
103484
|
-
formData.append(renderKey(
|
|
103484
|
+
formData.append(renderKey(path20, key, dots), convertValue(value));
|
|
103485
103485
|
return false;
|
|
103486
103486
|
}
|
|
103487
103487
|
const stack = [];
|
|
@@ -103490,10 +103490,10 @@ function toFormData(obj, formData, options) {
|
|
|
103490
103490
|
convertValue,
|
|
103491
103491
|
isVisitable
|
|
103492
103492
|
});
|
|
103493
|
-
function build(value,
|
|
103493
|
+
function build(value, path20) {
|
|
103494
103494
|
if (utils_default.isUndefined(value)) return;
|
|
103495
103495
|
if (stack.indexOf(value) !== -1) {
|
|
103496
|
-
throw Error("Circular reference detected in " +
|
|
103496
|
+
throw Error("Circular reference detected in " + path20.join("."));
|
|
103497
103497
|
}
|
|
103498
103498
|
stack.push(value);
|
|
103499
103499
|
utils_default.forEach(value, function each(el, key) {
|
|
@@ -103501,11 +103501,11 @@ function toFormData(obj, formData, options) {
|
|
|
103501
103501
|
formData,
|
|
103502
103502
|
el,
|
|
103503
103503
|
utils_default.isString(key) ? key.trim() : key,
|
|
103504
|
-
|
|
103504
|
+
path20,
|
|
103505
103505
|
exposedHelpers
|
|
103506
103506
|
);
|
|
103507
103507
|
if (result === true) {
|
|
103508
|
-
build(el,
|
|
103508
|
+
build(el, path20 ? path20.concat(key) : [key]);
|
|
103509
103509
|
}
|
|
103510
103510
|
});
|
|
103511
103511
|
stack.pop();
|
|
@@ -103717,7 +103717,7 @@ var platform_default = {
|
|
|
103717
103717
|
// node_modules/axios/lib/helpers/toURLEncodedForm.js
|
|
103718
103718
|
function toURLEncodedForm(data, options) {
|
|
103719
103719
|
return toFormData_default(data, new platform_default.classes.URLSearchParams(), {
|
|
103720
|
-
visitor: function(value, key,
|
|
103720
|
+
visitor: function(value, key, path20, helpers) {
|
|
103721
103721
|
if (platform_default.isNode && utils_default.isBuffer(value)) {
|
|
103722
103722
|
this.append(key, value.toString("base64"));
|
|
103723
103723
|
return false;
|
|
@@ -103747,11 +103747,11 @@ function arrayToObject(arr) {
|
|
|
103747
103747
|
return obj;
|
|
103748
103748
|
}
|
|
103749
103749
|
function formDataToJSON(formData) {
|
|
103750
|
-
function buildPath(
|
|
103751
|
-
let name =
|
|
103750
|
+
function buildPath(path20, value, target, index) {
|
|
103751
|
+
let name = path20[index++];
|
|
103752
103752
|
if (name === "__proto__") return true;
|
|
103753
103753
|
const isNumericKey = Number.isFinite(+name);
|
|
103754
|
-
const isLast = index >=
|
|
103754
|
+
const isLast = index >= path20.length;
|
|
103755
103755
|
name = !name && utils_default.isArray(target) ? target.length : name;
|
|
103756
103756
|
if (isLast) {
|
|
103757
103757
|
if (utils_default.hasOwnProp(target, name)) {
|
|
@@ -103764,7 +103764,7 @@ function formDataToJSON(formData) {
|
|
|
103764
103764
|
if (!target[name] || !utils_default.isObject(target[name])) {
|
|
103765
103765
|
target[name] = [];
|
|
103766
103766
|
}
|
|
103767
|
-
const result = buildPath(
|
|
103767
|
+
const result = buildPath(path20, value, target[name], index);
|
|
103768
103768
|
if (result && utils_default.isArray(target[name])) {
|
|
103769
103769
|
target[name] = arrayToObject(target[name]);
|
|
103770
103770
|
}
|
|
@@ -105086,9 +105086,9 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config2) {
|
|
|
105086
105086
|
auth2 = urlUsername + ":" + urlPassword;
|
|
105087
105087
|
}
|
|
105088
105088
|
auth2 && headers.delete("authorization");
|
|
105089
|
-
let
|
|
105089
|
+
let path20;
|
|
105090
105090
|
try {
|
|
105091
|
-
|
|
105091
|
+
path20 = buildURL(
|
|
105092
105092
|
parsed.pathname + parsed.search,
|
|
105093
105093
|
config2.params,
|
|
105094
105094
|
config2.paramsSerializer
|
|
@@ -105106,7 +105106,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config2) {
|
|
|
105106
105106
|
false
|
|
105107
105107
|
);
|
|
105108
105108
|
const options = {
|
|
105109
|
-
path:
|
|
105109
|
+
path: path20,
|
|
105110
105110
|
method,
|
|
105111
105111
|
headers: headers.toJSON(),
|
|
105112
105112
|
agents: { http: config2.httpAgent, https: config2.httpsAgent },
|
|
@@ -105342,14 +105342,14 @@ var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? /* @__PUR
|
|
|
105342
105342
|
var cookies_default = platform_default.hasStandardBrowserEnv ? (
|
|
105343
105343
|
// Standard browser envs support document.cookie
|
|
105344
105344
|
{
|
|
105345
|
-
write(name, value, expires,
|
|
105345
|
+
write(name, value, expires, path20, domain2, secure, sameSite) {
|
|
105346
105346
|
if (typeof document === "undefined") return;
|
|
105347
105347
|
const cookie = [`${name}=${encodeURIComponent(value)}`];
|
|
105348
105348
|
if (utils_default.isNumber(expires)) {
|
|
105349
105349
|
cookie.push(`expires=${new Date(expires).toUTCString()}`);
|
|
105350
105350
|
}
|
|
105351
|
-
if (utils_default.isString(
|
|
105352
|
-
cookie.push(`path=${
|
|
105351
|
+
if (utils_default.isString(path20)) {
|
|
105352
|
+
cookie.push(`path=${path20}`);
|
|
105353
105353
|
}
|
|
105354
105354
|
if (utils_default.isString(domain2)) {
|
|
105355
105355
|
cookie.push(`domain=${domain2}`);
|
|
@@ -106749,18 +106749,18 @@ var MemoryCookieStore = class extends Store {
|
|
|
106749
106749
|
/**
|
|
106750
106750
|
* @internal No doc because this is an overload that supports the implementation
|
|
106751
106751
|
*/
|
|
106752
|
-
findCookie(domain2,
|
|
106752
|
+
findCookie(domain2, path20, key, callback) {
|
|
106753
106753
|
const promiseCallback = createPromiseCallback(callback);
|
|
106754
|
-
if (domain2 == null ||
|
|
106754
|
+
if (domain2 == null || path20 == null || key == null) {
|
|
106755
106755
|
return promiseCallback.resolve(void 0);
|
|
106756
106756
|
}
|
|
106757
|
-
const result = this.idx[domain2]?.[
|
|
106757
|
+
const result = this.idx[domain2]?.[path20]?.[key];
|
|
106758
106758
|
return promiseCallback.resolve(result);
|
|
106759
106759
|
}
|
|
106760
106760
|
/**
|
|
106761
106761
|
* @internal No doc because this is an overload that supports the implementation
|
|
106762
106762
|
*/
|
|
106763
|
-
findCookies(domain2,
|
|
106763
|
+
findCookies(domain2, path20, allowSpecialUseDomain = false, callback) {
|
|
106764
106764
|
if (typeof allowSpecialUseDomain === "function") {
|
|
106765
106765
|
callback = allowSpecialUseDomain;
|
|
106766
106766
|
allowSpecialUseDomain = true;
|
|
@@ -106771,7 +106771,7 @@ var MemoryCookieStore = class extends Store {
|
|
|
106771
106771
|
return promiseCallback.resolve([]);
|
|
106772
106772
|
}
|
|
106773
106773
|
let pathMatcher;
|
|
106774
|
-
if (!
|
|
106774
|
+
if (!path20) {
|
|
106775
106775
|
pathMatcher = function matchAll2(domainIndex) {
|
|
106776
106776
|
for (const curPath in domainIndex) {
|
|
106777
106777
|
const pathIndex = domainIndex[curPath];
|
|
@@ -106786,7 +106786,7 @@ var MemoryCookieStore = class extends Store {
|
|
|
106786
106786
|
} else {
|
|
106787
106787
|
pathMatcher = function matchRFC(domainIndex) {
|
|
106788
106788
|
for (const cookiePath in domainIndex) {
|
|
106789
|
-
if (pathMatch(
|
|
106789
|
+
if (pathMatch(path20, cookiePath)) {
|
|
106790
106790
|
const pathIndex = domainIndex[cookiePath];
|
|
106791
106791
|
for (const key in pathIndex) {
|
|
106792
106792
|
const value = pathIndex[key];
|
|
@@ -106814,14 +106814,14 @@ var MemoryCookieStore = class extends Store {
|
|
|
106814
106814
|
*/
|
|
106815
106815
|
putCookie(cookie, callback) {
|
|
106816
106816
|
const promiseCallback = createPromiseCallback(callback);
|
|
106817
|
-
const { domain: domain2, path:
|
|
106818
|
-
if (domain2 == null ||
|
|
106817
|
+
const { domain: domain2, path: path20, key } = cookie;
|
|
106818
|
+
if (domain2 == null || path20 == null || key == null) {
|
|
106819
106819
|
return promiseCallback.resolve(void 0);
|
|
106820
106820
|
}
|
|
106821
106821
|
const domainEntry = this.idx[domain2] ?? /* @__PURE__ */ Object.create(null);
|
|
106822
106822
|
this.idx[domain2] = domainEntry;
|
|
106823
|
-
const pathEntry = domainEntry[
|
|
106824
|
-
domainEntry[
|
|
106823
|
+
const pathEntry = domainEntry[path20] ?? /* @__PURE__ */ Object.create(null);
|
|
106824
|
+
domainEntry[path20] = pathEntry;
|
|
106825
106825
|
pathEntry[key] = cookie;
|
|
106826
106826
|
return promiseCallback.resolve(void 0);
|
|
106827
106827
|
}
|
|
@@ -106835,20 +106835,20 @@ var MemoryCookieStore = class extends Store {
|
|
|
106835
106835
|
/**
|
|
106836
106836
|
* @internal No doc because this is an overload that supports the implementation
|
|
106837
106837
|
*/
|
|
106838
|
-
removeCookie(domain2,
|
|
106838
|
+
removeCookie(domain2, path20, key, callback) {
|
|
106839
106839
|
const promiseCallback = createPromiseCallback(callback);
|
|
106840
|
-
delete this.idx[domain2]?.[
|
|
106840
|
+
delete this.idx[domain2]?.[path20]?.[key];
|
|
106841
106841
|
return promiseCallback.resolve(void 0);
|
|
106842
106842
|
}
|
|
106843
106843
|
/**
|
|
106844
106844
|
* @internal No doc because this is an overload that supports the implementation
|
|
106845
106845
|
*/
|
|
106846
|
-
removeCookies(domain2,
|
|
106846
|
+
removeCookies(domain2, path20, callback) {
|
|
106847
106847
|
const promiseCallback = createPromiseCallback(callback);
|
|
106848
106848
|
const domainEntry = this.idx[domain2];
|
|
106849
106849
|
if (domainEntry) {
|
|
106850
|
-
if (
|
|
106851
|
-
delete domainEntry[
|
|
106850
|
+
if (path20) {
|
|
106851
|
+
delete domainEntry[path20];
|
|
106852
106852
|
} else {
|
|
106853
106853
|
delete this.idx[domain2];
|
|
106854
106854
|
}
|
|
@@ -106874,8 +106874,8 @@ var MemoryCookieStore = class extends Store {
|
|
|
106874
106874
|
domains.forEach((domain2) => {
|
|
106875
106875
|
const domainEntry = idx[domain2] ?? {};
|
|
106876
106876
|
const paths = Object.keys(domainEntry);
|
|
106877
|
-
paths.forEach((
|
|
106878
|
-
const pathEntry = domainEntry[
|
|
106877
|
+
paths.forEach((path20) => {
|
|
106878
|
+
const pathEntry = domainEntry[path20] ?? {};
|
|
106879
106879
|
const keys = Object.keys(pathEntry);
|
|
106880
106880
|
keys.forEach((key) => {
|
|
106881
106881
|
const keyEntry = pathEntry[key];
|
|
@@ -107759,18 +107759,18 @@ function cookieCompare(a, b) {
|
|
|
107759
107759
|
cmp = (a.creationIndex || 0) - (b.creationIndex || 0);
|
|
107760
107760
|
return cmp;
|
|
107761
107761
|
}
|
|
107762
|
-
function defaultPath(
|
|
107763
|
-
if (!
|
|
107762
|
+
function defaultPath(path20) {
|
|
107763
|
+
if (!path20 || path20.slice(0, 1) !== "/") {
|
|
107764
107764
|
return "/";
|
|
107765
107765
|
}
|
|
107766
|
-
if (
|
|
107767
|
-
return
|
|
107766
|
+
if (path20 === "/") {
|
|
107767
|
+
return path20;
|
|
107768
107768
|
}
|
|
107769
|
-
const rightSlash =
|
|
107769
|
+
const rightSlash = path20.lastIndexOf("/");
|
|
107770
107770
|
if (rightSlash === 0) {
|
|
107771
107771
|
return "/";
|
|
107772
107772
|
}
|
|
107773
|
-
return
|
|
107773
|
+
return path20.slice(0, rightSlash);
|
|
107774
107774
|
}
|
|
107775
107775
|
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}|:)))$)/;
|
|
107776
107776
|
function domainMatch(domain2, cookieDomain, canonicalize) {
|
|
@@ -108172,7 +108172,7 @@ var CookieJar = class _CookieJar {
|
|
|
108172
108172
|
return promiseCallback.reject(parameterError);
|
|
108173
108173
|
}
|
|
108174
108174
|
const host = canonicalDomain(context.hostname);
|
|
108175
|
-
const
|
|
108175
|
+
const path20 = context.pathname || "/";
|
|
108176
108176
|
const potentiallyTrustworthy = isPotentiallyTrustworthy(
|
|
108177
108177
|
url3,
|
|
108178
108178
|
this.allowSecureOnLocal
|
|
@@ -108203,7 +108203,7 @@ var CookieJar = class _CookieJar {
|
|
|
108203
108203
|
return false;
|
|
108204
108204
|
}
|
|
108205
108205
|
}
|
|
108206
|
-
if (!allPaths && typeof c.path === "string" && !pathMatch(
|
|
108206
|
+
if (!allPaths && typeof c.path === "string" && !pathMatch(path20, c.path)) {
|
|
108207
108207
|
return false;
|
|
108208
108208
|
}
|
|
108209
108209
|
if (c.secure && !potentiallyTrustworthy) {
|
|
@@ -108235,7 +108235,7 @@ var CookieJar = class _CookieJar {
|
|
|
108235
108235
|
}
|
|
108236
108236
|
store.findCookies(
|
|
108237
108237
|
host,
|
|
108238
|
-
allPaths ? null :
|
|
108238
|
+
allPaths ? null : path20,
|
|
108239
108239
|
this.allowSpecialUseDomain,
|
|
108240
108240
|
(err, cookies) => {
|
|
108241
108241
|
if (err) {
|
|
@@ -109302,6 +109302,12 @@ var import_ajv = __toESM(require_ajv());
|
|
|
109302
109302
|
var fs = __toESM(require("fs"));
|
|
109303
109303
|
var path3 = __toESM(require("path"));
|
|
109304
109304
|
var ajv = new import_ajv.default({ allErrors: true, strict: false });
|
|
109305
|
+
for (const formatName of ["int32", "int64", "float", "double"]) {
|
|
109306
|
+
ajv.addFormat(formatName, {
|
|
109307
|
+
type: "number",
|
|
109308
|
+
validate: () => true
|
|
109309
|
+
});
|
|
109310
|
+
}
|
|
109305
109311
|
var PATH_ALIAS_PREFIX = "@/";
|
|
109306
109312
|
var DEFAULT_CONTRACTS_FOLDER = "contracts";
|
|
109307
109313
|
function resolveSchemaPath(schemaPath, basePath, workspaceRoot) {
|
|
@@ -109340,7 +109346,7 @@ function resolveSchemaPath(schemaPath, basePath, workspaceRoot) {
|
|
|
109340
109346
|
return schemaPath;
|
|
109341
109347
|
}
|
|
109342
109348
|
function convertAjvError(err, value) {
|
|
109343
|
-
|
|
109349
|
+
let instancePath = err.instancePath || "(root)";
|
|
109344
109350
|
let expected;
|
|
109345
109351
|
let actual = void 0;
|
|
109346
109352
|
switch (err.keyword) {
|
|
@@ -109350,6 +109356,9 @@ function convertAjvError(err, value) {
|
|
|
109350
109356
|
break;
|
|
109351
109357
|
case "required":
|
|
109352
109358
|
expected = `property "${err.params.missingProperty}" to exist`;
|
|
109359
|
+
if (typeof err.params.missingProperty === "string") {
|
|
109360
|
+
instancePath = appendJsonPointerPath(instancePath, err.params.missingProperty);
|
|
109361
|
+
}
|
|
109353
109362
|
break;
|
|
109354
109363
|
case "enum":
|
|
109355
109364
|
expected = `one of: ${err.params.allowedValues?.join(", ")}`;
|
|
@@ -109379,6 +109388,10 @@ function convertAjvError(err, value) {
|
|
|
109379
109388
|
break;
|
|
109380
109389
|
case "additionalProperties":
|
|
109381
109390
|
expected = `no additional property "${err.params.additionalProperty}"`;
|
|
109391
|
+
if (typeof err.params.additionalProperty === "string") {
|
|
109392
|
+
instancePath = appendJsonPointerPath(instancePath, err.params.additionalProperty);
|
|
109393
|
+
actual = getValueAtPath(value, instancePath);
|
|
109394
|
+
}
|
|
109382
109395
|
break;
|
|
109383
109396
|
case "format":
|
|
109384
109397
|
expected = `format "${err.params.format}"`;
|
|
@@ -109405,6 +109418,11 @@ function convertAjvError(err, value) {
|
|
|
109405
109418
|
severity
|
|
109406
109419
|
};
|
|
109407
109420
|
}
|
|
109421
|
+
function appendJsonPointerPath(basePath, propertyName) {
|
|
109422
|
+
const normalizedBasePath = !basePath || basePath === "(root)" ? "" : basePath;
|
|
109423
|
+
const escapedPropertyName = propertyName.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
109424
|
+
return `${normalizedBasePath}/${escapedPropertyName}`;
|
|
109425
|
+
}
|
|
109408
109426
|
function getValueAtPath(obj, jsonPointer) {
|
|
109409
109427
|
if (jsonPointer === "(root)" || jsonPointer === "" || jsonPointer === "/") {
|
|
109410
109428
|
return obj;
|
|
@@ -109420,22 +109438,122 @@ function getValueAtPath(obj, jsonPointer) {
|
|
|
109420
109438
|
}
|
|
109421
109439
|
return current;
|
|
109422
109440
|
}
|
|
109441
|
+
var SCHEMA_RULE_KEYWORDS = /* @__PURE__ */ new Set([
|
|
109442
|
+
"type",
|
|
109443
|
+
"enum",
|
|
109444
|
+
"const",
|
|
109445
|
+
"multipleOf",
|
|
109446
|
+
"maximum",
|
|
109447
|
+
"exclusiveMaximum",
|
|
109448
|
+
"minimum",
|
|
109449
|
+
"exclusiveMinimum",
|
|
109450
|
+
"maxLength",
|
|
109451
|
+
"minLength",
|
|
109452
|
+
"pattern",
|
|
109453
|
+
"format",
|
|
109454
|
+
"maxItems",
|
|
109455
|
+
"minItems",
|
|
109456
|
+
"uniqueItems",
|
|
109457
|
+
"maxContains",
|
|
109458
|
+
"minContains",
|
|
109459
|
+
"maxProperties",
|
|
109460
|
+
"minProperties",
|
|
109461
|
+
"propertyNames",
|
|
109462
|
+
"dependentRequired"
|
|
109463
|
+
]);
|
|
109464
|
+
var SCHEMA_MAP_KEYWORDS = /* @__PURE__ */ new Set([
|
|
109465
|
+
"properties",
|
|
109466
|
+
"patternProperties",
|
|
109467
|
+
"dependentSchemas",
|
|
109468
|
+
"$defs",
|
|
109469
|
+
"definitions"
|
|
109470
|
+
]);
|
|
109471
|
+
var SCHEMA_ARRAY_KEYWORDS = /* @__PURE__ */ new Set(["allOf", "anyOf", "oneOf"]);
|
|
109472
|
+
var SCHEMA_NESTED_SCHEMA_KEYWORDS = /* @__PURE__ */ new Set(["items", "prefixItems", "additionalItems", "contains", "not", "if", "then", "else"]);
|
|
109473
|
+
function isRecord(value) {
|
|
109474
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
109475
|
+
}
|
|
109476
|
+
function countSchemaRules(schema) {
|
|
109477
|
+
if (Array.isArray(schema)) {
|
|
109478
|
+
return schema.reduce((sum, item) => sum + countSchemaRules(item), 0);
|
|
109479
|
+
}
|
|
109480
|
+
if (!isRecord(schema)) {
|
|
109481
|
+
return 0;
|
|
109482
|
+
}
|
|
109483
|
+
let count = 0;
|
|
109484
|
+
for (const [key, value] of Object.entries(schema)) {
|
|
109485
|
+
if (key === "required" && Array.isArray(value)) {
|
|
109486
|
+
count += value.length;
|
|
109487
|
+
continue;
|
|
109488
|
+
}
|
|
109489
|
+
if (SCHEMA_MAP_KEYWORDS.has(key)) {
|
|
109490
|
+
if (isRecord(value)) {
|
|
109491
|
+
for (const childSchema of Object.values(value)) {
|
|
109492
|
+
count += countSchemaRules(childSchema);
|
|
109493
|
+
}
|
|
109494
|
+
}
|
|
109495
|
+
continue;
|
|
109496
|
+
}
|
|
109497
|
+
if (SCHEMA_ARRAY_KEYWORDS.has(key)) {
|
|
109498
|
+
count += 1;
|
|
109499
|
+
count += countSchemaRules(value);
|
|
109500
|
+
continue;
|
|
109501
|
+
}
|
|
109502
|
+
if (key === "additionalProperties" || key === "unevaluatedProperties") {
|
|
109503
|
+
if (value !== true) {
|
|
109504
|
+
count += 1;
|
|
109505
|
+
}
|
|
109506
|
+
if (isRecord(value)) {
|
|
109507
|
+
count += countSchemaRules(value);
|
|
109508
|
+
}
|
|
109509
|
+
continue;
|
|
109510
|
+
}
|
|
109511
|
+
if (SCHEMA_NESTED_SCHEMA_KEYWORDS.has(key)) {
|
|
109512
|
+
if (key !== "items" && key !== "prefixItems") {
|
|
109513
|
+
count += 1;
|
|
109514
|
+
}
|
|
109515
|
+
count += countSchemaRules(value);
|
|
109516
|
+
continue;
|
|
109517
|
+
}
|
|
109518
|
+
if (SCHEMA_RULE_KEYWORDS.has(key)) {
|
|
109519
|
+
count += 1;
|
|
109520
|
+
}
|
|
109521
|
+
}
|
|
109522
|
+
return count;
|
|
109523
|
+
}
|
|
109524
|
+
function buildValidationSummary(schema, errors, valid) {
|
|
109525
|
+
const issueCount = errors?.length || 0;
|
|
109526
|
+
const errorCount = errors?.filter((error2) => error2.severity === "error").length || 0;
|
|
109527
|
+
const warningCount = errors?.filter((error2) => error2.severity === "warning").length || 0;
|
|
109528
|
+
const totalRules = Math.max(schema ? countSchemaRules(schema) : 0, issueCount);
|
|
109529
|
+
const failedRules = valid ? 0 : issueCount;
|
|
109530
|
+
return {
|
|
109531
|
+
totalRules,
|
|
109532
|
+
passedRules: Math.max(totalRules - failedRules, 0),
|
|
109533
|
+
failedRules,
|
|
109534
|
+
issueCount,
|
|
109535
|
+
errorCount,
|
|
109536
|
+
warningCount
|
|
109537
|
+
};
|
|
109538
|
+
}
|
|
109423
109539
|
function validateAgainstSchemaDetailed(value, schemaPath, basePath, workspaceRoot) {
|
|
109424
109540
|
try {
|
|
109425
109541
|
const resolvedPath = resolveSchemaPath(schemaPath, basePath, workspaceRoot);
|
|
109426
109542
|
if (!fs.existsSync(resolvedPath)) {
|
|
109543
|
+
const errors = [{
|
|
109544
|
+
instancePath: "(root)",
|
|
109545
|
+
schemaPath: "",
|
|
109546
|
+
keyword: "file",
|
|
109547
|
+
message: `Schema file not found: ${schemaPath}`,
|
|
109548
|
+
params: { path: schemaPath },
|
|
109549
|
+
severity: "error"
|
|
109550
|
+
}];
|
|
109427
109551
|
return {
|
|
109428
109552
|
valid: false,
|
|
109429
|
-
errors
|
|
109430
|
-
instancePath: "(root)",
|
|
109431
|
-
schemaPath: "",
|
|
109432
|
-
keyword: "file",
|
|
109433
|
-
message: `Schema file not found: ${schemaPath}`,
|
|
109434
|
-
params: { path: schemaPath },
|
|
109435
|
-
severity: "error"
|
|
109436
|
-
}],
|
|
109553
|
+
errors,
|
|
109437
109554
|
errorStrings: [`Schema file not found: ${schemaPath}`],
|
|
109438
|
-
resolvedSchemaPath: resolvedPath
|
|
109555
|
+
resolvedSchemaPath: resolvedPath,
|
|
109556
|
+
summary: buildValidationSummary(void 0, errors, false)
|
|
109439
109557
|
};
|
|
109440
109558
|
}
|
|
109441
109559
|
const schemaContent = fs.readFileSync(resolvedPath, "utf-8");
|
|
@@ -109443,18 +109561,20 @@ function validateAgainstSchemaDetailed(value, schemaPath, basePath, workspaceRoo
|
|
|
109443
109561
|
try {
|
|
109444
109562
|
schema = JSON.parse(schemaContent);
|
|
109445
109563
|
} catch (e) {
|
|
109564
|
+
const errors = [{
|
|
109565
|
+
instancePath: "(root)",
|
|
109566
|
+
schemaPath: "",
|
|
109567
|
+
keyword: "parse",
|
|
109568
|
+
message: `Invalid JSON in schema file: ${schemaPath}`,
|
|
109569
|
+
params: { path: schemaPath },
|
|
109570
|
+
severity: "error"
|
|
109571
|
+
}];
|
|
109446
109572
|
return {
|
|
109447
109573
|
valid: false,
|
|
109448
|
-
errors
|
|
109449
|
-
instancePath: "(root)",
|
|
109450
|
-
schemaPath: "",
|
|
109451
|
-
keyword: "parse",
|
|
109452
|
-
message: `Invalid JSON in schema file: ${schemaPath}`,
|
|
109453
|
-
params: { path: schemaPath },
|
|
109454
|
-
severity: "error"
|
|
109455
|
-
}],
|
|
109574
|
+
errors,
|
|
109456
109575
|
errorStrings: [`Invalid JSON in schema file: ${schemaPath}`],
|
|
109457
|
-
resolvedSchemaPath: resolvedPath
|
|
109576
|
+
resolvedSchemaPath: resolvedPath,
|
|
109577
|
+
summary: buildValidationSummary(void 0, errors, false)
|
|
109458
109578
|
};
|
|
109459
109579
|
}
|
|
109460
109580
|
const validate3 = ajv.compile(schema);
|
|
@@ -109462,35 +109582,39 @@ function validateAgainstSchemaDetailed(value, schemaPath, basePath, workspaceRoo
|
|
|
109462
109582
|
if (!valid && validate3.errors) {
|
|
109463
109583
|
const errors = validate3.errors.map((err) => convertAjvError(err, value));
|
|
109464
109584
|
const errorStrings = validate3.errors.map((err) => {
|
|
109465
|
-
const
|
|
109466
|
-
return `${
|
|
109585
|
+
const path20 = err.instancePath || "(root)";
|
|
109586
|
+
return `${path20}: ${err.message}`;
|
|
109467
109587
|
});
|
|
109468
109588
|
return {
|
|
109469
109589
|
valid: false,
|
|
109470
109590
|
errors,
|
|
109471
109591
|
errorStrings,
|
|
109472
109592
|
resolvedSchemaPath: resolvedPath,
|
|
109473
|
-
schema
|
|
109593
|
+
schema,
|
|
109594
|
+
summary: buildValidationSummary(schema, errors, false)
|
|
109474
109595
|
};
|
|
109475
109596
|
}
|
|
109476
109597
|
return {
|
|
109477
109598
|
valid: true,
|
|
109478
109599
|
resolvedSchemaPath: resolvedPath,
|
|
109479
|
-
schema
|
|
109600
|
+
schema,
|
|
109601
|
+
summary: buildValidationSummary(schema, void 0, true)
|
|
109480
109602
|
};
|
|
109481
109603
|
} catch (e) {
|
|
109482
109604
|
const error2 = e instanceof Error ? e.message : String(e);
|
|
109605
|
+
const errors = [{
|
|
109606
|
+
instancePath: "(root)",
|
|
109607
|
+
schemaPath: "",
|
|
109608
|
+
keyword: "exception",
|
|
109609
|
+
message: `Schema validation error: ${error2}`,
|
|
109610
|
+
params: {},
|
|
109611
|
+
severity: "error"
|
|
109612
|
+
}];
|
|
109483
109613
|
return {
|
|
109484
109614
|
valid: false,
|
|
109485
|
-
errors
|
|
109486
|
-
|
|
109487
|
-
|
|
109488
|
-
keyword: "exception",
|
|
109489
|
-
message: `Schema validation error: ${error2}`,
|
|
109490
|
-
params: {},
|
|
109491
|
-
severity: "error"
|
|
109492
|
-
}],
|
|
109493
|
-
errorStrings: [`Schema validation error: ${error2}`]
|
|
109615
|
+
errors,
|
|
109616
|
+
errorStrings: [`Schema validation error: ${error2}`],
|
|
109617
|
+
summary: buildValidationSummary(void 0, errors, false)
|
|
109494
109618
|
};
|
|
109495
109619
|
}
|
|
109496
109620
|
}
|
|
@@ -109501,34 +109625,38 @@ function validateAgainstSchemaObjectDetailed(value, schema) {
|
|
|
109501
109625
|
if (!valid && validate3.errors) {
|
|
109502
109626
|
const errors = validate3.errors.map((err) => convertAjvError(err, value));
|
|
109503
109627
|
const errorStrings = validate3.errors.map((err) => {
|
|
109504
|
-
const
|
|
109505
|
-
return `${
|
|
109628
|
+
const path20 = err.instancePath || "(root)";
|
|
109629
|
+
return `${path20}: ${err.message}`;
|
|
109506
109630
|
});
|
|
109507
109631
|
return {
|
|
109508
109632
|
valid: false,
|
|
109509
109633
|
errors,
|
|
109510
109634
|
errorStrings,
|
|
109511
|
-
schema
|
|
109635
|
+
schema,
|
|
109636
|
+
summary: buildValidationSummary(schema, errors, false)
|
|
109512
109637
|
};
|
|
109513
109638
|
}
|
|
109514
109639
|
return {
|
|
109515
109640
|
valid: true,
|
|
109516
|
-
schema
|
|
109641
|
+
schema,
|
|
109642
|
+
summary: buildValidationSummary(schema, void 0, true)
|
|
109517
109643
|
};
|
|
109518
109644
|
} catch (e) {
|
|
109519
109645
|
const error2 = e instanceof Error ? e.message : String(e);
|
|
109646
|
+
const errors = [{
|
|
109647
|
+
instancePath: "(root)",
|
|
109648
|
+
schemaPath: "",
|
|
109649
|
+
keyword: "exception",
|
|
109650
|
+
message: `Schema validation error: ${error2}`,
|
|
109651
|
+
params: {},
|
|
109652
|
+
severity: "error"
|
|
109653
|
+
}];
|
|
109520
109654
|
return {
|
|
109521
109655
|
valid: false,
|
|
109522
|
-
errors
|
|
109523
|
-
instancePath: "(root)",
|
|
109524
|
-
schemaPath: "",
|
|
109525
|
-
keyword: "exception",
|
|
109526
|
-
message: `Schema validation error: ${error2}`,
|
|
109527
|
-
params: {},
|
|
109528
|
-
severity: "error"
|
|
109529
|
-
}],
|
|
109656
|
+
errors,
|
|
109530
109657
|
errorStrings: [`Schema validation error: ${error2}`],
|
|
109531
|
-
schema
|
|
109658
|
+
schema,
|
|
109659
|
+
summary: buildValidationSummary(schema, errors, false)
|
|
109532
109660
|
};
|
|
109533
109661
|
}
|
|
109534
109662
|
}
|
|
@@ -109648,7 +109776,7 @@ function resolveValue(expr, responses, variables, getValueByPath2, responseIndex
|
|
|
109648
109776
|
if (refMatch) {
|
|
109649
109777
|
const responseIdx = parseInt(refMatch[1], 10);
|
|
109650
109778
|
const responseIndex = responseIdx - 1;
|
|
109651
|
-
const
|
|
109779
|
+
const path20 = refMatch[2];
|
|
109652
109780
|
if (responseIndex < 0 || responseIndex >= responses.length) {
|
|
109653
109781
|
return {
|
|
109654
109782
|
value: void 0,
|
|
@@ -109656,12 +109784,12 @@ function resolveValue(expr, responses, variables, getValueByPath2, responseIndex
|
|
|
109656
109784
|
};
|
|
109657
109785
|
}
|
|
109658
109786
|
const response = responses[responseIndex];
|
|
109659
|
-
const value = getValueByPath2(response,
|
|
109787
|
+
const value = getValueByPath2(response, path20);
|
|
109660
109788
|
return {
|
|
109661
109789
|
value,
|
|
109662
109790
|
responseIndex: responseIdx,
|
|
109663
109791
|
response,
|
|
109664
|
-
jsonPath:
|
|
109792
|
+
jsonPath: path20,
|
|
109665
109793
|
variableName: responseIndexToVariable?.get(responseIdx)
|
|
109666
109794
|
};
|
|
109667
109795
|
}
|
|
@@ -109678,22 +109806,22 @@ function resolveValue(expr, responses, variables, getValueByPath2, responseIndex
|
|
|
109678
109806
|
if (varName in variables) {
|
|
109679
109807
|
const varValue = variables[varName];
|
|
109680
109808
|
if (typeof varValue === "object" && varValue !== null) {
|
|
109681
|
-
const
|
|
109682
|
-
const value = getNestedValue2(varValue,
|
|
109809
|
+
const path20 = pathPart.replace(/^\./, "");
|
|
109810
|
+
const value = getNestedValue2(varValue, path20);
|
|
109683
109811
|
const isHttpResponse = "status" in varValue && "body" in varValue;
|
|
109684
109812
|
return {
|
|
109685
109813
|
value,
|
|
109686
109814
|
variableName: varName,
|
|
109687
|
-
jsonPath:
|
|
109815
|
+
jsonPath: path20,
|
|
109688
109816
|
response: isHttpResponse ? varValue : void 0
|
|
109689
109817
|
};
|
|
109690
109818
|
}
|
|
109691
109819
|
if (typeof varValue === "string") {
|
|
109692
109820
|
try {
|
|
109693
109821
|
const parsed = JSON.parse(varValue);
|
|
109694
|
-
const
|
|
109695
|
-
const value = getNestedValue2(parsed,
|
|
109696
|
-
return { value, variableName: varName, jsonPath:
|
|
109822
|
+
const path20 = pathPart.replace(/^\./, "");
|
|
109823
|
+
const value = getNestedValue2(parsed, path20);
|
|
109824
|
+
return { value, variableName: varName, jsonPath: path20 };
|
|
109697
109825
|
} catch {
|
|
109698
109826
|
return { value: void 0, error: `Cannot access path on non-object variable: ${varName}` };
|
|
109699
109827
|
}
|
|
@@ -109722,14 +109850,14 @@ function resolveValue(expr, responses, variables, getValueByPath2, responseIndex
|
|
|
109722
109850
|
const varValue = variables[varName];
|
|
109723
109851
|
if (pathPart) {
|
|
109724
109852
|
if (typeof varValue === "object" && varValue !== null) {
|
|
109725
|
-
const
|
|
109726
|
-
return { value: getNestedValue2(varValue,
|
|
109853
|
+
const path20 = pathPart.replace(/^\./, "");
|
|
109854
|
+
return { value: getNestedValue2(varValue, path20) };
|
|
109727
109855
|
}
|
|
109728
109856
|
if (typeof varValue === "string") {
|
|
109729
109857
|
try {
|
|
109730
109858
|
const parsed = JSON.parse(varValue);
|
|
109731
|
-
const
|
|
109732
|
-
return { value: getNestedValue2(parsed,
|
|
109859
|
+
const path20 = pathPart.replace(/^\./, "");
|
|
109860
|
+
return { value: getNestedValue2(parsed, path20) };
|
|
109733
109861
|
} catch {
|
|
109734
109862
|
return { value: void 0, error: `Cannot access path on non-object variable: ${varName}` };
|
|
109735
109863
|
}
|
|
@@ -109766,8 +109894,8 @@ function resolveValue(expr, responses, variables, getValueByPath2, responseIndex
|
|
|
109766
109894
|
}
|
|
109767
109895
|
return { value: void 0, error: `Cannot resolve expression: ${trimmed}` };
|
|
109768
109896
|
}
|
|
109769
|
-
function getNestedValue2(obj,
|
|
109770
|
-
return getNestedPathValue(obj,
|
|
109897
|
+
function getNestedValue2(obj, path20) {
|
|
109898
|
+
return getNestedPathValue(obj, path20);
|
|
109771
109899
|
}
|
|
109772
109900
|
function areValuesEqual(leftValue, rightValue) {
|
|
109773
109901
|
if (leftValue === rightValue) {
|
|
@@ -109916,6 +110044,7 @@ function evaluateAssertion(assertion, responses, variables, getValueByPath2, res
|
|
|
109916
110044
|
schemaErrors: validationResult.errors,
|
|
109917
110045
|
schemaPath: validationResult.resolvedSchemaPath,
|
|
109918
110046
|
schema: validationResult.schema,
|
|
110047
|
+
schemaSummary: validationResult.summary,
|
|
109919
110048
|
...!passed2 ? buildFailureContext() : {}
|
|
109920
110049
|
};
|
|
109921
110050
|
}
|
|
@@ -110058,11 +110187,11 @@ function readJsonFile(filePath, workingDir) {
|
|
|
110058
110187
|
};
|
|
110059
110188
|
}
|
|
110060
110189
|
}
|
|
110061
|
-
function setNestedValue(obj,
|
|
110062
|
-
if (!
|
|
110190
|
+
function setNestedValue(obj, path20, value) {
|
|
110191
|
+
if (!path20 || obj === null || obj === void 0 || typeof obj !== "object") {
|
|
110063
110192
|
return false;
|
|
110064
110193
|
}
|
|
110065
|
-
const parts =
|
|
110194
|
+
const parts = path20.replace(/\[(\d+)\]/g, ".$1").split(".").filter((p) => p !== "");
|
|
110066
110195
|
if (parts.length === 0) {
|
|
110067
110196
|
return false;
|
|
110068
110197
|
}
|
|
@@ -110214,15 +110343,30 @@ function formatUserFacingError(error2, context) {
|
|
|
110214
110343
|
|
|
110215
110344
|
// src/requestValidation.ts
|
|
110216
110345
|
var PLACEHOLDER_REGEX = /\{\{(\$env|\$[0-9]+|[a-zA-Z_][a-zA-Z0-9_]*)((?:\.[a-zA-Z_][a-zA-Z0-9_-]*|\[\d+\])*)\}\}/g;
|
|
110217
|
-
function
|
|
110346
|
+
function findPlaceholderReferences(text) {
|
|
110218
110347
|
if (!text) {
|
|
110219
110348
|
return [];
|
|
110220
110349
|
}
|
|
110221
|
-
const
|
|
110350
|
+
const references = [];
|
|
110222
110351
|
let match;
|
|
110223
110352
|
PLACEHOLDER_REGEX.lastIndex = 0;
|
|
110224
110353
|
while ((match = PLACEHOLDER_REGEX.exec(text)) !== null) {
|
|
110225
|
-
|
|
110354
|
+
references.push({
|
|
110355
|
+
text: match[0],
|
|
110356
|
+
name: match[1],
|
|
110357
|
+
pathPart: match[2] || "",
|
|
110358
|
+
index: match.index
|
|
110359
|
+
});
|
|
110360
|
+
}
|
|
110361
|
+
return references;
|
|
110362
|
+
}
|
|
110363
|
+
function collectUnresolvedPlaceholders(text) {
|
|
110364
|
+
if (!text) {
|
|
110365
|
+
return [];
|
|
110366
|
+
}
|
|
110367
|
+
const names = /* @__PURE__ */ new Set();
|
|
110368
|
+
for (const reference of findPlaceholderReferences(text)) {
|
|
110369
|
+
names.add(reference.text);
|
|
110226
110370
|
}
|
|
110227
110371
|
return [...names];
|
|
110228
110372
|
}
|
|
@@ -111587,8 +111731,8 @@ function getErrorMap() {
|
|
|
111587
111731
|
|
|
111588
111732
|
// node_modules/zod/v3/helpers/parseUtil.js
|
|
111589
111733
|
var makeIssue = (params) => {
|
|
111590
|
-
const { data, path:
|
|
111591
|
-
const fullPath = [...
|
|
111734
|
+
const { data, path: path20, errorMaps, issueData } = params;
|
|
111735
|
+
const fullPath = [...path20, ...issueData.path || []];
|
|
111592
111736
|
const fullIssue = {
|
|
111593
111737
|
...issueData,
|
|
111594
111738
|
path: fullPath
|
|
@@ -111703,11 +111847,11 @@ var errorUtil;
|
|
|
111703
111847
|
|
|
111704
111848
|
// node_modules/zod/v3/types.js
|
|
111705
111849
|
var ParseInputLazyPath = class {
|
|
111706
|
-
constructor(parent, value,
|
|
111850
|
+
constructor(parent, value, path20, key) {
|
|
111707
111851
|
this._cachedPath = [];
|
|
111708
111852
|
this.parent = parent;
|
|
111709
111853
|
this.data = value;
|
|
111710
|
-
this._path =
|
|
111854
|
+
this._path = path20;
|
|
111711
111855
|
this._key = key;
|
|
111712
111856
|
}
|
|
111713
111857
|
get path() {
|
|
@@ -115351,10 +115495,10 @@ function mergeDefs(...defs) {
|
|
|
115351
115495
|
function cloneDef(schema) {
|
|
115352
115496
|
return mergeDefs(schema._zod.def);
|
|
115353
115497
|
}
|
|
115354
|
-
function getElementAtPath(obj,
|
|
115355
|
-
if (!
|
|
115498
|
+
function getElementAtPath(obj, path20) {
|
|
115499
|
+
if (!path20)
|
|
115356
115500
|
return obj;
|
|
115357
|
-
return
|
|
115501
|
+
return path20.reduce((acc, key) => acc?.[key], obj);
|
|
115358
115502
|
}
|
|
115359
115503
|
function promiseAllObject(promisesObj) {
|
|
115360
115504
|
const keys = Object.keys(promisesObj);
|
|
@@ -115737,11 +115881,11 @@ function aborted(x, startIndex = 0) {
|
|
|
115737
115881
|
}
|
|
115738
115882
|
return false;
|
|
115739
115883
|
}
|
|
115740
|
-
function prefixIssues(
|
|
115884
|
+
function prefixIssues(path20, issues) {
|
|
115741
115885
|
return issues.map((iss) => {
|
|
115742
115886
|
var _a2;
|
|
115743
115887
|
(_a2 = iss).path ?? (_a2.path = []);
|
|
115744
|
-
iss.path.unshift(
|
|
115888
|
+
iss.path.unshift(path20);
|
|
115745
115889
|
return iss;
|
|
115746
115890
|
});
|
|
115747
115891
|
}
|
|
@@ -128277,8 +128421,8 @@ function parseJsonBackedValue(value) {
|
|
|
128277
128421
|
return value;
|
|
128278
128422
|
}
|
|
128279
128423
|
}
|
|
128280
|
-
function getVariableValueByPath(
|
|
128281
|
-
const parts = getPathSegments(
|
|
128424
|
+
function getVariableValueByPath(path20, variables) {
|
|
128425
|
+
const parts = getPathSegments(path20);
|
|
128282
128426
|
let current = variables;
|
|
128283
128427
|
for (const part of parts) {
|
|
128284
128428
|
if (current === null || current === void 0) {
|
|
@@ -128652,8 +128796,8 @@ function evaluateValueExpression(expr, runtimeVariables) {
|
|
|
128652
128796
|
if (typeof dataToNavigate !== "object" || dataToNavigate === null) {
|
|
128653
128797
|
return { value: String(varValue), error: `Cannot access path on non-object value` };
|
|
128654
128798
|
}
|
|
128655
|
-
const
|
|
128656
|
-
const parts = getPathSegments(
|
|
128799
|
+
const path20 = pathPart.replace(/^\./, "");
|
|
128800
|
+
const parts = getPathSegments(path20);
|
|
128657
128801
|
let current = dataToNavigate;
|
|
128658
128802
|
for (const part of parts) {
|
|
128659
128803
|
if (current === null || current === void 0) {
|
|
@@ -128777,8 +128921,8 @@ function resolveBareVariables(text, variables) {
|
|
|
128777
128921
|
if (varName in variables) {
|
|
128778
128922
|
const value = variables[varName];
|
|
128779
128923
|
if (pathPart) {
|
|
128780
|
-
const
|
|
128781
|
-
const nestedValue = getNestedPathValue(value,
|
|
128924
|
+
const path20 = pathPart.replace(/^\./, "");
|
|
128925
|
+
const nestedValue = getNestedPathValue(value, path20);
|
|
128782
128926
|
return valueToString2(nestedValue);
|
|
128783
128927
|
}
|
|
128784
128928
|
return valueToString2(value);
|
|
@@ -128798,8 +128942,8 @@ function resolveBareVariables(text, variables) {
|
|
|
128798
128942
|
if (varName in variables) {
|
|
128799
128943
|
const value = variables[varName];
|
|
128800
128944
|
if (pathPart) {
|
|
128801
|
-
const
|
|
128802
|
-
return valueToString2(getNestedPathValue(value,
|
|
128945
|
+
const path20 = pathPart.replace(/^\./, "");
|
|
128946
|
+
return valueToString2(getNestedPathValue(value, path20));
|
|
128803
128947
|
}
|
|
128804
128948
|
return valueToString2(value);
|
|
128805
128949
|
}
|
|
@@ -129235,24 +129379,24 @@ function extractCaptureDirectives(content) {
|
|
|
129235
129379
|
for (const line2 of content.split("\n")) {
|
|
129236
129380
|
const match = line2.trim().match(captureRegex);
|
|
129237
129381
|
if (match) {
|
|
129238
|
-
let
|
|
129239
|
-
if (
|
|
129240
|
-
|
|
129382
|
+
let path20 = match[3] || "";
|
|
129383
|
+
if (path20.startsWith(".")) {
|
|
129384
|
+
path20 = path20.substring(1);
|
|
129241
129385
|
}
|
|
129242
129386
|
captures.push({
|
|
129243
129387
|
varName: match[1],
|
|
129244
129388
|
afterRequest: parseInt(match[2], 10),
|
|
129245
|
-
path:
|
|
129389
|
+
path: path20
|
|
129246
129390
|
});
|
|
129247
129391
|
}
|
|
129248
129392
|
}
|
|
129249
129393
|
return captures;
|
|
129250
129394
|
}
|
|
129251
|
-
function getValueByPath(response,
|
|
129252
|
-
if (!
|
|
129395
|
+
function getValueByPath(response, path20) {
|
|
129396
|
+
if (!path20) {
|
|
129253
129397
|
return void 0;
|
|
129254
129398
|
}
|
|
129255
|
-
const parts = getPathSegments(
|
|
129399
|
+
const parts = getPathSegments(path20);
|
|
129256
129400
|
if (parts.length === 0) {
|
|
129257
129401
|
return void 0;
|
|
129258
129402
|
}
|
|
@@ -129621,8 +129765,8 @@ async function runSequenceWithJar(sequenceContent, fileVariables, cookieJar, wor
|
|
|
129621
129765
|
}
|
|
129622
129766
|
}
|
|
129623
129767
|
if (pathPart) {
|
|
129624
|
-
const
|
|
129625
|
-
newValue = getNestedPathValue(value,
|
|
129768
|
+
const path20 = pathPart.replace(/^\./, "");
|
|
129769
|
+
newValue = getNestedPathValue(value, path20);
|
|
129626
129770
|
} else {
|
|
129627
129771
|
newValue = value;
|
|
129628
129772
|
}
|
|
@@ -130257,8 +130401,8 @@ ${indentMultiline(userMessage)}`;
|
|
|
130257
130401
|
if (sequenceSources) {
|
|
130258
130402
|
const sourceFile = sequenceSources.get(targetName.toLowerCase());
|
|
130259
130403
|
if (sourceFile) {
|
|
130260
|
-
const
|
|
130261
|
-
subWorkingDir =
|
|
130404
|
+
const path20 = await import("path");
|
|
130405
|
+
subWorkingDir = path20.dirname(sourceFile);
|
|
130262
130406
|
}
|
|
130263
130407
|
}
|
|
130264
130408
|
const targetLocation = executionContext?.sequenceLocationIndex?.get(targetName.toLowerCase());
|
|
@@ -130566,8 +130710,8 @@ ${indentMultiline(userMessage)}`;
|
|
|
130566
130710
|
if (sequenceSources) {
|
|
130567
130711
|
const sourceFile = sequenceSources.get(sequenceName.toLowerCase());
|
|
130568
130712
|
if (sourceFile) {
|
|
130569
|
-
const
|
|
130570
|
-
subWorkingDir =
|
|
130713
|
+
const path20 = await import("path");
|
|
130714
|
+
subWorkingDir = path20.dirname(sourceFile);
|
|
130571
130715
|
}
|
|
130572
130716
|
}
|
|
130573
130717
|
const targetLocation = executionContext?.sequenceLocationIndex?.get(sequenceName.toLowerCase());
|
|
@@ -131068,6 +131212,178 @@ function formatResponseCompact(response, options) {
|
|
|
131068
131212
|
return `${prefix}${icon} ${statusColor(`${response.status} ${response.statusText}`)} ${colors.duration(formatDuration(response.duration))}${retryInfo}`;
|
|
131069
131213
|
}
|
|
131070
131214
|
|
|
131215
|
+
// src/contractAssertionSummary.ts
|
|
131216
|
+
var path13 = __toESM(require("path"));
|
|
131217
|
+
function buildContractAssertionDisplay(assertion, maxIssues = 3, maxValidatedItems = 24) {
|
|
131218
|
+
if (assertion.operator !== "matchesSchema") {
|
|
131219
|
+
return void 0;
|
|
131220
|
+
}
|
|
131221
|
+
const issueCount = assertion.schemaSummary?.issueCount ?? assertion.schemaErrors?.length ?? (assertion.error ? 1 : 0);
|
|
131222
|
+
const schemaPath = assertion.schemaPath || (typeof assertion.rightValue === "string" ? assertion.rightValue : void 0);
|
|
131223
|
+
const schemaName = schemaPath ? path13.basename(schemaPath) : void 0;
|
|
131224
|
+
const issueTexts = (assertion.schemaErrors || []).slice(0, maxIssues).map(formatSchemaIssue);
|
|
131225
|
+
const validationList = buildContractValidationList(
|
|
131226
|
+
assertion.schema,
|
|
131227
|
+
assertion.schemaErrors || [],
|
|
131228
|
+
maxValidatedItems
|
|
131229
|
+
);
|
|
131230
|
+
const failedValidationCount = validationList.failedCount || (!assertion.passed && issueCount > 0 ? 1 : 0);
|
|
131231
|
+
const totalValidations = validationList.totalCount + failedValidationCount;
|
|
131232
|
+
const passedValidations = assertion.passed ? totalValidations : validationList.totalCount;
|
|
131233
|
+
let summaryText;
|
|
131234
|
+
if (totalValidations > 0) {
|
|
131235
|
+
summaryText = `${passedValidations}/${totalValidations} validations passed`;
|
|
131236
|
+
} else {
|
|
131237
|
+
summaryText = assertion.passed ? "contract passed" : "contract validation failed";
|
|
131238
|
+
}
|
|
131239
|
+
if (issueCount > 0) {
|
|
131240
|
+
summaryText += `, ${issueCount} issue${issueCount === 1 ? "" : "s"}`;
|
|
131241
|
+
}
|
|
131242
|
+
const titleText = schemaName ? `${schemaName}: ${summaryText}` : `Contract: ${summaryText}`;
|
|
131243
|
+
const validationText = totalValidations > 0 ? `${passedValidations}/${totalValidations} validations` : assertion.passed ? "validated" : `${issueCount} issue${issueCount === 1 ? "" : "s"}`;
|
|
131244
|
+
const severity = getContractDisplaySeverity(assertion);
|
|
131245
|
+
return {
|
|
131246
|
+
titleText,
|
|
131247
|
+
summaryText,
|
|
131248
|
+
validationText,
|
|
131249
|
+
severity,
|
|
131250
|
+
schemaPath,
|
|
131251
|
+
schemaName,
|
|
131252
|
+
issueTexts,
|
|
131253
|
+
remainingIssueCount: Math.max(issueCount - issueTexts.length, 0),
|
|
131254
|
+
validatedItems: validationList.items,
|
|
131255
|
+
remainingValidatedCount: validationList.remainingCount,
|
|
131256
|
+
totalValidatedCount: validationList.totalCount
|
|
131257
|
+
};
|
|
131258
|
+
}
|
|
131259
|
+
function buildContractValidationList(schema, errors = [], maxItems = 24) {
|
|
131260
|
+
const failedPaths = new Set(errors.map(getComparableErrorPath));
|
|
131261
|
+
const allItems = collectContractValidationItems(schema).filter((item) => !isFailedValidationPath(item.comparablePath, failedPaths));
|
|
131262
|
+
const items = allItems.slice(0, maxItems).map(({ comparablePath: _comparablePath, ...item }) => item);
|
|
131263
|
+
return {
|
|
131264
|
+
items,
|
|
131265
|
+
totalCount: allItems.length,
|
|
131266
|
+
remainingCount: Math.max(allItems.length - items.length, 0),
|
|
131267
|
+
failedCount: failedPaths.size
|
|
131268
|
+
};
|
|
131269
|
+
}
|
|
131270
|
+
var RULE_LABELS = {
|
|
131271
|
+
type: (value) => `type: ${Array.isArray(value) ? value.join(" | ") : String(value)}`,
|
|
131272
|
+
format: (value) => `format: ${String(value)}`,
|
|
131273
|
+
enum: () => "enum",
|
|
131274
|
+
const: () => "const",
|
|
131275
|
+
pattern: () => "pattern",
|
|
131276
|
+
minimum: (value) => `min: ${String(value)}`,
|
|
131277
|
+
exclusiveMinimum: (value) => `exclusive min: ${String(value)}`,
|
|
131278
|
+
maximum: (value) => `max: ${String(value)}`,
|
|
131279
|
+
exclusiveMaximum: (value) => `exclusive max: ${String(value)}`,
|
|
131280
|
+
minLength: (value) => `min length: ${String(value)}`,
|
|
131281
|
+
maxLength: (value) => `max length: ${String(value)}`,
|
|
131282
|
+
minItems: (value) => `min items: ${String(value)}`,
|
|
131283
|
+
maxItems: (value) => `max items: ${String(value)}`,
|
|
131284
|
+
uniqueItems: () => "unique items",
|
|
131285
|
+
minProperties: (value) => `min properties: ${String(value)}`,
|
|
131286
|
+
maxProperties: (value) => `max properties: ${String(value)}`,
|
|
131287
|
+
multipleOf: (value) => `multiple of: ${String(value)}`
|
|
131288
|
+
};
|
|
131289
|
+
function collectContractValidationItems(schema, comparablePath = "", inheritedRules = []) {
|
|
131290
|
+
if (!isRecord2(schema)) {
|
|
131291
|
+
return [];
|
|
131292
|
+
}
|
|
131293
|
+
const items = [];
|
|
131294
|
+
const ownRules = getSchemaRuleLabels(schema);
|
|
131295
|
+
const rules = [...inheritedRules, ...ownRules];
|
|
131296
|
+
if (comparablePath && rules.length > 0) {
|
|
131297
|
+
items.push({
|
|
131298
|
+
comparablePath,
|
|
131299
|
+
path: formatComparablePath(comparablePath),
|
|
131300
|
+
rules
|
|
131301
|
+
});
|
|
131302
|
+
} else if (!comparablePath && rules.length > 0 && !schema.properties && !schema.items) {
|
|
131303
|
+
items.push({
|
|
131304
|
+
comparablePath: "/",
|
|
131305
|
+
path: "(root)",
|
|
131306
|
+
rules
|
|
131307
|
+
});
|
|
131308
|
+
}
|
|
131309
|
+
if (isRecord2(schema.properties)) {
|
|
131310
|
+
const required2 = Array.isArray(schema.required) ? new Set(schema.required.map(String)) : /* @__PURE__ */ new Set();
|
|
131311
|
+
for (const [propertyName, propertySchema] of Object.entries(schema.properties)) {
|
|
131312
|
+
const childPath = appendPropertyPath(comparablePath, propertyName);
|
|
131313
|
+
const childRules = required2.has(propertyName) ? ["required"] : [];
|
|
131314
|
+
items.push(...collectContractValidationItems(propertySchema, childPath, childRules));
|
|
131315
|
+
}
|
|
131316
|
+
}
|
|
131317
|
+
if (isRecord2(schema.items)) {
|
|
131318
|
+
items.push(...collectContractValidationItems(schema.items, appendArrayPath(comparablePath), []));
|
|
131319
|
+
}
|
|
131320
|
+
return items;
|
|
131321
|
+
}
|
|
131322
|
+
function getSchemaRuleLabels(schema) {
|
|
131323
|
+
const rules = [];
|
|
131324
|
+
for (const [keyword, formatter] of Object.entries(RULE_LABELS)) {
|
|
131325
|
+
if (schema[keyword] !== void 0) {
|
|
131326
|
+
rules.push(formatter(schema[keyword]));
|
|
131327
|
+
}
|
|
131328
|
+
}
|
|
131329
|
+
if (schema.additionalProperties === false) {
|
|
131330
|
+
rules.push("no extra properties");
|
|
131331
|
+
}
|
|
131332
|
+
return rules;
|
|
131333
|
+
}
|
|
131334
|
+
function appendPropertyPath(basePath, propertyName) {
|
|
131335
|
+
return `${basePath || ""}/${propertyName.replace(/~/g, "~0").replace(/\//g, "~1")}`;
|
|
131336
|
+
}
|
|
131337
|
+
function appendArrayPath(basePath) {
|
|
131338
|
+
return `${basePath || ""}/[]`;
|
|
131339
|
+
}
|
|
131340
|
+
function formatComparablePath(comparablePath) {
|
|
131341
|
+
return comparablePath.replace(/\/\[\]/g, "[]").replace(/~1/g, "/").replace(/~0/g, "~");
|
|
131342
|
+
}
|
|
131343
|
+
function getComparableErrorPath(error2) {
|
|
131344
|
+
let instancePath = error2.instancePath && error2.instancePath !== "(root)" ? error2.instancePath : "";
|
|
131345
|
+
if (error2.keyword === "required" && typeof error2.params?.missingProperty === "string") {
|
|
131346
|
+
instancePath = appendErrorPropertyPath(instancePath, error2.params.missingProperty);
|
|
131347
|
+
} else if (error2.keyword === "additionalProperties" && typeof error2.params?.additionalProperty === "string") {
|
|
131348
|
+
instancePath = appendErrorPropertyPath(instancePath, error2.params.additionalProperty);
|
|
131349
|
+
}
|
|
131350
|
+
return normalizeComparablePath(instancePath || "/");
|
|
131351
|
+
}
|
|
131352
|
+
function appendErrorPropertyPath(instancePath, propertyName) {
|
|
131353
|
+
const normalizedPath = instancePath && instancePath !== "(root)" && instancePath !== "/" ? instancePath : "";
|
|
131354
|
+
const escapedPropertyName = propertyName.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
131355
|
+
const lastSegment = normalizedPath.split("/").pop();
|
|
131356
|
+
return lastSegment === escapedPropertyName ? normalizedPath : `${normalizedPath}/${escapedPropertyName}`;
|
|
131357
|
+
}
|
|
131358
|
+
function normalizeComparablePath(instancePath) {
|
|
131359
|
+
if (!instancePath || instancePath === "(root)" || instancePath === "/") {
|
|
131360
|
+
return "/";
|
|
131361
|
+
}
|
|
131362
|
+
return instancePath.split("/").map((segment) => /^\d+$/.test(segment) ? "[]" : segment).join("/");
|
|
131363
|
+
}
|
|
131364
|
+
function isFailedValidationPath(comparablePath, failedPaths) {
|
|
131365
|
+
for (const failedPath of failedPaths) {
|
|
131366
|
+
if (comparablePath === failedPath || comparablePath.startsWith(`${failedPath}/`)) {
|
|
131367
|
+
return true;
|
|
131368
|
+
}
|
|
131369
|
+
}
|
|
131370
|
+
return false;
|
|
131371
|
+
}
|
|
131372
|
+
function isRecord2(value) {
|
|
131373
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
131374
|
+
}
|
|
131375
|
+
function formatSchemaIssue(error2) {
|
|
131376
|
+
const location = error2.instancePath && error2.instancePath !== "(root)" ? error2.instancePath : "";
|
|
131377
|
+
return location ? `${location}: ${error2.message}` : error2.message;
|
|
131378
|
+
}
|
|
131379
|
+
function getContractDisplaySeverity(assertion) {
|
|
131380
|
+
if (assertion.passed) {
|
|
131381
|
+
return "success";
|
|
131382
|
+
}
|
|
131383
|
+
const schemaErrors = assertion.schemaErrors || [];
|
|
131384
|
+
return schemaErrors.length > 0 && schemaErrors.every((error2) => error2.severity === "warning") ? "warning" : "error";
|
|
131385
|
+
}
|
|
131386
|
+
|
|
131071
131387
|
// src/cli/formatters/assertion.ts
|
|
131072
131388
|
function formatAssertion(assertion, options) {
|
|
131073
131389
|
const { colors, verbose } = options;
|
|
@@ -131078,6 +131394,31 @@ function formatAssertion(assertion, options) {
|
|
|
131078
131394
|
displayExpr = displayExpr.replace("$" + assertion.responseIndex, assertion.friendlyName);
|
|
131079
131395
|
}
|
|
131080
131396
|
const displayMessage = assertion.message || displayExpr;
|
|
131397
|
+
const contractDisplay = buildContractAssertionDisplay(assertion);
|
|
131398
|
+
if (contractDisplay) {
|
|
131399
|
+
const summaryColor = assertion.passed ? colors.success : colors.warning;
|
|
131400
|
+
lines.push(`${icon} ${summaryColor(contractDisplay.titleText)}`);
|
|
131401
|
+
if (assertion.message) {
|
|
131402
|
+
lines.push(` ${colors.dim("Note:")} ${assertion.message}`);
|
|
131403
|
+
}
|
|
131404
|
+
if (verbose && contractDisplay.schemaPath && contractDisplay.schemaPath !== contractDisplay.schemaName) {
|
|
131405
|
+
lines.push(` ${colors.dim("Schema path:")} ${contractDisplay.schemaPath}`);
|
|
131406
|
+
}
|
|
131407
|
+
if (!assertion.passed) {
|
|
131408
|
+
if (contractDisplay.issueTexts.length > 0) {
|
|
131409
|
+
lines.push(` ${colors.dim("Issues:")}`);
|
|
131410
|
+
for (const issue2 of contractDisplay.issueTexts) {
|
|
131411
|
+
lines.push(` ${colors.cross} ${colors.error(issue2)}`);
|
|
131412
|
+
}
|
|
131413
|
+
if (contractDisplay.remainingIssueCount > 0) {
|
|
131414
|
+
lines.push(` ${colors.dim(`+${contractDisplay.remainingIssueCount} more`)}`);
|
|
131415
|
+
}
|
|
131416
|
+
} else if (assertion.error) {
|
|
131417
|
+
lines.push(` ${colors.error(`Error: ${assertion.error}`)}`);
|
|
131418
|
+
}
|
|
131419
|
+
}
|
|
131420
|
+
return lines;
|
|
131421
|
+
}
|
|
131081
131422
|
lines.push(`${icon} assert ${displayMessage}`);
|
|
131082
131423
|
if (!assertion.passed || verbose) {
|
|
131083
131424
|
if (assertion.error) {
|
|
@@ -132047,7 +132388,7 @@ function generateHtmlReportFromResponse(response, testName, options) {
|
|
|
132047
132388
|
|
|
132048
132389
|
// src/environmentParser.ts
|
|
132049
132390
|
var fs15 = __toESM(require("fs"));
|
|
132050
|
-
var
|
|
132391
|
+
var path15 = __toESM(require("path"));
|
|
132051
132392
|
|
|
132052
132393
|
// src/secrets/crypto.ts
|
|
132053
132394
|
var crypto7 = __toESM(require("crypto"));
|
|
@@ -132116,14 +132457,14 @@ function decryptSecretValue(encryptedValue, sharedKey) {
|
|
|
132116
132457
|
|
|
132117
132458
|
// src/secrets/keyStore.ts
|
|
132118
132459
|
var fs14 = __toESM(require("fs"));
|
|
132119
|
-
var
|
|
132460
|
+
var path14 = __toESM(require("path"));
|
|
132120
132461
|
var CACHE_FILE2 = "secret-keys.json";
|
|
132121
132462
|
var CACHE_VERSION2 = 1;
|
|
132122
132463
|
var CACHE_SCAN_IGNORED_DIRS = /* @__PURE__ */ new Set(["node_modules", ".git", "dist", "out"]);
|
|
132123
132464
|
var sessionKeys = /* @__PURE__ */ new Map();
|
|
132124
132465
|
var projectSecretKeyCacheDirs = /* @__PURE__ */ new Map();
|
|
132125
132466
|
function getCacheFilePath(cacheDir) {
|
|
132126
|
-
return
|
|
132467
|
+
return path14.join(cacheDir, CACHE_FILE2);
|
|
132127
132468
|
}
|
|
132128
132469
|
function cacheFileExists(cacheDir) {
|
|
132129
132470
|
const cacheFilePath = getCacheFilePath(cacheDir);
|
|
@@ -132145,7 +132486,7 @@ function getProjectSecretKeyCacheDirs(projectRoot) {
|
|
|
132145
132486
|
if (!dir) {
|
|
132146
132487
|
continue;
|
|
132147
132488
|
}
|
|
132148
|
-
const cacheDir =
|
|
132489
|
+
const cacheDir = path14.join(dir, NORN_CACHE_DIR);
|
|
132149
132490
|
if (cacheFileExists(cacheDir)) {
|
|
132150
132491
|
results.push(cacheDir);
|
|
132151
132492
|
}
|
|
@@ -132162,7 +132503,7 @@ function getProjectSecretKeyCacheDirs(projectRoot) {
|
|
|
132162
132503
|
if (entry.name === NORN_CACHE_DIR || CACHE_SCAN_IGNORED_DIRS.has(entry.name)) {
|
|
132163
132504
|
continue;
|
|
132164
132505
|
}
|
|
132165
|
-
queue.push(
|
|
132506
|
+
queue.push(path14.join(dir, entry.name));
|
|
132166
132507
|
}
|
|
132167
132508
|
}
|
|
132168
132509
|
results.sort();
|
|
@@ -132170,11 +132511,11 @@ function getProjectSecretKeyCacheDirs(projectRoot) {
|
|
|
132170
132511
|
return results;
|
|
132171
132512
|
}
|
|
132172
132513
|
function getCacheDistance(targetPath, cacheDir) {
|
|
132173
|
-
const relative5 =
|
|
132514
|
+
const relative5 = path14.relative(getSearchStartDirectory(targetPath), cacheDir);
|
|
132174
132515
|
if (!relative5 || relative5 === ".") {
|
|
132175
132516
|
return 0;
|
|
132176
132517
|
}
|
|
132177
|
-
return relative5.split(
|
|
132518
|
+
return relative5.split(path14.sep).filter((segment) => segment !== "").length;
|
|
132178
132519
|
}
|
|
132179
132520
|
function findExistingSecretKeyCacheDir(targetPath) {
|
|
132180
132521
|
const projectRoot = findProjectRoot(targetPath);
|
|
@@ -132201,7 +132542,7 @@ function rememberSecretKeyCacheDir(targetPath, cacheDir) {
|
|
|
132201
132542
|
function ensureCacheDir(targetPath) {
|
|
132202
132543
|
const existing = findExistingSecretKeyCacheDir(targetPath);
|
|
132203
132544
|
const projectRoot = findProjectRoot(targetPath);
|
|
132204
|
-
const cacheDir = existing ??
|
|
132545
|
+
const cacheDir = existing ?? path14.join(projectRoot, NORN_CACHE_DIR);
|
|
132205
132546
|
if (!fs14.existsSync(cacheDir)) {
|
|
132206
132547
|
fs14.mkdirSync(cacheDir, { recursive: true });
|
|
132207
132548
|
}
|
|
@@ -132215,7 +132556,7 @@ function getReadCachePath(targetPath) {
|
|
|
132215
132556
|
return getCacheFilePath(existing);
|
|
132216
132557
|
}
|
|
132217
132558
|
const projectRoot = findProjectRoot(targetPath);
|
|
132218
|
-
const projectCacheDir =
|
|
132559
|
+
const projectCacheDir = path14.join(projectRoot, NORN_CACHE_DIR);
|
|
132219
132560
|
if (fs14.existsSync(projectCacheDir) && fs14.statSync(projectCacheDir).isDirectory()) {
|
|
132220
132561
|
return getCacheFilePath(projectCacheDir);
|
|
132221
132562
|
}
|
|
@@ -132434,22 +132775,22 @@ function parseEnvFile(content, sourceFilePath) {
|
|
|
132434
132775
|
return config2;
|
|
132435
132776
|
}
|
|
132436
132777
|
function getEnvSearchStartDirectory(targetPath) {
|
|
132437
|
-
const resolvedPath =
|
|
132778
|
+
const resolvedPath = path15.resolve(targetPath);
|
|
132438
132779
|
try {
|
|
132439
132780
|
const stats = fs15.statSync(resolvedPath);
|
|
132440
|
-
return stats.isDirectory() ? resolvedPath :
|
|
132781
|
+
return stats.isDirectory() ? resolvedPath : path15.dirname(resolvedPath);
|
|
132441
132782
|
} catch {
|
|
132442
|
-
return
|
|
132783
|
+
return path15.dirname(resolvedPath);
|
|
132443
132784
|
}
|
|
132444
132785
|
}
|
|
132445
132786
|
function findEnvFileFromPath(filePath) {
|
|
132446
132787
|
let dir = getEnvSearchStartDirectory(filePath);
|
|
132447
132788
|
while (true) {
|
|
132448
|
-
const envPath =
|
|
132789
|
+
const envPath = path15.join(dir, ENV_FILENAME);
|
|
132449
132790
|
if (fs15.existsSync(envPath)) {
|
|
132450
132791
|
return envPath;
|
|
132451
132792
|
}
|
|
132452
|
-
const parentDir =
|
|
132793
|
+
const parentDir = path15.dirname(dir);
|
|
132453
132794
|
if (parentDir === dir) {
|
|
132454
132795
|
break;
|
|
132455
132796
|
}
|
|
@@ -132458,9 +132799,9 @@ function findEnvFileFromPath(filePath) {
|
|
|
132458
132799
|
return void 0;
|
|
132459
132800
|
}
|
|
132460
132801
|
function formatNornenvErrorLocation(rootEnvFilePath, errorFilePath, line2) {
|
|
132461
|
-
const baseDir =
|
|
132462
|
-
const relativePath =
|
|
132463
|
-
const fileLabel = relativePath && relativePath !== "" ? relativePath :
|
|
132802
|
+
const baseDir = path15.dirname(rootEnvFilePath);
|
|
132803
|
+
const relativePath = path15.relative(baseDir, errorFilePath);
|
|
132804
|
+
const fileLabel = relativePath && relativePath !== "" ? relativePath : path15.basename(errorFilePath);
|
|
132464
132805
|
return line2 >= 0 ? `${fileLabel}:${line2 + 1}` : fileLabel;
|
|
132465
132806
|
}
|
|
132466
132807
|
function resolveNornenvImports(config2, baseDir, entryFilePath, readFile3, importStack, alreadyImported) {
|
|
@@ -132496,10 +132837,10 @@ function resolveNornenvImports(config2, baseDir, entryFilePath, readFile3, impor
|
|
|
132496
132837
|
});
|
|
132497
132838
|
continue;
|
|
132498
132839
|
}
|
|
132499
|
-
const normalizedPath =
|
|
132840
|
+
const normalizedPath = path15.resolve(resolvedImportPath);
|
|
132500
132841
|
if (stack.includes(normalizedPath)) {
|
|
132501
|
-
const entryDir =
|
|
132502
|
-
const cycle = [...stack, normalizedPath].map((p) =>
|
|
132842
|
+
const entryDir = path15.dirname(stack[0]);
|
|
132843
|
+
const cycle = [...stack, normalizedPath].map((p) => path15.relative(entryDir, p) || path15.basename(p)).join(" \u2192 ");
|
|
132503
132844
|
errors.push({
|
|
132504
132845
|
message: `Circular import detected: ${cycle}`,
|
|
132505
132846
|
filePath: entryFilePath,
|
|
@@ -132528,7 +132869,7 @@ function resolveNornenvImports(config2, baseDir, entryFilePath, readFile3, impor
|
|
|
132528
132869
|
if (importedConfig.imports.length > 0) {
|
|
132529
132870
|
const childResult = resolveNornenvImports(
|
|
132530
132871
|
importedConfig,
|
|
132531
|
-
|
|
132872
|
+
path15.dirname(normalizedPath),
|
|
132532
132873
|
normalizedPath,
|
|
132533
132874
|
readFile3,
|
|
132534
132875
|
[...stack, normalizedPath],
|
|
@@ -132546,7 +132887,7 @@ function resolveNornenvImports(config2, baseDir, entryFilePath, readFile3, impor
|
|
|
132546
132887
|
}
|
|
132547
132888
|
function resolveImportPath(importPath, baseDir) {
|
|
132548
132889
|
const cleaned = importPath.replace(/^["']|["']$/g, "");
|
|
132549
|
-
return
|
|
132890
|
+
return path15.resolve(baseDir, cleaned);
|
|
132550
132891
|
}
|
|
132551
132892
|
function registerVariableOrigins(config2, filePath, origins) {
|
|
132552
132893
|
for (const varName of Object.keys(config2.common)) {
|
|
@@ -132610,9 +132951,9 @@ function mergeConfigs(target, source, targetFilePath, sourceFilePath, variableOr
|
|
|
132610
132951
|
}
|
|
132611
132952
|
}
|
|
132612
132953
|
function toDisplayPath(filePath, entryFilePath) {
|
|
132613
|
-
const entryDir =
|
|
132614
|
-
const relative5 =
|
|
132615
|
-
return relative5 && relative5 !== "" ? relative5 :
|
|
132954
|
+
const entryDir = path15.dirname(entryFilePath);
|
|
132955
|
+
const relative5 = path15.relative(entryDir, filePath);
|
|
132956
|
+
return relative5 && relative5 !== "" ? relative5 : path15.basename(filePath);
|
|
132616
132957
|
}
|
|
132617
132958
|
function loadAndResolveEnvFile(filePath) {
|
|
132618
132959
|
const content = fs15.readFileSync(filePath, "utf-8");
|
|
@@ -132623,7 +132964,7 @@ function loadAndResolveEnvFile(filePath) {
|
|
|
132623
132964
|
}
|
|
132624
132965
|
const result = resolveNornenvImports(
|
|
132625
132966
|
config2,
|
|
132626
|
-
|
|
132967
|
+
path15.dirname(filePath),
|
|
132627
132968
|
filePath,
|
|
132628
132969
|
(p) => fs15.readFileSync(p, "utf-8")
|
|
132629
132970
|
);
|
|
@@ -132692,13 +133033,13 @@ function resolveEncryptedSecretValues(config2, entryFilePath) {
|
|
|
132692
133033
|
|
|
132693
133034
|
// src/secrets/cliSecrets.ts
|
|
132694
133035
|
var fs17 = __toESM(require("fs"));
|
|
132695
|
-
var
|
|
133036
|
+
var path17 = __toESM(require("path"));
|
|
132696
133037
|
var readline = __toESM(require("readline"));
|
|
132697
133038
|
var import_process = require("process");
|
|
132698
133039
|
|
|
132699
133040
|
// src/secrets/envFileSecrets.ts
|
|
132700
133041
|
var fs16 = __toESM(require("fs"));
|
|
132701
|
-
var
|
|
133042
|
+
var path16 = __toESM(require("path"));
|
|
132702
133043
|
var envRegex2 = /^\s*\[env:([a-zA-Z_][a-zA-Z0-9_-]*)\]\s*$/;
|
|
132703
133044
|
var secretConnectionStringRegex2 = /^(\s*secret\s+connectionString\s+)([a-zA-Z_][a-zA-Z0-9_]*)(\s*=\s*)(.+)$/;
|
|
132704
133045
|
var secretRegex2 = /^(\s*secret\s+)([a-zA-Z_][a-zA-Z0-9_]*)(\s*=\s*)(.+)$/;
|
|
@@ -132709,7 +133050,7 @@ function detectEol(content) {
|
|
|
132709
133050
|
return content.includes("\r\n") ? "\r\n" : "\n";
|
|
132710
133051
|
}
|
|
132711
133052
|
function isNornenvFilePath(filePath) {
|
|
132712
|
-
return
|
|
133053
|
+
return path16.basename(filePath).toLowerCase() === ".nornenv";
|
|
132713
133054
|
}
|
|
132714
133055
|
function extractSecretLines(content, filePath) {
|
|
132715
133056
|
const lines = splitContentLines(content);
|
|
@@ -132795,7 +133136,7 @@ function writeSecretLine(filePath, content) {
|
|
|
132795
133136
|
fs16.writeFileSync(filePath, content, "utf8");
|
|
132796
133137
|
}
|
|
132797
133138
|
function discoverNornenvFiles(targetPath) {
|
|
132798
|
-
const resolved =
|
|
133139
|
+
const resolved = path16.resolve(targetPath);
|
|
132799
133140
|
if (!fs16.existsSync(resolved)) {
|
|
132800
133141
|
return [];
|
|
132801
133142
|
}
|
|
@@ -132807,7 +133148,7 @@ function discoverNornenvFiles(targetPath) {
|
|
|
132807
133148
|
const walk = (dir) => {
|
|
132808
133149
|
const entries = fs16.readdirSync(dir, { withFileTypes: true });
|
|
132809
133150
|
for (const entry of entries) {
|
|
132810
|
-
const fullPath =
|
|
133151
|
+
const fullPath = path16.join(dir, entry.name);
|
|
132811
133152
|
if (entry.isDirectory()) {
|
|
132812
133153
|
if (entry.name === "node_modules" || entry.name === ".git" || entry.name === "dist" || entry.name === "out") {
|
|
132813
133154
|
continue;
|
|
@@ -132866,8 +133207,8 @@ function formatSecretError(err, envFilePath) {
|
|
|
132866
133207
|
if (!envFilePath) {
|
|
132867
133208
|
return `${err.message}`;
|
|
132868
133209
|
}
|
|
132869
|
-
const relative5 =
|
|
132870
|
-
const fileLabel = relative5 && relative5 !== "" ? relative5 :
|
|
133210
|
+
const relative5 = path17.relative(path17.dirname(envFilePath), err.filePath);
|
|
133211
|
+
const fileLabel = relative5 && relative5 !== "" ? relative5 : path17.basename(err.filePath);
|
|
132871
133212
|
const lineLabel = err.line >= 0 ? `${fileLabel}:${err.line + 1}` : fileLabel;
|
|
132872
133213
|
return `${lineLabel} - ${err.message}`;
|
|
132873
133214
|
}
|
|
@@ -132963,7 +133304,7 @@ async function handleEncrypt(args) {
|
|
|
132963
133304
|
console.error(`Error: encrypt requires --file and --var.`);
|
|
132964
133305
|
return 1;
|
|
132965
133306
|
}
|
|
132966
|
-
const absoluteFilePath =
|
|
133307
|
+
const absoluteFilePath = path17.resolve(filePath);
|
|
132967
133308
|
const { content, secret } = loadSecretLine(absoluteFilePath, variableName, envName);
|
|
132968
133309
|
if (secret.encrypted) {
|
|
132969
133310
|
console.error(`Error: Secret '${variableName}' is already encrypted. Use rotate instead.`);
|
|
@@ -132995,7 +133336,7 @@ async function handleRotate(args) {
|
|
|
132995
133336
|
console.error(`Error: rotate requires --file and --var.`);
|
|
132996
133337
|
return 1;
|
|
132997
133338
|
}
|
|
132998
|
-
const absoluteFilePath =
|
|
133339
|
+
const absoluteFilePath = path17.resolve(filePath);
|
|
132999
133340
|
const { content, secret } = loadSecretLine(absoluteFilePath, variableName, envName);
|
|
133000
133341
|
let kid = explicitKid;
|
|
133001
133342
|
if (!kid && secret.encrypted) {
|
|
@@ -133026,7 +133367,7 @@ async function handleRotate(args) {
|
|
|
133026
133367
|
}
|
|
133027
133368
|
async function handleRekey(args) {
|
|
133028
133369
|
const positional = args.filter((arg) => !arg.startsWith("-"));
|
|
133029
|
-
const targetPath = positional[0] ?
|
|
133370
|
+
const targetPath = positional[0] ? path17.resolve(positional[0]) : process.cwd();
|
|
133030
133371
|
const targetKid = getFlagValue(args, "--kid");
|
|
133031
133372
|
const files = discoverNornenvFiles(targetPath);
|
|
133032
133373
|
if (files.length === 0) {
|
|
@@ -133096,7 +133437,7 @@ async function handleRekey(args) {
|
|
|
133096
133437
|
}
|
|
133097
133438
|
async function handleAudit(args) {
|
|
133098
133439
|
const positional = args.filter((arg) => !arg.startsWith("-"));
|
|
133099
|
-
const targetPath = positional[0] ?
|
|
133440
|
+
const targetPath = positional[0] ? path17.resolve(positional[0]) : process.cwd();
|
|
133100
133441
|
const files = discoverNornenvFiles(targetPath);
|
|
133101
133442
|
if (files.length === 0) {
|
|
133102
133443
|
console.log(`No .nornenv files found under ${targetPath}`);
|
|
@@ -133191,7 +133532,7 @@ function printSecretResolutionErrors(errors, envFilePath) {
|
|
|
133191
133532
|
|
|
133192
133533
|
// src/theoryCaseLoader.ts
|
|
133193
133534
|
var fs18 = __toESM(require("fs/promises"));
|
|
133194
|
-
var
|
|
133535
|
+
var path18 = __toESM(require("path"));
|
|
133195
133536
|
function formatTheoryCaseLabel(params, index) {
|
|
133196
133537
|
const entries = Object.entries(params);
|
|
133197
133538
|
if (entries.length === 0) {
|
|
@@ -133215,7 +133556,7 @@ function normalizeTheoryCase(caseValue, sequenceParamNames) {
|
|
|
133215
133556
|
return void 0;
|
|
133216
133557
|
}
|
|
133217
133558
|
async function loadTheoryCasesFromSource(sourcePath, workingDir, sequenceParamNames) {
|
|
133218
|
-
const resolvedPath =
|
|
133559
|
+
const resolvedPath = path18.resolve(workingDir, sourcePath);
|
|
133219
133560
|
const content = await fs18.readFile(resolvedPath, "utf-8");
|
|
133220
133561
|
const parsed = JSON.parse(content);
|
|
133221
133562
|
if (!Array.isArray(parsed)) {
|
|
@@ -133365,10 +133706,10 @@ function generateTimestamp() {
|
|
|
133365
133706
|
return `${year}-${month}-${day}-${hours}${minutes}${seconds}`;
|
|
133366
133707
|
}
|
|
133367
133708
|
function generateReportPaths(outputDir, inputFile, timestamp) {
|
|
133368
|
-
const baseName =
|
|
133709
|
+
const baseName = path19.basename(inputFile, path19.extname(inputFile));
|
|
133369
133710
|
return {
|
|
133370
|
-
junitPath:
|
|
133371
|
-
htmlPath:
|
|
133711
|
+
junitPath: path19.join(outputDir, `${baseName}-${timestamp}-results.xml`),
|
|
133712
|
+
htmlPath: path19.join(outputDir, `${baseName}-${timestamp}-report.html`)
|
|
133372
133713
|
};
|
|
133373
133714
|
}
|
|
133374
133715
|
function parseArgs(args) {
|
|
@@ -133535,7 +133876,7 @@ function discoverNornFiles(dirPath) {
|
|
|
133535
133876
|
function walkDir(currentPath) {
|
|
133536
133877
|
const entries = fs19.readdirSync(currentPath, { withFileTypes: true });
|
|
133537
133878
|
for (const entry of entries) {
|
|
133538
|
-
const fullPath =
|
|
133879
|
+
const fullPath = path19.join(currentPath, entry.name);
|
|
133539
133880
|
if (entry.isDirectory()) {
|
|
133540
133881
|
if (!entry.name.startsWith(".") && entry.name !== "node_modules") {
|
|
133541
133882
|
walkDir(fullPath);
|
|
@@ -133659,7 +134000,7 @@ async function main() {
|
|
|
133659
134000
|
if (options.insecure) {
|
|
133660
134001
|
console.error(colors.warning("Warning: TLS certificate verification is disabled (--insecure). Use this only for local development."));
|
|
133661
134002
|
}
|
|
133662
|
-
const inputPath =
|
|
134003
|
+
const inputPath = path19.resolve(options.file);
|
|
133663
134004
|
if (!fs19.existsSync(inputPath)) {
|
|
133664
134005
|
console.error(`Error: Path not found: ${inputPath}`);
|
|
133665
134006
|
process.exit(1);
|
|
@@ -133735,7 +134076,7 @@ async function main() {
|
|
|
133735
134076
|
const fileVariables = extractFileLevelVariables(fileContent);
|
|
133736
134077
|
const variables = attachEnvironmentScope({ ...resolvedEnv.variables, ...fileVariables }, resolvedEnv.variables);
|
|
133737
134078
|
const cookieJar = createCookieJar();
|
|
133738
|
-
const workingDir =
|
|
134079
|
+
const workingDir = path19.dirname(filePath);
|
|
133739
134080
|
const importResult = await resolveImports(
|
|
133740
134081
|
fileContent,
|
|
133741
134082
|
workingDir,
|
|
@@ -133929,7 +134270,7 @@ ${fileContent}` : fileContent;
|
|
|
133929
134270
|
process.exit(1);
|
|
133930
134271
|
}
|
|
133931
134272
|
if (!resolvedEnv.envFilePath && options.env) {
|
|
133932
|
-
const relPath = isDirectory ?
|
|
134273
|
+
const relPath = isDirectory ? path19.relative(inputPath, filePath) : path19.basename(filePath);
|
|
133933
134274
|
console.error(colors.warning(`Warning: --env specified but no .nornenv file found for ${relPath}`));
|
|
133934
134275
|
}
|
|
133935
134276
|
mergeSecrets(combinedSecretNames, combinedSecretValues, resolvedEnv.secretNames, resolvedEnv.secretValues);
|
|
@@ -133938,7 +134279,7 @@ ${fileContent}` : fileContent;
|
|
|
133938
134279
|
const fileVariables = extractFileLevelVariables(fileContent);
|
|
133939
134280
|
const variables = attachEnvironmentScope({ ...resolvedEnv.variables, ...fileVariables }, resolvedEnv.variables);
|
|
133940
134281
|
const cookieJar = createCookieJar();
|
|
133941
|
-
const workingDir =
|
|
134282
|
+
const workingDir = path19.dirname(filePath);
|
|
133942
134283
|
const importResult = await resolveImports(
|
|
133943
134284
|
fileContent,
|
|
133944
134285
|
workingDir,
|
|
@@ -133958,7 +134299,7 @@ ${fileContent}` : fileContent;
|
|
|
133958
134299
|
continue;
|
|
133959
134300
|
}
|
|
133960
134301
|
if (isDirectory && options.output !== "json") {
|
|
133961
|
-
const relPath =
|
|
134302
|
+
const relPath = path19.relative(inputPath, filePath);
|
|
133962
134303
|
console.log(colors.info(`
|
|
133963
134304
|
\u2501\u2501\u2501 ${relPath} \u2501\u2501\u2501`));
|
|
133964
134305
|
}
|
|
@@ -134003,7 +134344,7 @@ ${fileContent}` : fileContent;
|
|
|
134003
134344
|
let htmlOutputPath = options.htmlOutput;
|
|
134004
134345
|
if (options.outputDir) {
|
|
134005
134346
|
const timestamp = generateTimestamp();
|
|
134006
|
-
const baseName = isDirectory ?
|
|
134347
|
+
const baseName = isDirectory ? path19.basename(inputPath) : path19.basename(inputPath, path19.extname(inputPath));
|
|
134007
134348
|
const generatedPaths = generateReportPaths(options.outputDir, baseName + ".norn", timestamp);
|
|
134008
134349
|
if (!junitOutputPath) {
|
|
134009
134350
|
junitOutputPath = generatedPaths.junitPath;
|
|
@@ -134016,7 +134357,7 @@ ${fileContent}` : fileContent;
|
|
|
134016
134357
|
}
|
|
134017
134358
|
}
|
|
134018
134359
|
if (junitOutputPath) {
|
|
134019
|
-
const suiteName = isDirectory ?
|
|
134360
|
+
const suiteName = isDirectory ? path19.basename(inputPath) : path19.basename(inputPath, path19.extname(inputPath));
|
|
134020
134361
|
if (result.type === "request") {
|
|
134021
134362
|
generateJUnitReportFromResponse(
|
|
134022
134363
|
result.results[0],
|
|
@@ -134032,11 +134373,11 @@ ${fileContent}` : fileContent;
|
|
|
134032
134373
|
console.log(colors.info(`JUnit report written to: ${junitOutputPath}`));
|
|
134033
134374
|
}
|
|
134034
134375
|
if (htmlOutputPath) {
|
|
134035
|
-
const title = `Norn Test Report - ${
|
|
134376
|
+
const title = `Norn Test Report - ${path19.basename(inputPath)}`;
|
|
134036
134377
|
if (result.type === "request") {
|
|
134037
134378
|
generateHtmlReportFromResponse(
|
|
134038
134379
|
result.results[0],
|
|
134039
|
-
options.request ||
|
|
134380
|
+
options.request || path19.basename(inputPath),
|
|
134040
134381
|
{ outputPath: htmlOutputPath, redaction, title }
|
|
134041
134382
|
);
|
|
134042
134383
|
} else {
|