MCPcopy Create free account
hub / github.com/bitwarden/clients / restoreCommand

Method restoreCommand

apps/cli/src/vault.program.ts:476–503  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

474 }
475
476 private restoreCommand(): Command {
477 const restoreObjects = ["item"];
478 return new Command("restore")
479 .argument("<object>", "Valid objects are: " + restoreObjects.join(", "))
480 .argument("<id>", "Object's globally unique `id`.")
481 .description("Restores an object from the trash or archive.")
482 .on("--help", () => {
483 writeLn("\n Examples:");
484 writeLn("");
485 writeLn(" bw restore item 7063feab-4b10-472e-b64c-785e2b870b92");
486 writeLn("", true);
487 })
488 .action(async (object, id, cmd) => {
489 if (!this.validateObject(object, restoreObjects)) {
490 return;
491 }
492
493 await this.exitIfLocked();
494 const command = new RestoreCommand(
495 this.serviceContainer.cipherService,
496 this.serviceContainer.accountService,
497 this.serviceContainer.cipherAuthorizationService,
498 this.serviceContainer.cipherArchiveService,
499 );
500 const response = await command.run(object, id);
501 this.processResponse(response);
502 });
503 }
504
505 private shareCommand(commandName: string, deprecated: boolean): Command {
506 return new Command(commandName)

Callers 1

registerMethod · 0.95

Calls 5

validateObjectMethod · 0.95
runMethod · 0.95
actionMethod · 0.80
descriptionMethod · 0.45
processResponseMethod · 0.45

Tested by

no test coverage detected