()
| 445 | } |
| 446 | |
| 447 | private archiveCommand(): Command { |
| 448 | const archiveObjects = ["item"]; |
| 449 | return new Command("archive") |
| 450 | .argument("<object>", "Valid objects are: " + archiveObjects.join(", ")) |
| 451 | .argument("<id>", "Object's globally unique `id`.") |
| 452 | .description("Archive an object from the vault.") |
| 453 | .on("--help", () => { |
| 454 | writeLn("\n Examples:"); |
| 455 | writeLn(""); |
| 456 | writeLn(" bw archive item 7063feab-4b10-472e-b64c-785e2b870b92"); |
| 457 | writeLn("", true); |
| 458 | }) |
| 459 | .action(async (object, id) => { |
| 460 | if (!this.validateObject(object, archiveObjects)) { |
| 461 | return; |
| 462 | } |
| 463 | |
| 464 | await this.exitIfLocked(); |
| 465 | const command = new ArchiveCommand( |
| 466 | this.serviceContainer.cipherService, |
| 467 | this.serviceContainer.accountService, |
| 468 | this.serviceContainer.cipherArchiveService, |
| 469 | this.serviceContainer.billingAccountProfileStateService, |
| 470 | ); |
| 471 | const response = await command.run(object, id); |
| 472 | this.processResponse(response); |
| 473 | }); |
| 474 | } |
| 475 | |
| 476 | private restoreCommand(): Command { |
| 477 | const restoreObjects = ["item"]; |
no test coverage detected