norn-cli 1.3.4 → 1.3.6
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 +21 -0
- package/dist/cli.js +50 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to the "Norn" extension will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [1.3.6] - 2026-02-09
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- **Empty Array and Object Assertions**: Support for asserting against empty literals
|
|
9
|
+
- `assert $1.body.items == []` now works for empty array comparison
|
|
10
|
+
- `assert $1.body.data == {}` now works for empty object comparison
|
|
11
|
+
|
|
12
|
+
## [1.3.5] - 2026-02-09
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
- **Endpoint Syntax Body Extraction**: Fixed form body not being sent with named requests using endpoint syntax
|
|
16
|
+
- `[PostFormWithEndpoint]` followed by `POST HttpBinPost Form` and body lines now works correctly
|
|
17
|
+
- Applies to standalone named requests (outside sequences) using `.nornapi` endpoints
|
|
18
|
+
- **Header Group Syntax Highlighting**: Fixed header group not showing green when on same line as URL
|
|
19
|
+
- `POST {{url}}/post Form` now correctly colors `Form` as header group
|
|
20
|
+
|
|
5
21
|
## [1.3.4] - 2026-02-09
|
|
6
22
|
|
|
7
23
|
### Fixed
|
|
@@ -9,6 +25,11 @@ All notable changes to the "Norn" extension will be documented in this file.
|
|
|
9
25
|
- `GET https://example.com/api Json` now correctly applies the Json header group
|
|
10
26
|
- Header groups on separate lines after URL also work
|
|
11
27
|
- Both extension and CLI support this fix
|
|
28
|
+
- Named requests (`[RequestName]`) also support header groups with raw URLs
|
|
29
|
+
- **CLI Named Requests with Endpoints**: Fixed body not being sent when using endpoint syntax
|
|
30
|
+
- `POST HttpBinPost Form` with body lines now correctly sends the form data
|
|
31
|
+
- **Syntax Highlighting for Form Parameters**: Added proper coloring for URL-encoded form body parameters
|
|
32
|
+
- `firstname=Alice` now shows key as parameter (purple), `=` as operator, value as string
|
|
12
33
|
|
|
13
34
|
## [1.3.3] - 2026-02-08
|
|
14
35
|
|
package/dist/cli.js
CHANGED
|
@@ -18961,6 +18961,12 @@ function resolveValue(expr, responses, variables, getValueByPath2, responseIndex
|
|
|
18961
18961
|
if (trimmed.toLowerCase() === "null") {
|
|
18962
18962
|
return { value: null };
|
|
18963
18963
|
}
|
|
18964
|
+
if (trimmed === "[]") {
|
|
18965
|
+
return { value: [] };
|
|
18966
|
+
}
|
|
18967
|
+
if (trimmed === "{}") {
|
|
18968
|
+
return { value: {} };
|
|
18969
|
+
}
|
|
18964
18970
|
return { value: void 0, error: `Cannot resolve expression: ${trimmed}` };
|
|
18965
18971
|
}
|
|
18966
18972
|
function getNestedValue2(obj, path5) {
|
|
@@ -30296,13 +30302,55 @@ async function runSingleRequest(fileContent, variables, cookieJar, apiDefinition
|
|
|
30296
30302
|
method: apiRequest.method,
|
|
30297
30303
|
url: resolvedPath,
|
|
30298
30304
|
headers: combinedHeaders,
|
|
30299
|
-
body:
|
|
30305
|
+
body: apiRequest.body
|
|
30300
30306
|
};
|
|
30301
30307
|
return await sendRequestWithJar(parsed2, cookieJar);
|
|
30302
30308
|
}
|
|
30303
30309
|
}
|
|
30304
30310
|
}
|
|
30305
|
-
|
|
30311
|
+
let parsed = parserHttpRequest(requestContent, variables);
|
|
30312
|
+
if (apiDefinitions && apiDefinitions.headerGroups.length > 0) {
|
|
30313
|
+
const headerGroupNames = apiDefinitions.headerGroups.map((hg) => hg.name);
|
|
30314
|
+
const foundGroups = [];
|
|
30315
|
+
for (const line2 of requestLines) {
|
|
30316
|
+
const trimmed = line2.trim();
|
|
30317
|
+
if (!trimmed || trimmed.startsWith("#") || trimmed.startsWith("var ")) {
|
|
30318
|
+
continue;
|
|
30319
|
+
}
|
|
30320
|
+
const methodMatch = trimmed.match(/^(GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS)\s+(.+)$/i);
|
|
30321
|
+
if (methodMatch) {
|
|
30322
|
+
const afterMethod = methodMatch[2];
|
|
30323
|
+
const tokens = afterMethod.split(/\s+/);
|
|
30324
|
+
for (let i = tokens.length - 1; i >= 0; i--) {
|
|
30325
|
+
if (headerGroupNames.includes(tokens[i])) {
|
|
30326
|
+
foundGroups.push(tokens[i]);
|
|
30327
|
+
} else {
|
|
30328
|
+
break;
|
|
30329
|
+
}
|
|
30330
|
+
}
|
|
30331
|
+
continue;
|
|
30332
|
+
}
|
|
30333
|
+
if (/^[A-Za-z0-9\-_]+\s*:\s*.+$/.test(trimmed)) {
|
|
30334
|
+
continue;
|
|
30335
|
+
}
|
|
30336
|
+
const potentialGroups = trimmed.split(/\s+/);
|
|
30337
|
+
for (const groupName of potentialGroups) {
|
|
30338
|
+
if (headerGroupNames.includes(groupName)) {
|
|
30339
|
+
foundGroups.push(groupName);
|
|
30340
|
+
}
|
|
30341
|
+
}
|
|
30342
|
+
}
|
|
30343
|
+
for (const groupName of foundGroups) {
|
|
30344
|
+
const group = apiDefinitions.headerGroups.find((hg) => hg.name === groupName);
|
|
30345
|
+
if (group) {
|
|
30346
|
+
const resolvedHeaders = resolveHeaderValues(group, variables);
|
|
30347
|
+
parsed.headers = { ...resolvedHeaders, ...parsed.headers };
|
|
30348
|
+
}
|
|
30349
|
+
const endPattern = new RegExp(`\\s+${groupName}$`);
|
|
30350
|
+
parsed.url = parsed.url.replace(endPattern, "");
|
|
30351
|
+
}
|
|
30352
|
+
parsed.url = parsed.url.trim();
|
|
30353
|
+
}
|
|
30306
30354
|
return await sendRequestWithJar(parsed, cookieJar);
|
|
30307
30355
|
}
|
|
30308
30356
|
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.
|
|
5
|
+
"version": "1.3.6",
|
|
6
6
|
"publisher": "Norn-PeterKrustanov",
|
|
7
7
|
"author": {
|
|
8
8
|
"name": "Peter Krastanov"
|