With this component you can easily delete a bulk of resources on the commercetools platform.
- Install the module with:
$ npm install sphere-deleter
- Build local libraries from coffeescript:
$ grunt build
- Clone repository:
$ git clone [email protected]:mmoelli/sphere-deleter.git
- Install dependencies from
npm
:$ npm i
- Build local libraries from coffeescript:
$ grunt build
General command line options can be seen by simply executing the command node lib/run
.
$ node lib/run
Usage: --projectKey <project-key> --clientId <client-id> --clientSecret <client-secret>
Options:
--projectKey <key> your commercetools project-key
--clientId <id> your OAuth client id for the commercetools API
--clientSecret <secret> your OAuth client secret for the commercetools API
--resource <resource> the type of resource you want delete
--resourceId <id> specific id of a resource you want to delete
--deleteHours <hours> number of hours to go back for deletion (lastModifiedAt) [default: 1]
--allTime
--logLevel <level> specifies log level (error|warn|info|debug|trace) [default: info]
--logDir <directory> specifies log file directory [.]
--logSilent <boolean> use console to print messages [default: false]
The following resources can be selected for deletions
cartDiscounts
carts
categories
channels
customObjects
customers
customerGroups
discountCodes
inventoryEntries
orders
payments
products
productDiscounts
productProjections
productTypes
reviews
shippingMethods
states
taxCategories
types
zones
Tests are written using jasmine (Behavior-Driven Development framework for testing javascript code). Thanks to jasmine-node, this test framework is also available for Node.js.
To run tests, simple execute the test task using grunt
.
$ grunt test
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt. More info here
Releasing a new version is completely automated using the Grunt task grunt release
.
grunt release // patch release
grunt release:minor // minor release
grunt release:major // major release
We <3 CoffeeScript here at commercetools! So please have a look at this referenced coffeescript styleguide when doing changes to the code.
Copyright (c) 2015 Martin Möllmann Licensed under the MIT License