norn-cli 1.3.2 → 1.3.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.
@@ -0,0 +1,33 @@
1
+ {
2
+ "version": 1,
3
+ "results": {
4
+ "tests/Regression/15-contract-validation.norn:15": {
5
+ "schemaPath": "tests/Regression/schemas/GET-todos-1.schema.json",
6
+ "sourceFile": "tests/Regression/15-contract-validation.norn",
7
+ "assertionLine": 15,
8
+ "status": "pass",
9
+ "lastRunTime": "2026-02-08T20:13:44.031Z"
10
+ },
11
+ "tests/Regression/15-contract-validation.norn:25": {
12
+ "schemaPath": "tests/Regression/schemas/GET-users-1.schema.json",
13
+ "sourceFile": "tests/Regression/15-contract-validation.norn",
14
+ "assertionLine": 25,
15
+ "status": "pass",
16
+ "lastRunTime": "2026-02-08T20:16:27.876Z"
17
+ },
18
+ "tests/Regression/15-contract-validation.norn:35": {
19
+ "schemaPath": "tests/Regression/schemas/GET-todos-1.schema.json",
20
+ "sourceFile": "tests/Regression/15-contract-validation.norn",
21
+ "assertionLine": 35,
22
+ "status": "pass",
23
+ "lastRunTime": "2026-02-08T20:17:12.506Z"
24
+ },
25
+ "tests/Regression/15-contract-validation.norn:39": {
26
+ "schemaPath": "tests/Regression/schemas/GET-todos-1.schema.json",
27
+ "sourceFile": "tests/Regression/15-contract-validation.norn",
28
+ "assertionLine": 39,
29
+ "status": "pass",
30
+ "lastRunTime": "2026-02-08T20:17:12.506Z"
31
+ }
32
+ }
33
+ }
package/CHANGELOG.md CHANGED
@@ -2,6 +2,25 @@
2
2
 
3
3
  All notable changes to the "Norn" extension will be documented in this file.
4
4
 
5
+ ## [1.3.4] - 2026-02-09
6
+
7
+ ### Fixed
8
+ - **Header Groups with Raw URLs**: Header groups now work with regular URL requests, not just endpoint syntax
9
+ - `GET https://example.com/api Json` now correctly applies the Json header group
10
+ - Header groups on separate lines after URL also work
11
+ - Both extension and CLI support this fix
12
+
13
+ ## [1.3.3] - 2026-02-08
14
+
15
+ ### Fixed
16
+ - **Contract View Panel**: Fixed webview rendering issue that showed raw JavaScript code
17
+ - Removed embedded script tags that broke HTML parsing
18
+ - "View Contract Details" button now works correctly
19
+ - **Contract View Styling**: Unified appearance with Contract Report
20
+ - Response JSON now has proper syntax highlighting (colored keys, strings, numbers)
21
+ - Schema JSON has consistent styling without background highlight artifacts
22
+ - **Gutter Decorations**: Removed contract gutter icons and line highlights for cleaner editor appearance
23
+
5
24
  ## [1.3.2] - 2026-02-08
6
25
 
7
26
  ### Improved
package/dist/cli.js CHANGED
@@ -26686,6 +26686,64 @@ function parsePropertyAssignment(line2) {
26686
26686
 
26687
26687
  // src/sequenceRunner.ts
26688
26688
  init_assertionRunner();
26689
+ function applyHeaderGroupsToRequest(parsed, requestText, headerGroups, variables) {
26690
+ const lines = requestText.split("\n");
26691
+ const headerGroupNames = headerGroups.map((hg) => hg.name);
26692
+ const headerGroupHeaders = {};
26693
+ const foundGroups = [];
26694
+ for (const line2 of lines) {
26695
+ const trimmed = line2.trim();
26696
+ if (!trimmed || trimmed.startsWith("#") || trimmed.startsWith("var ")) {
26697
+ continue;
26698
+ }
26699
+ const methodMatch = trimmed.match(/^(GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS)\s+(.+)$/i);
26700
+ if (methodMatch) {
26701
+ const afterMethod = methodMatch[2];
26702
+ const tokens = afterMethod.split(/\s+/);
26703
+ for (let i = tokens.length - 1; i >= 0; i--) {
26704
+ if (headerGroupNames.includes(tokens[i])) {
26705
+ foundGroups.push(tokens[i]);
26706
+ } else {
26707
+ break;
26708
+ }
26709
+ }
26710
+ continue;
26711
+ }
26712
+ if (/^[A-Za-z0-9\-_]+\s*:\s*.+$/.test(trimmed)) {
26713
+ continue;
26714
+ }
26715
+ if (trimmed.startsWith("{") || trimmed.startsWith("[") || trimmed.startsWith('"')) {
26716
+ continue;
26717
+ }
26718
+ const potentialGroups = trimmed.split(/\s+/);
26719
+ for (const groupName of potentialGroups) {
26720
+ if (headerGroupNames.includes(groupName)) {
26721
+ foundGroups.push(groupName);
26722
+ }
26723
+ }
26724
+ }
26725
+ for (const groupName of foundGroups) {
26726
+ const group = headerGroups.find((hg) => hg.name === groupName);
26727
+ if (group) {
26728
+ const resolvedHeaders = resolveHeaderValues(group, variables);
26729
+ Object.assign(headerGroupHeaders, resolvedHeaders);
26730
+ }
26731
+ }
26732
+ let modifiedUrl = parsed.url;
26733
+ for (const groupName of foundGroups) {
26734
+ const endPattern = new RegExp(`\\s+${groupName}$`);
26735
+ modifiedUrl = modifiedUrl.replace(endPattern, "");
26736
+ }
26737
+ modifiedUrl = modifiedUrl.trim();
26738
+ const result = {
26739
+ ...parsed,
26740
+ url: modifiedUrl
26741
+ };
26742
+ if (Object.keys(headerGroupHeaders).length > 0) {
26743
+ result.headers = { ...headerGroupHeaders, ...parsed.headers };
26744
+ }
26745
+ return result;
26746
+ }
26689
26747
  function isRunNamedRequestCommand(line2) {
26690
26748
  const trimmed = line2.trim();
26691
26749
  if (!trimmed.toLowerCase().startsWith("run ")) {
@@ -28721,10 +28779,16 @@ async function runSequenceWithJar(sequenceContent, fileVariables, cookieJar, wor
28721
28779
  } else {
28722
28780
  parsed = parserHttpRequest(step.content, runtimeVariables);
28723
28781
  requestDescription = `${parsed.method} ${parsed.url}`;
28782
+ if (apiDefinitions && apiDefinitions.headerGroups.length > 0) {
28783
+ parsed = applyHeaderGroupsToRequest(parsed, step.content, apiDefinitions.headerGroups, runtimeVariables);
28784
+ }
28724
28785
  }
28725
28786
  } else {
28726
28787
  parsed = parserHttpRequest(step.content, runtimeVariables);
28727
28788
  requestDescription = `${parsed.method} ${parsed.url}`;
28789
+ if (apiDefinitions && apiDefinitions.headerGroups.length > 0) {
28790
+ parsed = applyHeaderGroupsToRequest(parsed, step.content, apiDefinitions.headerGroups, runtimeVariables);
28791
+ }
28728
28792
  }
28729
28793
  const { retryCount, backoffMs } = extractRetryOptions(step.content);
28730
28794
  const retryOpts = retryCount ?? parsed.retryCount ? {
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.3.2",
5
+ "version": "1.3.4",
6
6
  "publisher": "Norn-PeterKrustanov",
7
7
  "author": {
8
8
  "name": "Peter Krastanov"