Skip to content

Commit

Permalink
fixed region
Browse files Browse the repository at this point in the history
  • Loading branch information
shafeeqd959 committed Dec 5, 2024
1 parent 587a9f8 commit c8d2651
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
23 changes: 14 additions & 9 deletions packages/contentstack-import-setup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

It is Contentstack’s CLI plugin to import content in the stack. To learn how to export and import content in Contentstack, refer to the [Migration guide](https://www.contentstack.com/docs/developers/cli/migration/).

[![License](https://img.shields.io/npm/l/@contentstack/cli)](https://github.com/contentstack/cli/blob/main/LICENSE)it -m
[![License](https://img.shields.io/npm/l/@contentstack/cli)](https://github.com/contentstack/cli/blob/main/LICENSE)it -m

<!-- toc -->
* [Usage](#usage)
* [Commands](#commands)

- [Usage](#usage)
- [Commands](#commands)
<!-- tocstop -->

For switching to EU region update the hosts at config/default.js
Expand Down Expand Up @@ -42,6 +43,7 @@ For switching to AZURE-EU region update the hosts at config/default.js
# Usage

<!-- usage -->

```sh-session
$ npm install -g @contentstack/cli-cm-import-setup
$ csdx COMMAND
Expand All @@ -53,21 +55,23 @@ USAGE
$ csdx COMMAND
...
```

<!-- usagestop -->

# Commands

<!-- commands -->
* [`csdx cm:stacks:import [-k <value>] [-d <value>] [-a <value>] [--modules <value,value>]`](#csdx-cmstacksimport--k-value--d-value--a-value---modules-valuevalue)
* [`csdx cm:stacks:import [-k <value>] [-d <value>] [-a <value>] [--modules <value,value>]`](#csdx-cmstacksimport--k-value--d-value--a-value---modules-valuevalue-1)

## `csdx cm:stacks:import [-k <value>] [-d <value>] [-a <value>] [--modules <value,value>]`
- [`csdx cm:stacks:import-setup [-k <value>] [-d <value>] [-a <value>] [--modules <value,value>]`](#csdx-cmstacksimport--k-value--d-value--a-value---modules-valuevalue)
- [`csdx cm:stacks:import-setup [-k <value>] [-d <value>] [-a <value>] [--modules <value,value>]`](#csdx-cmstacksimport--k-value--d-value--a-value---modules-valuevalue-1)

## `csdx cm:stacks:import-setup [-k <value>] [-d <value>] [-a <value>] [--modules <value,value>]`

Import content from a stack

```
USAGE
$ csdx cm:stacks:import [-k <value>] [-d <value>] [-a <value>] [--modules <value,value>]
$ csdx cm:stacks:import-setup [-k <value>] [-d <value>] [-a <value>] [--modules <value,value>]
FLAGS
-a, --alias=<value> alias of the management token
Expand All @@ -86,13 +90,13 @@ EXAMPLES
$ csdx cm:stacks:import-setup --stack-api-key <stack_api_key> --data-dir <path/of/export/destination/dir> --modules <module_name, module_name>
```

## `csdx cm:stacks:import [-k <value>] [-d <value>] [-a <value>] [--modules <value,value>]`
## `csdx cm:stacks:import-setup [-k <value>] [-d <value>] [-a <value>] [--modules <value,value>]`

Import content from a stack

```
USAGE
$ csdx cm:stacks:import [-k <value>] [-d <value>] [-a <value>] [--modules <value,value>]
$ csdx cm:stacks:import-setup [-k <value>] [-d <value>] [-a <value>] [--modules <value,value>]
FLAGS
-a, --alias=<value> alias of the management token
Expand All @@ -112,4 +116,5 @@ EXAMPLES
```

_See code: [src/commands/cm/stacks/import-setup.ts](https://github.com/contentstack/cli/blob/main/packages/contentstack-import-setup/src/commands/cm/stacks/import-setup.ts)_

<!-- commandsstop -->
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,18 @@ export default class ImportSetupCommand extends Command {
}),
};

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

static usage: string = 'cm:stacks:import [-k <value>] [-d <value>] [-a <value>] [--modules <value,value>]';
static usage: string = 'cm:stacks:import-setup [-k <value>] [-d <value>] [-a <value>] [--modules <value,value>]';

async run(): Promise<void> {
try {
const { flags } = await this.parse(ImportSetupCommand);
let importSetupConfig = await setupImportConfig(flags);
// Note setting host to create cma client
importSetupConfig.host = this.cmaHost;
importSetupConfig.region = this.region;
importSetupConfig.developerHubBaseUrl = this.developerHubUrl;
const managementAPIClient: ContentstackClient = await managementSDKClient(importSetupConfig);
const importSetup = new ImportSetup(importSetupConfig, managementAPIClient);
await importSetup.start();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export default interface ImportConfig extends DefaultConfig, ExternalConfig {
useBackedupDir?: string;
backupDir: string;
createBackupDir?: string;
region: any;
}

type branch = {
Expand Down

0 comments on commit c8d2651

Please sign in to comment.