add missing types to models

This commit is contained in:
Kyle Spearrin 2017-11-13 16:21:45 -05:00
parent bed28aebaa
commit 4664c783f2
5 changed files with 17 additions and 7 deletions

View File

@ -1,5 +1,7 @@
import { FieldType } from '../../enums/fieldType.enum';
class FieldData {
type: number; // TODO: enum
type: FieldType;
name: string;
value: string;

View File

@ -1,5 +1,7 @@
import { SecureNoteType } from '../../enums/secureNoteType.enum';
class SecureNoteData {
type: number; // TODO: enum
type: SecureNoteType;
constructor(data: any) {
this.type = data.Type;

View File

@ -1,7 +1,9 @@
import { Folder } from '../domain/folder';
class FolderRequest {
name: string;
constructor(folder: any) { // TODO: folder type
constructor(folder: Folder) {
this.name = folder.name ? folder.name.encryptedString : null;
}
}

View File

@ -1,19 +1,21 @@
import { DeviceRequest } from './deviceRequest';
class TokenRequest {
email: string;
masterPasswordHash: string;
token: string;
provider: number;
remember: boolean;
device?: any;
device?: DeviceRequest;
constructor(email: string, masterPasswordHash: string, provider: number,
token: string, remember: boolean, device?: any) {
token: string, remember: boolean, device?: DeviceRequest) {
this.email = email;
this.masterPasswordHash = masterPasswordHash;
this.token = token;
this.provider = provider;
this.remember = remember;
this.device = device ? device : null;
this.device = device != null ? device : null;
}
toIdentityToken() {

View File

@ -1,8 +1,10 @@
import { BrowserType } from '../../enums/browserType.enum';
class DeviceResponse {
id: string;
name: number;
identifier: string;
type: number; // TODO: Convert to enum
type: BrowserType;
creationDate: string;
constructor(response: any) {