Skip to content

Commit df8af84

Browse files
authored
Merge pull request #2271 from contentstack/feat/dx-3727
Removed deprecaed code from import plugin
2 parents def79f7 + d783775 commit df8af84

File tree

14 files changed

+144
-356
lines changed

14 files changed

+144
-356
lines changed

.talismanrc

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
fileignoreconfig:
2-
- filename: package-lock.json
3-
checksum: 7ab88b768020473414a7322e16c04b5b5a73b0122742b79b57f6e48bf39ae511
4-
- filename: pnpm-lock.yaml
5-
checksum: 1f9e4ddfd5db6a7677515bb1af1373d75bc83dbc755a99515808394df5d593d5
6-
- filename: packages/contentstack-export/src/commands/cm/stacks/export.ts
7-
checksum: a6cc98499a304a63f520e713c85ff707ca904044e15f095fa7498a5f602d57c5
8-
- filename: packages/contentstack-export/README.md
9-
checksum: 8b9f38642faa3b8fb5b2a35a6fe79b74862aeb32c318a1346a117fefea1291cd
2+
- filename: packages/contentstack-import/src/commands/cm/stacks/import.ts
3+
checksum: 22dec1acd2e5716cee5a22c834ee3292f8e822fd12db97eae412b9f004b15b70
104
- filename: packages/contentstack/README.md
11-
checksum: b746ebdb433947d6117694d33739b56d679d3fe1e18bc0a177f60b6a1f553ac9
5+
checksum: 69123c5e5b8580b8b20831fa1473b7c697e4aa336785ae08bda0d62a8e87794c
6+
- filename: packages/contentstack-import/README.md
7+
checksum: d17b25a28389abba3e7d90fe597dbdcbf705276acedc7b0beb1c5064f70fd5fd
128
version: '1.0'

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/contentstack-audit/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,5 +272,5 @@ DESCRIPTION
272272
Display help for csdx.
273273
```
274274

275-
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.35/src/commands/help.ts)_
275+
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.36/src/commands/help.ts)_
276276
<!-- commandsstop -->

packages/contentstack-clone/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"dependencies": {
88
"@colors/colors": "^1.6.0",
99
"@contentstack/cli-cm-export": "~2.0.0-beta.3",
10-
"@contentstack/cli-cm-import": "~2.0.0-beta.2",
10+
"@contentstack/cli-cm-import": "~2.0.0-beta.3",
1111
"@contentstack/cli-command": "~1.6.1",
1212
"@contentstack/cli-utilities": "~1.15.0",
1313
"@oclif/core": "^4.3.0",

packages/contentstack-import/README.md

Lines changed: 10 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ $ npm install -g @contentstack/cli-cm-import
4747
$ csdx COMMAND
4848
running command...
4949
$ csdx (--version)
50-
@contentstack/cli-cm-import/2.0.0-beta.2 darwin-arm64 node-v24.11.1
50+
@contentstack/cli-cm-import/2.0.0-beta.3 darwin-arm64 node-v24.11.1
5151
$ csdx --help [COMMAND]
5252
USAGE
5353
$ csdx COMMAND
@@ -58,25 +58,20 @@ USAGE
5858
# Commands
5959

6060
<!-- commands -->
61-
* [`csdx cm:stacks:import [-c <value>] [-k <value>] [-d <value>] [-a <value>] [--module <value>] [--backup-dir <value>] [--branch <value>] [--import-webhook-status disable|current]`](#csdx-cmstacksimport--c-value--k-value--d-value--a-value---module-value---backup-dir-value---branch-value---import-webhook-status-disablecurrent)
62-
* [`csdx cm:stacks:import [-c <value>] [-k <value>] [-d <value>] [-a <value>] [--module <value>] [--backup-dir <value>] [--branch <value>] [--import-webhook-status disable|current]`](#csdx-cmstacksimport--c-value--k-value--d-value--a-value---module-value---backup-dir-value---branch-value---import-webhook-status-disablecurrent)
61+
* [`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)
6362

64-
## `csdx cm:stacks:import [-c <value>] [-k <value>] [-d <value>] [-a <value>] [--module <value>] [--backup-dir <value>] [--branch <value>] [--import-webhook-status disable|current]`
63+
## `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]`
6564

6665
Import content from a stack
6766

6867
```
6968
USAGE
70-
$ csdx cm:import cm:stacks:import [-c <value>] [-k <value>] [-d <value>] [-a <value>] [--module <value>]
71-
[--backup-dir <value>] [--branch <value>] [--import-webhook-status disable|current]
69+
$ csdx cm:stacks:import [--config <value>] [--stack-api-key <value>] [--data-dir <value>] [--alias <value>]
70+
[--module <value>] [--backup-dir <value>] [--branch <value>] [--import-webhook-status disable|current]
7271
7372
FLAGS
74-
-B, --branch=<value> The name of the branch where you want to import your content. If you don't
75-
mention the branch name, then by default the content will be imported to the
76-
main branch.
7773
-a, --alias=<value> The management token of the destination stack where you will import the
7874
content.
79-
-b, --backup-dir=<value> [optional] Backup directory name when using specific module.
8075
-c, --config=<value> [optional] The path of the configuration JSON file containing all the options
8176
for a single run.
8277
-d, --data-dir=<value> The path or the location in your file system where the content, you intend to
@@ -85,89 +80,24 @@ FLAGS
8580
particular branch. For example, “-d
8681
"C:\Users\Name\Desktop\cli\content\branch_name"
8782
-k, --stack-api-key=<value> API Key of the target stack
88-
-m, --module=<value> [optional] Specify the module to import into the target stack. If not
89-
specified, the import command will import all the modules into the stack. The
90-
available modules are assets, content-types, entries, environments,
91-
extensions, marketplace-apps, global-fields, labels, locales, webhooks,
92-
workflows, custom-roles, personalize projects, and taxonomies.
9383
-y, --yes [optional] Force override all Marketplace prompts.
84+
--backup-dir=<value> [optional] Backup directory name when using specific module.
85+
--branch=<value> The name of the branch where you want to import your content. If you don't
86+
mention the branch name, then by default the content will be imported to the
87+
main branch.
9488
--branch-alias=<value> Specify the branch alias where you want to import your content. If not
9589
specified, the content is imported into the main branch by default.
9690
--exclude-global-modules Excludes the branch-independent module from the import operation.
9791
--import-webhook-status=<option> [default: disable] [default: disable] (optional) This webhook state keeps the
9892
same state of webhooks as the source stack. <options: disable|current>
9993
<options: disable|current>
100-
--personalize-project-name=<value> (optional) Provide a unique name for the Personalize project.
101-
--replace-existing Replaces the existing module in the target stack.
102-
--skip-app-recreation (optional) Skips the recreation of private apps if they already exist.
103-
--skip-assets-publish Skips asset publishing during the import process.
104-
--skip-audit Skips the audit fix that occurs during an import operation.
105-
--skip-entries-publish Skips entry publishing during the import process
106-
--skip-existing Skips the module exists warning messages.
107-
108-
DESCRIPTION
109-
Import content from a stack
110-
111-
ALIASES
112-
$ csdx cm:import
113-
114-
EXAMPLES
115-
$ csdx cm:stacks:import --stack-api-key <stack_api_key> --data-dir <path/of/export/destination/dir>
116-
117-
$ csdx cm:stacks:import --config <path/of/config/dir>
118-
119-
$ csdx cm:stacks:import --module <single module name>
120-
121-
$ csdx cm:stacks:import --module <single module name> --backup-dir <backup dir>
122-
123-
$ csdx cm:stacks:import --alias <management_token_alias>
124-
125-
$ csdx cm:stacks:import --alias <management_token_alias> --data-dir <path/of/export/destination/dir>
126-
127-
$ csdx cm:stacks:import --alias <management_token_alias> --config <path/of/config/file>
128-
129-
$ csdx cm:stacks:import --branch <branch name> --yes --skip-audit
130-
```
131-
132-
## `csdx cm:stacks:import [-c <value>] [-k <value>] [-d <value>] [-a <value>] [--module <value>] [--backup-dir <value>] [--branch <value>] [--import-webhook-status disable|current]`
133-
134-
Import content from a stack
135-
136-
```
137-
USAGE
138-
$ csdx cm:stacks:import [-c <value>] [-k <value>] [-d <value>] [-a <value>] [--module <value>] [--backup-dir
139-
<value>] [--branch <value>] [--import-webhook-status disable|current]
140-
141-
FLAGS
142-
-B, --branch=<value> The name of the branch where you want to import your content. If you don't
143-
mention the branch name, then by default the content will be imported to the
144-
main branch.
145-
-a, --alias=<value> The management token of the destination stack where you will import the
146-
content.
147-
-b, --backup-dir=<value> [optional] Backup directory name when using specific module.
148-
-c, --config=<value> [optional] The path of the configuration JSON file containing all the options
149-
for a single run.
150-
-d, --data-dir=<value> The path or the location in your file system where the content, you intend to
151-
import, is stored. For example, -d "C:\Users\Name\Desktop\cli\content". If the
152-
export folder has branches involved, then the path should point till the
153-
particular branch. For example, “-d
154-
"C:\Users\Name\Desktop\cli\content\branch_name"
155-
-k, --stack-api-key=<value> API Key of the target stack
156-
-m, --module=<value> [optional] Specify the module to import into the target stack. If not
94+
--module=<value> [optional] Specify the module to import into the target stack. If not
15795
specified, the import command will import all the modules into the stack. The
15896
available modules are assets, content-types, entries, environments,
15997
extensions, marketplace-apps, global-fields, labels, locales, webhooks,
16098
workflows, custom-roles, personalize projects, and taxonomies.
161-
-y, --yes [optional] Force override all Marketplace prompts.
162-
--branch-alias=<value> Specify the branch alias where you want to import your content. If not
163-
specified, the content is imported into the main branch by default.
164-
--exclude-global-modules Excludes the branch-independent module from the import operation.
165-
--import-webhook-status=<option> [default: disable] [default: disable] (optional) This webhook state keeps the
166-
same state of webhooks as the source stack. <options: disable|current>
167-
<options: disable|current>
16899
--personalize-project-name=<value> (optional) Provide a unique name for the Personalize project.
169100
--replace-existing Replaces the existing module in the target stack.
170-
--skip-app-recreation (optional) Skips the recreation of private apps if they already exist.
171101
--skip-assets-publish Skips asset publishing during the import process.
172102
--skip-audit Skips the audit fix that occurs during an import operation.
173103
--skip-entries-publish Skips entry publishing during the import process
@@ -176,9 +106,6 @@ FLAGS
176106
DESCRIPTION
177107
Import content from a stack
178108
179-
ALIASES
180-
$ csdx cm:import
181-
182109
EXAMPLES
183110
$ csdx cm:stacks:import --stack-api-key <stack_api_key> --data-dir <path/of/export/destination/dir>
184111

packages/contentstack-import/package.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@contentstack/cli-cm-import",
33
"description": "Contentstack CLI plugin to import content into stack",
4-
"version": "2.0.0-beta.2",
4+
"version": "2.0.0-beta.3",
55
"author": "Contentstack",
66
"bugs": "https://github.com/contentstack/cli/issues",
77
"dependencies": {
@@ -86,12 +86,8 @@
8686
"repositoryPrefix": "<%- repo %>/blob/main/packages/contentstack-import/<%- commandPath %>"
8787
},
8888
"csdxConfig": {
89-
"expiredCommands": {
90-
"cm:import": "csdx cm:stacks:import"
91-
},
9289
"shortCommandName": {
93-
"cm:stacks:import": "IMPRT",
94-
"cm:import": "O-IMPRT"
90+
"cm:stacks:import": "IMPRT"
9591
}
9692
},
9793
"repository": "https://github.com/contentstack/cli"

packages/contentstack-import/src/commands/cm/stacks/import.ts

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { Command } from '@contentstack/cli-command';
22
import {
33
messageHandler,
4-
printFlagDeprecation,
54
managementSDKClient,
65
flags,
76
FlagInput,
@@ -38,21 +37,10 @@ export default class ImportCommand extends Command {
3837
char: 'c',
3938
description: '[optional] The path of the configuration JSON file containing all the options for a single run.',
4039
}),
41-
'stack-uid': flags.string({
42-
char: 's',
43-
description: 'API key of the target stack.',
44-
hidden: true,
45-
parse: printFlagDeprecation(['-s', '--stack-uid'], ['-k', '--stack-api-key']),
46-
}),
4740
'stack-api-key': flags.string({
4841
char: 'k',
4942
description: 'API Key of the target stack',
5043
}),
51-
data: flags.string({
52-
description: 'path and location where data is stored',
53-
hidden: true,
54-
parse: printFlagDeprecation(['--data'], ['--data-dir']),
55-
}),
5644
'data-dir': flags.string({
5745
char: 'd',
5846
description: `The path or the location in your file system where the content, you intend to import, is stored. For example, -d "C:\\Users\\Name\\Desktop\\cli\\content". If the export folder has branches involved, then the path should point till the particular branch. For example, “-d "C:\\Users\\Name\\Desktop\\cli\\content\\branch_name"`,
@@ -61,39 +49,22 @@ export default class ImportCommand extends Command {
6149
char: 'a',
6250
description: 'The management token of the destination stack where you will import the content.',
6351
}),
64-
'management-token-alias': flags.string({
65-
description: 'alias of the management token',
66-
hidden: true,
67-
parse: printFlagDeprecation(['--management-token-alias'], ['-a', '--alias']),
68-
}),
69-
'auth-token': flags.boolean({
70-
char: 'A',
71-
description: 'to use auth token',
72-
hidden: true,
73-
parse: printFlagDeprecation(['-A', '--auth-token']),
74-
}),
7552
module: flags.string({
7653
required: false,
77-
char: 'm',
7854
description:
7955
'[optional] Specify the module to import into the target stack. If not specified, the import command will import all the modules into the stack. The available modules are assets, content-types, entries, environments, extensions, marketplace-apps, global-fields, labels, locales, webhooks, workflows, custom-roles, personalize projects, and taxonomies.',
80-
parse: printFlagDeprecation(['-m'], ['--module']),
8156
}),
8257
'backup-dir': flags.string({
83-
char: 'b',
8458
description: '[optional] Backup directory name when using specific module.',
85-
parse: printFlagDeprecation(['-b'], ['--backup-dir']),
8659
}),
8760
branch: flags.string({
88-
char: 'B',
8961
description:
9062
"The name of the branch where you want to import your content. If you don't mention the branch name, then by default the content will be imported to the main branch.",
91-
parse: printFlagDeprecation(['-B'], ['--branch']),
9263
exclusive: ['branch-alias'],
9364
}),
9465
'branch-alias': flags.string({
9566
description:
96-
"Specify the branch alias where you want to import your content. If not specified, the content is imported into the main branch by default.",
67+
'Specify the branch alias where you want to import your content. If not specified, the content is imported into the main branch by default.',
9768
exclusive: ['branch'],
9869
}),
9970
'import-webhook-status': flags.string({
@@ -108,10 +79,6 @@ export default class ImportCommand extends Command {
10879
required: false,
10980
description: '[optional] Force override all Marketplace prompts.',
11081
}),
111-
'skip-app-recreation': flags.boolean({
112-
description: '(optional) Skips the recreation of private apps if they already exist.',
113-
parse: printFlagDeprecation(['--skip-app-recreation']),
114-
}),
11582
'replace-existing': flags.boolean({
11683
required: false,
11784
description: 'Replaces the existing module in the target stack.',
@@ -142,10 +109,8 @@ export default class ImportCommand extends Command {
142109
}),
143110
};
144111

145-
static aliases: string[] = ['cm:import'];
146-
147112
static usage: string =
148-
'cm:stacks:import [-c <value>] [-k <value>] [-d <value>] [-a <value>] [--module <value>] [--backup-dir <value>] [--branch <value>] [--import-webhook-status disable|current]';
113+
'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]';
149114

150115
async run(): Promise<void> {
151116
// setup import config
@@ -159,7 +124,6 @@ export default class ImportCommand extends Command {
159124
// Prepare the context object
160125
const context = this.createImportContext(importConfig.apiKey, importConfig.authenticationMethod);
161126
importConfig.context = { ...context };
162-
//log.info(`Using Cli Version: ${this.context?.cliVersion}`, importConfig.context);
163127

164128
// Note setting host to create cma client
165129
importConfig.host = this.cmaHost;

0 commit comments

Comments
 (0)