1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-28 23:33:27 +00:00

WIP explore existing Send attributes and logic

This commit is contained in:
John Harrington
2025-12-24 08:07:47 -07:00
parent 735f885091
commit 69839292b1
5 changed files with 7 additions and 4 deletions

View File

@@ -87,6 +87,7 @@ export class SendCreateCommand {
req.key = null;
req.maxAccessCount = maxAccessCount;
req.emails = emails; //TODO should this be encrypted?
const hasPremium$ = this.accountService.activeAccount$.pipe(
switchMap(({ id }) => this.accountProfileService.hasPremiumFromAnySource$(id)),
@@ -139,7 +140,7 @@ export class SendCreateCommand {
// Add dates from template
encSend.deletionDate = sendView.deletionDate;
encSend.expirationDate = sendView.expirationDate;
encSend.emails = emails && emails.join(",");
encSend.emails = emails && emails.join(","); // TODO should this be encrypted
await this.sendApiService.save([encSend, fileData]);
const newSend = await this.sendService.getFromState(encSend.id);

View File

@@ -116,6 +116,7 @@ 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;

View File

@@ -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.")
@@ -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");

View File

@@ -33,6 +33,7 @@ export class Send extends Domain {
emails: string;
disabled: boolean;
hideEmail: boolean;
// TODO add authType enum
constructor(obj?: SendData) {
super();

View File

@@ -29,6 +29,7 @@ export class SendView implements View {
emails: string[] = [];
disabled = false;
hideEmail = false;
// TODO add AuthType enum
constructor(s?: Send) {
if (!s) {