From b801f1c71050bb4e4d5152740e5916d163dd493a Mon Sep 17 00:00:00 2001 From: John Harrington <84741727+harr1424@users.noreply.github.com> Date: Fri, 13 Feb 2026 10:23:25 -0700 Subject: [PATCH] rename flag to emails (#18955) --- .../send/commands/create.command.spec.ts | 8 ++--- .../src/tools/send/commands/create.command.ts | 2 +- .../tools/send/commands/edit.command.spec.ts | 8 ++--- .../src/tools/send/commands/edit.command.ts | 2 +- apps/cli/src/tools/send/send.program.ts | 32 +++++++++++-------- 5 files changed, 29 insertions(+), 23 deletions(-) diff --git a/apps/cli/src/tools/send/commands/create.command.spec.ts b/apps/cli/src/tools/send/commands/create.command.spec.ts index d3702689812..20f4d3e722e 100644 --- a/apps/cli/src/tools/send/commands/create.command.spec.ts +++ b/apps/cli/src/tools/send/commands/create.command.spec.ts @@ -62,7 +62,7 @@ describe("SendCreateCommand", () => { }; const cmdOptions = { - email: ["test@example.com"], + emails: ["test@example.com"], }; sendService.encrypt.mockResolvedValue([ @@ -155,7 +155,7 @@ describe("SendCreateCommand", () => { }; const cmdOptions = { - email: ["test@example.com"], + emails: ["test@example.com"], password: "testPassword123", }; @@ -246,7 +246,7 @@ describe("SendCreateCommand", () => { }; const cmdOptions = { - email: ["cli@example.com"], + emails: ["cli@example.com"], }; const response = await command.run(requestJson, cmdOptions); @@ -282,7 +282,7 @@ describe("SendCreateCommand", () => { }; const cmdOptions = { - email: ["cli@example.com"], + emails: ["cli@example.com"], }; sendService.encrypt.mockResolvedValue([ diff --git a/apps/cli/src/tools/send/commands/create.command.ts b/apps/cli/src/tools/send/commands/create.command.ts index ad4ff9c4e18..41cf5143acc 100644 --- a/apps/cli/src/tools/send/commands/create.command.ts +++ b/apps/cli/src/tools/send/commands/create.command.ts @@ -173,7 +173,7 @@ class Options { this.file = passedOptions?.file; this.text = passedOptions?.text; this.password = passedOptions?.password; - this.emails = passedOptions?.email; + this.emails = passedOptions?.emails; this.hidden = CliUtils.convertBooleanOption(passedOptions?.hidden); this.maxAccessCount = passedOptions?.maxAccessCount != null ? parseInt(passedOptions.maxAccessCount, null) : null; diff --git a/apps/cli/src/tools/send/commands/edit.command.spec.ts b/apps/cli/src/tools/send/commands/edit.command.spec.ts index 5bac63d3821..b72e9fdd512 100644 --- a/apps/cli/src/tools/send/commands/edit.command.spec.ts +++ b/apps/cli/src/tools/send/commands/edit.command.spec.ts @@ -81,7 +81,7 @@ describe("SendEditCommand", () => { const requestJson = encodeRequest(requestData); const cmdOptions = { - email: ["test@example.com"], + emails: ["test@example.com"], }; sendService.encrypt.mockResolvedValue([ @@ -155,7 +155,7 @@ describe("SendEditCommand", () => { const requestJson = encodeRequest(requestData); const cmdOptions = { - email: ["test@example.com"], + emails: ["test@example.com"], password: "testPassword123", }; @@ -239,7 +239,7 @@ describe("SendEditCommand", () => { const requestJson = encodeRequest(requestData); const cmdOptions = { - email: ["cli@example.com"], + emails: ["cli@example.com"], }; const response = await command.run(requestJson, cmdOptions); @@ -277,7 +277,7 @@ describe("SendEditCommand", () => { const requestJson = encodeRequest(requestData); const cmdOptions = { - email: ["cli@example.com"], + emails: ["cli@example.com"], }; sendService.encrypt.mockResolvedValue([ diff --git a/apps/cli/src/tools/send/commands/edit.command.ts b/apps/cli/src/tools/send/commands/edit.command.ts index 0709a33b88f..f3828784979 100644 --- a/apps/cli/src/tools/send/commands/edit.command.ts +++ b/apps/cli/src/tools/send/commands/edit.command.ts @@ -124,6 +124,6 @@ class Options { constructor(passedOptions: Record) { this.itemId = passedOptions?.itemId || passedOptions?.itemid; this.password = passedOptions.password; - this.emails = passedOptions.email; + this.emails = passedOptions.emails; } } diff --git a/apps/cli/src/tools/send/send.program.ts b/apps/cli/src/tools/send/send.program.ts index e40cea4daa9..a2f43bc2df8 100644 --- a/apps/cli/src/tools/send/send.program.ts +++ b/apps/cli/src/tools/send/send.program.ts @@ -57,11 +57,11 @@ export class SendProgram extends BaseProgram { new Option( "--password ", "optional password to access this Send. Can also be specified in JSON.", - ).conflicts("email"), + ).conflicts("emails"), ) .addOption( new Option( - "--email ", + "--emails ", "optional emails to access this Send. Can also be specified in JSON.", ).argParser(parseEmail), ) @@ -85,9 +85,11 @@ export class SendProgram extends BaseProgram { .addCommand(this.removePasswordCommand()) .addCommand(this.deleteCommand()) .action(async (data: string, options: OptionValues) => { - if (options.email) { + if (options.emails) { if (!emailAuthEnabled) { - this.processResponse(Response.error("The --email feature is not currently available.")); + this.processResponse( + Response.error("The --emails feature is not currently available."), + ); return; } } @@ -225,11 +227,13 @@ export class SendProgram extends BaseProgram { }) .action(async (encodedJson: string, options: OptionValues, args: { parent: Command }) => { // subcommands inherit flags from their parent; they cannot override them - const { fullObject = false, email = undefined, password = undefined } = args.parent.opts(); + const { fullObject = false, emails = undefined, password = undefined } = args.parent.opts(); - if (email) { + if (emails) { if (!emailAuthEnabled) { - this.processResponse(Response.error("The --email feature is not currently available.")); + this.processResponse( + Response.error("The --emails feature is not currently available."), + ); return; } } @@ -237,7 +241,7 @@ export class SendProgram extends BaseProgram { const mergedOptions = { ...options, fullObject: fullObject, - email, + emails, password, }; @@ -262,10 +266,12 @@ export class SendProgram extends BaseProgram { }) .action(async (encodedJson: string, options: OptionValues, args: { parent: Command }) => { await this.exitIfLocked(); - const { email = undefined, password = undefined } = args.parent.opts(); - if (email) { + const { emails = undefined, password = undefined } = args.parent.opts(); + if (emails) { if (!emailAuthEnabled) { - this.processResponse(Response.error("The --email feature is not currently available.")); + this.processResponse( + Response.error("The --emails feature is not currently available."), + ); return; } } @@ -288,7 +294,7 @@ export class SendProgram extends BaseProgram { const mergedOptions = { ...options, - email, + emails, password, }; @@ -353,7 +359,7 @@ export class SendProgram extends BaseProgram { file: sendFile, text: sendText, type: type, - emails: options.email ?? undefined, + emails: options.emails ?? undefined, }); return Buffer.from(JSON.stringify(template), "utf8").toString("base64");