Giter VIP home page Giter VIP logo

contentful-clean-space's Introduction

contentful-clean-space

Delete all entries from a contentful space.

Contentful CLI doesn't have a command to delete all entries from a space without deleting the space itself. However, this can be very useful, e.g. for user contract testing.

Installation

Using npm:

npm install -g contentful-clean-space

Usage

contentful-clean-space
Options:
      --help           Show help                                       [boolean]
      --space-id       Contentful space id                   [string] [required]
      --env            Contentful environment                [string] [required]
      --accesstoken    Contentful access token               [string] [required]
      --batch-size     Number of parallel contentful requests
                                                           [number] [default: 5]
      --content-types  Delete content types as well   [boolean] [default: false]
      --assets         Delete assets as well          [boolean] [default: false]
  -y, --yes            Auto-confirm delete prompt     [boolean] [default: false]
  -v, --verbose                                       [boolean] [default: false]

All parameters can be provided from environment variables, too. To do that, just set an environment variable using UPPER_CASE casing.

Example Usage

To delete all entries, content types, as well as assets in the "master" environment, and without the safety prompt, use contentful-clean-space --space-id [space id] --accesstoken [personal access token] --content-types=true --assets=true --env master --yes=true

contentful-clean-space's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar ikstar avatar s5no5t avatar soehlert-ecademy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

contentful-clean-space's Issues

Deprecated warning: Space.getContentTypes

When running the tool to delete all content types, warning messages are being shown asking for the usage of the method Environment.getContentTypes to replace Space.getContentTypes due to the deprecation and future removal of the later.

Using this tool is terrifying. Here's some ideas to make it less scary.

Hi,

This is extremely helpful but terrifying to use.

My use case is that I have a sandbox environment I need to clear out which shares a space with the master environment of a production site for a commercial entity.

This tool should provide more verbose feedback and change its default settings to make it less likely to accidentally the delete the master environment entries, which I am terrified might happen.

Please implement the following:

  1. Please do NOT make master the default value for the --env option, or set any default value here, please make the user set this manually every time.

  2. Please DO make the default value for the --yes confirmation prompt true by default.

  3. Please DO print the environment name as a sanity check before deleting entries.

  4. Please DO provide an example of a "safe" and "correct" CLI command. So far, I have not been able to get the --yes flag to work correctly, having tried --yes, --yes=true, and -y.

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.