Publication operations
6 operations named publication.*. Every one runs in a batch through apply_ops, dry_run_ops, the CLI or the admin.
| Operation | What it does | Permission | Confirmation |
|---|---|---|---|
| publication.publish | Publish the site: snapshot the draft (pages whose status is published, their trees, menus, collections with their published items, design system, settings, fonts) into a new live version, so the public site serves it. | content.publish | publish |
| publication.activate | Make an earlier published version of the site live again (roll back). | versions.activate | publish |
| publication.rollbackPage | Restore one page of the draft to how an earlier published version held it: its page fields, its tree and its scenes, through the tree commit, so an open editor replays it. | site.edit | destructive |
| publication.versions | List the site's published versions, newest first, limit of them (20 by default): each with its id (the versionId of publication.activate and publication.rollbackPage), its shortId (the first 8 characters, the id Pubblicazione e versioni shows: name a version to the person by it), its date (timestamp), its status, its note and whether it is the live one (isActive). | site.read | none |
| publication.versionPages | List the pages of one published version: each with its id in that version (the pageId of publication.rollbackPage), its title and path, the draft page at the same path, and what a rollback of it would change in the draft (title, settings, content, animations; empty when the draft already matches). | site.read | none |
| publication.pending | Say what changed since the live version, newest first: one entry per area (pages, designSystem, siteSettings, navigation, collections, fonts, ...) with the date of its latest draft edit and, for pages and collections, the changed rows. | site.read | none |
publication.publish
Publish the site: snapshot the draft (pages whose status is published, their trees, menus, collections with their published items, design system, settings, fonts) into a new live version, so the public site serves it. Run it alone in a batch with confirmed: ["publish"] and, as baseRevisions, the publishBaseRevisions of publication.pending (read the pending changes first, and publish what you read; a change after that read refuses it as stale); it cannot be dry-run. The answer is the new live version (shortId as Pubblicazione e versioni shows it) and changedAreas, the areas it changed against the version live before it (designSystem alone for a design-system-only change; empty when nothing changed); check the live result with render_preview target: "live". External effects (cache purge, screenshots) run after the commit.
Example input
{
"note": "Opening section and team page"
}Input
| Field | Type | Required | Notes |
|---|---|---|---|
| note | string | no | At most 2000 characters. |
Output
| Field | Type | Required | Notes |
|---|---|---|---|
| version | object | yes | |
| version.id | string (uuid) | yes | |
| version.shortId | string | yes | At least 8 characters. At most 8 characters. |
| version.timestamp | string | yes | |
| version.status | string | yes | One of "building", "ready", "failed". |
| version.isActive | boolean | yes | |
| version.note | string | no | |
| version.hasScreenshot | boolean | no | |
| version.hasMultipleScreenshots | boolean | no | |
| changedAreas | array of string | yes |
A dry run refuses an external operation, so it has no dry-run line: run it alone in a batch.
publication.activate
Make an earlier published version of the site live again (roll back). Run it alone in a batch with confirmed: ["publish"]; check the live result with render_preview target: "live". External effects (cache purge, screenshots) run after the commit.
Example input
{
"versionId": "8b9c0d1e-2f3a-4b4c-8d5e-6f7a8b9c0d1e"
}Input
| Field | Type | Required | Notes |
|---|---|---|---|
| versionId | string (uuid) | yes |
Output
| Field | Type | Required | Notes |
|---|---|---|---|
| success | true | yes | |
| versionId | string (uuid) | yes |
A dry run refuses an external operation, so it has no dry-run line: run it alone in a batch.
publication.rollbackPage
Restore one page of the draft to how an earlier published version held it: its page fields, its tree and its scenes, through the tree commit, so an open editor replays it. A page the draft no longer has is recreated at the same slug and parent path. The rest of the site is unchanged; publish to serve it. Run it alone in a batch with confirmed: ["destructive"]. pageId is the version's page, so the batch locks pages only; to guard the draft tree it rewrites, also pass tree:<draft page id> in baseRevisions, and a stale one is refused with 409 stale_revision.
Example input
{
"pageId": "6f1d2c3b-4a59-4e8d-9c7b-1a2b3c4d5e6f",
"versionId": "8b9c0d1e-2f3a-4b4c-8d5e-6f7a8b9c0d1e"
}Input
| Field | Type | Required | Notes |
|---|---|---|---|
| pageId | string | yes | At least 1 character. |
| versionId | string (uuid) | yes |
Output
| Field | Type | Required | Notes |
|---|---|---|---|
| pageId | string | yes | At least 1 character. |
| treeRevision | integer | yes | At least 0. |
| recreated | boolean | yes |
Needs confirmed: ["destructive"] on the batch, which the single-operation CLI form does not set: put it in a batch file and run yarn splash apply <file> --dry-run.
publication.versions
List the site's published versions, newest first, limit of them (20 by default): each with its id (the versionId of publication.activate and publication.rollbackPage), its shortId (the first 8 characters, the id Pubblicazione e versioni shows: name a version to the person by it), its date (timestamp), its status, its note and whether it is the live one (isActive). Read the pages of one with publication.versionPages.
Example input
{
"limit": 10
}Input
| Field | Type | Required | Notes |
|---|---|---|---|
| limit | integer | no | At least 1. At most 100. Default 20. |
Output
| Field | Type | Required | Notes |
|---|---|---|---|
| versions | array of object | yes | |
| versions[].id | string (uuid) | yes | |
| versions[].shortId | string | yes | At least 8 characters. At most 8 characters. |
| versions[].timestamp | string | yes | |
| versions[].status | string | yes | One of "building", "ready", "failed". |
| versions[].isActive | boolean | yes | |
| versions[].note | string | no | |
| versions[].hasScreenshot | boolean | no | |
| versions[].hasMultipleScreenshots | boolean | no |
Try it
yarn splash publication.versions '{"limit":10}' --dry-runpublication.versionPages
List the pages of one published version: each with its id in that version (the pageId of publication.rollbackPage), its title and path, the draft page at the same path, and what a rollback of it would change in the draft (title, settings, content, animations; empty when the draft already matches).
Example input
{
"versionId": "8b9c0d1e-2f3a-4b4c-8d5e-6f7a8b9c0d1e"
}Input
| Field | Type | Required | Notes |
|---|---|---|---|
| versionId | string (uuid) | yes |
Output
| Field | Type | Required | Notes |
|---|---|---|---|
| versionId | string (uuid) | yes | |
| pages | array of object | yes | |
| pages[].id | string | yes | At least 1 character. |
| pages[].kind | string | yes | One of "page", "region", "template", "component". |
| pages[].title | string | yes | |
| pages[].path | string | yes | |
| pages[].draft | object | null | yes | |
| pages[].changes | array of string | yes |
Try it
yarn splash publication.versionPages '{"versionId":"8b9c0d1e-2f3a-4b4c-8d5e-6f7a8b9c0d1e"}' --dry-runpublication.pending
Say what changed since the live version, newest first: one entry per area (pages, designSystem, siteSettings, navigation, collections, fonts, ...) with the date of its latest draft edit and, for pages and collections, the changed rows. A changed page whose status is draft stays out of publication.publish until it is published itself; mark it with page.update. publishBaseRevisions is the baseRevisions record a publication.publish batch needs, as it is now: pass it unchanged, and a draft edit made after this read refuses the publish as stale.
Example input
{}Input
The input is a record; see the schema below.
{
"type": "object",
"properties": {},
"additionalProperties": false
}Output
| Field | Type | Required | Notes |
|---|---|---|---|
| neverPublished | boolean | yes | |
| publishedAt | string (date-time) | null | yes | |
| areas | array of object | yes | |
| areas[].area | string | yes | One of "pages", "designSystem", "siteSettings", "brandIdentity", "envVariables", "apiConfigs", "animationScenes", "navigation", "collections", "fonts". |
| areas[].changedAt | string (date-time) | yes | |
| areas[].items | array of object | object | yes | |
| publishBaseRevisions | record of integer | yes |
Try it
yarn splash publication.pending '{}' --dry-runGenerated from the operation registry and the MCP tool catalogue (source 2dc0cc9bd914bca4).
Something wrong on this page? Write to docs@librettocms.com.