ReleaseItem
ReleaseItem
A ReleaseItem is a set of entries and assets that needs to be deployed (published or unpublished) all at once to a particular environment.
delete
The Delete method request deletes one or more items (entries and/or assets) from a specific Release.
| Name | Type | Description |
|---|---|---|
| params.item | object | Add a single item to a Release |
| params.items | object | Add multiple items to a Release |
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })
client.stack({ api_key: 'api_key'}).release('release_uid').delete()
.then((response) => console.log(response.notice))import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })
const items = [
{
uid: "entry_or_asset_uid1",
version: 1,
locale: "en-us",
content_type_uid: "demo1",
action: "publish"
},
{
uid: "entry_or_asset_uid2",
version: 4,
locale: "fr-fr",
content_type_uid: "demo2",
action: "publish"
}
]
client.stack({ api_key: 'api_key'}).release('release_uid')
.item()
.create({ items })
.then((release) => console.log(release))create
The Create method allows you to add an one or more items (entry or asset) to a Release.
| Name | Type | Description |
|---|---|---|
| params.item | object | Add a single item to a Release |
| params.items | object | Add multiple items to a Release |
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })
const item = {
version: 1,
uid: "entry_or_asset_uid",
content_type_uid: "your_content_type_uid",
action: "publish",
locale: "en-us"
}
client.stack({ api_key: 'api_key'}).release('release_uid')
.item()
.create({ item })
.then((release) => console.log(release))import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })
const items = [
{
uid: "entry_or_asset_uid1",
version: 1,
locale: "en-us",
content_type_uid: "demo1",
action: "publish"
},
{
uid: "entry_or_asset_uid2",
version: 4,
locale: "fr-fr",
content_type_uid: "demo2",
action: "publish"
}
]
client.stack({ api_key: 'api_key'}).release('release_uid')
.item()
.create({ items })
.then((release) => console.log(release))findAll
The Get all items in a Release request retrieves a list of all items (entries and assets) that are part of a specific Release.
| Name | Type | Description |
|---|---|---|
| params.include_count | boolean | The include_count parameter includes the count of total number of items in Release, along with the details of each items. |
| params.limit | number | The limit parameter will return a specific number of release items in the output. |
| params.skip | number | The skip parameter will skip a specific number of release items in the response. |
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })
client.stack({ api_key: 'api_key'}).release('release_uid')
.item()
.findAll()
.then((items) => console.log(items))move
The move method allows you to move multiple items within a specific release.
| Name | Type | Description |
|---|---|---|
| params.param | object | The data containing the items to be moved. |
| params.release_version | string | The release version(2.0) |
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })
const moveData = {
items: [
{
uid: 'entry_uid',
content_type: 'content_type_uid'
}
]
}
client.stack({ api_key: 'api_key'}).release('release_uid').item().move({ param: moveData, release_version: '1.0' })
.then((response) => { console.log(response) })