Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions .talismanrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
fileignoreconfig:
- filename: package-lock.json
checksum: 7ab88b768020473414a7322e16c04b5b5a73b0122742b79b57f6e48bf39ae511
- filename: pnpm-lock.yaml
checksum: 1f9e4ddfd5db6a7677515bb1af1373d75bc83dbc755a99515808394df5d593d5
- filename: packages/contentstack-export/src/commands/cm/stacks/export.ts
checksum: a6cc98499a304a63f520e713c85ff707ca904044e15f095fa7498a5f602d57c5
- filename: packages/contentstack-export/README.md
checksum: 8b9f38642faa3b8fb5b2a35a6fe79b74862aeb32c318a1346a117fefea1291cd
- filename: packages/contentstack-import/src/commands/cm/stacks/import.ts
checksum: 22dec1acd2e5716cee5a22c834ee3292f8e822fd12db97eae412b9f004b15b70
- filename: packages/contentstack/README.md
checksum: b746ebdb433947d6117694d33739b56d679d3fe1e18bc0a177f60b6a1f553ac9
checksum: 69123c5e5b8580b8b20831fa1473b7c697e4aa336785ae08bda0d62a8e87794c
- filename: packages/contentstack-import/README.md
checksum: d17b25a28389abba3e7d90fe597dbdcbf705276acedc7b0beb1c5064f70fd5fd
version: '1.0'
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/contentstack-audit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,5 +272,5 @@ DESCRIPTION
Display help for csdx.
```

_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.35/src/commands/help.ts)_
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.36/src/commands/help.ts)_
<!-- commandsstop -->
2 changes: 1 addition & 1 deletion packages/contentstack-clone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dependencies": {
"@colors/colors": "^1.6.0",
"@contentstack/cli-cm-export": "~2.0.0-beta.3",
"@contentstack/cli-cm-import": "~2.0.0-beta.2",
"@contentstack/cli-cm-import": "~2.0.0-beta.3",
"@contentstack/cli-command": "~1.6.1",
"@contentstack/cli-utilities": "~1.15.0",
"@oclif/core": "^4.3.0",
Expand Down
93 changes: 10 additions & 83 deletions packages/contentstack-import/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ $ npm install -g @contentstack/cli-cm-import
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-import/2.0.0-beta.2 darwin-arm64 node-v24.11.1
@contentstack/cli-cm-import/2.0.0-beta.3 darwin-arm64 node-v24.11.1
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand All @@ -58,25 +58,20 @@ USAGE
# Commands

<!-- commands -->
* [`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)
* [`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)
* [`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)

## `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 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]`

Import content from a stack

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

FLAGS
-B, --branch=<value> 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.
-a, --alias=<value> The management token of the destination stack where you will import the
content.
-b, --backup-dir=<value> [optional] Backup directory name when using specific module.
-c, --config=<value> [optional] The path of the configuration JSON file containing all the options
for a single run.
-d, --data-dir=<value> The path or the location in your file system where the content, you intend to
Expand All @@ -85,89 +80,24 @@ FLAGS
particular branch. For example, “-d
"C:\Users\Name\Desktop\cli\content\branch_name"
-k, --stack-api-key=<value> API Key of the target stack
-m, --module=<value> [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.
-y, --yes [optional] Force override all Marketplace prompts.
--backup-dir=<value> [optional] Backup directory name when using specific module.
--branch=<value> 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.
--branch-alias=<value> Specify the branch alias where you want to import your content. If not
specified, the content is imported into the main branch by default.
--exclude-global-modules Excludes the branch-independent module from the import operation.
--import-webhook-status=<option> [default: disable] [default: disable] (optional) This webhook state keeps the
same state of webhooks as the source stack. <options: disable|current>
<options: disable|current>
--personalize-project-name=<value> (optional) Provide a unique name for the Personalize project.
--replace-existing Replaces the existing module in the target stack.
--skip-app-recreation (optional) Skips the recreation of private apps if they already exist.
--skip-assets-publish Skips asset publishing during the import process.
--skip-audit Skips the audit fix that occurs during an import operation.
--skip-entries-publish Skips entry publishing during the import process
--skip-existing Skips the module exists warning messages.

DESCRIPTION
Import content from a stack

ALIASES
$ csdx cm:import

EXAMPLES
$ csdx cm:stacks:import --stack-api-key <stack_api_key> --data-dir <path/of/export/destination/dir>

$ csdx cm:stacks:import --config <path/of/config/dir>

$ csdx cm:stacks:import --module <single module name>

$ csdx cm:stacks:import --module <single module name> --backup-dir <backup dir>

$ csdx cm:stacks:import --alias <management_token_alias>

$ csdx cm:stacks:import --alias <management_token_alias> --data-dir <path/of/export/destination/dir>

$ csdx cm:stacks:import --alias <management_token_alias> --config <path/of/config/file>

$ csdx cm:stacks:import --branch <branch name> --yes --skip-audit
```

## `csdx cm:stacks:import [-c <value>] [-k <value>] [-d <value>] [-a <value>] [--module <value>] [--backup-dir <value>] [--branch <value>] [--import-webhook-status disable|current]`

Import content from a stack

```
USAGE
$ csdx cm:stacks:import [-c <value>] [-k <value>] [-d <value>] [-a <value>] [--module <value>] [--backup-dir
<value>] [--branch <value>] [--import-webhook-status disable|current]

FLAGS
-B, --branch=<value> 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.
-a, --alias=<value> The management token of the destination stack where you will import the
content.
-b, --backup-dir=<value> [optional] Backup directory name when using specific module.
-c, --config=<value> [optional] The path of the configuration JSON file containing all the options
for a single run.
-d, --data-dir=<value> 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"
-k, --stack-api-key=<value> API Key of the target stack
-m, --module=<value> [optional] Specify the module to import into the target stack. If not
--module=<value> [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.
-y, --yes [optional] Force override all Marketplace prompts.
--branch-alias=<value> Specify the branch alias where you want to import your content. If not
specified, the content is imported into the main branch by default.
--exclude-global-modules Excludes the branch-independent module from the import operation.
--import-webhook-status=<option> [default: disable] [default: disable] (optional) This webhook state keeps the
same state of webhooks as the source stack. <options: disable|current>
<options: disable|current>
--personalize-project-name=<value> (optional) Provide a unique name for the Personalize project.
--replace-existing Replaces the existing module in the target stack.
--skip-app-recreation (optional) Skips the recreation of private apps if they already exist.
--skip-assets-publish Skips asset publishing during the import process.
--skip-audit Skips the audit fix that occurs during an import operation.
--skip-entries-publish Skips entry publishing during the import process
Expand All @@ -176,9 +106,6 @@ FLAGS
DESCRIPTION
Import content from a stack

ALIASES
$ csdx cm:import

EXAMPLES
$ csdx cm:stacks:import --stack-api-key <stack_api_key> --data-dir <path/of/export/destination/dir>

Expand Down
8 changes: 2 additions & 6 deletions packages/contentstack-import/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-cm-import",
"description": "Contentstack CLI plugin to import content into stack",
"version": "2.0.0-beta.2",
"version": "2.0.0-beta.3",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
Expand Down Expand Up @@ -86,12 +86,8 @@
"repositoryPrefix": "<%- repo %>/blob/main/packages/contentstack-import/<%- commandPath %>"
},
"csdxConfig": {
"expiredCommands": {
"cm:import": "csdx cm:stacks:import"
},
"shortCommandName": {
"cm:stacks:import": "IMPRT",
"cm:import": "O-IMPRT"
"cm:stacks:import": "IMPRT"
}
},
"repository": "https://github.com/contentstack/cli"
Expand Down
40 changes: 2 additions & 38 deletions packages/contentstack-import/src/commands/cm/stacks/import.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Command } from '@contentstack/cli-command';
import {
messageHandler,
printFlagDeprecation,
managementSDKClient,
flags,
FlagInput,
Expand Down Expand Up @@ -38,21 +37,10 @@ export default class ImportCommand extends Command {
char: 'c',
description: '[optional] The path of the configuration JSON file containing all the options for a single run.',
}),
'stack-uid': flags.string({
char: 's',
description: 'API key of the target stack.',
hidden: true,
parse: printFlagDeprecation(['-s', '--stack-uid'], ['-k', '--stack-api-key']),
}),
'stack-api-key': flags.string({
char: 'k',
description: 'API Key of the target stack',
}),
data: flags.string({
description: 'path and location where data is stored',
hidden: true,
parse: printFlagDeprecation(['--data'], ['--data-dir']),
}),
'data-dir': flags.string({
char: 'd',
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"`,
Expand All @@ -61,39 +49,22 @@ export default class ImportCommand extends Command {
char: 'a',
description: 'The management token of the destination stack where you will import the content.',
}),
'management-token-alias': flags.string({
description: 'alias of the management token',
hidden: true,
parse: printFlagDeprecation(['--management-token-alias'], ['-a', '--alias']),
}),
'auth-token': flags.boolean({
char: 'A',
description: 'to use auth token',
hidden: true,
parse: printFlagDeprecation(['-A', '--auth-token']),
}),
module: flags.string({
required: false,
char: 'm',
description:
'[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.',
parse: printFlagDeprecation(['-m'], ['--module']),
}),
'backup-dir': flags.string({
char: 'b',
description: '[optional] Backup directory name when using specific module.',
parse: printFlagDeprecation(['-b'], ['--backup-dir']),
}),
branch: flags.string({
char: 'B',
description:
"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.",
parse: printFlagDeprecation(['-B'], ['--branch']),
exclusive: ['branch-alias'],
}),
'branch-alias': flags.string({
description:
"Specify the branch alias where you want to import your content. If not specified, the content is imported into the main branch by default.",
'Specify the branch alias where you want to import your content. If not specified, the content is imported into the main branch by default.',
exclusive: ['branch'],
}),
'import-webhook-status': flags.string({
Expand All @@ -108,10 +79,6 @@ export default class ImportCommand extends Command {
required: false,
description: '[optional] Force override all Marketplace prompts.',
}),
'skip-app-recreation': flags.boolean({
description: '(optional) Skips the recreation of private apps if they already exist.',
parse: printFlagDeprecation(['--skip-app-recreation']),
}),
'replace-existing': flags.boolean({
required: false,
description: 'Replaces the existing module in the target stack.',
Expand Down Expand Up @@ -142,10 +109,8 @@ export default class ImportCommand extends Command {
}),
};

static aliases: string[] = ['cm:import'];

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

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

// Note setting host to create cma client
importConfig.host = this.cmaHost;
Expand Down
Loading
Loading