diff --git a/src/content-cli-analyze.ts b/src/content-cli-analyze.ts index 7873588..ccbf822 100644 --- a/src/content-cli-analyze.ts +++ b/src/content-cli-analyze.ts @@ -11,7 +11,7 @@ class Analyze { .command("action-flows") .description("Analyze Action Flows dependencies for a certain package") .option("-p, --profile ", "Profile which you want to use to analyze Action Flows") - .requiredOption("-i, --packageId ", "ID of the package from which you want to export Action Flows") + .requiredOption("--packageId ", "ID of the package from which you want to export Action Flows") .option("-o, --outputToJsonFile", "Output the analyze result in a JSON file") .action(async cmd => { await new ActionFlowCommand().analyzeActionFlows(cmd.packageId, cmd.outputToJsonFile); diff --git a/src/content-cli-export.ts b/src/content-cli-export.ts index 34b00ef..d0032b2 100644 --- a/src/content-cli-export.ts +++ b/src/content-cli-export.ts @@ -43,7 +43,7 @@ export class Export { .command("action-flows") .description("Command to export all Action Flows in a package with their objects and dependencies") .option("-p, --profile ", "Profile which you want to use to export Action Flows") - .requiredOption("-i, --packageId ", "ID of the package from which you want to export Action Flows") + .requiredOption("--packageId ", "ID of the package from which you want to export Action Flows") .option("-f, --file ", "Action flows metadata file (relative path)") .action(async cmd => { await new ActionFlowCommand().exportActionFlows(cmd.packageId, cmd.file); diff --git a/src/content-cli-import.ts b/src/content-cli-import.ts index 476d5aa..df66889 100644 --- a/src/content-cli-import.ts +++ b/src/content-cli-import.ts @@ -48,7 +48,7 @@ export class Import { .command("action-flows") .description("Command to import all Action Flows in a package with their objects and dependencies") .option("-p, --profile ", "Profile which you want to use to import Action Flows") - .requiredOption("-i, --packageId ", "ID of the package to which you want to export Action Flows") + .requiredOption("--packageId ", "ID of the package to which you want to export Action Flows") .requiredOption("-f, --file ", "Exported Action Flows file (relative path)") .requiredOption("-d, --dryRun ", "Execute the import on dry run mode") .option("-o, --outputToJsonFile", "Output the import result in a JSON file") diff --git a/src/services/action-flow/action-flow-service.ts b/src/services/action-flow/action-flow-service.ts index 5abbaa5..f7b1f80 100644 --- a/src/services/action-flow/action-flow-service.ts +++ b/src/services/action-flow/action-flow-service.ts @@ -7,6 +7,8 @@ import * as FormData from "form-data"; import * as fs from "fs"; class ActionFlowService { + private static readonly METADATA_FILE_NAME = "metadata.json"; + public async exportActionFlows(packageId: string, metadataFilePath: string): Promise { const exportedActionFlowsData = await actionFlowApi.exportRawAssets(packageId); const tmpZip: AdmZip = new AdmZip(exportedActionFlowsData); @@ -65,7 +67,7 @@ class ActionFlowService { fileName = fileName + (fileName.endsWith(".json") ? "" : ".json"); const metadata = fileService.readFile(fileName); - zip.addFile("metadata.json", Buffer.from(metadata)); + zip.addFile(ActionFlowService.METADATA_FILE_NAME, Buffer.from(metadata)); } }