@contentstack/cli 2.0.0-beta.7 → 2.0.0-beta.8

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
@@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli
18
18
  $ csdx COMMAND
19
19
  running command...
20
20
  $ csdx (--version|-v)
21
- @contentstack/cli/2.0.0-beta.7 linux-x64 node-v22.22.0
21
+ @contentstack/cli/2.0.0-beta.8 linux-x64 node-v22.22.0
22
22
  $ csdx --help [COMMAND]
23
23
  USAGE
24
24
  $ csdx COMMAND
@@ -66,7 +66,6 @@ USAGE
66
66
  * [`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)
67
67
  * [`csdx cm:stacks:import [--config <value>] [--stack-api-key <value>] [--data-dir <value>] [--alias <value>] [--module <value>] [--backup-dir <value>] [--branch <value>] [--import-webhook-status disable|current]`](#csdx-cmstacksimport---config-value---stack-api-key-value---data-dir-value---alias-value---module-value---backup-dir-value---branch-value---import-webhook-status-disablecurrent)
68
68
  * [`csdx cm:stacks:import-setup [-k <value>] [-d <value>] [-a <value>] [--modules <value,value>]`](#csdx-cmstacksimport-setup--k-value--d-value--a-value---modules-valuevalue)
69
- * [`csdx cm:stacks:migration [-k <value>] [-a <value>] [--file-path <value>] [--branch <value>] [--config-file <value>] [--config <value>] [--multiple]`](#csdx-cmstacksmigration--k-value--a-value---file-path-value---branch-value---config-file-value---config-value---multiple)
70
69
  * [`csdx cm:stacks:publish`](#csdx-cmstackspublish)
71
70
  * [`csdx cm:stacks:publish-clear-logs`](#csdx-cmstackspublish-clear-logs)
72
71
  * [`csdx cm:stacks:publish-configure`](#csdx-cmstackspublish-configure)
@@ -2280,48 +2279,6 @@ EXAMPLES
2280
2279
 
2281
2280
  _See code: [@contentstack/cli-cm-import-setup](https://github.com/contentstack/cli/blob/main/packages/contentstack-import-setup/src/commands/cm/stacks/import-setup.ts)_
2282
2281
 
2283
- ## `csdx cm:stacks:migration [-k <value>] [-a <value>] [--file-path <value>] [--branch <value>] [--config-file <value>] [--config <value>] [--multiple]`
2284
-
2285
- Contentstack migration script.
2286
-
2287
- ```
2288
- USAGE
2289
- $ csdx cm:stacks:migration [-k <value>] [-a <value>] [--file-path <value>] [--branch <value>] [--config-file <value>]
2290
- [--config <value>] [--multiple]
2291
-
2292
- FLAGS
2293
- -a, --alias=<value> Use this flag to add the management token alias. You must use either the --alias flag or
2294
- the --stack-api-key flag.
2295
- -k, --stack-api-key=<value> Use this flag to add the API key of your stack. You must use either the --stack-api-key
2296
- flag or the --alias flag.
2297
- --branch=<value> Use this flag to add the branch name where you want to perform the migration. (target
2298
- branch name)
2299
- --config=<value>... [optional] Inline configuration, <key1>:<value1>. Passing an external configuration makes
2300
- the script re-usable.
2301
- --config-file=<value> [optional] Path of the JSON configuration file.
2302
- --file-path=<value> Use this flag to provide the path of the file of the migration script.
2303
- --multiple This flag helps you to migrate multiple content files in a single instance. Mention the
2304
- folder path where your migration script files are stored.
2305
-
2306
- DESCRIPTION
2307
- Contentstack migration script.
2308
-
2309
- EXAMPLES
2310
- $ csdx cm:migration --file-path <migration/script/file/path> --stack-api-key <stack-api-key>
2311
-
2312
- $ csdx cm:migration --file-path <migration/script/file/path> --stack-api-key <stack-api-key> --branch <target branch name>
2313
-
2314
- $ csdx cm:migration --config <key1>:<value1> <key2>:<value2> ... --file-path <migration/script/file/path>
2315
-
2316
- $ csdx cm:migration --config-file <path/to/json/config/file> --file-path <migration/script/file/path>
2317
-
2318
- $ csdx cm:migration --multiple --file-path <migration/scripts/dir/path>
2319
-
2320
- $ csdx cm:migration --alias <management-token-alias> --file-path <migration/script/file/path>
2321
- ```
2322
-
2323
- _See code: [@contentstack/cli-migration](https://github.com/contentstack/cli/blob/main/packages/contentstack-migration/src/commands/cm/stacks/migration.js)_
2324
-
2325
2282
  ## `csdx cm:stacks:publish`
2326
2283
 
2327
2284
  Publish entries and assets to multiple environments and locales
@@ -1,10 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const cli_utilities_1 = require("@contentstack/cli-utilities");
4
- const cli_utilities_2 = require("@contentstack/cli-utilities");
5
4
  // TBD: run region command if region is not there
6
5
  async function default_1(opts) {
7
- const newLogger = new cli_utilities_2.LoggerService(process.cwd(), 'cli-log');
8
6
  const { context: { plugin: { config: { protectedCommands = {} } = {} } = {}, region = null } = {} } = this.config;
9
7
  if (opts.Command.id !== 'config:set:region') {
10
8
  if (!region) {
@@ -17,7 +15,7 @@ async function default_1(opts) {
17
15
  // Auth guard
18
16
  if (protectedCommands[opts.Command.id]) {
19
17
  if (!(0, cli_utilities_1.isAuthenticated)()) {
20
- newLogger.error('No auth token found for command.', opts.Command.id);
18
+ (0, cli_utilities_1.handleAndLogError)(new Error('Authentication required for this command'), { module: 'auth-guard', commandId: opts.Command.id });
21
19
  cli_utilities_1.cliux.error('Please log in to execute the command');
22
20
  this.exit();
23
21
  }
@@ -25,14 +23,14 @@ async function default_1(opts) {
25
23
  try {
26
24
  const result = await client.getUser();
27
25
  if (!result) {
28
- newLogger.error('Error in auth validation');
26
+ (0, cli_utilities_1.handleAndLogError)(new Error('Error in auth validation'), { module: 'auth-guard' });
29
27
  cli_utilities_1.cliux.error('Please log in to execute the command');
30
28
  this.exit();
31
29
  }
32
- newLogger.debug('Logged-in user', result.data);
30
+ cli_utilities_1.log.debug('Logged-in user', { module: 'auth-guard', userData: result.data });
33
31
  }
34
32
  catch (error) {
35
- newLogger.error('Error in auth validation', error);
33
+ (0, cli_utilities_1.handleAndLogError)(error, { module: 'auth-guard' }, 'Error in auth validation');
36
34
  cli_utilities_1.cliux.error('Please log in to execute the command');
37
35
  process.exit();
38
36
  }
@@ -10,7 +10,6 @@ async function default_1(_opts) {
10
10
  var _a, _b;
11
11
  const now = Date.now();
12
12
  const today = new Date().toISOString().split('T')[0];
13
- const logger = new cli_utilities_1.LoggerService(process.env.CS_CLI_LOG_PATH || process.cwd(), 'cli-log');
14
13
  let cache = { lastChecked: 0, lastWarnedDate: '', latestVersion: '' };
15
14
  // if CLI_VERSION is not set or is not the same as the current version, set it
16
15
  if (!cli_utilities_1.configHandler.get('CLI_VERSION') || cli_utilities_1.configHandler.get('CLI_VERSION') !== this.config.version) {
@@ -30,7 +29,7 @@ async function default_1(_opts) {
30
29
  try {
31
30
  const latestVersion = (_b = (_a = (await httpClient.get(`https://registry.npmjs.org/@contentstack/cli/latest`))) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.version;
32
31
  if (!latestVersion) {
33
- logger.error('Failed to retrieve the latest version from the registry.');
32
+ (0, cli_utilities_1.handleAndLogError)(new Error('Failed to retrieve the latest version from the registry.'), { module: 'latest-version-warning' });
34
33
  return;
35
34
  }
36
35
  cache.latestVersion = latestVersion;
@@ -39,7 +38,7 @@ async function default_1(_opts) {
39
38
  cli_utilities_1.configHandler.set('versionUpgradeWarningCache', cache);
40
39
  }
41
40
  catch (error) {
42
- logger.error('Failed to check the latest version', error);
41
+ (0, cli_utilities_1.handleAndLogError)(error, { module: 'latest-version-warning' }, 'Failed to check the latest version');
43
42
  return;
44
43
  }
45
44
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "commands": {},
3
- "version": "2.0.0-beta.7"
3
+ "version": "2.0.0-beta.8"
4
4
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@contentstack/cli",
3
3
  "description": "Command-line tool (CLI) to interact with Contentstack",
4
- "version": "2.0.0-beta.7",
4
+ "version": "2.0.0-beta.8",
5
5
  "author": "Contentstack",
6
6
  "bin": {
7
7
  "csdx": "./bin/run.js"
@@ -23,21 +23,21 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "@contentstack/cli-audit": "~2.0.0-beta.2",
26
- "@contentstack/cli-auth": "~2.0.0-beta.3",
26
+ "@contentstack/cli-cm-export": "~2.0.0-beta.6",
27
+ "@contentstack/cli-cm-import": "~2.0.0-beta.5",
28
+ "@contentstack/cli-auth": "~2.0.0-beta.4",
27
29
  "@contentstack/cli-cm-bootstrap": "~2.0.0-beta.5",
28
30
  "@contentstack/cli-cm-branches": "~1.6.3",
29
31
  "@contentstack/cli-cm-bulk-publish": "~1.10.6",
30
- "@contentstack/cli-cm-clone": "~2.0.0-beta.6",
31
- "@contentstack/cli-cm-export": "~2.0.0-beta.5",
32
+ "@contentstack/cli-cm-clone": "~2.0.0-beta.7",
32
33
  "@contentstack/cli-cm-export-to-csv": "~1.11.0",
33
- "@contentstack/cli-cm-import": "~2.0.0-beta.5",
34
34
  "@contentstack/cli-cm-import-setup": "~2.0.0-beta.3",
35
35
  "@contentstack/cli-cm-seed": "~2.0.0-beta.5",
36
36
  "@contentstack/cli-command": "~1.7.2",
37
37
  "@contentstack/cli-config": "~1.18.0",
38
38
  "@contentstack/cli-launch": "1.9.3",
39
- "@contentstack/cli-migration": "~2.0.0-beta.2",
40
- "@contentstack/cli-utilities": "~1.17.0",
39
+ "@contentstack/cli-migration": "~2.0.0-beta.3",
40
+ "@contentstack/cli-utilities": "~1.17.1",
41
41
  "@contentstack/cli-variants": "~2.0.0-beta.4",
42
42
  "@contentstack/management": "~1.27.3",
43
43
  "@oclif/core": "^4.3.0",