@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 Contentstack
3
+ Copyright (c) 2026 Contentstack
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
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.22.1 linux-x64 node-v22.21.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
@@ -7,6 +7,5 @@ export default class ExportCommand extends Command {
7
7
  static flags: FlagInput;
8
8
  static aliases: string[];
9
9
  run(): Promise<void>;
10
- private createExportContext;
11
10
  private assignExportConfig;
12
11
  }
@@ -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
- // Prepare the context object
15
- const context = this.createExportContext(exportConfig.apiKey, exportConfig.authenticationMethod);
16
- exportConfig.context = Object.assign({}, context);
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 (!((_a = exportConfig.branches) === null || _a === void 0 ? void 0 : _a.length)) {
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!`, exportConfig.context);
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
@@ -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
  const mkdirp = require('mkdirp');
@@ -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
  const path = require('path');
@@ -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
  const mkdirp = require('mkdirp');
@@ -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
  const path = require('path');
@@ -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
  const path = require('path');
@@ -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
  const _ = require('lodash');
@@ -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
  const path = require('path');
@@ -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
  const path = require('path');
@@ -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
  const path = require('path');
@@ -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';
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * Contentstack Import
3
- * Copyright (c) 2024 Contentstack LLC
3
+ * Copyright (c) 2026 Contentstack LLC
4
4
  * MIT Licensed
5
5
  */
6
6
  import { ExternalConfig } from '../types';
@@ -4,7 +4,7 @@
4
4
  /* eslint-disable no-empty */
5
5
  /*!
6
6
  * Contentstack Import
7
- * Copyright (c) 2024 Contentstack LLC
7
+ * Copyright (c) 2026 Contentstack LLC
8
8
  * MIT Licensed
9
9
  */
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -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 { ExternalConfig, 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 });
@@ -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 });
@@ -159,5 +159,5 @@
159
159
  ]
160
160
  }
161
161
  },
162
- "version": "1.22.1"
162
+ "version": "1.23.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.22.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.0",
8
+ "@contentstack/cli-command": "~1.7.1",
9
9
  "@oclif/core": "^4.3.3",
10
- "@contentstack/cli-variants": "~1.3.5",
11
- "@contentstack/cli-utilities": "~1.15.0",
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.6.2",
25
- "@contentstack/cli-config": "~1.15.3",
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",