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:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user