norn-cli 1.3.4 → 1.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  All notable changes to the "Norn" extension will be documented in this file.
4
4
 
5
+ ## [1.3.5] - 2026-02-09
6
+
7
+ ### Fixed
8
+ - **Endpoint Syntax Body Extraction**: Fixed form body not being sent with named requests using endpoint syntax
9
+ - `[PostFormWithEndpoint]` followed by `POST HttpBinPost Form` and body lines now works correctly
10
+ - Applies to standalone named requests (outside sequences) using `.nornapi` endpoints
11
+ - **Header Group Syntax Highlighting**: Fixed header group not showing green when on same line as URL
12
+ - `POST {{url}}/post Form` now correctly colors `Form` as header group
13
+
5
14
  ## [1.3.4] - 2026-02-09
6
15
 
7
16
  ### Fixed
@@ -9,6 +18,11 @@ All notable changes to the "Norn" extension will be documented in this file.
9
18
  - `GET https://example.com/api Json` now correctly applies the Json header group
10
19
  - Header groups on separate lines after URL also work
11
20
  - Both extension and CLI support this fix
21
+ - Named requests (`[RequestName]`) also support header groups with raw URLs
22
+ - **CLI Named Requests with Endpoints**: Fixed body not being sent when using endpoint syntax
23
+ - `POST HttpBinPost Form` with body lines now correctly sends the form data
24
+ - **Syntax Highlighting for Form Parameters**: Added proper coloring for URL-encoded form body parameters
25
+ - `firstname=Alice` now shows key as parameter (purple), `=` as operator, value as string
12
26
 
13
27
  ## [1.3.3] - 2026-02-08
14
28
 
package/dist/cli.js CHANGED
@@ -30296,13 +30296,55 @@ async function runSingleRequest(fileContent, variables, cookieJar, apiDefinition
30296
30296
  method: apiRequest.method,
30297
30297
  url: resolvedPath,
30298
30298
  headers: combinedHeaders,
30299
- body: void 0
30299
+ body: apiRequest.body
30300
30300
  };
30301
30301
  return await sendRequestWithJar(parsed2, cookieJar);
30302
30302
  }
30303
30303
  }
30304
30304
  }
30305
- const parsed = parserHttpRequest(requestContent, variables);
30305
+ let parsed = parserHttpRequest(requestContent, variables);
30306
+ if (apiDefinitions && apiDefinitions.headerGroups.length > 0) {
30307
+ const headerGroupNames = apiDefinitions.headerGroups.map((hg) => hg.name);
30308
+ const foundGroups = [];
30309
+ for (const line2 of requestLines) {
30310
+ const trimmed = line2.trim();
30311
+ if (!trimmed || trimmed.startsWith("#") || trimmed.startsWith("var ")) {
30312
+ continue;
30313
+ }
30314
+ const methodMatch = trimmed.match(/^(GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS)\s+(.+)$/i);
30315
+ if (methodMatch) {
30316
+ const afterMethod = methodMatch[2];
30317
+ const tokens = afterMethod.split(/\s+/);
30318
+ for (let i = tokens.length - 1; i >= 0; i--) {
30319
+ if (headerGroupNames.includes(tokens[i])) {
30320
+ foundGroups.push(tokens[i]);
30321
+ } else {
30322
+ break;
30323
+ }
30324
+ }
30325
+ continue;
30326
+ }
30327
+ if (/^[A-Za-z0-9\-_]+\s*:\s*.+$/.test(trimmed)) {
30328
+ continue;
30329
+ }
30330
+ const potentialGroups = trimmed.split(/\s+/);
30331
+ for (const groupName of potentialGroups) {
30332
+ if (headerGroupNames.includes(groupName)) {
30333
+ foundGroups.push(groupName);
30334
+ }
30335
+ }
30336
+ }
30337
+ for (const groupName of foundGroups) {
30338
+ const group = apiDefinitions.headerGroups.find((hg) => hg.name === groupName);
30339
+ if (group) {
30340
+ const resolvedHeaders = resolveHeaderValues(group, variables);
30341
+ parsed.headers = { ...resolvedHeaders, ...parsed.headers };
30342
+ }
30343
+ const endPattern = new RegExp(`\\s+${groupName}$`);
30344
+ parsed.url = parsed.url.replace(endPattern, "");
30345
+ }
30346
+ parsed.url = parsed.url.trim();
30347
+ }
30306
30348
  return await sendRequestWithJar(parsed, cookieJar);
30307
30349
  }
30308
30350
  function discoverNornFiles(dirPath) {
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.4",
5
+ "version": "1.3.5",
6
6
  "publisher": "Norn-PeterKrustanov",
7
7
  "author": {
8
8
  "name": "Peter Krastanov"