@contentstack/cli-cm-import 1.26.0 → 1.26.1

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.26.0 linux-x64 node-v22.17.1
50
+ @contentstack/cli-cm-import/1.26.1 linux-x64 node-v22.17.1
51
51
  $ csdx --help [COMMAND]
52
52
  USAGE
53
53
  $ csdx COMMAND
@@ -45,9 +45,10 @@ class ImportCommand extends cli_command_1.Command {
45
45
  // Branch not enabled, just the let flow continue
46
46
  }
47
47
  }
48
+ // Set backupDir early so it's available in error handling
49
+ backupDir = importConfig.backupDir;
48
50
  const moduleImporter = new import_1.ModuleImporter(managementAPIClient, importConfig);
49
51
  const result = await moduleImporter.start();
50
- backupDir = importConfig.backupDir;
51
52
  if (!(result === null || result === void 0 ? void 0 : result.noSuccessMsg)) {
52
53
  const successMessage = importConfig.stackName
53
54
  ? `Successfully imported the content to the stack named ${importConfig.stackName} with the API key ${importConfig.apiKey} .`
@@ -60,7 +61,12 @@ class ImportCommand extends cli_command_1.Command {
60
61
  catch (error) {
61
62
  (0, cli_utilities_1.handleAndLogError)(error);
62
63
  cli_utilities_1.log.info(`The log has been stored at '${(0, cli_utilities_1.getLogPath)()}'`);
63
- cli_utilities_1.log.info(`The backup content has been stored at '${backupDir}'`);
64
+ if (backupDir) {
65
+ cli_utilities_1.log.info(`The backup content has been stored at '${backupDir}'`);
66
+ }
67
+ else {
68
+ cli_utilities_1.log.info('No backup directory was created due to early termination');
69
+ }
64
70
  }
65
71
  }
66
72
  // Create export context object
@@ -40,7 +40,15 @@ class ModuleImporter {
40
40
  // NOTE audit and fix the import content.
41
41
  if (!this.importConfig.skipAudit &&
42
42
  (!this.importConfig.moduleName ||
43
- ['content-types', 'global-fields', 'entries', 'extensions', 'workflows', 'custom-roles'].includes(this.importConfig.moduleName))) {
43
+ [
44
+ 'content-types',
45
+ 'global-fields',
46
+ 'entries',
47
+ 'extensions',
48
+ 'workflows',
49
+ 'custom-roles',
50
+ 'assets'
51
+ ].includes(this.importConfig.moduleName))) {
44
52
  if (!(await this.auditImportData(logger))) {
45
53
  return { noSuccessMsg: true };
46
54
  }
@@ -119,11 +127,20 @@ class ModuleImporter {
119
127
  }
120
128
  else if (this.importConfig.modules.types.length) {
121
129
  this.importConfig.modules.types
122
- .filter((val) => ['content-types', 'global-fields', 'entries', 'extensions', 'workflows', 'custom-roles'].includes(val))
130
+ .filter((val) => [
131
+ 'content-types',
132
+ 'global-fields',
133
+ 'entries',
134
+ 'extensions',
135
+ 'workflows',
136
+ 'custom-roles',
137
+ 'assets'
138
+ ].includes(val))
123
139
  .forEach((val) => {
124
140
  args.push('--modules', val);
125
141
  });
126
142
  }
143
+ args.push('--modules', 'field-rules');
127
144
  (0, utils_1.log)(this.importConfig, 'Starting audit process', 'info');
128
145
  const result = await cli_audit_1.AuditFix.run(args);
129
146
  (0, utils_1.log)(this.importConfig, 'Audit process completed', 'info');
@@ -199,5 +199,5 @@
199
199
  ]
200
200
  }
201
201
  },
202
- "version": "1.26.0"
202
+ "version": "1.26.1"
203
203
  }
package/package.json CHANGED
@@ -1,13 +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.26.0",
4
+ "version": "1.26.1",
5
5
  "author": "Contentstack",
6
6
  "bugs": "https://github.com/contentstack/cli/issues",
7
7
  "dependencies": {
8
8
  "@contentstack/cli-audit": "~1.14.0",
9
9
  "@contentstack/cli-command": "~1.6.0",
10
- "@contentstack/cli-utilities": "~1.13.0",
10
+ "@contentstack/cli-utilities": "~1.13.1",
11
11
  "@contentstack/management": "~1.22.0",
12
12
  "@contentstack/cli-variants": "~1.3.0",
13
13
  "@oclif/core": "^4.3.0",
@@ -36,7 +36,7 @@
36
36
  "@types/uuid": "^9.0.8",
37
37
  "@typescript-eslint/eslint-plugin": "^5.62.0",
38
38
  "eslint": "^8.57.1",
39
- "eslint-config-oclif": "^6.0.62",
39
+ "eslint-config-oclif": "^6.0.89",
40
40
  "mocha": "^10.8.2",
41
41
  "nyc": "^15.1.0",
42
42
  "oclif": "^4.17.46",