@terreno/mcp 57.6.0 → 57.6.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.
|
@@ -223,6 +223,22 @@ export const todoRouter = modelRouter("/todos", Todo, {
|
|
|
223
223
|
|
|
224
224
|
Do not add `endpoints: (router) => { router.get(...) }` when an action fits.
|
|
225
225
|
|
|
226
|
+
## modelRouter array operations
|
|
227
|
+
|
|
228
|
+
When a model has at least one array field, `modelRouter` provides subroutes for adding,
|
|
229
|
+
updating, and removing array items:
|
|
230
|
+
|
|
231
|
+
| Method | Path | Operation |
|
|
232
|
+
| --- | --- | --- |
|
|
233
|
+
| `POST` | `/:id/:field` | Append an item |
|
|
234
|
+
| `PATCH` | `/:id/:field/:itemId` | Replace or merge an item |
|
|
235
|
+
| `DELETE` | `/:id/:field/:itemId` | Remove an item |
|
|
236
|
+
|
|
237
|
+
The `field` path must resolve to an array on the document. Requests for scalar, object,
|
|
238
|
+
or unknown fields run the normal update transform and `preUpdate` hook first so consumer
|
|
239
|
+
authorization remains authoritative, then return `400` with code
|
|
240
|
+
`array-operation-field-not-array` if the hook allows the request.
|
|
241
|
+
|
|
226
242
|
## MCP tools
|
|
227
243
|
|
|
228
244
|
Opt a model into Model Context Protocol tools with `mcp` on `modelRouter`. `TerrenoApp` mounts `POST /mcp` when any model has `mcp` or a custom tool is registered.
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"@modelcontextprotocol/node": "^2.0.0",
|
|
12
12
|
"@modelcontextprotocol/server": "^2.0.0",
|
|
13
13
|
"@sentry/bun": "^10.39.0",
|
|
14
|
-
"@terreno/api": "57.6.
|
|
14
|
+
"@terreno/api": "57.6.1",
|
|
15
15
|
"express": "^5.2.1",
|
|
16
16
|
"luxon": "^3.7.2",
|
|
17
17
|
"minisearch": "^7.2.0",
|
|
@@ -104,5 +104,5 @@
|
|
|
104
104
|
"test:coverage": "bun run ../scripts/check-coverage.ts"
|
|
105
105
|
},
|
|
106
106
|
"type": "module",
|
|
107
|
-
"version": "57.6.
|
|
107
|
+
"version": "57.6.1"
|
|
108
108
|
}
|
|
@@ -223,6 +223,22 @@ export const todoRouter = modelRouter("/todos", Todo, {
|
|
|
223
223
|
|
|
224
224
|
Do not add `endpoints: (router) => { router.get(...) }` when an action fits.
|
|
225
225
|
|
|
226
|
+
## modelRouter array operations
|
|
227
|
+
|
|
228
|
+
When a model has at least one array field, `modelRouter` provides subroutes for adding,
|
|
229
|
+
updating, and removing array items:
|
|
230
|
+
|
|
231
|
+
| Method | Path | Operation |
|
|
232
|
+
| --- | --- | --- |
|
|
233
|
+
| `POST` | `/:id/:field` | Append an item |
|
|
234
|
+
| `PATCH` | `/:id/:field/:itemId` | Replace or merge an item |
|
|
235
|
+
| `DELETE` | `/:id/:field/:itemId` | Remove an item |
|
|
236
|
+
|
|
237
|
+
The `field` path must resolve to an array on the document. Requests for scalar, object,
|
|
238
|
+
or unknown fields run the normal update transform and `preUpdate` hook first so consumer
|
|
239
|
+
authorization remains authoritative, then return `400` with code
|
|
240
|
+
`array-operation-field-not-array` if the hook allows the request.
|
|
241
|
+
|
|
226
242
|
## MCP tools
|
|
227
243
|
|
|
228
244
|
Opt a model into Model Context Protocol tools with `mcp` on `modelRouter`. `TerrenoApp` mounts `POST /mcp` when any model has `mcp` or a custom tool is registered.
|