Skip to content

Commit

Permalink
Adds 'createReportFile' option for CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
Enngage committed Dec 12, 2024
1 parent 9e0d1d6 commit 9bb79a5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ You may migrate content (items & asset) between Kontent.ai environments. For mig
| **targetApiKey** | Management API key of target environment **(required)** |
| **language** | Codename of language that items will be exported in **(required)** |
| **items** | Comma separated list of items that will be exported **(required)** |
| force | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false` |
| force | Can be used to disable confirmation prompts. Available options: `true` & `false`. Defaults to `false` |

## Migrate CLI

Expand All @@ -77,13 +77,14 @@ kontent-ai-migration-toolkit migrate --targetEnvironmentId=x --targetApiKey=x --
## Configuration

| Config | Value |
| ----------------------- | ----------------------------------------------------------------------------------------------------- |
| **targetEnvironmentId** | Id of Kontent.ai environment **(required)** |
| **targetApiKey** | Management API key **(required)** |
| **filename** | Name of the zip file **(required)** |
| baseUrl | Custom base URL for Kontent.ai API calls |
| force | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false` |
| Config | Value |
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| **targetEnvironmentId** | Id of Kontent.ai environment **(required)** |
| **targetApiKey** | Management API key **(required)** |
| **filename** | Name of the zip file **(required)** |
| baseUrl | Custom base URL for Kontent.ai API calls |
| force | Can be used to disable confirmation prompts. Options: `true` & `false`. Defaults to `false` |
| createReportFile | When enabled, a detailed `json` file will be created in current dir with import details. Options: `true` & `false`. Defaults to `false` |

## Import CLI

Expand Down
4 changes: 3 additions & 1 deletion lib/node/cli/actions/import-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export async function importActionAsync(argsFetcher: CliArgumentsFetcher): Promi
const environmentId = argsFetcher.getRequiredArgumentValue('targetEnvironmentId');
const apiKey = argsFetcher.getRequiredArgumentValue('targetApiKey');
const baseUrl = argsFetcher.getOptionalArgumentValue('baseUrl');
const createReportFile = argsFetcher.getBooleanArgumentValue('createReportFile', false);
const force = argsFetcher.getBooleanArgumentValue('force', false);
const filename = argsFetcher.getOptionalArgumentValue('filename') ?? defaultZipFilename;

Expand All @@ -27,7 +28,8 @@ export async function importActionAsync(argsFetcher: CliArgumentsFetcher): Promi
data: importData,
baseUrl: baseUrl,
environmentId: environmentId,
apiKey: apiKey
apiKey: apiKey,
createReportFile: createReportFile
});

log.log({ type: 'completed', message: `Import has been successful` });
Expand Down

0 comments on commit 9bb79a5

Please sign in to comment.