norn-cli 1.5.3 → 1.5.4

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.
@@ -3,7 +3,7 @@
3
3
  "urls": {
4
4
  "https://petstore.swagger.io/v2/swagger.json": {
5
5
  "baseUrl": "https://petstore.swagger.io/v2",
6
- "fetchedAt": "2026-03-02T17:50:37.440Z",
6
+ "fetchedAt": "2026-03-02T22:20:46.746Z",
7
7
  "schemas": [
8
8
  {
9
9
  "operationId": "AddPet",
package/CHANGELOG.md CHANGED
@@ -4,6 +4,14 @@ All notable changes to the "Norn" extension will be documented in this file.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [1.5.4] - 2026-03-02
8
+
9
+ ### Improved
10
+ - **Norn Cache Git Ignore Behavior**:
11
+ - Stopped modifying the repository root `.gitignore` when secret keys are cached.
12
+ - Added local cache-level ignore behavior by writing `.norn-cache/.gitignore` with `*`.
13
+ - Keeps `.norn-cache` contents out of Git without mutating user-managed root ignore files.
14
+
7
15
  ## [1.5.3] - 2026-03-02
8
16
 
9
17
  ### Added
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(path9) {
8885
- if (!path9 || typeof path9 !== "string") {
8884
+ function lookup(path10) {
8885
+ if (!path10 || typeof path10 !== "string") {
8886
8886
  return false;
8887
8887
  }
8888
- var extension2 = extname2("x." + path9).toLowerCase().substr(1);
8888
+ var extension2 = extname2("x." + path10).toLowerCase().substr(1);
8889
8889
  if (!extension2) {
8890
8890
  return false;
8891
8891
  }
@@ -9990,11 +9990,11 @@ var require_form_data = __commonJS({
9990
9990
  "use strict";
9991
9991
  var CombinedStream = require_combined_stream();
9992
9992
  var util3 = require("util");
9993
- var path9 = require("path");
9993
+ var path10 = require("path");
9994
9994
  var http3 = require("http");
9995
9995
  var https3 = require("https");
9996
9996
  var parseUrl = require("url").parse;
9997
- var fs10 = require("fs");
9997
+ var fs11 = require("fs");
9998
9998
  var Stream = require("stream").Stream;
9999
9999
  var crypto3 = require("crypto");
10000
10000
  var mime = require_mime_types();
@@ -10061,7 +10061,7 @@ var require_form_data = __commonJS({
10061
10061
  if (value.end != void 0 && value.end != Infinity && value.start != void 0) {
10062
10062
  callback(null, value.end + 1 - (value.start ? value.start : 0));
10063
10063
  } else {
10064
- fs10.stat(value.path, function(err, stat) {
10064
+ fs11.stat(value.path, function(err, stat) {
10065
10065
  if (err) {
10066
10066
  callback(err);
10067
10067
  return;
@@ -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 = path9.normalize(options.filepath).replace(/\\/g, "/");
10121
+ filename = path10.normalize(options.filepath).replace(/\\/g, "/");
10122
10122
  } else if (options.filename || value && (value.name || value.path)) {
10123
- filename = path9.basename(options.filename || value && (value.name || value.path));
10123
+ filename = path10.basename(options.filename || value && (value.name || value.path));
10124
10124
  } else if (value && value.readable && hasOwn(value, "httpVersion")) {
10125
- filename = path9.basename(value.client._httpMessage.path || "");
10125
+ filename = path10.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(path9) {
15335
- let input2 = path9;
15334
+ function removeDotSegments(path10) {
15335
+ let input2 = path10;
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 [path9, query] = wsComponent.resourceName.split("?");
15535
- wsComponent.path = path9 && path9 !== "/" ? path9 : void 0;
15534
+ const [path10, query] = wsComponent.resourceName.split("?");
15535
+ wsComponent.path = path10 && path10 !== "/" ? path10 : void 0;
15536
15536
  wsComponent.query = query;
15537
15537
  wsComponent.resourceName = void 0;
15538
15538
  }
@@ -18738,8 +18738,8 @@ function validateAgainstSchemaDetailed(value, schemaPath, basePath, workspaceRoo
18738
18738
  if (!valid && validate2.errors) {
18739
18739
  const errors = validate2.errors.map((err) => convertAjvError(err, value));
18740
18740
  const errorStrings = validate2.errors.map((err) => {
18741
- const path9 = err.instancePath || "(root)";
18742
- return `${path9}: ${err.message}`;
18741
+ const path10 = err.instancePath || "(root)";
18742
+ return `${path10}: ${err.message}`;
18743
18743
  });
18744
18744
  return {
18745
18745
  valid: false,
@@ -18868,7 +18868,7 @@ function resolveValue(expr, responses, variables, getValueByPath2, responseIndex
18868
18868
  if (refMatch) {
18869
18869
  const responseIdx = parseInt(refMatch[1], 10);
18870
18870
  const responseIndex = responseIdx - 1;
18871
- const path9 = refMatch[2];
18871
+ const path10 = refMatch[2];
18872
18872
  if (responseIndex < 0 || responseIndex >= responses.length) {
18873
18873
  return {
18874
18874
  value: void 0,
@@ -18876,12 +18876,12 @@ function resolveValue(expr, responses, variables, getValueByPath2, responseIndex
18876
18876
  };
18877
18877
  }
18878
18878
  const response = responses[responseIndex];
18879
- const value = getValueByPath2(response, path9);
18879
+ const value = getValueByPath2(response, path10);
18880
18880
  return {
18881
18881
  value,
18882
18882
  responseIndex: responseIdx,
18883
18883
  response,
18884
- jsonPath: path9,
18884
+ jsonPath: path10,
18885
18885
  variableName: responseIndexToVariable?.get(responseIdx)
18886
18886
  };
18887
18887
  }
@@ -18898,22 +18898,22 @@ function resolveValue(expr, responses, variables, getValueByPath2, responseIndex
18898
18898
  if (varName in variables) {
18899
18899
  const varValue = variables[varName];
18900
18900
  if (typeof varValue === "object" && varValue !== null) {
18901
- const path9 = pathPart.replace(/^\./, "");
18902
- const value = getNestedValue2(varValue, path9);
18901
+ const path10 = pathPart.replace(/^\./, "");
18902
+ const value = getNestedValue2(varValue, path10);
18903
18903
  const isHttpResponse = "status" in varValue && "body" in varValue;
18904
18904
  return {
18905
18905
  value,
18906
18906
  variableName: varName,
18907
- jsonPath: path9,
18907
+ jsonPath: path10,
18908
18908
  response: isHttpResponse ? varValue : void 0
18909
18909
  };
18910
18910
  }
18911
18911
  if (typeof varValue === "string") {
18912
18912
  try {
18913
18913
  const parsed = JSON.parse(varValue);
18914
- const path9 = pathPart.replace(/^\./, "");
18915
- const value = getNestedValue2(parsed, path9);
18916
- return { value, variableName: varName, jsonPath: path9 };
18914
+ const path10 = pathPart.replace(/^\./, "");
18915
+ const value = getNestedValue2(parsed, path10);
18916
+ return { value, variableName: varName, jsonPath: path10 };
18917
18917
  } catch {
18918
18918
  return { value: void 0, error: `Cannot access path on non-object variable: ${varName}` };
18919
18919
  }
@@ -18969,11 +18969,11 @@ function resolveValue(expr, responses, variables, getValueByPath2, responseIndex
18969
18969
  }
18970
18970
  return { value: void 0, error: `Cannot resolve expression: ${trimmed}` };
18971
18971
  }
18972
- function getNestedValue2(obj, path9) {
18973
- if (!path9 || obj === null || obj === void 0) {
18972
+ function getNestedValue2(obj, path10) {
18973
+ if (!path10 || obj === null || obj === void 0) {
18974
18974
  return obj;
18975
18975
  }
18976
- const parts = path9.replace(/\[(\d+)\]/g, ".$1").split(".").filter((p) => p !== "");
18976
+ const parts = path10.replace(/\[(\d+)\]/g, ".$1").split(".").filter((p) => p !== "");
18977
18977
  let current = obj;
18978
18978
  for (const part of parts) {
18979
18979
  if (current === null || current === void 0) {
@@ -19769,16 +19769,16 @@ var init_source = __esm({
19769
19769
  });
19770
19770
 
19771
19771
  // src/cli.ts
19772
- var fs9 = __toESM(require("fs"));
19772
+ var fs10 = __toESM(require("fs"));
19773
19773
  var fsPromises = __toESM(require("fs/promises"));
19774
- var path8 = __toESM(require("path"));
19774
+ var path9 = __toESM(require("path"));
19775
19775
 
19776
19776
  // src/nornapiParser.ts
19777
- function extractPathParameters(path9) {
19777
+ function extractPathParameters(path10) {
19778
19778
  const params = [];
19779
19779
  const regex = /(?<!\{)\{([a-zA-Z_][a-zA-Z0-9_]*)\}(?!\})/g;
19780
19780
  let match;
19781
- while ((match = regex.exec(path9)) !== null) {
19781
+ while ((match = regex.exec(path10)) !== null) {
19782
19782
  params.push(match[1]);
19783
19783
  }
19784
19784
  return params;
@@ -19828,12 +19828,12 @@ function parseNornApiFile(content) {
19828
19828
  if (inEndpointsBlock) {
19829
19829
  const endpointMatch = trimmed.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\s*:\s*(GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS)\s+(.+)$/i);
19830
19830
  if (endpointMatch) {
19831
- const path9 = endpointMatch[3].trim();
19831
+ const path10 = endpointMatch[3].trim();
19832
19832
  endpoints.push({
19833
19833
  name: endpointMatch[1],
19834
19834
  method: endpointMatch[2].toUpperCase(),
19835
- path: path9,
19836
- parameters: extractPathParameters(path9)
19835
+ path: path10,
19836
+ parameters: extractPathParameters(path10)
19837
19837
  });
19838
19838
  }
19839
19839
  continue;
@@ -20123,11 +20123,11 @@ function extractFileLevelVariables(text) {
20123
20123
  }
20124
20124
  return variables;
20125
20125
  }
20126
- function getNestedValue(obj, path9) {
20127
- if (!path9 || obj === null || obj === void 0) {
20126
+ function getNestedValue(obj, path10) {
20127
+ if (!path10 || obj === null || obj === void 0) {
20128
20128
  return obj;
20129
20129
  }
20130
- const parts = path9.replace(/\[(\d+)\]/g, ".$1").split(".").filter((p) => p !== "");
20130
+ const parts = path10.replace(/\[(\d+)\]/g, ".$1").split(".").filter((p) => p !== "");
20131
20131
  let current = obj;
20132
20132
  for (const part of parts) {
20133
20133
  if (current === null || current === void 0) {
@@ -20159,8 +20159,8 @@ function substituteVariables(text, variables) {
20159
20159
  const value = variables[varName];
20160
20160
  if (typeof value === "object" && value !== null) {
20161
20161
  if (pathPart) {
20162
- const path9 = pathPart.replace(/^\./, "");
20163
- const nestedValue = getNestedValue(value, path9);
20162
+ const path10 = pathPart.replace(/^\./, "");
20163
+ const nestedValue = getNestedValue(value, path10);
20164
20164
  return valueToString(nestedValue);
20165
20165
  }
20166
20166
  return valueToString(value);
@@ -20168,8 +20168,8 @@ function substituteVariables(text, variables) {
20168
20168
  if (pathPart && typeof value === "string") {
20169
20169
  try {
20170
20170
  const parsed = JSON.parse(value);
20171
- const path9 = pathPart.replace(/^\./, "");
20172
- const nestedValue = getNestedValue(parsed, path9);
20171
+ const path10 = pathPart.replace(/^\./, "");
20172
+ const nestedValue = getNestedValue(parsed, path10);
20173
20173
  return valueToString(nestedValue);
20174
20174
  } catch {
20175
20175
  return value;
@@ -20285,8 +20285,8 @@ async function resolveImports(text, baseDir, readFile2, alreadyImported = /* @__
20285
20285
  const namedRequestSources = /* @__PURE__ */ new Map();
20286
20286
  const sequenceSources = /* @__PURE__ */ new Map();
20287
20287
  for (const imp of imports) {
20288
- const path9 = await import("path");
20289
- const absolutePath = path9.resolve(baseDir, imp.path);
20288
+ const path10 = await import("path");
20289
+ const absolutePath = path10.resolve(baseDir, imp.path);
20290
20290
  if (importStack.has(absolutePath)) {
20291
20291
  errors.push({
20292
20292
  path: imp.path,
@@ -20333,7 +20333,7 @@ async function resolveImports(text, baseDir, readFile2, alreadyImported = /* @__
20333
20333
  }
20334
20334
  continue;
20335
20335
  }
20336
- const importDir = path9.dirname(absolutePath);
20336
+ const importDir = path10.dirname(absolutePath);
20337
20337
  const nestedResult = await resolveImports(content, importDir, readFile2, alreadyImported, importStack);
20338
20338
  errors.push(...nestedResult.errors);
20339
20339
  resolvedPaths.push(...nestedResult.resolvedPaths);
@@ -20932,9 +20932,9 @@ function isVisitable(thing) {
20932
20932
  function removeBrackets(key) {
20933
20933
  return utils_default.endsWith(key, "[]") ? key.slice(0, -2) : key;
20934
20934
  }
20935
- function renderKey(path9, key, dots) {
20936
- if (!path9) return key;
20937
- return path9.concat(key).map(function each(token, i) {
20935
+ function renderKey(path10, key, dots) {
20936
+ if (!path10) return key;
20937
+ return path10.concat(key).map(function each(token, i) {
20938
20938
  token = removeBrackets(token);
20939
20939
  return !dots && i ? "[" + token + "]" : token;
20940
20940
  }).join(dots ? "." : "");
@@ -20982,9 +20982,9 @@ function toFormData(obj, formData, options) {
20982
20982
  }
20983
20983
  return value;
20984
20984
  }
20985
- function defaultVisitor(value, key, path9) {
20985
+ function defaultVisitor(value, key, path10) {
20986
20986
  let arr = value;
20987
- if (value && !path9 && typeof value === "object") {
20987
+ if (value && !path10 && typeof value === "object") {
20988
20988
  if (utils_default.endsWith(key, "{}")) {
20989
20989
  key = metaTokens ? key : key.slice(0, -2);
20990
20990
  value = JSON.stringify(value);
@@ -21003,7 +21003,7 @@ function toFormData(obj, formData, options) {
21003
21003
  if (isVisitable(value)) {
21004
21004
  return true;
21005
21005
  }
21006
- formData.append(renderKey(path9, key, dots), convertValue(value));
21006
+ formData.append(renderKey(path10, key, dots), convertValue(value));
21007
21007
  return false;
21008
21008
  }
21009
21009
  const stack = [];
@@ -21012,10 +21012,10 @@ function toFormData(obj, formData, options) {
21012
21012
  convertValue,
21013
21013
  isVisitable
21014
21014
  });
21015
- function build(value, path9) {
21015
+ function build(value, path10) {
21016
21016
  if (utils_default.isUndefined(value)) return;
21017
21017
  if (stack.indexOf(value) !== -1) {
21018
- throw Error("Circular reference detected in " + path9.join("."));
21018
+ throw Error("Circular reference detected in " + path10.join("."));
21019
21019
  }
21020
21020
  stack.push(value);
21021
21021
  utils_default.forEach(value, function each(el, key) {
@@ -21023,11 +21023,11 @@ function toFormData(obj, formData, options) {
21023
21023
  formData,
21024
21024
  el,
21025
21025
  utils_default.isString(key) ? key.trim() : key,
21026
- path9,
21026
+ path10,
21027
21027
  exposedHelpers
21028
21028
  );
21029
21029
  if (result === true) {
21030
- build(el, path9 ? path9.concat(key) : [key]);
21030
+ build(el, path10 ? path10.concat(key) : [key]);
21031
21031
  }
21032
21032
  });
21033
21033
  stack.pop();
@@ -21239,7 +21239,7 @@ var platform_default = {
21239
21239
  // node_modules/axios/lib/helpers/toURLEncodedForm.js
21240
21240
  function toURLEncodedForm(data, options) {
21241
21241
  return toFormData_default(data, new platform_default.classes.URLSearchParams(), {
21242
- visitor: function(value, key, path9, helpers) {
21242
+ visitor: function(value, key, path10, helpers) {
21243
21243
  if (platform_default.isNode && utils_default.isBuffer(value)) {
21244
21244
  this.append(key, value.toString("base64"));
21245
21245
  return false;
@@ -21269,11 +21269,11 @@ function arrayToObject(arr) {
21269
21269
  return obj;
21270
21270
  }
21271
21271
  function formDataToJSON(formData) {
21272
- function buildPath(path9, value, target, index) {
21273
- let name = path9[index++];
21272
+ function buildPath(path10, value, target, index) {
21273
+ let name = path10[index++];
21274
21274
  if (name === "__proto__") return true;
21275
21275
  const isNumericKey = Number.isFinite(+name);
21276
- const isLast = index >= path9.length;
21276
+ const isLast = index >= path10.length;
21277
21277
  name = !name && utils_default.isArray(target) ? target.length : name;
21278
21278
  if (isLast) {
21279
21279
  if (utils_default.hasOwnProp(target, name)) {
@@ -21286,7 +21286,7 @@ function formDataToJSON(formData) {
21286
21286
  if (!target[name] || !utils_default.isObject(target[name])) {
21287
21287
  target[name] = [];
21288
21288
  }
21289
- const result = buildPath(path9, value, target[name], index);
21289
+ const result = buildPath(path10, value, target[name], index);
21290
21290
  if (result && utils_default.isArray(target[name])) {
21291
21291
  target[name] = arrayToObject(target[name]);
21292
21292
  }
@@ -22608,9 +22608,9 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
22608
22608
  auth = urlUsername + ":" + urlPassword;
22609
22609
  }
22610
22610
  auth && headers.delete("authorization");
22611
- let path9;
22611
+ let path10;
22612
22612
  try {
22613
- path9 = buildURL(
22613
+ path10 = buildURL(
22614
22614
  parsed.pathname + parsed.search,
22615
22615
  config.params,
22616
22616
  config.paramsSerializer
@@ -22628,7 +22628,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
22628
22628
  false
22629
22629
  );
22630
22630
  const options = {
22631
- path: path9,
22631
+ path: path10,
22632
22632
  method,
22633
22633
  headers: headers.toJSON(),
22634
22634
  agents: { http: config.httpAgent, https: config.httpsAgent },
@@ -22864,14 +22864,14 @@ var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? /* @__PUR
22864
22864
  var cookies_default = platform_default.hasStandardBrowserEnv ? (
22865
22865
  // Standard browser envs support document.cookie
22866
22866
  {
22867
- write(name, value, expires, path9, domain, secure, sameSite) {
22867
+ write(name, value, expires, path10, domain, secure, sameSite) {
22868
22868
  if (typeof document === "undefined") return;
22869
22869
  const cookie = [`${name}=${encodeURIComponent(value)}`];
22870
22870
  if (utils_default.isNumber(expires)) {
22871
22871
  cookie.push(`expires=${new Date(expires).toUTCString()}`);
22872
22872
  }
22873
- if (utils_default.isString(path9)) {
22874
- cookie.push(`path=${path9}`);
22873
+ if (utils_default.isString(path10)) {
22874
+ cookie.push(`path=${path10}`);
22875
22875
  }
22876
22876
  if (utils_default.isString(domain)) {
22877
22877
  cookie.push(`domain=${domain}`);
@@ -24271,18 +24271,18 @@ var MemoryCookieStore = class extends Store {
24271
24271
  /**
24272
24272
  * @internal No doc because this is an overload that supports the implementation
24273
24273
  */
24274
- findCookie(domain, path9, key, callback) {
24274
+ findCookie(domain, path10, key, callback) {
24275
24275
  const promiseCallback = createPromiseCallback(callback);
24276
- if (domain == null || path9 == null || key == null) {
24276
+ if (domain == null || path10 == null || key == null) {
24277
24277
  return promiseCallback.resolve(void 0);
24278
24278
  }
24279
- const result = this.idx[domain]?.[path9]?.[key];
24279
+ const result = this.idx[domain]?.[path10]?.[key];
24280
24280
  return promiseCallback.resolve(result);
24281
24281
  }
24282
24282
  /**
24283
24283
  * @internal No doc because this is an overload that supports the implementation
24284
24284
  */
24285
- findCookies(domain, path9, allowSpecialUseDomain = false, callback) {
24285
+ findCookies(domain, path10, allowSpecialUseDomain = false, callback) {
24286
24286
  if (typeof allowSpecialUseDomain === "function") {
24287
24287
  callback = allowSpecialUseDomain;
24288
24288
  allowSpecialUseDomain = true;
@@ -24293,7 +24293,7 @@ var MemoryCookieStore = class extends Store {
24293
24293
  return promiseCallback.resolve([]);
24294
24294
  }
24295
24295
  let pathMatcher;
24296
- if (!path9) {
24296
+ if (!path10) {
24297
24297
  pathMatcher = function matchAll2(domainIndex) {
24298
24298
  for (const curPath in domainIndex) {
24299
24299
  const pathIndex = domainIndex[curPath];
@@ -24308,7 +24308,7 @@ var MemoryCookieStore = class extends Store {
24308
24308
  } else {
24309
24309
  pathMatcher = function matchRFC(domainIndex) {
24310
24310
  for (const cookiePath in domainIndex) {
24311
- if (pathMatch(path9, cookiePath)) {
24311
+ if (pathMatch(path10, cookiePath)) {
24312
24312
  const pathIndex = domainIndex[cookiePath];
24313
24313
  for (const key in pathIndex) {
24314
24314
  const value = pathIndex[key];
@@ -24336,14 +24336,14 @@ var MemoryCookieStore = class extends Store {
24336
24336
  */
24337
24337
  putCookie(cookie, callback) {
24338
24338
  const promiseCallback = createPromiseCallback(callback);
24339
- const { domain, path: path9, key } = cookie;
24340
- if (domain == null || path9 == null || key == null) {
24339
+ const { domain, path: path10, key } = cookie;
24340
+ if (domain == null || path10 == null || key == null) {
24341
24341
  return promiseCallback.resolve(void 0);
24342
24342
  }
24343
24343
  const domainEntry = this.idx[domain] ?? /* @__PURE__ */ Object.create(null);
24344
24344
  this.idx[domain] = domainEntry;
24345
- const pathEntry = domainEntry[path9] ?? /* @__PURE__ */ Object.create(null);
24346
- domainEntry[path9] = pathEntry;
24345
+ const pathEntry = domainEntry[path10] ?? /* @__PURE__ */ Object.create(null);
24346
+ domainEntry[path10] = pathEntry;
24347
24347
  pathEntry[key] = cookie;
24348
24348
  return promiseCallback.resolve(void 0);
24349
24349
  }
@@ -24357,20 +24357,20 @@ var MemoryCookieStore = class extends Store {
24357
24357
  /**
24358
24358
  * @internal No doc because this is an overload that supports the implementation
24359
24359
  */
24360
- removeCookie(domain, path9, key, callback) {
24360
+ removeCookie(domain, path10, key, callback) {
24361
24361
  const promiseCallback = createPromiseCallback(callback);
24362
- delete this.idx[domain]?.[path9]?.[key];
24362
+ delete this.idx[domain]?.[path10]?.[key];
24363
24363
  return promiseCallback.resolve(void 0);
24364
24364
  }
24365
24365
  /**
24366
24366
  * @internal No doc because this is an overload that supports the implementation
24367
24367
  */
24368
- removeCookies(domain, path9, callback) {
24368
+ removeCookies(domain, path10, callback) {
24369
24369
  const promiseCallback = createPromiseCallback(callback);
24370
24370
  const domainEntry = this.idx[domain];
24371
24371
  if (domainEntry) {
24372
- if (path9) {
24373
- delete domainEntry[path9];
24372
+ if (path10) {
24373
+ delete domainEntry[path10];
24374
24374
  } else {
24375
24375
  delete this.idx[domain];
24376
24376
  }
@@ -24396,8 +24396,8 @@ var MemoryCookieStore = class extends Store {
24396
24396
  domains.forEach((domain) => {
24397
24397
  const domainEntry = idx[domain] ?? {};
24398
24398
  const paths = Object.keys(domainEntry);
24399
- paths.forEach((path9) => {
24400
- const pathEntry = domainEntry[path9] ?? {};
24399
+ paths.forEach((path10) => {
24400
+ const pathEntry = domainEntry[path10] ?? {};
24401
24401
  const keys = Object.keys(pathEntry);
24402
24402
  keys.forEach((key) => {
24403
24403
  const keyEntry = pathEntry[key];
@@ -25281,18 +25281,18 @@ function cookieCompare(a, b) {
25281
25281
  cmp = (a.creationIndex || 0) - (b.creationIndex || 0);
25282
25282
  return cmp;
25283
25283
  }
25284
- function defaultPath(path9) {
25285
- if (!path9 || path9.slice(0, 1) !== "/") {
25284
+ function defaultPath(path10) {
25285
+ if (!path10 || path10.slice(0, 1) !== "/") {
25286
25286
  return "/";
25287
25287
  }
25288
- if (path9 === "/") {
25289
- return path9;
25288
+ if (path10 === "/") {
25289
+ return path10;
25290
25290
  }
25291
- const rightSlash = path9.lastIndexOf("/");
25291
+ const rightSlash = path10.lastIndexOf("/");
25292
25292
  if (rightSlash === 0) {
25293
25293
  return "/";
25294
25294
  }
25295
- return path9.slice(0, rightSlash);
25295
+ return path10.slice(0, rightSlash);
25296
25296
  }
25297
25297
  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}|:)))$)/;
25298
25298
  function domainMatch(domain, cookieDomain, canonicalize) {
@@ -25694,7 +25694,7 @@ var CookieJar = class _CookieJar {
25694
25694
  return promiseCallback.reject(parameterError);
25695
25695
  }
25696
25696
  const host = canonicalDomain(context.hostname);
25697
- const path9 = context.pathname || "/";
25697
+ const path10 = context.pathname || "/";
25698
25698
  const potentiallyTrustworthy = isPotentiallyTrustworthy(
25699
25699
  url2,
25700
25700
  this.allowSecureOnLocal
@@ -25725,7 +25725,7 @@ var CookieJar = class _CookieJar {
25725
25725
  return false;
25726
25726
  }
25727
25727
  }
25728
- if (!allPaths && typeof c.path === "string" && !pathMatch(path9, c.path)) {
25728
+ if (!allPaths && typeof c.path === "string" && !pathMatch(path10, c.path)) {
25729
25729
  return false;
25730
25730
  }
25731
25731
  if (c.secure && !potentiallyTrustworthy) {
@@ -25757,7 +25757,7 @@ var CookieJar = class _CookieJar {
25757
25757
  }
25758
25758
  store.findCookies(
25759
25759
  host,
25760
- allPaths ? null : path9,
25760
+ allPaths ? null : path10,
25761
25761
  this.allowSpecialUseDomain,
25762
25762
  (err, cookies) => {
25763
25763
  if (err) {
@@ -26785,11 +26785,11 @@ function readJsonFile(filePath, workingDir) {
26785
26785
  };
26786
26786
  }
26787
26787
  }
26788
- function setNestedValue(obj, path9, value) {
26789
- if (!path9 || obj === null || obj === void 0 || typeof obj !== "object") {
26788
+ function setNestedValue(obj, path10, value) {
26789
+ if (!path10 || obj === null || obj === void 0 || typeof obj !== "object") {
26790
26790
  return false;
26791
26791
  }
26792
- const parts = path9.replace(/\[(\d+)\]/g, ".$1").split(".").filter((p) => p !== "");
26792
+ const parts = path10.replace(/\[(\d+)\]/g, ".$1").split(".").filter((p) => p !== "");
26793
26793
  if (parts.length === 0) {
26794
26794
  return false;
26795
26795
  }
@@ -27291,8 +27291,8 @@ function bindSequenceArguments(params, args, runtimeVariables) {
27291
27291
  }
27292
27292
  return { variables: result };
27293
27293
  }
27294
- function getVariableValueByPath(path9, variables) {
27295
- const parts = path9.split(".");
27294
+ function getVariableValueByPath(path10, variables) {
27295
+ const parts = path10.split(".");
27296
27296
  let current = variables;
27297
27297
  for (const part of parts) {
27298
27298
  if (current === null || current === void 0) {
@@ -27657,8 +27657,8 @@ function evaluateValueExpression(expr, runtimeVariables) {
27657
27657
  } else {
27658
27658
  return { value: String(varValue), error: `Cannot access path on non-object value` };
27659
27659
  }
27660
- const path9 = pathPart.replace(/^\./, "").replace(/\[(\d+)\]/g, ".$1");
27661
- const parts = path9.split(".").filter((p) => p !== "");
27660
+ const path10 = pathPart.replace(/^\./, "").replace(/\[(\d+)\]/g, ".$1");
27661
+ const parts = path10.split(".").filter((p) => p !== "");
27662
27662
  let current = dataToNavigate;
27663
27663
  for (const part of parts) {
27664
27664
  if (current === null || current === void 0) {
@@ -27737,8 +27737,8 @@ function resolveBareVariables(text, variables) {
27737
27737
  if (varName in variables) {
27738
27738
  const value = variables[varName];
27739
27739
  if (pathPart) {
27740
- const path9 = pathPart.replace(/^\./, "");
27741
- const nestedValue = getNestedValueFromObject(value, path9);
27740
+ const path10 = pathPart.replace(/^\./, "");
27741
+ const nestedValue = getNestedValueFromObject(value, path10);
27742
27742
  return valueToString2(nestedValue);
27743
27743
  }
27744
27744
  return valueToString2(value);
@@ -27758,8 +27758,8 @@ function resolveBareVariables(text, variables) {
27758
27758
  if (varName in variables) {
27759
27759
  const value = variables[varName];
27760
27760
  if (pathPart) {
27761
- const path9 = pathPart.replace(/^\./, "");
27762
- return valueToString2(getNestedValueFromObject(value, path9));
27761
+ const path10 = pathPart.replace(/^\./, "");
27762
+ return valueToString2(getNestedValueFromObject(value, path10));
27763
27763
  }
27764
27764
  return valueToString2(value);
27765
27765
  }
@@ -27796,11 +27796,11 @@ function splitExpressionParts(expr) {
27796
27796
  }
27797
27797
  return parts;
27798
27798
  }
27799
- function getNestedValueFromObject(obj, path9) {
27800
- if (!path9) {
27799
+ function getNestedValueFromObject(obj, path10) {
27800
+ if (!path10) {
27801
27801
  return obj;
27802
27802
  }
27803
- const parts = path9.split(/\.|\[(\d+)\]/).filter((p) => p !== "" && p !== void 0);
27803
+ const parts = path10.split(/\.|\[(\d+)\]/).filter((p) => p !== "" && p !== void 0);
27804
27804
  let current = obj;
27805
27805
  for (const part of parts) {
27806
27806
  if (current === null || current === void 0) {
@@ -28145,24 +28145,24 @@ function extractCaptureDirectives(content) {
28145
28145
  for (const line2 of content.split("\n")) {
28146
28146
  const match = line2.trim().match(captureRegex);
28147
28147
  if (match) {
28148
- let path9 = match[3] || "";
28149
- if (path9.startsWith(".")) {
28150
- path9 = path9.substring(1);
28148
+ let path10 = match[3] || "";
28149
+ if (path10.startsWith(".")) {
28150
+ path10 = path10.substring(1);
28151
28151
  }
28152
28152
  captures.push({
28153
28153
  varName: match[1],
28154
28154
  afterRequest: parseInt(match[2], 10),
28155
- path: path9
28155
+ path: path10
28156
28156
  });
28157
28157
  }
28158
28158
  }
28159
28159
  return captures;
28160
28160
  }
28161
- function getValueByPath(response, path9) {
28162
- if (!path9) {
28161
+ function getValueByPath(response, path10) {
28162
+ if (!path10) {
28163
28163
  return void 0;
28164
28164
  }
28165
- const parts = path9.replace(/\[(\d+)\]/g, ".$1").split(".").filter((p) => p !== "");
28165
+ const parts = path10.replace(/\[(\d+)\]/g, ".$1").split(".").filter((p) => p !== "");
28166
28166
  if (parts.length === 0) {
28167
28167
  return void 0;
28168
28168
  }
@@ -28466,8 +28466,8 @@ async function runSequenceWithJar(sequenceContent, fileVariables, cookieJar, wor
28466
28466
  }
28467
28467
  }
28468
28468
  if (pathPart) {
28469
- const path9 = pathPart.replace(/^\./, "");
28470
- newValue = getNestedValueFromObject(value, path9);
28469
+ const path10 = pathPart.replace(/^\./, "");
28470
+ newValue = getNestedValueFromObject(value, path10);
28471
28471
  } else {
28472
28472
  newValue = value;
28473
28473
  }
@@ -28829,8 +28829,8 @@ ${indentMultiline(userMessage)}`;
28829
28829
  if (sequenceSources) {
28830
28830
  const sourceFile = sequenceSources.get(targetName.toLowerCase());
28831
28831
  if (sourceFile) {
28832
- const path9 = await import("path");
28833
- subWorkingDir = path9.dirname(sourceFile);
28832
+ const path10 = await import("path");
28833
+ subWorkingDir = path10.dirname(sourceFile);
28834
28834
  }
28835
28835
  }
28836
28836
  const subResult = await runSequenceWithJar(
@@ -29185,8 +29185,8 @@ ${indentMultiline(userMessage)}`;
29185
29185
  if (sequenceSources) {
29186
29186
  const sourceFile = sequenceSources.get(sequenceName.toLowerCase());
29187
29187
  if (sourceFile) {
29188
- const path9 = await import("path");
29189
- subWorkingDir = path9.dirname(sourceFile);
29188
+ const path10 = await import("path");
29189
+ subWorkingDir = path10.dirname(sourceFile);
29190
29190
  }
29191
29191
  }
29192
29192
  const subResult = await runSequenceWithJar(
@@ -30591,8 +30591,8 @@ function generateHtmlReportFromResponse(response, testName, options) {
30591
30591
  }
30592
30592
 
30593
30593
  // src/environmentParser.ts
30594
- var fs6 = __toESM(require("fs"));
30595
- var path5 = __toESM(require("path"));
30594
+ var fs7 = __toESM(require("fs"));
30595
+ var path6 = __toESM(require("path"));
30596
30596
 
30597
30597
  // src/secrets/crypto.ts
30598
30598
  var crypto2 = __toESM(require("crypto"));
@@ -30660,30 +30660,48 @@ function decryptSecretValue(encryptedValue, sharedKey) {
30660
30660
  }
30661
30661
 
30662
30662
  // src/secrets/keyStore.ts
30663
+ var fs6 = __toESM(require("fs"));
30664
+ var path5 = __toESM(require("path"));
30665
+
30666
+ // src/cacheDir.ts
30663
30667
  var fs5 = __toESM(require("fs"));
30664
30668
  var path4 = __toESM(require("path"));
30665
- var CACHE_DIR = ".norn-cache";
30669
+ var NORN_CACHE_DIR = ".norn-cache";
30670
+ var CACHE_GITIGNORE_FILE = ".gitignore";
30671
+ var CACHE_GITIGNORE_CONTENT = "*\n";
30672
+ function ensureNornCacheGitignore(cacheDir) {
30673
+ const gitignorePath = path4.join(cacheDir, CACHE_GITIGNORE_FILE);
30674
+ try {
30675
+ const hasDesiredContent = fs5.existsSync(gitignorePath) && fs5.readFileSync(gitignorePath, "utf8") === CACHE_GITIGNORE_CONTENT;
30676
+ if (hasDesiredContent) {
30677
+ return;
30678
+ }
30679
+ fs5.writeFileSync(gitignorePath, CACHE_GITIGNORE_CONTENT, "utf8");
30680
+ } catch {
30681
+ }
30682
+ }
30683
+
30684
+ // src/secrets/keyStore.ts
30666
30685
  var CACHE_FILE = "secret-keys.json";
30667
30686
  var CACHE_VERSION = 1;
30668
- var CACHE_GITIGNORE_RULE = ".norn-cache/";
30669
30687
  var sessionKeys = /* @__PURE__ */ new Map();
30670
30688
  function getSearchStartDirectory(targetPath) {
30671
- const resolvedPath = path4.resolve(targetPath);
30689
+ const resolvedPath = path5.resolve(targetPath);
30672
30690
  try {
30673
- const stats = fs5.statSync(resolvedPath);
30674
- return stats.isDirectory() ? resolvedPath : path4.dirname(resolvedPath);
30691
+ const stats = fs6.statSync(resolvedPath);
30692
+ return stats.isDirectory() ? resolvedPath : path5.dirname(resolvedPath);
30675
30693
  } catch {
30676
- return path4.dirname(resolvedPath);
30694
+ return path5.dirname(resolvedPath);
30677
30695
  }
30678
30696
  }
30679
30697
  function findExistingCacheDir(targetPath) {
30680
30698
  let dir = getSearchStartDirectory(targetPath);
30681
30699
  while (true) {
30682
- const cacheDir = path4.join(dir, CACHE_DIR);
30683
- if (fs5.existsSync(cacheDir) && fs5.statSync(cacheDir).isDirectory()) {
30700
+ const cacheDir = path5.join(dir, NORN_CACHE_DIR);
30701
+ if (fs6.existsSync(cacheDir) && fs6.statSync(cacheDir).isDirectory()) {
30684
30702
  return cacheDir;
30685
30703
  }
30686
- const parent = path4.dirname(dir);
30704
+ const parent = path5.dirname(dir);
30687
30705
  if (parent === dir) {
30688
30706
  return void 0;
30689
30707
  }
@@ -30692,67 +30710,24 @@ function findExistingCacheDir(targetPath) {
30692
30710
  }
30693
30711
  function ensureCacheDir(targetPath) {
30694
30712
  const existing = findExistingCacheDir(targetPath);
30695
- const cacheDir = existing ?? path4.join(getSearchStartDirectory(targetPath), CACHE_DIR);
30696
- if (!fs5.existsSync(cacheDir)) {
30697
- fs5.mkdirSync(cacheDir, { recursive: true });
30713
+ const cacheDir = existing ?? path5.join(getSearchStartDirectory(targetPath), NORN_CACHE_DIR);
30714
+ if (!fs6.existsSync(cacheDir)) {
30715
+ fs6.mkdirSync(cacheDir, { recursive: true });
30698
30716
  }
30717
+ ensureNornCacheGitignore(cacheDir);
30699
30718
  return cacheDir;
30700
30719
  }
30701
30720
  function getCachePath(targetPath) {
30702
30721
  const cacheDir = ensureCacheDir(targetPath);
30703
- return path4.join(cacheDir, CACHE_FILE);
30704
- }
30705
- function findGitRepositoryRoot(targetPath) {
30706
- let dir = getSearchStartDirectory(targetPath);
30707
- while (true) {
30708
- const gitPath = path4.join(dir, ".git");
30709
- if (fs5.existsSync(gitPath)) {
30710
- return dir;
30711
- }
30712
- const parent = path4.dirname(dir);
30713
- if (parent === dir) {
30714
- return void 0;
30715
- }
30716
- dir = parent;
30717
- }
30718
- }
30719
- function lineIgnoresNornCache(line2) {
30720
- const trimmed = line2.trim();
30721
- if (trimmed === "" || trimmed.startsWith("#") || trimmed.startsWith("!")) {
30722
- return false;
30723
- }
30724
- return /(^|\/)\.norn-cache\/?$/.test(trimmed);
30725
- }
30726
- function ensureNornCacheGitIgnored(targetPath) {
30727
- const repoRoot = findGitRepositoryRoot(targetPath);
30728
- if (!repoRoot) {
30729
- return;
30730
- }
30731
- const gitignorePath = path4.join(repoRoot, ".gitignore");
30732
- let current = "";
30733
- try {
30734
- if (fs5.existsSync(gitignorePath)) {
30735
- current = fs5.readFileSync(gitignorePath, "utf8");
30736
- const lines = current.split(/\r?\n/);
30737
- if (lines.some(lineIgnoresNornCache)) {
30738
- return;
30739
- }
30740
- }
30741
- const prefix = current.length > 0 && !current.endsWith("\n") ? "\n" : "";
30742
- const addition = `${prefix}# Norn cache
30743
- ${CACHE_GITIGNORE_RULE}
30744
- `;
30745
- fs5.writeFileSync(gitignorePath, current + addition, "utf8");
30746
- } catch {
30747
- }
30722
+ return path5.join(cacheDir, CACHE_FILE);
30748
30723
  }
30749
30724
  function readCache(targetPath) {
30750
30725
  const cachePath = getCachePath(targetPath);
30751
- if (!fs5.existsSync(cachePath)) {
30726
+ if (!fs6.existsSync(cachePath)) {
30752
30727
  return { version: CACHE_VERSION, keys: {} };
30753
30728
  }
30754
30729
  try {
30755
- const parsed = JSON.parse(fs5.readFileSync(cachePath, "utf8"));
30730
+ const parsed = JSON.parse(fs6.readFileSync(cachePath, "utf8"));
30756
30731
  if (parsed.version !== CACHE_VERSION || typeof parsed.keys !== "object" || parsed.keys === null) {
30757
30732
  return { version: CACHE_VERSION, keys: {} };
30758
30733
  }
@@ -30763,9 +30738,9 @@ function readCache(targetPath) {
30763
30738
  }
30764
30739
  function writeCache(targetPath, cache) {
30765
30740
  const cachePath = getCachePath(targetPath);
30766
- fs5.writeFileSync(cachePath, JSON.stringify(cache, null, 2), { encoding: "utf8", mode: 384 });
30741
+ fs6.writeFileSync(cachePath, JSON.stringify(cache, null, 2), { encoding: "utf8", mode: 384 });
30767
30742
  try {
30768
- fs5.chmodSync(cachePath, 384);
30743
+ fs6.chmodSync(cachePath, 384);
30769
30744
  } catch {
30770
30745
  }
30771
30746
  }
@@ -30818,7 +30793,6 @@ function setSessionSecretKey(kid, key) {
30818
30793
  sessionKeys.set(kid, key);
30819
30794
  }
30820
30795
  function saveSecretKeyToCache(kid, key, targetPath) {
30821
- ensureNornCacheGitIgnored(targetPath);
30822
30796
  const cache = readCache(targetPath);
30823
30797
  cache.keys[kid] = {
30824
30798
  value: key,
@@ -30922,22 +30896,22 @@ function parseEnvFile(content, sourceFilePath) {
30922
30896
  return config;
30923
30897
  }
30924
30898
  function getEnvSearchStartDirectory(targetPath) {
30925
- const resolvedPath = path5.resolve(targetPath);
30899
+ const resolvedPath = path6.resolve(targetPath);
30926
30900
  try {
30927
- const stats = fs6.statSync(resolvedPath);
30928
- return stats.isDirectory() ? resolvedPath : path5.dirname(resolvedPath);
30901
+ const stats = fs7.statSync(resolvedPath);
30902
+ return stats.isDirectory() ? resolvedPath : path6.dirname(resolvedPath);
30929
30903
  } catch {
30930
- return path5.dirname(resolvedPath);
30904
+ return path6.dirname(resolvedPath);
30931
30905
  }
30932
30906
  }
30933
30907
  function findEnvFileFromPath(filePath) {
30934
30908
  let dir = getEnvSearchStartDirectory(filePath);
30935
30909
  while (true) {
30936
- const envPath = path5.join(dir, ENV_FILENAME);
30937
- if (fs6.existsSync(envPath)) {
30910
+ const envPath = path6.join(dir, ENV_FILENAME);
30911
+ if (fs7.existsSync(envPath)) {
30938
30912
  return envPath;
30939
30913
  }
30940
- const parentDir = path5.dirname(dir);
30914
+ const parentDir = path6.dirname(dir);
30941
30915
  if (parentDir === dir) {
30942
30916
  break;
30943
30917
  }
@@ -30962,7 +30936,7 @@ function resolveNornenvImports(config, baseDir, entryFilePath, readFile2, import
30962
30936
  }
30963
30937
  for (const imp of config.imports) {
30964
30938
  const resolvedImportPath = resolveImportPath(imp.path, baseDir);
30965
- if (!resolvedImportPath || !fs6.existsSync(resolvedImportPath)) {
30939
+ if (!resolvedImportPath || !fs7.existsSync(resolvedImportPath)) {
30966
30940
  errors.push({
30967
30941
  message: `Imported file not found: '${imp.path}'`,
30968
30942
  filePath: entryFilePath,
@@ -30978,10 +30952,10 @@ function resolveNornenvImports(config, baseDir, entryFilePath, readFile2, import
30978
30952
  });
30979
30953
  continue;
30980
30954
  }
30981
- const normalizedPath = path5.resolve(resolvedImportPath);
30955
+ const normalizedPath = path6.resolve(resolvedImportPath);
30982
30956
  if (stack.includes(normalizedPath)) {
30983
- const entryDir = path5.dirname(stack[0]);
30984
- const cycle = [...stack, normalizedPath].map((p) => path5.relative(entryDir, p) || path5.basename(p)).join(" \u2192 ");
30957
+ const entryDir = path6.dirname(stack[0]);
30958
+ const cycle = [...stack, normalizedPath].map((p) => path6.relative(entryDir, p) || path6.basename(p)).join(" \u2192 ");
30985
30959
  errors.push({
30986
30960
  message: `Circular import detected: ${cycle}`,
30987
30961
  filePath: entryFilePath,
@@ -31010,7 +30984,7 @@ function resolveNornenvImports(config, baseDir, entryFilePath, readFile2, import
31010
30984
  if (importedConfig.imports.length > 0) {
31011
30985
  const childResult = resolveNornenvImports(
31012
30986
  importedConfig,
31013
- path5.dirname(normalizedPath),
30987
+ path6.dirname(normalizedPath),
31014
30988
  normalizedPath,
31015
30989
  readFile2,
31016
30990
  [...stack, normalizedPath],
@@ -31028,7 +31002,7 @@ function resolveNornenvImports(config, baseDir, entryFilePath, readFile2, import
31028
31002
  }
31029
31003
  function resolveImportPath(importPath, baseDir) {
31030
31004
  const cleaned = importPath.replace(/^["']|["']$/g, "");
31031
- return path5.resolve(baseDir, cleaned);
31005
+ return path6.resolve(baseDir, cleaned);
31032
31006
  }
31033
31007
  function registerVariableOrigins(config, filePath, origins) {
31034
31008
  for (const varName of Object.keys(config.common)) {
@@ -31092,12 +31066,12 @@ function mergeConfigs(target, source, targetFilePath, sourceFilePath, variableOr
31092
31066
  }
31093
31067
  }
31094
31068
  function toDisplayPath(filePath, entryFilePath) {
31095
- const entryDir = path5.dirname(entryFilePath);
31096
- const relative4 = path5.relative(entryDir, filePath);
31097
- return relative4 && relative4 !== "" ? relative4 : path5.basename(filePath);
31069
+ const entryDir = path6.dirname(entryFilePath);
31070
+ const relative4 = path6.relative(entryDir, filePath);
31071
+ return relative4 && relative4 !== "" ? relative4 : path6.basename(filePath);
31098
31072
  }
31099
31073
  function loadAndResolveEnvFile(filePath) {
31100
- const content = fs6.readFileSync(filePath, "utf-8");
31074
+ const content = fs7.readFileSync(filePath, "utf-8");
31101
31075
  const config = parseEnvFile(content, filePath);
31102
31076
  if (config.imports.length === 0) {
31103
31077
  const secretErrors = resolveEncryptedSecretValues(config, filePath);
@@ -31105,9 +31079,9 @@ function loadAndResolveEnvFile(filePath) {
31105
31079
  }
31106
31080
  const result = resolveNornenvImports(
31107
31081
  config,
31108
- path5.dirname(filePath),
31082
+ path6.dirname(filePath),
31109
31083
  filePath,
31110
- (p) => fs6.readFileSync(p, "utf-8")
31084
+ (p) => fs7.readFileSync(p, "utf-8")
31111
31085
  );
31112
31086
  result.secretErrors.push(...resolveEncryptedSecretValues(result.config, filePath));
31113
31087
  return result;
@@ -31173,14 +31147,14 @@ function resolveEncryptedSecretValues(config, entryFilePath) {
31173
31147
  }
31174
31148
 
31175
31149
  // src/secrets/cliSecrets.ts
31176
- var fs8 = __toESM(require("fs"));
31177
- var path7 = __toESM(require("path"));
31150
+ var fs9 = __toESM(require("fs"));
31151
+ var path8 = __toESM(require("path"));
31178
31152
  var readline = __toESM(require("readline"));
31179
31153
  var import_process = require("process");
31180
31154
 
31181
31155
  // src/secrets/envFileSecrets.ts
31182
- var fs7 = __toESM(require("fs"));
31183
- var path6 = __toESM(require("path"));
31156
+ var fs8 = __toESM(require("fs"));
31157
+ var path7 = __toESM(require("path"));
31184
31158
  var envRegex2 = /^\s*\[env:([a-zA-Z_][a-zA-Z0-9_-]*)\]\s*$/;
31185
31159
  var secretRegex2 = /^(\s*secret\s+)([a-zA-Z_][a-zA-Z0-9_]*)(\s*=\s*)(.+)$/;
31186
31160
  function extractSecretLines(content, filePath) {
@@ -31248,7 +31222,7 @@ function findSecretLine(content, variableName, envName) {
31248
31222
  return secretLines.find((secret) => secret.name === variableName);
31249
31223
  }
31250
31224
  function loadSecretLine(filePath, variableName, envName) {
31251
- const content = fs7.readFileSync(filePath, "utf8");
31225
+ const content = fs8.readFileSync(filePath, "utf8");
31252
31226
  const secret = findSecretLine(content, variableName, envName);
31253
31227
  if (!secret) {
31254
31228
  const envLabel = envName ? ` in [env:${envName}]` : "";
@@ -31257,22 +31231,22 @@ function loadSecretLine(filePath, variableName, envName) {
31257
31231
  return { content, secret };
31258
31232
  }
31259
31233
  function writeSecretLine(filePath, content) {
31260
- fs7.writeFileSync(filePath, content, "utf8");
31234
+ fs8.writeFileSync(filePath, content, "utf8");
31261
31235
  }
31262
31236
  function discoverNornenvFiles(targetPath) {
31263
- const resolved = path6.resolve(targetPath);
31264
- if (!fs7.existsSync(resolved)) {
31237
+ const resolved = path7.resolve(targetPath);
31238
+ if (!fs8.existsSync(resolved)) {
31265
31239
  return [];
31266
31240
  }
31267
- const stats = fs7.statSync(resolved);
31241
+ const stats = fs8.statSync(resolved);
31268
31242
  if (stats.isFile()) {
31269
- return path6.basename(resolved) === ".nornenv" ? [resolved] : [];
31243
+ return path7.basename(resolved) === ".nornenv" ? [resolved] : [];
31270
31244
  }
31271
31245
  const results = [];
31272
31246
  const walk = (dir) => {
31273
- const entries = fs7.readdirSync(dir, { withFileTypes: true });
31247
+ const entries = fs8.readdirSync(dir, { withFileTypes: true });
31274
31248
  for (const entry of entries) {
31275
- const fullPath = path6.join(dir, entry.name);
31249
+ const fullPath = path7.join(dir, entry.name);
31276
31250
  if (entry.isDirectory()) {
31277
31251
  if (entry.name === "node_modules" || entry.name === ".git" || entry.name === "dist" || entry.name === "out") {
31278
31252
  continue;
@@ -31331,8 +31305,8 @@ function formatSecretError(err, envFilePath) {
31331
31305
  if (!envFilePath) {
31332
31306
  return `${err.message}`;
31333
31307
  }
31334
- const relative4 = path7.relative(path7.dirname(envFilePath), err.filePath);
31335
- const fileLabel = relative4 && relative4 !== "" ? relative4 : path7.basename(err.filePath);
31308
+ const relative4 = path8.relative(path8.dirname(envFilePath), err.filePath);
31309
+ const fileLabel = relative4 && relative4 !== "" ? relative4 : path8.basename(err.filePath);
31336
31310
  const lineLabel = err.line >= 0 ? `${fileLabel}:${err.line + 1}` : fileLabel;
31337
31311
  return `${lineLabel} - ${err.message}`;
31338
31312
  }
@@ -31428,7 +31402,7 @@ async function handleEncrypt(args) {
31428
31402
  console.error(`Error: encrypt requires --file and --var.`);
31429
31403
  return 1;
31430
31404
  }
31431
- const absoluteFilePath = path7.resolve(filePath);
31405
+ const absoluteFilePath = path8.resolve(filePath);
31432
31406
  const { content, secret } = loadSecretLine(absoluteFilePath, variableName, envName);
31433
31407
  if (secret.encrypted) {
31434
31408
  console.error(`Error: Secret '${variableName}' is already encrypted. Use rotate instead.`);
@@ -31460,7 +31434,7 @@ async function handleRotate(args) {
31460
31434
  console.error(`Error: rotate requires --file and --var.`);
31461
31435
  return 1;
31462
31436
  }
31463
- const absoluteFilePath = path7.resolve(filePath);
31437
+ const absoluteFilePath = path8.resolve(filePath);
31464
31438
  const { content, secret } = loadSecretLine(absoluteFilePath, variableName, envName);
31465
31439
  let kid = explicitKid;
31466
31440
  if (!kid && secret.encrypted) {
@@ -31491,7 +31465,7 @@ async function handleRotate(args) {
31491
31465
  }
31492
31466
  async function handleRekey(args) {
31493
31467
  const positional = args.filter((arg) => !arg.startsWith("-"));
31494
- const targetPath = positional[0] ? path7.resolve(positional[0]) : process.cwd();
31468
+ const targetPath = positional[0] ? path8.resolve(positional[0]) : process.cwd();
31495
31469
  const targetKid = getFlagValue(args, "--kid");
31496
31470
  const files = discoverNornenvFiles(targetPath);
31497
31471
  if (files.length === 0) {
@@ -31501,7 +31475,7 @@ async function handleRekey(args) {
31501
31475
  let updatedFiles = 0;
31502
31476
  let updatedSecrets = 0;
31503
31477
  for (const filePath of files) {
31504
- const original = fs8.readFileSync(filePath, "utf8");
31478
+ const original = fs9.readFileSync(filePath, "utf8");
31505
31479
  const secretLines = extractSecretLines(original, filePath);
31506
31480
  if (secretLines.length === 0) {
31507
31481
  continue;
@@ -31552,7 +31526,7 @@ async function handleRekey(args) {
31552
31526
  updatedSecrets += 1;
31553
31527
  }
31554
31528
  if (updated !== original) {
31555
- fs8.writeFileSync(filePath, updated, "utf8");
31529
+ fs9.writeFileSync(filePath, updated, "utf8");
31556
31530
  updatedFiles += 1;
31557
31531
  }
31558
31532
  }
@@ -31561,7 +31535,7 @@ async function handleRekey(args) {
31561
31535
  }
31562
31536
  async function handleAudit(args) {
31563
31537
  const positional = args.filter((arg) => !arg.startsWith("-"));
31564
- const targetPath = positional[0] ? path7.resolve(positional[0]) : process.cwd();
31538
+ const targetPath = positional[0] ? path8.resolve(positional[0]) : process.cwd();
31565
31539
  const files = discoverNornenvFiles(targetPath);
31566
31540
  if (files.length === 0) {
31567
31541
  console.log(`No .nornenv files found under ${targetPath}`);
@@ -31569,7 +31543,7 @@ async function handleAudit(args) {
31569
31543
  }
31570
31544
  const issues = [];
31571
31545
  for (const filePath of files) {
31572
- const content = fs8.readFileSync(filePath, "utf8");
31546
+ const content = fs9.readFileSync(filePath, "utf8");
31573
31547
  const secrets = extractSecretLines(content, filePath);
31574
31548
  for (const secret of secrets) {
31575
31549
  if (!secret.encrypted) {
@@ -31656,9 +31630,9 @@ function printSecretResolutionErrors(errors, envFilePath) {
31656
31630
 
31657
31631
  // src/cli.ts
31658
31632
  function formatNornenvErrorLocation(rootEnvFilePath, errorFilePath, line2) {
31659
- const baseDir = path8.dirname(rootEnvFilePath);
31660
- const relativePath = path8.relative(baseDir, errorFilePath);
31661
- const fileLabel = relativePath && relativePath !== "" ? relativePath : path8.basename(errorFilePath);
31633
+ const baseDir = path9.dirname(rootEnvFilePath);
31634
+ const relativePath = path9.relative(baseDir, errorFilePath);
31635
+ const fileLabel = relativePath && relativePath !== "" ? relativePath : path9.basename(errorFilePath);
31662
31636
  return line2 >= 0 ? `${fileLabel}:${line2 + 1}` : fileLabel;
31663
31637
  }
31664
31638
  function resolveEnvironmentForPath(targetPath, selectedEnv) {
@@ -31740,10 +31714,10 @@ function generateTimestamp() {
31740
31714
  return `${year}-${month}-${day}-${hours}${minutes}${seconds}`;
31741
31715
  }
31742
31716
  function generateReportPaths(outputDir, inputFile, timestamp) {
31743
- const baseName = path8.basename(inputFile, path8.extname(inputFile));
31717
+ const baseName = path9.basename(inputFile, path9.extname(inputFile));
31744
31718
  return {
31745
- junitPath: path8.join(outputDir, `${baseName}-${timestamp}-results.xml`),
31746
- htmlPath: path8.join(outputDir, `${baseName}-${timestamp}-report.html`)
31719
+ junitPath: path9.join(outputDir, `${baseName}-${timestamp}-results.xml`),
31720
+ htmlPath: path9.join(outputDir, `${baseName}-${timestamp}-report.html`)
31747
31721
  };
31748
31722
  }
31749
31723
  function parseArgs(args) {
@@ -32011,9 +31985,9 @@ async function runSingleRequest(fileContent, variables, cookieJar, apiDefinition
32011
31985
  function discoverNornFiles(dirPath) {
32012
31986
  const files = [];
32013
31987
  function walkDir(currentPath) {
32014
- const entries = fs9.readdirSync(currentPath, { withFileTypes: true });
31988
+ const entries = fs10.readdirSync(currentPath, { withFileTypes: true });
32015
31989
  for (const entry of entries) {
32016
- const fullPath = path8.join(currentPath, entry.name);
31990
+ const fullPath = path9.join(currentPath, entry.name);
32017
31991
  if (entry.isDirectory()) {
32018
31992
  if (!entry.name.startsWith(".") && entry.name !== "node_modules") {
32019
31993
  walkDir(fullPath);
@@ -32033,7 +32007,7 @@ function countTestSequences(fileContent, tagFilterOptions) {
32033
32007
  return { total: testSequences.length, filtered };
32034
32008
  }
32035
32009
  async function loadTheoryFile(theoryPath, workingDir) {
32036
- const absolutePath = path8.resolve(workingDir, theoryPath);
32010
+ const absolutePath = path9.resolve(workingDir, theoryPath);
32037
32011
  const content = await fsPromises.readFile(absolutePath, "utf-8");
32038
32012
  return JSON.parse(content);
32039
32013
  }
@@ -32152,12 +32126,12 @@ async function main() {
32152
32126
  if (options.insecure) {
32153
32127
  console.error(colors.warning("Warning: TLS certificate verification is disabled (--insecure). Use this only for local development."));
32154
32128
  }
32155
- const inputPath = path8.resolve(options.file);
32156
- if (!fs9.existsSync(inputPath)) {
32129
+ const inputPath = path9.resolve(options.file);
32130
+ if (!fs10.existsSync(inputPath)) {
32157
32131
  console.error(`Error: Path not found: ${inputPath}`);
32158
32132
  process.exit(1);
32159
32133
  }
32160
- const isDirectory = fs9.statSync(inputPath).isDirectory();
32134
+ const isDirectory = fs10.statSync(inputPath).isDirectory();
32161
32135
  let filesToRun;
32162
32136
  if (isDirectory) {
32163
32137
  filesToRun = discoverNornFiles(inputPath);
@@ -32224,11 +32198,11 @@ async function main() {
32224
32198
  }
32225
32199
  mergeSecrets(combinedSecretNames, combinedSecretValues, resolvedEnv.secretNames, resolvedEnv.secretValues);
32226
32200
  const redaction2 = createRedactionOptions(combinedSecretNames, combinedSecretValues, !options.noRedact);
32227
- const fileContent = fs9.readFileSync(filePath, "utf-8");
32201
+ const fileContent = fs10.readFileSync(filePath, "utf-8");
32228
32202
  const fileVariables = extractFileLevelVariables(fileContent);
32229
32203
  const variables = { ...resolvedEnv.variables, ...fileVariables };
32230
32204
  const cookieJar = createCookieJar();
32231
- const workingDir = path8.dirname(filePath);
32205
+ const workingDir = path9.dirname(filePath);
32232
32206
  const importResult = await resolveImports(
32233
32207
  fileContent,
32234
32208
  workingDir,
@@ -32329,7 +32303,7 @@ ${fileContent}` : fileContent;
32329
32303
  let totalTestCount = 0;
32330
32304
  let filteredTestCount = 0;
32331
32305
  for (const filePath of filesToRun) {
32332
- const fileContent = fs9.readFileSync(filePath, "utf-8");
32306
+ const fileContent = fs10.readFileSync(filePath, "utf-8");
32333
32307
  const counts = countTestSequences(fileContent, tagFilterOptions);
32334
32308
  totalTestCount += counts.total;
32335
32309
  filteredTestCount += counts.filtered;
@@ -32371,16 +32345,16 @@ ${fileContent}` : fileContent;
32371
32345
  process.exit(1);
32372
32346
  }
32373
32347
  if (!resolvedEnv.envFilePath && options.env) {
32374
- const relPath = isDirectory ? path8.relative(inputPath, filePath) : path8.basename(filePath);
32348
+ const relPath = isDirectory ? path9.relative(inputPath, filePath) : path9.basename(filePath);
32375
32349
  console.error(colors.warning(`Warning: --env specified but no .nornenv file found for ${relPath}`));
32376
32350
  }
32377
32351
  mergeSecrets(combinedSecretNames, combinedSecretValues, resolvedEnv.secretNames, resolvedEnv.secretValues);
32378
32352
  const redaction2 = createRedactionOptions(combinedSecretNames, combinedSecretValues, !options.noRedact);
32379
- const fileContent = fs9.readFileSync(filePath, "utf-8");
32353
+ const fileContent = fs10.readFileSync(filePath, "utf-8");
32380
32354
  const fileVariables = extractFileLevelVariables(fileContent);
32381
32355
  const variables = { ...resolvedEnv.variables, ...fileVariables };
32382
32356
  const cookieJar = createCookieJar();
32383
- const workingDir = path8.dirname(filePath);
32357
+ const workingDir = path9.dirname(filePath);
32384
32358
  const importResult = await resolveImports(
32385
32359
  fileContent,
32386
32360
  workingDir,
@@ -32412,7 +32386,7 @@ ${fileContent}` : fileContent;
32412
32386
  continue;
32413
32387
  }
32414
32388
  if (isDirectory && options.output !== "json") {
32415
- const relPath = path8.relative(inputPath, filePath);
32389
+ const relPath = path9.relative(inputPath, filePath);
32416
32390
  console.log(colors.info(`
32417
32391
  \u2501\u2501\u2501 ${relPath} \u2501\u2501\u2501`));
32418
32392
  }
@@ -32456,7 +32430,7 @@ ${fileContent}` : fileContent;
32456
32430
  let htmlOutputPath = options.htmlOutput;
32457
32431
  if (options.outputDir) {
32458
32432
  const timestamp = generateTimestamp();
32459
- const baseName = isDirectory ? path8.basename(inputPath) : path8.basename(inputPath, path8.extname(inputPath));
32433
+ const baseName = isDirectory ? path9.basename(inputPath) : path9.basename(inputPath, path9.extname(inputPath));
32460
32434
  const generatedPaths = generateReportPaths(options.outputDir, baseName + ".norn", timestamp);
32461
32435
  if (!junitOutputPath) {
32462
32436
  junitOutputPath = generatedPaths.junitPath;
@@ -32464,12 +32438,12 @@ ${fileContent}` : fileContent;
32464
32438
  if (!htmlOutputPath) {
32465
32439
  htmlOutputPath = generatedPaths.htmlPath;
32466
32440
  }
32467
- if (!fs9.existsSync(options.outputDir)) {
32468
- fs9.mkdirSync(options.outputDir, { recursive: true });
32441
+ if (!fs10.existsSync(options.outputDir)) {
32442
+ fs10.mkdirSync(options.outputDir, { recursive: true });
32469
32443
  }
32470
32444
  }
32471
32445
  if (junitOutputPath) {
32472
- const suiteName = isDirectory ? path8.basename(inputPath) : path8.basename(inputPath, path8.extname(inputPath));
32446
+ const suiteName = isDirectory ? path9.basename(inputPath) : path9.basename(inputPath, path9.extname(inputPath));
32473
32447
  if (result.type === "request") {
32474
32448
  generateJUnitReportFromResponse(
32475
32449
  result.results[0],
@@ -32485,11 +32459,11 @@ ${fileContent}` : fileContent;
32485
32459
  console.log(colors.info(`JUnit report written to: ${junitOutputPath}`));
32486
32460
  }
32487
32461
  if (htmlOutputPath) {
32488
- const title = `Norn Test Report - ${path8.basename(inputPath)}`;
32462
+ const title = `Norn Test Report - ${path9.basename(inputPath)}`;
32489
32463
  if (result.type === "request") {
32490
32464
  generateHtmlReportFromResponse(
32491
32465
  result.results[0],
32492
- options.request || path8.basename(inputPath),
32466
+ options.request || path9.basename(inputPath),
32493
32467
  { outputPath: htmlOutputPath, redaction, title }
32494
32468
  );
32495
32469
  } else {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "norn-cli",
3
3
  "displayName": "Norn - REST Client",
4
4
  "description": "A powerful REST client for making HTTP requests with sequences, variables, scripts, and cookie support",
5
- "version": "1.5.3",
5
+ "version": "1.5.4",
6
6
  "publisher": "Norn-PeterKrustanov",
7
7
  "author": {
8
8
  "name": "Peter Krastanov"