@contentstack/cli-migration 1.2.0 → 1.3.1

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
@@ -21,7 +21,7 @@ $ npm install -g @contentstack/cli-migration
21
21
  $ csdx COMMAND
22
22
  running command...
23
23
  $ csdx (--version)
24
- @contentstack/cli-migration/1.2.0 linux-x64 node-v16.19.1
24
+ @contentstack/cli-migration/1.3.1 linux-x64 node-v16.20.0
25
25
  $ csdx --help [COMMAND]
26
26
  USAGE
27
27
  $ csdx COMMAND
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.2.0",
2
+ "version": "1.3.1",
3
3
  "commands": {
4
4
  "cm:stacks:migration": {
5
5
  "id": "cm:stacks:migration",
@@ -27,9 +27,6 @@
27
27
  "char": "k",
28
28
  "description": "With this flag add the API key of your stack.",
29
29
  "multiple": false,
30
- "dependsOn": [
31
- "authtoken"
32
- ],
33
30
  "exclusive": [
34
31
  "alias"
35
32
  ]
@@ -39,10 +36,7 @@
39
36
  "type": "option",
40
37
  "char": "a",
41
38
  "description": "Use this flag to add the management token alias.",
42
- "multiple": false,
43
- "exclusive": [
44
- "authtoken"
45
- ]
39
+ "multiple": false
46
40
  },
47
41
  "file-path": {
48
42
  "name": "file-path",
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@contentstack/cli-migration",
3
- "version": "1.2.0",
3
+ "version": "1.3.1",
4
4
  "author": "@contentstack",
5
5
  "bugs": "https://github.com/contentstack/cli/issues",
6
6
  "dependencies": {
7
- "@contentstack/cli-command": "^1.2.0",
8
- "@contentstack/cli-utilities": "^1.2.0",
7
+ "@contentstack/cli-command": "^1.2.2",
8
+ "@contentstack/cli-utilities": "^1.3.1",
9
9
  "@contentstack/management": "^1.6.1",
10
10
  "@oclif/command": "^1.8.16",
11
11
  "@oclif/config": "^1.18.3",
@@ -64,6 +64,10 @@
64
64
  "csdxConfig": {
65
65
  "expiredCommands": {
66
66
  "cm:migration": "csdx cm:stacks:migration"
67
+ },
68
+ "shortCommandName": {
69
+ "cm:stacks:migration": "MGRTN",
70
+ "cm:migration": "O-MGRTN"
67
71
  }
68
72
  }
69
73
  }
@@ -12,7 +12,7 @@ const { Parser } = require('../../../modules');
12
12
  const { ActionList } = require('../../../actions');
13
13
  const fs = require('fs');
14
14
  const chalk = require('chalk');
15
- const { configHandler, printFlagDeprecation, managementSDKClient, flags } = require('@contentstack/cli-utilities');
15
+ const { printFlagDeprecation, managementSDKClient, flags, isAuthenticated } = require('@contentstack/cli-utilities');
16
16
 
17
17
  const { ApiError, SchemaValidator, MigrationError, FieldValidator } = require('../../../validators');
18
18
 
@@ -49,7 +49,7 @@ class MigrationCommand extends Command {
49
49
  const { branch } = migrationCommandFlags || {};
50
50
  const filePath = migrationCommandFlags['file-path'] || migrationCommandFlags.filePath;
51
51
  const multi = migrationCommandFlags.multiple || migrationCommandFlags.multi;
52
- const authtoken = configHandler.get('authtoken');
52
+ const authtoken = isAuthenticated();
53
53
  const apiKey = migrationCommandFlags['api-key'] || migrationCommandFlags['stack-api-key'];
54
54
  const alias = migrationCommandFlags['alias'] || migrationCommandFlags['management-token-alias'];
55
55
  const config = migrationCommandFlags['config'];
@@ -81,7 +81,7 @@ class MigrationCommand extends Command {
81
81
  set('config', mapInstance, configObj);
82
82
  }
83
83
 
84
- const APIClient = await managementSDKClient({ host: this.cmaHost })
84
+ const APIClient = await managementSDKClient({ host: this.cmaHost });
85
85
  let stackSDKInstance;
86
86
  if (branch) {
87
87
  set(BRANCH, mapInstance, branch);
@@ -235,13 +235,11 @@ MigrationCommand.flags = {
235
235
  'stack-api-key': flags.string({
236
236
  char: 'k',
237
237
  description: 'With this flag add the API key of your stack.',
238
- dependsOn: ['authtoken'],
239
238
  exclusive: ['alias'],
240
239
  }),
241
240
  alias: flags.string({
242
241
  char: 'a',
243
242
  description: 'Use this flag to add the management token alias.',
244
- exclusive: ['authtoken'],
245
243
  }),
246
244
  'file-path': flags.string({
247
245
  description: 'Use this flag to provide the path of the file of the migration script provided by the user.',
@@ -258,7 +256,6 @@ MigrationCommand.flags = {
258
256
  description: '[optional] inline configuration, <key1>:<value1>',
259
257
  multiple: true,
260
258
  }),
261
-
262
259
  multiple: flags.boolean({
263
260
  description: 'This flag helps you to migrate multiple content files in a single instance.',
264
261
  }),