()
| 349 | } |
| 350 | |
| 351 | private archiveCommand(): Command { |
| 352 | const archiveObjects = ["item"]; |
| 353 | return new Command("archive") |
| 354 | .argument("<object>", "Valid objects are: " + archiveObjects.join(", ")) |
| 355 | .argument("<id>", "Object's globally unique `id`.") |
| 356 | .description("Archive an object from the vault.") |
| 357 | .on("--help", () => { |
| 358 | writeLn("\n Examples:"); |
| 359 | writeLn(""); |
| 360 | writeLn(" bw archive item 7063feab-4b10-472e-b64c-785e2b870b92"); |
| 361 | writeLn("", true); |
| 362 | }) |
| 363 | .action(async (object, id) => { |
| 364 | if (!this.validateObject(object, archiveObjects)) { |
| 365 | return; |
| 366 | } |
| 367 | |
| 368 | await this.exitIfLocked(); |
| 369 | const command = new ArchiveCommand( |
| 370 | this.serviceContainer.cipherService, |
| 371 | this.serviceContainer.accountService, |
| 372 | this.serviceContainer.cipherArchiveService, |
| 373 | this.serviceContainer.billingAccountProfileStateService, |
| 374 | ); |
| 375 | const response = await command.run(object, id); |
| 376 | this.processResponse(response); |
| 377 | }); |
| 378 | } |
| 379 | |
| 380 | private restoreCommand(): Command { |
| 381 | const restoreObjects = ["item"]; |
no test coverage detected