@contentstack/cli-cm-export 1.22.1 → 1.23.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/LICENSE +1 -1
- package/README.md +1 -1
- package/lib/commands/cm/stacks/export.d.ts +0 -1
- package/lib/commands/cm/stacks/export.js +7 -20
- package/lib/export/modules-js/assets.js +1 -1
- package/lib/export/modules-js/environments.js +1 -1
- package/lib/export/modules-js/extensions.js +1 -1
- package/lib/export/modules-js/global-fields.js +1 -1
- package/lib/export/modules-js/labels.js +1 -1
- package/lib/export/modules-js/marketplace-apps.js +1 -1
- package/lib/export/modules-js/stack.js +1 -1
- package/lib/export/modules-js/webhooks.js +1 -1
- package/lib/export/modules-js/workflows.js +1 -1
- package/lib/types/index.d.ts +0 -8
- package/lib/utils/basic-login.d.ts +1 -1
- package/lib/utils/basic-login.js +1 -1
- package/lib/utils/common-helper.d.ts +1 -1
- package/lib/utils/common-helper.js +1 -1
- package/lib/utils/logger.d.ts +1 -1
- package/lib/utils/logger.js +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +6 -6
package/LICENSE
CHANGED
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.23.0 linux-x64 node-v22.21.1
|
|
52
52
|
$ csdx --help [COMMAND]
|
|
53
53
|
USAGE
|
|
54
54
|
$ csdx COMMAND
|
|
@@ -6,14 +6,15 @@ const export_1 = require("../../../export");
|
|
|
6
6
|
const utils_1 = require("../../../utils");
|
|
7
7
|
class ExportCommand extends cli_command_1.Command {
|
|
8
8
|
async run() {
|
|
9
|
-
var _a;
|
|
9
|
+
var _a, _b, _c;
|
|
10
10
|
let exportDir = (0, cli_utilities_1.pathValidator)('logs');
|
|
11
11
|
try {
|
|
12
12
|
const { flags } = await this.parse(ExportCommand);
|
|
13
13
|
const exportConfig = await (0, utils_1.setupExportConfig)(flags);
|
|
14
|
-
//
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
// Store apiKey in configHandler for session.json (return value not needed)
|
|
15
|
+
(0, cli_utilities_1.createLogContext)(((_b = (_a = this.context) === null || _a === void 0 ? void 0 : _a.info) === null || _b === void 0 ? void 0 : _b.command) || 'cm:stacks:export', exportConfig.apiKey, exportConfig.authenticationMethod);
|
|
16
|
+
// For log entries, only pass module (other fields are in session.json)
|
|
17
|
+
exportConfig.context = { module: '' };
|
|
17
18
|
//log.info(`Using Cli Version: ${this.context?.cliVersion}`, exportConfig.context);
|
|
18
19
|
// Assign exportConfig variables
|
|
19
20
|
this.assignExportConfig(exportConfig);
|
|
@@ -21,10 +22,10 @@ class ExportCommand extends cli_command_1.Command {
|
|
|
21
22
|
const managementAPIClient = await (0, cli_utilities_1.managementSDKClient)(exportConfig);
|
|
22
23
|
const moduleExporter = new export_1.ModuleExporter(managementAPIClient, exportConfig);
|
|
23
24
|
await moduleExporter.start();
|
|
24
|
-
if (!((
|
|
25
|
+
if (!((_c = exportConfig.branches) === null || _c === void 0 ? void 0 : _c.length)) {
|
|
25
26
|
(0, utils_1.writeExportMetaFile)(exportConfig);
|
|
26
27
|
}
|
|
27
|
-
cli_utilities_1.log.success(`The content of the stack ${exportConfig.apiKey} has been exported successfully
|
|
28
|
+
cli_utilities_1.log.success(`The content of the stack ${exportConfig.apiKey} has been exported successfully!`);
|
|
28
29
|
cli_utilities_1.log.info(`The exported content has been stored at '${exportDir}'.`, exportConfig.context);
|
|
29
30
|
cli_utilities_1.log.success(`The log has been stored at '${(0, cli_utilities_1.getLogPath)()}'.`, exportConfig.context);
|
|
30
31
|
}
|
|
@@ -33,20 +34,6 @@ class ExportCommand extends cli_command_1.Command {
|
|
|
33
34
|
cli_utilities_1.log.info(`The log has been stored at '${(0, cli_utilities_1.getLogPath)()}'.`);
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
|
-
// Create export context object
|
|
37
|
-
createExportContext(apiKey, authenticationMethod) {
|
|
38
|
-
var _a, _b, _c;
|
|
39
|
-
return {
|
|
40
|
-
command: ((_b = (_a = this.context) === null || _a === void 0 ? void 0 : _a.info) === null || _b === void 0 ? void 0 : _b.command) || 'cm:stacks:export',
|
|
41
|
-
module: '',
|
|
42
|
-
userId: cli_utilities_1.configHandler.get('userUid') || '',
|
|
43
|
-
email: cli_utilities_1.configHandler.get('email') || '',
|
|
44
|
-
sessionId: ((_c = this.context) === null || _c === void 0 ? void 0 : _c.sessionId) || '',
|
|
45
|
-
apiKey: apiKey || '',
|
|
46
|
-
orgId: cli_utilities_1.configHandler.get('oauthOrgUid') || '',
|
|
47
|
-
authenticationMethod: authenticationMethod || 'Basic Auth',
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
37
|
// Assign values to exportConfig
|
|
51
38
|
assignExportConfig(exportConfig) {
|
|
52
39
|
// Note setting host to create cma client
|
package/lib/types/index.d.ts
CHANGED
|
@@ -123,15 +123,7 @@ export interface ComposableStudioProject {
|
|
|
123
123
|
uid: string;
|
|
124
124
|
}
|
|
125
125
|
export interface Context {
|
|
126
|
-
command: string;
|
|
127
126
|
module: string;
|
|
128
|
-
userId: string | undefined;
|
|
129
|
-
email: string | undefined;
|
|
130
|
-
sessionId: string | undefined;
|
|
131
|
-
clientId?: string | undefined;
|
|
132
|
-
apiKey: string;
|
|
133
|
-
orgId: string;
|
|
134
|
-
authenticationMethod?: string;
|
|
135
127
|
}
|
|
136
128
|
export { default as DefaultConfig } from './default-config';
|
|
137
129
|
export { default as ExportConfig } from './export-config';
|
package/lib/utils/basic-login.js
CHANGED
package/lib/utils/logger.d.ts
CHANGED
package/lib/utils/logger.js
CHANGED
package/oclif.manifest.json
CHANGED
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.23.0",
|
|
5
5
|
"author": "Contentstack",
|
|
6
6
|
"bugs": "https://github.com/contentstack/cli/issues",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@contentstack/cli-command": "~1.7.
|
|
8
|
+
"@contentstack/cli-command": "~1.7.1",
|
|
9
9
|
"@oclif/core": "^4.3.3",
|
|
10
|
-
"@contentstack/cli-variants": "~1.3.
|
|
11
|
-
"@contentstack/cli-utilities": "~1.
|
|
10
|
+
"@contentstack/cli-variants": "~1.3.6",
|
|
11
|
+
"@contentstack/cli-utilities": "~1.16.0",
|
|
12
12
|
"async": "^3.2.6",
|
|
13
13
|
"big-json": "^3.2.0",
|
|
14
14
|
"bluebird": "^3.7.2",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"winston": "^3.17.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@contentstack/cli-auth": "~1.
|
|
25
|
-
"@contentstack/cli-config": "~1.
|
|
24
|
+
"@contentstack/cli-auth": "~1.7.0",
|
|
25
|
+
"@contentstack/cli-config": "~1.17.0",
|
|
26
26
|
"@contentstack/cli-dev-dependencies": "~1.3.1",
|
|
27
27
|
"@oclif/plugin-help": "^6.2.28",
|
|
28
28
|
"@oclif/test": "^4.1.13",
|