From d48373ffbb395a9df53891bc59f516a7ec35c075 Mon Sep 17 00:00:00 2001 From: rajdip-b Date: Wed, 27 Nov 2024 10:31:17 +0530 Subject: [PATCH] fixed cli build issues --- apps/cli/src/commands/secret/rollback.secret.ts | 6 +----- apps/cli/src/commands/secret/update.secret.ts | 8 ++------ apps/cli/src/commands/variable/rollback.variable.ts | 11 +++++------ apps/cli/src/commands/variable/update.variable.ts | 7 ++----- 4 files changed, 10 insertions(+), 22 deletions(-) diff --git a/apps/cli/src/commands/secret/rollback.secret.ts b/apps/cli/src/commands/secret/rollback.secret.ts index d9414548..2282c800 100644 --- a/apps/cli/src/commands/secret/rollback.secret.ts +++ b/apps/cli/src/commands/secret/rollback.secret.ts @@ -55,11 +55,7 @@ export default class RollbackSecret extends BaseCommand { ) if (success) { - Logger.info(`Secret ${data.name} (${data.slug}) updated successfully!`) - Logger.info(`Created at ${data.createdAt}`) - Logger.info(`Updated at ${data.updatedAt}`) - Logger.info(`Note: ${data.note}`) - Logger.info(`rotateAfter: ${data.rotateAfter}`) + Logger.info(`Secret rolled back by ${data.count} versions successfully.`) } else { Logger.error(`Failed to update secret: ${error.message}`) } diff --git a/apps/cli/src/commands/secret/update.secret.ts b/apps/cli/src/commands/secret/update.secret.ts index d31b78e7..281c3d93 100644 --- a/apps/cli/src/commands/secret/update.secret.ts +++ b/apps/cli/src/commands/secret/update.secret.ts @@ -55,7 +55,7 @@ export default class UpdateSecret extends BaseCommand { async action({ args, options }: CommandActionData): Promise { const [secretSlug] = args - const { data, error, success } = + const { error, success } = await ControllerInstance.getInstance().secretController.updateSecret( { secretSlug, @@ -65,11 +65,7 @@ export default class UpdateSecret extends BaseCommand { ) if (success) { - Logger.info(`Secret ${data.name} (${data.slug}) updated successfully!`) - Logger.info(`Created at ${data.createdAt}`) - Logger.info(`Updated at ${data.updatedAt}`) - Logger.info(`Note: ${data.note}`) - Logger.info(`rotateAfter: ${data.rotateAfter}`) + Logger.info('Secret updated successfully') } else { Logger.error(`Failed to update secret: ${error.message}`) } diff --git a/apps/cli/src/commands/variable/rollback.variable.ts b/apps/cli/src/commands/variable/rollback.variable.ts index a5a56d3d..d480b313 100644 --- a/apps/cli/src/commands/variable/rollback.variable.ts +++ b/apps/cli/src/commands/variable/rollback.variable.ts @@ -55,10 +55,9 @@ export default class RollbackVariable extends BaseCommand { ) if (success) { - Logger.info(`Variable ${data.name} (${data.slug}) updated successfully!`) - Logger.info(`Created at ${data.createdAt}`) - Logger.info(`Updated at ${data.updatedAt}`) - Logger.info(`Note: ${data.note}`) + Logger.info( + `Variable rolled back by ${data.count} versions successfully!` + ) } else { Logger.error(`Failed to update variable: ${error.message}`) } @@ -66,13 +65,13 @@ export default class RollbackVariable extends BaseCommand { private async parseInput(options: CommandActionData['options']): Promise<{ environmentSlug: string - version: string + version: number }> { const { environmentSlug, version } = options return { environmentSlug, - version + version: parseInt(version, 10) } } } diff --git a/apps/cli/src/commands/variable/update.variable.ts b/apps/cli/src/commands/variable/update.variable.ts index 15bdd872..b50fc150 100644 --- a/apps/cli/src/commands/variable/update.variable.ts +++ b/apps/cli/src/commands/variable/update.variable.ts @@ -48,7 +48,7 @@ export default class UpdateVariable extends BaseCommand { async action({ args, options }: CommandActionData): Promise { const [variableSlug] = args - const { data, error, success } = + const { error, success } = await ControllerInstance.getInstance().variableController.updateVariable( { variableSlug, @@ -58,10 +58,7 @@ export default class UpdateVariable extends BaseCommand { ) if (success) { - Logger.info(`Variable ${data.name} (${data.slug}) updated successfully!`) - Logger.info(`Created at ${data.createdAt}`) - Logger.info(`Updated at ${data.updatedAt}`) - Logger.info(`Note: ${data.note}`) + Logger.info('Variable updated successfully!') } else { Logger.error(`Failed to update variable: ${error.message}`) }