norn-cli 1.1.0
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 +556 -0
- package/LICENSE +94 -0
- package/README.md +938 -0
- package/dist/cli.js +23453 -0
- package/package.json +194 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,556 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to the "Norn" extension will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [1.1.0] - 2026-02-01
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- **Test Sequences**: Mark sequences as tests with `test sequence Name` syntax
|
|
9
|
+
- Only `test sequence` blocks run from CLI; plain `sequence` blocks are helpers
|
|
10
|
+
- Use helpers for shared setup/utility sequences called by tests
|
|
11
|
+
- Example: `test sequence AuthFlow` runs from CLI, `sequence SetupUser` is a helper
|
|
12
|
+
|
|
13
|
+
- **Directory Discovery**: Run all test sequences in a directory tree
|
|
14
|
+
- `npx norn tests/` recursively finds and runs all `.norn` files
|
|
15
|
+
- Aggregates results across all files with combined summary
|
|
16
|
+
- Only `test sequence` blocks are executed
|
|
17
|
+
|
|
18
|
+
- **Output Directory**: Save reports to a custom location with timestamped filenames
|
|
19
|
+
- `--output-dir ./reports` saves results to specified directory
|
|
20
|
+
- Auto-generates timestamped filenames: `tests-2026-02-01-120000-results.xml`
|
|
21
|
+
- Works with `--junit` and `--html` reporters
|
|
22
|
+
|
|
23
|
+
- **Secret Variables**: Mark sensitive environment variables with `secret` keyword
|
|
24
|
+
- Syntax: `secret apiKey = my-secret-key` in `.nornenv` files
|
|
25
|
+
- Values automatically redacted as `***` in all CLI output
|
|
26
|
+
- Prevents accidental exposure of tokens, passwords, API keys
|
|
27
|
+
|
|
28
|
+
- **Human-Readable CLI Output**: Colorized, formatted output for terminal
|
|
29
|
+
- Pass/fail indicators with colors and Unicode symbols
|
|
30
|
+
- Assertion results with expected vs actual values
|
|
31
|
+
- Request/response details in verbose mode
|
|
32
|
+
|
|
33
|
+
- **JUnit Reporter**: Generate XML reports for CI/CD pipelines
|
|
34
|
+
- `--junit` flag outputs JUnit-compatible XML
|
|
35
|
+
- Compatible with GitHub Actions, Jenkins, Azure DevOps
|
|
36
|
+
- Includes test names, durations, failure messages
|
|
37
|
+
|
|
38
|
+
- **HTML Reporter**: Generate visual HTML reports
|
|
39
|
+
- `--html` flag outputs styled HTML report
|
|
40
|
+
- Expandable sections for requests, responses, assertions
|
|
41
|
+
- Easy sharing and archiving of test results
|
|
42
|
+
|
|
43
|
+
### Fixed
|
|
44
|
+
- **Print Statement Variable Resolution**: `{{$1.status}}` now resolves correctly in print statements
|
|
45
|
+
- Response references (`$1`, `$2`, etc.) are now stored in runtime variables
|
|
46
|
+
- Works in both print statements and variable assignments
|
|
47
|
+
|
|
48
|
+
## [1.0.26] - 2026-01-31
|
|
49
|
+
|
|
50
|
+
### Added
|
|
51
|
+
- **Sequence Tags**: Tag sequences with `@smoke`, `@team(CustomerExp)` for filtering in CI/CD
|
|
52
|
+
- Simple tags: `@smoke @regression` before `sequence` declaration
|
|
53
|
+
- Key-value tags: `@team(CustomerExp)`, `@priority(high)`, `@jira(NORN-123)`
|
|
54
|
+
- Multiple tags on same line or separate lines
|
|
55
|
+
- Case-insensitive tag matching
|
|
56
|
+
|
|
57
|
+
- **CLI Tag Filtering**: Filter sequences by tags when running from command line
|
|
58
|
+
- `--tag smoke` - AND logic (can repeat: `--tag smoke --tag auth`)
|
|
59
|
+
- `--tags smoke,regression` - OR logic (comma-separated)
|
|
60
|
+
- Key-value matching: `--tag team(CustomerExp)`
|
|
61
|
+
- Nested sequences silently skipped when tag filter is active and they don't match
|
|
62
|
+
|
|
63
|
+
- **Tag IntelliSense**: Type `@` to see existing tags from workspace
|
|
64
|
+
- Auto-completes simple tags and key-value tags
|
|
65
|
+
- Suggests common tags: `smoke`, `regression`, `wip`, `skip`, `team`, `priority`
|
|
66
|
+
|
|
67
|
+
- **Tag Diagnostics**: Warning when tags are placed incorrectly (not before `sequence`)
|
|
68
|
+
|
|
69
|
+
### Changed
|
|
70
|
+
- **Regression Test Runner**: `run-all.sh` now supports `--tag` and `--tags` options
|
|
71
|
+
- Example: `./run-all.sh --tag smoke` runs only smoke-tagged sequences
|
|
72
|
+
|
|
73
|
+
## [1.0.25] - 2026-01-28
|
|
74
|
+
|
|
75
|
+
### Added
|
|
76
|
+
- **Capture Named Request Response**: `var response = run NamedRequest` now works
|
|
77
|
+
- Previously only `run NamedRequest` (without capture) worked
|
|
78
|
+
- Now you can capture the full HTTP response including `status`, `body`, and `headers`
|
|
79
|
+
- Example: `var resp = run GetSingleTodo` then `assert resp.status == 200`
|
|
80
|
+
|
|
81
|
+
## [1.0.24] - 2026-01-27
|
|
82
|
+
|
|
83
|
+
### Changed
|
|
84
|
+
- **Single Return Values**: Single returns now pass the raw value, not a wrapped object
|
|
85
|
+
- `return myValue` → caller receives the value directly (e.g., `"level-3-data"`)
|
|
86
|
+
- `return a, b` → caller receives `{a: valueA, b: valueB}` object
|
|
87
|
+
- This matches intuitive behavior: "return the value" means pass the value itself
|
|
88
|
+
- Example: `var result = run GetEmail` where `GetEmail` does `return email` → `result` is the email string
|
|
89
|
+
|
|
90
|
+
### Fixed
|
|
91
|
+
- **Regression Tests**: Updated test expectations to match correct single-return behavior
|
|
92
|
+
- Tests now correctly assert raw values instead of accessing `.property` on single returns
|
|
93
|
+
|
|
94
|
+
## [1.0.23] - 2026-01-26
|
|
95
|
+
|
|
96
|
+
### Fixed
|
|
97
|
+
- **Sequence Return Value Consistency**: Single and multiple return statements now behave identically
|
|
98
|
+
- Fixed `assert result.value == "data"` failing with "Variable not defined" for single returns
|
|
99
|
+
- All return values are now wrapped in a JSON object, so `result.myValue` works consistently
|
|
100
|
+
|
|
101
|
+
- **API Endpoint Request Bodies**: POST/PUT/PATCH with endpoint syntax now includes the body
|
|
102
|
+
- Fixed `POST HttpBinPost Json` followed by `{"test": "data"}` sending empty body
|
|
103
|
+
- Body lines after endpoint requests are now correctly extracted and sent
|
|
104
|
+
|
|
105
|
+
- **Variable Quote Stripping**: Quoted string values are now stored without quotes
|
|
106
|
+
- Fixed `var url = "https://example.com"` being used as `"https://example.com"/path`
|
|
107
|
+
- Quotes are stripped during variable extraction for cleaner substitution
|
|
108
|
+
|
|
109
|
+
## [1.0.22] - 2026-01-26
|
|
110
|
+
|
|
111
|
+
### Fixed
|
|
112
|
+
- **Standalone API Requests**: `GET GetPetById(1)` now works outside of sequences
|
|
113
|
+
- Fixed "Invalid URL" error when clicking CodeLens on API endpoint requests
|
|
114
|
+
- API detection now correctly skips blank lines, comments, and import lines
|
|
115
|
+
|
|
116
|
+
## [1.0.21] - 2026-01-25
|
|
117
|
+
|
|
118
|
+
### Fixed
|
|
119
|
+
- **Script Variable Capture**: `var id = run powershell "script.ps1"` now correctly captures and parses JSON output
|
|
120
|
+
- Script output is automatically parsed as JSON when valid, enabling `id[0].property` access
|
|
121
|
+
- Fixed detection to not confuse `run powershell` with `run SequenceName`
|
|
122
|
+
|
|
123
|
+
- **Sequence Return Values**: `return id[0].id` now correctly returns nested values
|
|
124
|
+
- Fixed path parsing for array and property access in return statements
|
|
125
|
+
- Return values preserve their type (number, object, etc.) instead of being stringified
|
|
126
|
+
|
|
127
|
+
- **Sub-sequence API Endpoints**: API endpoints now work correctly in sub-sequences
|
|
128
|
+
- Fixed `GET GetUser(id)` not resolving when called from `run Get_200(id)`
|
|
129
|
+
- API definitions are now properly passed to nested sequence calls
|
|
130
|
+
|
|
131
|
+
## [1.0.20] - 2026-01-25
|
|
132
|
+
|
|
133
|
+
### Added
|
|
134
|
+
- **Swagger/OpenAPI Import**: Import endpoints from OpenAPI specifications in `.nornapi` files
|
|
135
|
+
- Add `swagger https://api.example.com/swagger.json` to your `.nornapi` file
|
|
136
|
+
- Click "Import Endpoints" CodeLens button to fetch and parse the spec
|
|
137
|
+
- Select which sections to import (All, or specific tags like pet/store/user)
|
|
138
|
+
- Customize the base URL for generated endpoints
|
|
139
|
+
- Supports OpenAPI 2.0 (Swagger) and OpenAPI 3.x specifications
|
|
140
|
+
- Generates clean endpoint definitions: `EndpointName: METHOD /path`
|
|
141
|
+
|
|
142
|
+
## [1.0.19] - 2026-01-25
|
|
143
|
+
|
|
144
|
+
### Improved
|
|
145
|
+
- **Simplified IntelliSense**: Completions now insert just the keyword without extra placeholders
|
|
146
|
+
- HTTP methods insert `GET ` instead of `GET https://` with snippet
|
|
147
|
+
- `var`, `run`, `assert` insert just the keyword for natural typing
|
|
148
|
+
- Endpoint completions insert just the name, letting you add `()` manually
|
|
149
|
+
|
|
150
|
+
- **Better Syntax Highlighting for JSON Bodies**: Full JSON coloring in request bodies
|
|
151
|
+
- Property keys highlighted as property names
|
|
152
|
+
- String values highlighted as strings
|
|
153
|
+
- Numbers highlighted as numbers
|
|
154
|
+
- Variable references `{{var}}` highlighted inside strings
|
|
155
|
+
- Works with or without blank line between headers and body
|
|
156
|
+
|
|
157
|
+
- **Print Statement Syntax Highlighting**: Distinct colors for different elements
|
|
158
|
+
- Quoted strings show string color
|
|
159
|
+
- Variables show variable color
|
|
160
|
+
- `+` operator highlighted
|
|
161
|
+
|
|
162
|
+
- **Variable Assignment Highlighting**: Better coloring for `var x = value`
|
|
163
|
+
- Variable paths like `result[0].id` highlighted as variables (not strings)
|
|
164
|
+
|
|
165
|
+
### Added
|
|
166
|
+
- **Missing Concatenation Diagnostics**: Red squiggly when `+` is missing between values in print
|
|
167
|
+
- `print "Result: " result` shows error between string and variable
|
|
168
|
+
- Suggests adding `+` operator
|
|
169
|
+
|
|
170
|
+
- **Missing Parameter Diagnostics**: Red squiggly when calling sequence without required parameters
|
|
171
|
+
- `run Teardown` shows error if `Teardown(sessionId)` requires a parameter
|
|
172
|
+
- Shows required parameter names in error message
|
|
173
|
+
|
|
174
|
+
### Fixed
|
|
175
|
+
- Auto-closing parentheses now works - typing `(` inserts `)`
|
|
176
|
+
- IntelliSense triggers when typing inside parentheses
|
|
177
|
+
|
|
178
|
+
## [1.0.18] - 2026-01-24
|
|
179
|
+
|
|
180
|
+
### Added
|
|
181
|
+
- **Variable Request Capture**: Capture HTTP responses into variables for stable assertions
|
|
182
|
+
- Syntax: `var user = GET {{baseUrl}}/users/1` or `var user = GET GetUser(1) Json`
|
|
183
|
+
- Access response properties: `user.body.username`, `user.status`, `user.headers`
|
|
184
|
+
- Eliminates need for fragile `$1`, `$2` references that break when requests change
|
|
185
|
+
- Full support for named endpoints with header groups
|
|
186
|
+
|
|
187
|
+
- **IntelliSense for Variable Request Capture**
|
|
188
|
+
- HTTP methods (GET, POST, etc.) shown after `var x = `
|
|
189
|
+
- Endpoint suggestions from `.nornapi` files after method
|
|
190
|
+
- Header group suggestions after endpoint (Auth, Json, etc.)
|
|
191
|
+
- Response property completions for captured variables (`user.body.`, `user.headers.`)
|
|
192
|
+
|
|
193
|
+
- **Diagnostics for Variable Request Capture**
|
|
194
|
+
- Red squiggly for undefined endpoints in `var x = GET UnknownEndpoint`
|
|
195
|
+
- Red squiggly for undefined header groups in `var x = GET GetUser(1) InvalidGroup`
|
|
196
|
+
|
|
197
|
+
- **Syntax Highlighting for Variable Request Capture**
|
|
198
|
+
- Endpoint name styled as function
|
|
199
|
+
- Parameters styled appropriately
|
|
200
|
+
- Header groups styled in green (matching other header group references)
|
|
201
|
+
|
|
202
|
+
## [1.0.17] - 2026-01-24
|
|
203
|
+
|
|
204
|
+
### Added
|
|
205
|
+
- **API Definition Files (.nornapi)**: New file format for defining reusable API configurations
|
|
206
|
+
- Define header groups with `headers GroupName` / `end headers`
|
|
207
|
+
- Define endpoint templates with `endpoints /path` / `end endpoints`
|
|
208
|
+
- Import into .norn files with `import "./api.nornapi"`
|
|
209
|
+
- IntelliSense support for .nornapi keywords and common headers
|
|
210
|
+
- Custom file icon for .nornapi files
|
|
211
|
+
|
|
212
|
+
- **Enhanced Sequence Request Display**: Request steps in sequences now show full details
|
|
213
|
+
- URL display with method badge (color-coded by HTTP method)
|
|
214
|
+
- Tabs for Body, Headers, and Cookies (same as single request view)
|
|
215
|
+
- Copy button for response body
|
|
216
|
+
- JSON syntax highlighting in response body
|
|
217
|
+
|
|
218
|
+
- **File Icons**: Custom icons for Norn file types
|
|
219
|
+
- `.nornapi` files show network connection icon
|
|
220
|
+
- `.nornenv` files show globe icon
|
|
221
|
+
|
|
222
|
+
### Fixed
|
|
223
|
+
- Comments no longer show diagnostic errors for undefined variables
|
|
224
|
+
- Lines starting with `#` or `//` are properly skipped during variable validation
|
|
225
|
+
|
|
226
|
+
## [1.0.16] - 2026-01-24
|
|
227
|
+
|
|
228
|
+
### Added
|
|
229
|
+
- **Sequence Parameters**: Sequences can now accept parameters with optional default values
|
|
230
|
+
- Declare parameters: `sequence Login(username, password = "secret123")`
|
|
231
|
+
- Call with positional args: `run Login("admin", "mypass")`
|
|
232
|
+
- Call with named args: `run Login(password: "pass", username: "user")`
|
|
233
|
+
- Parameters with defaults are optional
|
|
234
|
+
- Required parameters must come before optional ones
|
|
235
|
+
|
|
236
|
+
- **Sequence Return Values**: Sequences can return multiple values
|
|
237
|
+
- Return statement: `return token, userId`
|
|
238
|
+
- Capture in caller: `var result = run Login("admin")`
|
|
239
|
+
- Access fields: `{{result.token}}`, `{{result.userId}}`
|
|
240
|
+
|
|
241
|
+
- **IntelliSense for Return Fields**: Property completions for sequence return values
|
|
242
|
+
- Type `{{result.` to see available fields from the sequence's return statement
|
|
243
|
+
- Works for sequences in the same file and imported files
|
|
244
|
+
|
|
245
|
+
- **CLI Print Support**: Print statements now display in CLI output with `[print]` prefix
|
|
246
|
+
|
|
247
|
+
### Fixed
|
|
248
|
+
- Sequence parameters no longer show as undefined variables in diagnostics
|
|
249
|
+
- CodeLens "Run Sequence" now shows for sequences where all parameters have defaults
|
|
250
|
+
|
|
251
|
+
### Examples
|
|
252
|
+
|
|
253
|
+
```norn
|
|
254
|
+
sequence CreateUser(name, role = "user", active = "true")
|
|
255
|
+
print Creating {{name}} with role {{role}}
|
|
256
|
+
POST {{baseUrl}}/users
|
|
257
|
+
Content-Type: application/json
|
|
258
|
+
{"name": "{{name}}", "role": "{{role}}", "active": {{active}}}
|
|
259
|
+
|
|
260
|
+
var id = $1.body.id
|
|
261
|
+
return id, name, role
|
|
262
|
+
end sequence
|
|
263
|
+
|
|
264
|
+
sequence TestUsers
|
|
265
|
+
# Positional args
|
|
266
|
+
var admin = run CreateUser("Admin", "admin", "true")
|
|
267
|
+
print Admin ID: {{admin.id}}
|
|
268
|
+
|
|
269
|
+
# Named args (any order)
|
|
270
|
+
var guest = run CreateUser(role: "guest", name: "Guest")
|
|
271
|
+
print Guest ID: {{guest.id}}
|
|
272
|
+
|
|
273
|
+
# Use defaults
|
|
274
|
+
run CreateUser("DefaultUser")
|
|
275
|
+
end sequence
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
## [1.0.15] - 2026-01-24
|
|
279
|
+
|
|
280
|
+
### Added
|
|
281
|
+
- **Sequence Composition**: Sequences can now call other sequences with `run SequenceName`
|
|
282
|
+
- Enables modular test design with reusable setup/teardown patterns
|
|
283
|
+
- Variables set in called sequences are available to the caller
|
|
284
|
+
- Sequences can be nested to any depth
|
|
285
|
+
- Circular references are detected and reported as errors
|
|
286
|
+
- Sub-sequences shown in collapsible groups in the response panel
|
|
287
|
+
|
|
288
|
+
- **File Imports**: Import named requests and sequences from other files
|
|
289
|
+
- `import "./common.norn"` - import from relative path
|
|
290
|
+
- Nested imports supported (imported files can import other files)
|
|
291
|
+
- Circular imports detected and reported
|
|
292
|
+
- Variables resolved at import time (baked in), not exported
|
|
293
|
+
- `.nornenv` environment variables shared across all files
|
|
294
|
+
|
|
295
|
+
- **Response Panel Improvements**:
|
|
296
|
+
- Steps start collapsed by default for cleaner view
|
|
297
|
+
- "Expand All" / "Collapse All" button in sequence header
|
|
298
|
+
- Sub-sequence calls shown in collapsible groups with 📦 icon
|
|
299
|
+
- Failed sub-sequences show error styling
|
|
300
|
+
|
|
301
|
+
### Examples
|
|
302
|
+
|
|
303
|
+
```norn
|
|
304
|
+
# common.norn - shared utilities
|
|
305
|
+
var baseUrl = https://api.example.com
|
|
306
|
+
|
|
307
|
+
[AuthRequest]
|
|
308
|
+
POST {{baseUrl}}/auth/login
|
|
309
|
+
Content-Type: application/json
|
|
310
|
+
{"username": "admin", "password": "secret"}
|
|
311
|
+
|
|
312
|
+
sequence SharedSetup
|
|
313
|
+
run AuthRequest
|
|
314
|
+
var token = $1.body.accessToken
|
|
315
|
+
end sequence
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
```norn
|
|
319
|
+
# main-test.norn
|
|
320
|
+
import "./common.norn"
|
|
321
|
+
|
|
322
|
+
sequence MyTests
|
|
323
|
+
run SharedSetup
|
|
324
|
+
|
|
325
|
+
GET {{baseUrl}}/users/me
|
|
326
|
+
Authorization: Bearer {{token}}
|
|
327
|
+
assert $1.status == 200
|
|
328
|
+
end sequence
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
## [1.0.14] - 2026-01-23
|
|
332
|
+
|
|
333
|
+
### Added
|
|
334
|
+
- **Variable expression assignment**: Assign variables from expressions without `{{}}`
|
|
335
|
+
- `var id = data.users[0].id` - extract from JSON variable
|
|
336
|
+
- `var name = "John"` - quoted string literals
|
|
337
|
+
- `var count = 123` - numeric literals
|
|
338
|
+
- `var active = true` - boolean literals
|
|
339
|
+
- **PowerShell output parsing**: Automatic parsing of PowerShell table/list output to JSON
|
|
340
|
+
- Table format with headers and `---` separators
|
|
341
|
+
- List format with `Key : Value` pairs
|
|
342
|
+
- ANSI escape code stripping for clean output
|
|
343
|
+
- **Improved syntax highlighting**: Different colors for value types in variable assignments
|
|
344
|
+
- Quoted strings, numbers, booleans, variable references, URLs
|
|
345
|
+
- **IntelliSense for variable assignments**: After `var x = `, shows:
|
|
346
|
+
- Defined variables with their values
|
|
347
|
+
- Keywords: `true`, `false`, `null`
|
|
348
|
+
- Run commands
|
|
349
|
+
- **Diagnostic for invalid assignments**: Red squiggly for:
|
|
350
|
+
- Unquoted strings with spaces: `var x = hello world`
|
|
351
|
+
- Undefined variable references: `var x = unknownVar`
|
|
352
|
+
|
|
353
|
+
### Examples
|
|
354
|
+
|
|
355
|
+
```norn
|
|
356
|
+
sequence DataExtraction
|
|
357
|
+
# Load JSON data
|
|
358
|
+
var config = run readJson ./config.json
|
|
359
|
+
|
|
360
|
+
# Extract values directly (no {{}} needed)
|
|
361
|
+
var userId = config.users[0].id
|
|
362
|
+
var userName = config.users[0].name
|
|
363
|
+
|
|
364
|
+
# Use string literals with interpolation
|
|
365
|
+
var greeting = "Hello {{userName}}"
|
|
366
|
+
|
|
367
|
+
# PowerShell scripts now auto-parse to JSON
|
|
368
|
+
var dbResult = run powershell ./query.ps1
|
|
369
|
+
var recordId = dbResult.Id
|
|
370
|
+
|
|
371
|
+
print Result | User {{userId}}: {{userName}}
|
|
372
|
+
end sequence
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
## [1.0.13] - 2026-01-22
|
|
376
|
+
|
|
377
|
+
### Added
|
|
378
|
+
- **`wait` command**: Pause execution for a specified duration
|
|
379
|
+
- Formats: `wait 2s`, `wait 500ms`, `wait 1.5 seconds`
|
|
380
|
+
- Useful for testing async operations or rate-limited APIs
|
|
381
|
+
- **`if` statements**: Conditional execution of steps based on response data
|
|
382
|
+
- Use any assertion operator: `if $1.status == 200 ... end if`
|
|
383
|
+
- Supports nesting: multiple if blocks can be nested
|
|
384
|
+
- Skipped steps are not executed when condition is false
|
|
385
|
+
- **`isType` assertion**: Type checking for response values
|
|
386
|
+
- Supported types: `number`, `string`, `boolean`, `array`, `object`, `null`
|
|
387
|
+
- Example: `assert $1.body.id isType number`
|
|
388
|
+
- Example: `assert $1.body.tags isType array`
|
|
389
|
+
- **CLI improvements**:
|
|
390
|
+
- `--env` / `-e`: Select environment from `.nornenv`
|
|
391
|
+
- `--request` / `-r`: Run a specific named request
|
|
392
|
+
- `--timeout` / `-t`: Request timeout in seconds
|
|
393
|
+
- `--verbose` now shows response headers
|
|
394
|
+
|
|
395
|
+
### Examples
|
|
396
|
+
|
|
397
|
+
```norn
|
|
398
|
+
sequence ConditionalExample
|
|
399
|
+
GET {{baseUrl}}/users/1
|
|
400
|
+
|
|
401
|
+
# Type assertions
|
|
402
|
+
assert $1.body.id isType number
|
|
403
|
+
assert $1.body.name isType string
|
|
404
|
+
assert $1.body.roles isType array
|
|
405
|
+
|
|
406
|
+
# Conditional execution
|
|
407
|
+
if $1.status == 200
|
|
408
|
+
print Success | User found
|
|
409
|
+
|
|
410
|
+
# Wait before next request (rate limiting)
|
|
411
|
+
wait 1s
|
|
412
|
+
|
|
413
|
+
GET {{baseUrl}}/users/1/profile
|
|
414
|
+
assert $2.status == 200
|
|
415
|
+
end if
|
|
416
|
+
|
|
417
|
+
if $1.status == 404
|
|
418
|
+
print Not Found | User does not exist
|
|
419
|
+
end if
|
|
420
|
+
end sequence
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
## [1.0.12] - 2026-01-22
|
|
424
|
+
|
|
425
|
+
### Added
|
|
426
|
+
- **JSON file reading**: Load JSON files into variables with `var config = run readJson ./path/to/file.json`
|
|
427
|
+
- Access nested properties: `{{config.database.host}}`, `{{config.users[0].name}}`
|
|
428
|
+
- Modify properties inline: `config.apiKey = {{newKey}}`
|
|
429
|
+
- **IntelliSense for `run` commands**: Typing `run` and selecting it automatically triggers IntelliSense showing available options:
|
|
430
|
+
- Script types: `bash`, `powershell`, `js`, `readJson`
|
|
431
|
+
- Named requests defined in the file
|
|
432
|
+
- **Method icons**: Script type completions now show method icons for better visual distinction
|
|
433
|
+
- **Smart IntelliSense triggers**: Space after `run` automatically shows available options
|
|
434
|
+
|
|
435
|
+
### Changed
|
|
436
|
+
- **Simplified completions**: Removed snippet placeholders from `run` command completions - now inserts plain text for cleaner experience
|
|
437
|
+
- **Refactored completion logic**: `run` command completions now share logic between standalone `run` and `var x = run` contexts
|
|
438
|
+
|
|
439
|
+
## [1.0.11] - 2026-01-21
|
|
440
|
+
|
|
441
|
+
### Added
|
|
442
|
+
- **Assertions**: New `assert` command for validating HTTP responses in sequences
|
|
443
|
+
- Operators: `==`, `!=`, `>`, `>=`, `<`, `<=`, `contains`, `startsWith`, `endsWith`, `matches`, `exists`, `!exists`
|
|
444
|
+
- Assert on status: `assert $1.status == 200`
|
|
445
|
+
- Assert on body: `assert $1.body.userId == 1`
|
|
446
|
+
- Assert on headers: `assert $1.headers.Content-Type contains "application/json"`
|
|
447
|
+
- Assert duration: `assert $1.duration < 5000`
|
|
448
|
+
- Custom failure messages: `assert $1.body.id == 999 | "Expected different ID"`
|
|
449
|
+
- **IntelliSense for response properties**: After typing `$1.`, shows completions for `status`, `statusText`, `headers`, `body`, `duration`
|
|
450
|
+
- **Assertion syntax highlighting**: `assert` commands now have proper syntax coloring
|
|
451
|
+
|
|
452
|
+
### Changed
|
|
453
|
+
- **BREAKING**: Response body access now requires explicit `body.` prefix
|
|
454
|
+
- Before: `$1.userId` or `$1[0].title`
|
|
455
|
+
- After: `$1.body.userId` or `$1.body[0].title`
|
|
456
|
+
- This makes it clearer what you're accessing (status vs headers vs body)
|
|
457
|
+
|
|
458
|
+
## [1.0.10] - 2026-01-20
|
|
459
|
+
|
|
460
|
+
### Fixed
|
|
461
|
+
- **PowerShell 7 support**: Now prefers `pwsh` (PowerShell 7+) over `powershell` (Windows PowerShell 5.1) for script execution. PowerShell 7 has newer SqlClient drivers that support additional connection string options like `HostNameInCertificate`. Falls back to Windows PowerShell if pwsh is not installed.
|
|
462
|
+
|
|
463
|
+
## [1.0.9] - 2026-01-20
|
|
464
|
+
|
|
465
|
+
### Added
|
|
466
|
+
- **Streaming sequence results**: Sequence steps now appear in the response panel as they complete, providing real-time feedback during long-running sequences
|
|
467
|
+
- **Variable assignment IntelliSense**: After typing `var x = run `, IntelliSense now shows available script types (bash, powershell, js) AND named requests to run
|
|
468
|
+
- **Named request capture syntax**: Support for `var result = run MyRequest` to capture a named request's response into a variable
|
|
469
|
+
|
|
470
|
+
### Fixed
|
|
471
|
+
- **`run` keyword highlighting**: The `run` keyword is now properly highlighted while typing, before completing the full command
|
|
472
|
+
- **Partial command highlighting**: `var x = run` and `var x = run bash` now highlight correctly while still typing
|
|
473
|
+
- **IntelliSense after `run `**: Typing `run ` (with trailing space) now properly triggers IntelliSense suggestions
|
|
474
|
+
- **Sequence re-run cleanup**: Running a sequence again now properly clears previous results instead of appending to them
|
|
475
|
+
|
|
476
|
+
## [1.0.8] - 2026-01-19
|
|
477
|
+
|
|
478
|
+
### Added
|
|
479
|
+
- **Add env file**: When no `.nornenv` file exists, CodeLens shows "**+ Add env file**" - clicking it creates a template file with common variables and dev/prod environments ready to customize
|
|
480
|
+
|
|
481
|
+
### Fixed
|
|
482
|
+
- **Parser fix**: Body extraction now stops at request boundaries (`[SomeName]`, `sequence`, HTTP methods). Previously `[SomeName]` after URL-encoded params was incorrectly included in the body.
|
|
483
|
+
|
|
484
|
+
## [1.0.7] - 2026-01-19
|
|
485
|
+
|
|
486
|
+
### Fixed
|
|
487
|
+
- **Syntax highlighting**: Proper stateful parsing - headers before blank line get header color, body params after blank line get parameter color (like the parser does)
|
|
488
|
+
|
|
489
|
+
## [1.0.6] - 2026-01-19
|
|
490
|
+
|
|
491
|
+
### Fixed
|
|
492
|
+
- **URL-encoded body support**: Now supports `key: value` format (colon) in addition to `key=value` for form data
|
|
493
|
+
- **Syntax highlighting**: Body parameters now have distinct highlighting from headers (different color for `username:` vs `Content-Type:`)
|
|
494
|
+
|
|
495
|
+
## [1.0.5] - 2026-01-19
|
|
496
|
+
|
|
497
|
+
### Fixed
|
|
498
|
+
- **Fixed**: File icon resolution
|
|
499
|
+
- **Fixed header/body parsing**: Parser now uses blank line to separate headers from body (standard HTTP convention). This fixes 400 errors when URL-encoded form data params like `username: value` were incorrectly parsed as headers.
|
|
500
|
+
|
|
501
|
+
## [1.0.4] - 2026-01-19
|
|
502
|
+
|
|
503
|
+
### Added
|
|
504
|
+
- **Named Requests**: Define reusable requests with `[RequestName]` and call them with `run RequestName` in sequences
|
|
505
|
+
- **Environment Support**: Create `.nornenv` file with environment-specific variables
|
|
506
|
+
- Common variables available in all environments
|
|
507
|
+
- Switch environments via status bar or CodeLens
|
|
508
|
+
- Environment variables shown in IntelliSense with source indicator
|
|
509
|
+
- **URL-encoded Form Data**: Support for `application/x-www-form-urlencoded` with multi-line format
|
|
510
|
+
- **Environment Selector in CodeLens**: Click `env: dev` next to Send Request to switch environments
|
|
511
|
+
|
|
512
|
+
### Changed
|
|
513
|
+
- Changed language ID from `http` to `norn` to avoid conflicts with other extensions
|
|
514
|
+
- Improved syntax highlighting for `[RequestName]` declarations and `run` commands
|
|
515
|
+
|
|
516
|
+
### Fixed
|
|
517
|
+
- Diagnostics now respect environment variables (no false "undefined variable" errors)
|
|
518
|
+
- Diagnostics refresh when switching environments
|
|
519
|
+
- Named request names now enforce no-spaces rule with error highlighting
|
|
520
|
+
|
|
521
|
+
## [1.0.3] - 2026-01-18
|
|
522
|
+
|
|
523
|
+
- Fix 'sequence' not being recognized as a keyword
|
|
524
|
+
- Fixed an issue where if the name was of the sequence had a '-' it will be highlighted incorrectly
|
|
525
|
+
|
|
526
|
+
## [1.0.2] - 2026-01-18
|
|
527
|
+
|
|
528
|
+
### Added
|
|
529
|
+
- Capture entire response body with `var data = $1`
|
|
530
|
+
- Capture array elements with `var item = $1[0]`
|
|
531
|
+
- Extended evaluation period to 30 days
|
|
532
|
+
|
|
533
|
+
### Fixed
|
|
534
|
+
- Array index capture syntax now works correctly (`$1[0].field`)
|
|
535
|
+
|
|
536
|
+
## [1.0.1] - 2026-01-18
|
|
537
|
+
|
|
538
|
+
### Fixed
|
|
539
|
+
- Improved file icon resolution (128x128)
|
|
540
|
+
- Updated license badge in README
|
|
541
|
+
|
|
542
|
+
## [1.0.0] - 2025-01-15
|
|
543
|
+
|
|
544
|
+
### Added
|
|
545
|
+
- **HTTP Requests**: Send GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS requests
|
|
546
|
+
- **Variables**: Define with `var name = value`, reference with `{{name}}`
|
|
547
|
+
- **Sequences**: Chain multiple requests with `sequence Name` / `end sequence`
|
|
548
|
+
- **Response Capture**: Capture values from responses with `$N.path` syntax
|
|
549
|
+
- **Script Execution**: Run bash, PowerShell, or JavaScript scripts with `run` command
|
|
550
|
+
- **Print Statements**: Debug output with `print Message` or `print Title | Body`
|
|
551
|
+
- **Cookie Support**: Automatic cookie jar with persistence across requests
|
|
552
|
+
- **Syntax Highlighting**: Full highlighting for HTTP methods, headers, JSON bodies
|
|
553
|
+
- **IntelliSense**: Autocomplete for methods, headers, variables, and keywords
|
|
554
|
+
- **Diagnostics**: Error highlighting for undefined variables
|
|
555
|
+
- **CLI Tool**: Run requests from terminal with JSON output for CI/CD pipelines
|
|
556
|
+
- **Response Panel**: Webview with formatted JSON and execution results
|
package/LICENSE
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
End User License Agreement
|
|
2
|
+
|
|
3
|
+
This End User License Agreement ("Agreement") is a legal contract between you as an individual or business organisation ("you" or "Licensee") and the Norn developer ("Licensor") for the Norn software (all editions), including any associated media, printed materials and electronic documentation (the "Software").
|
|
4
|
+
|
|
5
|
+
By copying, downloading, accessing, or otherwise using the Software, you agree to be bound by the terms of this Agreement and you warrant and represent that you are authorised to enter into this Agreement on behalf of yourself or your business organisation.
|
|
6
|
+
|
|
7
|
+
If you do not wish to be bound by the terms of this Agreement, you may not download, install, access or use the Software.
|
|
8
|
+
|
|
9
|
+
• DEFINITIONS
|
|
10
|
+
|
|
11
|
+
"Authorized User" means any employee, independent contractor or other temporary worker authorized by Licensee to use the Software while performing duties within the scope of their employment or assignment.
|
|
12
|
+
|
|
13
|
+
"License Key" means a unique key-code that enables a single Authorized User to use the Software at a time. Only Licensor and/or its representatives are permitted to produce License Keys for the Software.
|
|
14
|
+
|
|
15
|
+
"Commercial Use" means any use of the Software in connection with a business, including but not limited to: (a) use by an employee or contractor during paid work hours, (b) use to develop, test, or maintain software or services that generate revenue, (c) use within a for-profit organisation, or (d) use in CI/CD pipelines for commercial projects.
|
|
16
|
+
|
|
17
|
+
"Personal Use" means use by an individual for personal projects, learning, education, or open-source projects that do not generate revenue.
|
|
18
|
+
|
|
19
|
+
• OWNERSHIP
|
|
20
|
+
|
|
21
|
+
This Agreement does not convey to you any rights of ownership in the Software. All right, title, benefit and interest in the Software and in any ideas, know-how, and programs which are developed by Licensor in the course of providing any technical services, including any enhancements or modifications made to the Software, shall at all times remain the property of Licensor.
|
|
22
|
+
|
|
23
|
+
• GRANT OF LICENSE
|
|
24
|
+
|
|
25
|
+
Upon your acceptance of this Agreement, Licensor grants you a limited, non-transferable, non-assignable, non-exclusive license to install and use the Software on the terms and conditions set forth herein.
|
|
26
|
+
|
|
27
|
+
• INTENDED USERS OF THE SOFTWARE
|
|
28
|
+
|
|
29
|
+
The Norn software is licensed to provide functionality to test APIs in Visual Studio Code as an Extension. The Norn CLI can be used locally on the user's computer for Personal Use without a license. A license is required to use the Software for Commercial Use, including use of the Norn CLI in CI/CD build pipelines.
|
|
30
|
+
|
|
31
|
+
• FREE USE (PERSONAL USE)
|
|
32
|
+
|
|
33
|
+
You may install and use the Software free of charge for Personal Use, including:
|
|
34
|
+
- Personal projects and experimentation
|
|
35
|
+
- Learning and educational purposes
|
|
36
|
+
- Open-source projects that do not generate revenue
|
|
37
|
+
- Academic research
|
|
38
|
+
|
|
39
|
+
• COMMERCIAL EVALUATION
|
|
40
|
+
|
|
41
|
+
Businesses and organisations may evaluate the Software for Commercial Use without a license for a period of thirty (30) days from first use ("Evaluation Period"). The Evaluation Period is:
|
|
42
|
+
- Limited to one (1) evaluation period per organisation
|
|
43
|
+
- Intended for genuine evaluation purposes only
|
|
44
|
+
- Not to be used for production workloads or client projects
|
|
45
|
+
- Not extendable or renewable without written permission from the Licensor
|
|
46
|
+
|
|
47
|
+
After the Evaluation Period, continued Commercial Use requires a valid license. Abuse of the Evaluation Period, including but not limited to repeated evaluations by the same organisation, rotating users to extend evaluation, or using evaluation for production purposes, constitutes a breach of this Agreement.
|
|
48
|
+
|
|
49
|
+
• COMMERCIAL USE
|
|
50
|
+
|
|
51
|
+
A license is required for Commercial Use of the Software after the Evaluation Period. Commercial Use includes but is not limited to:
|
|
52
|
+
- Use within a for-profit company or organisation
|
|
53
|
+
- Use by employees or contractors during paid work
|
|
54
|
+
- Use in CI/CD pipelines for commercial projects
|
|
55
|
+
- Use to develop, test, or maintain revenue-generating software or services
|
|
56
|
+
|
|
57
|
+
Please contact the Licensor for commercial licensing options.
|
|
58
|
+
|
|
59
|
+
• RESTRICTIONS ON USE OF THE SOFTWARE
|
|
60
|
+
|
|
61
|
+
You are NOT permitted to:
|
|
62
|
+
a) Edit, alter, modify, adapt, translate or otherwise change the whole or any part of the Software.
|
|
63
|
+
b) Decompile, disassemble or reverse engineer the Software or attempt to do any such things.
|
|
64
|
+
c) Reproduce, copy, distribute, resell or otherwise use the whole or any part of the Software's code for any commercial purpose.
|
|
65
|
+
d) Disable, modify or hide notifications sent by the Software.
|
|
66
|
+
e) Distribute, resell, or share License Keys.
|
|
67
|
+
f) Misrepresent your use as Personal Use when it constitutes Commercial Use.
|
|
68
|
+
g) Use older versions of the Software to circumvent licensing requirements.
|
|
69
|
+
|
|
70
|
+
• LIMITED WARRANTY AND DISCLAIMER OF WARRANTY
|
|
71
|
+
|
|
72
|
+
SOFTWARE IS PROVIDED TO LICENSEE "AS IS" AND WITHOUT WARRANTIES. LICENSOR MAKES NO WARRANTY AS TO ITS USE OR PERFORMANCE. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, LICENSOR AND ITS AFFILIATES, SUPPLIERS AND RESELLERS DISCLAIM ALL OTHER WARRANTIES AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO SOFTWARE, AND THE PROVISION OF OR FAILURE TO PROVIDE SUPPORT SERVICES.
|
|
73
|
+
|
|
74
|
+
• DISCLAIMER OF DAMAGES
|
|
75
|
+
|
|
76
|
+
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO LICENSEE UNDER ANY THEORY FOR ANY DAMAGES SUFFERED BY LICENSEE OR ANY USER OF SOFTWARE, OR FOR ANY SPECIAL, INCIDENTAL, INDIRECT, CONSEQUENTIAL, OR SIMILAR DAMAGES (INCLUDING, BUT NOT LIMITED TO, DAMAGES FOR LOSS OF PROFITS OR CONFIDENTIAL OR OTHER INFORMATION, FOR BUSINESS INTERRUPTION, FOR PERSONAL INJURY, FOR LOSS OF PRIVACY, FOR FAILURE TO MEET ANY DUTY INCLUDING OF GOOD FAITH OR OF REASONABLE CARE, FOR NEGLIGENCE, AND FOR ANY OTHER PECUNIARY OR OTHER LOSS WHATSOEVER) ARISING OUT OF THE USE OR INABILITY TO USE SOFTWARE, OR THE PROVISION OF OR FAILURE TO PROVIDE SUPPORT SERVICES, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, AND REGARDLESS OF THE LEGAL OR EQUITABLE THEORY (CONTRACT, TORT OR OTHERWISE) UPON WHICH THE CLAIM IS BASED.
|
|
77
|
+
|
|
78
|
+
IN ANY CASE, LICENSOR'S ENTIRE LIABILITY UNDER ANY PROVISION OF THIS AGREEMENT WILL BE LIMITED TO THE AMOUNT ACTUALLY PAID BY LICENSEE FOR SOFTWARE UNDER THIS AGREEMENT.
|
|
79
|
+
|
|
80
|
+
• TERMINATION
|
|
81
|
+
|
|
82
|
+
This license can be terminated by you at any time. If you choose to terminate the license, you will not be entitled to any refund of the license fee(s) you have paid. Your license may be terminated by Licensor if you fail to comply with the terms of this Agreement within ten (10) days after receipt of written notice of such failure. In the event of termination, you must cease using the Software, destroy all copies of the Software (including copies in storage media) and certify such destruction to Licensor. This requirement applies to all copies in any form, partial or complete. Upon the effective date of any termination, you relinquish all rights granted under this Agreement.
|
|
83
|
+
|
|
84
|
+
• RELATIONSHIP OF PARTIES
|
|
85
|
+
|
|
86
|
+
You and Licensor are independent parties. Nothing in this Agreement shall be construed as making you an employee, agent, partner or legal representative of Licensor.
|
|
87
|
+
|
|
88
|
+
• ENTIRE AGREEMENT
|
|
89
|
+
|
|
90
|
+
This Agreement and any document expressly referred to in it constitute the whole agreement between you and the Licensor and supersede any previous arrangement understanding or agreement between you and the Licensor, relating to the licensing of the Software.
|
|
91
|
+
|
|
92
|
+
The parties acknowledge that, in entering into this Agreement (and the documents referred to in it), neither party relies on any statement, representation, assurance or warranty ("Representation") of any person (whether a party to this Agreement or not) other than as expressly set out in this Agreement or those documents.
|
|
93
|
+
|
|
94
|
+
The parties agree that the only rights and remedies available to each party arising out of or in connection with a Representation shall be for breach of contract as provided in this Agreement.
|