From 4664c783f2d652722f5760ba48360d9c48ba4c54 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 13 Nov 2017 16:21:45 -0500 Subject: [PATCH] add missing types to models --- src/models/data/fieldData.ts | 4 +++- src/models/data/secureNoteData.ts | 4 +++- src/models/request/folderRequest.ts | 4 +++- src/models/request/tokenRequest.ts | 8 +++++--- src/models/response/deviceResponse.ts | 4 +++- 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/models/data/fieldData.ts b/src/models/data/fieldData.ts index 5349b85250..4914bb6ef9 100644 --- a/src/models/data/fieldData.ts +++ b/src/models/data/fieldData.ts @@ -1,5 +1,7 @@ +import { FieldType } from '../../enums/fieldType.enum'; + class FieldData { - type: number; // TODO: enum + type: FieldType; name: string; value: string; diff --git a/src/models/data/secureNoteData.ts b/src/models/data/secureNoteData.ts index 70e55800c3..ccfc9bd614 100644 --- a/src/models/data/secureNoteData.ts +++ b/src/models/data/secureNoteData.ts @@ -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; diff --git a/src/models/request/folderRequest.ts b/src/models/request/folderRequest.ts index f9362b7306..7ff9794b18 100644 --- a/src/models/request/folderRequest.ts +++ b/src/models/request/folderRequest.ts @@ -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; } } diff --git a/src/models/request/tokenRequest.ts b/src/models/request/tokenRequest.ts index 084652126b..d67facd81a 100644 --- a/src/models/request/tokenRequest.ts +++ b/src/models/request/tokenRequest.ts @@ -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() { diff --git a/src/models/response/deviceResponse.ts b/src/models/response/deviceResponse.ts index 3491df3b28..63f69fe3b3 100644 --- a/src/models/response/deviceResponse.ts +++ b/src/models/response/deviceResponse.ts @@ -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) {