@pikku/openapi-parser 0.12.22 → 0.12.24

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/CHANGELOG.md DELETED
@@ -1,247 +0,0 @@
1
- # @pikku/openapi-parser
2
-
3
- ## 0.12.22
4
-
5
- ### Patch Changes
6
-
7
- - 17d8746: An addon generated with `pikku new addon --openapi` never built. Every function file declared its zod schemas next to an import of `#pikku/function`, and `pikku all` loads the file that declares a schema to convert it. At runtime `#pikku` resolves through the addon's `imports` into `dist/`, which the first build has not written yet, so every schema failed with `Could not convert Zod schema … Cannot find module …/dist/.pikku/function/index.js` and the build stopped there. Each operation's schemas now go in a sibling `<operation>.schemas.ts` that imports only zod, and the function file imports them from it.
8
-
9
- The generated imports also named the wrong tree. An addon's generated code lives under `.pikku/addon/`, so `#pikku/function` and `#pikku/variables/…` pointed at leaves that do not exist, and `tsc` failed even once codegen had run. They are now `#pikku/addon/function` and `#pikku/addon/variables/…`, as the hand-written addon scaffold already had them.
10
-
11
- `pikku validate` now reports an installed Pikku package that resolves a different copy of a type-identity package (`zod`, `kysely`, `@pikku/core`, `better-auth`) than the project as an error, `skewed-type-identity-…`, and the codegen preflight warns about it as `PKU719`. Under bun's isolated layout `@pikku/cli` can carry its own `zod` beside it in the store. Codegen then reads the app's schemas with a different zod than wrote them, and correct schemas fail to convert. The existing check only looked at dependencies linked from outside the project, so it never saw this case.
12
-
13
- The `pikku-build` skill now recognises an OpenAPI spec or an n8n export handed over with the request, says so, converts it first, then carries on building the app. `pikku-addon` gains an OpenAPI reference and corrects its addon import paths and build steps. `pikku-n8n-import` joins the `core` install group.
14
-
15
- ## 0.12.21
16
-
17
- ### Patch Changes
18
-
19
- - 4c7a1b5: Run the monorepo's own scripts through bun instead of yarn. What moves is the
20
- package manager each package's `prepublishOnly` and build scripts invoke, plus
21
- the two manifest fixes bun needs to resolve the tree: `uWebSockets.js` is
22
- declared with an explicit `github:` specifier, and `@pikku/uws-handler` marks
23
- its `uWebSockets.js` peer optional so a bun install of a consumer that brings
24
- its own uWS app does not try to fetch it from the registry.
25
-
26
- Three published behaviours change, all of them cases where an isolated
27
- `node_modules` or bun as the runtime had been papered over by yarn's hoisting:
28
-
29
- - `@pikku/migrator-sql` turns foreign keys on when it opens a sqlite database
30
- through bun. `node:sqlite` enforces them by default and `bun:sqlite` does not,
31
- which silently turned every `ON DELETE CASCADE` into a no-op under
32
- `bunx --bun pikku`.
33
- - `@pikku/cli` resolves a deploy provider against the project being deployed
34
- rather than against wherever the CLI itself is installed, which is what its
35
- own "is not installed" error asks the user to arrange.
36
- - `@pikku/cli` treats a specifier a runtime hands straight back — bun does this
37
- for the modules it implements itself — as not resolved from the project, so
38
- it falls back rather than loading the runtime's own copy.
39
-
40
- ## 0.12.20
41
-
42
- ### Patch Changes
43
-
44
- - 6eef0a0: Bump every dependency to its latest compatible minor/patch across the monorepo.
45
- - 266e3bc: `#pikku` is a namespace, not a module: one subpath per wiring
46
-
47
- The bare `#pikku` specifier resolved to `.pikku/pikku-types.gen.ts`, a hub that
48
- re-exported all twelve wiring leaves with `export *` — undoing the split the
49
- leaves exist for, each of which still says so in its own generated header
50
- ("HTTP-specific type definitions for tree-shaking optimization"). Reaching that
51
- hub put 33 distinct `@pikku/core` subpaths into the module graph, and neither
52
- consumer could drop them again: bundlers keep `export *` chains because the app
53
- declares no `sideEffects`, and Node and tsx do not tree-shake at all, so an app
54
- with no queues still executed `@pikku/core/queue` at boot.
55
-
56
- The hub is gone. An app now imports the leaf the name belongs to —
57
- `#pikku/function`, `#pikku/http`, `#pikku/workflow` — and a project's `imports`
58
- map declares two patterns, because both resolvers pick the more specific one:
59
-
60
- ```json
61
- "#pikku/*.js": "./.pikku/*.ts",
62
- "#pikku/*": "./.pikku/*/index.ts"
63
- ```
64
-
65
- A source tree names the `.ts` on both. Webpack, esbuild and Bun all rewrite a
66
- `.js` specifier to the `.ts` beside it for a relative import but not for an
67
- imports-map target, so a `.js` target there resolves to a file that does not
68
- exist. The two places that keep `.js` are the ones where it is the real file: a
69
- published addon, whose map points into `dist`, and a project that imports a
70
- declaration-only generated file such as `pikku-rpc-wirings-map.gen.d.ts`, where
71
- naming the `.js` lets the type resolver's own mapping reach the `.d.ts`.
72
-
73
- `pikku` generates the leaf indexes and removes the hub, and `pikku validate`
74
- reports a barrel import as an error. The split also turns the addon boundary
75
- from advice into a rule: an addon never generates the wiring leaves, so
76
- `#pikku/http` fails at the specifier rather than yielding "no exported member"
77
- from a hub that quietly dropped the re-export.
78
-
79
- ## 0.12.19
80
-
81
- ### Patch Changes
82
-
83
- - a7fcd2e: Declare dependencies that were imported but missing from `package.json`
84
-
85
- `@pikku/openapi-parser` and `@pikku/better-auth` imported `zod`, `@pikku/next`
86
- imported `path-to-regexp`, `@pikku/cli` imported `kysely`, and
87
- `@pikku/assistant-ui` imported `rxjs`, none of which were declared. Each
88
- resolved through Yarn hoisting inside the monorepo and would fail for anyone
89
- installing the package on its own.
90
-
91
- `rxjs`, `kysely` and `path-to-regexp` reach consumers through public
92
- signatures — `Observable<BaseEvent>` is the return type of a published method,
93
- and `createCoercionPlugin` returns a `KyselyPlugin` — so they are runtime
94
- dependencies rather than build-only ones.
95
-
96
- `@pikku/assistant-ui` pins `rxjs` to the exact `7.8.1` that `@ag-ui/client`
97
- pins, rather than a caret range. The two packages exchange `Observable`s, so a
98
- range that floats to a second copy gives them two incompatible `Observable`
99
- types.
100
-
101
- `@pikku/kysely` also drops `SqliteSerializePlugin`, an alias of
102
- `SerializePlugin` that has been marked `@deprecated` in favour of it. Use
103
- `SerializePlugin`.
104
-
105
- ## 0.12.18
106
-
107
- ### Patch Changes
108
-
109
- - fd9d834: Stop publishing internals that only their own package or file used. The declarations stay; only the entrypoint re-export is removed, so nothing that imported a name from where it is declared is affected.
110
-
111
- ## 0.12.17
112
-
113
- ### Patch Changes
114
-
115
- - a7b26c5: rename the inspected declarations to `define*`: `wireScope` → `defineScope`, `wireSecret` → `defineSecret`, `wireVariable` → `defineVariable`, `wireCredential` → `defineCredential`
116
-
117
- `wire*` meant two unrelated things. A transport wiring attaches a function to
118
- something that can invoke it — `wireHTTP`, `wireChannel`, `wireScheduler`,
119
- `wireQueueWorker` and the rest — and the thing it wires runs. These four wire
120
- nothing: they are no-ops that exist only so the call typechecks, they are
121
- tree-shaken out of the build, and their whole job is to be found by the
122
- inspector's AST pass and turned into a type union. One word for both left the
123
- declaration reading like a registration with a runtime.
124
-
125
- So the vocabulary splits: **`wire*` is a transport, `define*` is an inspected
126
- declaration.**
127
-
128
- ```ts
129
- import { defineScope } from '@pikku/core/scope'
130
- import { defineSecret } from '@pikku/core/secret'
131
- import { defineVariable } from '@pikku/core/variable'
132
- import { defineCredential } from '@pikku/core/credential'
133
-
134
- defineScope({ admin: { scopes: { invoices: { scopes: { create: {} } } } } })
135
- ```
136
-
137
- **Breaking:** no alias is kept. Rename the four call sites; the module subpaths
138
- (`@pikku/core/scope`, `/secret`, `/variable`) are unchanged.
139
-
140
- The inspector matches these by identifier text, so a stale `wire*` call is not a
141
- type error — it is silently not extracted, and the generated union comes back
142
- empty. That fails as "this scope isn't declared" on code that was fine a moment
143
- ago, nowhere near the declaration. Grep for the old names rather than trusting a
144
- clean build.
145
-
146
- An addon published with `.pikku` output generated before this release re-exports
147
- `wireSecret` from `@pikku/core/secret` and will not typecheck against this core
148
- until it is rebuilt and republished.
149
-
150
- ## 0.12.16
151
-
152
- ### Patch Changes
153
-
154
- - 9f0d0eb: Migrate the `--oauth` addon scaffold off `OAuth2Client`. A scaffolded OAuth2
155
- addon service used to construct `new OAuth2Client(config, appCredentialSecretId,
156
- secrets)` and do its own token exchange/refresh — the responsibility better-auth
157
- now owns via the credential service. The `pikku new addon --oauth` scaffold (and
158
- the OpenAPI `--openapi` generator) now emit a service that receives a ready
159
- access token: `services.ts` uses `createWireServices` + `wire.getCredential<{
160
- accessToken: string }>(name)` and the service does a plain `fetch` with
161
- `Authorization: Bearer ${accessToken}`, matching the existing per-user
162
- bearer/apikey credential scaffold. With no remaining consumers, `OAuth2Client`
163
- (`@pikku/core/oauth2`) and its test are removed; the `./oauth2` export keeps the
164
- `OAuth2AppCredential` / `OAuth2Token` types.
165
- - 8601505: Make `wireCredential` the single source of truth for an addon's OAuth2 config: `pikku-credentials.gen.ts` exports `CREDENTIAL_OAUTH2_CONFIGS`, generated services import from it, the OpenAPI importer emits a `wireCredential`, and the inspector now extracts `oauth2.additionalParams`.
166
-
167
- ## 0.12.15
168
-
169
- ### Patch Changes
170
-
171
- - 854c342: Fix workspace addon integration: exclude nested pikku projects from inspection (prevents "More than one CoreUserSession/CoreConfig found" when a workspace addon is linked), widen the generated addon service `call()` data param to `unknown` so schema-less function inputs compile, and add `@pikku/inspector` + `@standard-schema/spec` to the generated addon devDependencies so its `.pikku` gen files typecheck.
172
-
173
- ## 0.12.14
174
-
175
- ### Patch Changes
176
-
177
- - a10e88d: auth-config: new `extraHeaders` field — static headers baked into every generated request (the delegated login call and all proxied service calls), for upstreams that route on a header such as multi-tenant APIs resolving the tenant from `Origin`.
178
-
179
- ## 0.12.13
180
-
181
- ### Patch Changes
182
-
183
- - 0f3edd3: Support an operator-supplied auth config that overrides/augments a spec's securitySchemes: custom auth header name/format (e.g. a raw token in `authentication:` instead of `Authorization: Bearer`), and a delegated-login descriptor (login path, credential fields, token dot-path, claims mapping from the decoded JWT payload or response body) that emits a self-contained `src/<name>-upstream-auth.ts` `authenticate<Name>Upstream()` for wiring into `@pikku/better-auth`'s `delegatedAuth()` plugin.
184
-
185
- ## 0.12.12
186
-
187
- ### Patch Changes
188
-
189
- - d97f2a1: Always emit a description for generated addon functions (and their MCP tools). When an OpenAPI operation omits both `description` and `summary` (common), the generator now synthesizes one — a humanized `operationId` (with the `Controller` segment stripped), else `METHOD /path` — instead of emitting none. This removes the "MCP tool is missing a description" warnings and makes `--mcp`-exposed tools usable.
190
-
191
- ## 0.12.11
192
-
193
- ### Patch Changes
194
-
195
- - 41ce2cb: Upgrade to TypeScript 6 and raise the minimum Node.js version to 22.
196
-
197
- All packages now build against `typescript@^6.0.3` and declare `engines.node >= 22`. Internal tooling (`ts-json-schema-generator`, `zod-to-ts`) was bumped to TypeScript 6-compatible releases.
198
-
199
- ## 0.12.10
200
-
201
- ### Patch Changes
202
-
203
- - 02fca80: Fix OpenAPI-to-addon codegen robustness across 2521 real-world specs (77% → 97.8% pass rate).
204
- - Cycle detection and depth limits in schema generation to prevent stack overflows
205
- - Schema partitioning: shared types file for multi-referenced schemas, inline for single-use (fixes crash on large specs)
206
- - Topological sort with z.lazy() for circular schema references
207
- - Validate default value types and enum membership before emitting .default()
208
- - Skip refinements (.min/.max) on incompatible Zod types
209
- - Sanitize reserved words and digit-leading names in function/type identifiers
210
- - Deduplicate schema names, imports, and object properties
211
- - 117 unit tests covering all edge cases
212
-
213
- ## 0.12.9
214
-
215
- ### Patch Changes
216
-
217
- - 2ce0733: Fix credential services template variable passing, duplicate body/path param collision, and add credentialOverrides to wireAddon.
218
-
219
- ## 0.12.8
220
-
221
- ### Patch Changes
222
-
223
- - 94ceecd: Fix duplicate property error in generated code when body and path/query/header params share the same name. Skips the body property with a warning.
224
-
225
- ## 0.12.7
226
-
227
- ### Patch Changes
228
-
229
- - 5dd1996: Fix credentials command crash when state.credentials is undefined, and add --credential flag to `pikku new addon` for per-user credential wiring (apikey, bearer, oauth2).
230
-
231
- ## 0.12.6
232
-
233
- ### Patch Changes
234
-
235
- - a57ff11: Add Swagger 2.0 support: extract requestBody from body parameters, responseSchema from direct response schema, and component schemas from definitions. Fix duplicate .describe() on request body properties.
236
-
237
- ## 0.12.5
238
-
239
- ### Patch Changes
240
-
241
- - 8552e18: Don't generate `output: z.void()` for operations without response schemas — omit the field instead
242
-
243
- ## 0.12.4
244
-
245
- ### Patch Changes
246
-
247
- - e3142ad: Use JSON.stringify for safe interpolation of OpenAPI spec values in generated code to prevent code injection via malicious specs.