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

Method editCommand

apps/cli/src/tools/send/send.program.ts:238–283  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

236 }
237
238 private editCommand(): Command {
239 return new Command("edit")
240 .argument(
241 "[encodedJson]",
242 "Updated JSON object to save. If not provided, encodedJson is read from stdin.",
243 )
244 .description("edit a Send")
245 .option("--itemid <itemid>", "Overrides the itemId provided in [encodedJson]")
246 .on("--help", () => {
247 writeLn("");
248 writeLn("Note:");
249 writeLn(" You cannot update a File-type Send's file. Just delete and remake it");
250 writeLn("", true);
251 })
252 .action(async (encodedJson: string, options: OptionValues, args: { parent: Command }) => {
253 await this.exitIfLocked();
254 const { emails = undefined, password = undefined } = args.parent.opts();
255
256 const getCmd = new SendGetCommand(
257 this.serviceContainer.sendService,
258 this.serviceContainer.environmentService,
259 this.serviceContainer.searchService,
260 this.serviceContainer.encryptService,
261 this.serviceContainer.apiService,
262 this.serviceContainer.accountService,
263 this.serviceContainer.sendDecryptionService,
264 );
265 const cmd = new SendEditCommand(
266 this.serviceContainer.sendService,
267 getCmd,
268 this.serviceContainer.sendApiService,
269 this.serviceContainer.billingAccountProfileStateService,
270 this.serviceContainer.accountService,
271 this.serviceContainer.sendDecryptionService,
272 );
273
274 const mergedOptions = {
275 ...options,
276 emails,
277 password,
278 };
279
280 const response = await cmd.run(encodedJson, mergedOptions);
281 this.processResponse(response);
282 });
283 }
284
285 private deleteCommand(): Command {
286 return new Command("delete")

Callers 1

sendCommandMethod · 0.95

Calls 4

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

Tested by

no test coverage detected