npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

contentstack-cli-content-type

v1.2.2

Published

Retrieve information about Content Types in a Stack.

Downloads

136

Readme

Node.js CI npm

Description

This is a plugin for Contentstack's CLI. It allows you to quickly retrieve information about Content Types in a Stack.

Why use this plugin

  1. The csdx content-type:audit command lists recent changes to a content type and by whom. This is useful when needing to find Content Type versions to compare with csdx content-type:compare. Audit logs are stored for 90 days within Contentstack.

  2. The csdx content-type:compare-remote command allows you to compare the same Content Type between two Stacks. This is useful when you have cloned or duplicated a Stack, and want to check what has changed in a child Stack.

  3. The csdx content-type:compare command allows you to compare multiple versions of a Content Type within a single Stack. This is useful when you are working in a development team, and want to compare changes made by colleagues.

  4. The csdx content-type:list command is useful when you want to see all the Content Types within a Stack. The Content Type's Display Name, UID, Last Modified Date, and Version number is shown. The list can be ordered by title or modified date. When developing against Contentstack, Content Type UIDs are needed when requesting data.

  5. The csdx content-type:details command provides useful information, such as:

    • Field UID and Data Types
    • Referenced Content Types
    • Options such as required, multiple, and unique
    • The full path to a field, useful when using the include reference endpoint or filtering operations, such as the equality endpoint.
  6. The csdx content-type:diagram command creates a visual representation of a Stack's content model.

    • The ouput format can be either svg or dot.
    • The diagram's orientation can be changed, using the -d landscape|portrait flag.
    • GraphViz is the layout engine. You can export the generated DOT Language source, using the -t dot flag.
    • Diagram Output

How to install this plugin

$ csdx plugins:install contentstack-cli-content-type

How to use this plugin

This plugin requires you to be authenticated using csdx auth:login.

Several commands, such as csdx content-type:compare support token aliases as input. These token aliases should be created using csdx auth:tokens:add.

The commands only use the Stack API Key. The management token is ignored. They are provided as a convenience, so the Stack API Keys do not have to be re-typed.

Usability

The csdx content-type:details command requires a wide terminal window. If the path column is not needed, you can hide it:

$ csdx content-type:details -a "management token" -c "content type" --no-path

Commands

csdx content-type:audit

Display recent changes to a Content Type

USAGE
  $ csdx content-type:audit -c <value> [-s <value> | -a <value> | -a <value>] [-k <value> |  | ]

FLAGS
  -a, --alias=<value>          Alias of the management token
  -a, --token-alias=<value>    Management token alias
  -c, --content-type=<value>   (required) Content Type UID
  -k, --stack-api-key=<value>  Stack API Key
  -s, --stack=<value>          Stack UID

DESCRIPTION
  Display recent changes to a Content Type

EXAMPLES
  $ csdx content-type:audit --stack-api-key "xxxxxxxxxxxxxxxxxxx" --content-type "home_page"

  $ csdx content-type:audit --alias "management token" --content-type "home_page"

See code: src/commands/content-type/audit.ts

csdx content-type:compare

Compare two Content Type versions

USAGE
  $ csdx content-type:compare -c <value> [-s <value> | -a <value>] [-k <value> | ] [-a <value>] [-l <value> -r <value>]

FLAGS
  -a, --alias=<value>          Alias of the management token
  -a, --token-alias=<value>    Management token alias
  -c, --content-type=<value>   (required) Content Type UID
  -k, --stack-api-key=<value>  Stack API Key
  -l, --left=<value>           Content Type version, i.e. prev version
  -r, --right=<value>          Content Type version, i.e. later version
  -s, --stack=<value>          Stack UID

DESCRIPTION
  Compare two Content Type versions

EXAMPLES
  $ csdx content-type:compare --stack-api-key "xxxxxxxxxxxxxxxxxxx" --content-type "home_page"

  $ csdx content-type:compare --stack-api-key "xxxxxxxxxxxxxxxxxxx" --content-type "home_page" --left # --right #

  $ csdx content-type:compare --alias "management token" --content-type "home_page" --left # --right #

See code: src/commands/content-type/compare.ts

csdx content-type:compare-remote

compare two Content Types on different Stacks

USAGE
  $ csdx content-type:compare-remote (-o <value> -r <value>) -c <value>

FLAGS
  -c, --content-type=<value>  (required) Content Type UID
  -o, --origin-stack=<value>  (required) Origin Stack API Key
  -r, --remote-stack=<value>  (required) Remote Stack API Key

DESCRIPTION
  compare two Content Types on different Stacks

EXAMPLES
  $ csdx content-type:compare-remote --origin-stack "xxxxxxxxxxxxxxxxxxx" --remote-stack "xxxxxxxxxxxxxxxxxxx" -content-type "home_page"

See code: src/commands/content-type/compare-remote.ts

csdx content-type:details

Display Content Type details

USAGE
  $ csdx content-type:details -c <value> [-s <value> | -a <value>] [-k <value> | ] [-a <value>] [-p]

FLAGS
  -a, --alias=<value>          Alias of the management token
  -a, --token-alias=<value>    Management token alias
  -c, --content-type=<value>   (required) Content Type UID
  -k, --stack-api-key=<value>  Stack API Key
  -p, --[no-]path              show path column
  -s, --stack=<value>          Stack UID

DESCRIPTION
  Display Content Type details

EXAMPLES
  $ csdx content-type:details --stack-api-key "xxxxxxxxxxxxxxxxxxx" --content-type "home_page"

  $ csdx content-type:details --alias "management token" --content-type "home_page"

  $ csdx content-type:details --alias "management token" --content-type "home_page" --no-path

See code: src/commands/content-type/details.ts

csdx content-type:diagram

Create a visual diagram of a Stack's Content Types

USAGE
  $ csdx content-type:diagram -o <value> -d portrait|landscape -t svg|dot [-s <value> | -a <value> | -a <value>] [-k
    <value> |  | ]

FLAGS
  -a, --alias=<value>          Alias of the management token
  -a, --token-alias=<value>    Management token alias
  -d, --direction=<option>     (required) [default: portrait] graph orientation
                               <options: portrait|landscape>
  -k, --stack-api-key=<value>  Stack API Key
  -o, --output=<value>         (required) full path to output
  -s, --stack=<value>          Stack UID
  -t, --type=<option>          (required) [default: svg] graph output file type
                               <options: svg|dot>

DESCRIPTION
  Create a visual diagram of a Stack's Content Types

EXAMPLES
  $ csdx content-type:diagram --stack-api-key "xxxxxxxxxxxxxxxxxxx" --output "content-model.svg"

  $ csdx content-type:diagram --alias "management token" --output "content-model.svg"

  $ csdx content-type:diagram --alias "management token" --output "content-model.svg" --direction "landscape"

  $ csdx content-type:diagram --alias "management token" --output "content-model.dot" --type "dot"

See code: src/commands/content-type/diagram.ts

csdx content-type:list

List all Content Types in a Stack

USAGE
  $ csdx content-type:list [-s <value> | -a <value> | -a <value>] [-k <value> |  | ] [-o title|modified]

FLAGS
  -a, --alias=<value>          Alias of the management token
  -a, --token-alias=<value>    Management token alias
  -k, --stack-api-key=<value>  Stack API Key
  -o, --order=<option>         [default: title] order by column
                               <options: title|modified>
  -s, --stack=<value>          Stack UID

DESCRIPTION
  List all Content Types in a Stack

EXAMPLES
  $ csdx content-type:list --stack-api-key "xxxxxxxxxxxxxxxxxxx"

  $ csdx content-type:list --alias "management token"

  $ csdx content-type:list --alias "management token" --order modified

See code: src/commands/content-type/list.ts