@contentstack/cli-cm-export 2.0.0-beta.1 → 2.0.0-beta.10

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.
Files changed (43) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +11 -65
  3. package/lib/commands/cm/stacks/export.d.ts +0 -1
  4. package/lib/commands/cm/stacks/export.js +12 -37
  5. package/lib/config/index.js +7 -0
  6. package/lib/constants/index.d.ts +57 -0
  7. package/lib/constants/index.js +59 -0
  8. package/lib/export/module-exporter.js +3 -2
  9. package/lib/export/modules/assets.js +5 -5
  10. package/lib/export/modules/base-class.d.ts +17 -0
  11. package/lib/export/modules/base-class.js +29 -1
  12. package/lib/export/modules/composable-studio.d.ts +15 -0
  13. package/lib/export/modules/composable-studio.js +87 -0
  14. package/lib/export/modules/content-types.js +6 -8
  15. package/lib/export/modules/custom-roles.js +2 -2
  16. package/lib/export/modules/entries.d.ts +1 -1
  17. package/lib/export/modules/entries.js +18 -19
  18. package/lib/export/modules/environments.js +2 -3
  19. package/lib/export/modules/extensions.js +2 -3
  20. package/lib/export/modules/global-fields.js +8 -5
  21. package/lib/export/modules/labels.js +2 -3
  22. package/lib/export/modules/locales.js +2 -3
  23. package/lib/export/modules/marketplace-apps.js +36 -25
  24. package/lib/export/modules/personalize.js +1 -2
  25. package/lib/export/modules/stack.js +29 -29
  26. package/lib/export/modules/taxonomies.d.ts +52 -8
  27. package/lib/export/modules/taxonomies.js +278 -104
  28. package/lib/export/modules/webhooks.js +2 -3
  29. package/lib/export/modules/workflows.js +3 -4
  30. package/lib/types/default-config.d.ts +6 -0
  31. package/lib/types/index.d.ts +27 -2
  32. package/lib/utils/basic-login.d.ts +1 -1
  33. package/lib/utils/basic-login.js +5 -5
  34. package/lib/utils/common-helper.d.ts +1 -1
  35. package/lib/utils/common-helper.js +4 -4
  36. package/lib/utils/export-config-handler.js +10 -13
  37. package/lib/utils/file-helper.js +1 -1
  38. package/lib/utils/logger.d.ts +1 -1
  39. package/lib/utils/logger.js +2 -2
  40. package/lib/utils/marketplace-app-helper.js +2 -4
  41. package/messages/index.json +73 -67
  42. package/oclif.manifest.json +4 -42
  43. package/package.json +18 -15
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  /*!
3
3
  * Contentstack Export
4
- * Copyright (c) 2024 Contentstack LLC
4
+ * Copyright (c) 2026 Contentstack LLC
5
5
  * MIT Licensed
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -13,13 +13,13 @@ const validateConfig = function (config) {
13
13
  if (!config.host || !config.cdn) {
14
14
  throw new Error('Host/CDN end point is missing from config');
15
15
  }
16
- if (config.email && config.password && !config.access_token && !config.source_stack) {
16
+ if (config.email && config.password && !config.access_token && !config.apiKey) {
17
17
  throw new Error('Kindly provide access_token or api_token');
18
18
  }
19
19
  else if (!config.email &&
20
20
  !config.password &&
21
21
  !config.management_token &&
22
- config.source_stack &&
22
+ config.apiKey &&
23
23
  !config.access_token &&
24
24
  !(0, cli_utilities_1.isAuthenticated)()) {
25
25
  throw new Error('Kindly provide management_token or email and password');
@@ -27,7 +27,7 @@ const validateConfig = function (config) {
27
27
  else if (config.email &&
28
28
  config.password &&
29
29
  !config.access_token &&
30
- config.source_stack &&
30
+ config.apiKey &&
31
31
  !config.management_token &&
32
32
  !(0, cli_utilities_1.isAuthenticated)()) {
33
33
  throw new Error('Kindly provide access_token or management_token');
@@ -10,28 +10,29 @@ const interactive_1 = require("./interactive");
10
10
  const basic_login_1 = tslib_1.__importDefault(require("./basic-login"));
11
11
  const lodash_1 = require("lodash");
12
12
  const setupConfig = async (exportCmdFlags) => {
13
+ // Set progress supported module FIRST, before any log calls
14
+ // This ensures the logger respects the showConsoleLogs setting correctly
15
+ cli_utilities_1.configHandler.set('log.progressSupportedModule', 'export');
13
16
  let config = (0, merge_1.default)({}, config_1.default);
14
17
  // Track authentication method
15
18
  let authenticationMethod = 'unknown';
16
19
  cli_utilities_1.log.debug('Setting up export configuration');
17
20
  // setup the config
18
21
  if (exportCmdFlags['config']) {
19
- cli_utilities_1.log.debug('Loading external configuration file', { configFile: exportCmdFlags['config'] });
22
+ cli_utilities_1.log.debug('Loading external configuration file...', { configFile: exportCmdFlags['config'] });
20
23
  const externalConfig = await (0, file_helper_1.readFile)(exportCmdFlags['config']);
21
24
  config = merge_1.default.recursive(config, externalConfig);
22
25
  }
23
- config.exportDir = (0, cli_utilities_1.sanitizePath)(exportCmdFlags['data'] || exportCmdFlags['data-dir'] || config.data || (await (0, interactive_1.askExportDir)()));
26
+ config.exportDir = (0, cli_utilities_1.sanitizePath)(exportCmdFlags['data'] || exportCmdFlags['data-dir'] || config.exportDir || (await (0, interactive_1.askExportDir)()));
24
27
  const pattern = /[*$%#<>{}!&?]/g;
25
28
  if (pattern.test(config.exportDir)) {
26
- cli_utilities_1.cliux.print(`\nPlease add a directory path without any of the special characters: (*,&,{,},[,],$,%,<,>,?,!)`, {
29
+ cli_utilities_1.cliux.print(`\nPlease enter a directory path without any special characters: (*,&,{,},[,],$,%,<,>,?,!)`, {
27
30
  color: 'yellow',
28
31
  });
29
32
  config.exportDir = (0, cli_utilities_1.sanitizePath)(await (0, interactive_1.askExportDir)());
30
33
  }
31
34
  config.exportDir = config.exportDir.replace(/['"]/g, '');
32
35
  config.exportDir = path.resolve(config.exportDir);
33
- //Note to support the old key
34
- config.data = config.exportDir;
35
36
  const managementTokenAlias = exportCmdFlags['management-token-alias'] || exportCmdFlags['alias'];
36
37
  if (managementTokenAlias) {
37
38
  cli_utilities_1.log.debug('Using management token alias', { alias: managementTokenAlias });
@@ -40,7 +41,7 @@ const setupConfig = async (exportCmdFlags) => {
40
41
  config.apiKey = apiKey;
41
42
  authenticationMethod = 'Management Token';
42
43
  if (!config.management_token) {
43
- cli_utilities_1.log.debug('Management token not found for alias', { alias: managementTokenAlias });
44
+ cli_utilities_1.log.debug('Management token not found for alias!', { alias: managementTokenAlias });
44
45
  throw new Error(`No management token found on given alias ${managementTokenAlias}`);
45
46
  }
46
47
  cli_utilities_1.log.debug('Management token configuration successful');
@@ -71,15 +72,13 @@ const setupConfig = async (exportCmdFlags) => {
71
72
  cli_utilities_1.log.debug('User authenticated via auth token');
72
73
  }
73
74
  config.apiKey =
74
- exportCmdFlags['stack-uid'] || exportCmdFlags['stack-api-key'] || config.source_stack || (await (0, interactive_1.askAPIKey)());
75
+ exportCmdFlags['stack-uid'] || exportCmdFlags['stack-api-key'] || config.apiKey || (await (0, interactive_1.askAPIKey)());
75
76
  if (typeof config.apiKey !== 'string') {
76
- cli_utilities_1.log.debug('Invalid API key received', { apiKey: config.apiKey });
77
+ cli_utilities_1.log.debug('Invalid API key received!', { apiKey: config.apiKey });
77
78
  throw new Error('Invalid API key received');
78
79
  }
79
80
  }
80
81
  }
81
- // Note support old config
82
- config.source_stack = config.apiKey;
83
82
  config.forceStopMarketplaceAppsPrompt = exportCmdFlags.yes;
84
83
  config.auth_token = cli_utilities_1.configHandler.get('authtoken'); // TBD handle auth token in httpClient & sdk
85
84
  config.isAuthenticated = (0, cli_utilities_1.isAuthenticated)();
@@ -119,11 +118,9 @@ const setupConfig = async (exportCmdFlags) => {
119
118
  throw new Error(`Invalid query format: ${error.message}`);
120
119
  }
121
120
  }
122
- // Set progress supported module to check and display console logs
123
- cli_utilities_1.configHandler.set('log.progressSupportedModule', 'export');
124
121
  // Add authentication details to config for context tracking
125
122
  config.authenticationMethod = authenticationMethod;
126
- cli_utilities_1.log.debug('Export configuration setup completed', Object.assign({}, config));
123
+ cli_utilities_1.log.debug('Export configuration setup completed.', Object.assign({}, config));
127
124
  return config;
128
125
  };
129
126
  exports.default = setupConfig;
@@ -51,7 +51,7 @@ const readLargeFile = function (filePath, options = {}) {
51
51
  resolve(data);
52
52
  });
53
53
  parseStream.on('error', (error) => {
54
- console.log('error', error);
54
+ console.log('Error', error);
55
55
  reject(error);
56
56
  });
57
57
  readStream.pipe(parseStream);
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * Contentstack Export
3
- * Copyright (c) 2024 Contentstack LLC
3
+ * Copyright (c) 2026 Contentstack LLC
4
4
  * MIT Licensed
5
5
  */
6
6
  import { ExportConfig } from '../types';
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  /*!
3
3
  * Contentstack Export
4
- * Copyright (c) 2024 Contentstack LLC
4
+ * Copyright (c) 2026 Contentstack LLC
5
5
  * MIT Licensed
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -126,7 +126,7 @@ function init(_logPath) {
126
126
  };
127
127
  }
128
128
  const log = async (config, message, type) => {
129
- const logsPath = (0, cli_utilities_1.sanitizePath)(config.cliLogsPath || config.data);
129
+ const logsPath = (0, cli_utilities_1.sanitizePath)(config.cliLogsPath || config.exportDir);
130
130
  // ignoring the type argument, as we are not using it to create a logfile anymore
131
131
  if (type !== 'error') {
132
132
  // removed type argument from init method
@@ -9,7 +9,7 @@ exports.getDeveloperHubUrl = getDeveloperHubUrl;
9
9
  async function getOrgUid(config) {
10
10
  const tempAPIClient = await (0, cli_utilities_1.managementSDKClient)({ host: config.host });
11
11
  const tempStackData = await tempAPIClient
12
- .stack({ api_key: config.source_stack })
12
+ .stack({ api_key: config.apiKey })
13
13
  .fetch()
14
14
  .catch((error) => {
15
15
  (0, cli_utilities_1.handleAndLogError)(error, Object.assign({}, config.context));
@@ -22,10 +22,8 @@ async function createNodeCryptoInstance(config) {
22
22
  if (config.forceStopMarketplaceAppsPrompt) {
23
23
  cryptoArgs['encryptionKey'] = config.marketplaceAppEncryptionKey;
24
24
  }
25
- else if (config.marketplaceAppEncryptionKey) {
26
- cryptoArgs['encryptionKey'] = config.marketplaceAppEncryptionKey;
27
- }
28
25
  else {
26
+ // Always prompt when forceStopMarketplaceAppsPrompt is false, using existing key as default
29
27
  cli_utilities_1.cliux.print('');
30
28
  cryptoArgs['encryptionKey'] = await askEncryptionKey(config);
31
29
  cli_utilities_1.cliux.print('');
@@ -1,71 +1,77 @@
1
1
  {
2
- "ASSET_EXPORT_COMPLETE": "Asset export process completed successfully",
3
- "ASSET_FOLDERS_EXPORT_COMPLETE": "Asset folder structure exported successfully with %s folder(s)",
4
- "ASSET_METADATA_EXPORT_COMPLETE": "Asset metadata exported successfully",
5
- "ASSET_VERSIONED_METADATA_EXPORT_COMPLETE": "Versioned asset metadata exported successfully",
6
- "ASSET_DOWNLOAD_COMPLETE": "Asset download completed successfully",
7
- "ASSET_DOWNLOAD_SUCCESS": "Asset '%s' (UID: %s) downloaded successfully",
8
- "ASSET_DOWNLOAD_FAILED": "Failed to download asset '%s' (UID: %s)",
9
- "ASSET_WRITE_FAILED": "Failed to write asset file '%s' (UID: %s)",
10
- "ASSET_QUERY_FAILED": "Failed to query asset data from the API",
11
- "ASSET_VERSIONED_QUERY_FAILED": "Failed to query versioned asset data from the API",
12
- "ASSET_COUNT_QUERY_FAILED": "Failed to retrieve total asset count",
13
-
14
- "CONTENT_TYPE_EXPORT_COMPLETE": "Content types exported successfully",
15
- "CONTENT_TYPE_NO_TYPES": "No content types found",
16
- "CONTENT_TYPE_EXPORT_FAILED": "Failed to export content types",
17
- "CONTENT_TYPE_NO_TYPES_RETURNED": "API returned no content types for the given query",
18
-
19
- "ENVIRONMENT_EXPORT_COMPLETE": "Successfully exported %s environment(s)",
20
- "ENVIRONMENT_EXPORT_SUCCESS": "Environment '%s' exported successfully",
21
- "ENVIRONMENT_NOT_FOUND": "No environments found in the current stack",
22
-
23
- "EXTENSION_EXPORT_COMPLETE": "Successfully exported %s extension(s)",
24
- "EXTENSION_EXPORT_SUCCESS": "Extension '%s' exported successfully",
25
- "EXTENSION_NOT_FOUND": "No extensions found in the current stack",
26
-
27
- "GLOBAL_FIELDS_EXPORT_COMPLETE": "Successfully exported %s global field(s)",
28
-
29
- "LABELS_EXPORT_COMPLETE": "Successfully exported %s label(s)",
30
- "LABEL_EXPORT_SUCCESS": "Label '%s' exported successfully",
31
- "LABELS_NOT_FOUND": "No labels found in the current stack",
32
-
33
- "LOCALES_EXPORT_COMPLETE": "Successfully exported %s locale(s) including %s master locale(s)",
34
-
35
- "TAXONOMY_EXPORT_COMPLETE": "Successfully exported %s taxonomy entries",
36
- "TAXONOMY_EXPORT_SUCCESS": "Taxonomy '%s' exported successfully",
37
- "TAXONOMY_NOT_FOUND": "No taxonomies found in the current stack",
38
-
39
- "WEBHOOK_EXPORT_COMPLETE": "Successfully exported %s webhook(s)",
40
- "WEBHOOK_EXPORT_SUCCESS": "Webhook '%s' exported successfully",
41
- "WEBHOOK_NOT_FOUND": "No webhooks found in the current stack",
42
-
43
- "WORKFLOW_EXPORT_COMPLETE": "Successfully exported %s workflow(s)",
44
- "WORKFLOW_EXPORT_SUCCESS": "Workflow '%s' exported successfully",
45
- "WORKFLOW_NOT_FOUND": "No workflows found in the current stack",
46
-
47
- "PERSONALIZE_URL_NOT_SET": "Cannot export Personalize project: URL not configured",
48
- "PERSONALIZE_SKIPPING_WITH_MANAGEMENT_TOKEN": "Skipping Personalize project export: Management token not supported",
49
- "PERSONALIZE_MODULE_NOT_IMPLEMENTED": "Module '%s' implementation not found",
50
- "PERSONALIZE_NOT_ENABLED": "Personalize feature is not enabled for this organization",
51
-
52
- "MARKETPLACE_APPS_EXPORT_COMPLETE": "Successfully exported %s marketplace app(s)",
53
- "MARKETPLACE_APP_CONFIG_EXPORT": "Exporting configuration for app '%s'",
54
- "MARKETPLACE_APP_CONFIG_SUCCESS": "Successfully exported configuration for app '%s'",
55
- "MARKETPLACE_APP_EXPORT_SUCCESS": "Successfully exported app '%s'",
56
- "MARKETPLACE_APPS_NOT_FOUND": "No marketplace apps found in the current stack",
57
- "MARKETPLACE_APP_CONFIG_EXPORT_FAILED": "Failed to export configuration for app '%s'",
58
- "MARKETPLACE_APP_MANIFEST_EXPORT_FAILED": "Failed to export manifest for app '%s'",
59
-
60
- "ENTRIES_EXPORT_COMPLETE": "Successfully exported entries (Content Type: %s, Locale: %s)",
61
- "ENTRIES_EXPORT_SUCCESS": "All entries exported successfully",
62
- "ENTRIES_VERSIONED_EXPORT_SUCCESS": "Successfully exported versioned entry (Content Type: %s, UID: %s, Locale: %s)",
63
- "ENTRIES_EXPORT_VERSIONS_FAILED": "Failed to export versions for content type '%s' (UID: %s)",
64
-
65
- "BRANCH_EXPORT_FAILED": "Failed to export contents from branch (UID: %s)",
66
-
67
- "ROLES_NO_CUSTOM_ROLES": "No custom roles found in the current stack",
68
- "ROLES_EXPORTING_ROLE": "Exporting role '%s'",
2
+ "ASSET_EXPORT_COMPLETE": "Asset export process completed successfully",
3
+ "ASSET_FOLDERS_EXPORT_COMPLETE": "Asset folder structure exported successfully with %s folder(s)",
4
+ "ASSET_METADATA_EXPORT_COMPLETE": "Asset metadata exported successfully",
5
+ "ASSET_VERSIONED_METADATA_EXPORT_COMPLETE": "Versioned asset metadata exported successfully",
6
+ "ASSET_DOWNLOAD_COMPLETE": "Asset download completed successfully",
7
+ "ASSET_DOWNLOAD_SUCCESS": "Asset '%s' (UID: %s) downloaded successfully",
8
+ "ASSET_DOWNLOAD_FAILED": "Failed to download asset '%s' (UID: %s)",
9
+ "ASSET_WRITE_FAILED": "Failed to write asset file '%s' (UID: %s)",
10
+ "ASSET_QUERY_FAILED": "Failed to query asset data from the API",
11
+ "ASSET_VERSIONED_QUERY_FAILED": "Failed to query versioned asset data from the API",
12
+ "ASSET_COUNT_QUERY_FAILED": "Failed to retrieve total asset count",
13
+
14
+ "CONTENT_TYPE_EXPORT_COMPLETE": "Content types exported successfully",
15
+ "CONTENT_TYPE_NO_TYPES": "No content types found",
16
+ "CONTENT_TYPE_EXPORT_FAILED": "Failed to export content types",
17
+ "CONTENT_TYPE_NO_TYPES_RETURNED": "API returned no content types for the given query",
18
+
19
+ "ENVIRONMENT_EXPORT_COMPLETE": "Successfully exported %s environment(s)",
20
+ "ENVIRONMENT_EXPORT_SUCCESS": "Environment '%s' exported successfully",
21
+ "ENVIRONMENT_NOT_FOUND": "No environments found in the current stack",
22
+
23
+ "EXTENSION_EXPORT_COMPLETE": "Successfully exported %s extension(s)",
24
+ "EXTENSION_EXPORT_SUCCESS": "Extension '%s' exported successfully",
25
+ "EXTENSION_NOT_FOUND": "No extensions found in the current stack",
26
+
27
+ "GLOBAL_FIELDS_EXPORT_COMPLETE": "Successfully exported %s global field(s)",
28
+
29
+ "LABELS_EXPORT_COMPLETE": "Successfully exported %s label(s)",
30
+ "LABEL_EXPORT_SUCCESS": "Label '%s' exported successfully",
31
+ "LABELS_NOT_FOUND": "No labels found in the current stack",
32
+
33
+ "LOCALES_EXPORT_COMPLETE": "Successfully exported %s locale(s) including %s master locale(s)",
34
+
35
+ "TAXONOMY_EXPORT_COMPLETE": "Successfully exported %s taxonomy entries",
36
+ "TAXONOMY_EXPORT_SUCCESS": "Taxonomy '%s' exported successfully",
37
+ "TAXONOMY_NOT_FOUND": "No taxonomies found in the current stack",
38
+
39
+ "WEBHOOK_EXPORT_COMPLETE": "Successfully exported %s webhook(s)",
40
+ "WEBHOOK_EXPORT_SUCCESS": "Webhook '%s' exported successfully",
41
+ "WEBHOOK_NOT_FOUND": "No webhooks found in the current stack",
42
+
43
+ "WORKFLOW_EXPORT_COMPLETE": "Successfully exported %s workflow(s)",
44
+ "WORKFLOW_EXPORT_SUCCESS": "Workflow '%s' exported successfully",
45
+ "WORKFLOW_NOT_FOUND": "No workflows found in the current stack",
46
+
47
+ "PERSONALIZE_URL_NOT_SET": "Cannot export Personalize project: URL not configured",
48
+ "PERSONALIZE_SKIPPING_WITH_MANAGEMENT_TOKEN": "Skipping Personalize project export: Management token not supported",
49
+ "PERSONALIZE_MODULE_NOT_IMPLEMENTED": "Module '%s' implementation not found",
50
+ "PERSONALIZE_NOT_ENABLED": "Personalize feature is not enabled for this organization",
51
+
52
+ "MARKETPLACE_APPS_EXPORT_COMPLETE": "Successfully exported %s marketplace app(s)",
53
+ "MARKETPLACE_APP_CONFIG_EXPORT": "Exporting configuration for app '%s'",
54
+ "MARKETPLACE_APP_CONFIG_SUCCESS": "Successfully exported configuration for app '%s'",
55
+ "MARKETPLACE_APP_EXPORT_SUCCESS": "Successfully exported app '%s'",
56
+ "MARKETPLACE_APPS_NOT_FOUND": "No marketplace apps found in the current stack",
57
+ "MARKETPLACE_APP_CONFIG_EXPORT_FAILED": "Failed to export configuration for app '%s'",
58
+ "MARKETPLACE_APP_MANIFEST_EXPORT_FAILED": "Failed to export manifest for app '%s'",
59
+
60
+ "COMPOSABLE_STUDIO_EXPORT_START": "Starting Studio project export...",
61
+ "COMPOSABLE_STUDIO_NOT_FOUND": "No Studio project found for this stack",
62
+ "COMPOSABLE_STUDIO_EXPORT_COMPLETE": "Successfully exported Studio project '%s'",
63
+ "COMPOSABLE_STUDIO_EXPORT_FAILED": "Failed to export Studio project: %s",
64
+ "COMPOSABLE_STUDIO_AUTH_REQUIRED": "To export Studio projects, you must be logged in",
65
+
66
+ "ENTRIES_EXPORT_COMPLETE": "Successfully exported entries (Content Type: %s, Locale: %s)",
67
+ "ENTRIES_EXPORT_SUCCESS": "All entries exported successfully",
68
+ "ENTRIES_VERSIONED_EXPORT_SUCCESS": "Successfully exported versioned entry (Content Type: %s, UID: %s, Locale: %s)",
69
+ "ENTRIES_EXPORT_VERSIONS_FAILED": "Failed to export versions for content type '%s' (UID: %s)",
70
+
71
+ "BRANCH_EXPORT_FAILED": "Failed to export contents from branch (UID: %s)",
72
+
73
+ "ROLES_NO_CUSTOM_ROLES": "No custom roles found in the current stack",
74
+ "ROLES_EXPORTING_ROLE": "Exporting role '%s'",
69
75
 
70
76
  "GLOBAL_FIELDS_NOT_FOUND": "No global fields found in the current stack"
71
77
  }
@@ -1,9 +1,7 @@
1
1
  {
2
2
  "commands": {
3
3
  "cm:stacks:export": {
4
- "aliases": [
5
- "cm:export"
6
- ],
4
+ "aliases": [],
7
5
  "args": {},
8
6
  "description": "Export content from a stack",
9
7
  "examples": [
@@ -24,15 +22,6 @@
24
22
  "multiple": false,
25
23
  "type": "option"
26
24
  },
27
- "stack-uid": {
28
- "char": "s",
29
- "description": "API key of the source stack",
30
- "hidden": true,
31
- "name": "stack-uid",
32
- "hasDynamicHelp": false,
33
- "multiple": false,
34
- "type": "option"
35
- },
36
25
  "stack-api-key": {
37
26
  "char": "k",
38
27
  "description": "API Key of the source stack",
@@ -41,14 +30,6 @@
41
30
  "multiple": false,
42
31
  "type": "option"
43
32
  },
44
- "data": {
45
- "description": "path or location to store the data",
46
- "hidden": true,
47
- "name": "data",
48
- "hasDynamicHelp": false,
49
- "multiple": false,
50
- "type": "option"
51
- },
52
33
  "data-dir": {
53
34
  "char": "d",
54
35
  "description": "The path or the location in your file system to store the exported content. For e.g., ./content",
@@ -65,32 +46,14 @@
65
46
  "multiple": false,
66
47
  "type": "option"
67
48
  },
68
- "management-token-alias": {
69
- "description": "alias of the management token",
70
- "hidden": true,
71
- "name": "management-token-alias",
72
- "hasDynamicHelp": false,
73
- "multiple": false,
74
- "type": "option"
75
- },
76
- "auth-token": {
77
- "char": "A",
78
- "description": "to use auth token",
79
- "hidden": true,
80
- "name": "auth-token",
81
- "allowNo": false,
82
- "type": "boolean"
83
- },
84
49
  "module": {
85
- "char": "m",
86
- "description": "[optional] Specific module name. If not specified, the export command will export all the modules to the stack. The available modules are assets, content-types, entries, environments, extensions, marketplace-apps, global-fields, labels, locales, webhooks, workflows, custom-roles, and taxonomies.",
50
+ "description": "[optional] Specific module name. If not specified, the export command will export all the modules to the stack. The available modules are assets, content-types, entries, environments, extensions, marketplace-apps, global-fields, labels, locales, webhooks, workflows, custom-roles, taxonomies, and studio.",
87
51
  "name": "module",
88
52
  "hasDynamicHelp": false,
89
53
  "multiple": false,
90
54
  "type": "option"
91
55
  },
92
56
  "content-types": {
93
- "char": "t",
94
57
  "description": "[optional] The UID of the content type(s) whose content you want to export. In case of multiple content types, specify the IDs separated by spaces.",
95
58
  "name": "content-types",
96
59
  "hasDynamicHelp": false,
@@ -98,7 +61,6 @@
98
61
  "type": "option"
99
62
  },
100
63
  "branch": {
101
- "char": "B",
102
64
  "description": "[optional] The name of the branch where you want to export your content. If you don't mention the branch name, then by default the content will be exported from all the branches of your stack.",
103
65
  "exclusive": [
104
66
  "branch-alias"
@@ -148,7 +110,7 @@
148
110
  "pluginName": "@contentstack/cli-cm-export",
149
111
  "pluginType": "core",
150
112
  "strict": true,
151
- "usage": "cm:stacks:export [-c <value>] [-k <value>] [-d <value>] [-a <value>] [--module <value>] [--content-types <value>] [--branch <value>] [--secured-assets]",
113
+ "usage": "cm:stacks:export [--config <value>] [--stack-api-key <value>] [--data-dir <value>] [--alias <value>] [--module <value>] [--content-types <value>] [--branch <value>] [--secured-assets]",
152
114
  "isESM": false,
153
115
  "relativePath": [
154
116
  "lib",
@@ -159,5 +121,5 @@
159
121
  ]
160
122
  }
161
123
  },
162
- "version": "2.0.0-beta.1"
124
+ "version": "2.0.0-beta.10"
163
125
  }
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@contentstack/cli-cm-export",
3
3
  "description": "Contentstack CLI plugin to export content from stack",
4
- "version": "2.0.0-beta.1",
4
+ "version": "2.0.0-beta.10",
5
5
  "author": "Contentstack",
6
6
  "bugs": "https://github.com/contentstack/cli/issues",
7
7
  "dependencies": {
8
- "@contentstack/cli-command": "~1.6.1",
9
- "@contentstack/cli-variants": "~2.0.0-beta",
10
- "@oclif/core": "^4.3.3",
11
- "@contentstack/cli-utilities": "~1.15.0",
8
+ "@contentstack/cli-command": "~2.0.0-beta",
9
+ "@contentstack/cli-utilities": "~2.0.0-beta.1",
10
+ "@contentstack/cli-variants": "~2.0.0-beta.7",
11
+ "@oclif/core": "^4.8.0",
12
12
  "async": "^3.2.6",
13
13
  "big-json": "^3.2.0",
14
14
  "bluebird": "^3.7.2",
15
15
  "chalk": "^4.1.2",
16
- "lodash": "^4.17.21",
16
+ "lodash": "^4.17.23",
17
17
  "merge": "^2.1.1",
18
18
  "mkdirp": "^1.0.4",
19
19
  "progress-stream": "^2.0.0",
@@ -21,14 +21,18 @@
21
21
  "winston": "^3.17.0"
22
22
  },
23
23
  "devDependencies": {
24
- "@contentstack/cli-auth": "~1.6.1",
25
- "@contentstack/cli-config": "~1.15.1",
24
+ "@contentstack/cli-auth": "~2.0.0-beta.6",
25
+ "@contentstack/cli-config": "~2.0.0-beta.2",
26
26
  "@contentstack/cli-dev-dependencies": "~1.3.1",
27
27
  "@oclif/plugin-help": "^6.2.28",
28
28
  "@oclif/test": "^4.1.13",
29
29
  "@types/big-json": "^3.2.5",
30
+ "@types/chai": "^4.3.11",
30
31
  "@types/mkdirp": "^1.0.2",
32
+ "@types/mocha": "^10.0.6",
31
33
  "@types/progress-stream": "^2.0.5",
34
+ "@types/sinon": "^17.0.2",
35
+ "chai": "^4.4.1",
32
36
  "dotenv": "^16.5.0",
33
37
  "dotenv-expand": "^9.0.0",
34
38
  "eslint": "^8.57.1",
@@ -36,6 +40,8 @@
36
40
  "mocha": "10.8.2",
37
41
  "nyc": "^15.1.0",
38
42
  "oclif": "^4.17.46",
43
+ "sinon": "^17.0.1",
44
+ "source-map-support": "^0.5.21",
39
45
  "ts-node": "^10.9.2",
40
46
  "typescript": "^4.9.5"
41
47
  },
@@ -54,7 +60,8 @@
54
60
  "format": "eslint src/**/*.ts --fix",
55
61
  "test:integration": "INTEGRATION_TEST=true mocha --config ./test/.mocharc.js --forbid-only \"test/run.test.js\"",
56
62
  "test:integration:report": "INTEGRATION_TEST=true nyc --extension .js mocha --forbid-only \"test/run.test.js\"",
57
- "test:unit": "mocha --forbid-only \"test/unit/*.test.ts\""
63
+ "test:unit": "mocha --forbid-only \"test/unit/**/*.test.ts\"",
64
+ "test:unit:report": "nyc --reporter=text --extension .ts mocha --forbid-only \"test/unit/**/*.test.ts\""
58
65
  },
59
66
  "engines": {
60
67
  "node": ">=14.0.0"
@@ -82,13 +89,9 @@
82
89
  "repositoryPrefix": "<%- repo %>/blob/main/packages/contentstack-export/<%- commandPath %>"
83
90
  },
84
91
  "csdxConfig": {
85
- "expiredCommands": {
86
- "cm:export": "csdx cm:stacks:export"
87
- },
88
92
  "shortCommandName": {
89
- "cm:stacks:export": "EXPRT",
90
- "cm:export": "O-EXPRT"
93
+ "cm:stacks:export": "EXPRT"
91
94
  }
92
95
  },
93
96
  "repository": "https://github.com/contentstack/cli"
94
- }
97
+ }