@contentstack/cli-cm-import 1.8.3 → 1.8.4

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
@@ -47,7 +47,7 @@ $ npm install -g @contentstack/cli-cm-import
47
47
  $ csdx COMMAND
48
48
  running command...
49
49
  $ csdx (--version)
50
- @contentstack/cli-cm-import/1.8.3 linux-x64 node-v18.17.1
50
+ @contentstack/cli-cm-import/1.8.4 linux-x64 node-v18.17.1
51
51
  $ csdx --help [COMMAND]
52
52
  USAGE
53
53
  $ csdx COMMAND
@@ -143,7 +143,11 @@ class ImportWorkflows extends base_class_1.default {
143
143
  return newStage;
144
144
  });
145
145
  const updateWorkflow = this.stack.workflow(workflow.uid);
146
- Object.assign(updateWorkflow, { workflow_stages: newWorkflowStages, name: workflow.name });
146
+ Object.assign(updateWorkflow, {
147
+ name: workflow.name,
148
+ branches: workflow.branches,
149
+ workflow_stages: newWorkflowStages,
150
+ });
147
151
  return updateWorkflow.update();
148
152
  }
149
153
  /**
@@ -14,7 +14,7 @@ const { default: config } = require('../../config');
14
14
  const addlogs = log;
15
15
  module.exports = class ImportEntries {
16
16
  constructor(importConfig, stackAPIClient) {
17
- this.skipFiles = ['__master.json', '__priority.json', 'schema.json'];
17
+ this.skipFiles = ['__master.json', '__priority.json', 'schema.json', '.DS_Store'];
18
18
  this.config = _.merge(config, importConfig);
19
19
  this.stackAPIClient = stackAPIClient;
20
20
  this.mappedAssetUidPath = path.resolve(this.config.data, 'mapper', 'assets', 'uid-mapping.json');
@@ -1029,7 +1029,7 @@ module.exports = class ImportEntries {
1029
1029
  // only checking one level deep, not recursive
1030
1030
  if (element.length) {
1031
1031
  for (const item of element) {
1032
- if ((item.type === 'p' || item.type === 'a') && item.children && item.children.length > 0) {
1032
+ if ((item.type === 'p' || item.type === 'a' || item.type === 'span') && item.children && item.children.length > 0) {
1033
1033
  return this.doEntryReferencesExist(item.children);
1034
1034
  }
1035
1035
  else if (this.isEntryRef(item)) {
@@ -1041,7 +1041,7 @@ module.exports = class ImportEntries {
1041
1041
  if (this.isEntryRef(element)) {
1042
1042
  return true;
1043
1043
  }
1044
- if ((element.type === 'p' || element.type === 'a') && element.children && element.children.length > 0) {
1044
+ if ((element.type === 'p' || element.type === 'a' || element.type === 'span') && element.children && element.children.length > 0) {
1045
1045
  return this.doEntryReferencesExist(element.children);
1046
1046
  }
1047
1047
  }
@@ -159,7 +159,11 @@ module.exports = class importWorkflows {
159
159
  return newStage;
160
160
  });
161
161
  const updateWorkflow = this.stackAPIClient.workflow(workflow.uid);
162
- Object.assign(updateWorkflow, { workflow_stages: newWorkflowStages, name: workflow.name });
162
+ Object.assign(updateWorkflow, {
163
+ name: workflow.name,
164
+ branches: workflow.branches,
165
+ workflow_stages: newWorkflowStages,
166
+ });
163
167
  return updateWorkflow.update();
164
168
  }
165
169
  };
@@ -191,8 +191,7 @@ const lookupAssets = function (data, mappedAssetUids, mappedAssetUrls, assetUidM
191
191
  jsonRteData.children.forEach((element) => {
192
192
  if (element.type) {
193
193
  switch (element.type) {
194
- case 'a':
195
- case 'p': {
194
+ default: {
196
195
  if (element.children && element.children.length > 0) {
197
196
  gatherJsonRteAssetIds(element);
198
197
  }
@@ -21,8 +21,7 @@ const lookupEntries = function (data, mappedUids, uidMapperPath) {
21
21
  jsonRteData.children.forEach((element) => {
22
22
  if (element.type) {
23
23
  switch (element.type) {
24
- case 'a':
25
- case 'p': {
24
+ default: {
26
25
  if (element.children && element.children.length > 0) {
27
26
  gatherJsonRteEntryIds(element);
28
27
  }
@@ -412,7 +411,7 @@ function doEntryReferencesExist(element) {
412
411
  // only checking one level deep, not recursive
413
412
  if (element.length) {
414
413
  for (const item of element) {
415
- if ((item.type === 'p' || item.type === 'a') && item.children && item.children.length > 0) {
414
+ if ((item.type === 'p' || item.type === 'a' || item.type === 'span') && item.children && item.children.length > 0) {
416
415
  return doEntryReferencesExist(item.children);
417
416
  }
418
417
  else if (isEntryRef(item)) {
@@ -424,7 +423,7 @@ function doEntryReferencesExist(element) {
424
423
  if (isEntryRef(element)) {
425
424
  return true;
426
425
  }
427
- if ((element.type === 'p' || element.type === 'a') && element.children && element.children.length > 0) {
426
+ if ((element.type === 'p' || element.type === 'a' || element.type === 'span') && element.children && element.children.length > 0) {
428
427
  return doEntryReferencesExist(element.children);
429
428
  }
430
429
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.8.3",
2
+ "version": "1.8.4",
3
3
  "commands": {
4
4
  "cm:stacks:import": {
5
5
  "id": "cm:stacks:import",
package/package.json CHANGED
@@ -1,14 +1,13 @@
1
1
  {
2
2
  "name": "@contentstack/cli-cm-import",
3
3
  "description": "Contentstack CLI plugin to import content into stack",
4
- "version": "1.8.3",
4
+ "version": "1.8.4",
5
5
  "author": "Contentstack",
6
6
  "bugs": "https://github.com/contentstack/cli/issues",
7
7
  "dependencies": {
8
8
  "@contentstack/cli-command": "~1.2.12",
9
9
  "@contentstack/cli-utilities": "~1.5.2",
10
10
  "@contentstack/management": "~1.10.0",
11
- "@oclif/config": "^1.18.3",
12
11
  "@oclif/core": "^2.9.3",
13
12
  "big-json": "^3.2.0",
14
13
  "bluebird": "^3.7.2",
@@ -96,4 +95,4 @@
96
95
  }
97
96
  },
98
97
  "repository": "https://github.com/contentstack/cli"
99
- }
98
+ }