@haddowg/json-api-mcp 1.3.0 → 1.4.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.
- package/README.md +8 -4
- package/dist/cli.mjs +1 -1
- package/dist/{generate-BcqHRSxB.mjs → generate-yf5Kc4Yh.mjs} +4 -4
- package/dist/{generate-BcqHRSxB.mjs.map → generate-yf5Kc4Yh.mjs.map} +1 -1
- package/dist/generate.mjs +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -24,8 +24,8 @@ npm install --save-dev @haddowg/json-api-codegen
|
|
|
24
24
|
## Generate the model
|
|
25
25
|
|
|
26
26
|
```bash
|
|
27
|
-
npx json-api-mcp --input openapi/v5.json --output src/mcp/v5.mcp.json
|
|
28
|
-
npx json-api-mcp --input openapi/v5.json --output src/mcp/v5.mcp.json --check # in CI
|
|
27
|
+
npx @haddowg/json-api-mcp --input openapi/v5.json --output src/mcp/v5.mcp.json
|
|
28
|
+
npx @haddowg/json-api-mcp --input openapi/v5.json --output src/mcp/v5.mcp.json --check # in CI
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
Tools include one relationship deep by default, so each tool's schema carries only the types its
|
|
@@ -52,8 +52,12 @@ type names, such as a presigned upload URL, under `links`.
|
|
|
52
52
|
|
|
53
53
|
Coming from 1.2: a get returns `{ data }` where it returned `{ item }`, a create or update is
|
|
54
54
|
wrapped in `{ data }` instead of coming back bare, and a collection lists its resources under
|
|
55
|
-
`data` instead of `items`.
|
|
56
|
-
|
|
55
|
+
`data` instead of `items`. A delete returns `{ data: null }` instead of a line of text, a
|
|
56
|
+
meta-only action `{ meta }` instead of the bare meta object, and a URL action
|
|
57
|
+
`{ data: { url, type, expiresAt? } }` instead of the bare object. Regenerate the model to get the
|
|
58
|
+
new shapes. A model generated by 1.2 still loads and keeps the 1.2 shapes its output schemas
|
|
59
|
+
describe. The [migration notes](https://haddowg.github.io/json-api-ts/mcp/#migrating-from-12)
|
|
60
|
+
cover the rest.
|
|
57
61
|
|
|
58
62
|
Scope filtering counts only the security requirements a caller can meet with its credential
|
|
59
63
|
schemes, the document's `oauth2` schemes unless you pass `credentialSchemes`. Scopes, feature
|
package/dist/cli.mjs
CHANGED
|
@@ -1445,9 +1445,9 @@ function buildEntry(op, parsed, inputCtx, outputCtx, descriptor) {
|
|
|
1445
1445
|
*/
|
|
1446
1446
|
function assertContract(doc) {
|
|
1447
1447
|
const contract = doc.info?.["x-generator"]?.contract;
|
|
1448
|
-
if (typeof contract !== "number") throw new Error(`The OpenAPI document declares no generator contract (info.x-generator.contract). @haddowg/json-api-mcp reads contracts 13 to
|
|
1449
|
-
if (contract < 13) throw new Error(`The OpenAPI document declares generator contract ${contract}, older than this package reads (13 to
|
|
1450
|
-
if (contract >
|
|
1448
|
+
if (typeof contract !== "number") throw new Error(`The OpenAPI document declares no generator contract (info.x-generator.contract). @haddowg/json-api-mcp reads contracts 13 to 19; regenerate the document from a newer haddowg/json-api server.`);
|
|
1449
|
+
if (contract < 13) throw new Error(`The OpenAPI document declares generator contract ${contract}, older than this package reads (13 to 19). Regenerate it from a newer haddowg/json-api server.`);
|
|
1450
|
+
if (contract > 19) throw new Error(`The OpenAPI document declares generator contract ${contract}, newer than this package reads (13 to 19). Upgrade @haddowg/json-api-mcp.`);
|
|
1451
1451
|
return contract;
|
|
1452
1452
|
}
|
|
1453
1453
|
//#endregion
|
|
@@ -1594,4 +1594,4 @@ async function writeMcpModel(options) {
|
|
|
1594
1594
|
//#endregion
|
|
1595
1595
|
export { buildMcpModel as i, serialiseMcpModel as n, writeMcpModel as r, generateMcpModel as t };
|
|
1596
1596
|
|
|
1597
|
-
//# sourceMappingURL=generate-
|
|
1597
|
+
//# sourceMappingURL=generate-yf5Kc4Yh.mjs.map
|