PublishRules

PublishRules

Source:
PublishRules is a tool that allows you to streamline the process of content creation and publishing, and lets you manage the content lifecycle of your project smoothly. Read more about PublishRuless and Publish Rules.

Methods

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

Source:
The Create Publish Rules request allows you to create publish rules for the publish rules of a stack.
Example
import * as contentstack from '@contentstack/management'
const client = contentstack.client()
const publishing_rule = {
   	"publish rules": "publish rules_uid",
       "actions": [],
       "content_types": ["$all"],
       "locales": ["en-us"],
       "environment": "environment_uid",
        "approvers": {
       	"users": ["user_uid"],
       	"roles": ["role_uid"]
       },
       "publish rules_stage": "publish rules_stage_uid",
        "disable_approver_publishing": false
   }
client.stack().publishRules().create({ publishing_rule })
.then((publishRules) => console.log(publishRules))
Returns:
Promise for PublishRules instance
Type
Promise.<PublishRules.PublishRules>