@pikku/openapi-parser 0.12.23 → 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.
Files changed (2) hide show
  1. package/package.json +11 -5
  2. package/CHANGELOG.md +0 -263
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pikku/openapi-parser",
3
- "version": "0.12.23",
3
+ "version": "0.12.24",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/pikkujs/pikku.git",
@@ -15,15 +15,21 @@
15
15
  "scripts": {
16
16
  "tsc": "tsc",
17
17
  "ncu": "npx npm-check-updates",
18
- "build": "tsc -b",
18
+ "build": "bun run clean && tsc -b",
19
19
  "test": "node --import tsx --test src/**/*.test.ts",
20
- "prepublishOnly": "bun run build"
20
+ "prepublishOnly": "bun run build",
21
+ "clean": "rm -rf dist tsconfig.tsbuildinfo"
21
22
  },
22
23
  "exports": {
23
- ".": "./dist/index.js"
24
+ ".": "./dist/index.js",
25
+ "./package.json": "./package.json"
24
26
  },
27
+ "files": [
28
+ "dist",
29
+ "!dist/**/*.tsbuildinfo"
30
+ ],
25
31
  "dependencies": {
26
- "yaml": "^2.9.0",
32
+ "yaml": "^2.9.1",
27
33
  "zod": "^4"
28
34
  }
29
35
  }
package/CHANGELOG.md DELETED
@@ -1,263 +0,0 @@
1
- # @pikku/openapi-parser
2
-
3
- ## 0.12.23
4
-
5
- ### Patch Changes
6
-
7
- - 0210e96: Review fixes for the OpenAPI addon onboarding:
8
-
9
- - A delegated sign-in whose email the upstream did not return, including a login typed as an email, never links to an existing user. An authenticator that omits `syntheticEmail` counts as synthetic.
10
- - `pikkuActor` credentials take an optional `remove`, which drops a credential the environment no longer sets. The actor log line names the user id, not the email.
11
- - Basic credentials are UTF-8 encoded, and a Swagger 2 `application` OAuth flow keeps its token URL.
12
- - `pikku new addon` writes a `file:` path relative to each package when the app is not a workspace, and reports an auth.ts factory it cannot edit instead of half-wiring it.
13
- - The inspector reads an addon from the package that declares it before the root.
14
- - The dev credentials key file is created exclusively, so two `pikku dev` processes agree on one key.
15
-
16
- - 38d4f65: OpenAPI codegen builds without hand-fixes: specs from a URL with headers, Swagger 2 / OAS 3.0 / 3.1, server variables, form and multipart bodies, tag/include/exclude filters, a coverage warning for thin specs, a url() base URL, z.unknown() for vague responses, basic auth, CredentialRejectedError on an upstream 401, and a generalized delegated-login config.
17
- - a8cf3a1: A generated addon's errors now carry the upstream API's own message (`error.message`, `message`, `detail`, `title`), capped at 200 characters, instead of the raw response body with whatever debug data the API put in it.
18
-
19
- ## 0.12.22
20
-
21
- ### Patch Changes
22
-
23
- - 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.
24
-
25
- 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.
26
-
27
- `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.
28
-
29
- 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.
30
-
31
- ## 0.12.21
32
-
33
- ### Patch Changes
34
-
35
- - 4c7a1b5: Run the monorepo's own scripts through bun instead of yarn. What moves is the
36
- package manager each package's `prepublishOnly` and build scripts invoke, plus
37
- the two manifest fixes bun needs to resolve the tree: `uWebSockets.js` is
38
- declared with an explicit `github:` specifier, and `@pikku/uws-handler` marks
39
- its `uWebSockets.js` peer optional so a bun install of a consumer that brings
40
- its own uWS app does not try to fetch it from the registry.
41
-
42
- Three published behaviours change, all of them cases where an isolated
43
- `node_modules` or bun as the runtime had been papered over by yarn's hoisting:
44
-
45
- - `@pikku/migrator-sql` turns foreign keys on when it opens a sqlite database
46
- through bun. `node:sqlite` enforces them by default and `bun:sqlite` does not,
47
- which silently turned every `ON DELETE CASCADE` into a no-op under
48
- `bunx --bun pikku`.
49
- - `@pikku/cli` resolves a deploy provider against the project being deployed
50
- rather than against wherever the CLI itself is installed, which is what its
51
- own "is not installed" error asks the user to arrange.
52
- - `@pikku/cli` treats a specifier a runtime hands straight back — bun does this
53
- for the modules it implements itself — as not resolved from the project, so
54
- it falls back rather than loading the runtime's own copy.
55
-
56
- ## 0.12.20
57
-
58
- ### Patch Changes
59
-
60
- - 6eef0a0: Bump every dependency to its latest compatible minor/patch across the monorepo.
61
- - 266e3bc: `#pikku` is a namespace, not a module: one subpath per wiring
62
-
63
- The bare `#pikku` specifier resolved to `.pikku/pikku-types.gen.ts`, a hub that
64
- re-exported all twelve wiring leaves with `export *` — undoing the split the
65
- leaves exist for, each of which still says so in its own generated header
66
- ("HTTP-specific type definitions for tree-shaking optimization"). Reaching that
67
- hub put 33 distinct `@pikku/core` subpaths into the module graph, and neither
68
- consumer could drop them again: bundlers keep `export *` chains because the app
69
- declares no `sideEffects`, and Node and tsx do not tree-shake at all, so an app
70
- with no queues still executed `@pikku/core/queue` at boot.
71
-
72
- The hub is gone. An app now imports the leaf the name belongs to —
73
- `#pikku/function`, `#pikku/http`, `#pikku/workflow` — and a project's `imports`
74
- map declares two patterns, because both resolvers pick the more specific one:
75
-
76
- ```json
77
- "#pikku/*.js": "./.pikku/*.ts",
78
- "#pikku/*": "./.pikku/*/index.ts"
79
- ```
80
-
81
- A source tree names the `.ts` on both. Webpack, esbuild and Bun all rewrite a
82
- `.js` specifier to the `.ts` beside it for a relative import but not for an
83
- imports-map target, so a `.js` target there resolves to a file that does not
84
- exist. The two places that keep `.js` are the ones where it is the real file: a
85
- published addon, whose map points into `dist`, and a project that imports a
86
- declaration-only generated file such as `pikku-rpc-wirings-map.gen.d.ts`, where
87
- naming the `.js` lets the type resolver's own mapping reach the `.d.ts`.
88
-
89
- `pikku` generates the leaf indexes and removes the hub, and `pikku validate`
90
- reports a barrel import as an error. The split also turns the addon boundary
91
- from advice into a rule: an addon never generates the wiring leaves, so
92
- `#pikku/http` fails at the specifier rather than yielding "no exported member"
93
- from a hub that quietly dropped the re-export.
94
-
95
- ## 0.12.19
96
-
97
- ### Patch Changes
98
-
99
- - a7fcd2e: Declare dependencies that were imported but missing from `package.json`
100
-
101
- `@pikku/openapi-parser` and `@pikku/better-auth` imported `zod`, `@pikku/next`
102
- imported `path-to-regexp`, `@pikku/cli` imported `kysely`, and
103
- `@pikku/assistant-ui` imported `rxjs`, none of which were declared. Each
104
- resolved through Yarn hoisting inside the monorepo and would fail for anyone
105
- installing the package on its own.
106
-
107
- `rxjs`, `kysely` and `path-to-regexp` reach consumers through public
108
- signatures — `Observable<BaseEvent>` is the return type of a published method,
109
- and `createCoercionPlugin` returns a `KyselyPlugin` — so they are runtime
110
- dependencies rather than build-only ones.
111
-
112
- `@pikku/assistant-ui` pins `rxjs` to the exact `7.8.1` that `@ag-ui/client`
113
- pins, rather than a caret range. The two packages exchange `Observable`s, so a
114
- range that floats to a second copy gives them two incompatible `Observable`
115
- types.
116
-
117
- `@pikku/kysely` also drops `SqliteSerializePlugin`, an alias of
118
- `SerializePlugin` that has been marked `@deprecated` in favour of it. Use
119
- `SerializePlugin`.
120
-
121
- ## 0.12.18
122
-
123
- ### Patch Changes
124
-
125
- - 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.
126
-
127
- ## 0.12.17
128
-
129
- ### Patch Changes
130
-
131
- - a7b26c5: rename the inspected declarations to `define*`: `wireScope` → `defineScope`, `wireSecret` → `defineSecret`, `wireVariable` → `defineVariable`, `wireCredential` → `defineCredential`
132
-
133
- `wire*` meant two unrelated things. A transport wiring attaches a function to
134
- something that can invoke it — `wireHTTP`, `wireChannel`, `wireScheduler`,
135
- `wireQueueWorker` and the rest — and the thing it wires runs. These four wire
136
- nothing: they are no-ops that exist only so the call typechecks, they are
137
- tree-shaken out of the build, and their whole job is to be found by the
138
- inspector's AST pass and turned into a type union. One word for both left the
139
- declaration reading like a registration with a runtime.
140
-
141
- So the vocabulary splits: **`wire*` is a transport, `define*` is an inspected
142
- declaration.**
143
-
144
- ```ts
145
- import { defineScope } from '@pikku/core/scope'
146
- import { defineSecret } from '@pikku/core/secret'
147
- import { defineVariable } from '@pikku/core/variable'
148
- import { defineCredential } from '@pikku/core/credential'
149
-
150
- defineScope({ admin: { scopes: { invoices: { scopes: { create: {} } } } } })
151
- ```
152
-
153
- **Breaking:** no alias is kept. Rename the four call sites; the module subpaths
154
- (`@pikku/core/scope`, `/secret`, `/variable`) are unchanged.
155
-
156
- The inspector matches these by identifier text, so a stale `wire*` call is not a
157
- type error — it is silently not extracted, and the generated union comes back
158
- empty. That fails as "this scope isn't declared" on code that was fine a moment
159
- ago, nowhere near the declaration. Grep for the old names rather than trusting a
160
- clean build.
161
-
162
- An addon published with `.pikku` output generated before this release re-exports
163
- `wireSecret` from `@pikku/core/secret` and will not typecheck against this core
164
- until it is rebuilt and republished.
165
-
166
- ## 0.12.16
167
-
168
- ### Patch Changes
169
-
170
- - 9f0d0eb: Migrate the `--oauth` addon scaffold off `OAuth2Client`. A scaffolded OAuth2
171
- addon service used to construct `new OAuth2Client(config, appCredentialSecretId,
172
- secrets)` and do its own token exchange/refresh — the responsibility better-auth
173
- now owns via the credential service. The `pikku new addon --oauth` scaffold (and
174
- the OpenAPI `--openapi` generator) now emit a service that receives a ready
175
- access token: `services.ts` uses `createWireServices` + `wire.getCredential<{
176
- accessToken: string }>(name)` and the service does a plain `fetch` with
177
- `Authorization: Bearer ${accessToken}`, matching the existing per-user
178
- bearer/apikey credential scaffold. With no remaining consumers, `OAuth2Client`
179
- (`@pikku/core/oauth2`) and its test are removed; the `./oauth2` export keeps the
180
- `OAuth2AppCredential` / `OAuth2Token` types.
181
- - 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`.
182
-
183
- ## 0.12.15
184
-
185
- ### Patch Changes
186
-
187
- - 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.
188
-
189
- ## 0.12.14
190
-
191
- ### Patch Changes
192
-
193
- - 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`.
194
-
195
- ## 0.12.13
196
-
197
- ### Patch Changes
198
-
199
- - 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.
200
-
201
- ## 0.12.12
202
-
203
- ### Patch Changes
204
-
205
- - 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.
206
-
207
- ## 0.12.11
208
-
209
- ### Patch Changes
210
-
211
- - 41ce2cb: Upgrade to TypeScript 6 and raise the minimum Node.js version to 22.
212
-
213
- 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.
214
-
215
- ## 0.12.10
216
-
217
- ### Patch Changes
218
-
219
- - 02fca80: Fix OpenAPI-to-addon codegen robustness across 2521 real-world specs (77% → 97.8% pass rate).
220
- - Cycle detection and depth limits in schema generation to prevent stack overflows
221
- - Schema partitioning: shared types file for multi-referenced schemas, inline for single-use (fixes crash on large specs)
222
- - Topological sort with z.lazy() for circular schema references
223
- - Validate default value types and enum membership before emitting .default()
224
- - Skip refinements (.min/.max) on incompatible Zod types
225
- - Sanitize reserved words and digit-leading names in function/type identifiers
226
- - Deduplicate schema names, imports, and object properties
227
- - 117 unit tests covering all edge cases
228
-
229
- ## 0.12.9
230
-
231
- ### Patch Changes
232
-
233
- - 2ce0733: Fix credential services template variable passing, duplicate body/path param collision, and add credentialOverrides to wireAddon.
234
-
235
- ## 0.12.8
236
-
237
- ### Patch Changes
238
-
239
- - 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.
240
-
241
- ## 0.12.7
242
-
243
- ### Patch Changes
244
-
245
- - 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).
246
-
247
- ## 0.12.6
248
-
249
- ### Patch Changes
250
-
251
- - 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.
252
-
253
- ## 0.12.5
254
-
255
- ### Patch Changes
256
-
257
- - 8552e18: Don't generate `output: z.void()` for operations without response schemas — omit the field instead
258
-
259
- ## 0.12.4
260
-
261
- ### Patch Changes
262
-
263
- - e3142ad: Use JSON.stringify for safe interpolation of OpenAPI spec values in generated code to prevent code injection via malicious specs.