Operazioni sulle voci delle raccolte
10 operazioni di nome item.*. Ognuna si esegue in un batch con apply_ops, dry_run_ops, la CLI o l’admin.
| Operation | What it does | Permission | Confirmation |
|---|---|---|---|
| item.list | List the draft items of a collection in order, optionally only those with a status, with the collection they fit. | site.read | none |
| item.read | Read a draft item. | site.read | none |
| item.history | List the published versions that hold the item, newest first, each with the item as it was published there. | site.read | none |
| item.create | Add a draft item at the end of a collection. | content.edit | none |
| item.update | Patch the slug or values of an item: values is merged key by key, and a null removes a key. | content.edit | none |
| item.delete | Delete a draft item; the published versions keep it until a publish, and item.rollback can bring it back. | content.edit | destructive |
| item.reorder | Reorder the items of a collection: itemIds names every item once, in the new order. | content.edit | none |
| item.import | Add many draft items at once, all or none. | content.edit | none |
| item.rollback | Restore an item of the draft to how a published version held it: its slug, values and status. | content.edit | none |
| item.setStatus | Set an item's status: a published item is served by the next publication.publish, a draft item is not. | content.publish | none |
item.list
List the draft items of a collection in order, optionally only those with a status, with the collection they fit. Collections are versioned with the site: publish copies them with their published items, and the public site serves those.
Esempio di input
{
"collectionId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
"status": "published"
}Input
| Field | Type | Required | Notes |
|---|---|---|---|
| collectionId | string (uuid) | yes | |
| status | string | no | One of "draft", "published". |
Output
| Field | Type | Required | Notes |
|---|---|---|---|
| collection | object | yes | |
| collection.uid | string (uuid) | yes | |
| collection.key | string | yes | At most 40 characters. |
| collection.label | string | record of string | yes | |
| collection.fields | array of object | object | object | object | object | object | object | object | object | object | object | yes | At least 1 item. At most 40 items. |
| collection.titleField | string | yes | |
| collection.slugField | string | yes | |
| collection.position | integer | yes | At least 0. |
| items | array of object | yes | |
| items[].uid | string (uuid) | yes | |
| items[].status | string | yes | One of "draft", "published". |
| items[].slug | string | record of string | yes | |
| items[].values | record of any JSON | yes | |
| items[].position | integer | yes | At least 0. |
| items[].updatedAt | string (date-time) | yes |
Provala
yarn splash item.list '{"collectionId":"a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d","status":"published"}' --dry-runitem.read
Read a draft item. Collections are versioned with the site: publish copies them with their published items, and the public site serves those.
Esempio di input
{
"collectionId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
"itemId": "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e"
}Input
| Field | Type | Required | Notes |
|---|---|---|---|
| collectionId | string (uuid) | yes | |
| itemId | string (uuid) | yes |
Output
| Field | Type | Required | Notes |
|---|---|---|---|
| collectionId | string (uuid) | yes | |
| item | object | yes | |
| item.uid | string (uuid) | yes | |
| item.status | string | yes | One of "draft", "published". |
| item.slug | string | record of string | yes | |
| item.values | record of any JSON | yes | |
| item.position | integer | yes | At least 0. |
| item.updatedAt | string (date-time) | yes |
Provala
yarn splash item.read '{"collectionId":"a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d","itemId":"b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e"}' --dry-runitem.history
List the published versions that hold the item, newest first, each with the item as it was published there. Collections are versioned with the site: publish copies them with their published items, and the public site serves those.
Esempio di input
{
"collectionId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
"itemId": "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e"
}Input
| Field | Type | Required | Notes |
|---|---|---|---|
| collectionId | string (uuid) | yes | |
| itemId | string (uuid) | yes |
Output
| Field | Type | Required | Notes |
|---|---|---|---|
| collectionId | string (uuid) | yes | |
| itemId | string (uuid) | yes | |
| versions | array of object | yes | |
| versions[].versionId | string (uuid) | yes | |
| versions[].publishedAt | string (date-time) | yes | |
| versions[].isActive | boolean | yes | |
| versions[].note | string | no | |
| versions[].item | object | yes |
I campi più annidati sono nello schema di output che risponde discover_operations con outputSchemas: true.
Provala
yarn splash item.history '{"collectionId":"a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d","itemId":"b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e"}' --dry-runitem.create
Add a draft item at the end of a collection. Its values are checked against the collection's fields and the site's locales; a reference names an item of the referenced collection, and a media or file value a media row of the site. Collections are versioned with the site: publish copies them with their published items, and the public site serves those.
Esempio di input
{
"collectionId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
"slug": {
"it": "giornata-del-recupero",
"en": "recovery-day"
},
"values": {
"title": {
"it": "Giornata del recupero",
"en": "Recovery day"
},
"date": "2026-11-21",
"venue": "Teatro Comunale",
"poster": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
"photos": [
"2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f"
],
"speakers": [
"c3d4e5f6-a7b8-4c9d-8e0f-2a3b4c5d6e7f"
]
}
}Input
| Field | Type | Required | Notes |
|---|---|---|---|
| collectionId | string (uuid) | yes | |
| slug | string | record of string | no | |
| values | record of any JSON | yes |
Output
| Field | Type | Required | Notes |
|---|---|---|---|
| collectionId | string (uuid) | yes | |
| item | object | yes | |
| item.uid | string (uuid) | yes | |
| item.status | string | yes | One of "draft", "published". |
| item.slug | string | record of string | yes | |
| item.values | record of any JSON | yes | |
| item.position | integer | yes | At least 0. |
| item.updatedAt | string (date-time) | yes |
Provala
yarn splash item.create '{"collectionId":"a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d","slug":{"it":"giornata-del-recupero","en":"recovery-day"},"values":{"title":{"it":"Giornata del recupero","en":"Recovery day"},"date":"2026-11-21","venue":"Teatro Comunale","poster":"2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f","photos":["2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f"],"speakers":["c3d4e5f6-a7b8-4c9d-8e0f-2a3b4c5d6e7f"]}}' --dry-runitem.update
Patch the slug or values of an item: values is merged key by key, and a null removes a key. The merged values are checked like item.create's. Collections are versioned with the site: publish copies them with their published items, and the public site serves those.
Esempio di input
{
"collectionId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
"itemId": "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e",
"patch": {
"values": {
"venue": "Sala civica",
"photos": null
}
}
}Input
| Field | Type | Required | Notes |
|---|---|---|---|
| collectionId | string (uuid) | yes | |
| itemId | string (uuid) | yes | |
| patch | object | yes | |
| patch.slug | string | record of string | no | |
| patch.values | record of any JSON | null | no |
Output
| Field | Type | Required | Notes |
|---|---|---|---|
| collectionId | string (uuid) | yes | |
| item | object | yes | |
| item.uid | string (uuid) | yes | |
| item.status | string | yes | One of "draft", "published". |
| item.slug | string | record of string | yes | |
| item.values | record of any JSON | yes | |
| item.position | integer | yes | At least 0. |
| item.updatedAt | string (date-time) | yes |
Provala
yarn splash item.update '{"collectionId":"a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d","itemId":"b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e","patch":{"values":{"venue":"Sala civica","photos":null}}}' --dry-runitem.delete
Delete a draft item; the published versions keep it until a publish, and item.rollback can bring it back. Collections are versioned with the site: publish copies them with their published items, and the public site serves those.
Esempio di input
{
"collectionId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
"itemId": "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e"
}Input
| Field | Type | Required | Notes |
|---|---|---|---|
| collectionId | string (uuid) | yes | |
| itemId | string (uuid) | yes |
Output
| Field | Type | Required | Notes |
|---|---|---|---|
| success | true | yes |
Vuole confirmed: ["destructive"] sul batch, che la forma della CLI per una sola operazione non imposta: mettila in un file di batch ed esegui yarn splash apply <file> --dry-run.
item.reorder
Reorder the items of a collection: itemIds names every item once, in the new order. Collections are versioned with the site: publish copies them with their published items, and the public site serves those.
Esempio di input
{
"collectionId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
"itemIds": [
"c3d4e5f6-a7b8-4c9d-8e0f-2a3b4c5d6e7f",
"b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e"
]
}Input
| Field | Type | Required | Notes |
|---|---|---|---|
| collectionId | string (uuid) | yes | |
| itemIds | array of string (uuid) | yes | At least 1 item. |
Output
| Field | Type | Required | Notes |
|---|---|---|---|
| itemIds | array of string (uuid) | yes |
Provala
yarn splash item.reorder '{"collectionId":"a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d","itemIds":["c3d4e5f6-a7b8-4c9d-8e0f-2a3b4c5d6e7f","b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e"]}' --dry-runitem.import
Add many draft items at once, all or none. A media, media list or file value names each media row by its id or by the exact filename of a file in the media library. Collections are versioned with the site: publish copies them with their published items, and the public site serves those.
Esempio di input
{
"collectionId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
"rows": [
{
"values": {
"title": "Open day",
"date": "2026-12-05",
"poster": "open-day-poster.jpg"
}
},
{
"slug": "winter-talk",
"values": {
"title": {
"it": "Incontro d'inverno",
"en": "Winter talk"
},
"date": "2027-01-16",
"poster": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f"
}
}
]
}Input
| Field | Type | Required | Notes |
|---|---|---|---|
| collectionId | string (uuid) | yes | |
| rows | array of object | yes | At least 1 item. At most 500 items. |
| rows[].slug | string | record of string | no | |
| rows[].values | record of any JSON | yes |
Output
| Field | Type | Required | Notes |
|---|---|---|---|
| collectionId | string (uuid) | yes | |
| items | array of object | yes | |
| items[].uid | string (uuid) | yes | |
| items[].status | string | yes | One of "draft", "published". |
| items[].slug | string | record of string | yes | |
| items[].values | record of any JSON | yes | |
| items[].position | integer | yes | At least 0. |
| items[].updatedAt | string (date-time) | yes |
Provala
yarn splash item.import '{"collectionId":"a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d","rows":[{"values":{"title":"Open day","date":"2026-12-05","poster":"open-day-poster.jpg"}},{"slug":"winter-talk","values":{"title":{"it":"Incontro d'\''inverno","en":"Winter talk"},"date":"2027-01-16","poster":"2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f"}}]}' --dry-runitem.rollback
Restore an item of the draft to how a published version held it: its slug, values and status. When that version did not hold the item, the rollback removes it from the draft. Collections are versioned with the site: publish copies them with their published items, and the public site serves those.
Esempio di input
{
"collectionId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
"itemId": "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e",
"versionId": "8b9c0d1e-2f3a-4b4c-8d5e-6f7a8b9c0d1e"
}Input
| Field | Type | Required | Notes |
|---|---|---|---|
| collectionId | string (uuid) | yes | |
| itemId | string (uuid) | yes | |
| versionId | string (uuid) | yes |
Output
| Field | Type | Required | Notes |
|---|---|---|---|
| collectionId | string (uuid) | yes | |
| item | object | null | yes |
Provala
yarn splash item.rollback '{"collectionId":"a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d","itemId":"b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e","versionId":"8b9c0d1e-2f3a-4b4c-8d5e-6f7a8b9c0d1e"}' --dry-runitem.setStatus
Set an item's status: a published item is served by the next publication.publish, a draft item is not. Collections are versioned with the site: publish copies them with their published items, and the public site serves those.
Esempio di input
{
"collectionId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
"itemId": "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e",
"status": "published"
}Input
| Field | Type | Required | Notes |
|---|---|---|---|
| collectionId | string (uuid) | yes | |
| itemId | string (uuid) | yes | |
| status | string | yes | One of "draft", "published". |
Output
| Field | Type | Required | Notes |
|---|---|---|---|
| collectionId | string (uuid) | yes | |
| item | object | yes | |
| item.uid | string (uuid) | yes | |
| item.status | string | yes | One of "draft", "published". |
| item.slug | string | record of string | yes | |
| item.values | record of any JSON | yes | |
| item.position | integer | yes | At least 0. |
| item.updatedAt | string (date-time) | yes |
Provala
yarn splash item.setStatus '{"collectionId":"a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d","itemId":"b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e","status":"published"}' --dry-runGenerato dal registro delle operazioni e dal catalogo degli strumenti MCP (sorgente 3c0e72376c54145a).
Qualcosa non va in questa pagina? Scrivi a docs@librettocms.com.