@haddowg/json-api-mcp 1.3.0 → 1.4.1

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 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`. Regenerate the model to get the new shapes. A model generated by 1.2
56
- still loads and keeps the 1.2 shapes its output schemas describe.
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
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { r as writeMcpModel } from "./generate-BcqHRSxB.mjs";
2
+ import { r as writeMcpModel } from "./generate-yf5Kc4Yh.mjs";
3
3
  import { realpathSync } from "node:fs";
4
4
  import { fileURLToPath } from "node:url";
5
5
  //#region src/cli.ts
@@ -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 18; 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 18). Regenerate it from a newer haddowg/json-api server.`);
1450
- if (contract > 18) throw new Error(`The OpenAPI document declares generator contract ${contract}, newer than this package reads (13 to 18). Upgrade @haddowg/json-api-mcp.`);
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-BcqHRSxB.mjs.map
1597
+ //# sourceMappingURL=generate-yf5Kc4Yh.mjs.map