Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
6983929
WIP explore existing Send attributes and logic
harr1424 Dec 24, 2025
68323dd
Merge branch 'main' into PM-24618-CLI-reveal-email-CLI-flag
harr1424 Dec 26, 2025
913a6ad
WIP progress checkpoint Send refactor
harr1424 Dec 26, 2025
e8794cf
send creation integrated with server and returns object containing emโ€ฆ
harr1424 Dec 27, 2025
e2659d6
Claude! Review my code!
harr1424 Dec 29, 2025
705bc2b
WIP respond to Claude & add tests
harr1424 Dec 30, 2025
5ea4414
Merge branch 'main' into PM-24618-CLI-reveal-email-CLI-flag
harr1424 Dec 30, 2025
0fd81fa
improve mutual exclusion check for create with emails and password
harr1424 Dec 30, 2025
07eb16d
respond to review comments
harr1424 Dec 30, 2025
51f920d
Merge branch 'main' into PM-24618-CLI-reveal-email-CLI-flag
harr1424 Jan 9, 2026
f31aca2
[PM-21774] Adjust icon and tooltip for protected Sends on the Sends lโ€ฆ
mcamirault Jan 9, 2026
4d486aa
Merge branch 'main' into tools/pm-21774/send-list-page-updates
mcamirault Jan 9, 2026
94b4b11
[PM-21774] Update Sent table UI stories
mcamirault Jan 9, 2026
06bc0d5
[PM-21774] Fix Send table UI story
mcamirault Jan 9, 2026
0f611a7
[PM-21774] Merge changes from main and resolve conflicts
mcamirault Jan 12, 2026
70a222b
merge origin/tools/pm-21774/send-list-page-updates
harr1424 Jan 15, 2026
42691b7
Merge remote-tracking branch 'origin/main' into PM-23108-CLI-Add-emaiโ€ฆ
harr1424 Jan 15, 2026
ff81b34
fix eslint issue
harr1424 Jan 15, 2026
c8c7f8b
resolve eslint errors
harr1424 Jan 15, 2026
02a3b6b
Merge branch 'main' into PM-24618-CLI-reveal-email-CLI-flag
harr1424 Jan 15, 2026
d27a9b4
fix strict typing errors
harr1424 Jan 15, 2026
6014a7d
Merge branch 'main' into PM-24618-CLI-reveal-email-CLI-flag
harr1424 Jan 15, 2026
347784d
gate usage of send email field in create and edit behind SendEmailOTPโ€ฆ
harr1424 Jan 16, 2026
aa241bf
re-implement feature flag using existing pattern
harr1424 Jan 16, 2026
86f1c6f
trim password whitespace in edit command
harr1424 Jan 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions apps/cli/src/tools/send/commands/create.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { getUserId } from "@bitwarden/common/auth/services/account.service";
import { BillingAccountProfileStateService } from "@bitwarden/common/billing/abstractions/account/billing-account-profile-state.service";
import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service";
import { SendType } from "@bitwarden/common/tools/send/enums/send-type";
import { AuthType } from "@bitwarden/common/tools/send/models/domain/send";
import { SendApiService } from "@bitwarden/common/tools/send/services/send-api.service.abstraction";
import { SendService } from "@bitwarden/common/tools/send/services/send.service.abstraction";
import { NodeUtils } from "@bitwarden/node/node-utils";
Expand Down Expand Up @@ -87,6 +88,15 @@ export class SendCreateCommand {

req.key = null;
req.maxAccessCount = maxAccessCount;
req.emails = emails;

if (emails != null && emails.length > 0) {
req.authType = AuthType.Email;
} else if (password != null && password.trim().length > 0) {
req.authType = AuthType.Password;
} else {
req.authType = AuthType.None;
}

const hasPremium$ = this.accountService.activeAccount$.pipe(
switchMap(({ id }) => this.accountProfileService.hasPremiumFromAnySource$(id)),
Expand Down
4 changes: 4 additions & 0 deletions apps/cli/src/tools/send/models/send.response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// @ts-strict-ignore
import { Utils } from "@bitwarden/common/platform/misc/utils";
import { SendType } from "@bitwarden/common/tools/send/enums/send-type";
import { AuthType } from "@bitwarden/common/tools/send/models/domain/send";
import { SendView } from "@bitwarden/common/tools/send/models/view/send.view";

import { BaseResponse } from "../../../models/response/base.response";
Expand Down Expand Up @@ -92,6 +93,7 @@ export class SendResponse implements BaseResponse {
emails?: Array<string>;
disabled: boolean;
hideEmail: boolean;
authType: AuthType;

constructor(o?: SendView, webVaultUrl?: string) {
if (o == null) {
Expand All @@ -116,8 +118,10 @@ export class SendResponse implements BaseResponse {
this.deletionDate = o.deletionDate;
this.expirationDate = o.expirationDate;
this.passwordSet = o.password != null;
this.emails = o.emails ?? [];
this.disabled = o.disabled;
this.hideEmail = o.hideEmail;
this.authType = o.authType;

if (o.type === SendType.Text && o.text != null) {
this.text = new SendTextResponse(o.text);
Expand Down
5 changes: 2 additions & 3 deletions apps/cli/src/tools/send/send.program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ export class SendProgram extends BaseProgram {
new Option(
"--email <email>",
"optional emails to access this Send. Can also be specified in JSON.",
)
.argParser(parseEmail)
.hideHelp(),
).argParser(parseEmail),
)
.option("-a, --maxAccessCount <amount>", "The amount of max possible accesses.")
.option("--hidden", "Hide <data> in web by default. Valid only if --file is not set.")
Expand Down Expand Up @@ -328,6 +326,7 @@ export class SendProgram extends BaseProgram {
file: sendFile,
text: sendText,
type: type,
emails: options.email ?? undefined,
});

return Buffer.from(JSON.stringify(template), "utf8").toString("base64");
Expand Down
4 changes: 4 additions & 0 deletions libs/common/src/tools/send/models/data/send.data.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// FIXME: Update this file to be type safe and remove this and next line
// @ts-strict-ignore
import { AuthType } from "@bitwarden/common/tools/send/models/domain/send";

import { SendType } from "../../enums/send-type";
import { SendResponse } from "../response/send.response";

Expand All @@ -24,6 +26,7 @@ export class SendData {
emails: string;
disabled: boolean;
hideEmail: boolean;
authType: AuthType;

constructor(response?: SendResponse) {
if (response == null) {
Expand All @@ -45,6 +48,7 @@ export class SendData {
this.emails = response.emails;
this.disabled = response.disable;
this.hideEmail = response.hideEmail;
this.authType = response.authType;

switch (this.type) {
case SendType.Text:
Expand Down
6 changes: 5 additions & 1 deletion libs/common/src/tools/send/models/domain/send.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { UserKey } from "../../../../types/key";
import { SendType } from "../../enums/send-type";
import { SendData } from "../data/send.data";

import { Send } from "./send";
import { AuthType, Send } from "./send";
import { SendText } from "./send-text";

describe("Send", () => {
Expand Down Expand Up @@ -42,6 +42,7 @@ describe("Send", () => {
emails: null!,
disabled: false,
hideEmail: true,
authType: AuthType.None,
};

mockContainerService();
Expand Down Expand Up @@ -94,6 +95,7 @@ describe("Send", () => {
emails: null!,
disabled: false,
hideEmail: true,
authType: AuthType.None,
});
});

Expand All @@ -118,6 +120,7 @@ describe("Send", () => {
send.password = "password";
send.disabled = false;
send.hideEmail = true;
send.authType = AuthType.None;

const encryptService = mock<EncryptService>();
const keyService = mock<KeyService>();
Expand Down Expand Up @@ -157,6 +160,7 @@ describe("Send", () => {
password: "password",
disabled: false,
hideEmail: true,
authType: AuthType.None,
});
});
});
10 changes: 10 additions & 0 deletions libs/common/src/tools/send/models/domain/send.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ import { SendView } from "../view/send.view";
import { SendFile } from "./send-file";
import { SendText } from "./send-text";

export const AuthType = Object.freeze({
Email: 0,
Password: 1,
None: 2,
} as const);

export type AuthType = (typeof AuthType)[keyof typeof AuthType];

export class Send extends Domain {
id: string;
accessId: string;
Expand All @@ -33,6 +41,7 @@ export class Send extends Domain {
emails: string;
disabled: boolean;
hideEmail: boolean;
authType: AuthType;

constructor(obj?: SendData) {
super();
Expand Down Expand Up @@ -63,6 +72,7 @@ export class Send extends Domain {
this.deletionDate = obj.deletionDate != null ? new Date(obj.deletionDate) : null;
this.expirationDate = obj.expirationDate != null ? new Date(obj.expirationDate) : null;
this.hideEmail = obj.hideEmail;
this.authType = obj.authType;

switch (this.type) {
case SendType.Text:
Expand Down
4 changes: 4 additions & 0 deletions libs/common/src/tools/send/models/response/send.response.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// FIXME: Update this file to be type safe and remove this and next line
// @ts-strict-ignore
import { AuthType } from "@bitwarden/common/tools/send/models/domain/send";

import { BaseResponse } from "../../../../models/response/base.response";
import { SendType } from "../../enums/send-type";
import { SendFileApi } from "../api/send-file.api";
Expand All @@ -23,6 +25,7 @@ export class SendResponse extends BaseResponse {
emails: string;
disable: boolean;
hideEmail: boolean;
authType: AuthType;

constructor(response: any) {
super(response);
Expand All @@ -41,6 +44,7 @@ export class SendResponse extends BaseResponse {
this.emails = this.getResponseProperty("Emails");
this.disable = this.getResponseProperty("Disabled") || false;
this.hideEmail = this.getResponseProperty("HideEmail") || false;
this.authType = this.getResponseProperty("AuthType");

const text = this.getResponseProperty("Text");
if (text != null) {
Expand Down
10 changes: 9 additions & 1 deletion libs/common/src/tools/send/models/view/send.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Utils } from "../../../../platform/misc/utils";
import { SymmetricCryptoKey } from "../../../../platform/models/domain/symmetric-crypto-key";
import { DeepJsonify } from "../../../../types/deep-jsonify";
import { SendType } from "../../enums/send-type";
import { Send } from "../domain/send";
import { AuthType, Send } from "../domain/send";

import { SendFileView } from "./send-file.view";
import { SendTextView } from "./send-text.view";
Expand All @@ -29,6 +29,7 @@ export class SendView implements View {
emails: string[] = [];
disabled = false;
hideEmail = false;
authType: AuthType = null;

constructor(s?: Send) {
if (!s) {
Expand All @@ -46,6 +47,13 @@ export class SendView implements View {
this.disabled = s.disabled;
this.password = s.password;
this.hideEmail = s.hideEmail;
this.authType = s.authType;
this.emails = s.emails
? s.emails
.split(",")
.map((e) => e.trim())
.filter((e) => e)
: [];
}

get urlB64Key(): string {
Expand Down
Loading