1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-02 09:43:29 +00:00
Files
browser/libs/common/src/tools/send/models/data/send.data.ts
Mike Amirault 9f74178928 [PM-21774] Adjust icon and tooltip for protected Sends on the Sends l… (#18293)
* [PM-21774] Adjust icon and tooltip for protected Sends on the Sends list page

* [PM-21774] Update Sent table UI stories

* [PM-21774] Fix Send table UI story
2026-01-15 14:19:43 -05:00

64 lines
1.7 KiB
TypeScript

// FIXME: Update this file to be type safe and remove this and next line
// @ts-strict-ignore
import { AuthType } from "../../types/auth-type";
import { SendType } from "../../types/send-type";
import { SendResponse } from "../response/send.response";
import { SendFileData } from "./send-file.data";
import { SendTextData } from "./send-text.data";
export class SendData {
id: string;
accessId: string;
type: SendType;
authType: AuthType;
name: string;
notes: string;
file: SendFileData;
text: SendTextData;
key: string;
maxAccessCount?: number;
accessCount: number;
revisionDate: string;
expirationDate: string;
deletionDate: string;
password: string;
emails: string;
disabled: boolean;
hideEmail: boolean;
constructor(response?: SendResponse) {
if (response == null) {
return;
}
this.id = response.id;
this.accessId = response.accessId;
this.type = response.type;
this.authType = response.authType;
this.name = response.name;
this.notes = response.notes;
this.key = response.key;
this.maxAccessCount = response.maxAccessCount;
this.accessCount = response.accessCount;
this.revisionDate = response.revisionDate;
this.expirationDate = response.expirationDate;
this.deletionDate = response.deletionDate;
this.password = response.password;
this.emails = response.emails;
this.disabled = response.disable;
this.hideEmail = response.hideEmail;
switch (this.type) {
case SendType.Text:
this.text = new SendTextData(response.text);
break;
case SendType.File:
this.file = new SendFileData(response.file);
break;
default:
break;
}
}
}