@contractkit/plugin-typescript 0.21.0 → 0.22.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.
@@ -1,9 +1,9 @@
1
1
 
2
- > @contractkit/plugin-typescript@0.21.0 build:ci /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript
2
+ > @contractkit/plugin-typescript@0.22.0 build:ci /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript
3
3
  > eslint --max-warnings=0 && pnpm run build
4
4
 
5
5
 
6
- > @contractkit/plugin-typescript@0.21.0 build /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript
6
+ > @contractkit/plugin-typescript@0.22.0 build /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript
7
7
  > tsup src/index.ts --format esm --sourcemap --dts && tsc --emitDeclarationOnly --declaration
8
8
 
9
9
  CLI Building entry: src/index.ts
@@ -11,9 +11,9 @@
11
11
  CLI tsup v8.5.1
12
12
  CLI Target: esnext
13
13
  ESM Build start
14
- ESM dist/index.js 149.46 KB
15
- ESM dist/index.js.map 325.97 KB
16
- ESM ⚡️ Build success in 327ms
14
+ ESM dist/index.js 149.45 KB
15
+ ESM dist/index.js.map 326.03 KB
16
+ ESM ⚡️ Build success in 355ms
17
17
  DTS Build start
18
- DTS ⚡️ Build success in 6545ms
18
+ DTS ⚡️ Build success in 4808ms
19
19
  DTS dist/index.d.ts 1.82 KB
@@ -1,31 +1,31 @@
1
1
 
2
- > @contractkit/plugin-typescript@0.21.0 test:ci /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript
2
+ > @contractkit/plugin-typescript@0.22.0 test:ci /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript
3
3
  > vitest run --coverage
4
4
 
5
5
 
6
6
   RUN  v4.1.5 /home/runner/work/ContractKit/ContractKit/packages/plugin-typescript
7
7
  Coverage enabled with v8
8
8
 
9
- ✓ tests/codegen-contract.test.ts (124 tests) 299ms
10
- ✓ tests/codegen-operation.test.ts (88 tests) 281ms
11
- ✓ tests/codegen-sdk.test.ts (132 tests) 366ms
12
- ✓ tests/codegen-plain-types.test.ts (61 tests) 46ms
13
- ✓ tests/pipeline.test.ts (25 tests) 127ms
14
- ✓ tests/codegen-server.test.ts (19 tests) 44ms
9
+ ✓ tests/codegen-operation.test.ts (88 tests) 96ms
10
+ ✓ tests/codegen-contract.test.ts (124 tests) 143ms
11
+ ✓ tests/codegen-sdk.test.ts (132 tests) 162ms
12
+ ✓ tests/pipeline.test.ts (25 tests) 180ms
13
+ ✓ tests/codegen-plain-types.test.ts (61 tests) 32ms
14
+ ✓ tests/codegen-server.test.ts (19 tests) 27ms
15
15
 
16
16
   Test Files  6 passed (6)
17
17
   Tests  449 passed (449)
18
-  Start at  11:53:46
19
-  Duration  7.18s (transform 4.25s, setup 0ms, import 14.68s, tests 1.16s, environment 1ms)
18
+  Start at  13:02:53
19
+  Duration  6.82s (transform 4.81s, setup 0ms, import 13.71s, tests 640ms, environment 1ms)
20
20
 
21
21
   % Coverage report from v8
22
22
  -------------------|---------|----------|---------|---------|-------------------
23
23
  File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
24
24
  -------------------|---------|----------|---------|---------|-------------------
25
- All files | 79.96 | 75.1 | 83.54 | 82.56 |
26
- src | 79.75 | 74.78 | 83.1 | 82.32 |
25
+ All files | 79.96 | 75.1 | 83.5 | 82.56 |
26
+ src | 79.74 | 74.78 | 83.06 | 82.32 |
27
27
  ...n-contract.ts | 87.83 | 82.12 | 90.08 | 88.96 | ...1069,1074-1075
28
- ...-operation.ts | 78.18 | 74.26 | 78.08 | 79.69 | ...68-679,684-685
28
+ ...-operation.ts | 78.13 | 74.26 | 77.77 | 79.69 | ...69-680,685-686
29
29
  ...lain-types.ts | 89.08 | 78.37 | 96.66 | 92.3 | ...31,243,249,301
30
30
  codegen-sdk.ts | 88.07 | 82.56 | 87.32 | 91.3 | ...1106-1107,1110
31
31
  index.ts | 60.23 | 47.91 | 63.04 | 65.37 | ...08-811,827-846
package/CHANGELOG.md CHANGED
@@ -1,5 +1,40 @@
1
1
  # @contractkit/contractkit-plugin-typescript
2
2
 
3
+ ## 0.22.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 79af33b: **Breaking:** Replace the `roles` field in `security: { ... }` blocks with `requireMfa: boolean`.
8
+
9
+ The `security` declaration on operations, routes, and the file-level `options { security: { ... } }` block no longer accepts a `roles:` line. The new field is `requireMfa: true | false`. Existing `.ck` files that use `roles:` will fail to parse.
10
+
11
+ ```ck
12
+ # Before
13
+ security: {
14
+ roles: admin editor
15
+ }
16
+
17
+ # After
18
+ security: {
19
+ requireMfa: true
20
+ }
21
+ ```
22
+
23
+ **`@contractkit/core`** — `SecurityFields` interface drops `roles` / `rolesDescription` and adds `requireMfa` / `requireMfaDescription`. The grammar's `SecurityRolesLine` is replaced by `SecurityRequireMfaLine` (`requireMfaKw ":" booleanLit`). `security: none` continues to work.
24
+
25
+ **`@contractkit/plugin-typescript`** — Generated Koa routers now emit `requireSecurity({ requireMfa: <bool> })` when `requireMfa` is set, and bare `requireSecurity()` for unannotated routes (previously `requireSecurity({ roles: [...] })` / `requireSecurity({ })`). The generated code matches the updated serverkit `SecurityOptions = { requireMfa: boolean }` signature; consumers must upgrade serverkit alongside.
26
+
27
+ **`@contractkit/prettier-plugin`** — Formats `requireMfa: true|false` lines inside security blocks. Files containing `roles:` will no longer round-trip and will surface as parse errors.
28
+
29
+ **`@contractkit/plugin-markdown`** — The "Security: authenticated" admonition now shows `requireMfa: <bool>` instead of `roles: <list>`.
30
+
31
+ **`@contractkit/openapi-to-ck`** — `convertSecurity` no longer extracts OpenAPI scopes into a `roles` list (those don't map onto MFA semantics). Any non-empty OpenAPI `security` requirement now collapses to `security: {}` (authenticated, no MFA flag).
32
+
33
+ ### Patch Changes
34
+
35
+ - Updated dependencies [79af33b]
36
+ - @contractkit/core@0.17.0
37
+
3
38
  ## 0.21.0
4
39
 
5
40
  ### Minor Changes