mirror of
https://github.com/bitwarden/browser
synced 2026-01-07 11:03:30 +00:00
Split jslib into multiple modules (#363)
* Split jslib into multiple modules
This commit is contained in:
6
common/src/models/request/attachmentRequest.ts
Normal file
6
common/src/models/request/attachmentRequest.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export class AttachmentRequest {
|
||||
fileName: string;
|
||||
key: string;
|
||||
fileSize: number;
|
||||
adminRequest: boolean;
|
||||
}
|
||||
9
common/src/models/request/bitPayInvoiceRequest.ts
Normal file
9
common/src/models/request/bitPayInvoiceRequest.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export class BitPayInvoiceRequest {
|
||||
userId: string;
|
||||
organizationId: string;
|
||||
credit: boolean;
|
||||
amount: number;
|
||||
returnUrl: string;
|
||||
name: string;
|
||||
email: string;
|
||||
}
|
||||
9
common/src/models/request/cipherBulkDeleteRequest.ts
Normal file
9
common/src/models/request/cipherBulkDeleteRequest.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export class CipherBulkDeleteRequest {
|
||||
ids: string[];
|
||||
organizationId: string;
|
||||
|
||||
constructor(ids: string[], organizationId?: string) {
|
||||
this.ids = ids == null ? [] : ids;
|
||||
this.organizationId = organizationId;
|
||||
}
|
||||
}
|
||||
9
common/src/models/request/cipherBulkMoveRequest.ts
Normal file
9
common/src/models/request/cipherBulkMoveRequest.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export class CipherBulkMoveRequest {
|
||||
ids: string[];
|
||||
folderId: string;
|
||||
|
||||
constructor(ids: string[], folderId: string) {
|
||||
this.ids = ids == null ? [] : ids;
|
||||
this.folderId = folderId;
|
||||
}
|
||||
}
|
||||
7
common/src/models/request/cipherBulkRestoreRequest.ts
Normal file
7
common/src/models/request/cipherBulkRestoreRequest.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export class CipherBulkRestoreRequest {
|
||||
ids: string[];
|
||||
|
||||
constructor(ids: string[]) {
|
||||
this.ids = ids == null ? [] : ids;
|
||||
}
|
||||
}
|
||||
18
common/src/models/request/cipherBulkShareRequest.ts
Normal file
18
common/src/models/request/cipherBulkShareRequest.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { CipherWithIdRequest } from './cipherWithIdRequest';
|
||||
|
||||
import { Cipher } from '../domain/cipher';
|
||||
|
||||
export class CipherBulkShareRequest {
|
||||
ciphers: CipherWithIdRequest[];
|
||||
collectionIds: string[];
|
||||
|
||||
constructor(ciphers: Cipher[], collectionIds: string[]) {
|
||||
if (ciphers != null) {
|
||||
this.ciphers = [];
|
||||
ciphers.forEach(c => {
|
||||
this.ciphers.push(new CipherWithIdRequest(c));
|
||||
});
|
||||
}
|
||||
this.collectionIds = collectionIds;
|
||||
}
|
||||
}
|
||||
7
common/src/models/request/cipherCollectionsRequest.ts
Normal file
7
common/src/models/request/cipherCollectionsRequest.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export class CipherCollectionsRequest {
|
||||
collectionIds: string[];
|
||||
|
||||
constructor(collectionIds: string[]) {
|
||||
this.collectionIds = collectionIds == null ? [] : collectionIds;
|
||||
}
|
||||
}
|
||||
13
common/src/models/request/cipherCreateRequest.ts
Normal file
13
common/src/models/request/cipherCreateRequest.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { CipherRequest } from './cipherRequest';
|
||||
|
||||
import { Cipher } from '../domain/cipher';
|
||||
|
||||
export class CipherCreateRequest {
|
||||
cipher: CipherRequest;
|
||||
collectionIds: string[];
|
||||
|
||||
constructor(cipher: Cipher) {
|
||||
this.cipher = new CipherRequest(cipher);
|
||||
this.collectionIds = cipher.collectionIds;
|
||||
}
|
||||
}
|
||||
151
common/src/models/request/cipherRequest.ts
Normal file
151
common/src/models/request/cipherRequest.ts
Normal file
@@ -0,0 +1,151 @@
|
||||
import { CipherRepromptType } from '../../enums/cipherRepromptType';
|
||||
import { CipherType } from '../../enums/cipherType';
|
||||
|
||||
import { Cipher } from '../domain/cipher';
|
||||
|
||||
import { CardApi } from '../api/cardApi';
|
||||
import { FieldApi } from '../api/fieldApi';
|
||||
import { IdentityApi } from '../api/identityApi';
|
||||
import { LoginApi } from '../api/loginApi';
|
||||
import { LoginUriApi } from '../api/loginUriApi';
|
||||
import { SecureNoteApi } from '../api/secureNoteApi';
|
||||
|
||||
import { AttachmentRequest } from './attachmentRequest';
|
||||
import { PasswordHistoryRequest } from './passwordHistoryRequest';
|
||||
|
||||
export class CipherRequest {
|
||||
type: CipherType;
|
||||
folderId: string;
|
||||
organizationId: string;
|
||||
name: string;
|
||||
notes: string;
|
||||
favorite: boolean;
|
||||
login: LoginApi;
|
||||
secureNote: SecureNoteApi;
|
||||
card: CardApi;
|
||||
identity: IdentityApi;
|
||||
fields: FieldApi[];
|
||||
passwordHistory: PasswordHistoryRequest[];
|
||||
// Deprecated, remove at some point and rename attachments2 to attachments
|
||||
attachments: { [id: string]: string; };
|
||||
attachments2: { [id: string]: AttachmentRequest; };
|
||||
lastKnownRevisionDate: Date;
|
||||
reprompt: CipherRepromptType;
|
||||
|
||||
constructor(cipher: Cipher) {
|
||||
this.type = cipher.type;
|
||||
this.folderId = cipher.folderId;
|
||||
this.organizationId = cipher.organizationId;
|
||||
this.name = cipher.name ? cipher.name.encryptedString : null;
|
||||
this.notes = cipher.notes ? cipher.notes.encryptedString : null;
|
||||
this.favorite = cipher.favorite;
|
||||
this.lastKnownRevisionDate = cipher.revisionDate;
|
||||
this.reprompt = cipher.reprompt;
|
||||
|
||||
switch (this.type) {
|
||||
case CipherType.Login:
|
||||
this.login = new LoginApi();
|
||||
this.login.uris = null;
|
||||
this.login.username = cipher.login.username ? cipher.login.username.encryptedString : null;
|
||||
this.login.password = cipher.login.password ? cipher.login.password.encryptedString : null;
|
||||
this.login.passwordRevisionDate = cipher.login.passwordRevisionDate != null ?
|
||||
cipher.login.passwordRevisionDate.toISOString() : null;
|
||||
this.login.totp = cipher.login.totp ? cipher.login.totp.encryptedString : null;
|
||||
this.login.autofillOnPageLoad = cipher.login.autofillOnPageLoad;
|
||||
|
||||
if (cipher.login.uris != null) {
|
||||
this.login.uris = cipher.login.uris.map(u => {
|
||||
const uri = new LoginUriApi();
|
||||
uri.uri = u.uri != null ? u.uri.encryptedString : null;
|
||||
uri.match = u.match != null ? u.match : null;
|
||||
return uri;
|
||||
});
|
||||
}
|
||||
break;
|
||||
case CipherType.SecureNote:
|
||||
this.secureNote = new SecureNoteApi();
|
||||
this.secureNote.type = cipher.secureNote.type;
|
||||
break;
|
||||
case CipherType.Card:
|
||||
this.card = new CardApi();
|
||||
this.card.cardholderName = cipher.card.cardholderName != null ?
|
||||
cipher.card.cardholderName.encryptedString : null;
|
||||
this.card.brand = cipher.card.brand != null ? cipher.card.brand.encryptedString : null;
|
||||
this.card.number = cipher.card.number != null ? cipher.card.number.encryptedString : null;
|
||||
this.card.expMonth = cipher.card.expMonth != null ? cipher.card.expMonth.encryptedString : null;
|
||||
this.card.expYear = cipher.card.expYear != null ? cipher.card.expYear.encryptedString : null;
|
||||
this.card.code = cipher.card.code != null ? cipher.card.code.encryptedString : null;
|
||||
break;
|
||||
case CipherType.Identity:
|
||||
this.identity = new IdentityApi();
|
||||
this.identity.title = cipher.identity.title != null ? cipher.identity.title.encryptedString : null;
|
||||
this.identity.firstName = cipher.identity.firstName != null ?
|
||||
cipher.identity.firstName.encryptedString : null;
|
||||
this.identity.middleName = cipher.identity.middleName != null ?
|
||||
cipher.identity.middleName.encryptedString : null;
|
||||
this.identity.lastName = cipher.identity.lastName != null ?
|
||||
cipher.identity.lastName.encryptedString : null;
|
||||
this.identity.address1 = cipher.identity.address1 != null ?
|
||||
cipher.identity.address1.encryptedString : null;
|
||||
this.identity.address2 = cipher.identity.address2 != null ?
|
||||
cipher.identity.address2.encryptedString : null;
|
||||
this.identity.address3 = cipher.identity.address3 != null ?
|
||||
cipher.identity.address3.encryptedString : null;
|
||||
this.identity.city = cipher.identity.city != null ? cipher.identity.city.encryptedString : null;
|
||||
this.identity.state = cipher.identity.state != null ? cipher.identity.state.encryptedString : null;
|
||||
this.identity.postalCode = cipher.identity.postalCode != null ?
|
||||
cipher.identity.postalCode.encryptedString : null;
|
||||
this.identity.country = cipher.identity.country != null ?
|
||||
cipher.identity.country.encryptedString : null;
|
||||
this.identity.company = cipher.identity.company != null ?
|
||||
cipher.identity.company.encryptedString : null;
|
||||
this.identity.email = cipher.identity.email != null ? cipher.identity.email.encryptedString : null;
|
||||
this.identity.phone = cipher.identity.phone != null ? cipher.identity.phone.encryptedString : null;
|
||||
this.identity.ssn = cipher.identity.ssn != null ? cipher.identity.ssn.encryptedString : null;
|
||||
this.identity.username = cipher.identity.username != null ?
|
||||
cipher.identity.username.encryptedString : null;
|
||||
this.identity.passportNumber = cipher.identity.passportNumber != null ?
|
||||
cipher.identity.passportNumber.encryptedString : null;
|
||||
this.identity.licenseNumber = cipher.identity.licenseNumber != null ?
|
||||
cipher.identity.licenseNumber.encryptedString : null;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (cipher.fields != null) {
|
||||
this.fields = cipher.fields.map(f => {
|
||||
const field = new FieldApi();
|
||||
field.type = f.type;
|
||||
field.name = f.name ? f.name.encryptedString : null;
|
||||
field.value = f.value ? f.value.encryptedString : null;
|
||||
return field;
|
||||
});
|
||||
}
|
||||
|
||||
if (cipher.passwordHistory != null) {
|
||||
this.passwordHistory = [];
|
||||
cipher.passwordHistory.forEach(ph => {
|
||||
this.passwordHistory.push({
|
||||
lastUsedDate: ph.lastUsedDate,
|
||||
password: ph.password ? ph.password.encryptedString : null,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if (cipher.attachments != null) {
|
||||
this.attachments = {};
|
||||
this.attachments2 = {};
|
||||
cipher.attachments.forEach(attachment => {
|
||||
const fileName = attachment.fileName ? attachment.fileName.encryptedString : null;
|
||||
this.attachments[attachment.id] = fileName;
|
||||
const attachmentRequest = new AttachmentRequest();
|
||||
attachmentRequest.fileName = fileName;
|
||||
if (attachment.key != null) {
|
||||
attachmentRequest.key = attachment.key.encryptedString;
|
||||
}
|
||||
this.attachments2[attachment.id] = attachmentRequest;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
13
common/src/models/request/cipherShareRequest.ts
Normal file
13
common/src/models/request/cipherShareRequest.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { CipherRequest } from './cipherRequest';
|
||||
|
||||
import { Cipher } from '../domain/cipher';
|
||||
|
||||
export class CipherShareRequest {
|
||||
cipher: CipherRequest;
|
||||
collectionIds: string[];
|
||||
|
||||
constructor(cipher: Cipher) {
|
||||
this.cipher = new CipherRequest(cipher);
|
||||
this.collectionIds = cipher.collectionIds;
|
||||
}
|
||||
}
|
||||
12
common/src/models/request/cipherWithIdRequest.ts
Normal file
12
common/src/models/request/cipherWithIdRequest.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { CipherRequest } from './cipherRequest';
|
||||
|
||||
import { Cipher } from '../domain/cipher';
|
||||
|
||||
export class CipherWithIdRequest extends CipherRequest {
|
||||
id: string;
|
||||
|
||||
constructor(cipher: Cipher) {
|
||||
super(cipher);
|
||||
this.id = cipher.id;
|
||||
}
|
||||
}
|
||||
17
common/src/models/request/collectionRequest.ts
Normal file
17
common/src/models/request/collectionRequest.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { Collection } from '../domain/collection';
|
||||
|
||||
import { SelectionReadOnlyRequest } from './selectionReadOnlyRequest';
|
||||
|
||||
export class CollectionRequest {
|
||||
name: string;
|
||||
externalId: string;
|
||||
groups: SelectionReadOnlyRequest[] = [];
|
||||
|
||||
constructor(collection?: Collection) {
|
||||
if (collection == null) {
|
||||
return;
|
||||
}
|
||||
this.name = collection.name ? collection.name.encryptedString : null;
|
||||
this.externalId = collection.externalId;
|
||||
}
|
||||
}
|
||||
3
common/src/models/request/deleteRecoverRequest.ts
Normal file
3
common/src/models/request/deleteRecoverRequest.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export class DeleteRecoverRequest {
|
||||
email: string;
|
||||
}
|
||||
17
common/src/models/request/deviceRequest.ts
Normal file
17
common/src/models/request/deviceRequest.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { DeviceType } from '../../enums/deviceType';
|
||||
|
||||
import { PlatformUtilsService } from '../../abstractions/platformUtils.service';
|
||||
|
||||
export class DeviceRequest {
|
||||
type: DeviceType;
|
||||
name: string;
|
||||
identifier: string;
|
||||
pushToken?: string;
|
||||
|
||||
constructor(appId: string, platformUtilsService: PlatformUtilsService) {
|
||||
this.type = platformUtilsService.getDevice();
|
||||
this.name = platformUtilsService.getDeviceString();
|
||||
this.identifier = appId;
|
||||
this.pushToken = null;
|
||||
}
|
||||
}
|
||||
7
common/src/models/request/deviceTokenRequest.ts
Normal file
7
common/src/models/request/deviceTokenRequest.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export class DeviceTokenRequest {
|
||||
pushToken: string;
|
||||
|
||||
constructor() {
|
||||
this.pushToken = null;
|
||||
}
|
||||
}
|
||||
7
common/src/models/request/emailRequest.ts
Normal file
7
common/src/models/request/emailRequest.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { EmailTokenRequest } from './emailTokenRequest';
|
||||
|
||||
export class EmailRequest extends EmailTokenRequest {
|
||||
newMasterPasswordHash: string;
|
||||
token: string;
|
||||
key: string;
|
||||
}
|
||||
6
common/src/models/request/emailTokenRequest.ts
Normal file
6
common/src/models/request/emailTokenRequest.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { PasswordVerificationRequest } from './passwordVerificationRequest';
|
||||
|
||||
export class EmailTokenRequest extends PasswordVerificationRequest {
|
||||
newEmail: string;
|
||||
masterPasswordHash: string;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export class EmergencyAccessAcceptRequest {
|
||||
token: string;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export class EmergencyAccessConfirmRequest {
|
||||
key: string;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import { EmergencyAccessType } from '../../enums/emergencyAccessType';
|
||||
|
||||
export class EmergencyAccessInviteRequest {
|
||||
email: string;
|
||||
type: EmergencyAccessType;
|
||||
waitTimeDays: number;
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
export class EmergencyAccessPasswordRequest {
|
||||
newMasterPasswordHash: string;
|
||||
key: string;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import { EmergencyAccessType } from '../../enums/emergencyAccessType';
|
||||
|
||||
export class EmergencyAccessUpdateRequest {
|
||||
type: EmergencyAccessType;
|
||||
waitTimeDays: number;
|
||||
keyEncrypted?: string;
|
||||
}
|
||||
7
common/src/models/request/eventRequest.ts
Normal file
7
common/src/models/request/eventRequest.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { EventType } from '../../enums/eventType';
|
||||
|
||||
export class EventRequest {
|
||||
type: EventType;
|
||||
cipherId: string;
|
||||
date: string;
|
||||
}
|
||||
9
common/src/models/request/folderRequest.ts
Normal file
9
common/src/models/request/folderRequest.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Folder } from '../domain/folder';
|
||||
|
||||
export class FolderRequest {
|
||||
name: string;
|
||||
|
||||
constructor(folder: Folder) {
|
||||
this.name = folder.name ? folder.name.encryptedString : null;
|
||||
}
|
||||
}
|
||||
12
common/src/models/request/folderWithIdRequest.ts
Normal file
12
common/src/models/request/folderWithIdRequest.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { FolderRequest } from './folderRequest';
|
||||
|
||||
import { Folder } from '../domain/folder';
|
||||
|
||||
export class FolderWithIdRequest extends FolderRequest {
|
||||
id: string;
|
||||
|
||||
constructor(folder: Folder) {
|
||||
super(folder);
|
||||
this.id = folder.id;
|
||||
}
|
||||
}
|
||||
8
common/src/models/request/groupRequest.ts
Normal file
8
common/src/models/request/groupRequest.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { SelectionReadOnlyRequest } from './selectionReadOnlyRequest';
|
||||
|
||||
export class GroupRequest {
|
||||
name: string;
|
||||
accessAll: boolean;
|
||||
externalId: string;
|
||||
collections: SelectionReadOnlyRequest[] = [];
|
||||
}
|
||||
5
common/src/models/request/iapCheckRequest.ts
Normal file
5
common/src/models/request/iapCheckRequest.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { PaymentMethodType } from '../../enums/paymentMethodType';
|
||||
|
||||
export class IapCheckRequest {
|
||||
paymentMethodType: PaymentMethodType;
|
||||
}
|
||||
9
common/src/models/request/importCiphersRequest.ts
Normal file
9
common/src/models/request/importCiphersRequest.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { CipherRequest } from './cipherRequest';
|
||||
import { FolderRequest } from './folderRequest';
|
||||
import { KvpRequest } from './kvpRequest';
|
||||
|
||||
export class ImportCiphersRequest {
|
||||
ciphers: CipherRequest[] = [];
|
||||
folders: FolderRequest[] = [];
|
||||
folderRelationships: KvpRequest<number, number>[] = [];
|
||||
}
|
||||
9
common/src/models/request/importDirectoryRequest.ts
Normal file
9
common/src/models/request/importDirectoryRequest.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { ImportDirectoryRequestGroup } from './importDirectoryRequestGroup';
|
||||
import { ImportDirectoryRequestUser } from './importDirectoryRequestUser';
|
||||
|
||||
export class ImportDirectoryRequest {
|
||||
groups: ImportDirectoryRequestGroup[] = [];
|
||||
users: ImportDirectoryRequestUser[] = [];
|
||||
overwriteExisting = false;
|
||||
largeImport = false;
|
||||
}
|
||||
5
common/src/models/request/importDirectoryRequestGroup.ts
Normal file
5
common/src/models/request/importDirectoryRequestGroup.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export class ImportDirectoryRequestGroup {
|
||||
name: string;
|
||||
externalId: string;
|
||||
users: string[];
|
||||
}
|
||||
5
common/src/models/request/importDirectoryRequestUser.ts
Normal file
5
common/src/models/request/importDirectoryRequestUser.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export class ImportDirectoryRequestUser {
|
||||
externalId: string;
|
||||
email: string;
|
||||
deleted: boolean;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import { CipherRequest } from './cipherRequest';
|
||||
import { CollectionRequest } from './collectionRequest';
|
||||
import { KvpRequest } from './kvpRequest';
|
||||
|
||||
export class ImportOrganizationCiphersRequest {
|
||||
ciphers: CipherRequest[] = [];
|
||||
collections: CollectionRequest[] = [];
|
||||
collectionRelationships: KvpRequest<number, number>[] = [];
|
||||
}
|
||||
8
common/src/models/request/index.ts
Normal file
8
common/src/models/request/index.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
export { CipherRequest } from './cipherRequest';
|
||||
export { DeviceRequest } from './deviceRequest';
|
||||
export { DeviceTokenRequest } from './deviceTokenRequest';
|
||||
export { FolderRequest } from './folderRequest';
|
||||
export { PasswordHintRequest } from './passwordHintRequest';
|
||||
export { RegisterRequest } from './registerRequest';
|
||||
export { TokenRequest } from './tokenRequest';
|
||||
export { TwoFactorEmailRequest } from './twoFactorEmailRequest';
|
||||
8
common/src/models/request/kdfRequest.ts
Normal file
8
common/src/models/request/kdfRequest.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { PasswordRequest } from './passwordRequest';
|
||||
|
||||
import { KdfType } from '../../enums/kdfType';
|
||||
|
||||
export class KdfRequest extends PasswordRequest {
|
||||
kdf: KdfType;
|
||||
kdfIterations: number;
|
||||
}
|
||||
9
common/src/models/request/keysRequest.ts
Normal file
9
common/src/models/request/keysRequest.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export class KeysRequest {
|
||||
publicKey: string;
|
||||
encryptedPrivateKey: string;
|
||||
|
||||
constructor(publicKey: string, encryptedPrivateKey: string) {
|
||||
this.publicKey = publicKey;
|
||||
this.encryptedPrivateKey = encryptedPrivateKey;
|
||||
}
|
||||
}
|
||||
9
common/src/models/request/kvpRequest.ts
Normal file
9
common/src/models/request/kvpRequest.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export class KvpRequest<TK, TV> {
|
||||
key: TK;
|
||||
value: TV;
|
||||
|
||||
constructor(key: TK, value: TV) {
|
||||
this.key = key;
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
26
common/src/models/request/organizationCreateRequest.ts
Normal file
26
common/src/models/request/organizationCreateRequest.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { PaymentMethodType } from '../../enums/paymentMethodType';
|
||||
import { PlanType } from '../../enums/planType';
|
||||
|
||||
import { OrganizationKeysRequest } from './organizationKeysRequest';
|
||||
|
||||
export class OrganizationCreateRequest {
|
||||
name: string;
|
||||
businessName: string;
|
||||
billingEmail: string;
|
||||
planType: PlanType;
|
||||
key: string;
|
||||
keys: OrganizationKeysRequest;
|
||||
paymentMethodType: PaymentMethodType;
|
||||
paymentToken: string;
|
||||
additionalSeats: number;
|
||||
additionalStorageGb: number;
|
||||
premiumAccessAddon: boolean;
|
||||
collectionName: string;
|
||||
taxIdNumber: string;
|
||||
billingAddressLine1: string;
|
||||
billingAddressLine2: string;
|
||||
billingAddressCity: string;
|
||||
billingAddressState: string;
|
||||
billingAddressPostalCode: string;
|
||||
billingAddressCountry: string;
|
||||
}
|
||||
19
common/src/models/request/organizationImportGroupRequest.ts
Normal file
19
common/src/models/request/organizationImportGroupRequest.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { ImportDirectoryRequestGroup } from './importDirectoryRequestGroup';
|
||||
|
||||
export class OrganizationImportGroupRequest {
|
||||
name: string;
|
||||
externalId: string;
|
||||
memberExternalIds: string[];
|
||||
|
||||
constructor(model: Required<OrganizationImportGroupRequest> | ImportDirectoryRequestGroup) {
|
||||
this.name = model.name;
|
||||
this.externalId = model.externalId;
|
||||
|
||||
if (model instanceof ImportDirectoryRequestGroup) {
|
||||
this.memberExternalIds = model.users;
|
||||
}
|
||||
else {
|
||||
this.memberExternalIds = model.memberExternalIds;
|
||||
}
|
||||
}
|
||||
}
|
||||
13
common/src/models/request/organizationImportMemberRequest.ts
Normal file
13
common/src/models/request/organizationImportMemberRequest.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { ImportDirectoryRequestUser } from './importDirectoryRequestUser';
|
||||
|
||||
export class OrganizationImportMemberRequest {
|
||||
email: string;
|
||||
externalId: string;
|
||||
deleted: boolean;
|
||||
|
||||
constructor(model: Required<OrganizationImportMemberRequest> | ImportDirectoryRequestUser) {
|
||||
this.email = model.email;
|
||||
this.externalId = model.externalId;
|
||||
this.deleted = model.deleted;
|
||||
}
|
||||
}
|
||||
25
common/src/models/request/organizationImportRequest.ts
Normal file
25
common/src/models/request/organizationImportRequest.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { ImportDirectoryRequest } from './importDirectoryRequest';
|
||||
import { OrganizationImportGroupRequest } from './organizationImportGroupRequest';
|
||||
import { OrganizationImportMemberRequest } from './organizationImportMemberRequest';
|
||||
|
||||
export class OrganizationImportRequest {
|
||||
groups: OrganizationImportGroupRequest[] = [];
|
||||
members: OrganizationImportMemberRequest[] = [];
|
||||
overwriteExisting: boolean = false;
|
||||
largeImport: boolean = false;
|
||||
|
||||
constructor(model: {
|
||||
groups: Required<OrganizationImportGroupRequest>[],
|
||||
users: Required<OrganizationImportMemberRequest>[], overwriteExisting: boolean, largeImport: boolean;
|
||||
} | ImportDirectoryRequest) {
|
||||
if (model instanceof ImportDirectoryRequest) {
|
||||
this.groups = model.groups.map(g => new OrganizationImportGroupRequest(g));
|
||||
this.members = model.users.map(u => new OrganizationImportMemberRequest(u));
|
||||
} else {
|
||||
this.groups = model.groups.map(g => new OrganizationImportGroupRequest(g));
|
||||
this.members = model.users.map(u => new OrganizationImportMemberRequest(u));
|
||||
}
|
||||
this.overwriteExisting = model.overwriteExisting;
|
||||
this.largeImport = model.largeImport;
|
||||
}
|
||||
}
|
||||
7
common/src/models/request/organizationKeysRequest.ts
Normal file
7
common/src/models/request/organizationKeysRequest.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { KeysRequest } from './keysRequest';
|
||||
|
||||
export class OrganizationKeysRequest extends KeysRequest {
|
||||
constructor(publicKey: string, encryptedPrivateKey: string) {
|
||||
super(publicKey, encryptedPrivateKey);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import { TaxInfoUpdateRequest } from './taxInfoUpdateRequest';
|
||||
|
||||
export class OrganizationTaxInfoUpdateRequest extends TaxInfoUpdateRequest {
|
||||
taxId: string;
|
||||
line1: string;
|
||||
line2: string;
|
||||
city: string;
|
||||
state: string;
|
||||
}
|
||||
9
common/src/models/request/organizationUpdateRequest.ts
Normal file
9
common/src/models/request/organizationUpdateRequest.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { OrganizationKeysRequest } from './organizationKeysRequest';
|
||||
|
||||
export class OrganizationUpdateRequest {
|
||||
name: string;
|
||||
identifier: string;
|
||||
businessName: string;
|
||||
billingEmail: string;
|
||||
keys: OrganizationKeysRequest;
|
||||
}
|
||||
14
common/src/models/request/organizationUpgradeRequest.ts
Normal file
14
common/src/models/request/organizationUpgradeRequest.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { PlanType } from '../../enums/planType';
|
||||
|
||||
import { OrganizationKeysRequest } from './organizationKeysRequest';
|
||||
|
||||
export class OrganizationUpgradeRequest {
|
||||
businessName: string;
|
||||
planType: PlanType;
|
||||
additionalSeats: number;
|
||||
additionalStorageGb: number;
|
||||
premiumAccessAddon: boolean;
|
||||
billingAddressCountry: string;
|
||||
billingAddressPostalCode: string;
|
||||
keys: OrganizationKeysRequest;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export class OrganizationUserAcceptRequest {
|
||||
token: string;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
type OrganizationUserBulkRequestEntry = {
|
||||
id: string;
|
||||
key: string;
|
||||
};
|
||||
|
||||
export class OrganizationUserBulkConfirmRequest {
|
||||
keys: OrganizationUserBulkRequestEntry[];
|
||||
|
||||
constructor(keys: OrganizationUserBulkRequestEntry[]) {
|
||||
this.keys = keys;
|
||||
}
|
||||
}
|
||||
7
common/src/models/request/organizationUserBulkRequest.ts
Normal file
7
common/src/models/request/organizationUserBulkRequest.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export class OrganizationUserBulkRequest {
|
||||
ids: string[];
|
||||
|
||||
constructor(ids: string[]) {
|
||||
this.ids = ids == null ? [] : ids;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export class OrganizationUserConfirmRequest {
|
||||
key: string;
|
||||
}
|
||||
12
common/src/models/request/organizationUserInviteRequest.ts
Normal file
12
common/src/models/request/organizationUserInviteRequest.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { SelectionReadOnlyRequest } from './selectionReadOnlyRequest';
|
||||
|
||||
import { OrganizationUserType } from '../../enums/organizationUserType';
|
||||
import { PermissionsApi } from '../api/permissionsApi';
|
||||
|
||||
export class OrganizationUserInviteRequest {
|
||||
emails: string[] = [];
|
||||
type: OrganizationUserType;
|
||||
accessAll: boolean;
|
||||
collections: SelectionReadOnlyRequest[] = [];
|
||||
permissions: PermissionsApi;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export class OrganizationUserResetPasswordEnrollmentRequest {
|
||||
resetPasswordKey: string;
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
export class OrganizationUserResetPasswordRequest {
|
||||
newMasterPasswordHash: string;
|
||||
key: string;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export class OrganizationUserUpdateGroupsRequest {
|
||||
groupIds: string[] = [];
|
||||
}
|
||||
11
common/src/models/request/organizationUserUpdateRequest.ts
Normal file
11
common/src/models/request/organizationUserUpdateRequest.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { SelectionReadOnlyRequest } from './selectionReadOnlyRequest';
|
||||
|
||||
import { OrganizationUserType } from '../../enums/organizationUserType';
|
||||
import { PermissionsApi } from '../api/permissionsApi';
|
||||
|
||||
export class OrganizationUserUpdateRequest {
|
||||
type: OrganizationUserType;
|
||||
accessAll: boolean;
|
||||
collections: SelectionReadOnlyRequest[] = [];
|
||||
permissions: PermissionsApi;
|
||||
}
|
||||
7
common/src/models/request/passwordHintRequest.ts
Normal file
7
common/src/models/request/passwordHintRequest.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export class PasswordHintRequest {
|
||||
email: string;
|
||||
|
||||
constructor(email: string) {
|
||||
this.email = email;
|
||||
}
|
||||
}
|
||||
4
common/src/models/request/passwordHistoryRequest.ts
Normal file
4
common/src/models/request/passwordHistoryRequest.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export class PasswordHistoryRequest {
|
||||
password: string;
|
||||
lastUsedDate: Date;
|
||||
}
|
||||
6
common/src/models/request/passwordRequest.ts
Normal file
6
common/src/models/request/passwordRequest.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { PasswordVerificationRequest } from './passwordVerificationRequest';
|
||||
|
||||
export class PasswordRequest extends PasswordVerificationRequest {
|
||||
newMasterPasswordHash: string;
|
||||
key: string;
|
||||
}
|
||||
3
common/src/models/request/passwordVerificationRequest.ts
Normal file
3
common/src/models/request/passwordVerificationRequest.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export class PasswordVerificationRequest {
|
||||
masterPasswordHash: string;
|
||||
}
|
||||
7
common/src/models/request/paymentRequest.ts
Normal file
7
common/src/models/request/paymentRequest.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { PaymentMethodType } from '../../enums/paymentMethodType';
|
||||
import { OrganizationTaxInfoUpdateRequest } from '../request/organizationTaxInfoUpdateRequest';
|
||||
|
||||
export class PaymentRequest extends OrganizationTaxInfoUpdateRequest {
|
||||
paymentMethodType: PaymentMethodType;
|
||||
paymentToken: string;
|
||||
}
|
||||
7
common/src/models/request/policyRequest.ts
Normal file
7
common/src/models/request/policyRequest.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { PolicyType } from '../../enums/policyType';
|
||||
|
||||
export class PolicyRequest {
|
||||
type: PolicyType;
|
||||
enabled: boolean;
|
||||
data: any;
|
||||
}
|
||||
7
common/src/models/request/preloginRequest.ts
Normal file
7
common/src/models/request/preloginRequest.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export class PreloginRequest {
|
||||
email: string;
|
||||
|
||||
constructor(email: string) {
|
||||
this.email = email;
|
||||
}
|
||||
}
|
||||
5
common/src/models/request/referenceEventRequest.ts
Normal file
5
common/src/models/request/referenceEventRequest.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export class ReferenceEventRequest {
|
||||
id: string;
|
||||
layout: string;
|
||||
flow: string;
|
||||
}
|
||||
30
common/src/models/request/registerRequest.ts
Normal file
30
common/src/models/request/registerRequest.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { KeysRequest } from './keysRequest';
|
||||
import { ReferenceEventRequest } from './referenceEventRequest';
|
||||
|
||||
import { KdfType } from '../../enums/kdfType';
|
||||
|
||||
export class RegisterRequest {
|
||||
name: string;
|
||||
email: string;
|
||||
masterPasswordHash: string;
|
||||
masterPasswordHint: string;
|
||||
key: string;
|
||||
keys: KeysRequest;
|
||||
token: string;
|
||||
organizationUserId: string;
|
||||
kdf: KdfType;
|
||||
kdfIterations: number;
|
||||
referenceData: ReferenceEventRequest;
|
||||
|
||||
constructor(email: string, name: string, masterPasswordHash: string, masterPasswordHint: string, key: string,
|
||||
kdf: KdfType, kdfIterations: number, referenceData: ReferenceEventRequest) {
|
||||
this.name = name;
|
||||
this.email = email;
|
||||
this.masterPasswordHash = masterPasswordHash;
|
||||
this.masterPasswordHint = masterPasswordHint ? masterPasswordHint : null;
|
||||
this.key = key;
|
||||
this.kdf = kdf;
|
||||
this.kdfIterations = kdfIterations;
|
||||
this.referenceData = referenceData;
|
||||
}
|
||||
}
|
||||
3
common/src/models/request/seatRequest.ts
Normal file
3
common/src/models/request/seatRequest.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export class SeatRequest {
|
||||
seatAdjustment: number;
|
||||
}
|
||||
11
common/src/models/request/selectionReadOnlyRequest.ts
Normal file
11
common/src/models/request/selectionReadOnlyRequest.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
export class SelectionReadOnlyRequest {
|
||||
id: string;
|
||||
readOnly: boolean;
|
||||
hidePasswords: boolean;
|
||||
|
||||
constructor(id: string, readOnly: boolean, hidePasswords: boolean) {
|
||||
this.id = id;
|
||||
this.readOnly = readOnly;
|
||||
this.hidePasswords = hidePasswords;
|
||||
}
|
||||
}
|
||||
3
common/src/models/request/sendAccessRequest.ts
Normal file
3
common/src/models/request/sendAccessRequest.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export class SendAccessRequest {
|
||||
password: string;
|
||||
}
|
||||
50
common/src/models/request/sendRequest.ts
Normal file
50
common/src/models/request/sendRequest.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
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;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
13
common/src/models/request/setPasswordRequest.ts
Normal file
13
common/src/models/request/setPasswordRequest.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { KeysRequest } from './keysRequest';
|
||||
|
||||
import { KdfType } from '../../enums/kdfType';
|
||||
|
||||
export class SetPasswordRequest {
|
||||
masterPasswordHash: string;
|
||||
key: string;
|
||||
masterPasswordHint: string;
|
||||
keys: KeysRequest;
|
||||
kdf: KdfType;
|
||||
kdfIterations: number;
|
||||
orgIdentifier: string;
|
||||
}
|
||||
3
common/src/models/request/storageRequest.ts
Normal file
3
common/src/models/request/storageRequest.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export class StorageRequest {
|
||||
storageGbAdjustment: number;
|
||||
}
|
||||
4
common/src/models/request/taxInfoUpdateRequest.ts
Normal file
4
common/src/models/request/taxInfoUpdateRequest.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export class TaxInfoUpdateRequest {
|
||||
country: string;
|
||||
postalCode: string;
|
||||
}
|
||||
82
common/src/models/request/tokenRequest.ts
Normal file
82
common/src/models/request/tokenRequest.ts
Normal file
@@ -0,0 +1,82 @@
|
||||
import { TwoFactorProviderType } from '../../enums/twoFactorProviderType';
|
||||
|
||||
import { DeviceRequest } from './deviceRequest';
|
||||
|
||||
export class TokenRequest {
|
||||
email: string;
|
||||
masterPasswordHash: string;
|
||||
code: string;
|
||||
codeVerifier: string;
|
||||
redirectUri: string;
|
||||
clientId: string;
|
||||
clientSecret: string;
|
||||
token: string;
|
||||
provider: TwoFactorProviderType;
|
||||
remember: boolean;
|
||||
device?: DeviceRequest;
|
||||
|
||||
constructor(credentials: string[], codes: string[], clientIdClientSecret: string[], provider: TwoFactorProviderType,
|
||||
token: string, remember: boolean, device?: DeviceRequest) {
|
||||
if (credentials != null && credentials.length > 1) {
|
||||
this.email = credentials[0];
|
||||
this.masterPasswordHash = credentials[1];
|
||||
} else if (codes != null && codes.length > 2) {
|
||||
this.code = codes[0];
|
||||
this.codeVerifier = codes[1];
|
||||
this.redirectUri = codes[2];
|
||||
} else if (clientIdClientSecret != null && clientIdClientSecret.length > 1) {
|
||||
this.clientId = clientIdClientSecret[0];
|
||||
this.clientSecret = clientIdClientSecret[1];
|
||||
}
|
||||
this.token = token;
|
||||
this.provider = provider;
|
||||
this.remember = remember;
|
||||
this.device = device != null ? device : null;
|
||||
}
|
||||
|
||||
toIdentityToken(clientId: string) {
|
||||
const obj: any = {
|
||||
scope: 'api offline_access',
|
||||
client_id: clientId,
|
||||
};
|
||||
|
||||
if (this.clientSecret != null) {
|
||||
obj.scope = clientId.startsWith('organization') ? 'api.organization' : 'api';
|
||||
obj.grant_type = 'client_credentials';
|
||||
obj.client_secret = this.clientSecret;
|
||||
} else if (this.masterPasswordHash != null && this.email != null) {
|
||||
obj.grant_type = 'password';
|
||||
obj.username = this.email;
|
||||
obj.password = this.masterPasswordHash;
|
||||
} else if (this.code != null && this.codeVerifier != null && this.redirectUri != null) {
|
||||
obj.grant_type = 'authorization_code';
|
||||
obj.code = this.code;
|
||||
obj.code_verifier = this.codeVerifier;
|
||||
obj.redirect_uri = this.redirectUri;
|
||||
} else {
|
||||
throw new Error('must provide credentials or codes');
|
||||
}
|
||||
|
||||
if (this.device) {
|
||||
obj.deviceType = this.device.type;
|
||||
obj.deviceIdentifier = this.device.identifier;
|
||||
obj.deviceName = this.device.name;
|
||||
// no push tokens for browser apps yet
|
||||
// obj.devicePushToken = this.device.pushToken;
|
||||
}
|
||||
|
||||
if (this.token && this.provider != null) {
|
||||
obj.twoFactorToken = this.token;
|
||||
obj.twoFactorProvider = this.provider;
|
||||
obj.twoFactorRemember = this.remember ? '1' : '0';
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
alterIdentityTokenHeaders(headers: Headers) {
|
||||
if (this.clientSecret == null && this.masterPasswordHash != null && this.email != null) {
|
||||
headers.set('Auth-Email', this.email);
|
||||
}
|
||||
}
|
||||
}
|
||||
11
common/src/models/request/twoFactorEmailRequest.ts
Normal file
11
common/src/models/request/twoFactorEmailRequest.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { PasswordVerificationRequest } from './passwordVerificationRequest';
|
||||
|
||||
export class TwoFactorEmailRequest extends PasswordVerificationRequest {
|
||||
email: string;
|
||||
|
||||
constructor(email: string, masterPasswordHash: string) {
|
||||
super();
|
||||
this.masterPasswordHash = masterPasswordHash;
|
||||
this.email = email;
|
||||
}
|
||||
}
|
||||
7
common/src/models/request/twoFactorProviderRequest.ts
Normal file
7
common/src/models/request/twoFactorProviderRequest.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { PasswordVerificationRequest } from './passwordVerificationRequest';
|
||||
|
||||
import { TwoFactorProviderType } from '../../enums/twoFactorProviderType';
|
||||
|
||||
export class TwoFactorProviderRequest extends PasswordVerificationRequest {
|
||||
type: TwoFactorProviderType;
|
||||
}
|
||||
6
common/src/models/request/twoFactorRecoveryRequest.ts
Normal file
6
common/src/models/request/twoFactorRecoveryRequest.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { PasswordVerificationRequest } from './passwordVerificationRequest';
|
||||
|
||||
export class TwoFactorRecoveryRequest extends PasswordVerificationRequest {
|
||||
recoveryCode: string;
|
||||
email: string;
|
||||
}
|
||||
4
common/src/models/request/updateDomainsRequest.ts
Normal file
4
common/src/models/request/updateDomainsRequest.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export class UpdateDomainsRequest {
|
||||
equivalentDomains: string[][];
|
||||
excludedGlobalEquivalentDomains: number[];
|
||||
}
|
||||
10
common/src/models/request/updateKeyRequest.ts
Normal file
10
common/src/models/request/updateKeyRequest.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { CipherWithIdRequest } from './cipherWithIdRequest';
|
||||
import { FolderWithIdRequest } from './folderWithIdRequest';
|
||||
|
||||
export class UpdateKeyRequest {
|
||||
ciphers: CipherWithIdRequest[] = [];
|
||||
folders: FolderWithIdRequest[] = [];
|
||||
masterPasswordHash: string;
|
||||
privateKey: string;
|
||||
key: string;
|
||||
}
|
||||
10
common/src/models/request/updateProfileRequest.ts
Normal file
10
common/src/models/request/updateProfileRequest.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
export class UpdateProfileRequest {
|
||||
name: string;
|
||||
masterPasswordHint: string;
|
||||
culture = 'en-US'; // deprecated
|
||||
|
||||
constructor(name: string, masterPasswordHint: string) {
|
||||
this.name = name;
|
||||
this.masterPasswordHint = masterPasswordHint ? masterPasswordHint : null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import { PasswordVerificationRequest } from './passwordVerificationRequest';
|
||||
|
||||
export class UpdateTwoFactorAuthenticatorRequest extends PasswordVerificationRequest {
|
||||
token: string;
|
||||
key: string;
|
||||
}
|
||||
7
common/src/models/request/updateTwoFactorDuoRequest.ts
Normal file
7
common/src/models/request/updateTwoFactorDuoRequest.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { PasswordVerificationRequest } from './passwordVerificationRequest';
|
||||
|
||||
export class UpdateTwoFactorDuoRequest extends PasswordVerificationRequest {
|
||||
integrationKey: string;
|
||||
secretKey: string;
|
||||
host: string;
|
||||
}
|
||||
6
common/src/models/request/updateTwoFactorEmailRequest.ts
Normal file
6
common/src/models/request/updateTwoFactorEmailRequest.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { PasswordVerificationRequest } from './passwordVerificationRequest';
|
||||
|
||||
export class UpdateTwoFactorEmailRequest extends PasswordVerificationRequest {
|
||||
token: string;
|
||||
email: string;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import { PasswordVerificationRequest } from './passwordVerificationRequest';
|
||||
|
||||
export class UpdateTwoFactorWebAuthnDeleteRequest extends PasswordVerificationRequest {
|
||||
id: number;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import { PasswordVerificationRequest } from './passwordVerificationRequest';
|
||||
|
||||
export class UpdateTwoFactorWebAuthnRequest extends PasswordVerificationRequest {
|
||||
deviceResponse: PublicKeyCredential;
|
||||
name: string;
|
||||
id: number;
|
||||
}
|
||||
10
common/src/models/request/updateTwoFactorYubioOtpRequest.ts
Normal file
10
common/src/models/request/updateTwoFactorYubioOtpRequest.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { PasswordVerificationRequest } from './passwordVerificationRequest';
|
||||
|
||||
export class UpdateTwoFactorYubioOtpRequest extends PasswordVerificationRequest {
|
||||
key1: string;
|
||||
key2: string;
|
||||
key3: string;
|
||||
key4: string;
|
||||
key5: string;
|
||||
nfc: boolean;
|
||||
}
|
||||
4
common/src/models/request/verifyBankRequest.ts
Normal file
4
common/src/models/request/verifyBankRequest.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export class VerifyBankRequest {
|
||||
amount1: number;
|
||||
amount2: number;
|
||||
}
|
||||
9
common/src/models/request/verifyDeleteRecoverRequest.ts
Normal file
9
common/src/models/request/verifyDeleteRecoverRequest.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export class VerifyDeleteRecoverRequest {
|
||||
userId: string;
|
||||
token: string;
|
||||
|
||||
constructor(userId: string, token: string) {
|
||||
this.userId = userId;
|
||||
this.token = token;
|
||||
}
|
||||
}
|
||||
9
common/src/models/request/verifyEmailRequest.ts
Normal file
9
common/src/models/request/verifyEmailRequest.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export class VerifyEmailRequest {
|
||||
userId: string;
|
||||
token: string;
|
||||
|
||||
constructor(userId: string, token: string) {
|
||||
this.userId = userId;
|
||||
this.token = token;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user