1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-19 09:43:23 +00:00

api support for sharing

This commit is contained in:
Kyle Spearrin
2018-06-12 11:45:02 -04:00
parent 5db55496c2
commit b3f71ed8e4
27 changed files with 371 additions and 12 deletions

View File

@@ -7,7 +7,10 @@ export class AttachmentData {
size: number;
sizeName: string;
constructor(response: AttachmentResponse) {
constructor(response?: AttachmentResponse) {
if (response == null) {
return;
}
this.id = response.id;
this.url = response.url;
this.fileName = response.fileName;

View File

@@ -8,7 +8,11 @@ export class CardData {
expYear: string;
code: string;
constructor(data: CardApi) {
constructor(data?: CardApi) {
if (data == null) {
return;
}
this.cardholderName = data.cardholderName;
this.brand = data.brand;
this.number = data.number;

View File

@@ -17,7 +17,7 @@ export class CipherData {
edit: boolean;
organizationUseTotp: boolean;
favorite: boolean;
revisionDate: string;
revisionDate: Date;
type: CipherType;
sizeName: string;
name: string;
@@ -30,7 +30,11 @@ export class CipherData {
attachments?: AttachmentData[];
collectionIds?: string[];
constructor(response: CipherResponse, userId: string, collectionIds?: string[]) {
constructor(response?: CipherResponse, userId?: string, collectionIds?: string[]) {
if (response == null) {
return;
}
this.id = response.id;
this.organizationId = response.organizationId;
this.folderId = response.folderId;

View File

@@ -7,7 +7,10 @@ export class FieldData {
name: string;
value: string;
constructor(response: FieldApi) {
constructor(response?: FieldApi) {
if (response == null) {
return;
}
this.type = response.type;
this.name = response.name;
this.value = response.value;

View File

@@ -20,7 +20,11 @@ export class IdentityData {
passportNumber: string;
licenseNumber: string;
constructor(data: IdentityApi) {
constructor(data?: IdentityApi) {
if (data == null) {
return;
}
this.title = data.title;
this.firstName = data.firstName;
this.middleName = data.middleName;

View File

@@ -9,7 +9,11 @@ export class LoginData {
password: string;
totp: string;
constructor(data: LoginApi) {
constructor(data?: LoginApi) {
if (data == null) {
return;
}
this.username = data.username;
this.password = data.password;
this.totp = data.totp;

View File

@@ -6,7 +6,10 @@ export class LoginUriData {
uri: string;
match: UriMatchType = null;
constructor(data: LoginUriApi) {
constructor(data?: LoginUriApi) {
if (data == null) {
return;
}
this.uri = data.uri;
this.match = data.match;
}

View File

@@ -5,7 +5,11 @@ import { SecureNoteApi } from '../api/secureNoteApi';
export class SecureNoteData {
type: SecureNoteType;
constructor(data: SecureNoteApi) {
constructor(data?: SecureNoteApi) {
if (data == null) {
return;
}
this.type = data.type;
}
}