mirror of
https://github.com/bitwarden/browser
synced 2025-12-19 09:43:23 +00:00
Some groundwork for Send (#192)
* send work * New method to update the last used index (#184) Instead of updating it every time you call getNext(), it will be updated in a separate call, to avoid updating the index when the cipher did not auto-fill correctly (e.g wrong frame) Fixes #1392 * added OnlyOrg to PolicyType enum (#183) * [Require SSO] Add policy type enumeration (#186) * Added SsoAuthentication policy type * Updated policy type name // added comments for clarification of what each type controls * [SSO] New user provision flow (#173) * Initial commit of new user sso flow * Adjusted stateSplit conditional per review * Add logging to lowdb storage service (#188) * Fix lint errors/warnings (#187) * remove password api * access id * makeSendKey Co-authored-by: Josep Marí <xusoo@users.noreply.github.com> Co-authored-by: Addison Beck <abeck@bitwarden.com> Co-authored-by: Vincent Salucci <26154748+vincentsalucci@users.noreply.github.com> Co-authored-by: Chad Scharf <3904944+cscharf@users.noreply.github.com>
This commit is contained in:
46
src/models/request/sendRequest.ts
Normal file
46
src/models/request/sendRequest.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
import { SendType } from '../../enums/sendType';
|
||||
|
||||
import { SendFileApi } from '../api/sendFileApi'
|
||||
import { SendTextApi } from '../api/sendTextApi';
|
||||
|
||||
import { Send } from '../domain/send';
|
||||
|
||||
export class SendRequest {
|
||||
type: SendType;
|
||||
name: string;
|
||||
notes: string;
|
||||
key: string;
|
||||
maxAccessCount?: number;
|
||||
expirationDate: string;
|
||||
deletionDate: string;
|
||||
text: SendTextApi;
|
||||
file: SendFileApi;
|
||||
password: string;
|
||||
disabled: boolean;
|
||||
|
||||
constructor(send: Send) {
|
||||
this.type = send.type;
|
||||
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;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user