diff --git a/.talismanrc b/.talismanrc index 5954e5dfd..f09503379 100644 --- a/.talismanrc +++ b/.talismanrc @@ -1,13 +1,5 @@ fileignoreconfig: - filename: pnpm-lock.yaml - checksum: 649aae748e3ae8c157439dc6c7c9ea402cc19b4dab7ca64b7e4d839d1375df53 -- filename: packages/contentstack-audit/src/audit-base-command.ts - checksum: b706ea114a3cb5e4c0e7e163f32ceffa3356a6b0766bf5b8fe387c3c72f44c36 -- filename: packages/contentstack-audit/src/types/content-types.ts - checksum: d16a65415c3184f15a807d58e5858310aeb5633794fc9075e36f89c94da636c3 -- filename: packages/contentstack-audit/src/modules/entries.ts - checksum: 13072df0872f8c098d23f49b02f9e8f3e492ab2f483d67a5ea5e423ab406ad94 -- filename: packages/contentstack-audit/test/unit/modules/entries.test.ts - checksum: 31d9767d87e4e9db54f641e8cb9d3360f591acdaa8b089a83eaa4aacdf0c3a35 - version: '1.0' + checksum: 0b457537758c783fd47916e9b51175f62b1c58dd691e7bda29d687be65bcdbe6 +version: "" diff --git a/packages/contentstack-migration/README.md b/packages/contentstack-migration/README.md index 1755515ea..f2ab22984 100644 --- a/packages/contentstack-migration/README.md +++ b/packages/contentstack-migration/README.md @@ -1,11 +1,11 @@ # @contentstack/cli-migration -The Contentstack CLI’s “Migration” plugin allows developers to automate the content migration process and easily migrate your content from your system to Contentstack. +The Contentstack CLI's "Migration" plugin allows developers to automate the content migration process and easily migrate your content from your system to Contentstack. [![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io) [![Version](https://img.shields.io/npm/v/@contentstack/cli-migration.svg)](https://npmjs.org/package/@contentstack/cli-migration) [![Downloads/week](https://img.shields.io/npm/dw/@contentstack/cli-migration.svg)](https://npmjs.org/package/@contentstack/cli-migration) -[![License](https://img.shields.io/npm/l/@contentstack/cli-migration.svg)](https://github.com/contentstack/cli-plugins/blob/main/packages/contentstack-migration/LICENSE) +[![License](https://img.shields.io/npm/l/@contentstack/cli-migration.svg)](https://github.com/contentstack/cli-plugins/blob/main/LICENSE) * [@contentstack/cli-migration](#contentstackcli-migration) @@ -32,31 +32,30 @@ USAGE # Commands -* [`csdx cm:stacks:migration [-k ] [-a ] [--file-path ] [--branch ] [--config-file ] [--config ] [--multiple]`](#csdx-cmstacksmigration--k-value--a-value---file-path-value---branch-value---config-file-value---config-value---multiple) -* [`csdx cm:stacks:migration [-k ] [-a ] [--file-path ] [--branch ] [--config-file ] [--config ] [--multiple]`](#csdx-cmstacksmigration--k-value--a-value---file-path-value---branch-value---config-file-value---config-value---multiple) +* [`csdx cm:stacks:migration [-k ] [-a ] [--file-path ] [--branch ] [-c ] [--inline-config ] [--multiple]`](#csdx-cmstacksmigration--k-value--a-value---file-path-value---branch-value--c-value---inline-config-value---multiple) -## `csdx cm:stacks:migration [-k ] [-a ] [--file-path ] [--branch ] [--config-file ] [--config ] [--multiple]` +## `csdx cm:stacks:migration [-k ] [-a ] [--file-path ] [--branch ] [-c ] [--inline-config ] [--multiple]` Contentstack migration script. ``` USAGE - $ csdx cm:migration cm:stacks:migration [-k ] [-a ] [--file-path ] [--branch ] - [--config-file ] [--config ] [--multiple] + $ csdx cm:stacks:migration [-k ] [-a ] [--file-path ] [--branch ] + [-c ] [--inline-config ] [--multiple] FLAGS - -a, --alias= Use this flag to add the management token alias. You must use either the --alias flag or - the --stack-api-key flag. - -k, --stack-api-key= Use this flag to add the API key of your stack. You must use either the --stack-api-key - flag or the --alias flag. - --branch= Use this flag to add the branch name where you want to perform the migration. (target - branch name) - --config=... [optional] Inline configuration, :. Passing an external configuration makes - the script re-usable. - --config-file= [optional] Path of the JSON configuration file. - --file-path= Use this flag to provide the path of the file of the migration script. - --multiple This flag helps you to migrate multiple content files in a single instance. Mention the - folder path where your migration script files are stored. + -a, --alias= Use this flag to add the management token alias. You must use either the --alias flag or + the --stack-api-key flag. + -c, --config= [optional] Path of the JSON configuration file. + -k, --stack-api-key= Use this flag to add the API key of your stack. You must use either the --stack-api-key + flag or the --alias flag. + --branch= Use this flag to add the branch name where you want to perform the migration. (target + branch name) + --file-path= Use this flag to provide the path of the file of the migration script. + --inline-config= [optional] Inline configuration, :. Use this to pass key-value pairs + directly on the command line instead of a config file. + --multiple This flag helps you to migrate multiple content files in a single instance. Mention the + folder path where your migration script files are stored. DESCRIPTION Contentstack migration script. @@ -69,54 +68,11 @@ EXAMPLES $ csdx cm:migration --file-path -k --branch - $ csdx cm:migration --config : : ... --file-path + $ csdx cm:migration --inline-config : : ... --file-path - $ csdx cm:migration --config-file --file-path + $ csdx cm:migration --config --file-path - $ csdx cm:migration --multiple --file-path - - $ csdx cm:migration --alias --file-path -``` - -## `csdx cm:stacks:migration [-k ] [-a ] [--file-path ] [--branch ] [--config-file ] [--config ] [--multiple]` - -Contentstack migration script. - -``` -USAGE - $ csdx cm:stacks:migration [-k ] [-a ] [--file-path ] [--branch ] [--config-file ] - [--config ] [--multiple] - -FLAGS - -a, --alias= Use this flag to add the management token alias. You must use either the --alias flag or - the --stack-api-key flag. - -k, --stack-api-key= Use this flag to add the API key of your stack. You must use either the --stack-api-key - flag or the --alias flag. - --branch= Use this flag to add the branch name where you want to perform the migration. (target - branch name) - --config=... [optional] Inline configuration, :. Passing an external configuration makes - the script re-usable. - --config-file= [optional] Path of the JSON configuration file. - --file-path= Use this flag to provide the path of the file of the migration script. - --multiple This flag helps you to migrate multiple content files in a single instance. Mention the - folder path where your migration script files are stored. - -DESCRIPTION - Contentstack migration script. - -ALIASES - $ csdx cm:migration - -EXAMPLES - $ csdx cm:migration --file-path -k - - $ csdx cm:migration --file-path -k --branch - - $ csdx cm:migration --config : : ... --file-path - - $ csdx cm:migration --config-file --file-path - - $ csdx cm:migration --multiple --file-path + $ csdx cm:migration --multiple --file-path $ csdx cm:migration --alias --file-path ``` diff --git a/packages/contentstack-migration/src/commands/cm/stacks/migration.ts b/packages/contentstack-migration/src/commands/cm/stacks/migration.ts index ae1a0a323..423a2f962 100644 --- a/packages/contentstack-migration/src/commands/cm/stacks/migration.ts +++ b/packages/contentstack-migration/src/commands/cm/stacks/migration.ts @@ -43,8 +43,8 @@ export default class MigrationCommand extends Command { static examples: string[] = [ '$ csdx cm:stacks:migration --file-path -k ', '$ csdx cm:stacks:migration --file-path -k --branch ', - '$ csdx cm:stacks:migration --config : : ... --file-path ', - '$ csdx cm:stacks:migration --config-file --file-path ', + '$ csdx cm:migration --inline-config : : ... --file-path ', + '$ csdx cm:migration --config --file-path ', '$ csdx cm:stacks:migration --multiple --file-path ', '$ csdx cm:stacks:migration --alias --file-path ', ]; @@ -67,10 +67,11 @@ export default class MigrationCommand extends Command { branch: flags.string({ description: 'Use this flag to add the branch name where you want to perform the migration. (target branch name)', }), - 'config-file': flags.string({ + config: flags.string({ + char: 'c', description: '[optional] Path of the JSON configuration file.', }), - config: flags.string({ + 'inline-config': flags.string({ description: '[optional] Inline configuration, :. Passing an external configuration makes the script re-usable.', multiple: true, @@ -84,7 +85,7 @@ export default class MigrationCommand extends Command { static aliases: string[] = []; static usage: string = - 'cm:stacks:migration [-k ] [-a ] [--file-path ] [--branch ] [--config-file ] [--config ] [--multiple]'; + 'cm:stacks:migration [-k ] [-a ] [--file-path ] [--branch ] [-c ] [--inline-config ] [--multiple]'; async run(): Promise { // TODO: filePath validation required. @@ -95,7 +96,7 @@ export default class MigrationCommand extends Command { const authtoken = isAuthenticated(); const apiKey = (migrationCommandFlags as any)['stack-api-key']; const alias = (migrationCommandFlags as any)['alias']; - const config = (migrationCommandFlags as any)['config']; + const config = (migrationCommandFlags as any)['inline-config']; if (!authtoken && !alias) { this.log( @@ -112,8 +113,8 @@ export default class MigrationCommand extends Command { // Reset map instance const mapInstance = getMapInstance(); resetMapInstance(mapInstance); - if (migrationCommandFlags['config-file']) { - set('config-path', mapInstance, migrationCommandFlags['config-file']); + if (migrationCommandFlags['config']) { + set('config-path', mapInstance, migrationCommandFlags['config']); } if (Array.isArray(config) && config.length > 0) {