1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-19 09:43:23 +00:00

[PM-328] Move Send to Tools (#5104)

* Move send in libs/common

* Move send in libs/angular

* Move send in browser

* Move send in cli

* Move send in desktop

* Move send in web
This commit is contained in:
Daniel James Smith
2023-03-29 16:23:37 +02:00
committed by GitHub
parent e645688f8a
commit e238ea20a9
105 changed files with 328 additions and 321 deletions

View File

@@ -1,3 +0,0 @@
export class SendAccessRequest {
password: string;
}

View File

@@ -1,12 +0,0 @@
import { Send } from "../domain/send";
import { SendRequest } from "./send.request";
export class SendWithIdRequest extends SendRequest {
id: string;
constructor(send: Send) {
super(send);
this.id = send.id;
}
}

View File

@@ -1,48 +0,0 @@
import { SendType } from "../../enums/sendType";
import { SendFileApi } from "../api/send-file.api";
import { SendTextApi } from "../api/send-text.api";
import { Send } from "../domain/send";
export class SendRequest {
type: SendType;
fileLength?: number;
name: string;
notes: string;
key: string;
maxAccessCount?: number;
expirationDate: string;
deletionDate: string;
text: SendTextApi;
file: SendFileApi;
password: string;
disabled: boolean;
hideEmail: boolean;
constructor(send: Send, fileLength?: number) {
this.type = send.type;
this.fileLength = fileLength;
this.name = send.name ? send.name.encryptedString : null;
this.notes = send.notes ? send.notes.encryptedString : null;
this.maxAccessCount = send.maxAccessCount;
this.expirationDate = send.expirationDate != null ? send.expirationDate.toISOString() : null;
this.deletionDate = send.deletionDate != null ? send.deletionDate.toISOString() : null;
this.key = send.key != null ? send.key.encryptedString : null;
this.password = send.password;
this.disabled = send.disabled;
this.hideEmail = send.hideEmail;
switch (this.type) {
case SendType.Text:
this.text = new SendTextApi();
this.text.text = send.text.text != null ? send.text.text.encryptedString : null;
this.text.hidden = send.text.hidden;
break;
case SendType.File:
this.file = new SendFileApi();
this.file.fileName = send.file.fileName != null ? send.file.fileName.encryptedString : null;
break;
default:
break;
}
}
}

View File

@@ -1,8 +1,7 @@
import { SendWithIdRequest } from "../../tools/send/models/request/send-with-id.request";
import { CipherWithIdRequest } from "../../vault/models/request/cipher-with-id.request";
import { FolderWithIdRequest } from "../../vault/models/request/folder-with-id.request";
import { SendWithIdRequest } from "./send-with-id.request";
export class UpdateKeyRequest {
ciphers: CipherWithIdRequest[] = [];
folders: FolderWithIdRequest[] = [];