@contentstack/cli-cm-export 1.20.2 → 1.22.0
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 +3 -3
- package/lib/commands/cm/stacks/export.js +7 -4
- package/lib/config/index.js +7 -0
- package/lib/export/module-exporter.js +4 -3
- package/lib/export/modules/base-class.js +1 -1
- package/lib/export/modules/composable-studio.d.ts +15 -0
- package/lib/export/modules/composable-studio.js +87 -0
- package/lib/export/modules/content-types.js +3 -3
- package/lib/export/modules/custom-roles.js +18 -20
- package/lib/export/modules/entries.js +7 -7
- package/lib/export/modules/environments.js +13 -13
- package/lib/export/modules/extensions.js +16 -16
- package/lib/export/modules/global-fields.js +16 -16
- package/lib/export/modules/labels.js +17 -17
- package/lib/export/modules/locales.js +17 -17
- package/lib/export/modules/marketplace-apps.js +32 -32
- package/lib/export/modules/personalize.js +14 -14
- package/lib/export/modules/stack.js +26 -26
- package/lib/export/modules/taxonomies.d.ts +28 -9
- package/lib/export/modules/taxonomies.js +191 -68
- package/lib/export/modules-js/assets.js +3 -3
- package/lib/types/default-config.d.ts +6 -0
- package/lib/types/index.d.ts +27 -1
- package/lib/utils/basic-login.js +1 -1
- package/lib/utils/export-config-handler.js +5 -5
- package/lib/utils/file-helper.js +1 -1
- package/messages/index.json +6 -0
- package/oclif.manifest.json +2 -2
- package/package.json +14 -7
|
@@ -16,14 +16,14 @@ const setupConfig = async (exportCmdFlags) => {
|
|
|
16
16
|
cli_utilities_1.log.debug('Setting up export configuration');
|
|
17
17
|
// setup the config
|
|
18
18
|
if (exportCmdFlags['config']) {
|
|
19
|
-
cli_utilities_1.log.debug('Loading external configuration file', { configFile: exportCmdFlags['config'] });
|
|
19
|
+
cli_utilities_1.log.debug('Loading external configuration file...', { configFile: exportCmdFlags['config'] });
|
|
20
20
|
const externalConfig = await (0, file_helper_1.readFile)(exportCmdFlags['config']);
|
|
21
21
|
config = merge_1.default.recursive(config, externalConfig);
|
|
22
22
|
}
|
|
23
23
|
config.exportDir = (0, cli_utilities_1.sanitizePath)(exportCmdFlags['data'] || exportCmdFlags['data-dir'] || config.data || (await (0, interactive_1.askExportDir)()));
|
|
24
24
|
const pattern = /[*$%#<>{}!&?]/g;
|
|
25
25
|
if (pattern.test(config.exportDir)) {
|
|
26
|
-
cli_utilities_1.cliux.print(`\nPlease
|
|
26
|
+
cli_utilities_1.cliux.print(`\nPlease enter a directory path without any special characters: (*,&,{,},[,],$,%,<,>,?,!)`, {
|
|
27
27
|
color: 'yellow',
|
|
28
28
|
});
|
|
29
29
|
config.exportDir = (0, cli_utilities_1.sanitizePath)(await (0, interactive_1.askExportDir)());
|
|
@@ -40,7 +40,7 @@ const setupConfig = async (exportCmdFlags) => {
|
|
|
40
40
|
config.apiKey = apiKey;
|
|
41
41
|
authenticationMethod = 'Management Token';
|
|
42
42
|
if (!config.management_token) {
|
|
43
|
-
cli_utilities_1.log.debug('Management token not found for alias', { alias: managementTokenAlias });
|
|
43
|
+
cli_utilities_1.log.debug('Management token not found for alias!', { alias: managementTokenAlias });
|
|
44
44
|
throw new Error(`No management token found on given alias ${managementTokenAlias}`);
|
|
45
45
|
}
|
|
46
46
|
cli_utilities_1.log.debug('Management token configuration successful');
|
|
@@ -73,7 +73,7 @@ const setupConfig = async (exportCmdFlags) => {
|
|
|
73
73
|
config.apiKey =
|
|
74
74
|
exportCmdFlags['stack-uid'] || exportCmdFlags['stack-api-key'] || config.source_stack || (await (0, interactive_1.askAPIKey)());
|
|
75
75
|
if (typeof config.apiKey !== 'string') {
|
|
76
|
-
cli_utilities_1.log.debug('Invalid API key received', { apiKey: config.apiKey });
|
|
76
|
+
cli_utilities_1.log.debug('Invalid API key received!', { apiKey: config.apiKey });
|
|
77
77
|
throw new Error('Invalid API key received');
|
|
78
78
|
}
|
|
79
79
|
}
|
|
@@ -121,7 +121,7 @@ const setupConfig = async (exportCmdFlags) => {
|
|
|
121
121
|
}
|
|
122
122
|
// Add authentication details to config for context tracking
|
|
123
123
|
config.authenticationMethod = authenticationMethod;
|
|
124
|
-
cli_utilities_1.log.debug('Export configuration setup completed', Object.assign({}, config));
|
|
124
|
+
cli_utilities_1.log.debug('Export configuration setup completed.', Object.assign({}, config));
|
|
125
125
|
return config;
|
|
126
126
|
};
|
|
127
127
|
exports.default = setupConfig;
|
package/lib/utils/file-helper.js
CHANGED
package/messages/index.json
CHANGED
|
@@ -57,6 +57,12 @@
|
|
|
57
57
|
"MARKETPLACE_APP_CONFIG_EXPORT_FAILED": "Failed to export configuration for app '%s'",
|
|
58
58
|
"MARKETPLACE_APP_MANIFEST_EXPORT_FAILED": "Failed to export manifest for app '%s'",
|
|
59
59
|
|
|
60
|
+
"COMPOSABLE_STUDIO_EXPORT_START": "Starting Composable Studio project export...",
|
|
61
|
+
"COMPOSABLE_STUDIO_NOT_FOUND": "No Composable Studio project found for this stack",
|
|
62
|
+
"COMPOSABLE_STUDIO_EXPORT_COMPLETE": "Successfully exported Composable Studio project '%s'",
|
|
63
|
+
"COMPOSABLE_STUDIO_EXPORT_FAILED": "Failed to export Composable Studio project: %s",
|
|
64
|
+
"COMPOSABLE_STUDIO_AUTH_REQUIRED": "To export Composable Studio projects, you must be logged in",
|
|
65
|
+
|
|
60
66
|
"ENTRIES_EXPORT_COMPLETE": "Successfully exported entries (Content Type: %s, Locale: %s)",
|
|
61
67
|
"ENTRIES_EXPORT_SUCCESS": "All entries exported successfully",
|
|
62
68
|
"ENTRIES_VERSIONED_EXPORT_SUCCESS": "Successfully exported versioned entry (Content Type: %s, UID: %s, Locale: %s)",
|
package/oclif.manifest.json
CHANGED
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
},
|
|
84
84
|
"module": {
|
|
85
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
|
|
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, taxonomies, and composable-studio.",
|
|
87
87
|
"name": "module",
|
|
88
88
|
"hasDynamicHelp": false,
|
|
89
89
|
"multiple": false,
|
|
@@ -159,5 +159,5 @@
|
|
|
159
159
|
]
|
|
160
160
|
}
|
|
161
161
|
},
|
|
162
|
-
"version": "1.
|
|
162
|
+
"version": "1.22.0"
|
|
163
163
|
}
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
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.22.0",
|
|
5
5
|
"author": "Contentstack",
|
|
6
6
|
"bugs": "https://github.com/contentstack/cli/issues",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@contentstack/cli-command": "~1.
|
|
9
|
-
"@contentstack/cli-variants": "~1.3.3",
|
|
8
|
+
"@contentstack/cli-command": "~1.7.0",
|
|
10
9
|
"@oclif/core": "^4.3.3",
|
|
11
|
-
"@contentstack/cli-
|
|
10
|
+
"@contentstack/cli-variants": "~1.3.5",
|
|
11
|
+
"@contentstack/cli-utilities": "~1.15.0",
|
|
12
12
|
"async": "^3.2.6",
|
|
13
13
|
"big-json": "^3.2.0",
|
|
14
14
|
"bluebird": "^3.7.2",
|
|
@@ -21,14 +21,18 @@
|
|
|
21
21
|
"winston": "^3.17.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@contentstack/cli-auth": "~1.6.
|
|
25
|
-
"@contentstack/cli-config": "~1.15.
|
|
24
|
+
"@contentstack/cli-auth": "~1.6.2",
|
|
25
|
+
"@contentstack/cli-config": "~1.15.3",
|
|
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
|
|
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"
|