1
0
mirror of https://github.com/bitwarden/jslib synced 2026-01-02 08:33:28 +00:00
Files
jslib/src/models/view/sendView.ts
Kyle Spearrin 0e9e73ce95 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>
2020-11-02 15:58:18 -05:00

50 lines
1.4 KiB
TypeScript

import { SendType } from '../../enums/sendType';
import { Utils } from '../../misc/utils';
import { Send } from '../domain/send';
import { SymmetricCryptoKey } from '../domain/symmetricCryptoKey';
import { SendFileView } from './sendFileView';
import { SendTextView } from './sendTextView';
import { View } from './view';
export class SendView implements View {
id: string = null;
accessId: string = null;
name: string = null;
notes: string = null;
key: ArrayBuffer;
cryptoKey: SymmetricCryptoKey;
type: SendType = null;
text = new SendTextView();
file = new SendFileView();
maxAccessCount?: number = null;
accessCount: number = 0;
revisionDate: Date = null;
deletionDate: Date = null;
expirationDate: Date = null;
password: string = null;
disabled: boolean = false;
constructor(s?: Send) {
if (!s) {
return;
}
this.id = s.id;
this.accessId = s.accessId;
this.type = s.type;
this.maxAccessCount = s.maxAccessCount;
this.accessCount = s.accessCount;
this.revisionDate = s.revisionDate;
this.deletionDate = s.deletionDate;
this.expirationDate = s.expirationDate;
this.disabled = s.disabled;
this.password = s.password;
}
get urlB64Key(): string {
return Utils.fromBufferToUrlB64(this.key);
}
}