ReleaseItem

ReleaseItem

Source:
A ReleaseItem is a set of entries and assets that needs to be deployed (published or unpublished) all at once to a particular environment.

Methods

(static) delete() → {Object}

Source:
The Delete method request deletes one or more items (entries and/or assets) from a specific Release.
Examples
import * as contentstack from '@contentstack/management'
const client = contentstack.client()
// To delete all the items from release
client.stack({ api_key: 'api_key'}).release('release_uid').delete()
.then((response) => console.log(response.notice))
     
// Delete specific items from delete
import * as contentstack from '@contentstack/management'
const client = contentstack.client() 

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').delete({items})
.then((response) => console.log(response.notice))
Parameters:
Name Type Description
param.items Object Add multiple items to a Release
param.items Object Add multiple items to a Release
Returns:
Response Object.
Type
Object

(static) create() → {Promise.<Release.Release>}

Source:
The Create method allows you to add an one or more items items (entry or asset) to a Release.
Examples
import * as contentstack from '@contentstack/management'
const client = contentstack.client()

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()

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))
Parameters:
Name Type Description
param.item Object Add a single item to a Release
param.items Object Add multiple items to a Release
Returns:
Promise for Release instance
Type
Promise.<Release.Release>

(static) findAll() → {Promise.<ContentstackCollection.ContentstackCollection>}

Source:
The Get all items in a Release request retrieves a list of all items (entries and assets) that are part of a specific Release.
Example
import * as contentstack from '@contentstack/management'
const client = contentstack.client()

client.stack({ api_key: 'api_key'}).release('release_uid').item().fetchAll()
.then((items) => console.log(items))
Parameters:
Name Type Description
param.include_count Boolean ‘include_count’ parameter includes the count of total number of items in Release, along with the details of each items.
param.limit Int The ‘limit’ parameter will return a specific number of release items in the output.
param.skip Int The ‘skip’ parameter will skip a specific number of release items in the response.
Returns:
Promise for ContentType instance
Type
Promise.<ContentstackCollection.ContentstackCollection>