@contentstack/cli-cm-export 2.0.0-beta.3 → 2.0.0-beta.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
@@ -48,7 +48,7 @@ $ npm install -g @contentstack/cli-cm-export
48
48
  $ csdx COMMAND
49
49
  running command...
50
50
  $ csdx (--version)
51
- @contentstack/cli-cm-export/2.0.0-beta.3 linux-x64 node-v22.21.1
51
+ @contentstack/cli-cm-export/2.0.0-beta.4 linux-x64 node-v22.21.1
52
52
  $ csdx --help [COMMAND]
53
53
  USAGE
54
54
  $ csdx COMMAND
@@ -59,93 +59,39 @@ USAGE
59
59
  # Commands
60
60
 
61
61
  <!-- commands -->
62
- * [`csdx cm:stacks:export [-c <value>] [-k <value>] [-d <value>] [-a <value>] [--module <value>] [--content-types <value>] [--branch <value>] [--secured-assets]`](#csdx-cmstacksexport--c-value--k-value--d-value--a-value---module-value---content-types-value---branch-value---secured-assets)
63
- * [`csdx cm:stacks:export [-c <value>] [-k <value>] [-d <value>] [-a <value>] [--module <value>] [--content-types <value>] [--branch <value>] [--secured-assets]`](#csdx-cmstacksexport--c-value--k-value--d-value--a-value---module-value---content-types-value---branch-value---secured-assets)
62
+ * [`csdx cm:stacks:export [--config <value>] [--stack-api-key <value>] [--data-dir <value>] [--alias <value>] [--module <value>] [--content-types <value>] [--branch <value>] [--secured-assets]`](#csdx-cmstacksexport---config-value---stack-api-key-value---data-dir-value---alias-value---module-value---content-types-value---branch-value---secured-assets)
64
63
 
65
- ## `csdx cm:stacks:export [-c <value>] [-k <value>] [-d <value>] [-a <value>] [--module <value>] [--content-types <value>] [--branch <value>] [--secured-assets]`
64
+ ## `csdx cm:stacks:export [--config <value>] [--stack-api-key <value>] [--data-dir <value>] [--alias <value>] [--module <value>] [--content-types <value>] [--branch <value>] [--secured-assets]`
66
65
 
67
66
  Export content from a stack
68
67
 
69
68
  ```
70
69
  USAGE
71
- $ csdx cm:export cm:stacks:export [-c <value>] [-k <value>] [-d <value>] [-a <value>] [--module <value>]
72
- [--content-types <value>] [--branch <value>] [--secured-assets]
70
+ $ csdx cm:stacks:export [--config <value>] [--stack-api-key <value>] [--data-dir <value>] [--alias <value>]
71
+ [--module <value>] [--content-types <value>] [--branch <value>] [--secured-assets]
73
72
 
74
73
  FLAGS
75
- -B, --branch=<value> [optional] The name of the branch where you want to export your content. If you don't
76
- mention the branch name, then by default the content will be exported from all the
77
- branches of your stack.
78
74
  -a, --alias=<value> The management token alias of the source stack from which you will export content.
79
75
  -c, --config=<value> [optional] Path of the config
80
76
  -d, --data-dir=<value> The path or the location in your file system to store the exported content. For e.g.,
81
77
  ./content
82
78
  -k, --stack-api-key=<value> API Key of the source stack
83
- -m, --module=<value> [optional] Specific module name. If not specified, the export command will export all
84
- the modules to the stack. The available modules are assets, content-types, entries,
85
- environments, extensions, marketplace-apps, global-fields, labels, locales, webhooks,
86
- workflows, custom-roles, taxonomies, and studio.
87
- -t, --content-types=<value>... [optional] The UID of the content type(s) whose content you want to export. In case
88
- of multiple content types, specify the IDs separated by spaces.
89
79
  -y, --yes [optional] Force override all Marketplace prompts.
90
- --branch-alias=<value> (Optional) The alias of the branch from which you want to export content.
91
- --secured-assets [optional] Use this flag for assets that are secured.
92
-
93
- DESCRIPTION
94
- Export content from a stack
95
-
96
- ALIASES
97
- $ csdx cm:export
98
-
99
- EXAMPLES
100
- $ csdx cm:stacks:export --stack-api-key <stack_api_key> --data-dir <path/of/export/destination/dir>
101
-
102
- $ csdx cm:stacks:export --config <path/to/config/dir>
103
-
104
- $ csdx cm:stacks:export --alias <management_token_alias>
105
-
106
- $ csdx cm:stacks:export --alias <management_token_alias> --data-dir <path/to/export/destination/dir>
107
-
108
- $ csdx cm:stacks:export --alias <management_token_alias> --config <path/to/config/file>
109
-
110
- $ csdx cm:stacks:export --module <single module name>
111
-
112
- $ csdx cm:stacks:export --branch [optional] branch name
113
- ```
114
-
115
- ## `csdx cm:stacks:export [-c <value>] [-k <value>] [-d <value>] [-a <value>] [--module <value>] [--content-types <value>] [--branch <value>] [--secured-assets]`
116
-
117
- Export content from a stack
118
-
119
- ```
120
- USAGE
121
- $ csdx cm:stacks:export [-c <value>] [-k <value>] [-d <value>] [-a <value>] [--module <value>] [--content-types
122
- <value>] [--branch <value>] [--secured-assets]
123
-
124
- FLAGS
125
- -B, --branch=<value> [optional] The name of the branch where you want to export your content. If you don't
80
+ --branch=<value> [optional] The name of the branch where you want to export your content. If you don't
126
81
  mention the branch name, then by default the content will be exported from all the
127
82
  branches of your stack.
128
- -a, --alias=<value> The management token alias of the source stack from which you will export content.
129
- -c, --config=<value> [optional] Path of the config
130
- -d, --data-dir=<value> The path or the location in your file system to store the exported content. For e.g.,
131
- ./content
132
- -k, --stack-api-key=<value> API Key of the source stack
133
- -m, --module=<value> [optional] Specific module name. If not specified, the export command will export all
83
+ --branch-alias=<value> (Optional) The alias of the branch from which you want to export content.
84
+ --content-types=<value>... [optional] The UID of the content type(s) whose content you want to export. In case
85
+ of multiple content types, specify the IDs separated by spaces.
86
+ --module=<value> [optional] Specific module name. If not specified, the export command will export all
134
87
  the modules to the stack. The available modules are assets, content-types, entries,
135
88
  environments, extensions, marketplace-apps, global-fields, labels, locales, webhooks,
136
89
  workflows, custom-roles, taxonomies, and studio.
137
- -t, --content-types=<value>... [optional] The UID of the content type(s) whose content you want to export. In case
138
- of multiple content types, specify the IDs separated by spaces.
139
- -y, --yes [optional] Force override all Marketplace prompts.
140
- --branch-alias=<value> (Optional) The alias of the branch from which you want to export content.
141
90
  --secured-assets [optional] Use this flag for assets that are secured.
142
91
 
143
92
  DESCRIPTION
144
93
  Export content from a stack
145
94
 
146
- ALIASES
147
- $ csdx cm:export
148
-
149
95
  EXAMPLES
150
96
  $ csdx cm:stacks:export --stack-api-key <stack_api_key> --data-dir <path/of/export/destination/dir>
151
97
 
@@ -5,7 +5,6 @@ export default class ExportCommand extends Command {
5
5
  static examples: string[];
6
6
  static usage: string;
7
7
  static flags: FlagInput;
8
- static aliases: string[];
9
8
  run(): Promise<void>;
10
9
  private createExportContext;
11
10
  private assignExportConfig;
@@ -14,7 +14,6 @@ class ExportCommand extends cli_command_1.Command {
14
14
  // Prepare the context object
15
15
  const context = this.createExportContext(exportConfig.apiKey, exportConfig.authenticationMethod);
16
16
  exportConfig.context = Object.assign({}, context);
17
- //log.info(`Using Cli Version: ${this.context?.cliVersion}`, exportConfig.context);
18
17
  // Assign exportConfig variables
19
18
  this.assignExportConfig(exportConfig);
20
19
  exportDir = (0, cli_utilities_1.sanitizePath)(exportConfig.cliLogsPath || exportConfig.data || exportConfig.exportDir);
@@ -83,27 +82,16 @@ ExportCommand.examples = [
83
82
  'csdx cm:stacks:export --module <single module name>',
84
83
  'csdx cm:stacks:export --branch [optional] branch name',
85
84
  ];
86
- ExportCommand.usage = 'cm:stacks:export [-c <value>] [-k <value>] [-d <value>] [-a <value>] [--module <value>] [--content-types <value>] [--branch <value>] [--secured-assets]';
85
+ ExportCommand.usage = 'cm:stacks:export [--config <value>] [--stack-api-key <value>] [--data-dir <value>] [--alias <value>] [--module <value>] [--content-types <value>] [--branch <value>] [--secured-assets]';
87
86
  ExportCommand.flags = {
88
87
  config: cli_utilities_1.flags.string({
89
88
  char: 'c',
90
89
  description: '[optional] Path of the config',
91
90
  }),
92
- 'stack-uid': cli_utilities_1.flags.string({
93
- char: 's',
94
- description: 'API key of the source stack',
95
- hidden: true,
96
- parse: (0, cli_utilities_1.printFlagDeprecation)(['-s', '--stack-uid'], ['-k', '--stack-api-key']),
97
- }),
98
91
  'stack-api-key': cli_utilities_1.flags.string({
99
92
  char: 'k',
100
93
  description: 'API Key of the source stack',
101
94
  }),
102
- data: cli_utilities_1.flags.string({
103
- description: 'path or location to store the data',
104
- hidden: true,
105
- parse: (0, cli_utilities_1.printFlagDeprecation)(['--data'], ['--data-dir']),
106
- }),
107
95
  'data-dir': cli_utilities_1.flags.string({
108
96
  char: 'd',
109
97
  description: 'The path or the location in your file system to store the exported content. For e.g., ./content',
@@ -112,33 +100,16 @@ ExportCommand.flags = {
112
100
  char: 'a',
113
101
  description: 'The management token alias of the source stack from which you will export content.',
114
102
  }),
115
- 'management-token-alias': cli_utilities_1.flags.string({
116
- description: 'alias of the management token',
117
- hidden: true,
118
- parse: (0, cli_utilities_1.printFlagDeprecation)(['--management-token-alias'], ['-a', '--alias']),
119
- }),
120
- 'auth-token': cli_utilities_1.flags.boolean({
121
- char: 'A',
122
- description: 'to use auth token',
123
- hidden: true,
124
- parse: (0, cli_utilities_1.printFlagDeprecation)(['-A', '--auth-token']),
125
- }),
126
103
  module: cli_utilities_1.flags.string({
127
- char: 'm',
128
104
  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.',
129
- parse: (0, cli_utilities_1.printFlagDeprecation)(['-m'], ['--module']),
130
105
  }),
131
106
  'content-types': cli_utilities_1.flags.string({
132
- char: 't',
133
107
  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.',
134
108
  multiple: true,
135
- parse: (0, cli_utilities_1.printFlagDeprecation)(['-t'], ['--content-types']),
136
109
  }),
137
110
  branch: cli_utilities_1.flags.string({
138
- char: 'B',
139
111
  // default: 'main',
140
112
  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.",
141
- parse: (0, cli_utilities_1.printFlagDeprecation)(['-B'], ['--branch']),
142
113
  exclusive: ['branch-alias'],
143
114
  }),
144
115
  'branch-alias': cli_utilities_1.flags.string({
@@ -158,4 +129,3 @@ ExportCommand.flags = {
158
129
  hidden: true,
159
130
  }),
160
131
  };
161
- ExportCommand.aliases = ['cm:export'];
@@ -10,6 +10,9 @@ 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';
@@ -119,8 +122,6 @@ const setupConfig = async (exportCmdFlags) => {
119
122
  throw new Error(`Invalid query format: ${error.message}`);
120
123
  }
121
124
  }
122
- // Set progress supported module to check and display console logs
123
- cli_utilities_1.configHandler.set('log.progressSupportedModule', 'export');
124
125
  // Add authentication details to config for context tracking
125
126
  config.authenticationMethod = authenticationMethod;
126
127
  cli_utilities_1.log.debug('Export configuration setup completed.', Object.assign({}, config));
@@ -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,24 +46,7 @@
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
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,
@@ -90,7 +54,6 @@
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.3"
124
+ "version": "2.0.0-beta.4"
163
125
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
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.3",
4
+ "version": "2.0.0-beta.4",
5
5
  "author": "Contentstack",
6
6
  "bugs": "https://github.com/contentstack/cli/issues",
7
7
  "dependencies": {
@@ -89,12 +89,8 @@
89
89
  "repositoryPrefix": "<%- repo %>/blob/main/packages/contentstack-export/<%- commandPath %>"
90
90
  },
91
91
  "csdxConfig": {
92
- "expiredCommands": {
93
- "cm:export": "csdx cm:stacks:export"
94
- },
95
92
  "shortCommandName": {
96
- "cm:stacks:export": "EXPRT",
97
- "cm:export": "O-EXPRT"
93
+ "cm:stacks:export": "EXPRT"
98
94
  }
99
95
  },
100
96
  "repository": "https://github.com/contentstack/cli"