@contentstack/cli-cm-import 0.1.1-beta.10 → 0.1.1-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -16,7 +16,7 @@ $ npm install -g @contentstack/cli-cm-import
16
16
  $ csdx COMMAND
17
17
  running command...
18
18
  $ csdx (-v|--version|version)
19
- @contentstack/cli-cm-import/0.1.1-beta.10 linux-x64 node-v12.22.7
19
+ @contentstack/cli-cm-import/0.1.1-beta.11 linux-x64 node-v12.22.7
20
20
  $ csdx --help [COMMAND]
21
21
  USAGE
22
22
  $ csdx COMMAND
@@ -57,5 +57,5 @@ EXAMPLES
57
57
  csdx cm:import -a <management_token_alias> -c <path/of/config/file>
58
58
  ```
59
59
 
60
- _See code: [src/commands/cm/import.js](https://github.com/contentstack/cli/blob/v0.1.1-beta.10/packages/contentstack-import/src/commands/cm/import.js)_
60
+ _See code: [src/commands/cm/import.js](https://github.com/contentstack/cli/blob/v0.1.1-beta.11/packages/contentstack-import/src/commands/cm/import.js)_
61
61
  <!-- commandsstop -->
@@ -1 +1 @@
1
- {"version":"0.1.1-beta.10","commands":{"cm:import":{"id":"cm:import","description":"Import script for importing the content into new stack\n...\nOnce you export content from the source stack, import it to your destination stack by using the cm:import command.\n","pluginName":"@contentstack/cli-cm-import","pluginType":"core","aliases":[],"examples":["csdx cm:import -A","csdx cm:import -A -s <stack_ApiKey> -d <path/of/export/destination/dir>","csdx cm:import -A -c <path/of/config/dir>","csdx cm:import -A -m <single module name>","csdx cm:import -A -m <single module name> -b <backup dir>","csdx cm:import -a <management_token_alias>","csdx cm:import -a <management_token_alias> -d <path/of/export/destination/dir>","csdx cm:import -a <management_token_alias> -c <path/of/config/file>"],"flags":{"config":{"name":"config","type":"option","char":"c","description":"[optional] path of config file"},"stack-uid":{"name":"stack-uid","type":"option","char":"s","description":"API key of the target stack"},"data":{"name":"data","type":"option","char":"d","description":"path and location where data is stored"},"management-token-alias":{"name":"management-token-alias","type":"option","char":"a","description":"alias of the management token"},"auth-token":{"name":"auth-token","type":"boolean","char":"A","description":"to use auth token","allowNo":false},"module":{"name":"module","type":"option","char":"m","description":"[optional] specific module name"},"backup-dir":{"name":"backup-dir","type":"option","char":"b","description":"[optional] backup directory name when using specific module"}},"args":[]}}}
1
+ {"version":"0.1.1-beta.11","commands":{"cm:import":{"id":"cm:import","description":"Import script for importing the content into new stack\n...\nOnce you export content from the source stack, import it to your destination stack by using the cm:import command.\n","pluginName":"@contentstack/cli-cm-import","pluginType":"core","aliases":[],"examples":["csdx cm:import -A","csdx cm:import -A -s <stack_ApiKey> -d <path/of/export/destination/dir>","csdx cm:import -A -c <path/of/config/dir>","csdx cm:import -A -m <single module name>","csdx cm:import -A -m <single module name> -b <backup dir>","csdx cm:import -a <management_token_alias>","csdx cm:import -a <management_token_alias> -d <path/of/export/destination/dir>","csdx cm:import -a <management_token_alias> -c <path/of/config/file>"],"flags":{"config":{"name":"config","type":"option","char":"c","description":"[optional] path of config file"},"stack-uid":{"name":"stack-uid","type":"option","char":"s","description":"API key of the target stack"},"data":{"name":"data","type":"option","char":"d","description":"path and location where data is stored"},"management-token-alias":{"name":"management-token-alias","type":"option","char":"a","description":"alias of the management token"},"auth-token":{"name":"auth-token","type":"boolean","char":"A","description":"to use auth token","allowNo":false},"module":{"name":"module","type":"option","char":"m","description":"[optional] specific module name"},"backup-dir":{"name":"backup-dir","type":"option","char":"b","description":"[optional] backup directory name when using specific module"}},"args":[]}}}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@contentstack/cli-cm-import",
3
3
  "description": "Contentstack CLI plugin to import content into stack",
4
- "version": "0.1.1-beta.10",
4
+ "version": "0.1.1-beta.11",
5
5
  "author": "Contentstack",
6
6
  "bugs": "https://github.com/contentstack/cli/issues",
7
7
  "dependencies": {
@@ -4,7 +4,7 @@ var _ = require('lodash');
4
4
 
5
5
  /* eslint-disable no-empty */
6
6
  var removeReferenceFields = module.exports = function (schema, flag) {
7
- for (var i in schema) {
7
+ for (let i = 0; i < schema.length; i++) {
8
8
  if (schema[i].data_type === 'group') {
9
9
  removeReferenceFields(schema[i].schema, flag);
10
10
  } else if (schema[i].data_type === 'blocks') {
@@ -13,10 +13,8 @@ var removeReferenceFields = module.exports = function (schema, flag) {
13
13
  }
14
14
  } else if(schema[i].data_type === 'reference') {
15
15
  flag.supressed = true;
16
- _.remove(schema, function(c) {
17
- return c.data_type === 'reference';
18
- });
19
-
16
+ schema.splice(i, 1);
17
+ --i;
20
18
  if(schema.length < 1) {
21
19
  schema.push({
22
20
  'data_type': 'text',