🚀. Socket Launch Week Day 2:Introducing Manifest Alerts.Learn more
Sign In

@contractkit/plugin-typescript

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contractkit/plugin-typescript - npm Package Compare versions

Comparing version
0.25.4
to
0.26.0
+4
-4
.turbo/turbo-build$colon$ci.log

@@ -8,7 +8,7 @@ $ eslint --max-warnings=0 && pnpm run build

ESM Build start
ESM dist/index.js 150.24 KB
ESM dist/index.js.map 328.17 KB
ESM ⚡️ Build success in 444ms
ESM dist/index.js 150.35 KB
ESM dist/index.js.map 328.43 KB
ESM ⚡️ Build success in 348ms
DTS Build start
DTS ⚡️ Build success in 6175ms
DTS ⚡️ Build success in 7174ms
DTS dist/index.d.ts 1.82 KB

@@ -6,13 +6,13 @@ $ vitest run --coverage

✓ tests/codegen-sdk.test.ts (132 tests) 231ms
✓ tests/codegen-operation.test.ts (88 tests) 186ms
✓ tests/codegen-contract.test.ts (127 tests) 163ms
✓ tests/codegen-server.test.ts (19 tests) 90ms
✓ tests/codegen-plain-types.test.ts (61 tests) 63ms
✓ tests/pipeline.test.ts (25 tests) 242ms
✓ tests/codegen-contract.test.ts (127 tests) 167ms
✓ tests/codegen-operation.test.ts (89 tests) 187ms
✓ tests/codegen-sdk.test.ts (132 tests) 186ms
✓ tests/codegen-plain-types.test.ts (61 tests) 51ms
✓ tests/codegen-server.test.ts (19 tests) 74ms
✓ tests/pipeline.test.ts (25 tests) 177ms
 Test Files  6 passed (6)
 Tests  452 passed (452)
 Start at  13:07:26
 Duration  7.02s (transform 3.96s, setup 0ms, import 13.06s, tests 975ms, environment 1ms)
 Tests  453 passed (453)
 Start at  19:14:39
 Duration  7.36s (transform 4.18s, setup 0ms, import 14.22s, tests 841ms, environment 12ms)

@@ -23,6 +23,6 @@  % Coverage report from v8

-------------------|---------|----------|---------|---------|-------------------
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

# @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 @@

@@ -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>

@@ -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">&nbsp;</span>
<span class="cline-any cline-yes">903x</span>
<span class="cline-any cline-yes">905x</span>
<span class="cline-any cline-neutral">&nbsp;</span>

@@ -381,3 +381,3 @@ <span class="cline-any cline-neutral">&nbsp;</span>

<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">207x</span>
<span class="cline-any cline-yes">208x</span>
<span class="cline-any cline-neutral">&nbsp;</span>

@@ -436,4 +436,4 @@ <span class="cline-any cline-neutral">&nbsp;</span>

<span class="cline-any cline-neutral">&nbsp;</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">&nbsp;</span>

@@ -475,6 +475,6 @@ <span class="cline-any cline-neutral">&nbsp;</span>

<span class="cline-any cline-neutral">&nbsp;</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">&nbsp;</span>

@@ -493,8 +493,8 @@ <span class="cline-any cline-neutral">&nbsp;</span>

<span class="cline-any cline-neutral">&nbsp;</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">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">198x</span>
<span class="cline-any cline-yes">199x</span>
<span class="cline-any cline-neutral">&nbsp;</span>

@@ -819,3 +819,3 @@ <span class="cline-any cline-neutral">&nbsp;</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>

{
"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