@contractkit/plugin-bruno 0.9.1 → 1.0.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/.turbo/turbo-build$colon$ci.log +19 -35
- package/.turbo/turbo-test$colon$ci.log +25 -128
- package/CHANGELOG.md +36 -0
- package/README.md +41 -0
- package/coverage/clover.xml +289 -275
- package/coverage/coverage-final.json +2 -2
- package/coverage/index.html +28 -28
- package/coverage/src/codegen-bruno.ts.html +242 -110
- package/coverage/src/index.html +18 -18
- package/coverage/tests/helpers.ts.html +28 -28
- package/coverage/tests/index.html +19 -19
- package/dist/codegen-bruno.d.ts +15 -0
- package/dist/codegen-bruno.d.ts.map +1 -1
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +32 -4
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
- package/src/codegen-bruno.ts +52 -8
- package/src/index.ts +12 -0
- package/tests/codegen-bruno.test.ts +153 -3
- package/.turbo/turbo-build.log +0 -15
- package/.turbo/turbo-test.log +0 -14
|
@@ -1,35 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
=============
|
|
21
|
-
|
|
22
|
-
> @contractkit/plugin-bruno@0.9.0 build /Users/robert/projects/contractkit/packages/plugin-bruno
|
|
23
|
-
> tsup src/index.ts --format esm --sourcemap --dts && tsc --emitDeclarationOnly --declaration
|
|
24
|
-
|
|
25
|
-
[34mCLI[39m Building entry: src/index.ts
|
|
26
|
-
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
27
|
-
[34mCLI[39m tsup v8.5.1
|
|
28
|
-
[34mCLI[39m Target: esnext
|
|
29
|
-
[34mESM[39m Build start
|
|
30
|
-
[32mESM[39m [1mdist/index.js [22m[32m19.94 KB[39m
|
|
31
|
-
[32mESM[39m [1mdist/index.js.map [22m[32m46.49 KB[39m
|
|
32
|
-
[32mESM[39m ⚡️ Build success in 41ms
|
|
33
|
-
DTS Build start
|
|
34
|
-
DTS ⚡️ Build success in 622ms
|
|
35
|
-
DTS dist/index.d.ts 1.37 KB
|
|
1
|
+
|
|
2
|
+
> @contractkit/plugin-bruno@1.0.0 build:ci /home/runner/work/ContractKit/ContractKit/packages/plugin-bruno
|
|
3
|
+
> eslint --max-warnings=0 && pnpm run build
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
> @contractkit/plugin-bruno@1.0.0 build /home/runner/work/ContractKit/ContractKit/packages/plugin-bruno
|
|
7
|
+
> tsup src/index.ts --format esm --sourcemap --dts && tsc --emitDeclarationOnly --declaration
|
|
8
|
+
|
|
9
|
+
[34mCLI[39m Building entry: src/index.ts
|
|
10
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
11
|
+
[34mCLI[39m tsup v8.5.1
|
|
12
|
+
[34mCLI[39m Target: esnext
|
|
13
|
+
[34mESM[39m Build start
|
|
14
|
+
[32mESM[39m [1mdist/index.js [22m[32m20.98 KB[39m
|
|
15
|
+
[32mESM[39m [1mdist/index.js.map [22m[32m50.34 KB[39m
|
|
16
|
+
[32mESM[39m ⚡️ Build success in 158ms
|
|
17
|
+
[34mDTS[39m Build start
|
|
18
|
+
[32mDTS[39m ⚡️ Build success in 3705ms
|
|
19
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m2.09 KB[39m
|
|
@@ -1,128 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
[
|
|
7
|
-
[
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
[1m[
|
|
12
|
-
|
|
13
|
-
[2m
|
|
14
|
-
[2m
|
|
15
|
-
|
|
16
|
-
[
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
[32m✓[39m generates opencollection.yml with correct spec version and collection name[32m 2[2mms[22m[39m
|
|
27
|
-
[32m✓[39m generates Local environment file with baseUrl variable[32m 0[2mms[22m[39m
|
|
28
|
-
[32m✓[39m emits requests for internal operations by default[32m 0[2mms[22m[39m
|
|
29
|
-
[32m✓[39m skips internal operations when includeInternal is false[32m 0[2mms[22m[39m
|
|
30
|
-
[32m✓[39m creates one folder per op root file[32m 0[2mms[22m[39m
|
|
31
|
-
[32m✓[39m folder.yml has info block with name, type: folder, and seq[32m 0[2mms[22m[39m
|
|
32
|
-
[32m✓[39m generates one .yml file per route+method combination[32m 0[2mms[22m[39m
|
|
33
|
-
[32m✓[39m request info block has name, type: http, and seq[32m 0[2mms[22m[39m
|
|
34
|
-
[32m✓[39m seq increments across operations within a folder[32m 0[2mms[22m[39m
|
|
35
|
-
[32m✓[39m uses slugified name as filename when op.name is set[32m 0[2mms[22m[39m
|
|
36
|
-
[32m✓[39m falls back to method-path filename when op.name is not set[32m 0[2mms[22m[39m
|
|
37
|
-
[32m✓[39m uses area meta as the top-level folder name[32m 0[2mms[22m[39m
|
|
38
|
-
[32m✓[39m falls back to filename when no area meta[32m 0[2mms[22m[39m
|
|
39
|
-
[32m✓[39m places request files in subfolder when subarea meta is set[32m 0[2mms[22m[39m
|
|
40
|
-
[32m✓[39m generates folder.yml for subarea with correct name[32m 0[2mms[22m[39m
|
|
41
|
-
[32m✓[39m still generates top-level folder.yml when subarea is set[32m 0[2mms[22m[39m
|
|
42
|
-
[32m✓[39m slugifies subarea for the folder path[32m 0[2mms[22m[39m
|
|
43
|
-
[32m✓[39m places request files directly in folder when no subarea[32m 0[2mms[22m[39m
|
|
44
|
-
[32m✓[39m uses {{baseUrl}} prefix and Bruno :param syntax for path params[32m 0[2mms[22m[39m
|
|
45
|
-
[32m✓[39m generates path params as flat array entries with type: path[32m 0[2mms[22m[39m
|
|
46
|
-
[32m✓[39m uses uuid example value for uuid path params[32m 0[2mms[22m[39m
|
|
47
|
-
[32m✓[39m uses typed example values for scalar path params[32m 0[2mms[22m[39m
|
|
48
|
-
[32m✓[39m uses ISO 8601 duration example value for duration path params[32m 0[2mms[22m[39m
|
|
49
|
-
[32m✓[39m uses first enum value as example for enum path params[32m 0[2mms[22m[39m
|
|
50
|
-
[32m✓[39m falls back to empty string for untyped path params[32m 0[2mms[22m[39m
|
|
51
|
-
[32m✓[39m does not generate params block when path has no params and no query[32m 0[2mms[22m[39m
|
|
52
|
-
[32m✓[39m generates query params as flat array entries with type: query[32m 0[2mms[22m[39m
|
|
53
|
-
[32m✓[39m uses typed example values for query params[32m 0[2mms[22m[39m
|
|
54
|
-
[32m✓[39m falls back to single placeholder entry for ref query params with no registry[32m 0[2mms[22m[39m
|
|
55
|
-
[32m✓[39m expands ref query params into individual fields when model registry provided[32m 0[2mms[22m[39m
|
|
56
|
-
[32m✓[39m mixes path and query params in the same flat array[32m 0[2mms[22m[39m
|
|
57
|
-
[32m✓[39m generates headers block from op.headers inline params[32m 0[2mms[22m[39m
|
|
58
|
-
[32m✓[39m falls back to single placeholder entry for ref header source with no registry[32m 0[2mms[22m[39m
|
|
59
|
-
[32m✓[39m expands ref header source into individual fields when model registry provided[32m 0[2mms[22m[39m
|
|
60
|
-
[32m✓[39m does not generate headers block when op has no headers[32m 0[2mms[22m[39m
|
|
61
|
-
[32m✓[39m generates body with type: json and data block literal for JSON requests[32m 0[2mms[22m[39m
|
|
62
|
-
[32m✓[39m expands inline object body type into a JSON skeleton[32m 0[2mms[22m[39m
|
|
63
|
-
[32m✓[39m uses ISO 8601 duration example value in body skeleton[32m 0[2mms[22m[39m
|
|
64
|
-
[32m✓[39m excludes readonly fields from inline object body skeleton[32m 0[2mms[22m[39m
|
|
65
|
-
[32m✓[39m uses empty object for ref body types when no contractRoots provided[32m 0[2mms[22m[39m
|
|
66
|
-
[32m✓[39m expands ref body type into a JSON skeleton when contractRoots provided[32m 0[2mms[22m[39m
|
|
67
|
-
[32m✓[39m excludes readonly fields from expanded ref body[32m 0[2mms[22m[39m
|
|
68
|
-
[32m✓[39m sets optional fields to null in expanded ref body[32m 0[2mms[22m[39m
|
|
69
|
-
[32m✓[39m expands inherited fields from base model in ref body[32m 0[2mms[22m[39m
|
|
70
|
-
[32m✓[39m uses field default value in body for non-optional fields[32m 0[2mms[22m[39m
|
|
71
|
-
[32m✓[39m uses field default value in body for optional fields[32m 0[2mms[22m[39m
|
|
72
|
-
[32m✓[39m uses field defaults from expanded ref model body[32m 1[2mms[22m[39m
|
|
73
|
-
[32m✓[39m uses first enum value in body[32m 0[2mms[22m[39m
|
|
74
|
-
[32m✓[39m uses example values for nested array fields in body[32m 0[2mms[22m[39m
|
|
75
|
-
[32m✓[39m leaves ref fields as empty objects in body[32m 0[2mms[22m[39m
|
|
76
|
-
[32m✓[39m generates body with type: multipart-form for multipart requests[32m 0[2mms[22m[39m
|
|
77
|
-
[32m✓[39m does not generate body block when no request body[32m 0[2mms[22m[39m
|
|
78
|
-
[32m✓[39m handles empty roots array[32m 0[2mms[22m[39m
|
|
79
|
-
[32m✓[39m derives folder name from file path with directory prefix[32m 0[2mms[22m[39m
|
|
80
|
-
[32m✓[39m does not generate any .bru files[32m 0[2mms[22m[39m
|
|
81
|
-
[32m✓[39m adds bearer auth block to opencollection.yml when security config provided[32m 0[2mms[22m[39m
|
|
82
|
-
[32m✓[39m adds apikey auth block to opencollection.yml[32m 0[2mms[22m[39m
|
|
83
|
-
[32m✓[39m adds basic auth block to opencollection.yml[32m 0[2mms[22m[39m
|
|
84
|
-
[32m✓[39m adds auth env vars to local.yml for bearer[32m 0[2mms[22m[39m
|
|
85
|
-
[32m✓[39m does not add request or auth to opencollection.yml when no security config[32m 0[2mms[22m[39m
|
|
86
|
-
[32m✓[39m adds auth: none inside http block when operation security is none[32m 0[2mms[22m[39m
|
|
87
|
-
[32m✓[39m adds auth: inherit inside http block for normal operations when default scheme is set[32m 0[2mms[22m[39m
|
|
88
|
-
[32m✓[39m does not add auth when no default scheme is set[32m 0[2mms[22m[39m
|
|
89
|
-
[32m✓[39m emits a status-code assertion using the first declared 2xx response[32m 0[2mms[22m[39m
|
|
90
|
-
[32m✓[39m falls back to the first response when no 2xx is declared[32m 0[2mms[22m[39m
|
|
91
|
-
[32m✓[39m does not emit a runtime block when the operation declares no responses[32m 0[2mms[22m[39m
|
|
92
|
-
[32m✓[39m emits assertions for required response headers and lists them in the docs[32m 0[2mms[22m[39m
|
|
93
|
-
[32m✓[39m emits a docs block from the operation description[32m 0[2mms[22m[39m
|
|
94
|
-
[32m✓[39m combines route and operation descriptions into the docs block[32m 0[2mms[22m[39m
|
|
95
|
-
[32m✓[39m does not emit a docs block when no description is set[32m 0[2mms[22m[39m
|
|
96
|
-
[32m✓[39m marks optional query params with disabled: true[32m 0[2mms[22m[39m
|
|
97
|
-
[32m✓[39m marks optional headers with disabled: true[32m 0[2mms[22m[39m
|
|
98
|
-
[32m✓[39m does not mark path params as disabled even though they have no optional flag[32m 0[2mms[22m[39m
|
|
99
|
-
[32m✓[39m marks optional fields from a ref-expanded query model as disabled[32m 0[2mms[22m[39m
|
|
100
|
-
[32m✓[39m emits a manifest listing every generated file[32m 0[2mms[22m[39m
|
|
101
|
-
[32m✓[39m parseManifest returns [] for malformed input[32m 0[2mms[22m[39m
|
|
102
|
-
[32m✓[39m emits Bruno faker templates for compatible scalar params when randomExamples is true[32m 0[2mms[22m[39m
|
|
103
|
-
[32m✓[39m keeps deterministic placeholders when randomExamples is false[32m 0[2mms[22m[39m
|
|
104
|
-
[32m✓[39m uses faker templates inside JSON body skeletons for string-valued scalars[32m 0[2mms[22m[39m
|
|
105
|
-
[32m✓[39m does not override field defaults when randomExamples is true[32m 0[2mms[22m[39m
|
|
106
|
-
[32m✓[39m sanitizePath [2m(5)[22m
|
|
107
|
-
[32m✓[39m converts simple path to filename-safe string[32m 0[2mms[22m[39m
|
|
108
|
-
[32m✓[39m replaces path params with their names[32m 0[2mms[22m[39m
|
|
109
|
-
[32m✓[39m handles multiple segments and params[32m 0[2mms[22m[39m
|
|
110
|
-
[32m✓[39m returns root for bare slash[32m 0[2mms[22m[39m
|
|
111
|
-
[32m✓[39m collapses consecutive dashes[32m 0[2mms[22m[39m
|
|
112
|
-
|
|
113
|
-
[2m Test Files [22m [1m[32m1 passed[39m[22m[90m (1)[39m
|
|
114
|
-
[2m Tests [22m [1m[32m85 passed[39m[22m[90m (85)[39m
|
|
115
|
-
[2m Start at [22m 08:51:09
|
|
116
|
-
[2m Duration [22m 1.08s[2m (transform 161ms, setup 0ms, import 586ms, tests 11ms, environment 0ms)[22m
|
|
117
|
-
|
|
118
|
-
[34m % [39m[2mCoverage report from [22m[33mv8[39m
|
|
119
|
-
-------------------|---------|----------|---------|---------|-------------------------------------------------------------------------------------------------
|
|
120
|
-
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
|
|
121
|
-
-------------------|---------|----------|---------|---------|-------------------------------------------------------------------------------------------------
|
|
122
|
-
[32;1mAll files [0m | [32;1m 83.77[0m | [33;1m 74.26[0m | [32;1m 84.05[0m | [32;1m 85.42[0m | [31;1m [0m
|
|
123
|
-
[32;1m src [0m | [32;1m 86.1[0m | [33;1m 75.1[0m | [32;1m 90.9[0m | [32;1m 87.54[0m | [31;1m [0m
|
|
124
|
-
[32;1m codegen-bruno.ts[0m | [32;1m 86.1[0m | [33;1m 75.1[0m | [32;1m 90.9[0m | [32;1m 87.54[0m | [31;1m239-240,324,332,385-388,395-402,422,428,432-434,450,460,484,494-496,502-504,509,513-521,530,534[0m
|
|
125
|
-
[33;1m tests [0m | [33;1m 68.18[0m | [33;1m 67.74[0m | [33;1m 72[0m | [33;1m 71.05[0m | [31;1m [0m
|
|
126
|
-
[33;1m helpers.ts [0m | [33;1m 68.18[0m | [33;1m 67.74[0m | [33;1m 72[0m | [33;1m 71.05[0m | [31;1m43-47,55-59,71,113,131-135,145 [0m
|
|
127
|
-
-------------------|---------|----------|---------|---------|-------------------------------------------------------------------------------------------------
|
|
128
|
-
[?25h
|
|
1
|
+
|
|
2
|
+
> @contractkit/plugin-bruno@1.0.0 test:ci /home/runner/work/ContractKit/ContractKit/packages/plugin-bruno
|
|
3
|
+
> vitest run --coverage
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
[1m[30m[46m RUN [49m[39m[22m [36mv4.1.5 [39m[90m/home/runner/work/ContractKit/ContractKit/packages/plugin-bruno[39m
|
|
7
|
+
[2mCoverage enabled with [22m[33mv8[39m
|
|
8
|
+
|
|
9
|
+
[32m✓[39m tests/codegen-bruno.test.ts [2m([22m[2m96 tests[22m[2m)[22m[33m 489[2mms[22m[39m
|
|
10
|
+
|
|
11
|
+
[2m Test Files [22m [1m[32m1 passed[39m[22m[90m (1)[39m
|
|
12
|
+
[2m Tests [22m [1m[32m96 passed[39m[22m[90m (96)[39m
|
|
13
|
+
[2m Start at [22m 18:49:07
|
|
14
|
+
[2m Duration [22m 4.73s[2m (transform 1.31s, setup 0ms, import 3.04s, tests 489ms, environment 0ms)[22m
|
|
15
|
+
|
|
16
|
+
[34m % [39m[2mCoverage report from [22m[33mv8[39m
|
|
17
|
+
-------------------|---------|----------|---------|---------|-------------------------------------------------------------------------------------------------
|
|
18
|
+
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
|
|
19
|
+
-------------------|---------|----------|---------|---------|-------------------------------------------------------------------------------------------------
|
|
20
|
+
All files | 85.26 | 76.65 | 85.91 | 87.05 |
|
|
21
|
+
src | 86.73 | 76.56 | 91.3 | 88.19 |
|
|
22
|
+
codegen-bruno.ts | 86.73 | 76.56 | 91.3 | 88.19 | 285-286,370,378,431-434,441-448,468,474,478-480,496,506,530,540-542,548-550,555,559-567,576,580
|
|
23
|
+
tests | 75 | 77.41 | 76 | 78.94 |
|
|
24
|
+
helpers.ts | 75 | 77.41 | 76 | 78.94 | 43-47,55-59,71,113,133,145
|
|
25
|
+
-------------------|---------|----------|---------|---------|-------------------------------------------------------------------------------------------------
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# @contractkit/contractkit-plugin-bruno
|
|
2
2
|
|
|
3
|
+
## 1.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 7555412: Drop the `overrideDir` config option from the Bruno plugin.
|
|
8
|
+
|
|
9
|
+
Per-operation overrides via `plugins: { bruno: "..." }` combined with the new `{{var}}` substitution in `.ck` files cover the same use cases more directly. Define a shared base path once in `options { keys: { bruno: "../bruno-overrides" } }` (or in the plugin's `keys` config in `contractkit.config.json` for a workspace-wide default) and reference per-operation override files with `plugins: { bruno: "{{bruno}}/path/to/file.yml" }`.
|
|
10
|
+
|
|
11
|
+
Migration: replace the `overrideDir` entry in your plugin config with a per-operation `plugins.bruno` declaration on each operation that needs an override.
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [7555412]
|
|
16
|
+
- @contractkit/core@0.13.0
|
|
17
|
+
|
|
18
|
+
## 0.10.0
|
|
19
|
+
|
|
20
|
+
### Minor Changes
|
|
21
|
+
|
|
22
|
+
- 876696f: Omit optional fields from generated request body skeletons instead of emitting them as `null`.
|
|
23
|
+
|
|
24
|
+
Previously, an optional field with no default produced `"nickname": null` in the example JSON body. The field is now absent so the example body sends only what the contract actually requires, matching how most APIs treat "omit" vs. "explicit null".
|
|
25
|
+
|
|
26
|
+
- f2d6a74: Add YAML override support to the Bruno plugin via per-operation plugin files and a new `overrideDir` config option.
|
|
27
|
+
|
|
28
|
+
Per-operation overrides: declare `plugins: { bruno: "override.yml" }` on an operation in a `.ck` file and the file's YAML content is deep-merged into the generated request file at codegen time. Objects recurse; arrays replace entirely.
|
|
29
|
+
|
|
30
|
+
Directory overrides: set `overrideDir` in the plugin config to a directory that mirrors the generated output structure. Any file found there is deep-merged into the matching generated file, enabling overrides for collection-level files (`opencollection.yml`, `environments/local.yml`) as well as individual request files.
|
|
31
|
+
|
|
32
|
+
The `mergePluginFile` function is now exported from `@contractkit/plugin-bruno` for use in custom tooling.
|
|
33
|
+
|
|
34
|
+
### Patch Changes
|
|
35
|
+
|
|
36
|
+
- Updated dependencies [876696f]
|
|
37
|
+
- @contractkit/core@0.12.0
|
|
38
|
+
|
|
3
39
|
## 0.9.1
|
|
4
40
|
|
|
5
41
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -38,6 +38,7 @@ pnpm add @contractkit/contractkit-plugin-bruno
|
|
|
38
38
|
| `output` | `string` | `"bruno-collection"` | Output directory name |
|
|
39
39
|
| `collectionName` | `string` | basename of `rootDir` | Collection name shown in Bruno |
|
|
40
40
|
| `randomExamples` | `boolean` | `true` | Use Bruno faker templates (`{{$randomUUID}}`, `{{$randomEmail}}`, etc.) for compatible scalar fields so each send produces fresh data. Set to `false` for stable, deterministic placeholders. |
|
|
41
|
+
| `includeInternal` | `boolean` | `true` | Include operations marked `internal`. Set to `false` to omit them from the collection. |
|
|
41
42
|
| `auth.defaultScheme` | `string` | — | Key from `auth.schemes` to apply by default |
|
|
42
43
|
| `auth.schemes` | `object` | — | Map of scheme name → security scheme definition |
|
|
43
44
|
|
|
@@ -62,6 +63,46 @@ bruno-collection/
|
|
|
62
63
|
|
|
63
64
|
The output directory is fully replaced on each run — stale request files from removed operations are automatically cleaned up.
|
|
64
65
|
|
|
66
|
+
## Per-operation overrides
|
|
67
|
+
|
|
68
|
+
Add a `plugins` block to any operation in a `.ck` file to deep-merge a YAML file into the generated request:
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
post: {
|
|
72
|
+
plugins: {
|
|
73
|
+
bruno: "overrides/auth-token.yml"
|
|
74
|
+
}
|
|
75
|
+
response: { 200: AuthResponse }
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
The file path is relative to the `.ck` source file. Its content is deep-merged into the generated request YAML — objects recurse, arrays replace entirely:
|
|
80
|
+
|
|
81
|
+
```yaml
|
|
82
|
+
# overrides/auth-token.yml
|
|
83
|
+
runtime:
|
|
84
|
+
script:
|
|
85
|
+
req: |
|
|
86
|
+
bru.setVar("token", bru.getEnvVar("adminToken"));
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Authoring tip: combine per-operation `plugins.bruno` paths with `{{var}}` substitution to factor out a shared override directory:
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
options {
|
|
93
|
+
keys: { bruno: "../../bruno-overrides" }
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
operation /payments/{id}: {
|
|
97
|
+
get: {
|
|
98
|
+
plugins: { bruno: "{{bruno}}/payments/get-payment.yml" }
|
|
99
|
+
response: { 200: { application/json: Payment } }
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
The `{{bruno}}` reference can also be supplied workspace-wide via the plugin's `keys` config in `contractkit.config.json`.
|
|
105
|
+
|
|
65
106
|
## Programmatic use
|
|
66
107
|
|
|
67
108
|
```typescript
|