@contractkit/openapi-to-ck 0.8.2 → 0.9.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.
@@ -7,12 +7,12 @@ $ tsup src/index.ts src/plugin.ts --format esm --sourcemap --dts && tsc --emitDe
7
7
  ESM Build start
8
8
  ESM dist/index.js 498.00 B
9
9
  ESM dist/plugin.js 2.51 KB
10
- ESM dist/chunk-YOTHJ2V4.js 50.45 KB
10
+ ESM dist/chunk-FMEMOXYD.js 50.70 KB
11
11
  ESM dist/index.js.map 71.00 B
12
12
  ESM dist/plugin.js.map 4.95 KB
13
- ESM dist/chunk-YOTHJ2V4.js.map 116.74 KB
14
- ESM ⚡️ Build success in 246ms
13
+ ESM dist/chunk-FMEMOXYD.js.map 117.30 KB
14
+ ESM ⚡️ Build success in 192ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 8261ms
16
+ DTS ⚡️ Build success in 7684ms
17
17
  DTS dist/index.d.ts 8.29 KB
18
18
  DTS dist/plugin.d.ts 128.00 B
@@ -3,25 +3,25 @@ $ vitest run --coverage
3
3
   RUN  v4.1.5 /home/runner/work/ContractKit/ContractKit/packages/openapi-to-ck
4
4
  Coverage enabled with v8
5
5
 
6
- ✓ tests/schema-to-ast.test.ts (36 tests) 142ms
7
- ✓ tests/ast-to-ck.test.ts (35 tests) 121ms
8
- ✓ tests/normalize.test.ts (6 tests) 18ms
9
- ✓ tests/tag-splitter.test.ts (5 tests) 61ms
10
- ✓ tests/circular-refs.test.ts (8 tests) 37ms
11
- ✓ tests/convert.test.ts (16 tests) 286ms
6
+ ✓ tests/ast-to-ck.test.ts (37 tests) 98ms
7
+ ✓ tests/schema-to-ast.test.ts (36 tests) 68ms
8
+ ✓ tests/tag-splitter.test.ts (5 tests) 55ms
9
+ ✓ tests/normalize.test.ts (6 tests) 54ms
10
+ ✓ tests/convert.test.ts (16 tests) 220ms
11
+ ✓ tests/circular-refs.test.ts (8 tests) 31ms
12
12
 
13
13
   Test Files  6 passed (6)
14
-  Tests  106 passed (106)
15
-  Start at  20:26:29
16
-  Duration  5.49s (transform 2.60s, setup 0ms, import 5.39s, tests 665ms, environment 1ms)
14
+  Tests  108 passed (108)
15
+  Start at  19:14:39
16
+  Duration  4.94s (transform 2.07s, setup 0ms, import 5.62s, tests 526ms, environment 1ms)
17
17
 
18
18
   % Coverage report from v8
19
19
  -------------------|---------|----------|---------|---------|-------------------------------------------------------------
20
20
  File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
21
21
  -------------------|---------|----------|---------|---------|-------------------------------------------------------------
22
- All files | 80.95 | 70.17 | 94.69 | 83.47 |
23
- src | 80.72 | 70.45 | 93.47 | 83.1 |
24
- ast-to-ck.ts | 90.27 | 81.48 | 100 | 91.5 | 82-92,169,264,296-297,312,345-346,356,417
22
+ All files | 81.27 | 70.78 | 94.69 | 83.8 |
23
+ src | 81.05 | 71.07 | 93.47 | 83.45 |
24
+ ast-to-ck.ts | 91.4 | 83.76 | 100 | 92.68 | 82-92,169,264,319,352-353,363,424
25
25
  circular-refs.ts | 100 | 90 | 100 | 100 | 20-23
26
26
  convert.ts | 77.19 | 87.5 | 80 | 77.77 | 83-98,112-117
27
27
  normalize.ts | 62.96 | 56.6 | 80 | 63.33 | 79,121-163,237-255,270-271,280-309,346,350,358
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @contractkit/openapi-to-ck
2
2
 
3
+ ## 0.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - fff30df: Add a block form to the operation `signature:` key. Alongside the existing bare form (`signature: KEY`), you can now write `signature: { options: KEY, policy: name }` to attach a signature-scoped policy. The policy is passed through to the generated `requireSignature(KEY, { policy: name })` middleware and surfaces in OpenAPI-to-`.ck` output, Markdown docs, and the explorer UI. The bare form is unchanged and remains shorthand for a block with only `options:`.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [fff30df]
12
+ - @contractkit/core@0.21.0
13
+
3
14
  ## 0.8.2
4
15
 
5
16
  ### Patch Changes
@@ -1,26 +1,26 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <coverage generated="1778876795559" clover="3.2.0">
3
- <project timestamp="1778876795559" name="All files">
4
- <metrics statements="835" coveredstatements="697" conditionals="751" coveredconditionals="527" methods="113" coveredmethods="107" elements="1699" coveredelements="1331" complexity="0" loc="835" ncloc="835" packages="2" files="9" classes="9"/>
2
+ <coverage generated="1781291684488" clover="3.2.0">
3
+ <project timestamp="1781291684488" name="All files">
4
+ <metrics statements="840" coveredstatements="704" conditionals="753" coveredconditionals="533" methods="113" coveredmethods="107" elements="1706" coveredelements="1344" complexity="0" loc="840" ncloc="840" packages="2" files="9" classes="9"/>
5
5
  <package name="src">
6
- <metrics statements="805" coveredstatements="669" conditionals="731" coveredconditionals="515" methods="92" coveredmethods="86"/>
6
+ <metrics statements="810" coveredstatements="676" conditionals="733" coveredconditionals="521" methods="92" coveredmethods="86"/>
7
7
  <file name="ast-to-ck.ts" path="/home/runner/work/ContractKit/ContractKit/packages/openapi-to-ck/src/ast-to-ck.ts">
8
- <metrics statements="200" coveredstatements="183" conditionals="189" coveredconditionals="154" methods="18" coveredmethods="18"/>
8
+ <metrics statements="205" coveredstatements="190" conditionals="191" coveredconditionals="160" methods="18" coveredmethods="18"/>
9
9
  <line num="17" count="2" type="stmt"/>
10
- <line num="27" count="47" type="cond" truecount="1" falsecount="0"/>
11
- <line num="28" count="47" type="stmt"/>
12
- <line num="29" count="47" type="stmt"/>
13
- <line num="32" count="47" type="stmt"/>
14
- <line num="33" count="47" type="cond" truecount="2" falsecount="0"/>
15
- <line num="36" count="47" type="stmt"/>
10
+ <line num="27" count="49" type="cond" truecount="1" falsecount="0"/>
11
+ <line num="28" count="49" type="stmt"/>
12
+ <line num="29" count="49" type="stmt"/>
13
+ <line num="32" count="49" type="stmt"/>
14
+ <line num="33" count="49" type="cond" truecount="2" falsecount="0"/>
15
+ <line num="36" count="49" type="stmt"/>
16
16
  <line num="37" count="46" type="stmt"/>
17
- <line num="41" count="47" type="stmt"/>
18
- <line num="42" count="45" type="stmt"/>
19
- <line num="45" count="47" type="stmt"/>
20
- <line num="57" count="47" type="stmt"/>
21
- <line num="58" count="47" type="cond" truecount="2" falsecount="0"/>
22
- <line num="59" count="47" type="stmt"/>
23
- <line num="61" count="47" type="cond" truecount="5" falsecount="0"/>
17
+ <line num="41" count="49" type="stmt"/>
18
+ <line num="42" count="47" type="stmt"/>
19
+ <line num="45" count="49" type="stmt"/>
20
+ <line num="57" count="49" type="stmt"/>
21
+ <line num="58" count="49" type="cond" truecount="2" falsecount="0"/>
22
+ <line num="59" count="49" type="stmt"/>
23
+ <line num="61" count="49" type="cond" truecount="5" falsecount="0"/>
24
24
  <line num="63" count="11" type="stmt"/>
25
25
  <line num="65" count="11" type="cond" truecount="2" falsecount="0"/>
26
26
  <line num="66" count="10" type="stmt"/>
@@ -114,98 +114,103 @@
114
114
  <line num="242" count="2" type="stmt"/>
115
115
  <line num="244" count="1" type="stmt"/>
116
116
  <line num="245" count="1" type="stmt"/>
117
- <line num="251" count="45" type="stmt"/>
118
- <line num="253" count="45" type="stmt"/>
119
- <line num="254" count="45" type="cond" truecount="3" falsecount="1"/>
120
- <line num="255" count="45" type="stmt"/>
121
- <line num="258" count="45" type="cond" truecount="2" falsecount="0"/>
117
+ <line num="251" count="47" type="stmt"/>
118
+ <line num="253" count="47" type="stmt"/>
119
+ <line num="254" count="47" type="cond" truecount="3" falsecount="1"/>
120
+ <line num="255" count="47" type="stmt"/>
121
+ <line num="258" count="47" type="cond" truecount="2" falsecount="0"/>
122
122
  <line num="259" count="13" type="stmt"/>
123
- <line num="263" count="45" type="cond" truecount="1" falsecount="1"/>
123
+ <line num="263" count="47" type="cond" truecount="1" falsecount="1"/>
124
124
  <line num="264" count="0" type="stmt"/>
125
- <line num="268" count="45" type="stmt"/>
126
- <line num="269" count="66" type="stmt"/>
127
- <line num="272" count="45" type="stmt"/>
128
- <line num="273" count="45" type="stmt"/>
129
- <line num="277" count="66" type="stmt"/>
130
- <line num="278" count="66" type="stmt"/>
131
- <line num="279" count="66" type="cond" truecount="3" falsecount="1"/>
132
- <line num="280" count="66" type="stmt"/>
133
- <line num="282" count="66" type="stmt"/>
134
- <line num="285" count="66" type="cond" truecount="2" falsecount="0"/>
125
+ <line num="268" count="47" type="stmt"/>
126
+ <line num="269" count="68" type="stmt"/>
127
+ <line num="272" count="47" type="stmt"/>
128
+ <line num="273" count="47" type="stmt"/>
129
+ <line num="277" count="68" type="stmt"/>
130
+ <line num="278" count="68" type="stmt"/>
131
+ <line num="279" count="68" type="cond" truecount="3" falsecount="1"/>
132
+ <line num="280" count="68" type="stmt"/>
133
+ <line num="282" count="68" type="stmt"/>
134
+ <line num="285" count="68" type="cond" truecount="2" falsecount="0"/>
135
135
  <line num="286" count="2" type="stmt"/>
136
- <line num="290" count="66" type="cond" truecount="2" falsecount="0"/>
136
+ <line num="290" count="68" type="cond" truecount="2" falsecount="0"/>
137
137
  <line num="291" count="55" type="stmt"/>
138
- <line num="295" count="66" type="cond" truecount="1" falsecount="1"/>
139
- <line num="296" count="0" type="cond" truecount="0" falsecount="4"/>
140
- <line num="297" count="0" type="stmt"/>
141
- <line num="301" count="66" type="cond" truecount="2" falsecount="0"/>
142
- <line num="302" count="12" type="stmt"/>
143
- <line num="306" count="66" type="cond" truecount="2" falsecount="0"/>
144
- <line num="307" count="11" type="stmt"/>
145
- <line num="311" count="66" type="cond" truecount="1" falsecount="1"/>
146
- <line num="312" count="0" type="stmt"/>
147
- <line num="316" count="66" type="cond" truecount="2" falsecount="0"/>
148
- <line num="317" count="12" type="stmt"/>
149
- <line num="321" count="66" type="cond" truecount="1" falsecount="1"/>
150
- <line num="322" count="66" type="stmt"/>
151
- <line num="325" count="66" type="stmt"/>
152
- <line num="326" count="66" type="stmt"/>
153
- <line num="330" count="111" type="cond" truecount="4" falsecount="0"/>
154
- <line num="331" count="1" type="stmt"/>
155
- <line num="335" count="24" type="stmt"/>
156
- <line num="338" count="24" type="cond" truecount="2" falsecount="0"/>
157
- <line num="339" count="1" type="stmt"/>
158
- <line num="340" count="1" type="stmt"/>
159
- <line num="344" count="23" type="cond" truecount="1" falsecount="1"/>
160
- <line num="345" count="0" type="stmt"/>
161
- <line num="346" count="0" type="stmt"/>
162
- <line num="350" count="23" type="cond" truecount="1" falsecount="1"/>
163
- <line num="351" count="24" type="stmt"/>
164
- <line num="352" count="24" type="stmt"/>
165
- <line num="353" count="23" type="cond" truecount="2" falsecount="0"/>
166
- <line num="354" count="23" type="stmt"/>
167
- <line num="355" count="23" type="cond" truecount="2" falsecount="2"/>
168
- <line num="356" count="0" type="stmt"/>
169
- <line num="358" count="23" type="cond" truecount="1" falsecount="1"/>
170
- <line num="359" count="23" type="cond" truecount="3" falsecount="1"/>
171
- <line num="360" count="23" type="stmt"/>
172
- <line num="362" count="23" type="stmt"/>
173
- <line num="366" count="12" type="stmt"/>
174
- <line num="367" count="12" type="stmt"/>
175
- <line num="368" count="12" type="stmt"/>
176
- <line num="369" count="12" type="stmt"/>
177
- <line num="371" count="12" type="stmt"/>
178
- <line num="375" count="66" type="stmt"/>
179
- <line num="376" count="66" type="stmt"/>
180
- <line num="377" count="66" type="stmt"/>
181
- <line num="378" count="76" type="cond" truecount="2" falsecount="0"/>
182
- <line num="379" count="76" type="cond" truecount="2" falsecount="0"/>
183
- <line num="380" count="76" type="cond" truecount="4" falsecount="0"/>
184
- <line num="381" count="54" type="stmt"/>
185
- <line num="382" count="54" type="cond" truecount="2" falsecount="0"/>
186
- <line num="383" count="53" type="stmt"/>
187
- <line num="385" count="54" type="cond" truecount="2" falsecount="0"/>
188
- <line num="386" count="3" type="stmt"/>
189
- <line num="387" count="3" type="stmt"/>
190
- <line num="388" count="4" type="cond" truecount="2" falsecount="0"/>
191
- <line num="389" count="4" type="cond" truecount="2" falsecount="0"/>
192
- <line num="390" count="4" type="stmt"/>
193
- <line num="392" count="3" type="stmt"/>
194
- <line num="394" count="54" type="stmt"/>
195
- <line num="396" count="22" type="stmt"/>
196
- <line num="399" count="66" type="stmt"/>
197
- <line num="403" count="12" type="stmt"/>
198
- <line num="404" count="12" type="cond" truecount="2" falsecount="0"/>
199
- <line num="405" count="11" type="stmt"/>
200
- <line num="406" count="11" type="stmt"/>
201
- <line num="409" count="1" type="stmt"/>
202
- <line num="410" count="1" type="cond" truecount="1" falsecount="1"/>
203
- <line num="411" count="1" type="cond" truecount="3" falsecount="1"/>
204
- <line num="412" count="1" type="cond" truecount="1" falsecount="1"/>
205
- <line num="413" count="1" type="stmt"/>
206
- <line num="414" count="1" type="stmt"/>
207
- <line num="415" count="1" type="stmt"/>
208
- <line num="417" count="0" type="stmt"/>
138
+ <line num="295" count="68" type="cond" truecount="2" falsecount="0"/>
139
+ <line num="296" count="2" type="cond" truecount="3" falsecount="1"/>
140
+ <line num="297" count="2" type="cond" truecount="2" falsecount="0"/>
141
+ <line num="298" count="1" type="stmt"/>
142
+ <line num="299" count="1" type="stmt"/>
143
+ <line num="300" count="1" type="stmt"/>
144
+ <line num="301" count="1" type="stmt"/>
145
+ <line num="303" count="1" type="stmt"/>
146
+ <line num="308" count="68" type="cond" truecount="2" falsecount="0"/>
147
+ <line num="309" count="12" type="stmt"/>
148
+ <line num="313" count="68" type="cond" truecount="2" falsecount="0"/>
149
+ <line num="314" count="11" type="stmt"/>
150
+ <line num="318" count="68" type="cond" truecount="1" falsecount="1"/>
151
+ <line num="319" count="0" type="stmt"/>
152
+ <line num="323" count="68" type="cond" truecount="2" falsecount="0"/>
153
+ <line num="324" count="12" type="stmt"/>
154
+ <line num="328" count="68" type="cond" truecount="1" falsecount="1"/>
155
+ <line num="329" count="68" type="stmt"/>
156
+ <line num="332" count="68" type="stmt"/>
157
+ <line num="333" count="68" type="stmt"/>
158
+ <line num="337" count="115" type="cond" truecount="4" falsecount="0"/>
159
+ <line num="338" count="1" type="stmt"/>
160
+ <line num="342" count="24" type="stmt"/>
161
+ <line num="345" count="24" type="cond" truecount="2" falsecount="0"/>
162
+ <line num="346" count="1" type="stmt"/>
163
+ <line num="347" count="1" type="stmt"/>
164
+ <line num="351" count="23" type="cond" truecount="1" falsecount="1"/>
165
+ <line num="352" count="0" type="stmt"/>
166
+ <line num="353" count="0" type="stmt"/>
167
+ <line num="357" count="23" type="cond" truecount="1" falsecount="1"/>
168
+ <line num="358" count="24" type="stmt"/>
169
+ <line num="359" count="24" type="stmt"/>
170
+ <line num="360" count="23" type="cond" truecount="2" falsecount="0"/>
171
+ <line num="361" count="23" type="stmt"/>
172
+ <line num="362" count="23" type="cond" truecount="2" falsecount="2"/>
173
+ <line num="363" count="0" type="stmt"/>
174
+ <line num="365" count="23" type="cond" truecount="1" falsecount="1"/>
175
+ <line num="366" count="23" type="cond" truecount="3" falsecount="1"/>
176
+ <line num="367" count="23" type="stmt"/>
177
+ <line num="369" count="23" type="stmt"/>
178
+ <line num="373" count="12" type="stmt"/>
179
+ <line num="374" count="12" type="stmt"/>
180
+ <line num="375" count="12" type="stmt"/>
181
+ <line num="376" count="12" type="stmt"/>
182
+ <line num="378" count="12" type="stmt"/>
183
+ <line num="382" count="68" type="stmt"/>
184
+ <line num="383" count="68" type="stmt"/>
185
+ <line num="384" count="68" type="stmt"/>
186
+ <line num="385" count="78" type="cond" truecount="2" falsecount="0"/>
187
+ <line num="386" count="78" type="cond" truecount="2" falsecount="0"/>
188
+ <line num="387" count="78" type="cond" truecount="4" falsecount="0"/>
189
+ <line num="388" count="54" type="stmt"/>
190
+ <line num="389" count="54" type="cond" truecount="2" falsecount="0"/>
191
+ <line num="390" count="53" type="stmt"/>
192
+ <line num="392" count="54" type="cond" truecount="2" falsecount="0"/>
193
+ <line num="393" count="3" type="stmt"/>
194
+ <line num="394" count="3" type="stmt"/>
195
+ <line num="395" count="4" type="cond" truecount="2" falsecount="0"/>
196
+ <line num="396" count="4" type="cond" truecount="2" falsecount="0"/>
197
+ <line num="397" count="4" type="stmt"/>
198
+ <line num="399" count="3" type="stmt"/>
199
+ <line num="401" count="54" type="stmt"/>
200
+ <line num="403" count="24" type="stmt"/>
201
+ <line num="406" count="68" type="stmt"/>
202
+ <line num="410" count="12" type="stmt"/>
203
+ <line num="411" count="12" type="cond" truecount="2" falsecount="0"/>
204
+ <line num="412" count="11" type="stmt"/>
205
+ <line num="413" count="11" type="stmt"/>
206
+ <line num="416" count="1" type="stmt"/>
207
+ <line num="417" count="1" type="cond" truecount="1" falsecount="1"/>
208
+ <line num="418" count="1" type="cond" truecount="3" falsecount="1"/>
209
+ <line num="419" count="1" type="cond" truecount="1" falsecount="1"/>
210
+ <line num="420" count="1" type="stmt"/>
211
+ <line num="421" count="1" type="stmt"/>
212
+ <line num="422" count="1" type="stmt"/>
213
+ <line num="424" count="0" type="stmt"/>
209
214
  </file>
210
215
  <file name="circular-refs.ts" path="/home/runner/work/ContractKit/ContractKit/packages/openapi-to-ck/src/circular-refs.ts">
211
216
  <metrics statements="33" coveredstatements="33" conditionals="20" coveredconditionals="18" methods="5" coveredmethods="5"/>
@@ -838,7 +843,7 @@
838
843
  <metrics statements="30" coveredstatements="28" conditionals="20" coveredconditionals="12" methods="21" coveredmethods="21"/>
839
844
  <file name="helpers.ts" path="/home/runner/work/ContractKit/ContractKit/packages/openapi-to-ck/tests/helpers.ts">
840
845
  <metrics statements="30" coveredstatements="28" conditionals="20" coveredconditionals="12" methods="21" coveredmethods="21"/>
841
- <line num="32" count="74" type="stmt"/>
846
+ <line num="32" count="78" type="stmt"/>
842
847
  <line num="36" count="42" type="stmt"/>
843
848
  <line num="40" count="9" type="stmt"/>
844
849
  <line num="44" count="1" type="stmt"/>
@@ -852,22 +857,22 @@
852
857
  <line num="76" count="1" type="stmt"/>
853
858
  <line num="80" count="23" type="stmt"/>
854
859
  <line num="92" count="15" type="stmt"/>
855
- <line num="102" count="23" type="stmt"/>
860
+ <line num="102" count="25" type="stmt"/>
856
861
  <line num="114" count="1" type="stmt"/>
857
862
  <line num="118" count="2" type="stmt"/>
858
- <line num="129" count="15" type="stmt"/>
863
+ <line num="129" count="17" type="stmt"/>
859
864
  <line num="135" count="4" type="cond" truecount="1" falsecount="1"/>
860
865
  <line num="136" count="4" type="cond" truecount="2" falsecount="0"/>
861
866
  <line num="137" count="1" type="cond" truecount="1" falsecount="1"/>
862
867
  <line num="138" count="0" type="cond" truecount="0" falsecount="5"/>
863
868
  <line num="139" count="0" type="stmt"/>
864
- <line num="143" count="18" type="stmt"/>
865
- <line num="144" count="18" type="cond" truecount="2" falsecount="0"/>
866
- <line num="145" count="18" type="cond" truecount="1" falsecount="1"/>
867
- <line num="146" count="18" type="stmt"/>
868
- <line num="155" count="17" type="stmt"/>
869
- <line num="156" count="17" type="cond" truecount="2" falsecount="0"/>
870
- <line num="157" count="17" type="stmt"/>
869
+ <line num="143" count="20" type="stmt"/>
870
+ <line num="144" count="20" type="cond" truecount="2" falsecount="0"/>
871
+ <line num="145" count="20" type="cond" truecount="1" falsecount="1"/>
872
+ <line num="146" count="20" type="stmt"/>
873
+ <line num="155" count="19" type="stmt"/>
874
+ <line num="156" count="19" type="cond" truecount="2" falsecount="0"/>
875
+ <line num="157" count="19" type="stmt"/>
871
876
  </file>
872
877
  </package>
873
878
  </project>