@contentstack/cli-cm-export 1.14.2 → 1.15.2
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/1.
|
|
51
|
+
@contentstack/cli-cm-export/1.15.2 linux-x64 node-v22.14.0
|
|
52
52
|
$ csdx --help [COMMAND]
|
|
53
53
|
USAGE
|
|
54
54
|
$ csdx COMMAND
|
|
@@ -19,7 +19,7 @@ class ExportCommand extends cli_command_1.Command {
|
|
|
19
19
|
exportConfig.developerHubBaseUrl = this.developerHubUrl;
|
|
20
20
|
if (this.personalizeUrl)
|
|
21
21
|
exportConfig.modules.personalize.baseURL[exportConfig.region.name] = this.personalizeUrl;
|
|
22
|
-
exportDir = exportConfig.cliLogsPath || exportConfig.data || exportConfig.exportDir;
|
|
22
|
+
exportDir = (0, cli_utilities_1.sanitizePath)(exportConfig.cliLogsPath || exportConfig.data || exportConfig.exportDir);
|
|
23
23
|
const managementAPIClient = await (0, cli_utilities_1.managementSDKClient)(exportConfig);
|
|
24
24
|
const moduleExporter = new export_1.ModuleExporter(managementAPIClient, exportConfig);
|
|
25
25
|
await moduleExporter.start();
|
package/lib/config/index.js
CHANGED
|
@@ -11,6 +11,7 @@ const config = {
|
|
|
11
11
|
'https://azure-na-api.contentstack.com': 'https://azure-na-developerhub-api.contentstack.com',
|
|
12
12
|
'https://azure-eu-api.contentstack.com': 'https://azure-eu-developerhub-api.contentstack.com',
|
|
13
13
|
'https://gcp-na-api.contentstack.com': 'https://gcp-na-developerhub-api.contentstack.com',
|
|
14
|
+
'https://gcp-eu-api.contentstack.com': 'https://gcp-eu-developerhub-api.contentstack.com',
|
|
14
15
|
},
|
|
15
16
|
// use below hosts for eu region
|
|
16
17
|
// host:'https://eu-api.contentstack.com/v3',
|
|
@@ -20,6 +21,8 @@ const config = {
|
|
|
20
21
|
// host:'https://azure-eu-api.contentstack.com/v3',
|
|
21
22
|
// use below hosts for gcp-na region
|
|
22
23
|
// host: 'https://gcp-na-api.contentstack.com'
|
|
24
|
+
// use below hosts for gcp-eu region
|
|
25
|
+
// host: 'https://gcp-eu-api.contentstack.com'
|
|
23
26
|
modules: {
|
|
24
27
|
types: [
|
|
25
28
|
'stack',
|
|
@@ -16,13 +16,13 @@ const setupConfig = async (exportCmdFlags) => {
|
|
|
16
16
|
const externalConfig = await (0, file_helper_1.readFile)(exportCmdFlags['config']);
|
|
17
17
|
config = merge_1.default.recursive(config, externalConfig);
|
|
18
18
|
}
|
|
19
|
-
config.exportDir = exportCmdFlags['data'] || exportCmdFlags['data-dir'] || config.data || (await (0, interactive_1.askExportDir)());
|
|
19
|
+
config.exportDir = (0, cli_utilities_1.sanitizePath)(exportCmdFlags['data'] || exportCmdFlags['data-dir'] || config.data || (await (0, interactive_1.askExportDir)()));
|
|
20
20
|
const pattern = /[*$%#<>{}!&?]/g;
|
|
21
21
|
if (pattern.test(config.exportDir)) {
|
|
22
22
|
cli_utilities_1.cliux.print(`\nPlease add a directory path without any of the special characters: (*,&,{,},[,],$,%,<,>,?,!)`, {
|
|
23
23
|
color: 'yellow',
|
|
24
24
|
});
|
|
25
|
-
config.exportDir = await (0, interactive_1.askExportDir)();
|
|
25
|
+
config.exportDir = (0, cli_utilities_1.sanitizePath)(await (0, interactive_1.askExportDir)());
|
|
26
26
|
}
|
|
27
27
|
config.exportDir = config.exportDir.replace(/['"]/g, '');
|
|
28
28
|
config.exportDir = path.resolve(config.exportDir);
|
package/lib/utils/logger.js
CHANGED
|
@@ -23,7 +23,10 @@ function returnString(args) {
|
|
|
23
23
|
.map(function (item) {
|
|
24
24
|
if (item && typeof item === 'object') {
|
|
25
25
|
try {
|
|
26
|
-
|
|
26
|
+
const redactedObject = (0, cli_utilities_1.redactObject)(item);
|
|
27
|
+
if (redactedObject && typeof redactedObject === 'object') {
|
|
28
|
+
return JSON.stringify(redactedObject);
|
|
29
|
+
}
|
|
27
30
|
}
|
|
28
31
|
catch (error) { }
|
|
29
32
|
return item;
|
|
@@ -123,7 +126,7 @@ function init(_logPath) {
|
|
|
123
126
|
};
|
|
124
127
|
}
|
|
125
128
|
const log = async (config, message, type) => {
|
|
126
|
-
const logsPath = config.cliLogsPath || config.data;
|
|
129
|
+
const logsPath = (0, cli_utilities_1.sanitizePath)(config.cliLogsPath || config.data);
|
|
127
130
|
// ignoring the type argument, as we are not using it to create a logfile anymore
|
|
128
131
|
if (type !== 'error') {
|
|
129
132
|
// removed type argument from init method
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentstack/cli-cm-export",
|
|
3
3
|
"description": "Contentstack CLI plugin to export content from stack",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.15.2",
|
|
5
5
|
"author": "Contentstack",
|
|
6
6
|
"bugs": "https://github.com/contentstack/cli/issues",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@contentstack/cli-command": "~1.3.3",
|
|
9
|
-
"@contentstack/cli-variants": "~1.1.
|
|
10
|
-
"@contentstack/cli-utilities": "~1.
|
|
9
|
+
"@contentstack/cli-variants": "~1.1.6",
|
|
10
|
+
"@contentstack/cli-utilities": "~1.9.0",
|
|
11
11
|
"@oclif/core": "^3.27.0",
|
|
12
12
|
"async": "^3.2.6",
|
|
13
13
|
"big-json": "^3.2.0",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"winston": "^3.17.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@contentstack/cli-auth": "~1.3.
|
|
25
|
-
"@contentstack/cli-config": "~1.
|
|
24
|
+
"@contentstack/cli-auth": "~1.3.25",
|
|
25
|
+
"@contentstack/cli-config": "~1.10.1",
|
|
26
26
|
"@contentstack/cli-dev-dependencies": "~1.2.4",
|
|
27
27
|
"@oclif/plugin-help": "^5.2.20",
|
|
28
28
|
"@oclif/test": "^4.1.6",
|