Operazioni sui preset

7 operazioni di nome preset.*. Ognuna si esegue in un batch con apply_ops, dry_run_ops, la CLI o l’admin.

Aggiornato il
OperationWhat it doesPermissionConfirmation
preset.listList the presets the site can insert, theme presets first, then the site library; each with its tree.site.readnone
preset.insertInsert a fresh copy of a theme or site preset (section, group or element) into a page or a region.site.editnone
preset.saveSave a page node and its subtree into the site preset library, with fresh ids; refuses bindings the copy cannot keep.site.editnone
preset.renameRename a preset of the site library.site.editnone
preset.deleteDelete a preset from the site library; pages that inserted it keep their copies.site.editdestructive
preset.indexList the presets the site can insert, theme presets first, then the site library, without their trees: each with its source, id, kind, label, keywords, category and description.site.readnone
preset.readRead one preset with its tree, named as preset.insert names it (kind, presetId, and source, the theme's presets when absent).site.readnone

preset.list

List the presets the site can insert, theme presets first, then the site library; each with its tree.

permission: site.readreads onlyclass: read

Esempio di input

{
  "kind": "section"
}

Input

FieldTypeRequiredNotes
kindstringnoOne of "section", "box", "element".
sourcestringnoOne of "theme", "site".

Output

FieldTypeRequiredNotes

Provala

yarn splash preset.list '{"kind":"section"}' --dry-run

preset.insert

Insert a fresh copy of a theme or site preset (section, group or element) into a page or a region. A section preset goes under a tree's root: in a region (header or footer), parentId is the region root, the root id region.read answers, never a section inside the region, which is refused as I5.section_placement. An element or box preset asked for under the root is wrapped in a new section (the answer's nodeId is the section); elsewhere it goes where asked. The batch is atomic, so one refused insert fails the whole batch.

permission: site.editwrites: tree:{pageId}class: transactionundo: yes

Esempio di input

{
  "pageId": "6f1d2c3b-4a59-4e8d-9c7b-1a2b3c4d5e6f",
  "parentId": "root0000",
  "index": 0,
  "kind": "section",
  "presetId": "hero-split",
  "source": "theme"
}

Input

FieldTypeRequiredNotes
pageIdstringyesAt least 1 character.
parentIdstringyes
indexintegeryesAt least 0.
kindstringyesOne of "section", "box", "element".
presetIdstringyesAt least 1 character.
sourcestringnoOne of "theme", "site".

Output

FieldTypeRequiredNotes
revisionintegeryesAt least 0.
inversearray of object | object | object | object | object | object | object | object | object | object | object | object | objectyes
nodeIdstringyes

Provala

yarn splash preset.insert '{"pageId":"6f1d2c3b-4a59-4e8d-9c7b-1a2b3c4d5e6f","parentId":"root0000","index":0,"kind":"section","presetId":"hero-split","source":"theme"}' --dry-run

preset.save

Save a page node and its subtree into the site preset library, with fresh ids; refuses bindings the copy cannot keep.

permission: site.editwrites: presetsclass: transactionundo: yes

Esempio di input

{
  "pageId": "6f1d2c3b-4a59-4e8d-9c7b-1a2b3c4d5e6f",
  "nodeId": "claim001",
  "label": "Claim band",
  "kind": "element",
  "category": "bands"
}

Input

FieldTypeRequiredNotes
pageIdstringyesAt least 1 character.
nodeIdstringyes
labelstringyesAt least 1 character. At most 80 characters.
idstringno
kindstringnoOne of "section", "box", "element".
categorystringno
descriptionstringnoAt most 280 characters.

Output

FieldTypeRequiredNotes
sourcestringyesOne of "theme", "site".
idstringyes
kindstringyesOne of "section", "box", "element".
labelstringyesAt least 1 character. At most 80 characters.
keywordsarray of stringnoAt least 1 item. At most 16 items.
categorystringyes
descriptionstringnoAt most 280 characters.
thumbnailstringno
scenesarray of objectnoAt most 20 items.
scenes[].triggerobject | object | object | object | object | objectyes
scenes[].entriesarray of objectyesAt most 100 items.
scenes[].conditionsobjectno
scenes[].actionsarray of object | objectnoAt most 20 items.
scenes[].seedintegernoAt least 0. At most 4294967295.
scenes[].pushByobjectno
scenes[].recipeobjectno
scenes[].disabledbooleanno
scenes[].defaultsobjectno
treeobject | object | object | object | object | object | objectyes

I campi più annidati sono nello schema di output che risponde discover_operations con outputSchemas: true.

Provala

yarn splash preset.save '{"pageId":"6f1d2c3b-4a59-4e8d-9c7b-1a2b3c4d5e6f","nodeId":"claim001","label":"Claim band","kind":"element","category":"bands"}' --dry-run

preset.rename

Rename a preset of the site library.

permission: site.editwrites: presetsclass: transactionundo: yes

Esempio di input

{
  "presetId": "claim-band",
  "label": "Claim band, dark"
}

Input

FieldTypeRequiredNotes
presetIdstringyes
labelstringyesAt least 1 character. At most 80 characters.

Output

FieldTypeRequiredNotes
sourcestringyesOne of "theme", "site".
idstringyes
kindstringyesOne of "section", "box", "element".
labelstringyesAt least 1 character. At most 80 characters.
keywordsarray of stringnoAt least 1 item. At most 16 items.
categorystringyes
descriptionstringnoAt most 280 characters.
thumbnailstringno
scenesarray of objectnoAt most 20 items.
scenes[].triggerobject | object | object | object | object | objectyes
scenes[].entriesarray of objectyesAt most 100 items.
scenes[].conditionsobjectno
scenes[].actionsarray of object | objectnoAt most 20 items.
scenes[].seedintegernoAt least 0. At most 4294967295.
scenes[].pushByobjectno
scenes[].recipeobjectno
scenes[].disabledbooleanno
scenes[].defaultsobjectno
treeobject | object | object | object | object | object | objectyes

I campi più annidati sono nello schema di output che risponde discover_operations con outputSchemas: true.

Provala

yarn splash preset.rename '{"presetId":"claim-band","label":"Claim band, dark"}' --dry-run

preset.delete

Delete a preset from the site library; pages that inserted it keep their copies.

permission: site.editwrites: presetsclass: transactionconfirm: destructiveundo: yes

Esempio di input

{
  "presetId": "claim-band"
}

Input

FieldTypeRequiredNotes
presetIdstringyes

Output

FieldTypeRequiredNotes
successtrueyes

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.

preset.index

List the presets the site can insert, theme presets first, then the site library, without their trees: each with its source, id, kind, label, keywords, category and description. Read one preset's tree with preset.read; insert one with preset.insert.

permission: site.readreads onlyclass: read

Esempio di input

{
  "kind": "section"
}

Input

FieldTypeRequiredNotes
kindstringnoOne of "section", "box", "element".
sourcestringnoOne of "theme", "site".

Output

FieldTypeRequiredNotes

Provala

yarn splash preset.index '{"kind":"section"}' --dry-run

preset.read

Read one preset with its tree, named as preset.insert names it (kind, presetId, and source, the theme's presets when absent). Refused with 404 preset_not_found when the site has no such preset.

permission: site.readreads onlyclass: read

Esempio di input

{
  "kind": "section",
  "presetId": "hero-split",
  "source": "theme"
}

Input

FieldTypeRequiredNotes
kindstringyesOne of "section", "box", "element".
presetIdstringyesAt least 1 character.
sourcestringnoOne of "theme", "site".

Output

FieldTypeRequiredNotes
sourcestringyesOne of "theme", "site".
idstringyes
kindstringyesOne of "section", "box", "element".
labelstringyesAt least 1 character. At most 80 characters.
keywordsarray of stringnoAt least 1 item. At most 16 items.
categorystringyes
descriptionstringnoAt most 280 characters.
thumbnailstringno
scenesarray of objectnoAt most 20 items.
scenes[].triggerobject | object | object | object | object | objectyes
scenes[].entriesarray of objectyesAt most 100 items.
scenes[].conditionsobjectno
scenes[].actionsarray of object | objectnoAt most 20 items.
scenes[].seedintegernoAt least 0. At most 4294967295.
scenes[].pushByobjectno
scenes[].recipeobjectno
scenes[].disabledbooleanno
scenes[].defaultsobjectno
treeobject | object | object | object | object | object | objectyes

I campi più annidati sono nello schema di output che risponde discover_operations con outputSchemas: true.

Provala

yarn splash preset.read '{"kind":"section","presetId":"hero-split","source":"theme"}' --dry-run

Generato dal registro delle operazioni e dal catalogo degli strumenti MCP (sorgente 7f6b25496ba8c140).

Qualcosa non va in questa pagina? Scrivi a docs@librettocms.com.

Guida di Libretto

Colophon. Questa guida è un sito Libretto: 70 pagine in due lingue, 21 pagine della guida importate da Markdown e 42 pagine di riferimento generate dal registro delle operazioni. Composta in Softcore, il codice in IBM Plex Mono. La sua struttura:

/it/ Guida di Libretto /it/start Per iniziare /it/start/request-access Richiedere l'accesso /it/start/workspace Il tuo spazio di lavoro /it/start/first-site Il tuo primo sito /it/start/invite-a-client Invitare un cliente /it/start/connect-claude Connettere Claude a Libretto /it/build Costruire /it/build/first-page Costruire una pagina /it/build/layers-and-canvas Livelli e canvas /it/build/site-components Componenti del sito /it/design-system Design system /it/design-system/tokens Colori, spazi e temi /it/design-system/components Componenti e varianti /it/design-system/fonts Tipografia e font /it/motion Movimento /it/motion/scenes Scene e ricette /it/motion/image-sequences Sequenze di immagini /it/motion/reduced-motion Movimento ridotto /it/publish Pubblicazione /it/publish/languages Le lingue del sito /it/publish/versions Pubblicazione e versioni /it/publish/members-and-forms Iscritti e moduli /it/publish/domains Domini /it/publish/redirects Reindirizzamenti /it/handover Consegnare un sito al cliente /it/glossary Glossario /it/agents Agenti e API /it/agents/mcp Server MCP /it/agents/cli CLI /it/agents/batches Batch /it/agents/errors Errori e segnalazioni /it/agents/operations Operazioni /it/search Cerca