norn-cli 1.3.0 → 1.3.2

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.
Files changed (4) hide show
  1. package/CHANGELOG.md +33 -2
  2. package/README.md +65 -0
  3. package/dist/cli.js +6843 -172
  4. package/package.json +2 -1
package/CHANGELOG.md CHANGED
@@ -2,10 +2,41 @@
2
2
 
3
3
  All notable changes to the "Norn" extension will be documented in this file.
4
4
 
5
+ ## [1.3.2] - 2026-02-08
6
+
7
+ ### Improved
8
+ - **Contract Report View**: Enhanced property highlighting in the annotated JSON view
9
+ - Color-coded property highlights (green=valid, yellow=warning, red=error)
10
+ - Highlights wrap only the property content, not the entire line
11
+ - Selection-style highlighting similar to assert hover
12
+ - Improved indentation and spacing
13
+
14
+ ### Fixed
15
+ - **Syntax Highlighting**: Fixed JSON body coloring after nested objects
16
+ - Properties following `{ }` objects now correctly colored
17
+ - **matchesSchema Keyword**: Fixed partial coloring issue
18
+ - Entire keyword now highlights as operator (was matching "matches" first)
19
+
20
+ ## [1.3.1] - 2026-02-08
21
+
22
+ - **Clickable JSON Properties**: Click any JSON value in the response panel to generate an assertion
23
+ - Hover over any value (string, number, boolean, null) to highlight it
24
+ - Click to automatically insert `assert $var.body.path == value` at the end of the sequence
25
+ - Works with nested objects and arrays (e.g., `body.user.address.city`, `body.items[0].name`)
26
+ - String values are properly escaped with quotes
27
+ - Toast notification confirms assertion added
28
+
29
+ - **Response Comparison**: Compare any two API responses with VS Code's built-in diff view
30
+ - New "⇄ Compare" button next to "📋 Copy" on response bodies
31
+ - Click on first response, then click another to open side-by-side diff
32
+ - Responses are pretty-printed JSON for easy comparison
33
+ - Toast notification guides user: "Select another response to compare"
34
+ - Works in both sequence results and single request views
35
+ - State resets automatically after diff opens
36
+
5
37
  ## [1.3.0] - 2026-02-07
6
38
 
7
- ### Added
8
- - **Retry and Backoff**: Automatically retry failed HTTP requests with configurable backoff
39
+ ### Added- **Retry and Backoff**: Automatically retry failed HTTP requests with configurable backoff
9
40
  - Syntax: `GET url retry 3 backoff 200 ms` (retry up to 3 times with 200ms linear backoff)
10
41
  - Works with direct URLs, named endpoints, and named requests
11
42
  - Supports time units: `ms`, `s`, `seconds`, `milliseconds`
package/README.md CHANGED
@@ -22,11 +22,14 @@ A powerful REST client extension for VS Code with sequences, assertions, environ
22
22
  - **Named Requests**: Define reusable requests with `[RequestName]` and call them with `run RequestName`
23
23
  - **Conditionals**: Control flow with `if/end if` blocks based on response data
24
24
  - **Wait Commands**: Add delays between requests with `wait 1s` or `wait 500ms`
25
+ - **Retry and Backoff**: Automatically retry failed requests with `retry 3 backoff 200 ms`
25
26
  - **JSON File Loading**: Load test data from JSON files with `run readJson ./file.json`
26
27
  - **Property Updates**: Modify loaded JSON data inline with `config.property = value`
27
28
  - **Script Execution**: Run bash, PowerShell, or JavaScript scripts within sequences
28
29
  - **Print Statements**: Debug and log messages during sequence execution
29
30
  - **Cookie Support**: Automatic cookie jar with persistence across requests
31
+ - **Response Comparison**: Compare any two API responses side-by-side with VS Code's diff view
32
+ - **Clickable JSON**: Click any JSON value in the response panel to auto-generate assertions
30
33
  - **Syntax Highlighting**: Full syntax highlighting for requests, headers, JSON bodies
31
34
  - **IntelliSense**: Autocomplete for HTTP methods, headers, variables, and keywords
32
35
  - **Diagnostics**: Error highlighting for undefined variables
@@ -606,6 +609,37 @@ sequence RateLimitedFlow
606
609
  end sequence
607
610
  ```
608
611
 
612
+ ### Retry and Backoff
613
+
614
+ Automatically retry failed HTTP requests with configurable backoff:
615
+
616
+ ```bash
617
+ sequence RetryExample
618
+ # Retry up to 3 times with 200ms linear backoff (200ms, 400ms, 600ms)
619
+ var result = GET "https://api.example.com/flaky-endpoint" retry 3 backoff 200 ms
620
+
621
+ # Works with named endpoints from .nornapi files
622
+ var user = GET UserEndpoint retry 2 backoff 500 ms
623
+
624
+ # Works with named requests
625
+ var data = run FlakyRequest retry 3 backoff 100 ms
626
+
627
+ # Retry only (uses default 1 second backoff)
628
+ var simple = GET "https://api.example.com/status" retry 2
629
+ end sequence
630
+ ```
631
+
632
+ **Retries trigger on:**
633
+ - 5xx server errors (500, 502, 503, etc.)
634
+ - 429 rate limiting
635
+ - Network failures and timeouts
636
+
637
+ **Time units:**
638
+ - `ms` or `milliseconds` - e.g., `backoff 200 ms`
639
+ - `s` or `seconds` - e.g., `backoff 2 s`
640
+
641
+ The response panel shows a retry indicator (🔄 retried 2x) when retries occurred.
642
+
609
643
  ### JSON File Loading
610
644
 
611
645
  Load test data from external JSON files:
@@ -710,6 +744,37 @@ end sequence
710
744
 
711
745
  Use `print "Title" | "Body content"` for expandable messages in the result view.
712
746
 
747
+ ### Response Panel Tools
748
+
749
+ The response panel provides interactive tools that accelerate test development:
750
+
751
+ #### Response Comparison
752
+
753
+ Compare any two API responses side-by-side using VS Code's built-in diff view:
754
+
755
+ 1. Click **⇄ Compare** on the first response body
756
+ 2. Click **⇄ Compare** on the second response
757
+ 3. VS Code opens a diff view showing differences between the two responses
758
+
759
+ This is useful for comparing responses across environments, before/after changes, or expected vs actual results.
760
+
761
+ #### Clickable JSON Values
762
+
763
+ Generate assertions instantly by clicking on JSON values in the response:
764
+
765
+ 1. Expand a response body in the panel
766
+ 2. Hover over any value (string, number, boolean, null) - it highlights with a **+** badge
767
+ 3. Click to automatically insert an assertion at the end of your sequence
768
+
769
+ For example, clicking on `"active"` in `{"status": "active"}` generates:
770
+ ```bash
771
+ assert $response.body.status == "active"
772
+ ```
773
+
774
+ Works with nested paths and arrays:
775
+ - `body.user.email` → `assert $user.body.user.email == "john@example.com"`
776
+ - `body.items[0].id` → `assert $order.body.items[0].id == 123`
777
+
713
778
  ## CLI Usage
714
779
 
715
780
  Run tests from the command line for CI/CD pipelines. Only sequences marked with `test` are executed.