@contractkit/plugin-typescript
Advanced tools
@@ -8,7 +8,7 @@ $ eslint --max-warnings=0 && pnpm run build | ||
| [34mESM[39m Build start | ||
| [32mESM[39m [1mdist/index.js [22m[32m150.24 KB[39m | ||
| [32mESM[39m [1mdist/index.js.map [22m[32m328.17 KB[39m | ||
| [32mESM[39m ⚡️ Build success in 444ms | ||
| [32mESM[39m [1mdist/index.js [22m[32m150.35 KB[39m | ||
| [32mESM[39m [1mdist/index.js.map [22m[32m328.43 KB[39m | ||
| [32mESM[39m ⚡️ Build success in 348ms | ||
| [34mDTS[39m Build start | ||
| [32mDTS[39m ⚡️ Build success in 6175ms | ||
| [32mDTS[39m ⚡️ Build success in 7174ms | ||
| [32mDTS[39m [1mdist/index.d.ts [22m[32m1.82 KB[39m |
@@ -6,13 +6,13 @@ $ vitest run --coverage | ||
| [32m✓[39m tests/codegen-sdk.test.ts [2m([22m[2m132 tests[22m[2m)[22m[32m 231[2mms[22m[39m | ||
| [32m✓[39m tests/codegen-operation.test.ts [2m([22m[2m88 tests[22m[2m)[22m[32m 186[2mms[22m[39m | ||
| [32m✓[39m tests/codegen-contract.test.ts [2m([22m[2m127 tests[22m[2m)[22m[32m 163[2mms[22m[39m | ||
| [32m✓[39m tests/codegen-server.test.ts [2m([22m[2m19 tests[22m[2m)[22m[32m 90[2mms[22m[39m | ||
| [32m✓[39m tests/codegen-plain-types.test.ts [2m([22m[2m61 tests[22m[2m)[22m[32m 63[2mms[22m[39m | ||
| [32m✓[39m tests/pipeline.test.ts [2m([22m[2m25 tests[22m[2m)[22m[32m 242[2mms[22m[39m | ||
| [32m✓[39m tests/codegen-contract.test.ts [2m([22m[2m127 tests[22m[2m)[22m[32m 167[2mms[22m[39m | ||
| [32m✓[39m tests/codegen-operation.test.ts [2m([22m[2m89 tests[22m[2m)[22m[32m 187[2mms[22m[39m | ||
| [32m✓[39m tests/codegen-sdk.test.ts [2m([22m[2m132 tests[22m[2m)[22m[32m 186[2mms[22m[39m | ||
| [32m✓[39m tests/codegen-plain-types.test.ts [2m([22m[2m61 tests[22m[2m)[22m[32m 51[2mms[22m[39m | ||
| [32m✓[39m tests/codegen-server.test.ts [2m([22m[2m19 tests[22m[2m)[22m[32m 74[2mms[22m[39m | ||
| [32m✓[39m tests/pipeline.test.ts [2m([22m[2m25 tests[22m[2m)[22m[32m 177[2mms[22m[39m | ||
| [2m Test Files [22m [1m[32m6 passed[39m[22m[90m (6)[39m | ||
| [2m Tests [22m [1m[32m452 passed[39m[22m[90m (452)[39m | ||
| [2m Start at [22m 13:07:26 | ||
| [2m Duration [22m 7.02s[2m (transform 3.96s, setup 0ms, import 13.06s, tests 975ms, environment 1ms)[22m | ||
| [2m Tests [22m [1m[32m453 passed[39m[22m[90m (453)[39m | ||
| [2m Start at [22m 19:14:39 | ||
| [2m Duration [22m 7.36s[2m (transform 4.18s, setup 0ms, import 14.22s, tests 841ms, environment 12ms)[22m | ||
@@ -23,6 +23,6 @@ [34m % [39m[2mCoverage report from [22m[33mv8[39m | ||
| -------------------|---------|----------|---------|---------|------------------- | ||
| All files | 80.04 | 75.34 | 83.66 | 82.63 | | ||
| src | 79.83 | 75.03 | 83.24 | 82.4 | | ||
| All files | 80.05 | 75.37 | 83.66 | 82.64 | | ||
| src | 79.83 | 75.06 | 83.24 | 82.41 | | ||
| ...n-contract.ts | 87.92 | 82.7 | 90.08 | 89.06 | ...1085,1090-1091 | ||
| ...-operation.ts | 78.37 | 74.56 | 78.94 | 79.85 | ...77-688,693-694 | ||
| ...-operation.ts | 78.41 | 74.7 | 78.94 | 79.9 | ...80-691,696-697 | ||
| ...lain-types.ts | 89.08 | 78.37 | 96.66 | 92.3 | ...31,243,249,301 | ||
@@ -29,0 +29,0 @@ codegen-sdk.ts | 88.09 | 82.56 | 87.32 | 91.32 | ...1108-1109,1112 |
+11
-0
| # @contractkit/contractkit-plugin-typescript | ||
| ## 0.26.0 | ||
| ### Minor Changes | ||
| - 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:`. | ||
| ### Patch Changes | ||
| - Updated dependencies [fff30df] | ||
| - @contractkit/core@0.21.0 | ||
| ## 0.25.4 | ||
@@ -4,0 +15,0 @@ |
+12
-12
@@ -26,5 +26,5 @@ | ||
| <div class='fl pad1y space-right2'> | ||
| <span class="strong">80.04% </span> | ||
| <span class="strong">80.05% </span> | ||
| <span class="quiet">Statements</span> | ||
| <span class='fraction'>2038/2546</span> | ||
| <span class='fraction'>2039/2547</span> | ||
| </div> | ||
@@ -34,5 +34,5 @@ | ||
| <div class='fl pad1y space-right2'> | ||
| <span class="strong">75.34% </span> | ||
| <span class="strong">75.37% </span> | ||
| <span class="quiet">Branches</span> | ||
| <span class='fraction'>1238/1643</span> | ||
| <span class='fraction'>1240/1645</span> | ||
| </div> | ||
@@ -49,5 +49,5 @@ | ||
| <div class='fl pad1y space-right2'> | ||
| <span class="strong">82.63% </span> | ||
| <span class="strong">82.64% </span> | ||
| <span class="quiet">Lines</span> | ||
| <span class='fraction'>1785/2160</span> | ||
| <span class='fraction'>1786/2161</span> | ||
| </div> | ||
@@ -90,9 +90,9 @@ | ||
| <td data-value="79.83" class="pct medium">79.83%</td> | ||
| <td data-value="2494" class="abs medium">1991/2494</td> | ||
| <td data-value="75.03" class="pct medium">75.03%</td> | ||
| <td data-value="1610" class="abs medium">1208/1610</td> | ||
| <td data-value="2495" class="abs medium">1992/2495</td> | ||
| <td data-value="75.06" class="pct medium">75.06%</td> | ||
| <td data-value="1612" class="abs medium">1210/1612</td> | ||
| <td data-value="83.24" class="pct high">83.24%</td> | ||
| <td data-value="376" class="abs high">313/376</td> | ||
| <td data-value="82.4" class="pct high">82.4%</td> | ||
| <td data-value="2114" class="abs high">1742/2114</td> | ||
| <td data-value="82.41" class="pct high">82.41%</td> | ||
| <td data-value="2115" class="abs high">1743/2115</td> | ||
| </tr> | ||
@@ -123,3 +123,3 @@ | ||
| <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a> | ||
| at 2026-06-03T13:07:33.231Z | ||
| at 2026-06-12T19:14:46.813Z | ||
| </div> | ||
@@ -126,0 +126,0 @@ <script src="prettify.js"></script> |
@@ -985,3 +985,3 @@ | ||
| <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a> | ||
| at 2026-06-03T13:07:33.231Z | ||
| at 2026-06-12T19:14:46.813Z | ||
| </div> | ||
@@ -988,0 +988,0 @@ <script src="../prettify.js"></script> |
+13
-13
@@ -28,3 +28,3 @@ | ||
| <span class="quiet">Statements</span> | ||
| <span class='fraction'>1991/2494</span> | ||
| <span class='fraction'>1992/2495</span> | ||
| </div> | ||
@@ -34,5 +34,5 @@ | ||
| <div class='fl pad1y space-right2'> | ||
| <span class="strong">75.03% </span> | ||
| <span class="strong">75.06% </span> | ||
| <span class="quiet">Branches</span> | ||
| <span class='fraction'>1208/1610</span> | ||
| <span class='fraction'>1210/1612</span> | ||
| </div> | ||
@@ -49,5 +49,5 @@ | ||
| <div class='fl pad1y space-right2'> | ||
| <span class="strong">82.4% </span> | ||
| <span class="strong">82.41% </span> | ||
| <span class="quiet">Lines</span> | ||
| <span class='fraction'>1742/2114</span> | ||
| <span class='fraction'>1743/2115</span> | ||
| </div> | ||
@@ -101,13 +101,13 @@ | ||
| <td class="file medium" data-value="codegen-operation.ts"><a href="codegen-operation.ts.html">codegen-operation.ts</a></td> | ||
| <td data-value="78.37" class="pic medium"> | ||
| <td data-value="78.41" class="pic medium"> | ||
| <div class="chart"><div class="cover-fill" style="width: 78%"></div><div class="cover-empty" style="width: 22%"></div></div> | ||
| </td> | ||
| <td data-value="78.37" class="pct medium">78.37%</td> | ||
| <td data-value="467" class="abs medium">366/467</td> | ||
| <td data-value="74.56" class="pct medium">74.56%</td> | ||
| <td data-value="342" class="abs medium">255/342</td> | ||
| <td data-value="78.41" class="pct medium">78.41%</td> | ||
| <td data-value="468" class="abs medium">367/468</td> | ||
| <td data-value="74.7" class="pct medium">74.7%</td> | ||
| <td data-value="344" class="abs medium">257/344</td> | ||
| <td data-value="78.94" class="pct medium">78.94%</td> | ||
| <td data-value="76" class="abs medium">60/76</td> | ||
| <td data-value="79.85" class="pct medium">79.85%</td> | ||
| <td data-value="402" class="abs medium">321/402</td> | ||
| <td data-value="79.9" class="pct medium">79.9%</td> | ||
| <td data-value="403" class="abs medium">322/403</td> | ||
| </tr> | ||
@@ -198,3 +198,3 @@ | ||
| <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a> | ||
| at 2026-06-03T13:07:33.231Z | ||
| at 2026-06-12T19:14:46.813Z | ||
| </div> | ||
@@ -201,0 +201,0 @@ <script src="../prettify.js"></script> |
@@ -733,3 +733,3 @@ | ||
| <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a> | ||
| at 2026-06-03T13:07:33.231Z | ||
| at 2026-06-12T19:14:46.813Z | ||
| </div> | ||
@@ -736,0 +736,0 @@ <script src="../prettify.js"></script> |
@@ -580,3 +580,3 @@ | ||
| <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a> | ||
| at 2026-06-03T13:07:33.231Z | ||
| at 2026-06-12T19:14:46.813Z | ||
| </div> | ||
@@ -583,0 +583,0 @@ <script src="../prettify.js"></script> |
@@ -344,3 +344,3 @@ | ||
| <span class="cline-any cline-neutral"> </span> | ||
| <span class="cline-any cline-yes">903x</span> | ||
| <span class="cline-any cline-yes">905x</span> | ||
| <span class="cline-any cline-neutral"> </span> | ||
@@ -381,3 +381,3 @@ <span class="cline-any cline-neutral"> </span> | ||
| <span class="cline-any cline-neutral"> </span> | ||
| <span class="cline-any cline-yes">207x</span> | ||
| <span class="cline-any cline-yes">208x</span> | ||
| <span class="cline-any cline-neutral"> </span> | ||
@@ -436,4 +436,4 @@ <span class="cline-any cline-neutral"> </span> | ||
| <span class="cline-any cline-neutral"> </span> | ||
| <span class="cline-any cline-yes">30x</span> | ||
| <span class="cline-any cline-yes">30x</span> | ||
| <span class="cline-any cline-yes">31x</span> | ||
| <span class="cline-any cline-yes">31x</span> | ||
| <span class="cline-any cline-neutral"> </span> | ||
@@ -475,6 +475,6 @@ <span class="cline-any cline-neutral"> </span> | ||
| <span class="cline-any cline-neutral"> </span> | ||
| <span class="cline-any cline-yes">212x</span> | ||
| <span class="cline-any cline-yes">212x</span> | ||
| <span class="cline-any cline-yes">212x</span> | ||
| <span class="cline-any cline-yes">212x</span> | ||
| <span class="cline-any cline-yes">213x</span> | ||
| <span class="cline-any cline-yes">213x</span> | ||
| <span class="cline-any cline-yes">213x</span> | ||
| <span class="cline-any cline-yes">213x</span> | ||
| <span class="cline-any cline-neutral"> </span> | ||
@@ -493,8 +493,8 @@ <span class="cline-any cline-neutral"> </span> | ||
| <span class="cline-any cline-neutral"> </span> | ||
| <span class="cline-any cline-yes">202x</span> | ||
| <span class="cline-any cline-yes">202x</span> | ||
| <span class="cline-any cline-yes">203x</span> | ||
| <span class="cline-any cline-yes">203x</span> | ||
| <span class="cline-any cline-neutral"> </span> | ||
| <span class="cline-any cline-neutral"> </span> | ||
| <span class="cline-any cline-neutral"> </span> | ||
| <span class="cline-any cline-yes">198x</span> | ||
| <span class="cline-any cline-yes">199x</span> | ||
| <span class="cline-any cline-neutral"> </span> | ||
@@ -819,3 +819,3 @@ <span class="cline-any cline-neutral"> </span> | ||
| <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a> | ||
| at 2026-06-03T13:07:33.231Z | ||
| at 2026-06-12T19:14:46.813Z | ||
| </div> | ||
@@ -822,0 +822,0 @@ <script src="../prettify.js"></script> |
@@ -104,3 +104,3 @@ | ||
| <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a> | ||
| at 2026-06-03T13:07:33.231Z | ||
| at 2026-06-12T19:14:46.813Z | ||
| </div> | ||
@@ -107,0 +107,0 @@ <script src="../prettify.js"></script> |
+4
-4
| { | ||
| "name": "@contractkit/plugin-typescript", | ||
| "version": "0.25.4", | ||
| "version": "0.26.0", | ||
| "description": "ContractKit built-in plugin: TypeScript codegen (SDK clients, Koa routers, Zod schemas, plain types)", | ||
@@ -29,7 +29,7 @@ "author": { | ||
| "dependencies": { | ||
| "@contractkit/core": "0.20.0" | ||
| "@contractkit/core": "0.21.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@repo/config-eslint": "0.3.1", | ||
| "@repo/config-typescript": "0.1.0" | ||
| "@repo/config-typescript": "0.1.0", | ||
| "@repo/config-eslint": "0.3.1" | ||
| }, | ||
@@ -36,0 +36,0 @@ "scripts": { |
@@ -263,3 +263,6 @@ import type { OpRootNode, OpRouteNode, OpOperationNode, ContractTypeNode, ParamSource, ObjectMode } from '@contractkit/core'; | ||
| if (op.signature) { | ||
| middlewares.push(`requireSignature('${op.signature}')`); | ||
| const sigArgs = op.signaturePolicy | ||
| ? `'${op.signature}', { policy: '${op.signaturePolicy}' }` | ||
| : `'${op.signature}'`; | ||
| middlewares.push(`requireSignature(${sigArgs})`); | ||
| } | ||
@@ -266,0 +269,0 @@ const middlewareStr = middlewares.length > 0 ? `, ${middlewares.join(', ')},` : ','; |
@@ -854,2 +854,13 @@ import { describe, it, expect } from 'vitest'; | ||
| it('passes the signature policy to requireSignature when set', () => { | ||
| const op = opOperation('post', { | ||
| signature: 'SLACK_WEBHOOK', | ||
| signaturePolicy: 'slackSignatureValid', | ||
| request: opRequest('Payload'), | ||
| }); | ||
| const root = opRoot([opRoute('/webhooks', [op])]); | ||
| const out = generateOp(root); | ||
| expect(out).toContain(`requireSignature('SLACK_WEBHOOK', { policy: 'slackSignatureValid' })`); | ||
| }); | ||
| it('places requireSignature after bodyParserMiddleware in the route line', () => { | ||
@@ -856,0 +867,0 @@ const op = opOperation('post', { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
2552926
0.1%16328
0.09%+ Added
- Removed
Updated