v7.2.0
Release and document version actions support
JavaScript Client
Content Release and Document Version operations
The client now has complete abstractions and types for all Content Lake release and version actions.
These are available to be used directly interfacing with the server action:
client.action(
{
actionType: 'sanity.action.document.version.create',
publishedId: 'bike-123',
document: {
_id: 'versions.new-bike-release.bike-123'
_type: 'bike'
}
}
)
Or additionally through method abstractions which provide more unified concepts such as releaseId
and publishedId
, in addition to client side guards on mismatching IDs:
client.createVersion(
{
publishedId: 'bike-123',
releaseId: 'new-bike-release',
document: {
_type: 'bike'
}
}
)
Deprecation notice of some document server actions
The discard
and replaceDraft
actions now have deprecation notices in the client, to reflect updates on the underlying Content Lake API.
discard
is superseded by discardVersion
and replaceDraft
by replaceVersion