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

Method archiveCommand

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

Source from the content-addressed store, hash-verified

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"];

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