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

Method restoreCommand

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

Source from the content-addressed store, hash-verified

378 }
379
380 private restoreCommand(): Command {
381 const restoreObjects = ["item"];
382 return new Command("restore")
383 .argument("<object>", "Valid objects are: " + restoreObjects.join(", "))
384 .argument("<id>", "Object's globally unique `id`.")
385 .description("Restores an object from the trash or archive.")
386 .on("--help", () => {
387 writeLn("\n Examples:");
388 writeLn("");
389 writeLn(" bw restore item 7063feab-4b10-472e-b64c-785e2b870b92");
390 writeLn("", true);
391 })
392 .action(async (object, id, cmd) => {
393 if (!this.validateObject(object, restoreObjects)) {
394 return;
395 }
396
397 await this.exitIfLocked();
398 const command = new RestoreCommand(
399 this.serviceContainer.cipherService,
400 this.serviceContainer.accountService,
401 this.serviceContainer.cipherAuthorizationService,
402 this.serviceContainer.cipherArchiveService,
403 );
404 const response = await command.run(object, id);
405 this.processResponse(response);
406 });
407 }
408
409 private shareCommand(commandName: string, deprecated: boolean): Command {
410 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